org.ow2.petals.jbi.messaging.registry
Class BaseEndpointRegistry

java.lang.Object
  extended by org.ow2.petals.jbi.messaging.registry.AbstractEndpointRegistry
      extended by org.ow2.petals.jbi.messaging.registry.BaseEndpointRegistry
All Implemented Interfaces:
EndpointRegistry, EndpointRegistryMBean, RegistryManagement
Direct Known Subclasses:
DistributedEndpointRegistryImpl

public abstract class BaseEndpointRegistry
extends AbstractEndpointRegistry

The base endpoint registry class. This will be extended to provide standalone or distributed behavior.

Author:
chamerling - eBM WebSourcing

Field Summary
protected  org.ow2.petals.registry.client.api.RegistryClient client
           
protected static java.lang.String CONFIG
          Default configuration is in the petals configuration file
static java.lang.String LISTENER_FRACTAL_PREFIX
           
protected  org.ow2.petals.registry.api.LocalRegistry registry
           
 
Fields inherited from class org.ow2.petals.jbi.messaging.registry.AbstractEndpointRegistry
log
 
Fields inherited from interface org.ow2.petals.jbi.messaging.registry.EndpointRegistryMBean
KEY_COMPONENT_NAME, KEY_CONTAINER_NAME, KEY_ENDPOINT_NAME, KEY_INTERFACE_NAMES, KEY_SERVICE_NAME, KEY_TYPE, TYPE_EXTERNAL, TYPE_INTERNAL, UNDEFINED
 
Constructor Summary
BaseEndpointRegistry()
           
 
Method Summary
 ServiceEndpoint activateEndpoint(javax.xml.namespace.QName serviceName, java.lang.String endpointName, java.util.List<javax.xml.namespace.QName> interfaces, org.w3c.dom.Document description, ServiceEndpoint address)
          Register an endpoint in the endpoints registry.
 void deactivateEndpoint(java.lang.String endpointName, javax.xml.namespace.QName serviceName)
          Deactivates the local given endpoint.
 void deregisterConnection(javax.xml.namespace.QName consInterface, javax.xml.namespace.QName provService, java.lang.String provEndpoint)
          Delete a connection
 void deregisterConnection(javax.xml.namespace.QName consService, java.lang.String consEndpoint, javax.xml.namespace.QName provService, java.lang.String provEndpoint)
          Delete a connection
 void deregisterExternalEndpoint(java.lang.String endpointName, javax.xml.namespace.QName serviceName)
          Deregister external endpoint
 java.lang.String getDescription(java.lang.String serviceName, java.lang.String endpointName)
          Returns an InputStream representation of a ServiceEndpoint description
 ServiceEndpoint getEndpoint(javax.xml.namespace.QName service, java.lang.String name)
          Get the service endpoint for the named activated endpoint, if any.
 org.w3c.dom.Document getEndpointDescriptorForEndpoint(ServiceEndpoint endpoint)
          Return the descriptor for a specified endpoint.
 java.util.List<ServiceEndpoint> getExternalEndpoints()
          
 ServiceEndpoint[] getExternalEndpointsForInterface(javax.xml.namespace.QName interfaceName)
          Queries the registry for external endpoints that implements the given interface name
 ServiceEndpoint[] getExternalEndpointsForService(javax.xml.namespace.QName serviceName)
          Queries the registry for external endpoints that are part of the given service name
 javax.xml.namespace.QName[] getInterfacesForEndpoint(ServiceEndpoint endpoint)
          Return the interfaces for the specified endpoint.
 java.util.List<ServiceEndpoint> getInternalEndpoints()
           
 ServiceEndpoint[] getInternalEndpointsForInterface(javax.xml.namespace.QName interfaceName, org.ow2.petals.jbi.descriptor.original.generated.LinkType linktype)
          Queries the registry for active endpoints that implements the given interface, according to the link type.
 ServiceEndpoint[] getInternalEndpointsForService(javax.xml.namespace.QName serviceName, org.ow2.petals.jbi.descriptor.original.generated.LinkType linktype)
          Queries the registry for active endpoints belonging to the given service, according to the link type.
protected  java.lang.String getKey(java.lang.String epName, javax.xml.namespace.QName serviceName)
           
protected abstract  java.lang.String getRootPath()
          Get the root path where the endpoints will be stored.
 java.util.List<ServiceEndpoint> query(java.lang.String endpointName, javax.xml.namespace.QName itf, javax.xml.namespace.QName service, java.lang.String containerName, java.lang.String componentName, java.lang.String subDomainName, java.lang.String type)
          
 void registerConnection(javax.xml.namespace.QName consInterface, javax.xml.namespace.QName provService, java.lang.String provEndpoint)
          Register a connection
 void registerConnection(javax.xml.namespace.QName consService, java.lang.String consEndpoint, javax.xml.namespace.QName provService, java.lang.String provEndpoint)
          Register a connection
