Interface Router

All Superinterfaces:
Object, Router

public interface Router extends Router
The Glacier2 specialization of the RouterPrx interface.
  • Method Details

    • getCategoryForClient

      String getCategoryForClient(Current current)
      Gets a unique category that identifies the client (caller) in the router. This category must be used in the identities of all the client's callback objects.
      Parameters:
      current - The Current object of the incoming request.
      Returns:
      The category. It's an empty string when Glacier2.Server.Endpoints is not configured.
    • createSessionAsync

      CompletionStage<SessionPrx> createSessionAsync(String userId, String password, Current current) throws PermissionDeniedException, CannotCreateSessionException
      Creates a session for the client (caller) with the router. If a SessionManagerPrx is configured, a proxy to a SessionPrx object is returned to the client. Otherwise, null is returned and only an internal session (i.e., not visible to the client) is created. If a non-null session proxy is returned, it must be configured to route through the router that created it. This occurs automatically when the router is configured as the client's default router at the time the session proxy is created in the client application; otherwise, the client must configure the session proxy explicitly.
      Parameters:
      userId - The user ID.
      password - The password.
      current - The Current object of the incoming request.
      Returns:
      A proxy for the newly created session, or null if no SessionManagerPrx is configured.
      Throws:
      CannotCreateSessionException - Thrown when the session cannot be created.
      PermissionDeniedException - Thrown when an authentication or authorization failure occurs.
      See Also:
    • createSessionFromSecureConnectionAsync

      CompletionStage<SessionPrx> createSessionFromSecureConnectionAsync(Current current) throws PermissionDeniedException, CannotCreateSessionException
      Creates a per-client session with the router. The user is authenticated through the SSL certificate(s) associated with the connection. If an SSLSessionManagerPrx is configured, a proxy to a SessionPrx object is returned to the client. Otherwise, null is returned and only an internal session (i.e., not visible to the client) is created. If a non-null session proxy is returned, it must be configured to route through the router that created it. This occurs automatically when the router is configured as the client's default router at the time the session proxy is created in the client application; otherwise, the client must configure the session proxy explicitly.
      Parameters:
      current - The Current object of the incoming request.
      Returns:
      A proxy for the newly created session, or null if no SSLSessionManagerPrx is configured.
      Throws:
      CannotCreateSessionException - Thrown when the session cannot be created.
      PermissionDeniedException - Thrown when an authentication or authorization failure occurs.
      See Also:
    • refreshSession

      void refreshSession(Current current) throws SessionNotExistException
      Keeps the session with this router alive.
      Parameters:
      current - The Current object of the incoming request.
      Throws:
      SessionNotExistException - Thrown when no session exists for the caller (client).
    • destroySession

      void destroySession(Current current) throws SessionNotExistException
      Destroys the session of the caller with this router.
      Parameters:
      current - The Current object of the incoming request.
      Throws:
      SessionNotExistException - Thrown when no session exists for the caller (client).
    • getSessionTimeout

      long getSessionTimeout(Current current)
      Gets the idle timeout used by the server-side of the connection.
      Parameters:
      current - The Current object of the incoming request.
      Returns:
      The idle timeout (in seconds).
    • getACMTimeout

      int getACMTimeout(Current current)
      Gets the idle timeout used by the server-side of the connection.
      Parameters:
      current - The Current object of the incoming request.
      Returns:
      The idle timeout (in seconds).
    • ice_staticId

      static String ice_staticId()
      Gets the type ID of the associated Slice interface.
      Returns:
      the string "::Glacier2::Router"
    • dispatch

      default CompletionStage<OutgoingResponse> dispatch(IncomingRequest request) throws UserException
      Dispatches an incoming request to one of the methods of this generated interface, based on the operation name carried by the request.
      Specified by:
      dispatch in interface Object
      Specified by:
      dispatch in interface Router
      Parameters:
      request - the incoming request
      Returns:
      the outgoing response
      Throws:
      UserException - if a UserException is thrown, Ice will marshal it as the response payload.