atg.adapter.gsa
Class GSAItemDescriptor

java.lang.Object
  extended by atg.repository.ItemDescriptorImpl
      extended by atg.adapter.gsa.GSAItemDescriptor
All Implemented Interfaces:
atg.adapter.gsa.Constants, DynamicBeanInfo, atg.repository.content.ContentPropertyItemDescriptor, RepositoryItemDescriptor, atg.repository.RepositoryItemDescriptorContainer, java.io.Serializable, java.lang.Comparable<java.lang.Object>

public class GSAItemDescriptor
extends ItemDescriptorImpl
implements java.io.Serializable, atg.adapter.gsa.Constants, atg.repository.RepositoryItemDescriptorContainer, java.lang.Comparable<java.lang.Object>, atg.repository.content.ContentPropertyItemDescriptor

An ItemDescriptor which defines a kind of item in a GSARepository. A GSARepository can have one or more of these.

See Also:
GSARepository, Serialized Form

Nested Class Summary
static class GSAItemDescriptor.DirectSqlResult
           
static class GSAItemDescriptor.ItemRefList
           
static class GSAItemDescriptor.PropIdRef
           
 
Field Summary
static java.lang.String CACHE_LOCALITY_EXTERNAL
           
static java.lang.String CACHE_LOCALITY_INTERNAL
           
static java.lang.String CACHE_LOCALITY_MIXED
           
static java.lang.String CACHE_MODE_DISABLED
           
static java.lang.String CACHE_MODE_DISTRIBUTED
           
static java.lang.String CACHE_MODE_DISTRIBUTED_EXTERNAL
           
static java.lang.String CACHE_MODE_DISTRIBUTED_HYBRID
           
static java.lang.String CACHE_MODE_DISTRIBUTED_JMS
           
static java.lang.String CACHE_MODE_LOCKED
           
static java.lang.String CACHE_MODE_SIMPLE
           
static java.lang.String CLASS_VERSION
          Class version string
 
Fields inherited from class atg.repository.ItemDescriptorImpl
mPropertiesChangedListeners, mPropertyDescriptors, mPropertyDescriptorTable, mPropertyNames
 
Fields inherited from interface atg.adapter.gsa.Constants
ATTR_CASCADE_DELETE_ORDER, ATTR_CSW_PROPERTIES, ATTR_CSW_QUERIES, ATTR_CURRENT_ITEM_CACHE_SIZE, ATTR_CURRENT_ITEM_CACHE_TIMEOUT, ATTR_DEFAULT_UNCACHED_ITEM_QUERIES, ATTR_HEAD_OF_LINE_CACHE_SIZE, ATTR_HEAD_OF_LINE_CACHE_TIMEOUT, ATTR_LOADING_STRATEGY, ATTR_SPLIT_QUERIES, ATTR_TEXT_HANDLE_COLUMN, ATTR_TEXT_INDEX_TABLE, ATTR_UPDATE_LAST_MODIFIED, CASCADE_DELETE_AFTER_AUX_BEFORE_PRI, CASCADE_DELETE_FIRST, CASCADE_DELETE_LAST, CASCADE_DELETE_ORDER_NAMES, DEFAULT_EVENT_SERVER, DEFAULT_GSA_CACHE_CLIENT_MANAGER, DEFAULT_INVALIDATOR_SERVICE, ERR_ADD_MISSING_PROPERTIES, ERR_ADD_NON_TRANSIENT, ERR_ARGS_FOR_NON_PARAMETER_QUERY, ERR_BAD_EVENT_DATA, ERR_BAD_TABLE, ERR_CACHE_LOCALITY_MODE_CONFLICT, ERR_CIRCULAR_REFERENCE, ERR_CLASS_NOT_FOUND, ERR_COMPARE_MULTI, ERR_COMPARE_NONCOMPARABLE, ERR_CONTENT_PROPERTIES_NOT_DEFINED, ERR_COULD_NOT_UNSUBSCRIBE, ERR_DEPENDENT_PROP_NOT_EXISTS, ERR_DEPENDENT_PROP_NULL, ERR_DS_PREPARE, ERR_DS_SWITCH, ERR_DUPLICATES, ERR_FOLDER_PROPERTIES_NOT_DEFINED, ERR_HANDLING_INVALIDATE_CACHE_ENTRY, ERR_ID_SPACE_CONFIGURATION, ERR_ILLEGAL_PARAM_TYPE, ERR_INITIALIZING_ID_GENERATOR, ERR_INVALID_COMPARISON_QUERY, ERR_INVALID_DATA_TYPE_NAME, ERR_INVALID_ITEM, ERR_INVALID_ITEM_DESCRIPTOR_NAME, ERR_INVALID_KEY, ERR_INVALID_KEY_ELEMENT, ERR_INVALID_KEY_ENCODING, ERR_INVALID_KEY_VALUES, ERR_INVALID_LIST_INDEX, ERR_INVALID_PATTERNMATCH_QUERY, ERR_INVALID_PROPERTY, ERR_INVALID_QUERY, ERR_INVALID_QUERY_ELEMENT, ERR_INVALID_TEXT_SEARCH_QUERY, ERR_INVALID_TM_DS_COMBO, ERR_ITEM_NOT_EXIST, ERR_LOAD_COLUMN_INFO, ERR_MISSING_ID_SPACE, ERR_NO_ARGS_FOR_QUERY, ERR_NO_DATABASE_TABLE_INFO, ERR_NO_DATATYPE_FOR_PROPERTY, ERR_NO_DB2_HANDLE, ERR_NO_DEFAULT_SEARCH_PROPERTIES, ERR_NO_EVENT_SERVER, ERR_NO_IDS, ERR_NO_LOWER_FUNCTION, ERR_NO_PARAMETER_EXPRESSION, ERR_NO_PARSER, ERR_NO_PRIMARY_TABLE, ERR_NO_SUB_PROPERTIES, ERR_NO_SUBSCRIBER_ITEM_DESCRIPTOR, ERR_NO_SYB_TEXT_INDEX, ERR_NO_TEMPLATE_FILES, ERR_NO_TRANSACTION, ERR_NO_TRANSIENT_QUERIES, ERR_NOT_DISTRIBUTED_MODE, ERR_NULL_ARGUMENT, ERR_NULL_ID, ERR_NULL_ITEM, ERR_NULL_QUERY_OPTIONS, ERR_PARSING_TEMPLATE, ERR_PROCEDURE_HELPER_INIT, ERR_PROPERTY_NOT_QUERYABLE, ERR_RETURN_PROP_NOT_EXISTS, ERR_RETURN_PROP_NOT_GSA, ERR_RETURN_PROP_NOT_READ, ERR_RETURN_PROP_NULL, ERR_RQL_FILTER, ERR_SQL_STRING_NULL, ERR_SUB_TYPE_PROPERTY_ON_NON_ROOT_TYPE, ERR_TABLE_KEY_UNMATCHED, ERR_TRANSACTION, ERR_TYPE_MATCHING, ERR_UNABLE_TO_READ_TEMPLATE_FILE, ERR_UNKNOWN_EVENT_TYPE, ERR_VERSION_PROPERTY_INVALID_TYPE, ERR_VIEW_IS_TRANSIENT, ERR_WRONG_NUMBER_ARGS_FOR_QUERY, FTS_LANG_DB2, FTS_LANG_MSSQL, FTS_LANG_MSSQL_INLINE, FTS_LANG_ORACLE, FTS_LANG_SYBASE, INFO_STARTUP_BEGIN, INFO_STARTUP_END, ISOLATION_LEVEL_NAMES, LOADING_STRATEGY_DEFAULT, LOADING_STRATEGY_EAGER, LOADING_STRATEGY_LAZY, READ_COMMITTED, REPEATABLE_READ, REPOSITORY_COMPONENT_NAME, RESOURCE_BUNDLE_NAME, SERIALIZABLE, SUBSCRIBER_ADDRESS_PROPERTY, SUBSCRIBER_ITEM_DESCRIPTOR_NAME, SUBSCRIBER_ITEM_DESCRIPTOR_PROPERTY, SUBSCRIBER_PORT_PROPERTY, SUBSCRIBER_REPOSITORY_PROPERTY, WARN_PROBLEM_SENDING_EVENT, WARN_RETURN_PROP_MULTI, WARN_RETURN_PROP_TRANSIENT
 
Constructor Summary
GSAItemDescriptor(atg.adapter.gsa.GSARepository pRepository)
          Creates a new item descriptor for the specified GSARepository.
 
Method Summary
 void addCascadeDeleteProperty(RepositoryPropertyDescriptor pDesc)
           
 void addCascadeInsertProperty(RepositoryPropertyDescriptor pDesc)
           
 void addCascadeUpdateProperty(RepositoryPropertyDescriptor pDesc)
           
protected  RepositoryItem addItem(atg.adapter.gsa.GSAItem pItem)
          Insert an item into the repository, using the the specified property values.
 RepositoryItem addItemOnCommit(atg.adapter.gsa.GSAItem pItem)
          Insert an item into the repository, using the the specified property values.
 void addManyToOneProperty(RepositoryPropertyDescriptor pDesc)
           
 void addPropertiesChangedListener(PropertiesChangedListener pListener)
          These events are all sent and managed by the root of the type hierarchy since they may affect all item types in this class tree.
 void addPropertyDescriptor(RepositoryPropertyDescriptor pPropertyDescriptor)
          Adds the given property descriptor to the internal table of known descriptors
 void addReciprocalPropertyRelation(GSAPropertyDescriptor pOwnedProperty, GSAPropertyDescriptor pReciprocalProperty)
           
protected  void addReferencedItems(atg.adapter.gsa.GSAItem pItem, RepositoryPropertyDescriptor[] pDescs)
          Loops through all properties that have "cascade=update" set and adds the referenced items if they are not already there.
 void addTable(atg.adapter.gsa.Table pTable)
          Adds a new table onto the list.
 void addTableInvalidationListeners()
          Adds any table event listeners that need to be registered for all of the tables in this this item descriptor.
protected  void addTransientItem(atg.adapter.gsa.GSAItem pItem)
          Add transient item to Item Transaction State
 GSAItemDescriptor addTypeDescriptorEntry(java.lang.Object pKey, GSAItemDescriptor pValue)
          Adds a new entry to the type descriptor table.
 boolean allowRemoveNullsUpdate(RepositoryItemImpl pItem)
          Can we persist changes to multi-properties when removing null values via the removeNullValues property
 atg.adapter.gsa.query.Clause applyContextFilters(atg.adapter.gsa.query.Clause pQueryClause)
          Add query clauses to the given query to filter based on membership context
 void applyItemCacheFilter()
          Invalidate remaining item entry in ItemCacheFilter; Invalidate queryCache; Set ItemCacheFillter as OnDeckItemCacheFilter; Clear out OnDeckItemCacheFilter.
 void applyItemCacheFilterReady()
          Set mAddFilteredItem to true after SWITCH_READY event
protected  java.util.ArrayList<atg.adapter.gsa.GSAId> applyRange(java.util.ArrayList<atg.adapter.gsa.GSAId> pInitial, int pStartIndex, int pEndIndex)
          Takes a list of returned item IDs and applies a range operation to them.
 boolean areInstances(DynamicBeanInfo pBeanInfo)
          Determine whether the specified BeanInfo is a descendent of this object.
 boolean areInstances(GSAItemDescriptor pOtherDesc)
          Determine whether the specified item descriptor is a descendent of this object.
 boolean checkForPersistentItem(atg.adapter.gsa.GSAId pId)
          Check for the persistent item with the specified id from the database.
 void clearReferencesToItem(atg.adapter.gsa.GSAId pId, RepositoryPropertyDescriptor[] pDescs)
          Loops through all properties manyToOneProperties.
protected  void close(java.sql.Connection pConnection)
          Close a DB connection, logging SQLExceptions or any other exceptions.
protected  void close(atg.adapter.gsa.GSATransaction pTr, java.sql.Connection pConnection)
          Close a DB connection, logging SQLExceptions or any other exceptions.
protected  void close(java.sql.ResultSet pResultSet)
          Closes the ResultSet, logging SQLExceptions or any other exceptions.
protected  void close(java.sql.ResultSet pResultSet, atg.adapter.gsa.SQLStatement pStatement, java.sql.Connection pConnection)
          Close DB objects, logging SQLExceptions or any other exceptions.
protected  void close(java.sql.ResultSet pResultSet, atg.adapter.gsa.SQLStatement pStatement, java.sql.Connection pConnection, atg.adapter.gsa.GSATransaction pTransaction)
          Close DB objects, logging SQLExceptions or any other exceptions.
protected  void close(atg.adapter.gsa.SQLStatement pStatement)
          Close an SQLStatement, logging SQLExceptions or any other exceptions.
protected  void close(java.sql.Statement pStatement)
          Closes the Statement, logging SQLExceptions or any other exceptions.
protected  RepositoryItem[] collectReferencedItemsForRemoval(atg.adapter.gsa.GSAId pId, RepositoryPropertyDescriptor[] pDescs)
          Loops through all properties that have "cascade=delete" set and collects object for future removal.
 int compareTo(GSAItemDescriptor pOther)
          Compare this item descriptor to another item descriptor.
 int compareTo(java.lang.Object pOther)
          Compare this descriptor to another object.
 GSAPropertyDescriptor[] computeDefaultProperties()
          Compute a starting value default properties.
 boolean containsCaseInsensitiveSort(SortDirectives pDirectives)
          Determines if any of the given sort directives specify case-insensitiviy, as from CASE IGNORECASE in the RQL.
 boolean containsDerivedSortProperties(SortDirectives pDirectives)
          Determines if any of the given sort directives refers to a derived property
 java.util.Collection<atg.adapter.gsa.GSAItem> createLazyLoadedItems(java.util.Collection<atg.adapter.gsa.GSAId> pIds, javax.transaction.Transaction pTransaction)
          Creates a set of lazy-load stub items and returns it.
protected  void createReferencedItems(atg.adapter.gsa.GSAItem pItem, RepositoryPropertyDescriptor[] pDescs)
          Loops through all properties that have "cascade=insert" set and creates any new items necessary.
