extends RepositoryImpl

The IntegrationRepository references another repository, which is referred to as the local repository and which is a SQL repository. The IntegrationRepository is defined by a Nucleus properties file and an XML definition file. Each method call functions as described in the Methods section, forwarding the request either to the local repository or to the IntegrationRepositoryItemDescriptor, which then executes a Command against the remote system.

Properties

localRepository
The SQL repository that acts as a local repository. The local repository is a normal SQL repository. It might be configured in a properties file like this:

//mystuff/MyLocalRepository.properties

$class=atg.adapter.gsa.GSARepository

definitionFiles=/mystuff/localConfig.xml
repositoryName=MyLocalStuff
groupContainerPath=/atg/registry/RepositoryGroups
XMLToolsFactory=/atg/dynamo/service/xml/XMLToolsFactory
transactionManager=/atg/dynamo/transaction/TransactionManager
dataSource=/atg/dynamo/service/jdbc/JTDataSource
idGenerator=/atg/dynamo/service/IdGenerator

definitionFile
The Integration Repository definition file. This is an XML file that uses the Integration Repository DTD,
http://www.atg.com/dtds/integrations/integration-repository_1.0.dtd . See Integration Repository Definition File for information about creating an Integration Repository definition file

integrationRepositoryTools
This is a property of type atg.adapter.integrations.IntegrationRepositoryTools. This class provides a set of helper methods that are used to convert between the local repository items and the remote system’s data format. An instance of this class exists at /atg/integrations/repository/IntegrationRepositoryTools.

persistentCacheManager
This is a property of type atg.adapter.integrations.PersistentCacheManager. This class provides management of persistent caching. An instance of this class exists at /atg/integrations/repository/PersistentCacheManager. See the Persistent Caching section.

mappingManager
This is a property of type atg.repository.databinding.MappingManager. You can optionally define a mapping of the local repository item to the data on the remote system. This class manages that mapping. See Mapping in this chapter and see also the Repository to XML Data Binding chapter.

mappingTools
This is a property of type atg.repository.databinding.MappingTools, which is a helper class to manage the mappings. An instance of this class exists at /atg/integrations/repository/MappingTools.

defaultTimeoutResponse
The Integration Repository needs to deal with the case of a Command timing out before a result is returned from the remote system. If the Command times out, this property defines what the default behavior should be. There are four choices:

ROLLBACK

Rollback the current transaction.

INVALID

Mark the item’s state as invalid. See Persistent Caching.

UNKNOWN

Mark the item’s state as unknown. See Persistent Caching.

IGNORE

Do nothing.

sendScenarioEvents
A boolean property that controls whether the repository sends scenario events. The Integration Framework includes one scenario event by default, atg.adapter.integrations.IntegrationExternalIdChange, which is sent when the externalId of an item is set. To trigger this event, use the IntegrationRepositoryTools.externalIDWasUpdated method.

Methods

Most methods in the IntegrationRepository class are pass-throughs to the local repository. The following methods provide special behavior:

getItem
Depending on how you have configured the Integration Repository, this method either:

Both the local repository’s query cache and the IntegrationRepository’s query cache will be used depending on the item descriptor. If the IntegrationRepository definition file includes a query Command, then the IntegrationRepository executes the query (and uses its query cache). If there is no query Command, then the query is forwarded to the local repository.

For a more detailed description, see getItem in the Command Operations section.

getView
This method can operate in two ways. If querying is implemented in the local repository (no query command) then this returns a LocalRepositoryViewWrapper. If a Command is used for querying then this returns the configured RepositoryView class.

getItemDescriptor
Return an IntegrationRepositoryItemDescriptor that wraps an item descriptor from the local repository. The local repository’s item cache will be used.

getItemForUpdate
getItemsForUpdate
Return one (or more) IntegrationRepositoryItem, using similar behavior to the getItem method above.

createItem
Call localRepository.createItem. This method is just a pass through. See addItem.

addItem
Call localRepository.addItem. Also call IntegrationRepositoryItemDescriptor.addRemoteItem. For a more detailed description, see addItem in the Command Operations section.

updateItem
Call localRepository.updateItem. Also call IntegrationRepositoryItemDescriptor.updateRemoteItem. For a more detailed description, see updateItem in the Command Operations section.

removeItem
Call localRepository.removeItem. Also call IntegrationRepositoryItemDescriptor.removeRemoteItem. For a more detailed description, see removeItem in the Command Operations section.

Each of the Command executions is relevant only if the given command is defined for the item descriptor.