org.apache.cayenne.remote

## Class RemoteSession

- java.lang.Object
- - org.apache.cayenne.remote.RemoteSession

- All Implemented Interfaces:
    Serializable

      public class RemoteSession
      extends Object
      implements Serializable

  A descriptor used by default service implementation to pass session parameters to the client. It provides the client with details on how to invoke the service and how to listen for the server events.
  Since:
    1.2
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `eventBridgeFactory`
    `protected Map<String,String>` | `eventBridgeParameters`
    `protected String` | `name`
    `protected String` | `sessionId`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RemoteSession(String sessionId)` Creates a HessianServiceDescriptor without server events support.
    `RemoteSession(String sessionId, String eventBridgeFactory, Map<String,String> eventBridgeParameters)` Creates a HessianServiceDescriptor.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `EventBridge` | `createServerEventBridge()` Deprecated. since 4.0. Factory creation should is handled by the client connection.
    `String` | `getEventBridgeFactory()`
    `Map<String,String>` | `getEventBridgeParameters()`
    `String` | `getName()` Returns session group name.
    `String` | `getSessionId()` Returns server session id.
    `static Collection<EventSubject>` | `getSubjects()`
    `int` | `hashCode()`
    `boolean` | `isServerEventsEnabled()`
    `void` | `setName(String name)`
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### name

          protected String name

    - #### sessionId

          protected String sessionId

    - #### eventBridgeFactory

          protected String eventBridgeFactory

    - #### eventBridgeParameters

          protected Map<String,String> eventBridgeParameters

  - ### Constructor Detail

    - #### RemoteSession

          public RemoteSession(String sessionId)

      Creates a HessianServiceDescriptor without server events support.

    - #### RemoteSession

          public RemoteSession(String sessionId,
                               String eventBridgeFactory,
                               Map<String,String> eventBridgeParameters)

      Creates a HessianServiceDescriptor. If `eventBridgeFactory` argument is not null, session will support server events.

  - ### Method Detail

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getSessionId

          public String getSessionId()

      Returns server session id. This is often the same as HttpSession id.

    - #### getName

          public String getName()

      Returns session group name. Group name is used for shared sessions.

    - #### setName

          public void setName(String name)

    - #### isServerEventsEnabled

          public boolean isServerEventsEnabled()

    - #### createServerEventBridge

          @Deprecated
          public EventBridge createServerEventBridge()
                                                           throws CayenneRuntimeException

      Deprecated. since 4.0. Factory creation should is handled by the client connection.
      Creates an EventBridge that will listen for server events. Returns null if server events support is not configured in the descriptor.
      Throws:
        `CayenneRuntimeException` - if EventBridge startup fails for any reason.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getSubjects

          public static Collection<EventSubject> getSubjects()

    - #### getEventBridgeFactory

          public String getEventBridgeFactory()

      Since:
        4.0

    - #### getEventBridgeParameters

          public Map<String,String> getEventBridgeParameters()

      Since:
        4.0

Copyright © 2001–2018 Apache Cayenne. All rights reserved.