com.avaya.ccs.api

## Interface SessionI

-     public interface SessionI

  The `SessionI` interface represents an active authenticated session with the server.

  Once a signin is successful, the client application will receive an instance of the new `SessionI` through the `SessionListenerI` that is passed to the `ClientI.signin(java.lang.String, java.lang.String, com.avaya.ccs.api.SessionListenerI, com.avaya.ccs.api.ClientListenerI)` method. Once the application has obtained the new `SessionI` instance, the application can then proceed to request access to the objects it is interested in by invoking;

  - `openUsers(com.avaya.ccs.api.UserListenerI)` for `UserI` objects
  - `openResources(com.avaya.ccs.api.ResourceListenerI)` for `ResourceI` objects
  - `openInteractions(com.avaya.ccs.api.InteractionListenerI)` for `InteractionI` objects
  Please see the documentation for each method to identify how the objects are received by the application. *

  In general, call control or agent control applications should always open the relevant paths to these objects on receipt of a new `SessionI` instance. For High Availability switchovers, a new `SessionI` instance will be created and sent to the application once the Standby Contact Center server takes over the Active role. It is also up to the application to open the relevant paths to the objects it is interested in on receipt of a new `SessionI` object at switchover time.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `InteractionI` | `findInteraction(java.lang.String id)`
    `ResourceI` | `findResource(java.lang.String id)`
    `UserI` | `findUser(java.lang.String id)`
    `CodeListI` | `getAfterCallWorkCodes()` A `CodeListI` object with type `CodeType.ACW` holding a list of `ContactCenterCodeI` objects representing the current after call work codes administered in the Contact Center.
    `com.avaya.ccs.core.Client` | `getClient()` Get the `Client` object associated with this `Session`.
    `java.lang.String` | `getId()` A unique identifier for the `SessionI` instance.
    `java.util.List<InteractionI>` | `getInteractions()`
    `java.lang.String` | `getLastLoginTime()` The server time of the last successful login for the currently connected user.
    `CodeListI` | `getNotReadyReasonCodes()` A `CodeListI` object with type `CodeType.NRRC` holding a list of `ContactCenterCodeI` objects representing the current not ready reason codes administered in the Contact Center.
    `int` | `getNumUsers()`
    `java.util.List<ResourceI>` | `getResources()`
    `java.util.List<UserI>` | `getUsers()`
    `java.lang.String` | `getVersion()`
    `void` | `openInteractions(InteractionListenerI interactionListener)` Opens the `InteractionI` path with the server to start the flow of events for all interactions associated with the `SessionI`.
    `void` | `openResources(ResourceListenerI resourceListener)` Opens the `ResourceI` path with the server to start the flow of events for all resources associated with the `SessionI`.
    `void` | `openUsers(UserListenerI userListener)` Opens the `UserI` path with the server to start the flow of events for all users associated with the `SessionI` .

