Class RemoteCall<T>
- java.lang.Object
-
- org.marketcetera.util.ws.stateless.StatelessRemoteCall
-
- org.marketcetera.util.ws.stateful.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 Summary
Fields Modifier and Type Field Description private TagFiltermSessionIdFilterprivate SessionManager<T>mSessionManager-
Fields inherited from class org.marketcetera.util.ws.stateless.StatelessRemoteCall
DEFAULT_VERSION_FILTER
-
-
Constructor Summary
Constructors Constructor Description 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.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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> ValidSessionTagFilter<T>getDefaultSessionIdFilter(SessionManager<T> sessionManager)Returns the default session ID filter for the given session manager.protected SessionHolder<T>getSessionHolder(ClientContext context)Asserts that the given client context matches all of the receiver's filters.TagFiltergetSessionIdFilter()Returns the receiver's session ID filter.SessionManager<T>getSessionManager()Returns the receiver's session manager.-
Methods inherited from class org.marketcetera.util.ws.stateless.StatelessRemoteCall
assertFilterMatch, assertFilterMatch, getAppIdFilter, getClientIdFilter, getVersionIdFilter, handleSuccess, startCall, wrapFailure
-
-
-
-
Field Detail
-
mSessionManager
private final SessionManager<T> mSessionManager
-
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.
-
-