com.fatwire.agent
Interface IConnector


public interface IConnector

Connector interface.

This interface is implemented when a new target or source system is supported.

The new connector implementation is typically placed into a new jar and registered in catalog.xml file in "connector" element.

This class is the first class which is loaded. All other implementation classes (implementations of IProviderSession, IRepository, IItem and InputStream are loaded though IConnector class which is used as an initial factory class.


Method Summary
 IProviderSession connect(Credentials credentials, Properties props)
          Creates a new session with the system represented by this connector.
 Properties getProperties()
          Gets this connector custom properties.
 void initialize(IConnectorContext ctx, Properties props)
          Called once during the connector initialization.
 void uninitialize()
          Called once during the connector uninitialization process.
 

Method Detail

initialize

void initialize(IConnectorContext ctx,
                Properties props)
                throws AgentException
Called once during the connector initialization.

This happens when the Agent runtime system is started. Should be used to allocate connector-specific resources.

Parameters:
context - connector context. It is typically used to make callbacks to the Agent runtime, e.g. IConnectorContext.guessMIMEType(String).
props - a bag of properties specific to this connector. These properties could be found in "init-params' section of catalog.xml file.
Throws:
AgentException - if any initialization error happens. This error is treated as critical and this connector is not process further.

uninitialize

void uninitialize()
                  throws AgentException
Called once during the connector uninitialization process.

This happends when Agent shuts down. Should be used to free all resources allocated in Initialize() method.

Throws:
AgentException - if any uninitialization error happens. This error is logged and the shut down process proceeds.

connect

IProviderSession connect(Credentials credentials,
                         Properties props)
                         throws AgentException
Creates a new session with the system represented by this connector.

Parameters:
credentials - credentials used to connect to the system (reserved for future use).
props - a bag of properties specific to the new provider created. These proprties could hold, e.g. a URL pointing to the Web Services interface of the represented system. They could be found in "init-params" section of "provider" element in catalog.xml file.
Returns:
newly established session with the represented system.
Throws:
if - provider session could not be established. In this case provider session is not created.
AgentException

getProperties

Properties getProperties()
Gets this connector custom properties.

Returns:
connector properties.