org.marketcetera.util.ws.stateless
Class StatelessRemoteCall

java.lang.Object
  extended by org.marketcetera.util.ws.stateless.StatelessRemoteCall
Direct Known Subclasses:
RemoteCall, StatelessRemoteCaller, StatelessRemoteRunner

public class StatelessRemoteCall
extends Object

An implementation wrapper for stateless services. It runs on the server-side and applies the (optional) client version, application, and client IDs through its filters; it also handles logging and exception wrapping.

Since:
1.0.0
Version:
$Id: StatelessRemoteCall.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Field Summary
static EqualsTagFilter DEFAULT_VERSION_FILTER
          The default version ID filter.
 
Constructor Summary
StatelessRemoteCall()
          Creates a new wrapper which applies a single filter to the client context.
StatelessRemoteCall(TagFilter versionIdFilter, TagFilter appIdFilter, TagFilter clientIdFilter)
          Creates a new wrapper which applies the given filters to the client context.
 
Method Summary
protected  void assertFilterMatch(StatelessClientContext context)
          Asserts that the given client context matches all of the receiver's filters.
protected static void assertFilterMatch(TagFilter filter, Tag tag)
          Asserts that the given filter matches the given tag.
 TagFilter getAppIdFilter()
          Returns the receiver's application ID filter.
 TagFilter getClientIdFilter()
          Returns the receiver's client ID filter.
 TagFilter getVersionIdFilter()
          Returns the receiver's version ID filter.
protected  void handleSuccess(StatelessClientContext context)
          Called by subclasses after custom processing of a service call on behalf of the client with the given context completes successfully.
protected  void startCall(StatelessClientContext context)
          Called by subclasses before starting custom processing of a service call on behalf of the client with the given context.
protected  RemoteException wrapFailure(StatelessClientContext context, Throwable t)
          Called by subclasses after custom processing of a service call on behalf of the client with the given context completes unsuccessfully.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_VERSION_FILTER

public static final EqualsTagFilter DEFAULT_VERSION_FILTER
The default version ID filter.

Constructor Detail

StatelessRemoteCall

public StatelessRemoteCall(TagFilter versionIdFilter,
                           TagFilter appIdFilter,
                           TagFilter clientIdFilter)
Creates a new wrapper 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.

StatelessRemoteCall

public StatelessRemoteCall()
Creates a new wrapper which applies a single filter to the client context. That filter ensures that the client's version ID is equal to the server's version ID.

Method Detail

getVersionIdFilter

public TagFilter getVersionIdFilter()
Returns the receiver's version ID filter.

Returns:
The filter, which may be null.

getAppIdFilter

public TagFilter getAppIdFilter()
Returns the receiver's application ID filter.

Returns:
The filter, which may be null.

getClientIdFilter

public TagFilter getClientIdFilter()
Returns the receiver's client ID filter.

Returns:
The filter, which may be null.

assertFilterMatch

protected static void assertFilterMatch(TagFilter filter,
                                        Tag tag)
                                 throws I18NException
Asserts that the given filter matches the given tag.

Parameters:
filter - The filter, which may be null.
tag - The tag, which may be null.
Throws:
I18NException - Thrown if there is a mismatch.

assertFilterMatch

protected void assertFilterMatch(StatelessClientContext context)
                          throws I18NException
Asserts that the given client context matches all of the receiver's filters.

Parameters:
context - The context.
Throws:
I18NException - Thrown if there is a mismatch.

startCall

protected void startCall(StatelessClientContext context)
Called by subclasses before starting custom processing of a service call on behalf of the client with the given context.

Parameters:
context - The context.

handleSuccess

protected void handleSuccess(StatelessClientContext context)
Called by subclasses after custom processing of a service call on behalf of the client with the given context completes successfully.

Parameters:
context - The context.

wrapFailure

protected RemoteException wrapFailure(StatelessClientContext context,
                                      Throwable t)
Called by subclasses after custom processing of a service call on behalf of the client with the given context completes unsuccessfully. The failure is described by the given throwable.

Parameters:
context - The context.
t - The throwable.


Copyright © 2012. All Rights Reserved.