com.waveset.adapter
Class JmsListenerResourceAdapter

java.lang.Object
  extended bycom.waveset.adapter.ResourceAdapterBase
      extended bycom.waveset.adapter.JmsListenerResourceAdapter
All Implemented Interfaces:
ActiveSync, ResourceAdapter

public class JmsListenerResourceAdapter
extends ResourceAdapterBase
implements ActiveSync

JMS Listener adapter processes messages delivered via JMS point-to-point (queues) or publish/subscribe (topics).

The 1.02b JMS API is used for maximum compatibility.

For 6.0 SP1, this adapter was re-written to read Messages synchronously in poll. The previous version processed Messages asynchronously, but it was found that J2EE spec does not require the asynchronous APIs be supported.


Nested Class Summary
static class JmsListenerResourceAdapter.SafetyInvocationHandler
          An invocation handler for a dynamic proxy which ignores all unhandled errors in the invokes.
 
Nested classes inherited from class com.waveset.adapter.ResourceAdapterBase
ResourceAdapterBase.SimpleAccountIterator
 
Nested classes inherited from class com.waveset.adapter.ResourceAdapter
ResourceAdapter.ActionResult, ResourceAdapter.Features, ResourceAdapter.ObjectType
 
Field Summary
protected  ActiveSyncUtil _util
          Handy utilities for logging
static java.lang.String code_id
           
static java.lang.String RA_DESTINATION_NAME
           
static java.lang.String RA_DESTINATION_TYPE
           
static java.lang.String RA_DURABLE_SUBSCRIPTION_NAME
           
static java.lang.String RA_DURABLE_TOPIC_CLIENT_ID
           
static java.lang.String RA_FACTORY_NAME
           
static java.lang.String RA_IS_NATIVE_DELETE_RULE
           
static java.lang.String RA_JNDI_PROPERTIES
          Resource property names
static java.lang.String RA_LIFECYCLE_LISTENER
           
static java.lang.String RA_MESSAGE_MAPPER
           
static java.lang.String RA_MESSAGE_SELECTOR
           
static java.lang.String RA_PASSWORD
           
static java.lang.String RA_REINIT_UPON_EXCEPTION
           
static java.lang.String RA_RELIABLE_MESSAGING
           
static java.lang.String RA_RETRY_CONNECTION_FREQ
           
static java.lang.String RA_USER
           
static java.lang.String RESOURCE_NAME
          Default resource name
static java.lang.String RESOURCE_USER_FORM
           
protected static java.lang.String RM_AUTO_ACK_NAME
           
protected static java.lang.String RM_CLIENT_ACK_NAME
           
protected static java.lang.String RM_DUPS_OK_ACK_NAME
           
protected static java.lang.String RM_LOCAL_TRANSACTION_NAME
          Valid values for the RA_RELIABLE_MESSAGING resource attribute
 
Fields inherited from class com.waveset.adapter.ResourceAdapterBase
_cache, _context, _excludedAccountsRule, _excludedAccountsRuleInited, _listAllObjectsAttrParse, _listAllObjectsAttrParseName, _listUserAttrParse, _listUserAttrParseName, _listUserGroupsAttrParse, _listUserGroupsAttrParseName, _resource, _thread, _trace, displayInfoCode, RA_BLOCKCOUNT, RA_LOGIN_ACTION, RA_LOGOFF_ACTION, RA_MULTI_VALUED_ATTRS, RA_TEST_MODE
 
Fields inherited from interface com.waveset.adapter.ActiveSync
ACTIVE_SYNC_EVENT_RES_ATTRS_XML, ACTIVE_SYNC_STD_RES_ATTRS_XML, ATTR_IS_DELETED, DATE_FORMAT, DATE_TIME_FORMAT, RA_APPLY_META_VIEW, RA_ASSIGN_SOURCE_ON_CREATE, RA_CONFIRMATION_RULE, RA_CORRELATION_RULE, RA_CREATE_UNMATCHED, RA_DELETE_RULE, RA_FORM, RA_ID, RA_IDM_NAME_RULE, RA_LEGACY_EVENT_GEN, RA_LOG_LEVEL, RA_LOG_PATH, RA_LOG_SIZE, RA_MAX_AGE_LENGTH, RA_MAX_AGE_UNIT, RA_MAX_ARCHIVES, RA_NAME, RA_PARAMETERIZED_INPUT_FORM, RA_POPULATE_GLOBAL, RA_POSTPOLL_WORKFLOW, RA_PREPOLL_WORKFLOW, RA_PROCESS_RULE, RA_PROXY_ADMINISTRATOR, RA_RESET_TO_TODAY, RA_RESOLVE_PROCESS_RULE, RA_SCHEDULE_INTERVAL, RA_SCHEDULE_INTERVAL_COUNT, RA_SCHEDULE_START_DATE, RA_SCHEDULE_START_TIME, RA_SYNC_CONFIG_MODE, RA_SYNC_POST_PROCESS_FORM, RA_UPDATE_IF_DELETE, RA_USE_INPUT_FORM, TIME_FORMAT, TRACE_LEVEL_DEBUG, TRACE_LEVEL_ERROR, TRACE_LEVEL_INFO, TRACE_LEVEL_NONE, TRACE_LEVEL_WARNING
 
Fields inherited from interface com.waveset.adapter.ResourceAdapter
CHANGE_PASSWORD_LOCATION, DISABLE, ENABLE, EXPIRE_PASSWORD, GUID, IGNORE_ATTR, NEW_ACCOUNT_ID, OP_DAYS_INACTIVE, OP_DISABLED, OP_DORMANT, OP_EXPIRED, OP_EXPIREDPWD, OP_INACTIVE, OP_LOCKED, OP_NO_PASSWORD_SET, OP_NOOWNERSHIP, OP_NOPASSWORDREQ, OP_NUMINACTIVEDAYS, OP_NUMPWDAYS, OP_PWNUMDAYS, RA_BASE_CTX, RA_DISPLAY_NAME_ATTR, RA_NEW_OBJECT_ID, RA_NEW_OBJECT_NAME, RA_OBJECT_ATTRIBUTES, RA_OBJECT_CLASS, RA_OBJECT_ID, RA_OBJECT_TYPE, RA_OP_TYPE, RA_RENAME_OP, RA_REQUESTOR, RA_SAVEAS_OP, RA_SEARCH_ATTRIBUTE_NAMES, RA_SEARCH_ATTRS_TO_GET, RA_SEARCH_CONTEXT, RA_SEARCH_FILTER, RA_SEARCH_RUN_AS_PASSWORD, RA_SEARCH_RUN_AS_USER, RA_SEARCH_SCOPE, RA_SEARCH_SCOPE_OBJECT, RA_SEARCH_SCOPE_ONE_LEVEL, RA_SEARCH_SCOPE_SUBTREE, RA_SEARCH_TIME_LIMIT, RESET_PASSWORD, SYSTEM_ATTRIBUTES, UNLOCK, WS_USER_PASSWORD
 
Constructor Summary
JmsListenerResourceAdapter()
           
 
Method Summary
 WavesetResult authenticate(java.util.HashMap loginInfo)
          Authenticates the user against the resource.
 WavesetResult checkCreateAccount(WSUser user)
           
 WavesetResult checkDeleteAccount(WSUser user)
           
 WavesetResult checkUpdateAccount(WSUser user)
           
 void commitSession()
           
protected  void connect()
           
 Resource createPrototypeResource()
           
protected  void disconnect()
           
protected  java.lang.Object evaluateRule(Rule rule, java.util.Map valueMap)
           
 AccountIterator getAccountIterator()
          account iteration not supported
 java.lang.Object getAttributeValue(java.lang.String name)
          These are methods implemented in sources to get and set attributes.
 GenericObject getFeatures()
          Expose features supported by the Resource Adapter.
protected  Rule getRule(java.lang.String name)
           
 void init()
          initialize yourself.
protected  java.util.Map mapMessageToRhs(javax.jms.Message message)
          Convert the incoming JMS Message into a Map.
protected  java.util.Map mapRhsToLhs(java.util.Map rhsValueMap)
          Map the values from the rhs to the lhs (based on schema map).
protected  GenericObject mungeValueMap(java.util.Map valueMap)
           
 int poll()
          The poll method.
 void setAttributeValue(java.lang.String name, java.lang.Object value)
          These are methods implemented in sources to get and set attributes.
 void shutdown()
          Called once when the active sync is terminated.
static Resource staticCreatePrototypeResource()
           
 WavesetResult testConfiguration()
          Test method.
 
Methods inherited from class com.waveset.adapter.ResourceAdapterBase
checkForNoPasswordInSchema, checkSyntax, createAccount, createAccounts, createIdentity, createObject, deleteAccount, deleteAccount, deleteAccounts, deleteObject, disableAccount, disableAccounts, dnsEqual, dnsEqual, enableAccount, enableAccounts, executeResourceAttributeJavascriptAction, fillInResourceInfo, fillInResourceInfo, getAccountAttributes, getAccountIterator, getAccountIterator, getAction, getActionNotFoundErrorMessage, getActionNotFoundMessage, getActionRunAsPassword, getActionRunAsUser, getActionTimeout, getActionType, getAdapter, getAdapter, getAdapter, getAdapterProxy, getAdapterProxy, getAllAccounts, getAttrNameFromMapName, getAttrNameFromMapName, getAttrParse, getAttrTypeFromMapName, getAttrTypeFromMapName, getAUserName, getBaseContextAttrName, getBaseContextObject, getBaseContexts, getBlockSize, getContext, getExcludedAccountsRule, getIdentity, getListAllObjectsAttrParse, getListUserAttrParse, getListUserGroupsAttrParse, getObject, getOptionalBooleanResAttrVal, getOptionalBooleanResAttrVal, getOptionalEncryptedResAttrVal, getOptionalResAttrVal, getOptionalStringResAttrVal, getRequiredResAttr, getRequiredResAttr, getRequiredResAttrVal, getRequiredResAttrVal, getRequiredResAttrVals, getRequiredUserAttributeNames, getResAttrValActionOnUser, getResAttrVals, getResource, getResourceAccounts, getResourceInfo, getResourceObjectAttrValNameAttr, getResourceObjectClassAttr, getResourceObjectTypePrefix, getSchemaMap, getUser, getUser, getWSAttrByMapName, getWSAttrByMapName, getWSAttrFromMap, handleActionResult, handleJavascriptActionResult, isAccountAttributeSecret, isExcludedAccount, isExcludedAccount, isFeatureEnabled, isSupported, isTestMode, listAllObjects, listAllObjects, listObjects, listObjects, listObjectsOfType, lookupAction, lookupAction, lookupActions, namesEqual, objectClassesMatchType, println, realCreate, realDelete, realDisable, realEnable, realUpdate, restoreResourceObjectClassAttr, run, run, runResourceAttributeJavascriptAction, scan, setCache, setContext, setDisabled, setFromResource, setResource, setResourceObjectClassAttr, setResourceOptionAttrs, startConnection, startConnectionWrapper, stopConnection, supportsAccountActions, supportsAccountDisable, supportsActions, supportsCaseInsensitiveAccountIds, supportsContainerObjectTypes, supportsExcludedAccounts, supportsResourceAccount, supportsScanning, updateAccount, updateAccounts, updateObject, updateResourceAccount, updateResourceIdentity, vmStoreBoot, vmStoreGet, vmStoreInit, vmStoreLatch, vmStorePut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

RA_JNDI_PROPERTIES

public static final java.lang.String RA_JNDI_PROPERTIES
Resource property names

See Also:
Constant Field Values

RA_DESTINATION_TYPE

public static final java.lang.String RA_DESTINATION_TYPE
See Also:
Constant Field Values

RA_FACTORY_NAME

public static final java.lang.String RA_FACTORY_NAME
See Also:
Constant Field Values

RA_DESTINATION_NAME

public static final java.lang.String RA_DESTINATION_NAME
See Also:
Constant Field Values

RA_DURABLE_TOPIC_CLIENT_ID

public static final java.lang.String RA_DURABLE_TOPIC_CLIENT_ID
See Also:
Constant Field Values

RA_DURABLE_SUBSCRIPTION_NAME

public static final java.lang.String RA_DURABLE_SUBSCRIPTION_NAME
See Also:
Constant Field Values

RA_USER

public static final java.lang.String RA_USER
See Also:
Constant Field Values

RA_PASSWORD

public static final java.lang.String RA_PASSWORD
See Also:
Constant Field Values

RA_MESSAGE_SELECTOR

public static final java.lang.String RA_MESSAGE_SELECTOR
See Also:
Constant Field Values

RA_RELIABLE_MESSAGING

public static final java.lang.String RA_RELIABLE_MESSAGING
See Also:
Constant Field Values

RA_MESSAGE_MAPPER

public static final java.lang.String RA_MESSAGE_MAPPER
See Also:
Constant Field Values

RA_RETRY_CONNECTION_FREQ

public static final java.lang.String RA_RETRY_CONNECTION_FREQ
See Also:
Constant Field Values

RA_REINIT_UPON_EXCEPTION

public static final java.lang.String RA_REINIT_UPON_EXCEPTION
See Also:
Constant Field Values

RA_LIFECYCLE_LISTENER

public static final java.lang.String RA_LIFECYCLE_LISTENER
See Also:
Constant Field Values

RA_IS_NATIVE_DELETE_RULE

public static final java.lang.String RA_IS_NATIVE_DELETE_RULE
See Also:
Constant Field Values

RM_LOCAL_TRANSACTION_NAME

protected static final java.lang.String RM_LOCAL_TRANSACTION_NAME
Valid values for the RA_RELIABLE_MESSAGING resource attribute

See Also:
Constant Field Values

RM_AUTO_ACK_NAME

protected static final java.lang.String RM_AUTO_ACK_NAME
See Also:
Constant Field Values

RM_DUPS_OK_ACK_NAME

protected static final java.lang.String RM_DUPS_OK_ACK_NAME
See Also:
Constant Field Values

RM_CLIENT_ACK_NAME

protected static final java.lang.String RM_CLIENT_ACK_NAME
See Also:
Constant Field Values

RESOURCE_NAME

public static final java.lang.String RESOURCE_NAME
Default resource name

See Also:
Constant Field Values

RESOURCE_USER_FORM

public static final java.lang.String RESOURCE_USER_FORM
See Also:
Constant Field Values

_util

protected ActiveSyncUtil _util
Handy utilities for logging

Constructor Detail

JmsListenerResourceAdapter

public JmsListenerResourceAdapter()
Method Detail

staticCreatePrototypeResource

public static Resource staticCreatePrototypeResource()
                                              throws WavesetException
Throws:
WavesetException

createPrototypeResource

public Resource createPrototypeResource()
                                 throws WavesetException
Specified by:
createPrototypeResource in interface ResourceAdapter
Specified by:
createPrototypeResource in class ResourceAdapterBase
Throws:
WavesetException

checkCreateAccount

public WavesetResult checkCreateAccount(WSUser user)
                                 throws WavesetException
Specified by:
checkCreateAccount in interface ResourceAdapter
Specified by:
checkCreateAccount in class ResourceAdapterBase
Throws:
WavesetException

checkUpdateAccount

public WavesetResult checkUpdateAccount(WSUser user)
                                 throws WavesetException
Specified by:
checkUpdateAccount in interface ResourceAdapter
Specified by:
checkUpdateAccount in class ResourceAdapterBase
Throws:
WavesetException

checkDeleteAccount

public WavesetResult checkDeleteAccount(WSUser user)
                                 throws WavesetException
Specified by:
checkDeleteAccount in interface ResourceAdapter
Specified by:
checkDeleteAccount in class ResourceAdapterBase
Throws:
WavesetException

authenticate

public WavesetResult authenticate(java.util.HashMap loginInfo)
                           throws WavesetException
Description copied from interface: ResourceAdapter
Authenticates the user against the resource. If authentication is successful, the authenticated id will be returned. If more info is required to complete authentication the result will contain the required info

Specified by:
authenticate in interface ResourceAdapter
Specified by:
authenticate in class ResourceAdapterBase
Throws:
WavesetException

getFeatures

public GenericObject getFeatures()
Expose features supported by the Resource Adapter. Note: ActiveSync is considered a facet, not a feature.

Specified by:
getFeatures in interface ResourceAdapter
Overrides:
getFeatures in class ResourceAdapterBase
Returns:
GenericObject containing Features, as both key and value, which are supported by this resource adapter.
See Also:
ResourceAdapter.Features

getRule

protected final Rule getRule(java.lang.String name)
                      throws WavesetException
Throws:
WavesetException

getAttributeValue

public final java.lang.Object getAttributeValue(java.lang.String name)
                                         throws WavesetException
These are methods implemented in sources to get and set attributes. Since this is a source with a resource, just pass the calls through.

Specified by:
getAttributeValue in interface ActiveSync
Throws:
WavesetException

setAttributeValue

public final void setAttributeValue(java.lang.String name,
                                    java.lang.Object value)
                             throws WavesetException
These are methods implemented in sources to get and set attributes. Since this is a source with a resource, just pass the calls through.

Specified by:
setAttributeValue in interface ActiveSync
Throws:
WavesetException

init

public final void init()
                throws java.lang.Exception
Description copied from interface: ActiveSync
initialize yourself. throw exception if initialization failed

Specified by:
init in interface ActiveSync
Throws:
java.lang.Exception

shutdown

public final void shutdown()
Called once when the active sync is terminated. This is where you can cleanup sockets, etc. If the server is just shutdown, though, this is not called.

Specified by:
shutdown in interface ActiveSync

poll

public final int poll()
               throws java.lang.InterruptedException
The poll method.

Specified by:
poll in interface ActiveSync
Returns:
0 if no work done, n if n calls processed.
Throws:
java.lang.InterruptedException

connect

protected void connect()
                throws WavesetException
Throws:
WavesetException

disconnect

protected void disconnect()

getAccountIterator

public AccountIterator getAccountIterator()
                                   throws WavesetException
account iteration not supported

Specified by:
getAccountIterator in interface ResourceAdapter
Overrides:
getAccountIterator in class ResourceAdapterBase
Throws:
WavesetException

mungeValueMap

protected GenericObject mungeValueMap(java.util.Map valueMap)

mapRhsToLhs

protected java.util.Map mapRhsToLhs(java.util.Map rhsValueMap)
                             throws java.lang.Exception
Map the values from the rhs to the lhs (based on schema map). This should only be over-ridden in advanced cases.

Parameters:
rhsValueMap - the incoming rhs value map
Returns:
the resulting lhs value map
Throws:
java.lang.Exception

evaluateRule

protected final java.lang.Object evaluateRule(Rule rule,
                                              java.util.Map valueMap)
                                       throws WavesetException
Throws:
WavesetException

mapMessageToRhs

protected java.util.Map mapMessageToRhs(javax.jms.Message message)
                                 throws java.lang.Exception
Convert the incoming JMS Message into a Map.

Throws:
java.lang.Exception

testConfiguration

public WavesetResult testConfiguration()
                                throws WavesetException
Test method. This method should check the configuration of the adapter as thoroughly as possible.

Specified by:
testConfiguration in interface ResourceAdapter
Overrides:
testConfiguration in class ResourceAdapterBase
Throws:
WavesetException

commitSession

public void commitSession()
                   throws java.lang.Exception
Throws:
java.lang.Exception