org.apache.manifoldcf.crawler.interfaces
Class RepositoryConnectorFactory

java.lang.Object
  extended by org.apache.manifoldcf.crawler.interfaces.RepositoryConnectorFactory

public class RepositoryConnectorFactory
extends java.lang.Object

This is the factory class for IRepositoryConnector objects.


Nested Class Summary
protected static class RepositoryConnectorFactory.ConnectorTracker
           
static class RepositoryConnectorFactory.Pool
          This class represents a value in the pool hash, which corresponds to a given key.
static class RepositoryConnectorFactory.PoolKey
          This is an immutable pool key class, which describes a pool in terms of two independent keys.
 
Field Summary
static java.lang.String _rcsid
           
protected static java.util.Map poolHash
           
 
Method Summary
static void closeAllConnectors(IThreadContext threadContext)
          Clean up all open repository connector handles.
static void deinstall(IThreadContext threadContext, java.lang.String className)
          Uninstall connector.
static java.lang.String[] getActivitiesList(IThreadContext threadContext, java.lang.String className)
          Get the activities supported by this connector.
protected static IRepositoryConnector getConnector(IThreadContext threadContext, java.lang.String className)
          Get a repository connector instance.
static int getConnectorModel(IThreadContext threadContext, java.lang.String className)
          Get the operating mode for a connector.
static IRepositoryConnector getConnectorNoCheck(java.lang.String className)
          Get a repository connector instance, without checking for installed connector.
static java.lang.String[] getRelationshipTypes(IThreadContext threadContext, java.lang.String className)
          Get the link types logged by this connector.
static IRepositoryConnector grab(IThreadContext threadContext, java.lang.String className, ConfigParams configInfo, int maxPoolSize)
          Get a repository connector.
static IRepositoryConnector[] grabMultiple(IThreadContext threadContext, java.lang.String[] orderingKeys, java.lang.String[] classNames, ConfigParams[] configInfos, int[] maxPoolSizes)
          Get multiple repository connectors, all at once.
static void install(IThreadContext threadContext, java.lang.String className)
          Install connector.
static void outputConfigurationBody(IThreadContext threadContext, java.lang.String className, IHTTPOutput out, ConfigParams parameters, java.lang.String tabName)
          Output the configuration body section.
static void outputConfigurationHeader(IThreadContext threadContext, java.lang.String className, IHTTPOutput out, ConfigParams parameters, java.util.ArrayList tabsArray)
          Output the configuration header section.
static void pollAllConnectors(IThreadContext threadContext)
          Idle notification for inactive repository connector handles.
static java.lang.String processConfigurationPost(IThreadContext threadContext, java.lang.String className, IPostParameters variableContext, ConfigParams configParams)
          Process configuration post data for a connector.
static void release(IRepositoryConnector connector)
          Release a repository connector.
static void releaseMultiple(IRepositoryConnector[] connectors)
          Release multiple repository connectors.
static void viewConfiguration(IThreadContext threadContext, java.lang.String className, IHTTPOutput out, ConfigParams configParams)
          View connector configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rcsid

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

poolHash

protected static java.util.Map poolHash
Method Detail

install

public static void install(IThreadContext threadContext,
                           java.lang.String className)
                    throws ManifoldCFException
Install connector.

Parameters:
className - is the class name.
Throws:
ManifoldCFException

deinstall

public static void deinstall(IThreadContext threadContext,
                             java.lang.String className)
                      throws ManifoldCFException
Uninstall connector.

Parameters:
className - is the class name.
Throws:
ManifoldCFException

getActivitiesList

public static java.lang.String[] getActivitiesList(IThreadContext threadContext,
                                                   java.lang.String className)
                                            throws ManifoldCFException
Get the activities supported by this connector.

Parameters:
className - is the class name.
Returns:
the list of activities.
Throws:
ManifoldCFException

getRelationshipTypes

public static java.lang.String[] getRelationshipTypes(IThreadContext threadContext,
                                                      java.lang.String className)
                                               throws ManifoldCFException
Get the link types logged by this connector.

