public final class SessionOwnershipRecord extends Object implements com.opencloud.util.FastSerializable
A Session Owner Record represents data for a single session stored by the session ownership facility.
A Session Ownership Record is immutable.
A SessionOwnershipRecord.Builder
is used to create a new Session Ownership Record.
Calling the static method newBuilder()
will create a builder with fields initialised with empty data and a sequence number of 0.
Calling toBuilder()
on an existing SessionOwnershipRecord
instance will create a builder with fields initialised to match the original record but with the sequence number incremented by one.
Session Ownership Records may contain attributes. Application and Resource Adaptor logic may use their own attribute names and values. Organisations should use the "reverse domain name notation" approach for naming their own attributes, to avoid clashing with other components that also use Session Ownership
In order to avoid clashing with established attribute name and values used by both Rhino and various Resource Adaptors it is recommended to avoid using attribute names that begin with "com.metaswitch.rhino".
Modifier and Type | Class and Description |
---|---|
static class |
SessionOwnershipRecord.Builder
Builder of Session Ownership Records.
|
Modifier and Type | Field and Description |
---|---|
static String |
ASSOCIATED_RECORD_ATTRIBUTE_NAME
This attribute is used to allow a one way linking of one session ownership record to another.
|
static String |
CLUSTER_VIEW_ID_ATTRIBUTE_NAME
This attribute is used to store Rhino’s cluster view ID.
|
Constructor and Description |
---|
SessionOwnershipRecord(DataInput stream)
Constructor used for deserialising a Session Ownership Record from a stream.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Set<String> |
getAdditionalKeys()
Get the additional keys of this Session Ownership Record.
|
String |
getAttribute(String name)
Get the value of the Session Ownership Record attribute with the specified name.
|
Map<String,String> |
getAttributes()
Get a map of attribute name to attribute value for all attributes stored with this Session Ownership Record.
|
Set<String> |
getAttributesNames()
Get the set of names of the attributes stored with this Session Ownership Record.
|
Set<String> |
getOwnerUris()
Deprecated.
use
getOwnerURIs() instead. |
Set<String> |
getOwnerURIs()
Get the URIs for the owner of this Session Ownership Record.
|
String |
getPrimaryKey()
Get the primary key of this Session Ownership Record.
|
int |
getSequenceNumber()
Get the sequence number of this Session Ownership Record.
|
int |
hashCode() |
static SessionOwnershipRecord.Builder |
newBuilder()
Create a new Session Ownership Record builder with fields initialised with empty data and a sequence number of 0.
|
SessionOwnershipRecord.Builder |
toBuilder()
Create a new builder with values initialised to match this record, however with the sequence number incremented by one.
|
void |
toStream(DataOutput stream)
Serialise this Session Ownership Record to the specified data output stream.
|
String |
toString() |
public static final String ASSOCIATED_RECORD_ATTRIBUTE_NAME
This attribute is used to allow a one way linking of one session ownership record to another.
public static final String CLUSTER_VIEW_ID_ATTRIBUTE_NAME
This attribute is used to store Rhino’s cluster view ID.
public SessionOwnershipRecord(DataInput stream) throws IOException
Constructor used for deserialising a Session Ownership Record from a stream.
This method is provided only to fulfill the requirements FastSerializable
contract and should not be used for general purpose.
A SessionOwnershipRecord.Builder
should be used to create new Session Ownership Records.
IOException
public static SessionOwnershipRecord.Builder newBuilder()
Create a new Session Ownership Record builder with fields initialised with empty data and a sequence number of 0.
public void toStream(DataOutput stream) throws IOException
Serialise this Session Ownership Record to the specified data output stream.
toStream
in interface com.opencloud.util.FastSerializable
IOException
public String getPrimaryKey()
Get the primary key of this Session Ownership Record.
public Set<String> getAdditionalKeys()
Get the additional keys of this Session Ownership Record.
public int getSequenceNumber()
Get the sequence number of this Session Ownership Record.
@Deprecated public Set<String> getOwnerUris()
getOwnerURIs()
instead.Get the URIs for the owner of this Session Ownership Record.
public Set<String> getOwnerURIs()
Get the URIs for the owner of this Session Ownership Record.
public String getAttribute(String name)
Get the value of the Session Ownership Record attribute with the specified name.
name
- the attribute name.null
if there is no such attribute.public Set<String> getAttributesNames()
Get the set of names of the attributes stored with this Session Ownership Record.
public Map<String,String> getAttributes()
Get a map of attribute name to attribute value for all attributes stored with this Session Ownership Record.
public SessionOwnershipRecord.Builder toBuilder()
Create a new builder with values initialised to match this record, however with the sequence number incremented by one.