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 boolean |
enforceLevel |
protected Map<String,AgentLock> |
heldLocks |
protected Object |
listenerUpdatesLock |
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 volatile AgentLock myCurrentLock
protected final boolean enforceLevel
protected final Object listenerUpdatesLock
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 = Command.NORMAL 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 AgentLockServiceDelegateprotected void addHeldLock(AgentLock lock) throws UnauthorizedLockException
UnauthorizedLockExceptionprotected void removeHeldLock(String agentName, AgentLock info) throws UnauthorizedLockException
UnauthorizedLockExceptionprotected void setCurrentLock(AgentLock lock)
public AgentLock getCurrentLock()
protected void removeCurrentLock()
public void addAgentLockUpdateListener(AgentLockService.AgentLockUpdateListener aluListener)
addAgentLockUpdateListener in interface AgentLockServiceDelegatepublic void removeAgentLockUpdateListener(AgentLockService.AgentLockUpdateListener aluListener)
removeAgentLockUpdateListener in interface AgentLockServiceDelegateprotected void notifyLockListeners(String agentName, String owner, AgentLock lock)
protected void notifyGlobalLockListeners(String agentName, AgentLock lock)
protected void notifyLevelListeners(String agentName, int level)
public void onAgentLoginUpdate(String oldUserId, String newUserId)
AgentLoginService.AgentLoginUpdateListeneronAgentLoginUpdate in interface AgentLoginService.AgentLoginUpdateListenerprotected 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 String validateLock(DictionaryCommand command, AgentLock lock, int level)
validateLock in interface AgentLockServiceDelegatepublic int getMaxLevel(String userid, String agentName)
getMaxLevel in interface AgentLockServiceDelegateCopyright © 2024 LSST. All rights reserved.