Package org.distributeme.core
Class RegistryUtil
java.lang.Object
org.distributeme.core.util.BaseRegistryUtil
org.distributeme.core.RegistryUtil
Utilities for communication with the registry over http protocol.
- Version:
- $Id: $Id
- Author:
- lrosenberg
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInner configuration holder class. -
Field Summary
Fields inherited from class org.distributeme.core.util.BaseRegistryUtil
registryLocation -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanbind(ServiceDescriptor service) Binds a service.static ServiceDescriptorcreateLocalServiceDescription(ServiceDescriptor.Protocol protocol, String serviceId, String instanceId, int port) createLocalServiceDescription.static StringcreateRegistryOperationUrl(String operation, String parameters) Helper methods that creates the url for given operation and parameters.static StringcreateRegistryOperationUrl(Location loc, String operation, String parameters) Helper methods that creates the url for given operation and parameters.static final Stringprotected static StringGet registry url for internal use.protected static StringgetRegistryBaseUrl(Location location) Get registry url for internal use.static StringReturns the list of services as xml-string.static StringReturns the list of services from a specified location.static booleannotifyBind(Location location, ServiceDescriptor descriptor) notifyBind.static booleannotifyUnbind(Location location, ServiceDescriptor descriptor) notifyUnbind.static StringPings a location.static ServiceDescriptorresolve(ServiceDescriptor toResolve) Resolves a service request.static ServiceDescriptorresolve(ServiceDescriptor toResolve, Location loc) Resolves a service descriptor at a specified location.static booleanunbind(ServiceDescriptor service) Unbinds a service.Methods inherited from class org.distributeme.core.util.BaseRegistryUtil
encode, getRegistryBaseUrl, getRegistryBaseUrl, getRegistryLocation, getUrlContent, getUrlContent
-
Constructor Details
-
RegistryUtil
public RegistryUtil()
-
-
Method Details
-
bind
Binds a service.- Parameters:
service- aServiceDescriptorobject.- Returns:
- true if sucessful, false otherwise.
-
ping
Pings a location. This is part of the cluster management.- Parameters:
location- location to ping.- Returns:
- a
Stringobject.
-
notifyBind
notifyBind.
- Parameters:
location- aLocationobject.descriptor- aServiceDescriptorobject.- Returns:
- a boolean.
-
notifyUnbind
notifyUnbind.
- Parameters:
location- aLocationobject.descriptor- aServiceDescriptorobject.- Returns:
- a boolean.
-
unbind
Unbinds a service.- Parameters:
service- aServiceDescriptorobject.- Returns:
- a boolean.
-
resolve
Resolves a service descriptor at a specified location.- Parameters:
toResolve- aServiceDescriptorobject.loc- aLocationobject.- Returns:
- a
ServiceDescriptorobject.
-
createRegistryOperationUrl
Helper methods that creates the url for given operation and parameters.- Parameters:
operation- the operation which should be executed. For example BIND,UNBIND etc.parameters- the parameters to the operation.- Returns:
- a
Stringobject.
-
createRegistryOperationUrl
Helper methods that creates the url for given operation and parameters.- Parameters:
loc- location of the registry.operation- the operation which should be executed. For example BIND,UNBIND etc.parameters- the parameters to the operation.- Returns:
- a
Stringobject.
-
getXMLServiceList
Returns the list of services as xml-string.- Returns:
- a
Stringobject.
-
getXMLServiceList
Returns the list of services from a specified location. -
resolve
Resolves a service request.- Parameters:
toResolve- parameter descriptor which contains the serviceid to be resolved.- Returns:
- resolved service descriptor which points to a concrete service instance or null if no service has been found.
-
getRegistryBaseUrl
Get registry url for internal use.- Returns:
- a
Stringobject.
-
getRegistryBaseUrl
Get registry url for internal use.- Parameters:
location- registry location.- Returns:
- a
Stringobject.
-
createLocalServiceDescription
public static ServiceDescriptor createLocalServiceDescription(ServiceDescriptor.Protocol protocol, String serviceId, String instanceId, int port) createLocalServiceDescription.
- Parameters:
protocol- aServiceDescriptor.Protocolobject.serviceId- aStringobject.instanceId- aStringobject.port- a int.- Returns:
- a
ServiceDescriptorobject.
-
describeRegistry
-