atg.integrations
Class ExternalRepositoryUpdate

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.integrations.ExternalRepositoryUpdate
All Implemented Interfaces:
NameContextBindingListener, NameContextElement, NameResolver, AdminableService, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, java.util.EventListener

public class ExternalRepositoryUpdate
extends GenericService

This class processes messages sent by external systems when synchronized objects are updated or added. The incoming message body is assumed to be a string containing XML describing repository item properties and their new values.


Field Summary
static java.lang.String ADD
          Set operationMode to this to do an Add
static java.lang.String CLASS_VERSION
           
static java.lang.String UPDATE
          Set operationMode to this to do an Update
static java.lang.String UPSERT
          Set operationMode to this to do an Upsert
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
ExternalRepositoryUpdate()
           
 
Method Summary
protected  RepositoryItem addItem(java.lang.String pInput)
          Adds a repository item according to the input message.
 AddService getAddService()
          The service that adds a new repository item given an xml document
 java.lang.String getExternalIdProperty()
          The name of the repository item's external ID property
 java.lang.String getIdConfirmedProperty()
          The name of the repository item's "external ID is valid" property
 java.lang.String getMappingFile()
          The mapping file that should be used for the input
 java.lang.String[] getMatchProperties()
          The name of the properties used to locate a repository item if externalId didn't work
 java.lang.String getOperationMode()
          This identifies how this component behaves.
 atg.adapter.integrations.IntegrationRepository getRepository()
          Returns property Repository
 RepositoryXMLTools getRepositoryXMLTools()
          The tools class for dealing with xml files
 UpdateService getUpdateService()
          The service that updates a repository item given an xml document
 void processMessage(java.lang.String pInput)
          Process a repository item update or add.
 void setAddService(AddService pAddService)
           
 void setExternalIdProperty(java.lang.String pExternalIdProperty)
          Set the name of the externalIdProperty.
 void setIdConfirmedProperty(java.lang.String pIdConfirmedProperty)
          Set the name of the property that validates the external ID
 void setMappingFile(java.lang.String pMappingFile)
           
 void setMatchProperties(java.lang.String[] pMatchProperties)
          Set the name of the matchProperties.
 void setOperationMode(java.lang.String pOperationMode)
           
 void setRepository(atg.adapter.integrations.IntegrationRepository pRepository)
          Sets property Repository
 void setRepositoryXMLTools(RepositoryXMLTools pRepositoryXMLTools)
           
 void setUpdateService(UpdateService pUpdateService)
           
protected  void updateItem(RepositoryItem pItem, java.lang.String pInput)
          Updates a local repository item according to the input message.
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION

UPSERT

public static final java.lang.String UPSERT
Set operationMode to this to do an Upsert

See Also:
Constant Field Values

UPDATE

public static final java.lang.String UPDATE
Set operationMode to this to do an Update

See Also:
Constant Field Values

ADD

public static final java.lang.String ADD
Set operationMode to this to do an Add

See Also:
Constant Field Values
Constructor Detail

ExternalRepositoryUpdate

public ExternalRepositoryUpdate()
Method Detail

setOperationMode

public void setOperationMode(java.lang.String pOperationMode)

getOperationMode

public java.lang.String getOperationMode()
This identifies how this component behaves. The choices are: UPSERT - Look for the item, if you find it, do an UPDATE if not, do an ADD. UPDATE - Assume the item exists and call the UpdateService ADD - Assume the item does not exist and call the AddService The default mode is UPSERT


getExternalIdProperty

public java.lang.String getExternalIdProperty()
The name of the repository item's external ID property

Returns:
the name of the repository item's external ID property

setExternalIdProperty

public void setExternalIdProperty(java.lang.String pExternalIdProperty)
Set the name of the externalIdProperty.

Parameters:
pExternalIdProperty -

getIdConfirmedProperty

public java.lang.String getIdConfirmedProperty()
The name of the repository item's "external ID is valid" property

Returns:
the name of the repository item's "external ID is valid" property

setIdConfirmedProperty

public void setIdConfirmedProperty(java.lang.String pIdConfirmedProperty)
Set the name of the property that validates the external ID

Parameters:
pIdConfirmedProperty -

getMatchProperties

public java.lang.String[] getMatchProperties()
The name of the properties used to locate a repository item if externalId didn't work

Returns:
the name of the repository item match properties

setMatchProperties

public void setMatchProperties(java.lang.String[] pMatchProperties)
Set the name of the matchProperties.

Parameters:
pMatchProperties -

setRepository

public void setRepository(atg.adapter.integrations.IntegrationRepository pRepository)
Sets property Repository


getRepository

public atg.adapter.integrations.IntegrationRepository getRepository()
Returns property Repository


setAddService

public void setAddService(AddService pAddService)

getAddService

public AddService getAddService()
The service that adds a new repository item given an xml document


setUpdateService

public void setUpdateService(UpdateService pUpdateService)

getUpdateService

public UpdateService getUpdateService()
The service that updates a repository item given an xml document


setRepositoryXMLTools

public void setRepositoryXMLTools(RepositoryXMLTools pRepositoryXMLTools)

getRepositoryXMLTools

public RepositoryXMLTools getRepositoryXMLTools()
The tools class for dealing with xml files


setMappingFile

public void setMappingFile(java.lang.String pMappingFile)

getMappingFile

public java.lang.String getMappingFile()
The mapping file that should be used for the input


processMessage

public void processMessage(java.lang.String pInput)
Process a repository item update or add. The input is expected to be an XML String containing property names and values. The method first looks for the existing item. If the item exists, the UpdateService is called, otherwise the AddService is called.

Parameters:
pInput - XML describing updated properties
See Also:
RepositoryXMLTools.getRepositoryItemsFromXML(java.lang.String, java.lang.String[]), AddService, UpdateService

addItem

protected RepositoryItem addItem(java.lang.String pInput)
                          throws AddException,
                                 RepositoryException
Adds a repository item according to the input message. This method handles only the simple case of a single item type (no subtypes) and no required properties. More complex cases require overriding this method.

Throws:
AddException
RepositoryException

updateItem

protected void updateItem(RepositoryItem pItem,
                          java.lang.String pInput)
                   throws UpdateException,
                          RepositoryException
Updates a local repository item according to the input message. Updates the IntegrationRepository item's external ID if that property is in the input message.

Throws:
UpdateException
RepositoryException