Package org.lsst.ccs.services
Class LocalAgentLockService
java.lang.Object
org.lsst.ccs.services.AbstractAgentLockServiceDelegate
org.lsst.ccs.services.LocalAgentLockService
- All Implemented Interfaces:
AgentPresenceListener,AgentLockServiceDelegate,AgentLoginService.AgentLoginUpdateListener
Client side locking service, for a given agent. It is attached to an instance
of Agent, which is any agent with type >= CONSOLE. It provides an API both
for consoles that need to lock/unlock a WORKER subsystem, and for WORKER
subsystem that need to check the validity of a lock attached with a command
request. It encapsulates the communication protocol with the centralized
LockManager subsystem.
- Author:
- LSST CCS Team
-
Field Summary
Fields inherited from class org.lsst.ccs.services.AbstractAgentLockServiceDelegate
agentLevels, agentLockUpdateListeners, allLocks, enforceLevel, heldLocks, listenerUpdatesLock, log, myCurrentLock, svc -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattachLock(String agentName) voiddestroyLock(String agentName, String userId) voiddetachLock(String agentName) voiddisconnected(AgentInfo... agents) Invoked when one or more agents are disconnected from this cluster, either because the shutdown or because they were lost.getLocks()intgetMaxLevel(String userid, String agentName) voidvoidpreInit()voidpreStart()voidsetLevelForAgent(String agentName, int level) voidunlockAgent(String agentName) validateLock(DictionaryCommand command, CommandRequest request) Methods inherited from class org.lsst.ccs.services.AbstractAgentLockServiceDelegate
addAgentLockUpdateListener, addHeldLock, getAgent, getAgentStateService, getAllLockedAgents, getAllWorkerAgents, getAttachableAgents, getCurrentLock, getDetachableAgents, getExistingLockForAgent, getHeldLocks, getLevelForAgent, getLocallyLockedAgents, getLockableAgents, getLockedAgents, getLockForAgent, notifyGlobalLockListeners, notifyHeldLockListeners, notifyLevelListeners, notifyLockListeners, notifyLockVisibility, onAgentLoginUpdate, removeAgentLockUpdateListener, removeCurrentLock, removeHeldLock, setCurrentLock, setLevelInternalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lsst.ccs.messaging.AgentPresenceListener
connected, connecting, disconnecting
-
Constructor Details
-
LocalAgentLockService
-
-
Method Details
-
setLevelForAgent
public void setLevelForAgent(String agentName, int level) throws UnauthorizedLevelException, UnauthorizedLockException -
lockAgent
- Throws:
UnauthorizedLockException
-
attachLock
- Throws:
UnauthorizedLockException
-
detachLock
- Throws:
UnauthorizedLockException
-
unlockAgent
-
disconnected
Description copied from interface:AgentPresenceListenerInvoked when one or more agents are disconnected from this cluster, either because the shutdown or because they were lost. The implementation should return immediately : any blocking operations should be scheduled on a separate thread. -
getLocks
- Specified by:
getLocksin interfaceAgentLockServiceDelegate- Overrides:
getLocksin classAbstractAgentLockServiceDelegate
-
preStart
public void preStart()- Specified by:
preStartin interfaceAgentLockServiceDelegate- Overrides:
preStartin classAbstractAgentLockServiceDelegate
-
preInit
public void preInit()- Specified by:
preInitin interfaceAgentLockServiceDelegate- Overrides:
preInitin classAbstractAgentLockServiceDelegate
-
validateLock
- Specified by:
validateLockin interfaceAgentLockServiceDelegate- Overrides:
validateLockin classAbstractAgentLockServiceDelegate
-
destroyLock
-
getMaxLevel
-