public class GlobalRegistryCache
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.util.List<java.net.URI>,java.util.List<java.net.URI>> |
globalLocalUris
The mapping from global service URIs to the corresponding locally exported
URIs.
|
protected java.util.Map<java.net.URI,Pair<java.lang.String,java.lang.String>> |
globalNames
The mapping from each global URI to the corresponding service name.
|
protected java.util.concurrent.locks.ReadWriteLock |
lock
The lock for synchronising access to the data structures.
|
protected java.util.Map<Pair<java.lang.String,java.lang.String>,java.util.List<java.net.URI>> |
nameGlobalUris
The mapping from service name (type and instance name) to the corresponding
globally exported URIs.
|
protected java.util.Map<Pair<java.lang.String,java.lang.String>,java.util.List<java.net.URI>> |
nameLocalUris
The mapping from service name (type and instance name) to the corresponding
locally exported URIs.
|
| Constructor and Description |
|---|
GlobalRegistryCache()
Creates a new cache with empty data structures.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAndRenew(java.net.URI globUri,
java.util.List<java.net.URI> locUris)
Adds the locally exported URIs of the designated service identified by one
of its global URIs and renews the local URIs.
|
java.util.List<java.net.URI> |
getGlobalServiceUris(java.lang.String servType,
java.lang.String servName)
Gets the URIs with which the designated service can be reached globally
(via the global registry).
|
java.util.List<java.net.URI> |
getLocalServiceUris(java.util.List<java.net.URI> globUris)
Gets the URIs with which the designated service has been exported locally.
|
java.util.List<java.net.URI> |
getLocalServiceUris(java.lang.String servType,
java.lang.String servName)
Gets the URIs with which the designated service has been exported locally.
|
java.util.List<java.net.URI> |
getLocalServiceUris(java.net.URI globUri)
Gets the URIs with which the designated service has been exported locally.
|
void |
invalidateAll()
Invalidates all local URIs in this cache.
|
void |
invalidateService(java.util.List<java.net.URI> globUris)
Invalidates the local URIs of the service with the designated global URIs
and removes them from this cache.
|
void |
invalidateService(java.lang.String servType,
java.lang.String servName)
Invalidates the local URIs of the designated service and removes them from
this cache.
|
void |
invalidateUri(java.net.URI globUri)
Invalidates the local URIs of the service with the designated global URI
and removes them from this cache.
|
void |
publishService(java.lang.String servType,
java.lang.String servName,
java.util.List<java.net.URI> globUris,
java.util.List<java.net.URI> locUris)
Adds the designated service information to the cache.
|
void |
renew(java.util.List<java.net.URI> globUris,
java.util.List<java.net.URI> locUris)
Renews the locally exported URIs of the designated service identified by
its global URIs.
|
void |
renew(java.lang.String servType,
java.lang.String servName,
java.util.List<java.net.URI> locUris)
Renews the locally exported URIs of the designated service identified by
its name.
|
protected final java.util.Map<Pair<java.lang.String,java.lang.String>,java.util.List<java.net.URI>> nameLocalUris
protected final java.util.Map<Pair<java.lang.String,java.lang.String>,java.util.List<java.net.URI>> nameGlobalUris
protected final java.util.Map<java.util.List<java.net.URI>,java.util.List<java.net.URI>> globalLocalUris
protected final java.util.Map<java.net.URI,Pair<java.lang.String,java.lang.String>> globalNames
protected final java.util.concurrent.locks.ReadWriteLock lock
public GlobalRegistryCache()
public void publishService(java.lang.String servType,
java.lang.String servName,
java.util.List<java.net.URI> globUris,
java.util.List<java.net.URI> locUris)
servType - The service type name of the published service.servName - The (simple) name of the published service.globUris - The URIs the service can be reached globally (via the
global registry).locUris - The URIs the service has been exported locally.public void renew(java.lang.String servType,
java.lang.String servName,
java.util.List<java.net.URI> locUris)
published service.servType - The service type name of the published service.servName - The (simple) name of the published service.locUris - The URIs the service has been exported locally.public void renew(java.util.List<java.net.URI> globUris,
java.util.List<java.net.URI> locUris)
published service.globUris - The URIs the service can be reached globally (via the
global registry).locUris - The URIs the service has been exported locally.public void addAndRenew(java.net.URI globUri,
java.util.List<java.net.URI> locUris)
published service.globUri - One of the URIs the service can be reached globally (via the
global registry).locUris - The URIs the service has been exported locally.public java.util.List<java.net.URI> getGlobalServiceUris(java.lang.String servType,
java.lang.String servName)
published service.servType - The service type name of the published service for which to
get its global URIs.servName - The (simple) name of the published service for which to get
its global URIs.null will be
returned.public java.util.List<java.net.URI> getLocalServiceUris(java.lang.String servType,
java.lang.String servName)
published service.servType - The service type name of the published service for which to
get its local URIs.servName - The (simple) name of the published service for which to get
its local URIs.null will be returned.public java.util.List<java.net.URI> getLocalServiceUris(java.util.List<java.net.URI> globUris)
published service.globUris - The URIs the service can be reached globally (via the
global registry).null will be returned.public java.util.List<java.net.URI> getLocalServiceUris(java.net.URI globUri)
published service.globUri - One of the URIs of a service that can be reached globally
(via the global registry).null will be returned.public void invalidateUri(java.net.URI globUri)
globUri - One of the URIs of a service which that can be reached
globally (via the global registry) and of which to remove its
local URIs from this cache.public void invalidateService(java.lang.String servType,
java.lang.String servName)
servType - The service type name of the published service of which to
remove its local URIs from this cache.servName - The (simple) name of the published service of which to
remove its local URIs from this cache.public void invalidateService(java.util.List<java.net.URI> globUris)
globUris - The URIs the service can be reached globally (via the
global registry) and of which to remove its local URIs from this
cache.public void invalidateAll()