protected
<T> java.util.Map<java.lang.String,T>
createSizedMap(int pExpectedSize)
          Create an appropriately sized Map.
 void debug(java.lang.String pMsg, int pLevel)
           
 boolean dependsOn(GSAItemDescriptor pDesc, boolean pRequired, boolean pPrimaryTableOnly)
          Returns true if we have a reference from one of our property descriptors to the item-descriptor supplied (which may be of a different GSA repository).
 void disableItemCache()
          Disable the item cache.
 void disableQueryCache()
          Disable the query cache.
 java.lang.String dumpCaches()
          Dump the caches for this item descriptor
 java.lang.String dumpItemCacheFilter()
          Dump out contents of onDeckItemCacheFilter and itemCacheFilter
 java.lang.String encodeCompositeKey(java.lang.String[] pIdValues)
          Encode an array of ID values to be used as a Repository ID
 java.lang.Object[] evaluateRqlFilterParams()
          Evaluates our current rql filter params and returns all evaluated values
 int executeCountQuery(Query pQuery)
          Execute a query that returns the count of items that would be returned in the specifed query were executed.
 int executeCountQuery(Query pQuery, java.lang.Object[] pParameterValues)
          Execute a query that returns the count of items that would be returned in the specifed query were executed.
 atg.adapter.gsa.GSAItem[] executeDirectSqlQuery(atg.adapter.gsa.query.DirectSqlQuery pQuery, int pStartingIndex, int pEndingIndex, SortDirectives pSortDirectives, java.lang.Object[] pParameterValues, QueryOptions pOptions)
          Executes a direct sql query, which can contain user-defined returned properties and query dependencies
 java.util.Collection<atg.adapter.gsa.GSAId> executeQuery(atg.adapter.gsa.query.Clause pClause, SortDirectives pSortDirectives, int pStartIndex, int pEndIndex, java.sql.Connection pConnection, java.lang.Object[] pParameterValues, atg.adapter.gsa.GSATransaction pTr, QueryOptions pOptions)
          Execute a query and return the ids matching the answer in the order they were returned from the DB.
 atg.adapter.gsa.GSAItem[] executeQuery(Query pQuery, int pStartingIndex, int pEndingIndex, SortDirectives pSortDirectives)
          Execute the specified query and return the results.
 atg.adapter.gsa.GSAItem[] executeQuery(Query pQuery, int pStartingIndex, int pEndingIndex, SortDirectives pSortDirectives, java.lang.Object[] pParameterValues, QueryOptions pOptions)
          Execute the specified query and return the results.
 java.util.List<atg.adapter.gsa.GSAId> executeSingleQuery(atg.adapter.gsa.query.Clause pClause, SortDirectives pSortDirectives, int pStartIndex, int pEndIndex)
          Execute a query and return the results.
 java.util.List<atg.adapter.gsa.GSAId> executeSingleQuery(atg.adapter.gsa.query.Clause pClause, SortDirectives pSortDirectives, int pStartIndex, int pEndIndex, java.sql.Connection pConnection)
          Execute a query and return the results.
 java.util.List<atg.adapter.gsa.GSAId> executeSingleQuery(atg.adapter.gsa.query.Clause pClause, SortDirectives pSortDirectives, int pStartIndex, int pEndIndex, java.sql.Connection pConnection, java.lang.Object[] pParameterValues, atg.adapter.gsa.GSATransaction pTr, QueryOptions pOptions)
          Execute a query and return the results.
 java.util.List<atg.adapter.gsa.GSAId> executeSingleQuery(atg.adapter.gsa.query.Clause pClause, SortDirectives pSortDirectives, int pStartIndex, int pEndIndex, QueryOptions pOptions)
          Execute a query and return the results.
protected  atg.adapter.gsa.GSAItem filterCachedItem(java.lang.String pId, atg.adapter.gsa.GSAItem pItem)
          If item id is in the filter, remove current properties for the cache item and remove the cache entry in local cachere and remove the item id from the filter.
protected static Query findNestedQuery(atg.adapter.gsa.query.CompoundQuery pCompoundQuery, java.lang.Class<?> pQueryType)
           
 java.lang.String format(java.lang.String pMsgKey)
          Utility for formatting messages with no arguments
 java.lang.String format(java.lang.String pMsgKey, java.lang.Object pArg)
           
 java.lang.String format(java.lang.String pMsgKey, java.lang.Object[] pArgs)
          Utility for formatting predefined messages using our respository's resource bundle
 java.lang.String format(java.lang.String pMsgKey, java.lang.Object pArg1, java.lang.Object pArg2)
           
 java.lang.String generateDropSQL(atg.adapter.gsa.OutputSQLContext pSQLContext, atg.adapter.gsa.DatabaseTableInfo pDTI)
          Generate SQL to drop tables for this item descriptor
 atg.adapter.gsa.GSAId generateGSAId(atg.repository.CompositeKey pValue)
          Generate a GSAId based on another composite key
 atg.adapter.gsa.GSAId generateGSAId(java.lang.Object pValue)
          Generate a GSAId based on a single ID value
 atg.adapter.gsa.GSAId generateGSAId(java.lang.Object[] pValues)
          Generate a GSAId based on an array of values
 atg.adapter.gsa.GSAId generateGSAId(java.lang.Object[] pValues, boolean pRemoveNulls)
          Generate a GSAId based on an array of values
 java.lang.String generateSQL(atg.adapter.gsa.OutputSQLContext pSQLContext, atg.adapter.gsa.DatabaseTableInfo pDTI)
          Generate SQL for this item descriptor
 java.lang.String generateSQL(atg.adapter.gsa.OutputSQLContext pSQLContext, java.lang.String pDatabaseName)
          Generate SQL for this item descriptor
 GSAItemDescriptor getBaseDescriptor()
           
 Builder getBuilder()
          Get our query builder as the right type.
protected  atg.adapter.gsa.GSAItem getCachedItem(java.lang.String pId)
          Get an item from the cache, by id.
 java.util.List<java.lang.String> getCachedItemIds()
          Get list of item ids from cache Called internally only by GSARepository.dumpCachesForReload.
 java.lang.String getCacheLocality()
          Returns property CacheLocality
 java.lang.String getCacheMode()
          Returns property CacheMode
 boolean getCacheNullItems()
           
 boolean getCacheSwitchLoadQueries()
          Get property cacheSwitchLoadQueries
 int getCascadeDeleteOrder()
          Get property cascadeDeleteOrder This property controls when cascade delete operations are performed.
 RepositoryPropertyDescriptor[] getCascadeDeleteProperties()
           
 RepositoryPropertyDescriptor[] getCascadeInsertProperties()
           
 RepositoryPropertyDescriptor[] getCascadeUpdateProperties()
           
protected  RepositoryPropertyDescriptor getChildPropertyDescriptor(java.lang.String pName)
          Get the named property descriptor from the specified item descriptor or its sub-type item descriptors.
protected  java.sql.Connection getConnection(atg.adapter.gsa.GSATransaction pTr)
          Get a DB connection to use.
 RepositoryPropertyDescriptor getContentChecksumProperty()
           
 RepositoryPropertyDescriptor getContentLengthProperty()
           
 RepositoryPropertyDescriptor getContentNameProperty()
           
 RepositoryPropertyDescriptor getContentPathProperty()
           
 Query getContentPathQuery(java.lang.String pPath)
          Returns a query to retrieve an item for a path.
 RepositoryPropertyDescriptor getContentProperty()
           
 RepositoryPropertyDescriptor getContextMembershipProperty()
          Overridden to look for context membership property on parents of sub-types.
 boolean getDefaultItemDescriptor()
          Get property DefaultItemDescriptor.
 GSAPropertyDescriptor[] getDefaultProperties()
          Get property defaultProperties
 GSAPropertyDescriptor[] getDefaultTextSearchProperties()
          Get property defaultTextSearchProperties
 boolean getDefaultUncachedItemQueries()
           
 java.util.List<atg.repository.query.QueryDependency> getDependencies(Query pQuery)
          Generate query dependency list for this query used for query invalidation.
 java.lang.String getErrorCode()
          Returns an error code if this item descriptor is not valid.
 atg.adapter.gsa.query.Clause getFilterQuery()
          Get property filterQuery
 RepositoryPropertyDescriptor getFolderIdProperty()
           
 GSAPropertyDescriptor getGSAPropertyDescriptor(java.lang.String pName)
          Get a property descriptor as the right type
 atg.adapter.gsa.GSARepository getGSARepository()
          Get our repository as the right type.
 atg.adapter.gsa.GSAView getGSARepositoryView()
          Get our repository as the right type.
 atg.adapter.gsa.GSATransaction getGSATransaction()
          Gets the current GSATransaction.
 atg.adapter.gsa.GSATransaction getGSATransaction(boolean pCreate)
          Gets the current GSATransaction.
 boolean getHasCacheReferencesById()
           
 int getId()
          Get property Id
 atg.core.jdbc.ResultSetGetter[] getIdGetters()
          Get property idGetter
 GSAPropertyDescriptor getIdProperty()
          Get property idProperty
 atg.repository.query.IdQueryDependency getIdQueryDependency(Query pQuery, GSAItemDescriptor pContext)
          Get dependency for id query
 char getIdSeparator()
          Get property IdSpearator
 java.lang.String[] getIdSpaceNames()
          Get property idSpaceNames
 java.lang.Class<?>[] getIdTypes()
          Get property idTypes
 int getIsolationLevel()
           
 atg.adapter.gsa.GSAItem getItem(atg.adapter.gsa.GSAId pId, boolean pReadWrite)
          Get the item of our type with the specified id
 RepositoryItem getItemByPath(java.lang.String pPath)
           
protected  atg.adapter.gsa.ItemCache getItemCache()
          Get the cache to use.
 int getItemCacheSize()
           
 long getItemCacheTimeout()
           
 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 all child item descriptors.
 java.lang.String getItemDisplayNameProperty()
          Gets the property ItemDisplayNameProperty.
 long getItemExpireTimeout()
           
 java.util.Map<java.lang.String,atg.adapter.gsa.GSAItem> getItems(java.util.Collection<atg.adapter.gsa.GSAId> pIds, boolean pReadWrite)
          Returns the items for the collection of ids supplied (including any transient items).
 java.util.Map<java.lang.String,atg.adapter.gsa.GSAItem> getItems(java.util.Collection<atg.adapter.gsa.GSAId> pIds, boolean pReadWrite, boolean pGetTransientItems)
          Returns the items for the collection of ids supplied (including any transient items).
protected  java.util.Map<java.lang.String,atg.adapter.gsa.GSAItem> getItems(java.util.Collection<atg.adapter.gsa.GSAId> pIds, boolean pReadWrite, boolean pGetTransientItems, boolean pAllowLazyLoading)
          Get the items of our type with the specified ids.
 RepositoryPropertyDescriptor getLastModifiedProperty()
           
 GSAPropertyDescriptor getLastModifiedUpdateProperty()
           
 java.lang.String getLoadingStrategy()
          Get property loadingStrategy
 int getLoadItemBatchSize()
          Get property loadItemBatchSize
 ClientLockManager getLockManager()
           
 long getLockTimeout()
           
 RepositoryPropertyDescriptor[] getManyToOneProperties()
           
protected  atg.adapter.gsa.GSAId getNewId()
          Get a id suitable for creating items of this type.
protected  java.util.Map<atg.adapter.gsa.GSAId,java.lang.Boolean> getNullItems()
          Get the cache to use.
protected  atg.adapter.gsa.GSAItem getOrWaitForPersistentItem(atg.adapter.gsa.GSAId pId)
          This method is the main access point for getting a persistent version of the item.
 GSAItemDescriptor getParentDescriptor()
          Get property ParentDescriptor
 RepositoryItemDescriptor getParentItemDescriptor()
          This method is in the RepositoryItemDescriptorContainer interface for accessing this information.
protected  atg.adapter.gsa.GSAItem getPersistentItem(atg.adapter.gsa.GSAId pId)
          Load the persistent item with the specified id from the database.
protected  void getPersistentItems(java.util.List<atg.adapter.gsa.GSAId> pIds, java.util.Map<java.lang.String,atg.adapter.gsa.GSAItem> pItems, boolean pCacheResults)
          Load the specified items from the DB into the passed in Map, optionally caching the items using a normal GSA transaction.
protected  void getPersistentItems(java.util.List<atg.adapter.gsa.GSAId> pIds, java.util.Map<java.lang.String,atg.adapter.gsa.GSAItem> pItems, java.sql.Connection pConnection, boolean pCacheResults)
          Load the specified items from the DB into the passed in Map, optionally caching the items.
 atg.adapter.gsa.Table getPrimaryTable()
           
 DynamicPropertyDescriptor[] getPropertyDescriptors()
          Returns the all PropertyDescriptors
 java.lang.String[] getPropertyNames()
          Returns the list of the names of the known properties
 GSAPropertyDescriptor[] getReciprocalProperties(GSAPropertyDescriptor pOwnedProperty)
          Returns array of properties from various other item descriptors that use the same table data as the given property in this item descriptor.
 GSAPropertyDescriptor getReciprocalPropertyForItemDescriptor(GSAPropertyDescriptor pOwnedProperty, GSAItemDescriptor pReciprocalItemDescriptor)
          Returns a property from another item descriptor that shares the same data as a particular property in this item descriptor.
 RepositoryPropertyDescriptor getRepositoryPropertyDescriptor(java.lang.String pPropertyName)
          Returns the RepositoryPropertyDescriptor for the specified property.
 GSAItemDescriptor getRootDescriptor()
           
 java.lang.Object[] getRqlFilterParameters()
          Get property rqlFilterParameters
 java.lang.String getRqlFilterString()
          Get property rqlFilterString
 boolean getSplitQueries()
          Get property splitQueries If true repository queries are split into pieces for SQL generation as needed for correctness.
protected  boolean getStoreTransientItems()
           
 boolean getStoreTransientItemsOnCommit()
           
 java.lang.String getSubscriberXML()
           
 GSAItemDescriptor[] getSubTypeDescriptors()
           
 GSAPropertyDescriptor getSubTypeProperty()
           
 java.lang.Object getSubTypeValue()
           
 java.util.Set<java.lang.Object> getSubTypeValues()
           
 java.lang.String getSubTypeValueString()
           
 GSAItemDescriptor getSuperTypeDescriptor()
           
 atg.adapter.gsa.Table[] getTables()
           
protected  atg.adapter.gsa.GSAItem getTransientItem(java.lang.String pId)
           
 java.util.Map<java.lang.String,java.lang.ref.WeakReference<atg.adapter.gsa.GSAItem>> getTransientItems()
           
 java.util.Map<java.lang.Object,GSAItemDescriptor> getTypeDescriptorMap()
           
 java.lang.Object getTypeDescriptorMapKey(java.lang.Object pRawType)
          Converts a raw type value which is stored in the database for a sub-type-property, to a type object, which is used as the key in the typeDescriptorMap.
 boolean getUseCacheForDelete()
          Get property useCacheForDelete
 boolean getUseIdForPath()
           
 atg.adapter.version.VersionItemDescriptor getVersionDescriptorWrapper()
          Get property versionDescriptorWrapper
 RepositoryPropertyDescriptor getVersionProperty()
           
 boolean hasCompositeKey()
          Determine if this item type has a composite ID.
 void invalidateCachedItem(java.lang.String pId)
          Invalidates any cached properties we may have for this item.
 void invalidateCaches()
          Invalidates both the item and query caches for this item descriptor.
 void invalidateCaches(boolean pGlobal)
          Invalidates both the item and query caches for this item descriptor.
 void invalidateExternalItemCache()
          Invalidates any third-party external cache.
 void invalidateItem(java.lang.String pId, boolean pRemove)
          For the case of distributed-cache mode operation, this is used to notify other subscribers that they may need to flush this item from their caches
 void invalidateItemCache()
          Invalidates the item caches for this item descriptor.
 void invalidateItemCache(boolean pGlobal)
          Invalidates both the item and query caches for this item descriptor.
 void invalidateLocalCaches()
          Invalidates both the item and query caches for this item descriptor locally.
 void invalidateLocalItemCache()
          Invalidates the item caches for this item descriptor locally (only in this dynamo instance).
protected  boolean isCachedItemRemoved(atg.adapter.gsa.GSAItem pItem, boolean pReadWrite, javax.transaction.Transaction pTrans)
          Check to see if a cached item has been removed.
