Class RegistryUtil


public class RegistryUtil extends BaseRegistryUtil
Utilities for communication with the registry over http protocol.
Version:
$Id: $Id
Author:
lrosenberg
  • Constructor Details

    • RegistryUtil

      public RegistryUtil()
  • Method Details

    • bind

      public static boolean bind(ServiceDescriptor service)
      Binds a service.
      Parameters:
      service - a ServiceDescriptor object.
      Returns:
      true if sucessful, false otherwise.
    • ping

      public static String ping(Location location)
      Pings a location. This is part of the cluster management.
      Parameters:
      location - location to ping.
      Returns:
      a String object.
    • notifyBind

      public static boolean notifyBind(Location location, ServiceDescriptor descriptor)

      notifyBind.

      Parameters:
      location - a Location object.
      descriptor - a ServiceDescriptor object.
      Returns:
      a boolean.
    • notifyUnbind

      public static boolean notifyUnbind(Location location, ServiceDescriptor descriptor)

      notifyUnbind.

      Parameters:
      location - a Location object.
      descriptor - a ServiceDescriptor object.
      Returns:
      a boolean.
    • unbind

      public static boolean unbind(ServiceDescriptor service)
      Unbinds a service.
      Parameters:
      service - a ServiceDescriptor object.
      Returns:
      a boolean.
    • resolve

      public static ServiceDescriptor resolve(ServiceDescriptor toResolve, Location loc)
      Resolves a service descriptor at a specified location.
      Parameters:
      toResolve - a ServiceDescriptor object.
      loc - a Location object.
      Returns:
      a ServiceDescriptor object.
    • createRegistryOperationUrl

      public static String createRegistryOperationUrl(String operation, String parameters)
      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 String object.
    • createRegistryOperationUrl

      public static String createRegistryOperationUrl(Location loc, String operation, String parameters)
      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 String object.
    • getXMLServiceList

      public static String getXMLServiceList()
      Returns the list of services as xml-string.
      Returns:
      a String object.
    • getXMLServiceList

      public static String getXMLServiceList(Location loc)
      Returns the list of services from a specified location.
      Parameters:
      loc - a Location object.
      Returns:
      a String object.
    • resolve

      public static ServiceDescriptor resolve(ServiceDescriptor toResolve)
      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

      protected static String getRegistryBaseUrl()
      Get registry url for internal use.
      Returns:
      a String object.
    • getRegistryBaseUrl

      protected static String getRegistryBaseUrl(Location location)
      Get registry url for internal use.
      Parameters:
      location - registry location.
      Returns:
      a String object.
    • createLocalServiceDescription

      public static ServiceDescriptor createLocalServiceDescription(ServiceDescriptor.Protocol protocol, String serviceId, String instanceId, int port)

      createLocalServiceDescription.

      Parameters:
      protocol - a ServiceDescriptor.Protocol object.
      serviceId - a String object.
      instanceId - a String object.
      port - a int.
      Returns:
      a ServiceDescriptor object.
    • describeRegistry

      public static final String describeRegistry()