public interface ConvergenceNameSessionOwnershipRecord
The ConvergenceNameSessionOwnershipRecord
interface represents a Rhino-managed session ownership record that is related to an SBB entity tree.
Rhino will manage this session ownership record using the Session Ownership Facility on behalf of the SBB Entity Tree.
This means that applications do not need to create, update, or store the record directly themselves, they simply ask for the record and modify attributes on it in a CMP-style fashion as desired.
Modifications to the underlying record will be stored automatically by Rhino during transaction commit.
The record will be automatically deleted when the SBB entity tree is removed.
A convergence name session ownership record may be obtained by application code using RhinoSbbContext.getConvergenceNameSessionOwnershipRecord()
or SbbPartContext.getConvergenceNameSessionOwnershipRecord()
.
Record Continuity
Rhino will use the TTL of a convergence name session ownership record to determine if and when a record needs refreshing to ensure its continued survival for the lifetime of the SBB entity.
However, such checks are only made after an SBB entity tree processes an event.
This means that an application should set the TTL of this record to a value greater than the maximum expected time between received events.
Attributes
The methods in this interface that provide a means to access and modify attributes on the session ownership record operate on a subset of the real session ownership attributes specifically for application use.
An application can only read, modify, or remove attributes that it creates.
Other attributes, such as those set by Rhino for managing the record, are not visible to applications using this interface.
Modifier and Type | Method and Description |
---|---|
String |
getAttribute(String name)
Get the value of the specified application-defined attribute from the record.
|
Map<String,String> |
getAttributes()
Get a map of all application-defined attributes and their values in the record.
|
ConvergenceName |
getConvergenceName()
Get the convergence name of the SBB entity tree that this session ownership record was created for.
|
String |
getPrimaryKey()
Get the primary key of this session ownership record.
|
long |
getTimeToLive()
Get the current time-to-live (TTL) period for the underlying session ownership record.
|
boolean |
removeAttribute(String name)
Remove an application-defined attribute.
|
void |
setAttribute(String name,
String value)
Set an application-defined attribute on the record.
|
void |
setAttributes(Map<String,String> attributes,
boolean exclusive)
Set application-defined attributes on the record.
|
void |
setTimeToLive(int ttl)
Set a new time-to-live (TTL) period for the underlying session ownership record.
|
String getPrimaryKey()
Get the primary key of this session ownership record.
ConvergenceName getConvergenceName()
Get the convergence name of the SBB entity tree that this session ownership record was created for.
Map<String,String> getAttributes()
Get a map of all application-defined attributes and their values in the record.
Modifications to the map returned from this method have no effect on the record the map was returned from.
String getAttribute(String name)
Get the value of the specified application-defined attribute from the record.
name
- the attribute name.null
if no such attribute exists.void setAttributes(Map<String,String> attributes, boolean exclusive) throws NullPointerException
Set application-defined attributes on the record.
If exclusive
is true
, then current set of application-defined attributes in the record will be removed and replaced by the map of attributes provided.
If exclusive
is `false, then the specified map of attributes will be set in the record, but any existing attributes in the record that do not occur in the specified map will be left untouched.
attributes
- the application-defined attributes to set.exclusive
- determines if existing attributes are deleted and replaced (true
) or a union updates occurs (false
).NullPointerException
- if attributes
contains null keys or values.void setAttribute(String name, String value) throws NullPointerException
Set an application-defined attribute on the record.
name
- the name of the attribute.value
- the attribute’s value.NullPointerException
- if either argument is null
.boolean removeAttribute(String name)
Remove an application-defined attribute.
name
- the name of the attribute.true
if the attribute was removed, false
if an attribute with the specified name did not exist.long getTimeToLive()
Get the current time-to-live (TTL) period for the underlying session ownership record.
void setTimeToLive(int ttl) throws IllegalArgumentException
Set a new time-to-live (TTL) period for the underlying session ownership record.
Changing the TTL period affects when Rhino may automatically refresh the underlying record to ensure its continued survival.
ttl
- the minimum duration, in milliseconds, for which the session ownership record should be kept, provided the corresponding SBB entity tree is not removed.IllegalArgumentException
- if ttl
is not a positive number.