Class NotificationConnectionManager
- java.lang.Object
-
- org.apache.manifoldcf.core.database.BaseTable
-
- org.apache.manifoldcf.crawler.notification.NotificationConnectionManager
-
- All Implemented Interfaces:
INotificationConnectionManager
public class NotificationConnectionManager extends BaseTable implements INotificationConnectionManager
This class is the manager of the notification connection description. Inside, multiple database tables are 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.
notificationconnectionsField 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 classNotificationConnectionManager.NotificationConnectionDescriptionThis is the object description for a repository connection object.protected static classNotificationConnectionManager.NotificationConnectionExecutorThis is the executor object for locating notification connection objects.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String_rcsidprotected ICacheManagercacheManagerprotected static java.lang.StringclassNameFieldprotected static java.lang.StringconfigFieldprotected static java.lang.StringdescriptionFieldprotected static intFETCH_MAXprotected ILockManagerlockManagerprotected static java.lang.StringmaxCountFieldprotected static java.lang.StringnameFieldprotected java.lang.StringnotificationsLockprotected static java.util.Randomrandomprotected IThreadContextthreadContext-
Fields inherited from class org.apache.manifoldcf.core.database.BaseTable
dbInterface, tableName
-
-
Constructor Summary
Constructors Constructor Description NotificationConnectionManager(IThreadContext threadContext, IDBInterface database)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckConnectorExists(java.lang.String name)Check if underlying connector exists.INotificationConnectioncreate()Create a new notification connection object.voiddeinstall()Uninstall the manager.voiddelete(java.lang.String name)Delete a notification connection.voidexportConfiguration(java.io.OutputStream os)Export configurationjava.lang.String[]findConnectionsForConnector(java.lang.String className)Get a list of notification connections that share the same connector.INotificationConnection[]getAllConnections()Obtain a list of the notification connections, ordered by name.java.lang.StringgetConnectionNameColumn()Return the name column.protected static java.lang.StringgetNotificationConnectionKey(java.lang.String connectionName)Construct a key which represents an individual notification connection.protected voidgetNotificationConnectionsChunk(NotificationConnection[] rval, java.util.Map returnIndex, java.util.ArrayList params)Read a chunk of notification connections.protected static java.lang.StringgetNotificationConnectionsKey()Construct a key which represents the general list of notification connectors.protected NotificationConnection[]getNotificationConnectionsMultiple(java.lang.String[] connectionNames)Fetch multiple notification connections at a single time.voidimportConfiguration(java.io.InputStream is)Import configurationvoidinstall()Install the manager.INotificationConnectionload(java.lang.String name)Load a notification connection by name.INotificationConnection[]loadMultiple(java.lang.String[] names)Load multiple notification connections by name.protected intloadMultipleInternal(INotificationConnection[] rval, int outputIndex, java.lang.String[] fetchNames, int inputIndex, int length)protected intmaxClauseGetNotificationConnectionsChunk()Calculate how many notification connections to get at once.booleansave(INotificationConnection object)Save a notification 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.crawler.interfaces.INotificationConnectionManager
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
-
cacheManager
protected final ICacheManager cacheManager
-
threadContext
protected final IThreadContext threadContext
-
lockManager
protected final ILockManager lockManager
-
notificationsLock
protected final java.lang.String notificationsLock
- See Also:
- Constant Field Values
-
FETCH_MAX
protected static final int FETCH_MAX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NotificationConnectionManager
public NotificationConnectionManager(IThreadContext threadContext, IDBInterface database) throws ManifoldCFException
Constructor.- Parameters:
threadContext- is the thread context.- Throws:
ManifoldCFException
-
-
Method Detail
-
install
public void install() throws ManifoldCFExceptionInstall the manager.- Specified by:
installin interfaceINotificationConnectionManager- Throws:
ManifoldCFException
-
deinstall
public void deinstall() throws ManifoldCFExceptionUninstall the manager.- Specified by:
deinstallin interfaceINotificationConnectionManager- Throws:
ManifoldCFException
-
exportConfiguration
public void exportConfiguration(java.io.OutputStream os) throws java.io.IOException, ManifoldCFExceptionExport configuration- Specified by:
exportConfigurationin interfaceINotificationConnectionManager- Throws:
java.io.IOExceptionManifoldCFException
-
importConfiguration
public void importConfiguration(java.io.InputStream is) throws java.io.IOException, ManifoldCFExceptionImport configuration- Specified by:
importConfigurationin interfaceINotificationConnectionManager- Throws:
java.io.IOExceptionManifoldCFException
-
getAllConnections
public INotificationConnection[] getAllConnections() throws ManifoldCFException
Obtain a list of the notification connections, ordered by name.- Specified by:
getAllConnectionsin interfaceINotificationConnectionManager- Returns:
- an array of connection objects.
- Throws:
ManifoldCFException
-
load
public INotificationConnection load(java.lang.String name) throws ManifoldCFException
Load a notification connection by name.- Specified by:
loadin interfaceINotificationConnectionManager- Parameters:
name- is the name of the notification connection.- Returns:
- the loaded connection object, or null if not found.
- Throws:
ManifoldCFException
-
loadMultiple
public INotificationConnection[] loadMultiple(java.lang.String[] names) throws ManifoldCFException
Load multiple notification connections by name.- Specified by:
loadMultiplein interfaceINotificationConnectionManager- Parameters:
names- are the names to load.- Returns:
- the loaded connection objects.
- Throws:
ManifoldCFException
-
loadMultipleInternal
protected int loadMultipleInternal(INotificationConnection[] rval, int outputIndex, java.lang.String[] fetchNames, int inputIndex, int length) throws ManifoldCFException
- Throws:
ManifoldCFException
-
create
public INotificationConnection create() throws ManifoldCFException
Create a new notification connection object.- Specified by:
createin interfaceINotificationConnectionManager- Returns:
- the new object.
- Throws:
ManifoldCFException
-
save
public boolean save(INotificationConnection object) throws ManifoldCFException
Save a notification connection object.- Specified by:
savein interfaceINotificationConnectionManager- Parameters:
object- is the object to save.- Returns:
- true if the object was created, false otherwise.
- Throws:
ManifoldCFException
-
delete
public void delete(java.lang.String name) throws ManifoldCFExceptionDelete a notification connection.- Specified by:
deletein interfaceINotificationConnectionManager- 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 ManifoldCFExceptionGet a list of notification connections that share the same connector.- Specified by:
findConnectionsForConnectorin interfaceINotificationConnectionManager- Parameters:
className- is the class name of the connector.- Returns:
- the notification connections that use that connector.
- Throws:
ManifoldCFException
-
checkConnectorExists
public boolean checkConnectorExists(java.lang.String name) throws ManifoldCFExceptionCheck if underlying connector exists.- Specified by:
checkConnectorExistsin interfaceINotificationConnectionManager- 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:
getConnectionNameColumnin interfaceINotificationConnectionManager- Returns:
- the name column.
-
getNotificationConnectionsKey
protected static java.lang.String getNotificationConnectionsKey()
Construct a key which represents the general list of notification connectors.- Returns:
- the cache key.
-
getNotificationConnectionKey
protected static java.lang.String getNotificationConnectionKey(java.lang.String connectionName)
Construct a key which represents an individual notification connection.- Parameters:
connectionName- is the name of the connector.- Returns:
- the cache key.
-
getNotificationConnectionsMultiple
protected NotificationConnection[] getNotificationConnectionsMultiple(java.lang.String[] connectionNames) throws ManifoldCFException
Fetch multiple notification connections at a single time.- Parameters:
connectionNames- are a list of connection names.- Returns:
- the corresponding repository connection objects.
- Throws:
ManifoldCFException
-
maxClauseGetNotificationConnectionsChunk
protected int maxClauseGetNotificationConnectionsChunk()
Calculate how many notification connections to get at once.
-
getNotificationConnectionsChunk
protected void getNotificationConnectionsChunk(NotificationConnection[] rval, java.util.Map returnIndex, java.util.ArrayList params) throws ManifoldCFException
Read a chunk of notification 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
-
-