atg.repository
Class RepositoryImpl

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.repository.RepositoryImpl
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, atg.repository.DisplayableRepository, atg.repository.ProxyableRepository, Repository, RepositoryViewContainer, java.util.EventListener

public abstract class RepositoryImpl
extends GenericService
implements Repository, atg.repository.DisplayableRepository, atg.repository.ProxyableRepository

This is a base class which you can use to start your implementation of a repository.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
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
RepositoryImpl()
           
 
Method Summary
 void addItemDescriptor(RepositoryItemDescriptor pItemDescriptor)
          Use this to add a new RepositoryItemDescriptor.
 void addView(RepositoryView pView)
          Use this to add a new RepositoryView.
 void copyFromOtherRepository(RepositoryImpl pSrc)
          This method copies all data from another similar repository.
 void debug(java.lang.String pMsg, int pLevel)
          Log a debug message it the debugLevel is greater than or equal to the specified level
 java.lang.String getComponentResourceBundleName()
          Get property componentResourceBundleName
 int getDebugLevel()
          Get property debugLevel
 java.lang.String getDefaultViewName()
          Returns the name of the "default" or "root" RepositoryView
 Repository getExposedRepository()
          Returns the exposed repository.
 atg.repository.nucleus.RepositoryGroupContainer getGroupContainer()
          Returns the group registry.
 atg.repository.groups.GroupProperties getGroupProperties()
          Returns the group properties for this repository.
abstract  RepositoryItem getItem(java.lang.String pId)
          Returns an item in the Repository with the given id
 RepositoryItemDescriptor getItemDescriptor(RepositoryItemDescriptor pDesc)
          Returns a RepositoryItemDescriptor accessed with the name of the given descriptor.
 RepositoryItemDescriptor getItemDescriptor(java.lang.String pName)
          Returns a RepositoryItemDescriptor accessed with the given name.
 java.lang.String[] getItemDescriptorNames()
          Returns an array of the names of the known RepositoryItemDescriptors.
 RepositoryItem[] getItems(java.lang.String[] pIds)
          Returns the items in the Repository with the given ids.
 RepositoryItem[] getItems(java.lang.String[] pIds, java.lang.String pDescriptorName)
          Returns the items in the Repository with the given ids.
 java.lang.String getRepositoryDisplayName()
          Get property repositoryDisplayName
 java.lang.String getRepositoryDisplayNameResource()
          Get property repositoryDisplayNameResource
 java.lang.String getRepositoryName()
          Returns the name of this Repository
 javax.transaction.TransactionManager getTransactionManager()
          Get property transactionManager
 RepositoryView getView(RepositoryItemDescriptor pDesc)
          Returns a RepositoryView accessed with the name of the given descriptor.
 RepositoryView getView(java.lang.String pName)
          Returns a RepositoryView accessed with the given name.
 java.lang.String[] getViewNames()
          Returns an array of the names of all contained top-level views
 void invalidateCaches()
          Invalidates all caches in this repository.
 void invalidateCaches(boolean pGlobal)
          Invalidates all caches in this repository and if global is true, it sends an invalidation event to all servers.
 boolean isDisableRepositoryGroupsCache()
          get DisableRepositoryGroupsCache
 void setComponentResourceBundleName(java.lang.String pComponentResourceBundleName)
          Set property componentResourceBundleName
 void setDebugLevel(int pDebugLevel)
          Set property debugLevel
 void setDefaultViewName(java.lang.String pDefaultViewName)
          Sets the property DefaultViewName.
 void setDisableRepositoryGroupsCache(boolean pDisableRepositoryGroupsCache)
          set DisableRepositoryGroupsCache - if this is set to true then this Repository will not cache its RepositoryGroups and instead will try to load them on demand each time
 void setExposedRepository(Repository pExposedRepository)
          Sets the exposed repository.
 void setGroupContainer(atg.repository.nucleus.RepositoryGroupContainer pGroupContainer)
          Sets the group registry.
 atg.repository.groups.GroupProperties setGroupProperties(atg.repository.groups.GroupProperties pGroupProperties)
          Set the group properties for this repository.
 void setRepositoryDisplayNameResource(java.lang.String pRepositoryDisplayNameResource)
          Set property repositoryDisplayNameResource
 void setRepositoryName(java.lang.String pRepositoryName)
          Sets the property RepositoryName.
 void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
          Set property transactionManager
 
Methods inherited from class atg.nucleus.GenericService
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
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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
 
Methods inherited from interface atg.repository.Repository
getItem
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

RepositoryImpl

public RepositoryImpl()
Method Detail

setRepositoryName

public void setRepositoryName(java.lang.String pRepositoryName)
Sets the property RepositoryName.

Parameters:
pRepositoryName - new value to set

getRepositoryName

public java.lang.String getRepositoryName()
Returns the name of this Repository

Specified by:
getRepositoryName in interface Repository

getRepositoryDisplayName

public java.lang.String getRepositoryDisplayName()
Get property repositoryDisplayName

Specified by:
getRepositoryDisplayName in interface atg.repository.DisplayableRepository
Returns:
the display name of this repository

setRepositoryDisplayNameResource

public void setRepositoryDisplayNameResource(java.lang.String pRepositoryDisplayNameResource)
Set property repositoryDisplayNameResource

Parameters:
pRepositoryDisplayNameResource - the name of the resource that contains the display name for this repository

getRepositoryDisplayNameResource

public java.lang.String getRepositoryDisplayNameResource()
Get property repositoryDisplayNameResource

Returns:
the name of the resource that contains the display name for this repository

setComponentResourceBundleName

public void setComponentResourceBundleName(java.lang.String pComponentResourceBundleName)
Set property componentResourceBundleName

Parameters:
pComponentResourceBundleName - the name of the resource bundle that holds the display name resource

getComponentResourceBundleName

public java.lang.String getComponentResourceBundleName()
Get property componentResourceBundleName

Returns:
the name of the resource bundle that holds the display name resource

setDisableRepositoryGroupsCache

public void setDisableRepositoryGroupsCache(boolean pDisableRepositoryGroupsCache)
set DisableRepositoryGroupsCache - if this is set to true then this Repository will not cache its RepositoryGroups and instead will try to load them on demand each time

Parameters:
pDisableRepositoryGroupsCache - the DisableRepositoryGroupsCache

isDisableRepositoryGroupsCache

public boolean isDisableRepositoryGroupsCache()
get DisableRepositoryGroupsCache

Returns:
the DisableRepositoryGroupsCache

getItem

public abstract RepositoryItem getItem(java.lang.String pId)
                                throws RepositoryException
Returns an item in the Repository with the given id

Specified by:
getItem in interface Repository
Parameters:
pId - the id of the item to retrieve
Returns:
null if no item can be found
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryItem

getItems

public RepositoryItem[] getItems(java.lang.String[] pIds)
                          throws RepositoryException
Returns the items in the Repository with the given ids. This implementation repeatedly calls the getItem method. If your subclass can optimize this operation, you should override this implementation.

Specified by:
getItems in interface Repository
Returns:
null if no items with the given ids exist
Throws:
RepositoryException - if there was an error while attempting to retrieve the RepositoryItems

getItems

public RepositoryItem[] getItems(java.lang.String[] pIds,
                                 java.lang.String pDescriptorName)
                          throws RepositoryException
Returns the items in the Repository with the given ids. This implementation repeatedly calls the getItem method. If your subclass can optimize this operation, you should override this implementation.

Specified by:
getItems in interface Repository
Parameters:
pIds - the list of ids
pDescriptorName - the item descriptor containing these ids
Returns:
null if no items with the given ids exist
Throws:
RepositoryException - if there was an error while attempting to retrieve the RepositoryItems

setDefaultViewName

public void setDefaultViewName(java.lang.String pDefaultViewName)
Sets the property DefaultViewName.

Parameters:
pDefaultViewName - new value to set

getDefaultViewName

public java.lang.String getDefaultViewName()
Returns the name of the "default" or "root" RepositoryView

Specified by:
getDefaultViewName in interface Repository

getViewNames

public java.lang.String[] getViewNames()
Returns an array of the names of all contained top-level views