Parameters:
className - is the class name.
Returns:
the list of link types, in sorted order.
Throws:
ManifoldCFException

getConnectorModel

public static int getConnectorModel(IThreadContext threadContext,
                                    java.lang.String className)
                             throws ManifoldCFException
Get the operating mode for a connector.

Parameters:
className - is the class name.
Returns:
the connector operating model, as specified in IRepositoryConnector.
Throws:
ManifoldCFException

outputConfigurationHeader

public static void outputConfigurationHeader(IThreadContext threadContext,
                                             java.lang.String className,
                                             IHTTPOutput out,
                                             ConfigParams parameters,
                                             java.util.ArrayList tabsArray)
                                      throws ManifoldCFException,
                                             java.io.IOException
Output the configuration header section.

Throws:
ManifoldCFException
java.io.IOException

outputConfigurationBody

public static void outputConfigurationBody(IThreadContext threadContext,
                                           java.lang.String className,
                                           IHTTPOutput out,
                                           ConfigParams parameters,
                                           java.lang.String tabName)
                                    throws ManifoldCFException,
                                           java.io.IOException
Output the configuration body section.

Throws:
ManifoldCFException
java.io.IOException

processConfigurationPost

public static java.lang.String processConfigurationPost(IThreadContext threadContext,
                                                        java.lang.String className,
                                                        IPostParameters variableContext,
                                                        ConfigParams configParams)
                                                 throws ManifoldCFException
Process configuration post data for a connector.

Throws:
ManifoldCFException

viewConfiguration

public static void viewConfiguration(IThreadContext threadContext,
                                     java.lang.String className,
                                     IHTTPOutput out,
                                     ConfigParams configParams)
                              throws ManifoldCFException,
                                     java.io.IOException
View connector configuration.

Throws:
ManifoldCFException
java.io.IOException

getConnectorNoCheck

public static IRepositoryConnector getConnectorNoCheck(java.lang.String className)
                                                throws ManifoldCFException
Get a repository connector instance, without checking for installed connector.

Parameters:
className - is the class name.
Returns:
the instance.
Throws:
ManifoldCFException

getConnector

protected static IRepositoryConnector getConnector(IThreadContext threadContext,
                                                   java.lang.String className)
                                            throws ManifoldCFException
Get a repository connector instance.

Parameters:
className - is the class name.
Returns:
the instance.
Throws:
ManifoldCFException

grabMultiple

public static IRepositoryConnector[] grabMultiple(IThreadContext threadContext,
                                                  java.lang.String[] orderingKeys,
                                                  java.lang.String[] classNames,
                                                  ConfigParams[] configInfos,
                                                  int[] maxPoolSizes)
                                           throws ManifoldCFException
Get multiple repository connectors, all at once. Do this in a particular order so that any connector exhaustion will not cause a deadlock.

Throws:
ManifoldCFException

grab

public static IRepositoryConnector grab(IThreadContext threadContext,
                                        java.lang.String className,
                                        ConfigParams configInfo,
                                        int maxPoolSize)
                                 throws ManifoldCFException
Get a repository connector. The connector is specified by its class and its parameters.

Parameters:
threadContext - is the current thread context.
className - is the name of the class to get a connector for.
configInfo - are the name/value pairs constituting configuration info for this class.
Throws:
ManifoldCFException

releaseMultiple

public static void releaseMultiple(IRepositoryConnector[] connectors)
                            throws ManifoldCFException
Release multiple repository connectors.

Throws:
ManifoldCFException

release

public static void release(IRepositoryConnector connector)
                    throws ManifoldCFException
Release a repository connector.

Parameters:
connector - is the connector to release.
Throws:
ManifoldCFException

pollAllConnectors

public static void pollAllConnectors(IThreadContext threadContext)
                              throws ManifoldCFException
Idle notification for inactive repository connector handles. This method polls all inactive handles.

Throws:
ManifoldCFException

closeAllConnectors

public static void closeAllConnectors(IThreadContext threadContext)
                               throws ManifoldCFException
Clean up all open repository connector handles. This method is called when the connector pool needs to be flushed, to free resources.

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