protected  void registerEndpoint(ServiceEndpoint serviceEndpoint)
           
 void registerExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
          FIXME ! Register this given external endpoint
 void removeAllLocalEndpoints()
          Remove all the local endpoints.
 
Methods inherited from class org.ow2.petals.jbi.messaging.registry.AbstractEndpointRegistry
getAllEndpoints, getAllExternalEndpoints, getAllInternalEndpoints, getEndpoints, interfaceQNameToString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ow2.petals.jbi.messaging.registry.EndpointRegistry
getListeners
 
Methods inherited from interface org.ow2.petals.jbi.messaging.registry.RegistryManagement
synchronizeData
 

Field Detail

LISTENER_FRACTAL_PREFIX

public static final java.lang.String LISTENER_FRACTAL_PREFIX
See Also:
Constant Field Values

CONFIG

protected static final java.lang.String CONFIG
Default configuration is in the petals configuration file

See Also:
Constant Field Values

registry

protected org.ow2.petals.registry.api.LocalRegistry registry

client

protected org.ow2.petals.registry.client.api.RegistryClient client
Constructor Detail

BaseEndpointRegistry

public BaseEndpointRegistry()
Method Detail

activateEndpoint

public ServiceEndpoint activateEndpoint(javax.xml.namespace.QName serviceName,
                                        java.lang.String endpointName,
                                        java.util.List<javax.xml.namespace.QName> interfaces,
                                        org.w3c.dom.Document description,
                                        ServiceEndpoint address)
                                 throws EndpointAlreadyExistsException,
                                        RegistryException
Register an endpoint in the endpoints registry.

Parameters:
serviceName - Endpoint service name.
endpointName - Endpoint name
interfaces - Endpoint interfaces
description - Endpoint WSDL
Returns:
A ServiceEndpoint associated to the registered endpoint.
Throws:
EndpointAlreadyExistsException - The endpoint is already registered.
RegistryException

registerEndpoint

protected void registerEndpoint(ServiceEndpoint serviceEndpoint)
                         throws RegistryException
Throws:
RegistryException

deactivateEndpoint

public void deactivateEndpoint(java.lang.String endpointName,
                               javax.xml.namespace.QName serviceName)
                        throws RegistryException
Deactivates the local given endpoint. Does not care about remotes ones !

Throws:
RegistryException

deregisterConnection

public void deregisterConnection(javax.xml.namespace.QName consInterface,
                                 javax.xml.namespace.QName provService,
                                 java.lang.String provEndpoint)
                          throws RegistryException
Delete a connection

Parameters:
consInterface - consumer interface name; must be non null
provService - provider service name; must be non null
provEndpoint - provider endpoint name; must be non null
Throws:
RegistryException

deregisterConnection

public void deregisterConnection(javax.xml.namespace.QName consService,
                                 java.lang.String consEndpoint,
                                 javax.xml.namespace.QName provService,
                                 java.lang.String provEndpoint)
                          throws RegistryException
Delete a connection

Parameters:
consService - consumer service name; must be non null
consEndpoint - consumer endpoint name; must be non null
provService - provider service name; must be non null
provEndpoint - provider endpoint name; must be non null
Throws:
RegistryException

deregisterExternalEndpoint

public void deregisterExternalEndpoint(java.lang.String endpointName,
                                       javax.xml.namespace.QName serviceName)
                                throws RegistryException
Deregister external endpoint

Throws:
RegistryException

getEndpoint

public ServiceEndpoint getEndpoint(javax.xml.namespace.QName service,
                                   java.lang.String name)
                            throws RegistryException
Get the service endpoint for the named activated endpoint, if any. It can be a connection.

Parameters:
service - qualified name of the endpoint's service; must be non null
name - name of the endpoint; must be non null
Returns:
the named endpoint, or null if the named endpoint is not activated
Throws:
RegistryException

getEndpointDescriptorForEndpoint

public org.w3c.dom.Document getEndpointDescriptorForEndpoint(ServiceEndpoint endpoint)
                                                      throws RegistryException
Return the descriptor for a specified endpoint. It can not be a connection endpoint.

Parameters:
endpoint - endpoint on which we want to retrieve the descriptor; must be non null
Returns:
Document the DOM representation of the descriptor (WSDL)
Throws:
RegistryException

getExternalEndpointsForInterface

public ServiceEndpoint[] getExternalEndpointsForInterface(javax.xml.namespace.QName interfaceName)
                                                   throws RegistryException
Description copied from interface: EndpointRegistry
Queries the registry for external endpoints that implements the given interface name

