Package org.lockss.repository
Class OldLockssRepositoryImpl
java.lang.Object
org.lockss.app.BaseLockssManager
org.lockss.app.BaseLockssDaemonManager
org.lockss.repository.OldLockssRepositoryImpl
- All Implemented Interfaces:
org.lockss.app.LockssAuManager,org.lockss.app.LockssManager,OldLockssRepository
public class OldLockssRepositoryImpl
extends org.lockss.app.BaseLockssDaemonManager
implements OldLockssRepository
LockssRepository is used to organize the urls being cached.
It keeps a memory cache of the most recently used nodes as a
least-recently-used map, and also caches weak references to the instances
as they're doled out. This ensures that two instances of the same node are
never created, as the weak references only disappear when the object is
finalized (they go to null when the last hard reference is gone, then are
removed from the cache on finalize()).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lockss.app.BaseLockssManager
org.lockss.app.BaseLockssManager.MapMessageListenerNested classes/interfaces inherited from interface org.lockss.app.LockssAuManager
org.lockss.app.LockssAuManager.FactoryNested classes/interfaces inherited from interface org.lockss.repository.OldLockssRepository
OldLockssRepository.RepositoryStateException -
Field Summary
Fields inherited from class org.lockss.app.BaseLockssManager
isInited, isStarted, jmsConsumer, jmsProducer, shuttingDown, startedSem, theApp -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateNewNode(String url) Creates a newRepositoryNodefor the purposes of writing a new leaf to the cache.voiddeactivateNode(String url) Deactivate the node.voiddeleteNode(String url) Delete the node.Returns aRepositoryNodewhich represents the url in question.voidTraverses the node hierarchy and tests internal state consistency for each node.voidsetAuConfig(org.lockss.config.Configuration auConfig) Methods inherited from class org.lockss.app.BaseLockssDaemonManager
getDaemon, initService, initService, isDaemonInitedMethods inherited from class org.lockss.app.BaseLockssManager
getAlertManager, getApp, getClassName, getConfigManager, getDefaultTempRootDirectory, getJMSManager, getManagerByType, isAppInited, isInited, isRepoReady, isShuttingDown, isStarted, receiveMessage, resetConfig, serviceStarted, setUpJmsReceive, setUpJmsReceive, setUpJmsSend, startService, stopJms, stopService, waitForRepo, waitForRepo, waitStarted, waitStartedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lockss.app.LockssManager
getApp, initService, isInited, isStarted, serviceStarted, startService, stopService
-
Constructor Details
-
OldLockssRepositoryImpl
public OldLockssRepositoryImpl()
-
-
Method Details
-
setAuConfig
public void setAuConfig(org.lockss.config.Configuration auConfig) - Specified by:
setAuConfigin interfaceorg.lockss.app.LockssAuManager
-
getNode
Description copied from interface:OldLockssRepositoryReturns aRepositoryNodewhich represents the url in question. This only returns urls which exist in the cache (null otherwise).- Specified by:
getNodein interfaceOldLockssRepository- Parameters:
url- the desired url- Returns:
- an entry for the url
- Throws:
MalformedURLException
-
createNewNode
Description copied from interface:OldLockssRepositoryCreates a newRepositoryNodefor the purposes of writing a new leaf to the cache. This is used to add new leaves, though it still returns the leaf if it already exists.- Specified by:
createNewNodein interfaceOldLockssRepository- Parameters:
url- the url to be cached- Returns:
- an entry for the url
- Throws:
MalformedURLException
-
deleteNode
Description copied from interface:OldLockssRepositoryDelete the node.- Specified by:
deleteNodein interfaceOldLockssRepository- Parameters:
url- the url to be deleted- Throws:
MalformedURLException
-
deactivateNode
Description copied from interface:OldLockssRepositoryDeactivate the node.- Specified by:
deactivateNodein interfaceOldLockssRepository- Parameters:
url- the url to be deactivated- Throws:
MalformedURLException
-
nodeConsistencyCheck
public void nodeConsistencyCheck()Description copied from interface:OldLockssRepositoryTraverses the node hierarchy and tests internal state consistency for each node. Corrects and logs any correctable errors it encounters.- Specified by:
nodeConsistencyCheckin interfaceOldLockssRepository
-