Specified by:
getViewNames in interface Repository
Specified by:
getViewNames in interface RepositoryViewContainer
Returns:
null if no sub-views exist

getView

public RepositoryView getView(java.lang.String pName)
                       throws RepositoryException
Returns a RepositoryView accessed with the given name.

Specified by:
getView in interface Repository
Specified by:
getView in interface RepositoryViewContainer
Parameters:
pName - the name of the view to find
Returns:
null if the requested view does not exist
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryView

getView

public RepositoryView getView(RepositoryItemDescriptor pDesc)
                       throws RepositoryException
Description copied from interface: Repository
Returns a RepositoryView accessed with the name of the given descriptor.

Specified by:
getView in interface Repository
Parameters:
pDesc - the descriptor of the view to find
Returns:
null if the requested view does not exist
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryView

addView

public void addView(RepositoryView pView)
Use this to add a new RepositoryView. You should override this method in your implementation and verify that the view is of the correct subclass to be added, then call this method.


getItemDescriptorNames

public java.lang.String[] getItemDescriptorNames()
Returns an array of the names of the known RepositoryItemDescriptors. There should always be at least one item descriptor per Repository.

Specified by:
getItemDescriptorNames in interface Repository

getItemDescriptor

public RepositoryItemDescriptor getItemDescriptor(java.lang.String pName)
                                           throws RepositoryException
Returns a RepositoryItemDescriptor accessed with the given name.

Specified by:
getItemDescriptor in interface Repository
Parameters:
pName - the name of the descritpro to find
Returns:
null if the requested descritpro does not exist
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryItemDescriptor

getItemDescriptor

public RepositoryItemDescriptor getItemDescriptor(RepositoryItemDescriptor pDesc)
                                           throws RepositoryException
Description copied from interface: Repository
Returns a RepositoryItemDescriptor accessed with the name of the given descriptor.

Specified by:
getItemDescriptor in interface Repository
Parameters:
pDesc - the descriptor to find
Returns:
null if the requested descriptor does not exist
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryItemDescriptor

addItemDescriptor

public void addItemDescriptor(RepositoryItemDescriptor pItemDescriptor)
Use this to add a new RepositoryItemDescriptor. You should override this method in your implementation and verify that the view is of the correct subclass to be added, then call this method.


getGroupContainer

public atg.repository.nucleus.RepositoryGroupContainer getGroupContainer()
Returns the group registry.


setGroupContainer

public void setGroupContainer(atg.repository.nucleus.RepositoryGroupContainer pGroupContainer)
Sets the group registry.


getExposedRepository

public Repository getExposedRepository()
Returns the exposed repository.

Specified by:
getExposedRepository in interface atg.repository.ProxyableRepository

setExposedRepository

public void setExposedRepository(Repository pExposedRepository)
Sets the exposed repository.


setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Set property transactionManager

Parameters:
pTransactionManager - new value to set

getTransactionManager

public javax.transaction.TransactionManager getTransactionManager()
Get property transactionManager

Returns:
transactionManager

getGroupProperties

public atg.repository.groups.GroupProperties getGroupProperties()
Returns the group properties for this repository.


setGroupProperties

public atg.repository.groups.GroupProperties setGroupProperties(atg.repository.groups.GroupProperties pGroupProperties)
Set the group properties for this repository.


invalidateCaches

public void invalidateCaches()
Invalidates all caches in this repository.


invalidateCaches

public void invalidateCaches(boolean pGlobal)
Invalidates all caches in this repository and if global is true, it sends an invalidation event to all servers.


copyFromOtherRepository

public void copyFromOtherRepository(RepositoryImpl pSrc)
This method copies all data from another similar repository. It is used when one repository restarts itself.


setDebugLevel

public void setDebugLevel(int pDebugLevel)
Set property debugLevel

Parameters:
pDebugLevel - new value to set

getDebugLevel

public int getDebugLevel()
Get property debugLevel

Returns:
debugLevel

debug

public void debug(java.lang.String pMsg,
                  int pLevel)
Log a debug message it the debugLevel is greater than or equal to the specified level

Parameters:
pMsg - message to log
pLevel - debug level of message