Class SessionOwnershipRecord
- java.lang.Object
-
- com.opencloud.rhino.facilities.sessionownership.SessionOwnershipRecord
-
- All Implemented Interfaces:
com.opencloud.util.FastSerializable
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 methodnewBuilder()
will create a builder with fields initialised with empty data and a sequence number of 0. CallingtoBuilder()
on an existingSessionOwnershipRecord
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".
- Since:
- Rhino 2.6.1
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SessionOwnershipRecord.Builder
Builder of Session Ownership Records.
-
Field Summary
Fields Modifier and Type Field 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.static String
PARTITION_KEY_ATTRIBUTE_NAME
This attribute is used to store the partition key of the activity the session ownership record relates to (if any).
-
Constructor Summary
Constructors Constructor Description SessionOwnershipRecord(DataInput stream)
Constructor used for deserialising a Session Ownership Record from a stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method 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.usegetOwnerURIs()
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()
-
-
-
Field Detail
-
ASSOCIATED_RECORD_ATTRIBUTE_NAME
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.
- Since:
- Rhino 2.6.2
- See Also:
- Constant Field Values
-
CLUSTER_VIEW_ID_ATTRIBUTE_NAME
public static final String CLUSTER_VIEW_ID_ATTRIBUTE_NAME
This attribute is used to store Rhino’s cluster view ID.
- Since:
- Rhino 2.6.2
- See Also:
- Constant Field Values
-
PARTITION_KEY_ATTRIBUTE_NAME
public static final String PARTITION_KEY_ATTRIBUTE_NAME
This attribute is used to store the partition key of the activity the session ownership record relates to (if any).
- Since:
- Rhino 3.0.0
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SessionOwnershipRecord
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. ASessionOwnershipRecord.Builder
should be used to create new Session Ownership Records.- Throws:
IOException
-
-
Method Detail
-
newBuilder
public static SessionOwnershipRecord.Builder newBuilder()
Create a new Session Ownership Record builder with fields initialised with empty data and a sequence number of 0.
- Returns:
- a new builder.
- Since:
- Rhino 2.6.1
-
toStream
public void toStream(DataOutput stream) throws IOException
Serialise this Session Ownership Record to the specified data output stream.
- Specified by:
toStream
in interfacecom.opencloud.util.FastSerializable
- Throws:
IOException
-
getPrimaryKey
public String getPrimaryKey()
Get the primary key of this Session Ownership Record.
- Returns:
- the primary key.
- Since:
- Rhino 2.6.1
-
getAdditionalKeys
public Set<String> getAdditionalKeys()
Get the additional keys of this Session Ownership Record.
- Returns:
- a set of the additional keys for this record. The returned set is immutable.
- Since:
- Rhino 2.6.1
-
getSequenceNumber
public int getSequenceNumber()
Get the sequence number of this Session Ownership Record.
- Returns:
- the sequence number.
- Since:
- Rhino 2.6.1
-
getOwnerUris
@Deprecated public Set<String> getOwnerUris()
Deprecated.usegetOwnerURIs()
instead.Get the URIs for the owner of this Session Ownership Record.
- Returns:
- the set of URIs for the owner of the session represented by this record. The returned set is immutable.
- Since:
- Rhino 2.6.1
-
getOwnerURIs
public Set<String> getOwnerURIs()
Get the URIs for the owner of this Session Ownership Record.
- Returns:
- the set of URIs for the owner of the session represented by this record. The returned set is immutable.
- Since:
- Rhino 2.6.2
-
getAttribute
public String getAttribute(String name)
Get the value of the Session Ownership Record attribute with the specified name.
- Parameters:
name
- the attribute name.- Returns:
- the attribute value, or
null
if there is no such attribute. - Since:
- Rhino 2.6.1
-
getAttributesNames
public Set<String> getAttributesNames()
Get the set of names of the attributes stored with this Session Ownership Record.
- Returns:
- the set of attribute names. The returned set is immutable.
- Since:
- Rhino 2.6.1
-
getAttributes
public Map<String,String> getAttributes()
Get a map of attribute name to attribute value for all attributes stored with this Session Ownership Record.
- Returns:
- a map of attribute name to value. The returned map is immutable.
- Since:
- Rhino 2.6.1
-
toBuilder
public SessionOwnershipRecord.Builder toBuilder()
Create a new builder with values initialised to match this record, however with the sequence number incremented by one.
- Returns:
- the new builder.
- Since:
- Rhino 2.6.1
-
-