protected  boolean isCachedNull(atg.adapter.gsa.GSAId pId)
           
 boolean isCacheSwitchLoadQueries()
          Test property cacheSwitchLoadQueries
 boolean isContent()
           
 boolean isDefaultItemDescriptor()
          Test property DefaultItemDescriptor
 boolean isDisabledCacheMode()
          Returns true if property cacheMode equals CACHE_MODE_DISABLED, else false
 boolean isDistributedCacheMode()
          Returns true if property cacheMode equals CACHE_MODE_DISTRIBUTED, else false
 boolean isDistributedExternalCacheMode()
          Returns true if property cacheMode equals CACHE_MODE_DISTRIBUTED_EXTERNAL, else false
 boolean isDistributedHybridCacheMode()
          Returns true if property cacheMode equals CACHE_MODE_DISTRIBUTED_HYBRID, else false
 boolean isDistributedJMSCacheMode()
          Returns true if property cacheMode equals CACHE_MODE_DISTRIBUTED_JMS, else false
 boolean isFolder()
           
 boolean isIdEqualsPath()
          Sets the property IdEqualsPath property.
 boolean isInstance(java.lang.Object pObj)
          If this item is from the GSA we then check the inheritance tree to see if the object is an instanceof of this item descriptor
 boolean isInstance(RepositoryItemDescriptor pDescriptor)
           
 boolean isItemLazyLoading()
          Returns true if this item-descriptor is lazy-loading, false if eager-loading.
 boolean isItemLazyLoading(boolean pClearNext)
          Returns true if this item-descriptor is lazy-loading, false if eager-loading.
 boolean isLockedCacheMode()
          Returns true if property cacheMode equals CACHE_MODE_LOCKED, else false
 boolean isLoggingDebug()
           
 boolean isLoggingError()
          Get the loggingError property from our repository.
 boolean isLoggingWarning()
          Get the loggingWarning property from our repository.
protected  boolean isOrQuery(atg.adapter.gsa.query.Clause pQueryClause)
          Utility method to see whether or not a particular query is an OR query.
 java.lang.Boolean isPropertyLazyLoading(java.lang.String pPropertyName)
          Returns true if a particular property in this item-descriptor is lazy-loading, false if eager-loading, null if no determination was made.
 boolean isSimpleCacheMode()
          Returns true if property cacheMode equals CACHE_MODE_SIMPLE, else false
 boolean isSuperTypeDistributedCacheMode()
          Returns true if property cacheMode of the superTypeDescriptor equals CACHE_MODE_DISTRIBUTED, else false
 boolean isUpdateTransactionWarningForNotMethodCalled()
          Get property updateTransactionWarningForNotMethodCalled if true ItemTransactionState will monitor whether a specific method is called when items belong to this ItemDescriptor get updated.
 boolean isUseCacheForDelete()
          Test property useCacheForDelete
 boolean isWritable()
           
protected  void loadPrecachedProperties(atg.adapter.gsa.GSAItem[] pItems, QueryOptions pOptions)
          Check and load precached properties.
protected  void loadPrecachedProperty(atg.adapter.gsa.GSAItem[] pItems, GSAPropertyDescriptor pPrecachedProp)
          Check and load precached property.
 void logDebug(java.lang.String pMsg)
          Log a debug message through our repository.
 void logDebug(java.lang.Throwable pThrowable)
          Log a debug exception through our repository.
 void logError(java.lang.String pMsg)
          Log an error message through our repository.
 void logError(java.lang.String pMsg, java.lang.Throwable pThrowable)
          Log an error message through our repository including and exception
 void logError(java.lang.Throwable pThrowable)
          Log an exception through our repository
protected  void logGetItem(java.lang.String pId, boolean pReadWrite, atg.adapter.gsa.GSAItem pItem, java.lang.String pDetail)
          Logs information from a getItem call
 void logWarning(java.lang.String pMsg)
          Log an warning message through our repository.
 void logWarning(java.lang.String pMsg, java.lang.Throwable pThrowable)
          Log an warning message through our repository including and exception
 void logWarning(java.lang.Throwable pThrowable)
          Log an exception through our repository
 void markItemAsRemoved(atg.adapter.gsa.GSAId pId)
          Marks this item as being removed in this transaction.
 void markItemAsRemoved(atg.adapter.gsa.GSAId pId, boolean pSendDelete)
          Marks this item as being removed in this transaction.
 void prepareItemCacheFilter(java.util.Set<java.lang.String> pItemSet)
          Update an item list to OnDeckItemCacheFilter
 void putCurrentProperty(atg.adapter.gsa.GSAItem pItem, RepositoryPropertyDescriptor pProperty, java.lang.Object pValue)
          Put the specified property directly into the specifed item's current properties.
protected  void putNullItemInCache(atg.adapter.gsa.GSAId pId)
           
protected  boolean queryContainsProperty(atg.adapter.gsa.query.Clause pClause, RepositoryPropertyDescriptor pRepositoryPropertyDescriptor)
          Find out if the given query clause has the give property used in it.
protected  void removeCurrentProperties(java.util.Set<java.lang.String> pItemList)
          Remove current properties for cached items.
protected  void removeCurrentProperties(java.lang.String pId)
          Remove current properties for a cached item.
 void removeItem(atg.adapter.gsa.GSAId pId, boolean pRemoveReferences)
          Removes the item from the permanent repository data store.
 void removeItemFromCache(java.lang.String pId)
          Removes the specified item from all repository caches.
 void removeItemFromCache(java.lang.String pId, boolean pGlobal)
          Removes the specified item from all repository caches.
 void removeItemFromCache(java.lang.String pId, boolean pGlobal, boolean pRemoveTransientProperties)
          Removes the specified item from all repository caches.
protected  void removeNullItem(atg.adapter.gsa.GSAId pId)
           
 void removePropertiesChangedListener(PropertiesChangedListener pListener)
          Removes a properties changed event listener from this item descriptor.
 void removePropertyDescriptor(java.lang.String pPropertyName)
          Removes the given property descriptor from the internal table of known descriptors
 void removeReferencedItems(atg.adapter.gsa.GSAId pId, RepositoryPropertyDescriptor[] pDescs)
          Loops through all properties that have "cascade=delete" set and removes the referenced items.
protected  void removeReferencedItems(RepositoryItem[] pItems)
          Removes the items in the array of references.
 void removeTableInvalidationListeners()
          Removes any table event listeners that are registered
protected  java.lang.Object removeTransientItem(java.lang.String pId)
           
protected  boolean repositoryGroupCachesDisabled()
          check to see if repository group caches should be disabled
 void resetItemCacheFilter(boolean pInvalidateCachesOnNextApply)
          Clear out OnDeckItemCacheFilter and ItemCachefilter; Set InvalidateCachesOnNextApply.
 void resetOnDeckItemCacheFilter(boolean pInvalidateCachesOnNextApply)
          Clear out OnDeckItemCacheFilter.
 void revertItemCacheFiler()
          Revert last changes on OnDeckItemCacheFilter.
