@Plugin(name="Lock Service Plugin", id="lock-service", description="Graphical console service that provides interface between GUI components and Agent services dealing with locks, levels, logins, etc.") public class LockService extends ConsolePlugin implements ConsoleService
Getters provided by this class should be used to retrieve lock management information related to
multiple remote agents. For information on a specific agent, getters of the corresponding
Locker instance can be used. All getters should be called on EDT.
To be notified of changes, command browser components register listeners
through this class. LockService.Listener instances added through addListener(Listener)
method are notified whenever the set of watched agents changes (a remote agent is watched
if it is either connected to the buses or is locked by someone). To be notified of changes
related to a specific agent, a ChangeListener should be registered on the corresponding
Locker instance. Listener registration and removal can be requested on any thread,
but the callbacks are always executed on EDT.
To initiate lock management related operations, clients can call one of the
executeOperation(org.lsst.ccs.gconsole.services.lock.LockService.Operation, java.lang.String, int), executeBulkOperation(org.lsst.ccs.gconsole.services.lock.LockService.Operation, java.util.List<java.lang.String>), and #login methods.
These methods can be called on any thread. If the requested operation involves
communicating over the buses, it will be offloaded to a worker thread.
| Modifier and Type | Class and Description |
|---|---|
static interface |
LockService.Listener
Listener interface for receiving notifications of changes to the set of agents watched by this service.
|
static class |
LockService.Operation
Lock management operations.
|
static class |
LockService.State
States of remote agents with respect to lock management.
|
| Constructor and Description |
|---|
LockService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(LockService.Listener listener) |
void |
executeBulkOperation(LockService.Operation op,
List<String> agentNames)
Executes the specified operation on multiple agents.
|
void |
executeOperation(LockService.Operation op,
String agentName,
int level)
Executes the specified operation on the given agent.
|
Locker |
getAgent(String agentName)
Returns lock management data for the specified agent.
|
static LockService |
getService() |
String |
getUserId()
Returns user ID of this console.
|
void |
login(String userID,
String credentials)
Changes user ID associated with this console.
|
void |
removeListener(LockService.Listener listener) |
void |
startService() |
void |
stopService() |
getConsole, getServices, initialize, propertiesChanged, restore, save, setServicesProvider, shutdown, start, stoppublic static LockService getService()
public void startService()
startService in interface ConsoleServicepublic void stopService()
stopService in interface ConsoleServicepublic Locker getAgent(String agentName)
agentName - Agent name.Locker for the specified agent, or null if the agent is unlocked and offline.public String getUserId()
public void executeBulkOperation(LockService.Operation op, List<String> agentNames)
op - Operation.agentNames - Agent names.public void executeOperation(LockService.Operation op, String agentName, int level)
op - Operation.agentName - Agent name.level - Desired level (ignored for operations other than LEVEL.public void login(String userID, String credentials)
userID - Desired user ID, or null if the user ID should be reset to system user name.credentials - Ignored in the current implementation.public void addListener(LockService.Listener listener)
public void removeListener(LockService.Listener listener)
Copyright © 2021 LSST. All rights reserved.