public class NamesServiceCache extends ConcurrentOperationServiceBase implements Names, Serializable
NamesService. This class ensures that the possibly
slow read operations from underlying services are not performed more than once in a given session.initialized| Constructor and Description |
|---|
NamesServiceCache() |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
getActiveNames()
Returns a set of all active names
|
Map<String,org.openepics.names.jaxb.DeviceNameElement> |
getAllNames()
Returns a map of all names
|
String |
getNameByUuid(String uuid)
Returns a name with the given uuid.
|
NameStatus |
getNameStatus(String deviceName)
Returns the status of the name.
|
protected String |
getOperation()
Extend this function to provide operation used for logging.
|
protected String |
getServiceName()
Extend this function to provide service name used for logging.
|
String |
getUuidByName(String name)
Returns a uuid of the name.
|
protected void |
initialise() |
boolean |
isError() |
boolean |
isValid() |
void |
refresh()
Refreshes the names, for example by clearing cache and reloading
|
protected boolean |
runOperation(String... vargs)
Update cache (names, devices).
|
void |
update()
Updated name service cache.
|
runOperationBlocking, runOperationNonBlocking@PostConstruct protected void initialise()
initialise in class ConcurrentOperationServiceBasepublic void update()
protected String getServiceName()
ConcurrentOperationServiceBasegetServiceName in class ConcurrentOperationServiceBaseprotected String getOperation()
ConcurrentOperationServiceBasegetOperation in class ConcurrentOperationServiceBaseprotected boolean runOperation(String... vargs)
runOperation in class ConcurrentOperationServiceBasevargs - arguments to pass on to operationpublic boolean isError()
public void refresh()
Namespublic Map<String,org.openepics.names.jaxb.DeviceNameElement> getAllNames()
NamesgetAllNames in interface Namespublic Set<String> getActiveNames()
NamesgetActiveNames in interface Namespublic boolean isValid()
isValid in class ConcurrentOperationServiceBasepublic NameStatus getNameStatus(String deviceName)
NamesgetNameStatus in interface NamesdeviceName - the namepublic String getNameByUuid(String uuid)
NamesgetNameByUuid in interface Namesuuid - uuid of the namepublic String getUuidByName(String name)
NamesgetUuidByName in interface Namesname - device nameCopyright © 2025 European Spallation Source. All rights reserved.