org.apache.manifoldcf.core.interfaces
Interface IConnector

All Known Subinterfaces:
IAuthorityConnector, IOutputConnector, IRepositoryConnector
All Known Implementing Classes:
BaseAuthorityConnector, BaseConnector, BaseOutputConnector, BaseRepositoryConnector

public interface IConnector

This interface represents the base methods every configurable connector needs. Connector instances are pooled, so that session setup does not need to be done repeatedly. The pool is segregated by specific sets of configuration parameters.


Method Summary
 java.lang.String check()
          Test the connection.
 void clearThreadContext()
          Clear out any state information specific to a given thread.
 void connect(ConfigParams configParams)
          Connect.
 void deinstall(IThreadContext threadContext)
          Uninstall the connector.
 void disconnect()
          Close the connection.
 ConfigParams getConfiguration()
          Get configuration information.
 void install(IThreadContext threadContext)
          Install the connector.
 void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, java.lang.String tabName)
          Output the configuration body section.
 void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, java.util.ArrayList tabsArray)
          Output the configuration header section.
 void poll()
          This method is periodically called for all connectors that are connected but not in active use.
 java.lang.String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext, ConfigParams parameters)
          Process a configuration post.
 void setThreadContext(IThreadContext threadContext)
          Attach to a new thread.
 void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters)
          View configuration.
 

Method Detail

install

void install(IThreadContext threadContext)
             throws ManifoldCFException
Install the connector. This method is called to initialize persistent storage for the connector, such as database tables etc. It is called when the connector is registered.

Parameters:
threadContext - is the current thread context.
Throws:
ManifoldCFException

deinstall

void deinstall(IThreadContext threadContext)
               throws ManifoldCFException
Uninstall the connector. This method is called to remove persistent storage for the connector, such as database tables etc. It is called when the connector is deregistered.

Parameters:
threadContext - is the current thread context.
Throws:
ManifoldCFException

connect

void connect(ConfigParams configParams)
Connect. The configuration parameters are included.

Parameters:
configParams - are the configuration parameters for this connection.

check

java.lang.String check()
                       throws ManifoldCFException
Test the connection. Returns a string describing the connection integrity.

Returns:
the connection's status as a displayable string.
Throws:
ManifoldCFException

poll

void poll()
          throws ManifoldCFException
This method is periodically called for all connectors that are connected but not in active use.

Throws:
ManifoldCFException

disconnect

void disconnect()
                throws ManifoldCFException
Close the connection. Call this before discarding the repository connector.

Throws:
ManifoldCFException

getConfiguration

ConfigParams getConfiguration()
Get configuration information.

Returns:
the configuration information for this class.

clearThreadContext

void clearThreadContext()
Clear out any state information specific to a given thread. This method is called when this object is returned to the connection pool.


setThreadContext

void setThreadContext(IThreadContext threadContext)
Attach to a new thread.

Parameters:
threadContext - is the new thread context.

outputConfigurationHeader

void outputConfigurationHeader(IThreadContext threadContext,
                               IHTTPOutput out,
                               ConfigParams parameters,
                               java.util.ArrayList tabsArray)
                               throws ManifoldCFException,
                                      java.io.IOException
Output the configuration header section. This method is called in the head section of the connector's configuration page. Its purpose is to add the required tabs to the list, and to output any javascript methods that might be needed by the configuration editing HTML.

Parameters:
threadContext - is the local thread context.
out - is the output to which any HTML should be sent.
parameters - are the configuration parameters, as they currently exist, for this connection being configured.
tabsArray - is an array of tab names. Add to this array any tab names that are specific to the connector.
Throws:
ManifoldCFException
java.io.IOException

outputConfigurationBody

void outputConfigurationBody(IThreadContext threadContext,
                             IHTTPOutput out,
                             ConfigParams parameters,
                             java.lang.String tabName)
                             throws ManifoldCFException,
                                    java.io.IOException
Output the configuration body section. This method is called in the body section of the authority connector's configuration page. Its purpose is to present the required form elements for editing. The coder can presume that the HTML that is output from this configuration will be within appropriate , , and
tags. The name of the form is "editconnection".

Parameters:
threadContext - is the local thread context.
out - is the output to which any HTML should be sent.
parameters - are the configuration parameters, as they currently exist, for this connection being configured.
tabName - is the current tab name.
Throws:
ManifoldCFException
java.io.IOException

processConfigurationPost

java.lang.String processConfigurationPost(IThreadContext threadContext,
                                          IPostParameters variableContext,
                                          ConfigParams parameters)
                                          throws ManifoldCFException
Process a configuration post. This method is called at the start of the authority connector's configuration page, whenever there is a possibility that form data for a connection has been posted. Its purpose is to gather form information and modify the configuration parameters accordingly. The name of the posted form is "editconnection".

Parameters:
threadContext - is the local thread context.
variableContext - is the set of variables available from the post, including binary file post information.
parameters - are the configuration parameters, as they currently exist, for this connection being configured.
Returns:
null if all is well, or a string error message if there is an error that should prevent saving of the connection (and cause a redirection to an error page).
Throws:
ManifoldCFException

viewConfiguration

void viewConfiguration(IThreadContext threadContext,
                       IHTTPOutput out,
                       ConfigParams parameters)
                       throws ManifoldCFException,
                              java.io.IOException
View configuration. This method is called in the body section of the authority connector's view configuration page. Its purpose is to present the connection information to the user. The coder can presume that the HTML that is output from this configuration will be within appropriate and tags.

Parameters:
threadContext - is the local thread context.
out - is the output to which any HTML should be sent.
parameters - are the configuration parameters, as they currently exist, for this connection being configured.
Throws:
ManifoldCFException
java.io.IOException