Package org.lsst.ccs.services
Class RemoteAgentLockService
java.lang.Object
org.lsst.ccs.services.AbstractAgentLockServiceDelegate
org.lsst.ccs.services.RemoteAgentLockService
- 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) intgetMaxLevel(String user, String agentName) voidvoidonAgentLoginUpdate(String oldUserId, String newUserId) Called upon loginvoidpreInit()voidpreStart()voidsetLevelForAgent(String agentName, int level) voidunlockAgent(String agentName) 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, getLocks, notifyGlobalLockListeners, notifyHeldLockListeners, notifyLevelListeners, notifyLockListeners, notifyLockVisibility, removeAgentLockUpdateListener, removeCurrentLock, removeHeldLock, setCurrentLock, setLevelInternal, validateLockMethods 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, disconnected, disconnecting
-
Constructor Details
-
RemoteAgentLockService
-
-
Method Details
-
preInit
public void preInit()- Specified by:
preInitin interfaceAgentLockServiceDelegate- Overrides:
preInitin classAbstractAgentLockServiceDelegate
-
preStart
public void preStart()- Specified by:
preStartin interfaceAgentLockServiceDelegate- Overrides:
preStartin classAbstractAgentLockServiceDelegate
-
onAgentLoginUpdate
Description copied from interface:AgentLoginService.AgentLoginUpdateListenerCalled upon login- Specified by:
onAgentLoginUpdatein interfaceAgentLoginService.AgentLoginUpdateListener- Overrides:
onAgentLoginUpdatein classAbstractAgentLockServiceDelegate
-
setLevelForAgent
public void setLevelForAgent(String agentName, int level) throws UnauthorizedLevelException, UnauthorizedLockException -
attachLock
- Throws:
UnauthorizedLockException
-
detachLock
- Throws:
UnauthorizedLockException
-
lockAgent
- Throws:
UnauthorizedLockException
-
unlockAgent
- Throws:
UnauthorizedLockException
-
destroyLock
-
getMaxLevel
-