Class ACMSeamlessSessionMaps


  • public class ACMSeamlessSessionMaps
    extends java.lang.Object
    ACMSeamlessSessionMaps keeps track of remote sessions that were used to create new sessions locally. In the Seamless Login workflow, the remote side may invoke the seamless workflow multiple times using the same underlying IServer session. In this case, we do not want to create new sessions locally every time. We should recognize when a session is being used again and hook it up with the Master Session Id we had created the first time.
    • Constructor Detail

      • ACMSeamlessSessionMaps

        public ACMSeamlessSessionMaps()
    • Method Detail

      • start

        public IDSSXMLSessionId.IMasterSessionId start​(IDSSXMLSessionId iRemoteSessionId)
                                                throws MSTRWebAPIException
        start will retrieve an existing MasterSessionId associated with the RemoteSessionId. If the MasterSessionId does not exist start will return and the caller is responsible for creating the MasterSessionId If the MasterSessionId does already exist, then the caller should use the found MasterSessionId If another thread is busy creating this MasterSessionId, then start will block until the other thread finishes. The other thread may finish successfully or fail. If success, the caller should use the found MasterSessionId. If fail, the caller may choose to retry creating the MasterSessionId
        Parameters:
        iRemoteSessionId -
        Returns:
        Throws:
        MSTRWebAPIException
      • finishSuccess

        public void finishSuccess​(IDSSXMLSessionId iRemoteSessionId,
                                  IDSSXMLSessionId.IMasterSessionId iLocalMasterSessionId)
        finishSuccess will insert the master session id keyed by the remote session id into the map for other threads and calls to use. When the data is ready it will notify any waiting threads
        Parameters:
        iRemoteSessionId -
        iLocalMasterSessionId -
      • finishFail

        public void finishFail​(IDSSXMLSessionId iRemoteSessionId)
        finishFail will remove the remote session id from the map. It will then notify any waiting threads
        Parameters:
        iRemoteSessionId -
      • remove

        public void remove​(IDSSXMLSessionId.IMasterSessionId iLocalMasterSessionId)
        remove will remove all remote sessions in the map that point to this master session id
        Parameters:
        iLocalMasterSessionId -
      • remove

        public void remove​(IDSSXMLSessionId iRemoteSessionId)
        remove will remove this remote session from the map. Any other remote sessions in the map that correspond to this master session will remain in the map!
        Parameters:
        iRemoteSessionId -
      • getSeamlessSessions

        public java.util.Map<IDSSXMLSessionId,​IDSSXMLSessionId.IMasterSessionId> getSeamlessSessions()
        getSeamlessSessions returns the map. It will copy the entire contents of the map in O(n). This method is intended only for logging.
        Returns: