public class IntegrationRepositoryTools extends GenericService implements MessageSource, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
IntegrationRepositoryTools() |
Modifier and Type | Method and Description |
---|---|
protected void |
copyRemoteProperties(MutableRepositoryItem pTargetItem,
java.lang.Object pSourceObject,
atg.adapter.integrations.IntegrationRepositoryItemDescriptor pTargetDescriptor,
Command pRemoteCommand)
Copy all of the properties in the source object to the target repository
item based on the mapping file rules.
|
protected void |
copyRemoteProperties(MutableRepositoryItem pTargetItem,
java.lang.Object pSourceObject,
atg.adapter.integrations.IntegrationRepositoryItemDescriptor pTargetDescriptor,
Command pRemoteCommand,
boolean setExternalId)
Copy all of the properties in the source object to the target repository
item based on the mapping file rules.
|
java.lang.Object |
createGetCommandInput(java.lang.String pId,
java.lang.String pExternalIdPropertyName,
atg.adapter.integrations.IntegrationRepositoryItemDescriptor pItemDescriptor,
Command pGetCommand)
Create the input for the get command.
|
java.lang.Object |
createRemoveCommandInput(java.lang.String pId,
java.lang.String pExternalIdPropertyName,
atg.adapter.integrations.IntegrationRepositoryItemDescriptor pItemDescriptor,
Command pGetCommand)
Create the input for the remove command.
|
java.lang.Object |
createRemoveCommandInputSimple(java.lang.String pId,
java.lang.String pExternalIdPropertyName)
Create the input for the remove command.
|
RepositoryItem |
createRepositoryItem(java.lang.Object pCommandResult,
atg.adapter.integrations.IntegrationRepositoryItemDescriptor pItemDescriptor,
MutableRepositoryItem pLocalItem,
Command pRemoteCommand)
Given a object, create a repository item out of it.
|
RepositoryItem[] |
createRepositoryItems(java.lang.Object pCommandResult,
atg.adapter.integrations.IntegrationRepositoryItemDescriptor pItemDescriptor,
MutableRepositoryItem pLocalItem,
Command pRemoteCommand)
Given a object, create a repository item out of it.
|
protected java.lang.Object |
createRepositoryValue(RepositoryPropertyDescriptor pPropertyDescriptor,
java.lang.String pRemoteValue)
Create an appropriate property value from the given remote value.
|
void |
externalIdWasUpdated(atg.adapter.integrations.IntegrationRepository pRepository,
RepositoryItem pItem,
java.lang.String pOldValue,
java.lang.String pNewValue)
Send a scenario message of type IntegrationExternalIdChange when the
external id is set for the first time.
|
java.lang.Object |
getCommandResultObject(CommandResult pResult)
Get result from the CommandResult.
|
java.lang.String |
getExternalIdFromResult(java.lang.Object pResult,
atg.adapter.integrations.IntegrationRepositoryItemDescriptor pItemDescriptor)
Get the id for the external data.
|
java.lang.String |
getMessagePort()
The port that the scenario messages will be sent on
|
MessageSourceContext |
getMessageSourceContext()
Return the message source context for this source.
|
protected boolean |
handleValue(MutableRepositoryItem pItem,
RepositoryPropertyDescriptor pPropDescriptor,
java.lang.Object pExternalValue,
java.lang.Object pResult,
java.lang.Object pParent,
Command pRemoteCommand)
copy the value into the correct property
|
boolean |
isAllowMessageSending()
This class cannot send messages if this is false.
|
void |
sendMessage(atg.adapter.integrations.IntegrationRepository pRepository,
atg.adapter.integrations.IntegrationRepositoryMessage pMessage)
Sends an object message out on
messagePort |
void |
setAllowMessageSending(boolean pAllowMessageSending) |
void |
setMessagePort(java.lang.String pMessagePort) |
void |
setMessageSourceContext(MessageSourceContext pMessageSourceContext)
Set the message source context for this source.
|
void |
startMessageSource()
This is called to tell the MessageSource that it may begin sending
messages.
|
void |
stopMessageSource()
This is called to tell the MessageSource that it should stop sending
messages.
|
MutableRepositoryItem |
updateExternalId(atg.adapter.integrations.IntegrationRepository pRepository,
MutableRepositoryItem pItem,
atg.adapter.integrations.IntegrationRepositoryItemDescriptor pItemDescriptor,
java.lang.String pExternalId,
boolean pAllowNewItem)
Update the given repository item with the given external id.
|
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public static final java.lang.String CLASS_VERSION
public void setMessagePort(java.lang.String pMessagePort)
public java.lang.String getMessagePort()
public java.lang.Object getCommandResultObject(CommandResult pResult)
pResult
- The result of a command.public MutableRepositoryItem updateExternalId(atg.adapter.integrations.IntegrationRepository pRepository, MutableRepositoryItem pItem, atg.adapter.integrations.IntegrationRepositoryItemDescriptor pItemDescriptor, java.lang.String pExternalId, boolean pAllowNewItem) throws RepositoryException
pItem
- The item being updatedpItemDescriptor
- The IntegrationRepositoryItemDescriptor for pItempExternalId
- The new external idpAllowNewItem
- If true, then it is possible that a new item will be created if
the item uses external id as the id, and it is not correct.RepositoryException
public void externalIdWasUpdated(atg.adapter.integrations.IntegrationRepository pRepository, RepositoryItem pItem, java.lang.String pOldValue, java.lang.String pNewValue) throws RepositoryException
sendScenarioEvents
is true.pRepository
- The integration repository containing the updated itempItem
- The item whose external id changedpOldValue
- The old value for the external idpNewValue
- The new value for the external idRepositoryException
public java.lang.String getExternalIdFromResult(java.lang.Object pResult, atg.adapter.integrations.IntegrationRepositoryItemDescriptor pItemDescriptor) throws RepositoryException
RepositoryException
public RepositoryItem createRepositoryItem(java.lang.Object pCommandResult, atg.adapter.integrations.IntegrationRepositoryItemDescriptor pItemDescriptor, MutableRepositoryItem pLocalItem, Command pRemoteCommand) throws RepositoryException
pCommandResult
- This is the result of the command to retrieve data from the remote
systempItemDescriptor
- This is the item descriptor of the item being createdpLocalItem
- This is only relevant during a "getItem". We don't need to get the
local item twicepRemoteCommand
- This is the command that retrieved pCommandResult and is provided
in case this method needs to be extended.RepositoryException
public RepositoryItem[] createRepositoryItems(java.lang.Object pCommandResult, atg.adapter.integrations.IntegrationRepositoryItemDescriptor pItemDescriptor, MutableRepositoryItem pLocalItem, Command pRemoteCommand) throws RepositoryException
pCommandResult
- This is the result of the command to retrieve data from the remote
systempItemDescriptor
- This is the item descriptor of the item being createdpLocalItem
- This is only relevant during a "getItem". We don't need to get the
local item twicepRemoteCommand
- This is the command that retrieved pCommandResult and is provided
in case this method needs to be extended.RepositoryException
public java.lang.Object createGetCommandInput(java.lang.String pId, java.lang.String pExternalIdPropertyName, atg.adapter.integrations.IntegrationRepositoryItemDescriptor pItemDescriptor, Command pGetCommand)
pId
- String of the item's ID to get.pExternalIdPropertyName
- String of the name of the ID property in the external system.pItemDescriptor
- IntegrationRepositoryItemDescriptor of the item to get.pGetCommand
- Command (object) of the get command that was invoked and is
provided in case this method needs to be extended.public java.lang.Object createRemoveCommandInputSimple(java.lang.String pId, java.lang.String pExternalIdPropertyName)
public java.lang.Object createRemoveCommandInput(java.lang.String pId, java.lang.String pExternalIdPropertyName, atg.adapter.integrations.IntegrationRepositoryItemDescriptor pItemDescriptor, Command pGetCommand)
pId
- String of the item's ID to remove.pExternalIdPropertyName
- String of the name of the ID property in the external system.pItemDescriptor
- IntegrationRepositoryItemDescriptor of the item to remove.pGetCommand
- Command (object) of the remove command that was invoked and is
provided in case this method needs to be extended.protected void copyRemoteProperties(MutableRepositoryItem pTargetItem, java.lang.Object pSourceObject, atg.adapter.integrations.IntegrationRepositoryItemDescriptor pTargetDescriptor, Command pRemoteCommand) throws RepositoryException
pTargetItem
- MutableRepositoryItem of local item to which the properties will
be copied.pSourceObject
- Object from the remote system from which the property values will
be copied.pTargetDescriptor
- IntegrationRepositoryItemDescriptor used to define the
relationship between the local and remote properties.pRemoteCommand
- Command that was invoked and is provided in case this method needs
to be extended.RepositoryException
- If there is an error in setting a value on the local repository
item.protected void copyRemoteProperties(MutableRepositoryItem pTargetItem, java.lang.Object pSourceObject, atg.adapter.integrations.IntegrationRepositoryItemDescriptor pTargetDescriptor, Command pRemoteCommand, boolean setExternalId) throws RepositoryException
pTargetItem
- MutableRepositoryItem of local item to which the properties will
be copied.pSourceObject
- Object from the remote system from which the property values will
be copied.pTargetDescriptor
- IntegrationRepositoryItemDescriptor used to define the
relationship between the local and remote properties.pRemoteCommand
- Command that was invoked and is provided in case this method needs
to be extended.setExternalId
- boolean flag indicating if the external ID should be set as part
of this call.RepositoryException
- If there is an error in setting a value on the local repository
item.protected boolean handleValue(MutableRepositoryItem pItem, RepositoryPropertyDescriptor pPropDescriptor, java.lang.Object pExternalValue, java.lang.Object pResult, java.lang.Object pParent, Command pRemoteCommand) throws RepositoryException
pItem
- The item whose property will be updated.pPropDescriptor
- The property that will be updatedpExternalValue
- The new value for the propertypResult
- The object that contained the value.pParent
- the parent of pItem if applicable, usually nullpRemoteCommand
- Command (object) for which the value is being handled and is
provided in case this method needs to be extended.RepositoryException
protected java.lang.Object createRepositoryValue(RepositoryPropertyDescriptor pPropertyDescriptor, java.lang.String pRemoteValue)
pPropertyDescriptor
- The property that will be setpRemoteValue
- The value of the remote datapublic void setMessageSourceContext(MessageSourceContext pMessageSourceContext)
setMessageSourceContext
in interface MessageSource
MessageSource
public MessageSourceContext getMessageSourceContext()
public void setAllowMessageSending(boolean pAllowMessageSending)
public boolean isAllowMessageSending()
public void startMessageSource()
startMessageSource
in interface MessageSource
public void stopMessageSource()
stopMessageSource
in interface MessageSource
public void sendMessage(atg.adapter.integrations.IntegrationRepository pRepository, atg.adapter.integrations.IntegrationRepositoryMessage pMessage) throws javax.jms.JMSException
messagePort
pObjectMessage
- the object to be placed in the object message.javax.jms.JMSException
- is thrown when a failure to send the message occurs. This is
generally a configuration issue.