Class TransformationConnectionManager
- java.lang.Object
-
- org.apache.manifoldcf.core.database.BaseTable
-
- org.apache.manifoldcf.agents.transformationconnection.TransformationConnectionManager
-
- All Implemented Interfaces:
ITransformationConnectionManager
public class TransformationConnectionManager extends BaseTable implements ITransformationConnectionManager
This class is the manager of the transformation connection description. Inside, a database table is managed, with appropriate caching. Note well: The database handle is instantiated here using the DBInterfaceFactory. This is acceptable because the actual database that this table is located in is fixed.
transformationconnectionsField Type Description connectionname VARCHAR(32) Primary Key description VARCHAR(255) classname VARCHAR(255) maxcount BIGINT configxml LONGTEXT
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
TransformationConnectionManager.TransformationConnectionDescription
This is the object description for a transformation connection object.protected static class
TransformationConnectionManager.TransformationConnectionExecutor
This is the executor object for locating transformation connection objects.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
_rcsid
protected ICacheManager
cacheManager
protected static java.lang.String
classNameField
protected static java.lang.String
configField
protected static java.lang.String
descriptionField
protected static int
FETCH_MAX
protected ILockManager
lockManager
protected static java.lang.String
maxCountField
protected static java.lang.String
nameField
protected IThreadContext
threadContext
protected static java.lang.String
transformationsLock
-
Fields inherited from class org.apache.manifoldcf.core.database.BaseTable
dbInterface, tableName
-
-
Constructor Summary
Constructors Constructor Description TransformationConnectionManager(IThreadContext threadContext, IDBInterface database)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkConnectorExists(java.lang.String name)
Check if underlying connector exists.ITransformationConnection
create()
Create a new transformation connection object.void
deinstall()
Uninstall the manager.void
delete(java.lang.String name)
Delete an output connection.void
exportConfiguration(java.io.OutputStream os)
Export configurationjava.lang.String[]
findConnectionsForConnector(java.lang.String className)
Get a list of output connections that share the same connector.ITransformationConnection[]
getAllConnections()
Obtain a list of the transformation connections, ordered by name.java.lang.String
getConnectionNameColumn()
Return the name column.protected static java.lang.String
getTransformationConnectionKey(java.lang.String connectionName)
Construct a key which represents an individual transformation connection.protected void
getTransformationConnectionsChunk(TransformationConnection[] rval, java.util.Map<java.lang.String,java.lang.Integer> returnIndex, java.util.ArrayList params)
Read a chunk of transformation connections.protected static java.lang.String
getTransformationConnectionsKey()
Construct a key which represents the general list of transformation connectors.protected TransformationConnection[]
getTransformationConnectionsMultiple(java.lang.String[] connectionNames)
Fetch multiple output connections at a single time.void
importConfiguration(java.io.InputStream is)
Import configurationvoid
install()
Install the manager.ITransformationConnection
load(java.lang.String name)
Load a transformation connection by name.ITransformationConnection[]
loadMultiple(java.lang.String[] names)
Load multiple transformation connections by name.protected int
loadMultipleInternal(ITransformationConnection[] rval, int outputIndex, java.lang.String[] fetchNames, int inputIndex, int length)
protected int
maxClauseGetTransformationConnectionsChunk()
Calculate max number of clauses to send to getTransformationConnectionsChunk.boolean
save(ITransformationConnection object)
Save a transformation connection object.-
Methods inherited from class org.apache.manifoldcf.core.database.BaseTable
addTableIndex, analyzeTable, beginTransaction, buildConjunctionClause, constructCountClause, constructDistinctOnClause, constructDoubleCastClause, constructOffsetLimitClause, constructRegexpClause, constructSubstringClause, endTransaction, findConjunctionClauseMax, getDatabaseCacheKey, getDBInterface, getMaxInClause, getMaxOrClause, getSleepAmt, getTableIndexes, getTableName, getTableSchema, getTransactionID, getWindowedReportMaxRows, makeTableKey, noteModifications, performAddIndex, performAlter, performCommit, performCreate, performDelete, performDrop, performInsert, performModification, performQuery, performQuery, performRemoveIndex, performUpdate, prepareRowForSave, readRow, reindexTable, signalRollback, sleepFor
-
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.agents.interfaces.ITransformationConnectionManager
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
-
cacheManager
protected final ICacheManager cacheManager
-
threadContext
protected final IThreadContext threadContext
-
lockManager
protected final ILockManager lockManager
-
transformationsLock
protected static final java.lang.String transformationsLock
- See Also:
- Constant Field Values
-
FETCH_MAX
protected static final int FETCH_MAX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TransformationConnectionManager
public TransformationConnectionManager(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 interfaceITransformationConnectionManager
- Throws:
ManifoldCFException
-
deinstall
public void deinstall() throws ManifoldCFException
Uninstall the manager.- Specified by:
deinstall
in interfaceITransformationConnectionManager
- Throws:
ManifoldCFException
-
exportConfiguration
public void exportConfiguration(java.io.OutputStream os) throws java.io.IOException, ManifoldCFException
Export configuration- Specified by:
exportConfiguration
in interfaceITransformationConnectionManager
- Throws:
java.io.IOException
ManifoldCFException
-
importConfiguration
public void importConfiguration(java.io.InputStream is) throws java.io.IOException, ManifoldCFException
Import configuration- Specified by:
importConfiguration
in interfaceITransformationConnectionManager
- Throws:
java.io.IOException
ManifoldCFException
-
getAllConnections
public ITransformationConnection[] getAllConnections() throws ManifoldCFException
Obtain a list of the transformation connections, ordered by name.- Specified by:
getAllConnections
in interfaceITransformationConnectionManager
- Returns:
- an array of connection objects.
- Throws:
ManifoldCFException
-
load
public ITransformationConnection load(java.lang.String name) throws ManifoldCFException
Load a transformation connection by name.- Specified by:
load
in interfaceITransformationConnectionManager
- Parameters:
name
- is the name of the transformation connection.- Returns:
- the loaded connection object, or null if not found.
- Throws:
ManifoldCFException
-
loadMultiple
public ITransformationConnection[] loadMultiple(java.lang.String[] names) throws ManifoldCFException
Load multiple transformation connections by name.- Specified by:
loadMultiple
in interfaceITransformationConnectionManager
- Parameters:
names
- are the names to load.- Returns:
- the loaded connection objects.
- Throws:
ManifoldCFException
-
loadMultipleInternal
protected int loadMultipleInternal(ITransformationConnection[] rval, int outputIndex, java.lang.String[] fetchNames, int inputIndex, int length) throws ManifoldCFException
- Throws:
ManifoldCFException
-
create
public ITransformationConnection create() throws ManifoldCFException
Create a new transformation connection object.- Specified by:
create
in interfaceITransformationConnectionManager
- Returns:
- the new object.
- Throws:
ManifoldCFException
-
save
public boolean save(ITransformationConnection object) throws ManifoldCFException
Save a transformation connection object.- Specified by:
save
in interfaceITransformationConnectionManager
- Parameters:
object
- is the object to save.- Returns:
- true if the object is being created, false otherwise.
- Throws:
ManifoldCFException
-
delete
public void delete(java.lang.String name) throws ManifoldCFException
Delete an output connection.- Specified by:
delete
in interfaceITransformationConnectionManager
- Parameters:
name
- is the name of the connection to delete. If the name does not exist, no error is returned.- Throws:
ManifoldCFException
-
findConnectionsForConnector
public java.lang.String[] findConnectionsForConnector(java.lang.String className) throws ManifoldCFException
Get a list of output connections that share the same connector.- Specified by:
findConnectionsForConnector
in interfaceITransformationConnectionManager
- Parameters:
className
- is the class name of the connector.- Returns:
- the repository connections that use that connector.
- Throws:
ManifoldCFException
-
checkConnectorExists
public boolean checkConnectorExists(java.lang.String name) throws ManifoldCFException
Check if underlying connector exists.- Specified by:
checkConnectorExists
in interfaceITransformationConnectionManager
- Parameters:
name
- is the name of the connection to check.- Returns:
- true if the underlying connector is registered.
- Throws:
ManifoldCFException
-
getConnectionNameColumn
public java.lang.String getConnectionNameColumn()
Return the name column.- Specified by:
getConnectionNameColumn
in interfaceITransformationConnectionManager
- Returns:
- the name column.
-
getTransformationConnectionsKey
protected static java.lang.String getTransformationConnectionsKey()
Construct a key which represents the general list of transformation connectors.- Returns:
- the cache key.
-
getTransformationConnectionKey
protected static java.lang.String getTransformationConnectionKey(java.lang.String connectionName)
Construct a key which represents an individual transformation connection.- Parameters:
connectionName
- is the name of the connector.- Returns:
- the cache key.
-
getTransformationConnectionsMultiple
protected TransformationConnection[] getTransformationConnectionsMultiple(java.lang.String[] connectionNames) throws ManifoldCFException
Fetch multiple output connections at a single time.- Parameters:
connectionNames
- are a list of connection names.- Returns:
- the corresponding output connection objects.
- Throws:
ManifoldCFException
-
maxClauseGetTransformationConnectionsChunk
protected int maxClauseGetTransformationConnectionsChunk()
Calculate max number of clauses to send to getTransformationConnectionsChunk.
-
getTransformationConnectionsChunk
protected void getTransformationConnectionsChunk(TransformationConnection[] rval, java.util.Map<java.lang.String,java.lang.Integer> returnIndex, java.util.ArrayList params) throws ManifoldCFException
Read a chunk of transformation 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.params
- is the set of parameters.- Throws:
ManifoldCFException
-
-