Interface SessionOwnershipActivity


  • public interface SessionOwnershipActivity

    The Session Ownership Activity is the activity type on which the Session Ownership resource adaptor fires session ownership operation result events.

    Since Rhino 3.0.0, Session Ownership Activities will implicitly end in the SLEE if they are unreferenced by SBB entities, SLEE facilities, etc (i.e in the same way that Null Activities can implicitly end). An SBB must attach to a Session Ownership Activity or create a reference to it elsewhere, for example by using the Activity Context Naming Facility to bind it to a name if it wishes to keep the activity alive. Session Ownership Activities can still of course still be ended explicitly by using the endActivity() method.

    Since:
    Rhino 2.6.1
    • Method Detail

      • storeRecord

        long storeRecord​(SessionOwnershipRecord sessionOwnershipRecord)
                  throws NullPointerException

        Asynchronously attempt to write a session ownership record into the session ownership store. The write will blindly overwrite anything already stored against the specified record’s primary key and additional keys. If the write is successful, the TTL of the record will set with the default TTL of the session ownership store configured for the platform.

        Parameters:
        sessionOwnershipRecord - the record to store.
        Returns:
        an identifier for this query. This identifier is included in the subsequent SessionOwnershipWriteResultEvent fired on this activity so that the SBB can match the result event to the query it relates to.
        Throws:
        NullPointerException - if sessionOwnershipRecord is null.
        Since:
        Rhino 2.6.1
      • storeRecord

        long storeRecord​(SessionOwnershipRecord sessionOwnershipRecord,
                         long ttl)
                  throws NullPointerException

        Asynchronously attempt to write a session ownership record into the session ownership store. The write will blindly overwrite anything already stored against the specified record’s primary key and additional keys. If the write is successful, the TTL of the record will set to the specified value.

        Parameters:
        sessionOwnershipRecord - the record to store.
        ttl - the duration, in milliseconds, for which the session ownership store should keep the new record.
        Returns:
        an identifier for this query. This identifier is included in the subsequent SessionOwnershipWriteResultEvent fired on this activity so that the SBB can match the result event to the query it relates to.
        Throws:
        NullPointerException - if sessionOwnershipRecord is null.
        Since:
        Rhino 2.6.1
      • storeRecordWithCASCreateOnly

        long storeRecordWithCASCreateOnly​(SessionOwnershipRecord sessionOwnershipRecord)
                                   throws NullPointerException

        Asynchronously attempt to write a session ownership record into the session ownership store. The write will only be successful if there is no record already stored with the same primary key as that of the specified record. If the write is successful, the TTL of the record will set with the default TTL of the session ownership store configured for the platform.

        Parameters:
        sessionOwnershipRecord - the record to store.
        Returns:
        an identifier for this query. This identifier is included in the subsequent SessionOwnershipWriteResultEvent fired on this activity so that the SBB can match the result event to the query it relates to.
        Throws:
        NullPointerException - if sessionOwnershipRecord is null.
        Since:
        Rhino 2.6.1
      • storeRecordWithCASCreateOnly

        long storeRecordWithCASCreateOnly​(SessionOwnershipRecord sessionOwnershipRecord,
                                          long ttl)
                                   throws NullPointerException

        Asynchronously attempt to write a session ownership record into the session ownership store. The write will only be successful if there is no record already stored with the same primary key as that of the specified record. If the write is successful, the TTL of the record will set to the specified value.

        Parameters:
        sessionOwnershipRecord - the record to store.
        ttl - the duration, in milliseconds, for which the session ownership store should keep the new record.
        Returns:
        an identifier for this query. This identifier is included in the subsequent SessionOwnershipWriteResultEvent fired on this activity so that the SBB can match the result event to the query it relates to.
        Throws:
        NullPointerException - if sessionOwnershipRecord is null.
        Since:
        Rhino 2.6.1
      • storeRecordWithCASCompareSequence

        long storeRecordWithCASCompareSequence​(int expectedStoredSequence,
                                               SessionOwnershipRecord sessionOwnershipRecord)
                                        throws NullPointerException

        Asynchronously attempt to write a session ownership record into the session ownership store. The write will only be successful if there already exists a session ownership record with the same primary key as the specified record and that record has a sequence number matching the specified expected sequence number. If the write is successful, the TTL of the record will set with the default TTL of the session ownership store configured for the platform.

        Parameters:
        expectedStoredSequence - the expected sequence number of the record currently stored that will be replaced.
        sessionOwnershipRecord - the updated record to store.
        Returns:
        an identifier for this query. This identifier is included in the subsequent SessionOwnershipWriteResultEvent fired on this activity so that the SBB can match the result event to the query it relates to.
        Throws:
        NullPointerException - if sessionOwnershipRecord is null.
        Since:
        Rhino 2.6.1
      • storeRecordWithCASCompareSequence

        long storeRecordWithCASCompareSequence​(int expectedStoredSequence,
                                               SessionOwnershipRecord sessionOwnershipRecord,
                                               long ttl)
                                        throws NullPointerException

        Asynchronously attempt to write a session ownership record into the session ownership store. The write will only be successful if there already exists a session ownership record with the same primary key as the specified record and that record has a sequence number matching the specified expected sequence number. If the write is successful, the TTL of the record will set to the specified value.

        Parameters:
        expectedStoredSequence - the expected sequence number of the record currently stored that will be replaced.
        sessionOwnershipRecord - the updated record to store.
        Returns:
        an identifier for this query. This identifier is included in the subsequent SessionOwnershipWriteResultEvent fired on this activity so that the SBB can match the result event to the query it relates to.
        Throws:
        NullPointerException - if sessionOwnershipRecord is null.
        Since:
        Rhino 2.6.1
      • deleteRecord

        long deleteRecord​(String primaryKey,
                          Set<String> additionalKeys)
                   throws NullPointerException

        Asynchronously attempt to delete all the session ownership records identified by the specified primary key and additional keys. The caller must specify all additional keys, ie. the implementation will not do a lookup on primary key before deleting records. If an additional key is not provided, and a record with that key exists in the session ownership store, it will not be removed by this method.

        Parameters:
        primaryKey - the primary key of the session ownership record to be removed.
        additionalKeys - the additional keys to remove.
        Returns:
        an identifier for this query. This identifier is included in the subsequent SessionOwnershipWriteResultEvent fired on this activity so that the SBB can match the result event to the query it relates to.
        Throws:
        NullPointerException - if either argument is null.
        Since:
        Rhino 2.6.1
      • deleteRecordWithCASCompareSequence

        long deleteRecordWithCASCompareSequence​(int expectedStoredSequence,
                                                String primaryKey,
                                                Set<String> additionalKeys)
                                         throws NullPointerException

        Asynchronously attempt to delete all the session ownership records identified by the specified primary key and additional keys. The delete will only occur if there already exists a session ownership record with the same primary key as the specified record and that record has a sequence number matching the specified expected sequence number. The caller must specify all additional keys, ie. the implementation will not do a lookup on primary key before deleting records. If an additional key is not provided, and a record with that key exists in the session ownership store, it will not be removed by this method.

        Parameters:
        expectedStoredSequence - the expected sequence number of the record currently stored to be removed.
        primaryKey - the primary key of the session ownership record to be removed.
        additionalKeys - the additional keys to remove.
        Returns:
        an identifier for this query. This identifier is included in the subsequent SessionOwnershipWriteResultEvent fired on this activity so that the SBB can match the result event to the query it relates to.
        Throws:
        NullPointerException - if primaryKey or additionalKeys is null.
        Since:
        Rhino 2.6.1
      • retrieveRecord

        long retrieveRecord​(String primaryKey)
                     throws NullPointerException

        Asynchronously attempt to retrieve the session ownership record with the specified primary key.

        Parameters:
        primaryKey - the primary key of the session ownership record to retrieve.
        Returns:
        an identifier for this query. This identifier is included in the subsequent SessionOwnershipReadResultEvent fired on this activity so that the SBB can match the result event to the query it relates to.
        Throws:
        NullPointerException - if primaryKey is null.
        Since:
        Rhino 2.6.1
      • retrieveRecordsByAdditionalKey

        long retrieveRecordsByAdditionalKey​(String additionalKey)
                                     throws NullPointerException

        Asynchronously attempt to retrieve all session ownership records with the specified additional key.

        Parameters:
        additionalKey - the additional key of the session ownership records to retrieve.
        Returns:
        an identifier for this query. This identifier is included in the subsequent SessionOwnershipReadResultEvent fired on this activity so that the SBB can match the result event to the query it relates to.
        Throws:
        NullPointerException - if additionalKey is null.
        Since:
        Rhino 2.6.1
      • queryInProgress

        boolean queryInProgress()

        Determine if an asynchronous query operation is still in progress on this activity. The query operations are the store, delete, and retrieve operations defined in this interface.

        Returns:
        true if a query operation is still in progress, false otherwise.
        Since:
        Rhino 2.6.1
      • endActivity

        void endActivity()

        Request that this session ownership activity be ended. Since Rhino 3.0.0 Session Ownership Activities will also be implicitly ended by the SLEE if unreferenced.

        Since:
        Rhino 2.6.1
      • hasEnded

        boolean hasEnded()

        Determine if a request has been made to end this session ownership activity.

        Returns:
        true if the activity has been ended
        Since:
        Rhino 2.6.1