Parameters:
interfaceName - qualified name of interface implemented by the endpoints; can be null
Returns:
an array of availabe endpoints for the specified interface name; returns all availabe endpoints if interface name is null; must be non null, may be empty
Throws:
RegistryException

getExternalEndpointsForService

public ServiceEndpoint[] getExternalEndpointsForService(javax.xml.namespace.QName serviceName)
                                                 throws RegistryException
Description copied from interface: EndpointRegistry
Queries the registry for external endpoints that are part of the given service name

Parameters:
serviceName - qualified name of service that contains endpoints; must be non null
Returns:
an array of available endpoints for the specified service name; must be non null, may be empy
Throws:
RegistryException

getInterfacesForEndpoint

public javax.xml.namespace.QName[] getInterfacesForEndpoint(ServiceEndpoint endpoint)
Return the interfaces for the specified endpoint. This will get this information from the registry. The endpoint information is not updated with the new data !

Parameters:
endpoint - endpoint on which we want to retrieve the interface names; must be non null and not a connection endpoint
Returns:
Array of interfaces QName

getInternalEndpointsForInterface

public ServiceEndpoint[] getInternalEndpointsForInterface(javax.xml.namespace.QName interfaceName,
                                                          org.ow2.petals.jbi.descriptor.original.generated.LinkType linktype)
                                                   throws RegistryException
Queries the registry for active endpoints that implements the given interface, according to the link type.

Parameters:
interfaceName - qualified interface/portType that is implemented by the endpoints; if null then all activated endpoints in the JBI environment must be returned
Returns:
an array of available endpoints for the specified interface name; must be non null, may be empty
Throws:
RegistryException

getInternalEndpointsForService

public ServiceEndpoint[] getInternalEndpointsForService(javax.xml.namespace.QName serviceName,
                                                        org.ow2.petals.jbi.descriptor.original.generated.LinkType linktype)
                                                 throws RegistryException
Description copied from interface: EndpointRegistry
Queries the registry for active endpoints belonging to the given service, according to the link type.

Parameters:
serviceName - qualified name of the service that the endpoints are part of; must be non null
Returns:
an array of available endpoints for the specified service name; must be non null, may be empty
Throws:
RegistryException

registerConnection

public void registerConnection(javax.xml.namespace.QName consInterface,
                               javax.xml.namespace.QName provService,
                               java.lang.String provEndpoint)
                        throws RegistryException
Description copied from interface: EndpointRegistry
Register a connection

Parameters:
consInterface - consumer interface name; must be non null
provService - provider service name; must be non null
provEndpoint - provider endpoint name; must be non null
Throws:
RegistryException

registerConnection

public void registerConnection(javax.xml.namespace.QName consService,
                               java.lang.String consEndpoint,
                               javax.xml.namespace.QName provService,
                               java.lang.String provEndpoint)
                        throws RegistryException
Description copied from interface: EndpointRegistry
Register a connection

Parameters:
consService - consumer service name; must be non null
consEndpoint - consumer endpoint name; must be non null
provService - provider service name; must be non null
provEndpoint - provider endpoint name; must be non null
Throws:
RegistryException

registerExternalEndpoint

public void registerExternalEndpoint(javax.jbi.servicedesc.ServiceEndpoint externalEndpoint)
                              throws RegistryException
FIXME ! Register this given external endpoint

Throws:
RegistryException

getDescription

public java.lang.String getDescription(java.lang.String serviceName,
                                       java.lang.String endpointName)
                                throws RegistryException
Returns an InputStream representation of a ServiceEndpoint description

Parameters:
serviceName - the service QName of this endpoint
endpointName - the unique name of this endpoint
Returns:
a Dom representation of a ServiceEndpoint description
Throws:
RegistryException

getKey

protected java.lang.String getKey(java.lang.String epName,
                                  javax.xml.namespace.QName serviceName)

getRootPath

protected abstract java.lang.String getRootPath()
Get the root path where the endpoints will be stored.

Returns:
A path which must end with '/'

getExternalEndpoints

public java.util.List<ServiceEndpoint> getExternalEndpoints()
                                                     throws RegistryException

Throws:
RegistryException

getInternalEndpoints

public java.util.List<ServiceEndpoint> getInternalEndpoints()
                                                     throws RegistryException
Throws:
RegistryException

query

public java.util.List<ServiceEndpoint> query(java.lang.String endpointName,
                                             javax.xml.namespace.QName itf,
                                             javax.xml.namespace.QName service,
                                             java.lang.String containerName,
                                             java.lang.String componentName,
                                             java.lang.String subDomainName,
                                             java.lang.String type)
                                      throws RegistryException

Returns:
Throws:
RegistryException

removeAllLocalEndpoints

public void removeAllLocalEndpoints()
                             throws RegistryException
Remove all the local endpoints. If the registry is a distributed one, propagate the delete action to them.

Throws:
RegistryException


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.