### *** This class provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.services.session

# Class SessionServiceProxy

java.lang.Object
com.sas.services.ServiceProxy
com.sas.services.session.SessionServiceProxy

All Implemented Interfaces:
  `com.sas.entities.EntityKeyInterface`, `ServiceNotificationBroadcasterInterface`, `QuiesceInterface`, `RemoteServiceInterface`, `SessionServiceInterface`, `Serializable`, `Remote`

@SASScope("ALL") @BinaryCompatibilityOnly public class SessionServiceProxy extends ServiceProxy implements SessionServiceInterface, Serializable
Session Service proxy. If this proxy is serialized to a remote process then the proxy will optimize calls to ensure that a local object reference is used where appropriate and that static data is cached locally to minimize remote calls.

Since:
  1.1
See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from interface com.sas.services.RemoteServiceInterface

  `CLASS_IDENTIFIER, CLASS_IDENTIFIER_1_1, CLASS_IDENTIFIER_1_2, CLASS_IDENTIFIER_SERVICE_TYPE, CLASS_IDENTIFIER_SERVICE_TYPE_1_1, CLASS_IDENTIFIER_SERVICE_TYPE_1_2`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SessionServiceProxy(SessionServiceInterface sessionService)`
  Constructs a proxy to the specified session service.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `destroySession(UserContextInterface userContext, String sessionContextId)`
  Forcibly destroys the session context identified by the session context id.
  `void`
  `destroySessions(UserContextInterface userContext)`
  This destroys all session contexts created by this session service, without destroying the session service itself.
  `SessionContextInterface`
  `fromByteArray(byte[] data)`
  Instantiate a SessionContext from a passivated byte array.
  `final SessionContextInterface`
  `getSessionContext(UserContextInterface userContext, String uniqueId)`
  Obtains the session context interface identified by the unique identifer or `null` if no session context exists with this id.
  `final SessionContextInterface`
  `getSessionContext(String uniqueId)`
  Obtains the session context interface identified by the unique identifer or `null` if no session context exists with this id.
  `List`
  `getSummaryData(UserContextInterface userContext)`
  Return summary information for all active session contexts created by this Session Service.
  `boolean`
  `isQuiesced()`
  Returns a flag indicating whether the Session Service is in a quiesce state or not.
  `final SessionContextInterface`
  `newSessionContext(UserContextInterface userContext)`
  Creates and returns a new session context interface.
  `final void`
  `quiesce(UserContextInterface userContext)`
  Resumes the session service.
  `final void`
  `resume(UserContextInterface userContext)`
  Resume the session service.

  ### Methods inherited from class com.sas.services.ServiceProxy

  `addServiceObserver, configure, destroy, findRemoteService, getCreationTime, getEntityKey, getService, getServiceConfiguration, getServiceConfiguration, getServiceProxy, getServiceState, isAccessibleToRemoteClients, isExported, isLocalService, isProxyToRemoteService, notifyServiceObservers, reconfigure, removeAllServiceObservers, removeServiceObserver, sameEnitityKey, sameEntity, setEntityKey, setServiceState`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface com.sas.entities.EntityKeyInterface

  `getEntityKey, sameEntity, setEntityKey`

  ### Methods inherited from interface com.sas.services.RemoteServiceInterface

  `configure, destroy, getCreationTime, getServiceConfiguration, getServiceConfiguration, getServiceProxy, getServiceState, isAccessibleToRemoteClients, isExported, reconfigure, setServiceState`

  ### Methods inherited from interface com.sas.services.mgmt.ServiceNotificationBroadcasterInterface

  `addServiceObserver, notifyServiceObservers, removeAllServiceObservers, removeServiceObserver`

- ## Constructor Details

  - ### SessionServiceProxy

    public SessionServiceProxy(SessionServiceInterface sessionService) throws InitializationException
    Constructs a proxy to the specified session service.
    Parameters:
      `sessionService` - Session service to be proxied.
    Throws:
      `InitializationException` - if unable to create a proxy for the logging service.

- ## Method Details

  - ### newSessionContext

    public final SessionContextInterface newSessionContext(UserContextInterface userContext) throws InitializationException, RemoteException
    Creates and returns a new session context interface. The user context to bind to the session context can be provided. If a null user context is provided, it can be set at a later time. Once the user context has been set to a non-null value, it cannot be changed.
    Specified by:
      `newSessionContext` in interface `SessionServiceInterface`
    Parameters:
      `userContext` - User context for this session context; can be `null`.
    Returns:
      `SessionContextInterface` The created session context interface.
    Throws:
      `InitializationException` - If the context fails to initialize.
      `RemoteException` - If a network anomaly is encountered.

  - ### getSessionContext

    public final SessionContextInterface getSessionContext(String uniqueId) throws RemoteException
    Obtains the session context interface identified by the unique identifer or `null` if no session context exists with this id. The unique identifier is required to identify the desired context so that applications don't have access to all session contexts.
    Specified by:
      `getSessionContext` in interface `SessionServiceInterface`
    Parameters:
      `uniqueId` - Unique identifier of the session context to be returned.
    Returns:
      `SessionContextInterface` The session context interface.
    Throws:
      `RemoteException` - If a network anomaly is encountered.

  - ### getSessionContext

    public final SessionContextInterface getSessionContext(UserContextInterface userContext, String uniqueId) throws RemoteException
    Obtains the session context interface identified by the unique identifer or `null` if no session context exists with this id. The unique identifier is required to identify the desired context so that applications don't have access to all session contexts. This method is protected using JAAS permissions. A `SessionContextPermission` is required to obtain the session context from the Session Service.
    Specified by:
      `getSessionContext` in interface `SessionServiceInterface`
    Parameters:
      `userContext` - A user context whose principals will be checked for permission to perform the getSessionContext function. This can be null, but if the method is invoked remotely, it will always fail with a null user context.
      `uniqueId` - Unique identifier of the session context to be returned.
    Returns:
      `SessionContextInterface` The session context interface.
    Throws:
      `RemoteException` - If a network anomaly is encountered.

  - ### quiesce

    public final void quiesce(UserContextInterface userContext) throws ServiceException, QuiesceException, RemoteException
    Resumes the session service. This allows it to start creating new session contexts.
    Specified by:
      `quiesce` in interface `QuiesceInterface`
    Specified by:
      `quiesce` in interface `SessionServiceInterface`
    Parameters:
      `userContext` - The user context.
    Throws:
      `ServiceException` - If a service error occurs.
      `QuiesceException` - If an error occurs quiescing the service.
      `RemoteException` - If a network anomaly is encountered.

  - ### isQuiesced

    public boolean isQuiesced() throws RemoteException
    Returns a flag indicating whether the Session Service is in a quiesce state or not.
    Specified by:
      `isQuiesced` in interface `SessionServiceInterface`
    Returns:
      `true` if the Session Service is in a quiesce state; otherwise `false` is returned.
    Throws:
      `RemoteException` - if a network error occurs.

  - ### resume

    public final void resume(UserContextInterface userContext) throws ServiceException, QuiesceException, RemoteException
    Resume the session service. This should be called after the Session Service has been quiesced, to allow the Session Service to start creating new session contexts.
    Specified by:
      `resume` in interface `QuiesceInterface`
    Specified by:
      `resume` in interface `SessionServiceInterface`
    Parameters:
      `userContext` - The user context.
    Throws:
      `ServiceException` - If a service error occurs.
      `QuiesceException` - If an error occurs quiescing the service.
      `RemoteException` - If a network anomaly is encountered.

  - ### destroySessions

    public void destroySessions(UserContextInterface userContext) throws RemoteException
    This destroys all session contexts created by this session service, without destroying the session service itself.

    When each session context is destroyed, all objects are unbound from it. If the bound objects implement `RemoteSessionContextStateChangedListener`, the session context will invoke `RemoteSessionContextStateChangedListener.contextStateChanged(SessionContextStateChangedEvent)`. This allows objects to be notified when they are removed from the session context so they can perform any necessary cleanup.

    Specified by:
      `destroySessions` in interface `SessionServiceInterface`
    Parameters:
      `userContext` - the user context.
    Throws:
      `RemoteException` - If a network anomaly is encountered.

  - ### destroySession

    public boolean destroySession(UserContextInterface userContext, String sessionContextId) throws RemoteException
    Forcibly destroys the session context identified by the session context id. The session context will be destroyed even if is locked.

    This method is protected using JAAS permissions. A `SessionPermission` is required to destroy the active session context.

    Specified by:
      `destroySession` in interface `SessionServiceInterface`
    Parameters:
      `userContext` - The user context.
      `sessionContextId` - The unique identifier of the session context to destroy.
    Returns:
      `boolean` that is `false` if the session context identified by the unique id could not be found; otherwise `true` is returned.
    Throws:
      `RemoteException` - If a network anomaly is encountered.

  - ### getSummaryData

    public List getSummaryData(UserContextInterface userContext) throws RemoteException
    Return summary information for all active session contexts created by this Session Service. Each session context can be bound to a user context. The summary data for each active session contains information such as the user context name, the user's email addresses, and the user's global profile.
    Specified by:
      `getSummaryData` in interface `SessionServiceInterface`
    Parameters:
      `userContext` - The user context.
    Returns:
      `List`A list of SummaryDataInterface objects.
    Throws:
      `RemoteException` - if a network error occurs

  - ### fromByteArray

    public SessionContextInterface fromByteArray(byte[] data) throws RemoteException, ServiceException
    Description copied from interface: `SessionServiceInterface`
    Instantiate a SessionContext from a passivated byte array. The first item in the passivated stream is the session ID. If that session ID is one this session service has in its known list, get it and return it.
    Specified by:
      `fromByteArray` in interface `SessionServiceInterface`
    Parameters:
      `data` - The passivated data stream.
    Returns:
      The instantiated Session Context
    Throws:
      `RemoteException` - In the event of remote object failure.
      `ServiceException` - If an error occurs processing the data.