org.n52.connectors.core
Interface ConnectorCreation

All Known Implementing Classes:
AbstractServiceFactory, ServiceFactory

public interface ConnectorCreation

Creation of connectors by a factory class. The classes that implement this interface are considered client side classes and provide the users of connectors with a interface to the repository that stores the functionality supported by the Connector framework. Implementers of the interface must be able to fecth connectors from a registry.

Author:
martin Schouwenburg

Method Summary
 void addRegistry(ConnectorTypeRegistry registry)
          adds a certain registry to the set of registries that will be searched to find certain functionality
 java.lang.Object getServiceAdapter(ServiceRequest request)
          return one object which supports an interface with requested functionality.
 java.lang.Object[] getServiceAdapters(ServiceRequest request)
          returns one or more objects which supports an interface with requested functionality
 

Method Detail

getServiceAdapter

java.lang.Object getServiceAdapter(ServiceRequest request)
                                   throws org.n52.connectors.core.exceptions.N52Exception
return one object which supports an interface with requested functionality. If more than one is found the first one will be returned. To be usable a object must be cast to the functionality interface it supports.

Parameters:
request - contains all information that is needed to find a suitable connector
Returns:
a object that supports the request
Throws:
org.n52.connectors.core.exceptions.IllegalConnectorRequestException - request could not be fullfilled
org.n52.connectors.core.exceptions.N52Exception - low level errors that are passed to higher level error handling

getServiceAdapters

java.lang.Object[] getServiceAdapters(ServiceRequest request)
returns one or more objects which supports an interface with requested functionality

Parameters:
request - contains all information that is needed to find a suitable connector
Returns:
a set of objects that all supports the request

addRegistry

void addRegistry(ConnectorTypeRegistry registry)
adds a certain registry to the set of registries that will be searched to find certain functionality

Parameters:
registry - a registry made locally to query for functionality