- - ### Method Detail

    - #### getId

          java.lang.String getId()

      A unique identifier for the `SessionI` instance.

      Identifier values are only guaranteed to be unique among objects of the same type. Client applications should not rely on the value of the ID property for anything other than uniquely identifying an instance of a particular object type, as the actual value of the ID property may be changed in future releases.

      This property is available for access after the application has received a `NotificationType.DELETE` notification for this `SessionI` object.

      Returns:
        id of the `SessionI` instance

    - #### getNumUsers

          int getNumUsers()
                   throws ObjectInvalidException

      Returns:
        the number of users in this `SessionI` instance
      Throws:
        `ObjectInvalidException` - if the `SessionI` instance has been deleted

    - #### getVersion

          java.lang.String getVersion()
                               throws ObjectInvalidException

      Returns:
        the version of the Contact Center server
      Throws:
        `ObjectInvalidException` - if the `SessionI` instance has been deleted

    - #### getLastLoginTime

          java.lang.String getLastLoginTime()
                                     throws ObjectInvalidException

      The server time of the last successful login for the currently connected user.

      The value of the property is a String object containing the Universal Coordinated Time (UTC) server time of the previous successful login by the same user or null if the user has never previously signed in.

      Returns:
        a String representing the time of the users last login
      Throws:
        `ObjectInvalidException` - if the `SessionI` instance has been deleted

    - #### getNotReadyReasonCodes

          CodeListI getNotReadyReasonCodes()
                                    throws ObjectInvalidException

      A `CodeListI` object with type `CodeType.NRRC` holding a list of `ContactCenterCodeI` objects representing the current not ready reason codes administered in the Contact Center.
      Returns:
        a `CodeList` object allowing access to the codes
      Throws:
        `ObjectInvalidException` - if the `SessionI` instance has been deleted

    - #### getAfterCallWorkCodes

          CodeListI getAfterCallWorkCodes()
                                   throws ObjectInvalidException

      A `CodeListI` object with type `CodeType.ACW` holding a list of `ContactCenterCodeI` objects representing the current after call work codes administered in the Contact Center.
      Returns:
        a `CodeList` object allowing access to the codes
      Throws:
        `ObjectInvalidException` - if the `SessionI` instance has been deleted

    - #### openUsers

          void openUsers(UserListenerI userListener)
                  throws InvalidArgumentException,
                         ObjectInvalidException

      Opens the `UserI` path with the server to start the flow of events for all users associated with the `SessionI` .

      The `UserI` objects and subsequent notifications for these objects are sent to the application through the `UserListenerI.onUserEvent(com.avaya.ccs.api.NotificationEventI<com.avaya.ccs.api.UserI>)` method

      Parameters:
        `userListener` - notifies the application of user level events
      Throws:
        `InvalidArgumentException` - if the mandatory `UserListenerI` argument is not supplied
        `ObjectInvalidException` - if the `SessionI` has been deleted

    - #### getUsers

          java.util.List<UserI> getUsers()
                                  throws ObjectInvalidException

      Returns:
        a list of `UserI` objects in the `SessionI`
      Throws:
        `ObjectInvalidException` - if the `SessionI` has been deleted

    - #### findUser

          UserI findUser(java.lang.String id)
                  throws InvalidArgumentException,
                         ObjectInvalidException

      Parameters:
        `id` - of the `UserI` object to find
      Returns:
        the `UserI` object if found in the `SessionI` and `null` if the `UserI` is not found
      Throws:
        `InvalidArgumentException` - if the supplied id argument is `null` or an empty string
        `ObjectInvalidException` - if the `SessionI` has been deleted

    - #### openResources

          void openResources(ResourceListenerI resourceListener)
                      throws InvalidArgumentException,
                             ObjectInvalidException

      Opens the `ResourceI` path with the server to start the flow of events for all resources associated with the `SessionI`.

      The `ResourceI` objects and subsequent notifications for these objects are sent to the application through the `ResourceListenerI.onResourceEvent(com.avaya.ccs.api.NotificationEventI<com.avaya.ccs.api.ResourceI>)` method

      Parameters:
        `resourceListener` - notifies the application of resource level events
      Throws:
        `InvalidArgumentException` - if the mandatory `ResourceListenerI` argument is not supplied
        `ObjectInvalidException` - if the `SessionI` has been deleted

    - #### getClient

          com.avaya.ccs.core.Client getClient()

      Get the `Client` object associated with this `Session`.
      Returns:

    - #### getResources

          java.util.List<ResourceI> getResources()
                                          throws ObjectInvalidException

      Returns:
        a list of `ResourceI` objects in the `SessionI`
      Throws:
        `ObjectInvalidException` - if the `SessionI` has been deleted

    - #### findResource

          ResourceI findResource(java.lang.String id)
                          throws InvalidArgumentException,
                                 ObjectInvalidException

      Parameters:
        `id` - of the `ResourceI` object to find
      Returns:
        the `ResourceI` object if found in the `SessionI` and `null` if the `ResourceI` is not found
      Throws:
        `InvalidArgumentException` - if the supplied id argument is `null` or an empty string
        `ObjectInvalidException` - if the `SessionI` has been deleted

    - #### openInteractions

          void openInteractions(InteractionListenerI interactionListener)
                         throws InvalidArgumentException,
                                ObjectInvalidException

      Opens the `InteractionI` path with the server to start the flow of events for all interactions associated with the `SessionI`.

      The `InteractionI` objects and subsequent notifications for these objects are sent to the application through the `InteractionListenerI.onInteractionEvent(com.avaya.ccs.api.NotificationEventI<com.avaya.ccs.api.InteractionI>)` method

      Parameters:
        `interactionListener` - notifies the application of interaction level events
      Throws:
        `InvalidArgumentException` - if the mandatory `InteractionListenerI` argument is not supplied
        `ObjectInvalidException` - if the `SessionI` has been deleted

    - #### getInteractions

          java.util.List<InteractionI> getInteractions()
                                                throws ObjectInvalidException

      Returns:
        a list of `InteractionI` objects in the `SessionI`
      Throws:
        `ObjectInvalidException` - if the `SessionI` has been deleted

    - #### findInteraction

          InteractionI findInteraction(java.lang.String id)
                                throws InvalidArgumentException,
                                       ObjectInvalidException

      Parameters:
        `id` - of the `InteractionI` object to find
      Returns:
        the `InteractionI` object if found in the `SessionI` and `null` if the `InteractionI` is not found
      Throws:
        `InvalidArgumentException` - if the supplied id argument is `null` or an empty string
        `ObjectInvalidException` - if the `SessionI` has been deleted