protected  void rollback()
          Mark the current transaction to be rolled back.
 void sendGSAEvent(atg.adapter.gsa.event.GSAEvent pEvent)
          /** Sends an event to the subscribers for this item-descriptor.
 void sendPropertiesChangedEvent(atg.repository.RepositoryChangedItem pItem, int pType, java.util.Map<RepositoryPropertyDescriptor,java.lang.Object> pProperties)
          We cannot be synchronized on the item-descriptor when this method is called or we'll deadlock due to the TableInvalidationListener logic which gets called synchronously from one of these listeners.
 void sendPropertiesChangedEvent(java.lang.String pId, int pType, java.util.Map<RepositoryPropertyDescriptor,java.lang.Object> pProperties)
          We cannot be synchronized on the item-descriptor when this method is called or we'll deadlock due to the TableInvalidationListener logic which gets called synchronously from one of these listeners.
 void sendQueryDependencyPropertiesChangedEvent(atg.repository.RepositoryChangedItem pItem, int pType, java.util.Map<RepositoryPropertyDescriptor,java.lang.Object> pProperties)
          Sends a propertiesChangedEvent to QueryDependencies
 void sendQueryDependencyPropertiesChangedEvent(java.lang.String pId, int pType, java.util.Map<RepositoryPropertyDescriptor,java.lang.Object> pProperties)
          Sends a propertiesChangedEvent given the id of the item that changed to QueryDependencies
 void setCacheLocality(java.lang.String pCacheLocality)
          Sets property CacheLocality
 void setCacheMode(java.lang.String pCacheMode)
          Sets property CacheMode
 void setCacheNullItems(boolean pCacheNullItems)
          Sets the property CacheNullItems.
 void setCacheSwitchLoadQueries(boolean pCacheSwitchLoadQueries)
          Set property cacheSwitchLoadQueries
 void setCascadeDeleteOrder(int pCascadeDeleteOrder)
          Set property cascadeDeleteOrder
 void setContent(boolean pContent)
          Sets the property Content.
 void setContentChecksumProperty(RepositoryPropertyDescriptor pContentChecksumProperty)
          Sets the property ContentChecksumProperty.
 void setContentLengthProperty(RepositoryPropertyDescriptor pContentLengthProperty)
          Sets the property ContentLengthProperty.
 void setContentNameProperty(RepositoryPropertyDescriptor pContentNameProperty)
          Sets the property ContentNameProperty.
 void setContentPathProperty(RepositoryPropertyDescriptor pContentPathProperty)
          Sets the property ContentPathProperty.
 void setContentProperty(RepositoryPropertyDescriptor pContentProperty)
          Sets the property ContentProperty.
 void setDefaultProperties(GSAPropertyDescriptor[] pDefaultProperties)
          Set property defaultProperties.
 void setDefaultTextSearchProperties(GSAPropertyDescriptor[] pDefaultTextSearchProperties)
          Set property defaultTextSearchProperties
 void setDefaultUncachedItemQueries(boolean pDefaultUncachedItemQueries)
          Sets the property DefaultUncachedItemQueries.
 void setFilterQuery(atg.adapter.gsa.query.Clause pFilterQuery)
          Set property filterQuery
 void setFolderIdProperty(RepositoryPropertyDescriptor pFolderIdProperty)
          Sets the property FolderIdProperty.
 void setHasCacheReferencesById(boolean pVal)
           
 void setId(int pId)
          Set property Id
 void setIdSeparator(char pValue)
          Set property IdSeparator
 void setIdSpaceNames(java.lang.String[] pIdSpaceNames)
          Set property idSpaceNames
 void setIsolationLevel(int pIsolationLevel)
          Sets the property IsolationLevel.
 void setItemCacheSize(int pItemCacheSize)
          Sets the property ItemCacheSize.
 void setItemCacheTimeout(long pItemCacheTimeout)
          Sets the property ItemCacheTimeout.
 atg.adapter.gsa.GSAId setItemDescriptorType(atg.adapter.gsa.GSAId pGSAId, java.lang.Object pType)
          Set the item descriptor type to a GSAId based on the given value of the type column
 void setItemExpireTimeout(long pItemExpireTimeout)
          Sets the property ItemExpireTimeout.
 void setLastModifiedProperty(RepositoryPropertyDescriptor pLastModifiedProperty)
          Sets the property LastModifiedProperty.
 void setLastModifiedUpdateProperty(GSAPropertyDescriptor pLastModifiedProperty)
          Sets the property LastModifiedUpdateProperty.
 void setLoadingStrategy(java.lang.String pLoadingStrategy)
          Set property loadingStrategy
 void setLoadItemBatchSize(int pLoadItemBatchSize)
          Set property loadItemBatchSize
 void setLoggingDebug(boolean pLoggingDebug)
          Are we debugging this item type specifically? Returns true if logging debug is set on the repository or the item-descriptor.
 void setParentDescriptor(GSAItemDescriptor pParentDescriptor)
          Set property ParentDescriptor
 void setPrimaryTable(atg.adapter.gsa.Table pPrimaryTable)
          Sets the property primaryTable.
 void setPropertiesOnItem(atg.adapter.gsa.GSAItem pItem, java.util.Map<GSAPropertyDescriptor,java.lang.Object> pPropertyToValueMap)
          Sets the properties found in the propertyToValueMap on the given item.
 void setRqlFilterParameters(java.lang.Object[] pRqlFilterParameters)
          Set property rqlFilterParameters
 void setRqlFilterString(java.lang.String pRqlFilterString)
          Set property rqlFilterString.
 void setSplitQueries(boolean pSplitQueries)
          Set property splitQueries
 void setStoreTransientItemsOnCommit(boolean storeOnCommitFlag)
           
 void setSubTypeProperty(GSAPropertyDescriptor pSubTypeProperty)
          Sets the property SubTypeProperty.
 void setSubTypeValue(java.lang.Object pSubTypeValue)
          Sets the property SubTypeValue.
 void setSubTypeValueString(java.lang.String pSubTypeValueString)
          Sets the property SubTypeValueString.
 void setSuperTypeDescriptor(GSAItemDescriptor pSuperTypeDescriptor)
          Sets the property SuperTypeDescriptor.
 void setTypeDescriptorMap(java.util.Map<java.lang.Object,GSAItemDescriptor> pTypeDescriptorMap)
          Sets the property TypeDescriptorMap.
 void setUpdateTransactionWarningForNotMethodCalled(boolean pUpdateTransactionWarningForNotMethodCalled)
          Set property updateTransactionWarningForNotMethodCalled
 void setUseCacheForDelete(boolean pUseCacheForDelete)
          Set property useCacheForDelete
 void setUseIdForPath(boolean pUseIdForPath)
          Sets the property UseIdForPath.
 void setVersionDescriptorWrapper(atg.adapter.version.VersionItemDescriptor pWrapper)
          Set property versionDescriptorWrapper
 void setVersionProperty(RepositoryPropertyDescriptor pVersionProperty)
          Sets the property VersionProperty.
 void setWritable(boolean pWritable)
          Sets the property Writable.
protected  void sort(java.util.List<atg.adapter.gsa.GSAItem> pItems, SortDirectives pSortDirectives)
          Sort the specified list of repository items according to the sort directives and collator specified.
protected  void storeTransientItem(atg.adapter.gsa.GSAItem pItem)
          Store the transient item in a RAM (commited items/transactions only).
protected  void storeTransientItemStrongRef(atg.adapter.gsa.GSAItem pItem)
           
 atg.adapter.gsa.GSAId stringToRawId(java.lang.String pStringId)
          Convert a String repository id to a raw repository id
 void subscribe()
          Adds an entry for this item descriptor to the table of subscribers
 java.lang.String toString()
          Get a string representation of this object.
 void unsubscribe()
          Removes any entries for this item descriptor from the table of subscribers
 void updateItem(atg.adapter.gsa.GSAItem pItem)
          Updates the item in the repository
 void updateItemDescriptor()
          This method gets called when the parsing of the template has been completed.
protected  GSAItemDescriptor updateItemType(atg.adapter.gsa.GSAItem pItem)
          Sets the item type to a dynamic type based on the subTypeProperty's current value.
 
Methods inherited from class atg.repository.ItemDescriptorImpl
equals, getBeanDescriptor, getDisplayNameProperty, getItemDescriptorName, getPluralDisplayName, getPropertiesChangedListeners, getPropertyDescriptor, getRepository, getRepositoryImpl, getRepositoryView, getRepositoryViewImpl, getValue, hashCode, hasProperty, isContextMembershipEnabled, setBeanDescriptor, setContextMembershipProperty, setItemDescriptorName, setItemDisplayNameProperty, setRepository, setRepositoryView, setValue, updateDataStructures, updatePropertyDescriptor
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

CACHE_LOCALITY_INTERNAL

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

CACHE_LOCALITY_EXTERNAL

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

CACHE_LOCALITY_MIXED

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

CACHE_MODE_DISABLED

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

CACHE_MODE_SIMPLE

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

CACHE_MODE_DISTRIBUTED

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

CACHE_MODE_DISTRIBUTED_JMS

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

CACHE_MODE_DISTRIBUTED_HYBRID

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

CACHE_MODE_LOCKED

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

CACHE_MODE_DISTRIBUTED_EXTERNAL

public static final java.lang.String CACHE_MODE_DISTRIBUTED_EXTERNAL
See Also:
Constant Field Values
Constructor Detail

GSAItemDescriptor

public GSAItemDescriptor(atg.adapter.gsa.GSARepository pRepository)
Creates a new item descriptor for the specified GSARepository.

Method Detail

setId

public void setId(int pId)
Set property Id

Parameters:
pId - new value to set

getId

public int getId()
Get property Id

Returns:
Id

setIdSpaceNames

public void setIdSpaceNames(java.lang.String[] pIdSpaceNames)
Set property idSpaceNames

Parameters:
pIdSpaceNames - new value to set

getIdSpaceNames

public java.lang.String[] getIdSpaceNames()
Get property idSpaceNames

Returns:
idSpaceNames

setItemCacheSize

public void setItemCacheSize(int pItemCacheSize)
Sets the property ItemCacheSize. This is the maximum number of items of this type that we'll store in the cache at any given time. The only way this limit is exceeded is if the least recently accessed item is still in use by a transaction when a new item is added. Set this value to 0 to disable caching entirely for the item descriptor. Set this value to -1 to allow the GSA to cache an unlimited number of items in memory. Note that if your database contains a very large number of items, this could consume all of the memory in your VM so be careful.

Parameters:
pItemCacheSize - new value to set

getItemCacheSize

public int getItemCacheSize()
Returns:
The value of the property ItemCacheSize.

setItemCacheTimeout

public void setItemCacheTimeout(long pItemCacheTimeout)
Sets the property ItemCacheTimeout. If this is set to a positive value, it indicates the number of milliseconds to leave properties in an item cache after they've been accessed and to clear the properties in item cache once the timeout occurs to trigger reloading fresh values from the database on consequent access. If the value is zero, the item will not remain in the cache indefinitely. It just disables the feature.

Parameters:
pItemCacheTimeout - new value to set
Throws:
java.lang.IllegalArgumentException - if pItemCacheTimeout < 0

getItemCacheTimeout

public long getItemCacheTimeout()
Returns:
The value of the property ItemCacheTimeout.

setItemExpireTimeout

public void setItemExpireTimeout(long pItemExpireTimeout)
Sets the property ItemExpireTimeout. If this is set to a non-zero value, it indicates the maximum number of milliseconds to cache a property value.

Parameters:
pItemExpireTimeout - new value to set

getItemExpireTimeout

public long getItemExpireTimeout()
Returns:
The value of the property ItemExpireTimeout.

setCacheSwitchLoadQueries

public void setCacheSwitchLoadQueries(boolean pCacheSwitchLoadQueries)
Set property cacheSwitchLoadQueries

Parameters:
pCacheSwitchLoadQueries - new value to set

getCacheSwitchLoadQueries

public boolean getCacheSwitchLoadQueries()
Get property cacheSwitchLoadQueries

Returns:
cacheSwitchLoadQueries

isCacheSwitchLoadQueries

public boolean isCacheSwitchLoadQueries()
Test property cacheSwitchLoadQueries

Returns:
cacheSwitchLoadQueries

getLockTimeout

public long getLockTimeout()
Returns:
The value of the property LockTimeout. This is the number of milliseconds that we'll wait for lock manager locks.

setDefaultUncachedItemQueries

public void setDefaultUncachedItemQueries(boolean pDefaultUncachedItemQueries)
Sets the property DefaultUncachedItemQueries.

Parameters:
pDefaultUncachedItemQueries - new value to set

getDefaultUncachedItemQueries

public boolean getDefaultUncachedItemQueries()
Returns:
The value of the property DefaultUncachedItemQueries.

getContextMembershipProperty

public RepositoryPropertyDescriptor getContextMembershipProperty()
Overridden to look for context membership property on parents of sub-types. It should be possible to enable context membership on a part of an item descriptor type hierarchy.

Specified by:
getContextMembershipProperty in interface RepositoryItemDescriptor
Overrides:
getContextMembershipProperty in class ItemDescriptorImpl
Returns:
The value of the property ContextMembershipProperty.

getItemCache

protected atg.adapter.gsa.ItemCache getItemCache()
Get the cache to use. Only the base item descriptor has a cache.

Returns:
the cache

getNullItems

protected java.util.Map<atg.adapter.gsa.GSAId,java.lang.Boolean> getNullItems()
Get the cache to use. Only the base item descriptor has a cache.

Returns:
the cache

setUseCacheForDelete

public void setUseCacheForDelete(boolean pUseCacheForDelete)
Set property useCacheForDelete

Parameters:
pUseCacheForDelete - new value to set

getUseCacheForDelete

public boolean getUseCacheForDelete()
Get property useCacheForDelete

Returns:
useCacheForDelete

isUseCacheForDelete

public boolean isUseCacheForDelete()
Test property useCacheForDelete

Returns:
useCacheForDelete

setWritable

public void setWritable(boolean pWritable)
Sets the property Writable. If this is false, the item-descriptor is marked as read only.

Parameters:
pWritable - new value to set

isWritable

public boolean isWritable()
Returns:
The value of the property Writable.

setLoadItemBatchSize

public void setLoadItemBatchSize(int pLoadItemBatchSize)
Set property loadItemBatchSize

Parameters:
pLoadItemBatchSize - new value to set

getLoadItemBatchSize

public int getLoadItemBatchSize()
Get property loadItemBatchSize

Returns:
loadItemBatchSize

setLoadingStrategy

public void setLoadingStrategy(java.lang.String pLoadingStrategy)
Set property loadingStrategy

Parameters:
pLoadingStrategy - new value to set

getLoadingStrategy

public java.lang.String getLoadingStrategy()
Get property loadingStrategy

Returns:
loadingStrategy

setRqlFilterString

public void setRqlFilterString(java.lang.String pRqlFilterString)
Set property rqlFilterString. If the RQL string is not valid for this item descriptor the property is not changed and an error message is logged if loggingError is true.

Parameters:
pRqlFilterString - new value to set

getRqlFilterString

public java.lang.String getRqlFilterString()
Get property rqlFilterString

Returns:
rqlFilterString

setRqlFilterParameters

public void setRqlFilterParameters(java.lang.Object[] pRqlFilterParameters)
Set property rqlFilterParameters

Parameters:
pRqlFilterParameters - new value to set

getRqlFilterParameters

public java.lang.Object[] getRqlFilterParameters()
Get property rqlFilterParameters

Returns:
rqlFilterParameters

setFilterQuery

public void setFilterQuery(atg.adapter.gsa.query.Clause pFilterQuery)
Set property filterQuery

Parameters:
pFilterQuery - new value to set

getFilterQuery

public atg.adapter.gsa.query.Clause getFilterQuery()
Get property filterQuery

Returns:
filterQuery

evaluateRqlFilterParams

public java.lang.Object[] evaluateRqlFilterParams()
Evaluates our current rql filter params and returns all evaluated values

Returns:
an array of evaluated parameters, or null if there are no parameters to evaluate

applyContextFilters

public atg.adapter.gsa.query.Clause applyContextFilters(atg.adapter.gsa.query.Clause pQueryClause)
                                                 throws RepositoryException
Add query clauses to the given query to filter based on membership context

Parameters:
pQueryClause -
Returns:
filtered QueryClause
Throws:
RepositoryException

queryContainsProperty

protected boolean queryContainsProperty(atg.adapter.gsa.query.Clause pClause,
                                        RepositoryPropertyDescriptor pRepositoryPropertyDescriptor)
Find out if the given query clause has the give property used in it.

Parameters:
pClause -
pRepositoryPropertyDescriptor -
Returns:
true if query contains property, otherwise false

setCascadeDeleteOrder

public void setCascadeDeleteOrder(int pCascadeDeleteOrder)
Set property cascadeDeleteOrder

Parameters:
pCascadeDeleteOrder - new value to set

getCascadeDeleteOrder

public int getCascadeDeleteOrder()
Get property cascadeDeleteOrder This property controls when cascade delete operations are performed. the legal values are:

The default is CASCADE_DELETE_AFTER_AUX_BEFORE_PRI.

Returns:
cascadeDeleteOrder

setParentDescriptor

public void setParentDescriptor(GSAItemDescriptor pParentDescriptor)
Set property ParentDescriptor

Parameters:
pParentDescriptor - new value to set

getParentDescriptor

public GSAItemDescriptor getParentDescriptor()
Get property ParentDescriptor

Returns:
ParentDescriptor

getParentItemDescriptor

public RepositoryItemDescriptor getParentItemDescriptor()
This method is in the RepositoryItemDescriptorContainer interface for accessing this information.

Specified by:
getParentItemDescriptor in interface atg.repository.RepositoryItemDescriptorContainer

isInstance

public boolean isInstance(java.lang.Object pObj)
If this item is from the GSA we then check the inheritance tree to see if the object is an instanceof of this item descriptor

Specified by:
isInstance in interface DynamicBeanInfo
Overrides:
isInstance in class ItemDescriptorImpl

isInstance

public boolean isInstance(RepositoryItemDescriptor pDescriptor)

getPropertyDescriptors

public DynamicPropertyDescriptor[] getPropertyDescriptors()
Description copied from class: ItemDescriptorImpl
Returns the all PropertyDescriptors

Specified by:
getPropertyDescriptors in interface DynamicBeanInfo
Overrides:
getPropertyDescriptors in class ItemDescriptorImpl
Returns:
The value of the property PropertyDescriptors.

getChildPropertyDescriptor

protected RepositoryPropertyDescriptor getChildPropertyDescriptor(java.lang.String pName)
Get the named property descriptor from the specified item descriptor or its sub-type item descriptors. First pItemDescriptor is checked, then the sub-types are checked in order, until the first non null value is found.

Parameters:
pName - name of property to get
Returns:
the property descriptor, or null if not found

getPropertyNames

public java.lang.String[] getPropertyNames()
Returns the list of the names of the known properties

Specified by:
getPropertyNames in interface DynamicBeanInfo
Overrides:
getPropertyNames in class ItemDescriptorImpl

getRepositoryPropertyDescriptor

public RepositoryPropertyDescriptor getRepositoryPropertyDescriptor(java.lang.String pPropertyName)
Returns the RepositoryPropertyDescriptor for the specified property. Use this version if you know you have an ItemDescriptorImpl and you need fast access to the property descriptor (i.e. to avoid a cast).

This is the *real* implementation of getPropertyDescriptor. We inherit the one from our base class. note that this is synchronized and that is not because this table gets rebuilt dynamically in this class and that does not.

Overrides:
getRepositoryPropertyDescriptor in class ItemDescriptorImpl
Returns:
null if the Repository has no such property.

addPropertyDescriptor

public void addPropertyDescriptor(RepositoryPropertyDescriptor pPropertyDescriptor)
                           throws RepositoryException
Adds the given property descriptor to the internal table of known descriptors

Specified by:
addPropertyDescriptor in interface RepositoryItemDescriptor
Overrides:
addPropertyDescriptor in class ItemDescriptorImpl
Parameters:
pPropertyDescriptor - the descriptor for the new property to add to the Repository
Throws:
RepositoryException - if there was an error

removePropertyDescriptor

public void removePropertyDescriptor(java.lang.String pPropertyName)
                              throws RepositoryException
Removes the given property descriptor from the internal table of known descriptors

Specified by:
removePropertyDescriptor in interface RepositoryItemDescriptor
Overrides:
removePropertyDescriptor in class ItemDescriptorImpl
Parameters:
pPropertyName - the name of the property
Throws:
RepositoryException - if there was an error

repositoryGroupCachesDisabled

protected boolean repositoryGroupCachesDisabled()
check to see if repository group caches should be disabled


setSuperTypeDescriptor

public void setSuperTypeDescriptor(GSAItemDescriptor pSuperTypeDescriptor)
Sets the property SuperTypeDescriptor. This is a base item-descriptor which defines a property which dynamically selects the real item-type of the item. The superTypeDescriptor is always the parentDescriptor, (i.e. you always inherit its type information).

Parameters:
pSuperTypeDescriptor - new value to set

getSuperTypeDescriptor

public GSAItemDescriptor getSuperTypeDescriptor()
Returns:
The value of the property SuperTypeDescriptor.

getBaseDescriptor

public GSAItemDescriptor getBaseDescriptor()
Returns:
The value of the property BaseDescriptor. If your item descriptor has either a super-type, or a copy-from attribute, this represents the root of that hierarchy.

getRootDescriptor

public GSAItemDescriptor getRootDescriptor()
Returns:
The value of the property RootDescriptor.

getSubTypeDescriptors

public GSAItemDescriptor[] getSubTypeDescriptors()
Returns:
The value of the property SubTypeDescriptors.

setTypeDescriptorMap

public void setTypeDescriptorMap(java.util.Map<java.lang.Object,GSAItemDescriptor> pTypeDescriptorMap)
Sets the property TypeDescriptorMap. Keys into this map are values of the subTypeProperty. The values are ItemDescriptors which for each value of the subTypeProperty. If this is null, the item-descriptor has no sub-type-value associations and so has a fixed type. If this item descriptor has a root item descriptor, it will always define the map for type values.

Parameters:
pTypeDescriptorMap - new value to set

getTypeDescriptorMap

public java.util.Map<java.lang.Object,GSAItemDescriptor> getTypeDescriptorMap()
Returns:
The value of the property TypeDescriptorMap.

addTypeDescriptorEntry

public GSAItemDescriptor addTypeDescriptorEntry(java.lang.Object pKey,
                                                GSAItemDescriptor pValue)
Adds a new entry to the type descriptor table. Returns an existing entry if there was one.


setSubTypeValue

public void setSubTypeValue(java.lang.Object pSubTypeValue)
Sets the property SubTypeValue.

Parameters:
pSubTypeValue - new value to set

getSubTypeValue

public java.lang.Object getSubTypeValue()
Returns:
The value of the property SubTypeValue.

setSubTypeValueString

public void setSubTypeValueString(java.lang.String pSubTypeValueString)
Sets the property SubTypeValueString. This is just the string representation of the subTypeValue property.

Parameters:
pSubTypeValueString - new value to set

getSubTypeValueString

public java.lang.String getSubTypeValueString()
Returns:
The value of the property SubTypeValueString.

getSubTypeValues

public java.util.Set<java.lang.Object> getSubTypeValues()
Returns:
The value of the property SubTypeValues. This is the list of values for the subTypeProperty that this item-descriptor can have. It includes the sub-type-value set for this item (if any) and it includes the sub-type-value's set on any item-descriptor which is derived from this type.

getTables

public final atg.adapter.gsa.Table[] getTables()
Returns:
The set of tables used by this descriptor. This is stored and returned as an array for fast sequential access.

addTable

public void addTable(atg.adapter.gsa.Table pTable)
Adds a new table onto the list. Note that the list of tables can contain the tables of the same name more than once.


setPrimaryTable

public void setPrimaryTable(atg.adapter.gsa.Table pPrimaryTable)
Sets the property primaryTable.

Parameters:
pPrimaryTable - new value to set

getPrimaryTable

public atg.adapter.gsa.Table getPrimaryTable()
Returns:
The value of the property primaryTable.

getIdProperty

public GSAPropertyDescriptor getIdProperty()
Get property idProperty

Returns:
idProperty

getIdGetters

public atg.core.jdbc.ResultSetGetter[] getIdGetters()
Get property idGetter

Returns:
idGetter

getIdTypes

public java.lang.Class<?>[] getIdTypes()
Get property idTypes

Returns:
idTypes

getItemDescriptor

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

Specified by:
getItemDescriptor in interface atg.repository.RepositoryItemDescriptorContainer
Parameters:
pName - the name of the child item descriptor to find
Returns:
null if the requested item descriptor does not exist
Throws:
RepositoryException - if there was an error while attempting to return the RepositoryItemDescriptor

getItemDescriptorNames

public java.lang.String[] getItemDescriptorNames()
Returns an array of the names of all child item descriptors.

Specified by:
getItemDescriptorNames in interface atg.repository.RepositoryItemDescriptorContainer
Returns:
null if no child item descriptors exist.

setSubTypeProperty

public void setSubTypeProperty(GSAPropertyDescriptor pSubTypeProperty)
Sets the property SubTypeProperty.

Parameters:
pSubTypeProperty - new value to set

getSubTypeProperty

public GSAPropertyDescriptor getSubTypeProperty()
Returns:
The value of the property SubTypeProperty.

getDefaultItemDescriptor

public boolean getDefaultItemDescriptor()
Get property DefaultItemDescriptor. Check the repository to see if the DefaultItemDescriptor is set to this object.

Returns:
DefaultItemDescriptor

isDefaultItemDescriptor

public boolean isDefaultItemDescriptor()
Test property DefaultItemDescriptor

Returns:
DefaultItemDescriptor

setDefaultTextSearchProperties

public void setDefaultTextSearchProperties(GSAPropertyDescriptor[] pDefaultTextSearchProperties)
Set property defaultTextSearchProperties

Parameters:
pDefaultTextSearchProperties - new value to set

getDefaultTextSearchProperties

public GSAPropertyDescriptor[] getDefaultTextSearchProperties()
Get property defaultTextSearchProperties

Returns:
defaultTextSearchProperties

getItemDisplayNameProperty

public java.lang.String getItemDisplayNameProperty()
Gets the property ItemDisplayNameProperty. This is the name of the property whose value gets shown in a UI for this particular item.

Overrides:
getItemDisplayNameProperty in class ItemDescriptorImpl
Returns:
The value of the property ItemDisplayNameProperty.

setCacheLocality

public void setCacheLocality(java.lang.String pCacheLocality)
Sets property CacheLocality


getCacheLocality

public java.lang.String getCacheLocality()
Returns property CacheLocality


setCacheMode

public void setCacheMode(java.lang.String pCacheMode)
Sets property CacheMode


getCacheMode

public java.lang.String getCacheMode()
Returns property CacheMode


isDisabledCacheMode

public boolean isDisabledCacheMode()
Returns true if property cacheMode equals CACHE_MODE_DISABLED, else false


isSimpleCacheMode

public boolean isSimpleCacheMode()
Returns true if property cacheMode equals CACHE_MODE_SIMPLE, else false


isDistributedCacheMode

public boolean isDistributedCacheMode()
Returns true if property cacheMode equals CACHE_MODE_DISTRIBUTED, else false


isDistributedJMSCacheMode

public boolean isDistributedJMSCacheMode()
Returns true if property cacheMode equals CACHE_MODE_DISTRIBUTED_JMS, else false


isDistributedHybridCacheMode

public boolean isDistributedHybridCacheMode()
Returns true if property cacheMode equals CACHE_MODE_DISTRIBUTED_HYBRID, else false


isSuperTypeDistributedCacheMode

public boolean isSuperTypeDistributedCacheMode()
Returns true if property cacheMode of the superTypeDescriptor equals CACHE_MODE_DISTRIBUTED, else false


isLockedCacheMode

public boolean isLockedCacheMode()
Returns true if property cacheMode equals CACHE_MODE_LOCKED, else false


isDistributedExternalCacheMode

public boolean isDistributedExternalCacheMode()
Returns true if property cacheMode equals CACHE_MODE_DISTRIBUTED_EXTERNAL, else false


setIsolationLevel

public void setIsolationLevel(int pIsolationLevel)
Sets the property IsolationLevel.

Parameters:
pIsolationLevel - new value to set

getIsolationLevel

public int getIsolationLevel()
Returns:
The value of the property IsolationLevel.

getErrorCode

public java.lang.String getErrorCode()
Returns an error code if this item descriptor is not valid. Use this to format a message describing the invalid state of the table.

Returns:
the code

getLockManager

public ClientLockManager getLockManager()
Returns:
The value of the property LockManager.

getSubscriberXML

public java.lang.String getSubscriberXML()

subscribe

public void subscribe()
Adds an entry for this item descriptor to the table of subscribers


unsubscribe

public void unsubscribe()
Removes any entries for this item descriptor from the table of subscribers


getGSATransaction

public atg.adapter.gsa.GSATransaction getGSATransaction()
Gets the current GSATransaction.

Returns:
the connection

getGSATransaction

public atg.adapter.gsa.GSATransaction getGSATransaction(boolean pCreate)
Gets the current GSATransaction.

Returns:
the connection

getConnection

protected java.sql.Connection getConnection(atg.adapter.gsa.GSATransaction pTr)
                                     throws java.sql.SQLException
Get a DB connection to use.

Returns:
the connection
Throws:
java.sql.SQLException

close

protected void close(atg.adapter.gsa.GSATransaction pTr,
                     java.sql.Connection pConnection)
Close a DB connection, logging SQLExceptions or any other exceptions. It is okay to pass a null here.

Parameters:
pConnection - connection to close, may be null

close

protected void close(java.sql.ResultSet pResultSet)
Closes the ResultSet, logging SQLExceptions or any other exceptions. It is okay to pass a null here.


close

protected void close(java.sql.Statement pStatement)
Closes the Statement, logging SQLExceptions or any other exceptions. It is okay to pass a null here.


close

protected void close(java.sql.Connection pConnection)
Close a DB connection, logging SQLExceptions or any other exceptions. It is okay to pass a null here.

Parameters:
pConnection - connection to close, may be null

close

protected final void close(java.sql.ResultSet pResultSet,
                           atg.adapter.gsa.SQLStatement pStatement,
                           java.sql.Connection pConnection,
                           atg.adapter.gsa.GSATransaction pTransaction)
Close DB objects, logging SQLExceptions or any other exceptions. It is okay to pass a null here. This version closes the connection through the GSATransaction.

Parameters:
pResultSet - result set to close
pSQLStatement - statement to close
pConnection - connection to close

close

protected final void close(java.sql.ResultSet pResultSet,
                           atg.adapter.gsa.SQLStatement pStatement,
                           java.sql.Connection pConnection)
Close DB objects, logging SQLExceptions or any other exceptions. It is okay to pass a null here. This version closes the transaction directly: it does not go through the GSATransaction model.

Parameters:
pResultSet - result set to close
pSQLStatement - statement to close
pConnection - connection to close

close

protected final void close(atg.adapter.gsa.SQLStatement pStatement)
Close an SQLStatement, logging SQLExceptions or any other exceptions. It is okay to pass a null here.

Parameters:
pSelect - statement to close, may be null

rollback

protected void rollback()
Mark the current transaction to be rolled back.


setIdSeparator

public void setIdSeparator(char pValue)
Set property IdSeparator

Parameters:
pValue - new value to set

getIdSeparator

public char getIdSeparator()
Get property IdSpearator

Returns:
IdSeparator

stringToRawId

public atg.adapter.gsa.GSAId stringToRawId(java.lang.String pStringId)
Convert a String repository id to a raw repository id

Parameters:
pStringId - regular/String id to convert
Returns:
GSAId or null if the String could not be converted to the id type for this item descriptor

checkForPersistentItem

public boolean checkForPersistentItem(atg.adapter.gsa.GSAId pId)
Check for the persistent item with the specified id from the database. Do not load any of the item's properties.

Parameters:
pId - id of item to get
Returns:
true if the item exists, false if not
Throws:
RepositoryException - if there is DB trouble

getItem

public atg.adapter.gsa.GSAItem getItem(atg.adapter.gsa.GSAId pId,
                                       boolean pReadWrite)
                                throws RepositoryException
Get the item of our type with the specified id

Parameters:
pId - id of item to retrieve
pReadWrite - true if we want to get item for modification
Returns:
the item
Throws:
RepositoryException - if there is a problem retrieving the item

logGetItem

protected void logGetItem(java.lang.String pId,
                          boolean pReadWrite,
                          atg.adapter.gsa.GSAItem pItem,
                          java.lang.String pDetail)
Logs information from a getItem call


getItems

public java.util.Map<java.lang.String,atg.adapter.gsa.GSAItem> getItems(java.util.Collection<atg.adapter.gsa.GSAId> pIds,
                                                                        boolean pReadWrite)
                                                                 throws RepositoryException
Returns the items for the collection of ids supplied (including any transient items).

Throws:
RepositoryException

getItems

public java.util.Map<java.lang.String,atg.adapter.gsa.GSAItem> getItems(java.util.Collection<atg.adapter.gsa.GSAId> pIds,
                                                                        boolean pReadWrite,
                                                                        boolean pGetTransientItems)
                                                                 throws RepositoryException
Returns the items for the collection of ids supplied (including any transient items).

Throws:
RepositoryException

getItems

protected java.util.Map<java.lang.String,atg.adapter.gsa.GSAItem> getItems(java.util.Collection<atg.adapter.gsa.GSAId> pIds,
                                                                           boolean pReadWrite,
                                                                           boolean pGetTransientItems,
                                                                           boolean pAllowLazyLoading)
                                                                    throws RepositoryException
Get the items of our type with the specified ids.

Parameters:
pIds - ids of items to retrieve, cannot be null or zero length
pReadWrite - true if we are getting these items for read-write access, else false.
pAllowLazyLoad - controls eager versus lazy loading, false means do not lazy-load, true means check the configuration.
pGetTransientItems - true if we are to return items from the transient cache. If you have retrieved items directly by querying the DB you should not return items from the transient cache so that we do not have a race and end up with a transient item which really is a persistent one. There is a large interval from when the SQL transaction is committed and the item's state in commitItemState gets run. Ideally we'd have some way to lock around that but that seems quite tricky. Instead, it is better if we let the query create its own item, populate it from the database and then the first of these transactions to get their item into the cache wins. Both items will have the same state so it should not matter which makes it.

Cached queries I don't think can hit this same race condition since presumably once you've called getItem on an item once via a query, it has to be in the cache or already added at least.

Returns:
Map of items found with the specified ids. The keys in the Map are String ids, and the values are the corresponding GSAItem objects. order.
Throws:
RepositoryException - if there is a problem retrieving the items

isCachedItemRemoved

protected boolean isCachedItemRemoved(atg.adapter.gsa.GSAItem pItem,
                                      boolean pReadWrite,
                                      javax.transaction.Transaction pTrans)
                               throws RepositoryException
Check to see if a cached item has been removed.

Parameters:
pIdStr - the string id
Throws:
RepositoryException - if there is a problem retrieving the item

setPropertiesOnItem

public void setPropertiesOnItem(atg.adapter.gsa.GSAItem pItem,
                                java.util.Map<GSAPropertyDescriptor,java.lang.Object> pPropertyToValueMap)
                         throws RepositoryException
Sets the properties found in the propertyToValueMap on the given item. Specifically, setPropertyValueInCache is called

Parameters:
pItem - the item to set the properties on
pPropertyToValueMap - a mapping or property descriptors to values for that property, to be set on the items in question
Throws:
a - RepositoryException if there is a problem setting the values in the item
RepositoryException

setDefaultProperties

public void setDefaultProperties(GSAPropertyDescriptor[] pDefaultProperties)
Set property defaultProperties. This does not normally need to be set as it is computed by default from property group information. This method is not necessarily efficent and should generally only be called at definitition or initialization time. In any case it should not be called frequently.

Parameters:
pDefaultProperties - new value to set

getDefaultProperties

public GSAPropertyDescriptor[] getDefaultProperties()
Get property defaultProperties

Returns:
defaultProperties

computeDefaultProperties

public GSAPropertyDescriptor[] computeDefaultProperties()
Compute a starting value default properties. In general

Returns:
the default properties, this should never be null for GSAItemDescriptors

createLazyLoadedItems

public java.util.Collection<atg.adapter.gsa.GSAItem> createLazyLoadedItems(java.util.Collection<atg.adapter.gsa.GSAId> pIds,
                                                                           javax.transaction.Transaction pTransaction)
Creates a set of lazy-load stub items and returns it.


isItemLazyLoading

public boolean isItemLazyLoading()
Returns true if this item-descriptor is lazy-loading, false if eager-loading.


isItemLazyLoading

public boolean isItemLazyLoading(boolean pClearNext)
Returns true if this item-descriptor is lazy-loading, false if eager-loading.


isPropertyLazyLoading

public java.lang.Boolean isPropertyLazyLoading(java.lang.String pPropertyName)
Returns true if a particular property in this item-descriptor is lazy-loading, false if eager-loading, null if no determination was made.


getPersistentItems

protected void getPersistentItems(java.util.List<atg.adapter.gsa.GSAId> pIds,
                                  java.util.Map<java.lang.String,atg.adapter.gsa.GSAItem> pItems,
                                  boolean pCacheResults)
                           throws RepositoryException
Load the specified items from the DB into the passed in Map, optionally caching the items using a normal GSA transaction.

Parameters:
pIds - List of ids to load, this must be a list with at least one id in it
pItems - Map of items where retrieved items will go, keyed by String id
pCacheResults - if true, cache the returned items, else do not
Throws:
RepositoryException - if there is a problem retrieving the item

getPersistentItems

protected void getPersistentItems(java.util.List<atg.adapter.gsa.GSAId> pIds,
                                  java.util.Map<java.lang.String,atg.adapter.gsa.GSAItem> pItems,
                                  java.sql.Connection pConnection,
                                  boolean pCacheResults)
                           throws RepositoryException
Load the specified items from the DB into the passed in Map, optionally caching the items.

Parameters:
pIds - List of ids to load, this must be a list with at least one id in it
pItems - Map of items where retrieved items will go, keyed by String id
pConnection - connection to use. If null a connection is obtained from the current GSA transaction. If a non-null connection is passed in the caller is responsible for close()ing it.
pCacheResults - if true, cache the returned items, else do not
Throws:
RepositoryException - if there is a problem retrieving the item

putCurrentProperty

public void putCurrentProperty(atg.adapter.gsa.GSAItem pItem,
                               RepositoryPropertyDescriptor pProperty,
                               java.lang.Object pValue)
Put the specified property directly into the specifed item's current properties. No transaction is consulted.

Parameters:
pItem - item
pProperty - property descriptor of property being set
pValue - value to put

getOrWaitForPersistentItem

protected atg.adapter.gsa.GSAItem getOrWaitForPersistentItem(atg.adapter.gsa.GSAId pId)
                                                      throws RepositoryException
This method is the main access point for getting a persistent version of the item. It's main purpose is to optimize the case where we have more than one thread trying to get the item at the same time. Our goal is to have only one thread get the item. The second and subsequent threads wait for the item by the main thread.

Unfortunately, if we do this explicitly, we can deadlock because the thread which is chosen to get the item may deadlock against one or more threads which are waiting for it. The second and subsequent threads will wait for some period of time and then try to get it themselves thus breaking the deadlock. This is a bad deadlock because it is a mixture of Java synchronization and database locks and so is not detected by the database.

Parameters:
pId - id of item to get
Throws:
RepositoryException

isCachedNull

protected boolean isCachedNull(atg.adapter.gsa.GSAId pId)

putNullItemInCache

protected void putNullItemInCache(atg.adapter.gsa.GSAId pId)

getPersistentItem

protected atg.adapter.gsa.GSAItem getPersistentItem(atg.adapter.gsa.GSAId pId)
                                             throws RepositoryException
Load the persistent item with the specified id from the database. Do not load any of the item's properties. They will be loaded as needed.

Parameters:
pId - id of item to get
Returns:
the item, or null if no item of the right type could be found
Throws:
RepositoryException - if there is DB trouble

invalidateItemCache

public void invalidateItemCache()
Invalidates the item caches for this item descriptor.

Overrides:
invalidateItemCache in class ItemDescriptorImpl

invalidateLocalItemCache

public void invalidateLocalItemCache()
Invalidates the item caches for this item descriptor locally (only in this dynamo instance).


invalidateCaches

public void invalidateCaches()
Invalidates both the item and query caches for this item descriptor.

Overrides:
invalidateCaches in class ItemDescriptorImpl

invalidateExternalItemCache

public void invalidateExternalItemCache()
Invalidates any third-party external cache. Does not invalidate local cache


invalidateLocalCaches

public void invalidateLocalCaches()
Invalidates both the item and query caches for this item descriptor locally.


invalidateCaches

public void invalidateCaches(boolean pGlobal)
Invalidates both the item and query caches for this item descriptor. and if global is true, it sends an invalidation event to all servers.

Overrides:
invalidateCaches in class ItemDescriptorImpl
Parameters:
pGlobal - if true, the caches are invalidated in all servers in the cluster. Use of this option may require additional configuration in which case, the local cache is invalidated and a warning is issued.

invalidateItemCache

public void invalidateItemCache(boolean pGlobal)
Invalidates both the item and query caches for this item descriptor. and if global is true, it sends an invalidation event to all servers.

Overrides:
invalidateItemCache in class ItemDescriptorImpl
Parameters:
pGlobal - if true, the item caches are invalidated in all servers in the cluster. Use of this option may require additional configuration in which case, the local cache is invalidated and a warning is issued.

disableItemCache

public void disableItemCache()
Disable the item cache. This sets the item cache size to 0 and flushes it.


disableQueryCache

public void disableQueryCache()
Disable the query cache. This sets the query cache size to 0 and flushes it.


updateItemType

protected GSAItemDescriptor updateItemType(atg.adapter.gsa.GSAItem pItem)
Sets the item type to a dynamic type based on the subTypeProperty's current value. If this is a dynamically typed item, we return the GSAItemDescriptor of the item so that we can ensure that it is of a type compatible with the current type (if necessary). If this is a static type, we return null to skip the type check.


prepareItemCacheFilter

public void prepareItemCacheFilter(java.util.Set<java.lang.String> pItemSet)
                            throws RepositoryException
Update an item list to OnDeckItemCacheFilter

Parameters:
pItemList - a list of item ids
Throws:
RepositoryException

applyItemCacheFilterReady

public void applyItemCacheFilterReady()
                               throws RepositoryException
Set mAddFilteredItem to true after SWITCH_READY event

Throws:
RepositoryException

applyItemCacheFilter

public void applyItemCacheFilter()
                          throws RepositoryException
Invalidate remaining item entry in ItemCacheFilter; Invalidate queryCache; Set ItemCacheFillter as OnDeckItemCacheFilter; Clear out OnDeckItemCacheFilter.

Throws:
RepositoryException

resetItemCacheFilter

public void resetItemCacheFilter(boolean pInvalidateCachesOnNextApply)
Clear out OnDeckItemCacheFilter and ItemCachefilter; Set InvalidateCachesOnNextApply.


resetOnDeckItemCacheFilter

public void resetOnDeckItemCacheFilter(boolean pInvalidateCachesOnNextApply)
Clear out OnDeckItemCacheFilter. Set InvalidateCachesOnNextApply.


revertItemCacheFiler

public void revertItemCacheFiler()
                          throws RepositoryException
Revert last changes on OnDeckItemCacheFilter.

Throws:
RepositoryException

dumpItemCacheFilter

public java.lang.String dumpItemCacheFilter()
Dump out contents of onDeckItemCacheFilter and itemCacheFilter

Returns:
a String contents of onDeckItemCacheFilter and itemCacheFilter

removeCurrentProperties

protected void removeCurrentProperties(java.util.Set<java.lang.String> pItemList)
Remove current properties for cached items.

Parameters:
pItemList - the item list

removeCurrentProperties

protected void removeCurrentProperties(java.lang.String pId)
Remove current properties for a cached item.

Parameters:
pId - the item id

filterCachedItem

protected atg.adapter.gsa.GSAItem filterCachedItem(java.lang.String pId,
                                                   atg.adapter.gsa.GSAItem pItem)
If item id is in the filter, remove current properties for the cache item and remove the cache entry in local cachere and remove the item id from the filter. Returns null if pItem is in mItemCacheFilter. Returns pItem if pItem is not in mItemCacheFilter. Returns pItem without current properties if mAddFilteredItem is true.

Parameters:
pId - the item id
pItem - the GSAItem
Returns:
GSAItem

getCachedItem

protected atg.adapter.gsa.GSAItem getCachedItem(java.lang.String pId)
                                         throws RepositoryException
Get an item from the cache, by id. If the item is not in active part of the item cache, it gets re-added.

Parameters:
pId - id of item to find
Returns:
the item if found in the cache, else null
Throws:
RepositoryException

markItemAsRemoved

public void markItemAsRemoved(atg.adapter.gsa.GSAId pId)
                       throws RepositoryException
Marks this item as being removed in this transaction. When the transaction is committed, it is removed for real.

Parameters:
pId - item id of item to remove
Throws:
RepositoryException - if the id is null or there is a problem removing the item from cache

markItemAsRemoved

public void markItemAsRemoved(atg.adapter.gsa.GSAId pId,
                              boolean pSendDelete)
                       throws RepositoryException
Marks this item as being removed in this transaction. When the transaction is committed, it is removed for real.

Parameters:
pId - item id of item to remove
pSendDelete - true if we send the DELETE event, false we send CACHE_INVALIDATE.
Throws:
RepositoryException - if the id is null or there is a problem removing the item from cache

removeItemFromCache

public void removeItemFromCache(java.lang.String pId)
                         throws RepositoryException
Removes the specified item from all repository caches.

Overrides:
removeItemFromCache in class ItemDescriptorImpl
Parameters:
pId - item id of item to remove
Throws:
RepositoryException - if the id is null or there is a problem removing the item from cache

removeItemFromCache

public void removeItemFromCache(java.lang.String pId,
                                boolean pGlobal)
                         throws RepositoryException
Removes the specified item from all repository caches.

Overrides:
removeItemFromCache in class ItemDescriptorImpl
Parameters:
pId - item id of item to remove
pGlobal - if true, then an invalidation event is sent to other instance caches for all cache modes other than "distributedHybrid".
Throws:
RepositoryException - if the id is null or there is a problem removing the item from cache

removeItemFromCache

public void removeItemFromCache(java.lang.String pId,
                                boolean pGlobal,
                                boolean pRemoveTransientProperties)
                         throws RepositoryException
Removes the specified item from all repository caches.

Overrides:
removeItemFromCache in class ItemDescriptorImpl
Parameters:
pId - item id of item to remove
pGlobal - if true, then an invalidation event is sent to other instance caches for all cache modes other than "distributedHybrid".
pRemoveTransientProperties - if true transient properties will also be remove from the cache.
Throws:
RepositoryException - if the id is null or there is a problem removing the item from cache

invalidateCachedItem

public void invalidateCachedItem(java.lang.String pId)
Invalidates any cached properties we may have for this item.

Parameters:
pId - id of item to invalidate

getDependencies

public java.util.List<atg.repository.query.QueryDependency> getDependencies(Query pQuery)
Generate query dependency list for this query used for query invalidation.

Overrides:
getDependencies in class ItemDescriptorImpl
Parameters:
pQuery - Query to generate dependency list for.
Returns:
List of dependencies.

getIdQueryDependency

public atg.repository.query.IdQueryDependency getIdQueryDependency(Query pQuery,
                                                                   GSAItemDescriptor pContext)
Get dependency for id query

Parameters:
pQuery - Query that has dependency
pContext - Descriptor of ids
Returns:
IdQueryDependency if dependency found

findNestedQuery

protected static Query findNestedQuery(atg.adapter.gsa.query.CompoundQuery pCompoundQuery,
                                       java.lang.Class<?> pQueryType)

getNewId

protected atg.adapter.gsa.GSAId getNewId()
                                  throws RepositoryException
Get a id suitable for creating items of this type. We use out Repository's IdGenerator.

Returns:
a new id, which is unique across all items in this repository with this item descriptor.
Throws:
RepositoryException - if there is trouble creating the id

addItemOnCommit

public RepositoryItem addItemOnCommit(atg.adapter.gsa.GSAItem pItem)
                               throws RepositoryException
Insert an item into the repository, using the the specified property values.

Throws:
RepositoryException - if there is trouble adding the item to the repository

addItem

protected RepositoryItem addItem(atg.adapter.gsa.GSAItem pItem)
                          throws RepositoryException
Insert an item into the repository, using the the specified property values.

Throws:
RepositoryException - if there is trouble adding the item to the repository

updateItem

public void updateItem(atg.adapter.gsa.GSAItem pItem)
                throws RepositoryException
Updates the item in the repository

Parameters:
pItem - item to update
Throws:
RepositoryException

removeItem

public void removeItem(atg.adapter.gsa.GSAId pId,
                       boolean pRemoveReferences)
                throws RepositoryException
Removes the item from the permanent repository data store.

Parameters:
pId - id of item to remove
pRemoveReferences - True to remove references to and from this item. The default behavior of the GSA is to remove references.
Throws:
RepositoryException - if there is DB trouble

invalidateItem

public void invalidateItem(java.lang.String pId,
                           boolean pRemove)
For the case of distributed-cache mode operation, this is used to notify other subscribers that they may need to flush this item from their caches

Parameters:
pId - id of item to invalidate
pRemove - true if the item should be removed from the cache, false if all of the properties should just be removed.
Throws:
RepositoryException - if called on a descriptor not operating in distributed-cache mode, or if there are database errors

sendGSAEvent

public void sendGSAEvent(atg.adapter.gsa.event.GSAEvent pEvent)
/** Sends an event to the subscribers for this item-descriptor. This event is typically an invalidation or remote cache entry event. It can also be an event which simply tests the connectivity.


executeQuery

public atg.adapter.gsa.GSAItem[] executeQuery(Query pQuery,
                                              int pStartingIndex,
                                              int pEndingIndex,
                                              SortDirectives pSortDirectives,
                                              java.lang.Object[] pParameterValues,
                                              QueryOptions pOptions)
                                       throws RepositoryException
Execute the specified query and return the results.

Parameters:
pQuery - query to execute
pStartingIndex - the beginning index, inclusive
pEndingIndex - the ending index, exclusive.
pSortDirectives - the directives to sort the result set with
pParameterValues - an array of values for parameters present in the query, if any
Returns:
the items that match the query
Throws:
if - the query is not from this repository or if there is DB trouble
RepositoryException

loadPrecachedProperties

protected void loadPrecachedProperties(atg.adapter.gsa.GSAItem[] pItems,
                                       QueryOptions pOptions)
                                throws RepositoryException
Check and load precached properties.

Parameters:
pItems - Array of GSAItems
pOptions - QueryOptions
Throws:
RepositoryException

loadPrecachedProperty

protected void loadPrecachedProperty(atg.adapter.gsa.GSAItem[] pItems,
                                     GSAPropertyDescriptor pPrecachedProp)
Check and load precached property.

Parameters:
pItems - Array of GSAItems
pPrecachedProp - GSAPropertyDescriptor to load

executeQuery

public atg.adapter.gsa.GSAItem[] executeQuery(Query pQuery,
                                              int pStartingIndex,
                                              int pEndingIndex,
                                              SortDirectives pSortDirectives)
                                       throws RepositoryException
Execute the specified query and return the results.

Parameters:
pQuery - query to execute
pStartingIndex - the beginning index, inclusive
pEndingIndex - the ending index, exclusive.
pSortDirectives - the directives to sort the result set with
Returns:
the items that match the query
Throws:
if - the query is not from this repository or if there is DB trouble
RepositoryException

executeDirectSqlQuery

public atg.adapter.gsa.GSAItem[] executeDirectSqlQuery(atg.adapter.gsa.query.DirectSqlQuery pQuery,
                                                       int pStartingIndex,
                                                       int pEndingIndex,
                                                       SortDirectives pSortDirectives,
                                                       java.lang.Object[] pParameterValues,
                                                       QueryOptions pOptions)
                                                throws RepositoryException
Executes a direct sql query, which can contain user-defined returned properties and query dependencies

Parameters:
pQuery - the direct sql query to execute
pStartingIndex - the beginning index, inclusive
pEndingIndex - the ending index, exclusive.
pSortDirectives - the directives to sort the result set with
pParameterValues - values for any parameters present in the query
Returns:
the items that match the query
Throws:
if - the query is not from this repository or if there is DB trouble
RepositoryException

isOrQuery

protected boolean isOrQuery(atg.adapter.gsa.query.Clause pQueryClause)
Utility method to see whether or not a particular query is an OR query. We split these, but can still range and sort the results to some extent.


sort

protected void sort(java.util.List<atg.adapter.gsa.GSAItem> pItems,
                    SortDirectives pSortDirectives)
             throws RepositoryException
Sort the specified list of repository items according to the sort directives and collator specified. This method tries to be efficient. In particular it minimizes the number of Repository API calls made. This in turn reduces the overhead incurred for transaction state checking.

Parameters:
pItems - list of items to sort
pSortDirectives - sort directives to use
RepositoryException - if there is a problem sorting. This typically would be caused by a bad sort directive or DB or user defined property error trying to get a property value
Throws:
RepositoryException

executeQuery

public java.util.Collection<atg.adapter.gsa.GSAId> executeQuery(atg.adapter.gsa.query.Clause pClause,
                                                                SortDirectives pSortDirectives,
                                                                int pStartIndex,
                                                                int pEndIndex,
                                                                java.sql.Connection pConnection,
                                                                java.lang.Object[] pParameterValues,
                                                                atg.adapter.gsa.GSATransaction pTr,
                                                                QueryOptions pOptions)
                                                         throws java.sql.SQLException,
                                                                RepositoryException
Execute a query and return the ids matching the answer in the order they were returned from the DB. This is an internal helper method which does the real work of running queries.

Parameters:
pClause - query to execute
pSortDirectives - sort directives to use
pStartIndex - the index to start at for the return range
pEndIndex - the endex to end at (non-inclusive) for the return range
pConnection - connection to use, caller is responsible for all transaction management
pParameterValues - an array of values for parameters present in the query, if any
Returns:
a List of matching ids if pClause was not split into pieces for exection, otherwise a Set of the matching ids
Throws:
java.sql.SQLException
RepositoryException

applyRange

protected java.util.ArrayList<atg.adapter.gsa.GSAId> applyRange(java.util.ArrayList<atg.adapter.gsa.GSAId> pInitial,
                                                                int pStartIndex,
                                                                int pEndIndex)
Takes a list of returned item IDs and applies a range operation to them.


executeSingleQuery

public java.util.List<atg.adapter.gsa.GSAId> executeSingleQuery(atg.adapter.gsa.query.Clause pClause,
                                                                SortDirectives pSortDirectives,
                                                                int pStartIndex,
                                                                int pEndIndex,
                                                                java.sql.Connection pConnection,
                                                                java.lang.Object[] pParameterValues,
                                                                atg.adapter.gsa.GSATransaction pTr,
                                                                QueryOptions pOptions)
                                                         throws java.sql.SQLException,
                                                                RepositoryException
Execute a query and return the results. This is an internal helper method which does the real work of executing a single query. The query is executed as-is in a single SQL statement: it is not optimized or split into pieces.

Parameters:
pQuery - query to execute
pSortDirectives - sort directives to use
pMaxIds - the maximum # of ids to return, a negative value means no limit
pConnection - connection to use, caller is responsible for all transaction management
pParameterValues - an array of values for parameters present in the query, if any
Returns:
a list containing the ids of the items which satisfy the query
Throws:
java.sql.SQLException
RepositoryException

executeSingleQuery

public java.util.List<atg.adapter.gsa.GSAId> executeSingleQuery(atg.adapter.gsa.query.Clause pClause,
                                                                SortDirectives pSortDirectives,
                                                                int pStartIndex,
                                                                int pEndIndex,
                                                                java.sql.Connection pConnection)
                                                         throws java.sql.SQLException,
                                                                RepositoryException
Execute a query and return the results. This is an internal helper method which does the real work of executing a single query. The query is executed as-is in a single SQL statement: it is not optimized or split into pieces.

Parameters:
pQuery - query to execute
pSortDirectives - sort directives to use
pMaxIds - the maximum # of ids to return, a negative value means no limit
pConnection - connection to use, caller is responsible for all transaction management
Returns:
a list containing the ids of the items which satisfy the query
Throws:
java.sql.SQLException
RepositoryException

executeSingleQuery

public java.util.List<atg.adapter.gsa.GSAId> executeSingleQuery(atg.adapter.gsa.query.Clause pClause,
                                                                SortDirectives pSortDirectives,
                                                                int pStartIndex,
                                                                int pEndIndex)
                                                         throws RepositoryException
Execute a query and return the results. The query is executed as-is in a single SQL statement: it is not optimized or split into pieces.

Parameters:
pQuery - query to execute
pSortDirectives - sort directives to use
pMaxIds - the maximum # of ids to return, a negative value means no limit
Returns:
a list containing the ids of the items which satisfy the query
Throws:
RepositoryException

executeSingleQuery

public java.util.List<atg.adapter.gsa.GSAId> executeSingleQuery(atg.adapter.gsa.query.Clause pClause,
                                                                SortDirectives pSortDirectives,
                                                                int pStartIndex,
                                                                int pEndIndex,
                                                                QueryOptions pOptions)
                                                         throws RepositoryException
Execute a query and return the results. The query is executed as-is in a single SQL statement: it is not optimized or split into pieces.

Parameters:
pQuery - query to execute
pSortDirectives - sort directives to use
pMaxIds - the maximum # of ids to return, a negative value means no limit
Returns:
a list containing the ids of the items which satisfy the query
Throws:
RepositoryException

executeCountQuery

public int executeCountQuery(Query pQuery)
                      throws RepositoryException
Execute a query that returns the count of items that would be returned in the specifed query were executed.

Parameters:
pQuery - query to count
Returns:
the # of items that would match the query
Throws:
if - the query is not from this repository or if there is DB trouble
RepositoryException

executeCountQuery

public int executeCountQuery(Query pQuery,
                             java.lang.Object[] pParameterValues)
                      throws RepositoryException
Execute a query that returns the count of items that would be returned in the specifed query were executed.

Parameters:
pQuery - query to count
pParameterValues - values of any parameter expressions that are in the given query. Each expression is replaced in the order that it is encountered with the corresponding parameter value e.g. the first parameter is replaced with pParameterValues[0], the second parameter is replaced with pParameterValues[1], etc.
Returns:
the # of items that would match the query
Throws:
if - the query is not from this repository or if there is DB trouble
RepositoryException

clearReferencesToItem

public void clearReferencesToItem(atg.adapter.gsa.GSAId pId,
                                  RepositoryPropertyDescriptor[] pDescs)
                           throws RepositoryException
Loops through all properties manyToOneProperties. For each of these multi-valued properties, we go through each item referenced, and for the single valued property that refers back to this item, we must clear that reference.

Throws:
RepositoryException

removeReferencedItems

public void removeReferencedItems(atg.adapter.gsa.GSAId pId,
                                  RepositoryPropertyDescriptor[] pDescs)
                           throws RepositoryException
Loops through all properties that have "cascade=delete" set and removes the referenced items.

Throws:
RepositoryException

collectReferencedItemsForRemoval

protected RepositoryItem[] collectReferencedItemsForRemoval(atg.adapter.gsa.GSAId pId,
                                                            RepositoryPropertyDescriptor[] pDescs)
                                                     throws RepositoryException
Loops through all properties that have "cascade=delete" set and collects object for future removal.

Throws:
RepositoryException

removeReferencedItems

protected void removeReferencedItems(RepositoryItem[] pItems)
                              throws RepositoryException
Removes the items in the array of references.

Throws:
RepositoryException

createReferencedItems

protected void createReferencedItems(atg.adapter.gsa.GSAItem pItem,
                                     RepositoryPropertyDescriptor[] pDescs)
                              throws RepositoryException
Loops through all properties that have "cascade=insert" set and creates any new items necessary. Cascade insert can only be set on scalar values for now.

Throws:
RepositoryException

addReferencedItems

protected void addReferencedItems(atg.adapter.gsa.GSAItem pItem,
                                  RepositoryPropertyDescriptor[] pDescs)
                           throws RepositoryException
Loops through all properties that have "cascade=update" set and adds the referenced items if they are not already there.

Throws:
RepositoryException

areInstances

public boolean areInstances(DynamicBeanInfo pBeanInfo)
Determine whether the specified BeanInfo is a descendent of this object. This is the dynamic beans equivalent of:
pOtherDesc instanceof this.getClass()

Specified by:
areInstances in interface DynamicBeanInfo
Overrides:
areInstances in class ItemDescriptorImpl
Returns:
true if the other descriptor is an instance of this object from a dynamic beans perspective

areInstances

public boolean areInstances(GSAItemDescriptor pOtherDesc)
Determine whether the specified item descriptor is a descendent of this object. This is the dynamic beans equivalent of:
pOtherDesc instanceof this.getClass()

Returns:
true if the other descriptor is an instance of this object from a dynamic beans perspective

getGSARepository

public final atg.adapter.gsa.GSARepository getGSARepository()
Get our repository as the right type.

Returns:
the repository

getGSARepositoryView

public final atg.adapter.gsa.GSAView getGSARepositoryView()
Get our repository as the right type.

Returns:
the repository

getBuilder

public final Builder getBuilder()
Get our query builder as the right type.

Returns:
the repository

getGSAPropertyDescriptor

public final GSAPropertyDescriptor getGSAPropertyDescriptor(java.lang.String pName)
Get a property descriptor as the right type

Parameters:
pName - name of property descriptor
Returns:
the property descriptor

getItemByPath

public RepositoryItem getItemByPath(java.lang.String pPath)
                             throws RepositoryException
Throws:
RepositoryException

getContentPathQuery

public Query getContentPathQuery(java.lang.String pPath)
                          throws RepositoryException
Returns a query to retrieve an item for a path.

Throws:
RepositoryException

setContentPathProperty

public void setContentPathProperty(RepositoryPropertyDescriptor pContentPathProperty)
Sets the property ContentPathProperty. This optional property, specifies the name of the property which stores the full path name of the content items in this type. You must either set this property or contentNameProperty or set useIdAsPath=true.

Parameters:
pContentPathProperty - new value to set

getContentPathProperty

public RepositoryPropertyDescriptor getContentPathProperty()
Specified by:
getContentPathProperty in interface atg.repository.content.ContentPropertyItemDescriptor
Returns:
The value of the property ContentPathProperty.

setContentNameProperty

public void setContentNameProperty(RepositoryPropertyDescriptor pContentNameProperty)
Sets the property ContentNameProperty. This optional property speciies the name of the property which stores the name of this item (not including its folder's name). You must set either this property or the contentPathProperty property or set useIdAsPath=true.

Parameters:
pContentNameProperty - new value to set

getContentNameProperty

public RepositoryPropertyDescriptor getContentNameProperty()
Specified by:
getContentNameProperty in interface atg.repository.content.ContentPropertyItemDescriptor
Returns:
The value of the property ContentNameProperty.

setUseIdForPath

public void setUseIdForPath(boolean pUseIdForPath)
Sets the property UseIdForPath. If this is set to true, we use the path name to store the repository id.

Parameters:
pUseIdForPath - new value to set

getUseIdForPath

public boolean getUseIdForPath()
Returns:
The value of the property UseIdForPath.

isIdEqualsPath

public boolean isIdEqualsPath()
Sets the property IdEqualsPath property. This is a read-only property defined by the ContentPropertyItemDescriptor interface. It has the same meaning as the UseIdForPath property.

Specified by:
isIdEqualsPath in interface atg.repository.content.ContentPropertyItemDescriptor
Parameters:
pIdEqualsPath - new value to set

setFolderIdProperty

public void setFolderIdProperty(RepositoryPropertyDescriptor pFolderIdProperty)
Sets the property FolderIdProperty. This must be set to a property name of a property which is an id into the folder item descriptor. It defines the folder that this item is in.

Parameters:
pFolderIdProperty - new value to set

getFolderIdProperty

public RepositoryPropertyDescriptor getFolderIdProperty()
Specified by:
getFolderIdProperty in interface atg.repository.content.ContentPropertyItemDescriptor
Returns:
The value of the property FolderIdProperty.

setLastModifiedProperty

public void setLastModifiedProperty(RepositoryPropertyDescriptor pLastModifiedProperty)
Sets the property LastModifiedProperty. You can use this to expose the last modified time of an item.

Parameters:
pLastModifiedProperty - new value to set

getLastModifiedProperty

public RepositoryPropertyDescriptor getLastModifiedProperty()
Specified by:
getLastModifiedProperty in interface atg.repository.content.ContentPropertyItemDescriptor
Returns:
The value of the property LastModifiedProperty.

setLastModifiedUpdateProperty

public void setLastModifiedUpdateProperty(GSAPropertyDescriptor pLastModifiedProperty)
Sets the property LastModifiedUpdateProperty. This is set via the lastModifiedProperty attribute, but only when the attribute updateLastModified is set to true.

Parameters:
pLastModifiedProperty - new value to set

getLastModifiedUpdateProperty

public GSAPropertyDescriptor getLastModifiedUpdateProperty()
Returns:
The value of the property LastModifiedUpdateProperty.

setContentLengthProperty

public void setContentLengthProperty(RepositoryPropertyDescriptor pContentLengthProperty)
Sets the property ContentLengthProperty. You can use this to provide a property which returns the length of the content item. It is optional but if you omit this property, the getContentLength method will always return -1 for these items.

Parameters:
pContentLengthProperty - new value to set

getContentLengthProperty

public RepositoryPropertyDescriptor getContentLengthProperty()
Specified by:
getContentLengthProperty in interface atg.repository.content.ContentPropertyItemDescriptor
Returns:
The value of the property ContentLengthProperty.

setContentChecksumProperty

public void setContentChecksumProperty(RepositoryPropertyDescriptor pContentChecksumProperty)
Sets the property ContentChecksumProperty. You can use this to provide a property which returns the checksum of the content item. It is optional and it is used for checksum validation performance, by caching the checksum value. The checksum used is in atg.core.io.CRC64.

Parameters:
pContentChecksumProperty - new value to set

getContentChecksumProperty

public RepositoryPropertyDescriptor getContentChecksumProperty()
Returns:
The value of the property ContentChecksumProperty.

setContentProperty

public void setContentProperty(RepositoryPropertyDescriptor pContentProperty)
Sets the property ContentProperty.

Parameters:
pContentProperty - new value to set

getContentProperty

public RepositoryPropertyDescriptor getContentProperty()
Specified by:
getContentProperty in interface atg.repository.content.ContentPropertyItemDescriptor
Returns:
The value of the property ContentProperty.

setContent

public void setContent(boolean pContent)
Sets the property Content. This property is true if this item descriptor's items implement the ContentRepositoryItem interface.

Parameters:
pContent - new value to set

isContent

public boolean isContent()
Returns:
The value of the property Content.

isFolder

public boolean isFolder()
Returns:
true if this is the folder item descriptor.

setVersionProperty

public void setVersionProperty(RepositoryPropertyDescriptor pVersionProperty)
Sets the property VersionProperty. This is set on an item descriptor to provide an integer property which we can use for versioning updates. When an update is made with data that is stale (i.e. changes have been made to this item since the values were retrieve), an exception is thrown.

Parameters:
pVersionProperty - new value to set

getVersionProperty

public RepositoryPropertyDescriptor getVersionProperty()
Returns:
The value of the property VersionProperty.

getCascadeInsertProperties

public RepositoryPropertyDescriptor[] getCascadeInsertProperties()
Returns:
The value of the property CascadeInsertProperties. This is the list of property descriptors which have CascadeInsert=true.

addCascadeInsertProperty

public void addCascadeInsertProperty(RepositoryPropertyDescriptor pDesc)

getCascadeUpdateProperties

public RepositoryPropertyDescriptor[] getCascadeUpdateProperties()
Returns:
The value of the property CascadeUpdateProperties. This is the list of property descriptors which have CascadeUpdate=true.

addCascadeUpdateProperty

public void addCascadeUpdateProperty(RepositoryPropertyDescriptor pDesc)

getCascadeDeleteProperties

public RepositoryPropertyDescriptor[] getCascadeDeleteProperties()
Returns:
The value of the property CascadeDeleteProperties. This is list of property descriptors which have CascadeDelete=true.

addCascadeDeleteProperty

public void addCascadeDeleteProperty(RepositoryPropertyDescriptor pDesc)

getManyToOneProperties

public RepositoryPropertyDescriptor[] getManyToOneProperties()
Returns:
The value of the property ManyToOneProperties. This is list of property descriptors which have been designed to be many valued properties that have a corresponding single valued property elsewhere in the schema.

addManyToOneProperty

public void addManyToOneProperty(RepositoryPropertyDescriptor pDesc)

generateSQL

public java.lang.String generateSQL(atg.adapter.gsa.OutputSQLContext pSQLContext,
                                    atg.adapter.gsa.DatabaseTableInfo pDTI)
                             throws RepositoryException
Generate SQL for this item descriptor

Throws:
RepositoryException

generateSQL

public java.lang.String generateSQL(atg.adapter.gsa.OutputSQLContext pSQLContext,
                                    java.lang.String pDatabaseName)
                             throws RepositoryException
Generate SQL for this item descriptor

Throws:
RepositoryException

generateDropSQL

public java.lang.String generateDropSQL(atg.adapter.gsa.OutputSQLContext pSQLContext,
                                        atg.adapter.gsa.DatabaseTableInfo pDTI)
                                 throws RepositoryException
Generate SQL to drop tables for this item descriptor

Throws:
RepositoryException

getStoreTransientItems

protected boolean getStoreTransientItems()

setStoreTransientItemsOnCommit

public void setStoreTransientItemsOnCommit(boolean storeOnCommitFlag)

getStoreTransientItemsOnCommit

public boolean getStoreTransientItemsOnCommit()

getTransientItems

public java.util.Map<java.lang.String,java.lang.ref.WeakReference<atg.adapter.gsa.GSAItem>> getTransientItems()

storeTransientItemStrongRef

protected void storeTransientItemStrongRef(atg.adapter.gsa.GSAItem pItem)

storeTransientItem

protected void storeTransientItem(atg.adapter.gsa.GSAItem pItem)
Store the transient item in a RAM (commited items/transactions only). This is used to "persist" the transient item in RAM.


addTransientItem

protected void addTransientItem(atg.adapter.gsa.GSAItem pItem)
Add transient item to Item Transaction State


getTransientItem

protected atg.adapter.gsa.GSAItem getTransientItem(java.lang.String pId)

removeTransientItem

protected java.lang.Object removeTransientItem(java.lang.String pId)

setCacheNullItems

public void setCacheNullItems(boolean pCacheNullItems)
Sets the property CacheNullItems. If this is set to true, we'll keep cache the state of getItem methods which are found to return null. The default is false for consistency with old versions.

Parameters:
pCacheNullItems - new value to set

getCacheNullItems

public boolean getCacheNullItems()
Returns:
The value of the property CacheNullItems.

compareTo

public int compareTo(java.lang.Object pOther)
Compare this descriptor to another object. If the other object is also an item descriptor, this method behaves like compareTo(GSAItemDescriptor), otherwise it throws ClassCastException as item descriptors are only comparable to other item descriptors.

Specified by:
compareTo in interface java.lang.Comparable<java.lang.Object>
Parameters:
pOther - object to compare
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified item descriptor

compareTo

public int compareTo(GSAItemDescriptor pOther)
Compare this item descriptor to another item descriptor. The result is the result of comparing the ids of the two descriptors.

Parameters:
pOther - object to compare
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified item descriptor

addPropertiesChangedListener

public void addPropertiesChangedListener(PropertiesChangedListener pListener)
These events are all sent and managed by the root of the type hierarchy since they may affect all item types in this class tree.

Overrides:
addPropertiesChangedListener in class ItemDescriptorImpl

removePropertiesChangedListener

public void removePropertiesChangedListener(PropertiesChangedListener pListener)
Description copied from class: ItemDescriptorImpl
Removes a properties changed event listener from this item descriptor.

Overrides:
removePropertiesChangedListener in class ItemDescriptorImpl

sendPropertiesChangedEvent

public void sendPropertiesChangedEvent(atg.repository.RepositoryChangedItem pItem,
                                       int pType,
                                       java.util.Map<RepositoryPropertyDescriptor,java.lang.Object> pProperties)
We cannot be synchronized on the item-descriptor when this method is called or we'll deadlock due to the TableInvalidationListener logic which gets called synchronously from one of these listeners.

Overrides:
sendPropertiesChangedEvent in class ItemDescriptorImpl

sendPropertiesChangedEvent

public void sendPropertiesChangedEvent(java.lang.String pId,
                                       int pType,
                                       java.util.Map<RepositoryPropertyDescriptor,java.lang.Object> pProperties)
We cannot be synchronized on the item-descriptor when this method is called or we'll deadlock due to the TableInvalidationListener logic which gets called synchronously from one of these listeners.

Overrides:
sendPropertiesChangedEvent in class ItemDescriptorImpl

sendQueryDependencyPropertiesChangedEvent

public void sendQueryDependencyPropertiesChangedEvent(atg.repository.RepositoryChangedItem pItem,
                                                      int pType,
                                                      java.util.Map<RepositoryPropertyDescriptor,java.lang.Object> pProperties)
Description copied from class: ItemDescriptorImpl
Sends a propertiesChangedEvent to QueryDependencies

Overrides:
sendQueryDependencyPropertiesChangedEvent in class ItemDescriptorImpl

sendQueryDependencyPropertiesChangedEvent

public void sendQueryDependencyPropertiesChangedEvent(java.lang.String pId,
                                                      int pType,
                                                      java.util.Map<RepositoryPropertyDescriptor,java.lang.Object> pProperties)
Description copied from class: ItemDescriptorImpl
Sends a propertiesChangedEvent given the id of the item that changed to QueryDependencies

Overrides:
sendQueryDependencyPropertiesChangedEvent in class ItemDescriptorImpl

addTableInvalidationListeners

public void addTableInvalidationListeners()
Adds any table event listeners that need to be registered for all of the tables in this this item descriptor. These keep the tables in sync if they are used more than once in the same template definition.


removeTableInvalidationListeners

public void removeTableInvalidationListeners()
Removes any table event listeners that are registered


isLoggingError

public boolean isLoggingError()
Get the loggingError property from our repository.

Returns:
loggingError

logError

public void logError(java.lang.String pMsg)
Log an error message through our repository.

Parameters:
pMsg - message to log

logError

public void logError(java.lang.String pMsg,
                     java.lang.Throwable pThrowable)
Log an error message through our repository including and exception

Parameters:
pMsg - message to log
pThrowable - exception to log

logError

public void logError(java.lang.Throwable pThrowable)
Log an exception through our repository

Parameters:
pThrowable - exception to log

isLoggingWarning

public boolean isLoggingWarning()
Get the loggingWarning property from our repository.

Returns:
loggingWarning

logWarning

public void logWarning(java.lang.String pMsg)
Log an warning message through our repository.

Parameters:
pMsg - message to log

logWarning

public void logWarning(java.lang.String pMsg,
                       java.lang.Throwable pThrowable)
Log an warning message through our repository including and exception

Parameters:
pMsg - message to log
pThrowable - exception to log

logWarning

public void logWarning(java.lang.Throwable pThrowable)
Log an exception through our repository

Parameters:
pThrowable - exception to log

setLoggingDebug

public void setLoggingDebug(boolean pLoggingDebug)
Are we debugging this item type specifically? Returns true if logging debug is set on the repository or the item-descriptor.

Overrides:
setLoggingDebug in class ItemDescriptorImpl
Parameters:
pLoggingDebug - new value to set

isLoggingDebug

public boolean isLoggingDebug()
Overrides:
isLoggingDebug in class ItemDescriptorImpl
Returns:
The value of the property LoggingDebug.

logDebug

public void logDebug(java.lang.String pMsg)
Log a debug message through our repository.

Parameters:
pMsg - message to log

logDebug

public void logDebug(java.lang.Throwable pThrowable)
Log a debug exception through our repository.

Parameters:
pThrowable - exception to log

debug

public void debug(java.lang.String pMsg,
                  int pLevel)

format

public java.lang.String format(java.lang.String pMsgKey,
                               java.lang.Object[] pArgs)
Utility for formatting predefined messages using our respository's resource bundle

Parameters:
pMsgKey - message id to format
pArgs - arguments to fill in in message

format

public java.lang.String format(java.lang.String pMsgKey)
Utility for formatting messages with no arguments


format

public java.lang.String format(java.lang.String pMsgKey,
                               java.lang.Object pArg)

format

public java.lang.String format(java.lang.String pMsgKey,
                               java.lang.Object pArg1,
                               java.lang.Object pArg2)

toString

public java.lang.String toString()
Get a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
the string

setSplitQueries

public void setSplitQueries(boolean pSplitQueries)
Set property splitQueries

Parameters:
pSplitQueries - new value to set

getSplitQueries

public boolean getSplitQueries()
Get property splitQueries If true repository queries are split into pieces for SQL generation as needed for correctness. If false, queries are not split. A setting of false may result in fewer SQL queries but may also result in incorrect query results in certain cases. See PR#53204 for details. The default is true.

Returns:
splitQueries

setVersionDescriptorWrapper

public void setVersionDescriptorWrapper(atg.adapter.version.VersionItemDescriptor pWrapper)
Set property versionDescriptorWrapper

Parameters:
pWrapper - new value to set

getVersionDescriptorWrapper

public atg.adapter.version.VersionItemDescriptor getVersionDescriptorWrapper()
Get property versionDescriptorWrapper

Returns:
versionDescriptorWrapper

updateItemDescriptor

public void updateItemDescriptor()
This method gets called when the parsing of the template has been completed. It is the best place to put code which computes information that is defined in the template. Here we compute the property group membership.


getTypeDescriptorMapKey

public java.lang.Object getTypeDescriptorMapKey(java.lang.Object pRawType)
Converts a raw type value which is stored in the database for a sub-type-property, to a type object, which is used as the key in the typeDescriptorMap.

Parameters:
pRawType - The raw type value stored in the database
Returns:
Type object, which is used as the key in typeDescriptorMap

containsDerivedSortProperties

public boolean containsDerivedSortProperties(SortDirectives pDirectives)
Determines if any of the given sort directives refers to a derived property

Parameters:
pDirectives - the directives to examine
Returns:
true if the directives contain a property that is derived, false otherwise

containsCaseInsensitiveSort

public boolean containsCaseInsensitiveSort(SortDirectives pDirectives)
Determines if any of the given sort directives specify case-insensitiviy, as from CASE IGNORECASE in the RQL.

Parameters:
pDirectives - the directives to examine
Returns:
true if the directives contain caseSensitive==false, false otherwise

createSizedMap

protected <T> java.util.Map<java.lang.String,T> createSizedMap(int pExpectedSize)
Create an appropriately sized Map. The returned Map may be a TreeMap or a HashMap and will not be expected to grow very much after being created. Also, the Map is not expected to be used for a long time.

Type Parameters:
T -
Parameters:
pExpectedSize - expected size of the Map when populated
Returns:
the Map

dumpCaches

public java.lang.String dumpCaches()
Dump the caches for this item descriptor


getCachedItemIds

public java.util.List<java.lang.String> getCachedItemIds()
Get list of item ids from cache Called internally only by GSARepository.dumpCachesForReload. If the cache locality is mixed, this method should return the ids only of items in a local cache (a data store within this JVM), not items in an external, possibly centralized data store.


dependsOn

public boolean dependsOn(GSAItemDescriptor pDesc,
                         boolean pRequired,
                         boolean pPrimaryTableOnly)
Returns true if we have a reference from one of our property descriptors to the item-descriptor supplied (which may be of a different GSA repository). If the required flag is true, we only return true if all of the referenced in the chain are marked as "required".

Note per bug 112626: The below recursive code is actually badly broken. The visited list should check the passed-in item descriptor, not "this". However, the effect is that this function only searches one level, which is in fact the behavior expected by Utils.java and other classes. So, this function does not search more than one level.

Parameters:
pPrimaryTableOnly - If should only looks for references which are stored in a primary table

generateGSAId

public atg.adapter.gsa.GSAId generateGSAId(atg.repository.CompositeKey pValue)
Generate a GSAId based on another composite key

Parameters:
pValue - CompositeKey that will be wrapped by the ID
Returns:
the GSAId

generateGSAId

public atg.adapter.gsa.GSAId generateGSAId(java.lang.Object pValue)
Generate a GSAId based on a single ID value

Parameters:
pObject - Value that will be wrapped by the ID
Returns:
the GSAId

generateGSAId

public atg.adapter.gsa.GSAId generateGSAId(java.lang.Object[] pValues,
                                           boolean pRemoveNulls)
Generate a GSAId based on an array of values

Parameters:
pObject - Values that will be wrapped by the ID
pRemoveNulls - if true, we return null for items with nulls in the id.
Returns:
the GSAId

generateGSAId

public atg.adapter.gsa.GSAId generateGSAId(java.lang.Object[] pValues)
Generate a GSAId based on an array of values

Parameters:
pObject - Values that will be wrapped by the ID
Returns:
the GSAId

setItemDescriptorType

public atg.adapter.gsa.GSAId setItemDescriptorType(atg.adapter.gsa.GSAId pGSAId,
                                                   java.lang.Object pType)
Set the item descriptor type to a GSAId based on the given value of the type column

Parameters:
pObject - value of the sub-type-value for the GSAId
Returns:
the GSAId

hasCompositeKey

public boolean hasCompositeKey()
Determine if this item type has a composite ID.

Specified by:
hasCompositeKey in interface RepositoryItemDescriptor
Overrides:
hasCompositeKey in class ItemDescriptorImpl
Returns:
true if ID is composed multiple columns

encodeCompositeKey

public java.lang.String encodeCompositeKey(java.lang.String[] pIdValues)
                                    throws RepositoryException
Encode an array of ID values to be used as a Repository ID

Specified by:
encodeCompositeKey in interface RepositoryItemDescriptor
Overrides:
encodeCompositeKey in class ItemDescriptorImpl
Parameters:
pIdValues - Array of ID values
Returns:
the encoded String value of the composite key
Throws:
RepositoryException - unsupported feature

allowRemoveNullsUpdate

public boolean allowRemoveNullsUpdate(RepositoryItemImpl pItem)
                               throws RepositoryException
Can we persist changes to multi-properties when removing null values via the removeNullValues property

Returns:
true if update allowed
Throws:
RepositoryException - thrown if problem encountered

setHasCacheReferencesById

public void setHasCacheReferencesById(boolean pVal)

getHasCacheReferencesById

public boolean getHasCacheReferencesById()

removeNullItem

protected void removeNullItem(atg.adapter.gsa.GSAId pId)

setUpdateTransactionWarningForNotMethodCalled

public void setUpdateTransactionWarningForNotMethodCalled(boolean pUpdateTransactionWarningForNotMethodCalled)
Set property updateTransactionWarningForNotMethodCalled

Parameters:
pUpdateTransactionWarningForNotMethodCalled - new value to set

isUpdateTransactionWarningForNotMethodCalled

public boolean isUpdateTransactionWarningForNotMethodCalled()
Get property updateTransactionWarningForNotMethodCalled if true ItemTransactionState will monitor whether a specific method is called when items belong to this ItemDescriptor get updated. if that method is not called, a debug warning stack track will be generated. it will only monitor non-transient item and update only transactions. it is used for debug purpose. The default is false.

Returns:
updateTransactionWarningForNotMethodCalled

addReciprocalPropertyRelation

public void addReciprocalPropertyRelation(GSAPropertyDescriptor pOwnedProperty,
                                          GSAPropertyDescriptor pReciprocalProperty)

getReciprocalProperties

public GSAPropertyDescriptor[] getReciprocalProperties(GSAPropertyDescriptor pOwnedProperty)
Returns array of properties from various other item descriptors that use the same table data as the given property in this item descriptor.

Parameters:
pOwnedProperty -
Returns:
array of properties from various other item descriptors, or null if there are none

getReciprocalPropertyForItemDescriptor

public GSAPropertyDescriptor getReciprocalPropertyForItemDescriptor(GSAPropertyDescriptor pOwnedProperty,
                                                                    GSAItemDescriptor pReciprocalItemDescriptor)
Returns a property from another item descriptor that shares the same data as a particular property in this item descriptor.

Parameters:
pOwnedProperty, - pReciprocalItemDescriptor
Returns:
a property from another item descriptor, or null if none exists

Value String in XML Meaning
CASCADE_DELETE_FIRST first cascade delete is performed before any deletes on the tables of the item
CASCADE_DELETE_AFTER_AUX_BEFORE_PRI afterAuxiliaryBeforePrimary cascade delete is performed after auxilary multi table rows but before deleting the primary table row
CASCADE_DELETE_LAST last cascade delete is performed after all deletes on the tables of the item