
public abstract class AbstractAgentLockServiceDelegate extends Object implements AgentLockServiceDelegate, AgentPresenceListener, AgentLoginService.AgentLoginUpdateListener
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Integer> |
agentLevels |
protected List<AgentLockService.AgentLockUpdateListener> |
agentLockUpdateListeners |
protected Map<String,AgentLock> |
allLocks |
protected Map<String,AgentLock> |
heldLocks |
protected Object |
lockLevelUpdate |
protected Semaphore |
lockListenersSemaphore |
protected static Logger |
log |
protected AgentLock |
myCurrentLock |
protected AgentLockService |
svc |
| Constructor and Description |
|---|
AbstractAgentLockServiceDelegate(AgentLockService svc) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitattachLock, destroyLock, detachLock, lockAgent, setLevelForAgent, unlockAgentconnected, connecting, disconnected, disconnectingprotected static final Logger log
protected AgentLockService svc
protected final List<AgentLockService.AgentLockUpdateListener> agentLockUpdateListeners
protected AgentLock myCurrentLock
protected final Object lockLevelUpdate
protected final Semaphore lockListenersSemaphore
public AbstractAgentLockServiceDelegate(AgentLockService svc)
protected Agent getAgent()
protected AgentStateService getAgentStateService()
public void preInit()
preInit in interface AgentLockServiceDelegatepublic void preStart()
preStart in interface AgentLockServiceDelegatepublic int getLevelForAgent(String agentName)
agentName. It returns 0 if this agent does not hold a lock on
agentName.getLevelForAgent in interface AgentLockServiceDelegateagentName - the agent to get the level for.public AgentLock getLockForAgent(String agentName)
getLockForAgent in interface AgentLockServiceDelegatepublic AgentLock getExistingLockForAgent(String agentName)
getExistingLockForAgent in interface AgentLockServiceDelegatepublic Map<String,AgentLock> getHeldLocks()
getHeldLocks in interface AgentLockServiceDelegatepublic AgentLock getCurrentLock()
public void addAgentLockUpdateListener(AgentLockService.AgentLockUpdateListener aluListener)
addAgentLockUpdateListener in interface AgentLockServiceDelegatepublic void removeAgentLockUpdateListener(AgentLockService.AgentLockUpdateListener aluListener)
removeAgentLockUpdateListener in interface AgentLockServiceDelegateprotected void addHeldLock(AgentLock lock) throws UnauthorizedLockException
UnauthorizedLockExceptionprotected void removeHeldLock(String agentName, AgentLock info) throws UnauthorizedLockException
UnauthorizedLockExceptionprotected void setCurrentLock(AgentLock lock)
protected void removeCurrentLock()
protected void notifyLockListeners(String agentName, String owner, AgentLock lock)
public void onAgentLoginUpdate(String oldUserId, String newUserId)
AgentLoginService.AgentLoginUpdateListeneronAgentLoginUpdate in interface AgentLoginService.AgentLoginUpdateListenerprotected void notifyGlobalLockListeners(String agentName, AgentLock lock)
protected void notifyLevelListeners(String agentName, int level)
protected void setLevelInternal(String agentName, int level) throws UnauthorizedLevelException
UnauthorizedLevelExceptionpublic List<String> getLockableAgents()
getLockableAgents in interface AgentLockServiceDelegatepublic List<String> getLocallyLockedAgents()
getLocallyLockedAgents in interface AgentLockServiceDelegatepublic List<String> getLockedAgents()
getLockedAgents in interface AgentLockServiceDelegatepublic List<String> getDetachableAgents()
getDetachableAgents in interface AgentLockServiceDelegatepublic List<String> getAttachableAgents()
getAttachableAgents in interface AgentLockServiceDelegatepublic List<String> getAllWorkerAgents()
getAllWorkerAgents in interface AgentLockServiceDelegatepublic Map<String,AgentLock> getLocks()
getLocks in interface AgentLockServiceDelegatepublic boolean validateLock(AgentLock lock)
validateLock in interface AgentLockServiceDelegateCopyright © 2020 LSST. All rights reserved.