Class RemoteCall<T>

  • Direct Known Subclasses:
    RemoteCaller, RemoteRunner

    public class RemoteCall<T>
    extends StatelessRemoteCall
    An implementation wrapper for stateful services. It runs on the server-side and applies the (optional) client version, application, client, and session IDs through its filters; it also handles logging, exception wrapping, and (optionally) maps session IDs to session holders.
    Since:
    1.0.0
    Version:
    $Id: RemoteCall.java 16154 2012-07-14 16:34:05Z colin $
    Author:
    tlerios@marketcetera.com
    • Field Detail

      • mSessionIdFilter

        private final TagFilter mSessionIdFilter
    • Constructor Detail

      • RemoteCall

        public RemoteCall​(TagFilter versionIdFilter,
                          TagFilter appIdFilter,
                          TagFilter clientIdFilter,
                          SessionManager<T> sessionManager,
                          TagFilter sessionIdFilter)
        Creates a new wrapper which uses the given (optional) session manager for session ID mappings, and which applies the given filters to the client context.
        Parameters:
        versionIdFilter - The version ID filter, which may be null.
        appIdFilter - The application ID filter, which may be null.
        clientIdFilter - The client ID filter, which may be null.
        sessionManager - The session manager, which may be null.
        sessionIdFilter - The session ID filter, which may be null.
      • RemoteCall

        public RemoteCall​(SessionManager<T> sessionManager)
        Creates a new wrapper which uses the given (optional) session manager for session ID mappings, and which applies two filters to the client context. The first filter ensures that the client's version ID is equal to the server's version ID; the second ensures that the session ID maps to an active session.
        Parameters:
        sessionManager - The session manager, which may be null.
    • Method Detail

      • getSessionManager

        public SessionManager<T> getSessionManager()
        Returns the receiver's session manager.
        Returns:
        The session manager, which may be null.
      • getDefaultSessionIdFilter

        public static <T> ValidSessionTagFilter<T> getDefaultSessionIdFilter​(SessionManager<T> sessionManager)
        Returns the default session ID filter for the given session manager.
        Parameters:
        sessionManager - The session manager.
        Returns:
        The filter.
      • getSessionIdFilter

        public TagFilter getSessionIdFilter()
        Returns the receiver's session ID filter.
        Returns:
        The filter, which may be null.
      • getSessionHolder

        protected SessionHolder<T> getSessionHolder​(ClientContext context)
                                             throws I18NException
        Asserts that the given client context matches all of the receiver's filters. It also returns the session holder for the active session of that client, if one exists.
        Parameters:
        context - The context.
        Returns:
        The session holder, which may be null.
        Throws:
        I18NException - Thrown if there is a filter mismatch.