org.n52.connectors.core
Class AbstractConnector

java.lang.Object
  extended by org.n52.connectors.core.AbstractConnector
All Implemented Interfaces:
Connector

public abstract class AbstractConnector
extends java.lang.Object
implements Connector

Contains a number of default implementations of methods of the interface. The class is the mandatory parent for all implementations of the Connector interface

Author:
martin schouwenburg

Field Summary
private  java.net.URL classUrl
           
protected  java.lang.String connectorName
           
private  java.util.ArrayList<Dependency> dependencies
           
private  java.lang.String implementingClass
           
 
Constructor Summary
AbstractConnector()
           
 
Method Summary
protected  void addDependency(Dependency dependency)
           
 void factorySideInitialization(org.w3c.dom.Document xmlConfiguration, ServiceRequest request)
          Initializes the connector with information contained in the request.
 java.lang.Object getImplementingObject(ServiceRequest request)
          Returns an object that supports the desired functionality or gives (indirectly)access to the desired functionality.
abstract  org.geotools.metadata.iso.MetadataEntity getMetadata(java.lang.String arg0)
           
 java.lang.String getName()
          access to the name field of a connector
abstract  boolean isSupported(ServiceRequest request)
          Checks if a connector supports a service provider that fullfills the conditions set in the request.
 java.lang.String registrySideInitialization(ServiceRequest request)
          Creates an Xml string that contains initialization inforamtion needed by the factory to properly created the connector implied by the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectorName

protected java.lang.String connectorName

dependencies

private java.util.ArrayList<Dependency> dependencies

implementingClass

private java.lang.String implementingClass

classUrl

private java.net.URL classUrl
Constructor Detail

AbstractConnector

public AbstractConnector()
Method Detail

isSupported

public abstract boolean isSupported(ServiceRequest request)
Description copied from interface: Connector
Checks if a connector supports a service provider that fullfills the conditions set in the request.

Specified by:
isSupported in interface Connector
Parameters:
request - contains all information that is needed to find a suitable connector
Returns:
true if the information in the request matches with the properties of this connector

getMetadata

public abstract org.geotools.metadata.iso.MetadataEntity getMetadata(java.lang.String arg0)
Specified by:
getMetadata in interface Connector
Parameters:
arg0 - a metadata identifier based on ISO 19115. see..
Returns:
returns a metadataentity based on geotools (ISO 19115)

getName

public java.lang.String getName()
Description copied from interface: Connector
access to the name field of a connector

Specified by:
getName in interface Connector
Returns:
a name of the connector

registrySideInitialization

public java.lang.String registrySideInitialization(ServiceRequest request)
Description copied from interface: Connector
Creates an Xml string that contains initialization inforamtion needed by the factory to properly created the connector implied by the request. This initialization happens at the server side (registry) with parameters that are only present at the server side. This methode can be overruled in an appropraite connector

Specified by:
registrySideInitialization in interface Connector
Parameters:
request - The original request may contain information that is needed by the server side to create extra initialization information

factorySideInitialization

public void factorySideInitialization(org.w3c.dom.Document xmlConfiguration,
                                      ServiceRequest request)
                               throws org.n52.connectors.core.exceptions.N52Exception
Description copied from interface: Connector
Initializes the connector with information contained in the request. This initialization happens at the client side (factory) with parameters that do not need to be send to the registry. The method also ensures that initialization information send by the registry to the factory is properly used to initialize the connector This methode can be overruled in an appropraite connector

Specified by:
factorySideInitialization in interface Connector
Parameters:
xmlConfiguration - xml DOM document containing the information returned by the registry
request - The original request may contain initialization information used as the client side
Throws:
org.n52.connectors.core.exceptions.IllegalConnectorRequestException - requested parameters where not present or invalid in the request
org.n52.connectors.core.exceptions.ParameterDoesNotExistException
org.n52.connectors.core.exceptions.N52Exception

addDependency

protected void addDependency(Dependency dependency)

getImplementingObject

public java.lang.Object getImplementingObject(ServiceRequest request)
                                       throws org.n52.connectors.core.exceptions.N52Exception
Description copied from interface: Connector
Returns an object that supports the desired functionality or gives (indirectly)access to the desired functionality.

Specified by:
getImplementingObject in interface Connector
Returns:
Throws:
org.n52.connectors.core.exceptions.N52Exception