public interface GlobalRegistry extends ADEPT2Service
Note: The orchestration of the services in the sense "which service uses which other service instance" is not part of the global registry. The local registries are responsible for this kind of orchestration.
The following image provides an overview of the role of the
services, the local registries and the global registry.
Registry.
The local registry knows which instance of the data manager shall be
used by the calling execution manager. In case it is a local service
instance, it will be returned immediately. In case it is a remote
service instance, the local registry queries the global registry for
the location and communication techniques of the remote service. This
information is used by the local registry to locally create a stub and
return it to the calling service, i.e. the execution manager in the
example.
simple-rmi://main.example.com:43005/ProcessManager/PM1
describes that the ProcessManager instance named PM1 can be reached
using simple-rmi on the host main.example.com at the port 43005. ADEPT2ServiceExport.
TODO will reject all URIs with local as scheme.
Object URIs are used across the system for identifying an object
including the service where it belongs to. The service type and the
service name are part of the object URI - e.g.
template://ProcessManager/PM1/3 identifies the process
template with ID 3, which is stored in the ProcessManager with the
name PM1.
In the global registry, object URIs can be used for resolving the
service's URIs providing the object's URI to
LocalServiceRegistry.getService(SessionToken, URI[], Class).
TODO also keep track of "who" queried the process instances?
TODO block a shutdown of a service and inform other services which used the service?
TODO global registry as service monitor and service event monitor?
TODO global registry as central point of authority concerning service requests?
TODO above will require local services to have a public interface for maintenance calls. => preliminary LocalServiceRegistry
TODO configuration management interface?
TODO URIs for objects, URLs for services?
TODO use hierarchical instance names?
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,Pair<java.util.List<java.net.URI>,java.util.List<java.net.URI>>>> |
getAllServices()
Gets the global and local URIs of all published services currently managed
by the global registry.
|
java.util.Map<java.lang.String,Pair<java.util.List<java.net.URI>,java.util.List<java.net.URI>>> |
getAllServices(java.lang.String serviceType)
Gets the global and local URIs of all published service instances of the
designated service type currently managed by the global registry.
|
GlobalServiceExport |
getGlobalServiceExport()
Gets the global service export interface, that allows arbitrary services,
to be exported via a corresponding callback object.
|
java.util.List<java.net.URI> |
getGlobalServiceUris(java.lang.String clusterName,
java.lang.String serviceType,
java.lang.String serviceName)
Gets the global URIs with which the designated service instance is
published.
|
java.util.List<java.net.URI> |
getGlobalServiceUris(java.lang.String clusterName,
java.net.URI entityUri)
Gets the global URIs of the service, which is referenced in the given
object URI.
|
java.util.List<java.net.URI> |
getLocalServiceUris(java.lang.String clusterName,
java.lang.String serviceType,
java.lang.String serviceName)
Gets the local URIs with which the designated service instance is published
at this global registry.
|
java.util.List<java.net.URI> |
getLocalServiceUris(java.lang.String clusterName,
java.net.URI entityUri)
Gets the local URIs of the service, which is referenced in the given object
URI.
|
java.util.List<java.net.URI> |
getLocalServiceUris(java.lang.String clusterName,
java.net.URI[] globalServiceUris)
Gets the local service URI of a service having the designated global URIs.
|
void |
invalidate(SessionToken session,
java.lang.String clusterName,
java.lang.String serviceType,
java.lang.String serviceName)
Informs the global registry that the designated service is not reachable any more.
|
void |
invalidate(SessionToken session,
java.lang.String clusterName,
java.net.URI[] globalServiceUris)
Informs the global registry that the designated service is not reachable any more.
|
java.util.List<java.net.URI> |
prepareServicePublishing(SessionToken session,
java.lang.String clusterName,
java.lang.String serviceType,
java.lang.String serviceName,
java.util.List<java.net.URI> localServiceUris)
Prepares the specified service for being published.
|
void |
publishService(SessionToken session,
java.lang.String serviceType,
java.lang.String serviceName,
java.util.List<java.net.URI> globalServiceUris)
Publishes the designated service with the designated global URIs and
registers the designated local URIs for it.
|
boolean |
unpublishService(SessionToken session,
java.lang.String clusterName,
java.lang.String serviceType,
java.lang.String serviceName,
java.util.List<java.net.URI> globalServiceUris)
Unpublishes the designated service with the designated global URIs.
|
getLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, init, ping, preShutdown, shutdown, startjava.util.List<java.net.URI> getGlobalServiceUris(java.lang.String clusterName,
java.lang.String serviceType,
java.lang.String serviceName)
throws ServiceNotKnownException
clusterName - The name of the cluster of the requested service.serviceType - The type of the service of which to get the global URIs.serviceName - The simple instance name of the service of which to get
the global URIs.ServiceNotKnownException - If the designated service is not known by
this global registry, a ServiceNotKnownException
will be thrown. If the provided cluster name is different from
the cluster name of this registry, a
WrongClusterException will be thrown.java.util.List<java.net.URI> getLocalServiceUris(java.lang.String clusterName,
java.lang.String serviceType,
java.lang.String serviceName)
throws ServiceNotKnownException
clusterName - The name of the cluster of the requested service.serviceType - The type of the service of which to get the local URIs.serviceName - The simple instance name of the service of which to get
the local URIs.ServiceNotKnownException - If the designated service is not known by
this global registry, a ServiceNotKnownException
will be thrown. If the provided cluster name is different from
the cluster name of this registry, a
WrongClusterException will be thrown.java.util.List<java.net.URI> getGlobalServiceUris(java.lang.String clusterName,
java.net.URI entityUri)
throws ServiceNotKnownException
clusterName - The name of the cluster of the requested entity.entityUri - The URI of an entity.null
will be returned. If the service is only prepared yet, an empty
list will be returned.ServiceNotKnownException - If the service the entity URI refers to is
not known by this global registry, a
ServiceNotKnownException will be thrown. If the
provided cluster name is different from the cluster name of this
registry, a WrongClusterException will be thrown.java.lang.IllegalArgumentException - If the entityURI is not a
valid object URI.java.util.List<java.net.URI> getLocalServiceUris(java.lang.String clusterName,
java.net.URI entityUri)
throws ServiceNotKnownException
clusterName - The name of the cluster of the requested entity.entityUri - The URI of an entity.null
will be returned. If the service is only prepared yet, an empty
list will be returned.ServiceNotKnownException - If the service the entity URI refers to is
not known by this global registry, a
ServiceNotKnownException will be thrown. If the
provided cluster name is different from the cluster name of this
registry, a WrongClusterException will be thrown.java.lang.IllegalArgumentException - If the entityUri is not a
valid object URI.java.util.Map<java.lang.String,java.util.Map<java.lang.String,Pair<java.util.List<java.net.URI>,java.util.List<java.net.URI>>>> getAllServices()
java.util.Map<java.lang.String,Pair<java.util.List<java.net.URI>,java.util.List<java.net.URI>>> getAllServices(java.lang.String serviceType)
serviceType - The type of the service for which to get all instances
and their global and local URIs.java.util.List<java.net.URI> getLocalServiceUris(java.lang.String clusterName,
java.net.URI[] globalServiceUris)
throws ServiceNotKnownException
clusterName - The name of the cluster of the requested service.globalServiceUris - The global URIs of a specific service.ServiceNotKnownException - If one of the designated URIs is unknown
or not all URIs refer to the same service, a
ServiceNotKnownException will be thrown. If the
provided cluster name is different from the cluster name of this
registry, a WrongClusterException will be thrown.java.util.List<java.net.URI> prepareServicePublishing(SessionToken session, java.lang.String clusterName, java.lang.String serviceType, java.lang.String serviceName, java.util.List<java.net.URI> localServiceUris) throws WrongClusterException
session - The session which is used to identify the publishing
service. Only the publishing service may
publish an
unpublish the service.clusterName - The name of the cluster in which to publish the service.serviceType - The type of the service for which to prepare its
publishing.serviceName - The simple instance name of the service for which to
prepare its publishing.localServiceUris - The local service URIs the service is exported
locally and can be reached with.WrongClusterException - If the provided cluster name is different
from the cluster name of this registry, a
WrongClusterException will be thrown.java.lang.IllegalArgumentException - If there is already a service with the
designated name or there are problems retrieving the required
information from the designated session token, an
IllegalArgumentException will be thrown.void publishService(SessionToken session, java.lang.String serviceType, java.lang.String serviceName, java.util.List<java.net.URI> globalServiceUris) throws ServiceNotKnownException
session - The session which is used to identify the publishing
service. This has to be the same service that
prepared publishing.serviceType - The type of the service for which to prepare its
publishing.serviceName - The simple instance name of the service for which to
prepare its publishing.globalServiceUris - The global service URI with which the service
publishing has been prepared.ServiceNotKnownException - If the service has not been prepared for
publishing, a ServiceNotKnownException will be
thrown.java.lang.IllegalArgumentException - If
IllegalArgumentException will be thrown.boolean unpublishService(SessionToken session, java.lang.String clusterName, java.lang.String serviceType, java.lang.String serviceName, java.util.List<java.net.URI> globalServiceUris) throws ServiceNotKnownException
session - The session which is used to identify the publishing
service. This has to be the same service that
prepared publishing.clusterName - The name of the cluster in which to unpublish the
service.serviceType - The type of the service for which to prepare its
publishing.serviceName - The simple instance name of the service for which to
prepare its publishing.globalServiceUris - The global service URI with which the service
publishing has been prepared.false will be returned.ServiceNotKnownException - If the service has not been prepared for
publishing, a ServiceNotKnownException will be
thrown. If the provided cluster name is different from the
cluster name of this registry, a
WrongClusterException will be thrown.java.lang.IllegalArgumentException - If
IllegalArgumentException will be thrown.void invalidate(SessionToken session, java.lang.String clusterName, java.net.URI[] globalServiceUris) throws WrongClusterException
session - The session token with which to check for access rights and recursive calls of
this method.clusterName - The name of the cluster in which to invalidate the service.globalServiceUris - The global URIs of the invalid service.WrongClusterException - If the provided cluster name is different from the cluster name
of this registry, a WrongClusterException will be thrown.void invalidate(SessionToken session, java.lang.String clusterName, java.lang.String serviceType, java.lang.String serviceName) throws WrongClusterException
session - The session token with which to check for access rights and recursive calls of
this method.clusterName - The name of the cluster in which to invalidate the service.serviceType - The type of the service which to invalidate.serviceName - The simple instance name of the service which to invalidate.WrongClusterException - If the provided cluster name is different from the cluster name
of this registry, a WrongClusterException will be thrown.GlobalServiceExport getGlobalServiceExport()