|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.repository.search.indexing.ConfigStatePersister
public class ConfigStatePersister
Handles persisting information about the state of the indexing configuration. Specifically, persists such information as:
A generation is merely a version number for a set of changes. The
generation mechanism exists so that the incremental loader can queue up a
set of changes (see IncrementalItemQueue
), claim that generation
and begin processing it, even as change events get queued up in the next
generation.
Created: April 15 2005
Nested Class Summary | |
---|---|
class |
ConfigStatePersister.ConfigState
Class which represents the configuration state. |
static class |
ConfigStatePersister.IndexingReadLockedTransactionAction
An inner class to do a transaction with the CLAIMED read lock. |
static class |
ConfigStatePersister.IndexingWriteLockedTransactionAction
An inner class to do a transaction with the CLAIMED write lock. |
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
ConfigStatePersister()
|
Method Summary | |
---|---|
int |
claimAndIncrementGeneration(java.lang.String pConfigPath,
boolean pForIncrementalUpdate)
Claim the current generation, increment the generation count, and return the number for the generation we just claimed. |
void |
completedFullIndex(java.lang.String pConfigPath,
int pGeneration,
boolean pCompletedSuccessfully)
|
void |
completedIncrementalIndex(java.lang.String pConfigPath,
int pGeneration,
boolean pCompletedSuccessfully)
|
protected void |
completedIndex(java.lang.String pConfigPath,
int pGeneration,
boolean pCompletedSuccessfully,
boolean pIncremental)
|
protected ConfigStatePersister.ConfigState |
createConfigState(RepositoryItem pItem)
Create a configuration state from the specified repository item. |
void |
doStartService()
Start up the service... |
protected RepositoryItem[] |
getClaimedConfigStateItems()
Return the configuration items claimed by some server. |
java.lang.String |
getClaimedGenerationPropertyName()
Get the claimed generation property name. |
ClientLockManager |
getClientLockManager()
The client lock manager... |
java.lang.String |
getConfigPathPropertyName()
|
protected RepositoryItem[] |
getConfigStateItemsByUniqueServerId(java.lang.String pUniqueServerId)
Return the repository items that are owned by the specified server Id. |
java.lang.Object |
getConfigStateProperty(java.lang.String pConfigPath,
java.lang.String pPropertyName)
|
int |
getCurrentGenerationForConfig(java.lang.String pConfigPath)
Get the current generation for the specified configuration. |
int |
getGenerationForConfig(java.lang.String pConfigPath)
Get the generation for the specified config. |
java.lang.String |
getGenerationPropertyName()
|
RepositoryItemDescriptor |
getItemDescriptor()
Get the item descriptor used for storage. |
java.lang.String |
getItemDescriptorName()
|
protected RepositoryItem |
getItemForConfig(java.lang.String pConfigPath,
boolean pMutable)
Get or create the repository item for the specified configuration. |
java.lang.String |
getLastActivityPropertyName()
|
java.lang.String |
getLastFullIndexPropertyName()
|
java.util.Date |
getLastFullIndexTime(java.lang.String pConfigPath)
Get the last full index time. |
java.lang.String |
getLastIncrementalIndexPropertyName()
|
java.util.Date |
getLastIncrementalIndexTime(java.lang.String pConfigPath)
Get the last incremental index time. |
java.net.InetAddress |
getLocalHost()
Returns the InetAddress of this host |
java.lang.String |
getNextIncrementalGenerationPropertyName()
|
long |
getRefreshCurrentGenerationMsecs()
The number of seconds before cached information about the current generation for a configuration is considered stale. |
MutableRepository |
getRepository()
The repository to store items. |
java.net.InetAddress |
getSessionIdAddress()
Returns the IP address that will be stamped into generated session id's |
int |
getSessionIdPort()
Returns the IP address that will be stamped into generated session id's |
long |
getTimeOutMsecs()
Get the number of milliseconds of inactivity before a claimed index is considered timed out. |
javax.transaction.TransactionManager |
getTransactionManager()
Get the transaction manager used to manager transactions. |
protected RepositoryItem[] |
getUnclaimedConfigStateItems()
Return the configuration items claimed by some server. |
ConfigStatePersister.ConfigState[] |
getUnclaimedConfigStates()
Get the generation for the specified config. |
java.lang.String |
getUniqueServerId()
This is a uniq id for each dyanmo server. |
java.lang.String |
getUniqueServerIdPropertyName()
|
protected boolean |
hasTimedOut(long pLastActivity)
Whether the last activity time is considered timed out. |
protected boolean |
hasTimedOut(RepositoryItem pItem)
Whether the lastActivity property on pItem is longer ago than timeOutMsecs. |
boolean |
isAlwaysAcquireWriteLock()
Whether to always acquire a write lock from the lock manager. |
void |
releaseAllConfigurations()
Release all configurations claimed by this server. |
void |
releaseTimedOutConfigurations()
Release all configurations claimed by this server. |
void |
removedCachedValueForConfig(java.lang.String pConfigPath)
Remove cached information for the specified configuration path, so that it will be fetched anew next time it is needed. |
void |
setAlwaysAcquireWriteLock(boolean pAlwaysAcquireWriteLock)
Whether to always acquire a write lock from the lock manager. |
void |
setClaimedGenerationPropertyName(java.lang.String pClaimedGenerationPropertyName)
Set the claimed generation property name. |
void |
setClientLockManager(ClientLockManager pClientLockManager)
The client lock manager... |
void |
setConfigPathPropertyName(java.lang.String pConfigPathPropertyName)
|
void |
setGenerationPropertyName(java.lang.String pGenerationPropertyName)
|
void |
setItemDescriptorName(java.lang.String pItemDescriptorName)
|
void |
setLastActivityPropertyName(java.lang.String pLastActivityPropertyName)
|
void |
setLastFullIndexPropertyName(java.lang.String pLastFullIndexPropertyName)
|
void |
setLastIncrementalIndexPropertyName(java.lang.String pLastIncrementalIndexPropertyName)
|
void |
setNextIncrementalGenerationPropertyName(java.lang.String pNextIncrementalGenerationPropertyName)
|
void |
setRefreshCurrentGenerationMsecs(long pRefreshCurrentGenerationMsecs)
The number of seconds before cached information about the current generation for a configuration is considered stale. |
void |
setRepository(MutableRepository pRepository)
The repository to store items. |
void |
setSessionIdAddress(java.net.InetAddress pSessionIdAddress)
Sets the IP address that will be stamped into generated session id's |
void |
setSessionIdPort(int pSessionIdPort)
Sets the IP address that will be stamped into generated session id's |
void |
setTimeOutMsecs(long pTimeOutMsecs)
Set the number of milliseconds of inactivity before a claimed index is considered timed out. |
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Set the transaction manager used to manager transactions. |
void |
setUniqueServerIdPropertyName(java.lang.String pUniqueServerIdPropertyName)
|
void |
updateLastActivityTime(java.lang.String pConfigPath,
int pGeneration)
Update the activity time for the specified generation. |
void |
updateLastActivityTime(java.lang.String pConfigPath,
int pGeneration,
long pLastActivityTime)
Update the activity time for the specified generation. |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_VERSION
Constructor Detail |
---|
public ConfigStatePersister()
Method Detail |
---|
public void setRepository(MutableRepository pRepository)
public MutableRepository getRepository()
public void setItemDescriptorName(java.lang.String pItemDescriptorName)
public java.lang.String getItemDescriptorName()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public javax.transaction.TransactionManager getTransactionManager()
public RepositoryItemDescriptor getItemDescriptor()
public void setConfigPathPropertyName(java.lang.String pConfigPathPropertyName)
public java.lang.String getConfigPathPropertyName()
public void setGenerationPropertyName(java.lang.String pGenerationPropertyName)
public java.lang.String getGenerationPropertyName()
public void setUniqueServerIdPropertyName(java.lang.String pUniqueServerIdPropertyName)
public java.lang.String getUniqueServerIdPropertyName()
public void setLastActivityPropertyName(java.lang.String pLastActivityPropertyName)
public java.lang.String getLastActivityPropertyName()
public void setLastFullIndexPropertyName(java.lang.String pLastFullIndexPropertyName)
public java.lang.String getLastFullIndexPropertyName()
public void setLastIncrementalIndexPropertyName(java.lang.String pLastIncrementalIndexPropertyName)
public java.lang.String getLastIncrementalIndexPropertyName()
public void setTimeOutMsecs(long pTimeOutMsecs)
public long getTimeOutMsecs()
public void setRefreshCurrentGenerationMsecs(long pRefreshCurrentGenerationMsecs)
public long getRefreshCurrentGenerationMsecs()
public void setClaimedGenerationPropertyName(java.lang.String pClaimedGenerationPropertyName)
public java.lang.String getClaimedGenerationPropertyName()
public void setNextIncrementalGenerationPropertyName(java.lang.String pNextIncrementalGenerationPropertyName)
public java.lang.String getNextIncrementalGenerationPropertyName()
public java.lang.String getUniqueServerId()
public java.net.InetAddress getSessionIdAddress()
public void setSessionIdAddress(java.net.InetAddress pSessionIdAddress)
public int getSessionIdPort()
public void setSessionIdPort(int pSessionIdPort)
public java.net.InetAddress getLocalHost()
public void setClientLockManager(ClientLockManager pClientLockManager)
public ClientLockManager getClientLockManager()
public void setAlwaysAcquireWriteLock(boolean pAlwaysAcquireWriteLock)
public boolean isAlwaysAcquireWriteLock()
protected RepositoryItem getItemForConfig(java.lang.String pConfigPath, boolean pMutable) throws RepositoryException
RepositoryException
public int getGenerationForConfig(java.lang.String pConfigPath) throws IndexingException
IndexingException
public void updateLastActivityTime(java.lang.String pConfigPath, int pGeneration) throws IndexingException
IndexingException
public void updateLastActivityTime(java.lang.String pConfigPath, int pGeneration, long pLastActivityTime) throws IndexingException
pConfigPath
- the configuration path for the config statuspGeneration
- the generation claimed whose last activity time needs to be updatepLastActivityTime
- the new last activity time to be written
IndexingException
public int claimAndIncrementGeneration(java.lang.String pConfigPath, boolean pForIncrementalUpdate) throws IndexingException, ConfigurationClaimedIndexingException
pConfigPath
- The configuration path of
the configuration to claim.
IndexingException
ConfigurationClaimedIndexingException
public void completedFullIndex(java.lang.String pConfigPath, int pGeneration, boolean pCompletedSuccessfully) throws IndexingException
IndexingException
public void completedIncrementalIndex(java.lang.String pConfigPath, int pGeneration, boolean pCompletedSuccessfully) throws IndexingException
IndexingException
protected void completedIndex(java.lang.String pConfigPath, int pGeneration, boolean pCompletedSuccessfully, boolean pIncremental) throws IndexingException
IndexingException
public java.util.Date getLastFullIndexTime(java.lang.String pConfigPath) throws IndexingException
IndexingException
public java.util.Date getLastIncrementalIndexTime(java.lang.String pConfigPath) throws IndexingException
IndexingException
public java.lang.Object getConfigStateProperty(java.lang.String pConfigPath, java.lang.String pPropertyName) throws IndexingException
IndexingException
protected RepositoryItem[] getConfigStateItemsByUniqueServerId(java.lang.String pUniqueServerId) throws RepositoryException
RepositoryException
protected RepositoryItem[] getClaimedConfigStateItems() throws RepositoryException
RepositoryException
protected RepositoryItem[] getUnclaimedConfigStateItems() throws RepositoryException
RepositoryException
public ConfigStatePersister.ConfigState[] getUnclaimedConfigStates() throws IndexingException
IndexingException
protected ConfigStatePersister.ConfigState createConfigState(RepositoryItem pItem)
protected boolean hasTimedOut(RepositoryItem pItem)
pItem
- the item whose lastActivity property
will be consulted to look at timeout.protected boolean hasTimedOut(long pLastActivity)
pLastActivity
- The last activity time expressed
in milliseconds.public void releaseAllConfigurations() throws IndexingException
IndexingException
public void releaseTimedOutConfigurations() throws IndexingException
IndexingException
public int getCurrentGenerationForConfig(java.lang.String pConfigPath) throws IndexingException
IndexingException
public void removedCachedValueForConfig(java.lang.String pConfigPath)
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting up
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |