org.apache.manifoldcf.authorities.authority
Class AuthorityConnectionManager

java.lang.Object
  extended by org.apache.manifoldcf.core.database.BaseTable
      extended by org.apache.manifoldcf.authorities.authority.AuthorityConnectionManager
All Implemented Interfaces:
IAuthorityConnectionManager

public class AuthorityConnectionManager
extends BaseTable
implements IAuthorityConnectionManager

Implementation of the authority connection manager functionality.


Nested Class Summary
protected static class AuthorityConnectionManager.AuthorityConnectionDescription
          This is the object description for a repository connection object.
protected static class AuthorityConnectionManager.AuthorityConnectionExecutor
          This is the executor object for locating repository connection objects.
 
Field Summary
static java.lang.String _rcsid
           
protected static java.lang.String classNameField
           
protected static java.lang.String configField
           
protected static java.lang.String descriptionField
           
protected static java.lang.String maxCountField
           
protected static java.lang.String nameField
           
protected static java.util.Random random
           
 
Fields inherited from class org.apache.manifoldcf.core.database.BaseTable
dbInterface, tableName
 
Constructor Summary
AuthorityConnectionManager(IThreadContext threadContext, IDBInterface database)
          Constructor.
 
Method Summary
 IAuthorityConnection create()
          Create a new repository connection object.
 void deinstall()
          Uninstall the manager.
 void delete(java.lang.String name)
          Delete a repository connection.
 void exportConfiguration(java.io.OutputStream os)
          Export configuration
 IAuthorityConnection[] getAllConnections()
          Obtain a list of the repository connections, ordered by name.
protected static java.lang.String getAuthorityConnectionKey(java.lang.String connectionName)
          Construct a key which represents an individual repository connection.
protected  void getAuthorityConnectionsChunk(AuthorityConnection[] rval, java.util.Map returnIndex, java.lang.String idList, java.util.ArrayList params)
          Read a chunk of authority connections.
protected static java.lang.String getAuthorityConnectionsKey()
          Construct a key which represents the general list of repository connectors.
protected  AuthorityConnection[] getAuthorityConnectionsMultiple(java.lang.String[] connectionNames)
          Fetch multiple repository connections at a single time.
 java.lang.String getAuthorityNameColumn()
          Get the authority connection name column.
 void importConfiguration(java.io.InputStream is)
          Import configuration
 void install()
          Install the manager.
 IAuthorityConnection load(java.lang.String name)
          Load a repository connection by name.
 IAuthorityConnection[] loadMultiple(java.lang.String[] names)
          Load multiple repository connections by name.
 boolean save(IAuthorityConnection object)
          Save a repository connection object.
 
Methods inherited from class org.apache.manifoldcf.core.database.BaseTable
addTableIndex, analyzeTable, beginTransaction, constructDistinctOnClause, constructOffsetLimitClause, constructRegexpClause, constructSubstringClause, endTransaction, getDatabaseCacheKey, getDBInterface, getMaxInClause, getMaxOrClause, getTableIndexes, getTableName, getTableSchema, getTransactionID, makeTableKey, noteModifications, performAddIndex, performAlter, performCreate, performDelete, performDrop, performInsert, performLock, performModification, performQuery, performQuery, performRemoveIndex, performUpdate, prepareRowForSave, readRow, reindexTable, signalRollback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.manifoldcf.authorities.interfaces.IAuthorityConnectionManager
getTableName
 

Field Detail

_rcsid

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

nameField

protected static final java.lang.String nameField
See Also:
Constant Field Values

descriptionField

protected static final java.lang.String descriptionField
See Also:
Constant Field Values

classNameField

protected static final java.lang.String classNameField
See Also:
Constant Field Values

maxCountField

protected static final java.lang.String maxCountField
See Also:
Constant Field Values

configField

protected static final java.lang.String configField
See Also:
Constant Field Values

random

protected static java.util.Random random
Constructor Detail

AuthorityConnectionManager

public AuthorityConnectionManager(IThreadContext threadContext,
                                  IDBInterface database)
                           throws ManifoldCFException
Constructor.

Parameters:
threadContext - is the thread context.
Throws:
ManifoldCFException
Method Detail

install

public void install()
             throws ManifoldCFException
Install the manager.

Specified by:
install in interface IAuthorityConnectionManager
Throws:
ManifoldCFException

deinstall

public void deinstall()
               throws ManifoldCFException
Uninstall the manager.

Specified by:
deinstall in interface IAuthorityConnectionManager
Throws:
ManifoldCFException

exportConfiguration

public void exportConfiguration(java.io.OutputStream os)
                         throws java.io.IOException,
                                ManifoldCFException
Export configuration

Specified by:
exportConfiguration in interface IAuthorityConnectionManager
Throws:
java.io.IOException
ManifoldCFException

importConfiguration

public void importConfiguration(java.io.InputStream is)
                         throws java.io.IOException,
                                ManifoldCFException
Import configuration

Specified by:
importConfiguration in interface IAuthorityConnectionManager
Throws:
java.io.IOException
ManifoldCFException

getAllConnections

public IAuthorityConnection[] getAllConnections()
                                         throws ManifoldCFException
Obtain a list of the repository connections, ordered by name.

Specified by:
getAllConnections in interface IAuthorityConnectionManager
Returns:
an array of connection objects.
Throws:
ManifoldCFException

load

public IAuthorityConnection load(java.lang.String name)
                          throws ManifoldCFException
Load a repository connection by name.

Specified by:
load in interface IAuthorityConnectionManager
Parameters:
name - is the name of the repository connection.
Returns:
the loaded connection object, or null if not found.
Throws:
ManifoldCFException

loadMultiple

public IAuthorityConnection[] loadMultiple(java.lang.String[] names)
                                    throws ManifoldCFException
Load multiple repository connections by name.

Parameters:
names - are the names to load.
Returns:
the loaded connection objects.
Throws:
ManifoldCFException

create

public IAuthorityConnection create()
                            throws ManifoldCFException
Create a new repository connection object.

Specified by:
create in interface IAuthorityConnectionManager
Returns:
the new object.
Throws:
ManifoldCFException

save

public boolean save(IAuthorityConnection object)
             throws ManifoldCFException
Save a repository connection object.

Specified by:
save in interface IAuthorityConnectionManager
Parameters:
object - is the object to save.
Returns:
true if the object is created, false otherwise.
Throws:
ManifoldCFException

delete

public void delete(java.lang.String name)
            throws ManifoldCFException
Delete a repository connection.

Specified by:
delete in interface IAuthorityConnectionManager
Parameters:
name - is the name of the connection to delete. If the name does not exist, no error is returned.
Throws:
ManifoldCFException

getAuthorityNameColumn

public java.lang.String getAuthorityNameColumn()
Get the authority connection name column.

Specified by:
getAuthorityNameColumn in interface IAuthorityConnectionManager
Returns:
the name column.

getAuthorityConnectionsKey

protected static java.lang.String getAuthorityConnectionsKey()
Construct a key which represents the general list of repository connectors.

Returns:
the cache key.

getAuthorityConnectionKey

protected static java.lang.String getAuthorityConnectionKey(java.lang.String connectionName)
Construct a key which represents an individual repository connection.

Parameters:
connectionName - is the name of the connector.
Returns:
the cache key.

getAuthorityConnectionsMultiple

protected AuthorityConnection[] getAuthorityConnectionsMultiple(java.lang.String[] connectionNames)
                                                         throws ManifoldCFException
Fetch multiple repository connections at a single time.

Parameters:
connectionNames - are a list of connection names.
Returns:
the corresponding repository connection objects.
Throws:
ManifoldCFException

getAuthorityConnectionsChunk

protected void getAuthorityConnectionsChunk(AuthorityConnection[] rval,
                                            java.util.Map returnIndex,
                                            java.lang.String idList,
                                            java.util.ArrayList params)
                                     throws ManifoldCFException
Read a chunk of authority connections.

Parameters:
rval - is the place to put the read policies.
returnIndex - is a map from the object id (resource id) and the rval index.
idList - is the list of id's.
params - is the set of parameters.
Throws:
ManifoldCFException