public class RepositoryConnectionManager extends BaseTable implements IRepositoryConnectionManager
Field | Type | Description |
---|---|---|
connectionname | VARCHAR(32) | Primary Key |
description | VARCHAR(255) | |
classname | VARCHAR(255) | |
groupname | VARCHAR(32) | |
maxcount | BIGINT | |
configxml | LONGTEXT |
Modifier and Type | Class and Description |
---|---|
protected static class |
RepositoryConnectionManager.RepositoryConnectionDescription
This is the object description for a repository connection object.
|
protected static class |
RepositoryConnectionManager.RepositoryConnectionExecutor
This is the executor object for locating repository connection objects.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
_rcsid |
protected static java.lang.String |
authorityNameField |
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 static java.lang.String |
groupNameField |
protected RepositoryHistoryManager |
historyManager |
protected ILockManager |
lockManager |
protected static java.lang.String |
maxCountField |
protected static java.lang.String |
nameField |
protected static java.util.Random |
random |
protected java.lang.String |
repositoriesLock |
protected IThreadContext |
threadContext |
protected ThrottleSpecManager |
throttleSpecManager |
dbInterface, tableName
ACTIVITY_JOBCONTINUE, ACTIVITY_JOBEND, ACTIVITY_JOBSTART, ACTIVITY_JOBSTOP, ACTIVITY_JOBUNWAIT, ACTIVITY_JOBWAIT, activitySet
Constructor and Description |
---|
RepositoryConnectionManager(IThreadContext threadContext,
IDBInterface database)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkConnectorExists(java.lang.String name)
Check if underlying connector exists.
|
void |
cleanUpHistoryData(long timeCutoff)
Delete history rows older than a specified timestamp.
|
void |
cleanUpHistoryData(java.lang.String connectionName)
Delete history rows related to a specific connection, upon user request.
|
long |
countHistoryRows(java.lang.String connectionName,
FilterCriteria criteria)
Count the number of rows specified by a given set of criteria.
|
IRepositoryConnection |
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
|
java.lang.String[] |
findConnectionsForConnector(java.lang.String className)
Get a list of repository connections that share the same connector.
|
IResultSet |
genHistoryActivityCount(java.lang.String connectionName,
FilterCriteria criteria,
SortOrder sort,
BucketDescription idBucket,
long interval,
int startRow,
int maxRowCount)
Generate a report, listing the start time, activity count, and identifier bucket, given
a time slice (interval) size.
|
IResultSet |
genHistoryByteCount(java.lang.String connectionName,
FilterCriteria criteria,
SortOrder sort,
BucketDescription idBucket,
long interval,
int startRow,
int maxRowCount)
Generate a report, listing the start time, bytes processed, and identifier bucket, given
a time slice (interval) size.
|
IResultSet |
genHistoryResultCodes(java.lang.String connectionName,
FilterCriteria criteria,
SortOrder sort,
BucketDescription resultCodeBucket,
BucketDescription idBucket,
int startRow,
int maxRowCount)
Generate a report, listing the result bucket and identifier bucket.
|
IResultSet |
genHistorySimple(java.lang.String connectionName,
FilterCriteria criteria,
SortOrder sort,
int startRow,
int maxRowCount)
Generate a report, listing the start time, elapsed time, result code and description, number of bytes, and entity identifier.
|
IRepositoryConnection[] |
getAllConnections()
Obtain a list of the repository connections, ordered by name.
|
java.lang.String |
getConnectionNameColumn()
Return the name column.
|
long |
getMaxRows()
Get the maximum number of rows a window-based report can work with.
|
protected static java.lang.String |
getRepositoryConnectionKey(java.lang.String connectionName)
Construct a key which represents an individual repository connection.
|
protected void |
getRepositoryConnectionsChunk(RepositoryConnection[] rval,
java.util.Map returnIndex,
java.util.ArrayList params)
Read a chunk of repository connections.
|
protected static java.lang.String |
getRepositoryConnectionsKey()
Construct a key which represents the general list of repository connectors.
|
protected RepositoryConnection[] |
getRepositoryConnectionsMultiple(java.lang.String[] connectionNames)
Fetch multiple repository connections at a single time.
|
void |
importConfiguration(java.io.InputStream is)
Import configuration
|
void |
install()
Install the manager.
|
boolean |
isGroupReferenced(java.lang.String groupName)
Return true if the specified authority name is referenced.
|
IRepositoryConnection |
load(java.lang.String name)
Load a repository connection by name.
|
IRepositoryConnection[] |
loadMultiple(java.lang.String[] names)
Load multiple repository connections by name.
|
protected int |
loadMultipleInternal(IRepositoryConnection[] rval,
int outputIndex,
java.lang.String[] fetchNames,
int inputIndex,
int length) |
protected int |
maxClauseGetRepositoryConnectionsChunk()
Calculate how many repository connections to get at once.
|
void |
recordHistory(java.lang.String connectionName,
java.lang.Long startTime,
java.lang.String activityType,
java.lang.Long dataSize,
java.lang.String entityIdentifier,
java.lang.String resultCode,
java.lang.String resultDescription,
java.lang.String[] childIdentifiers)
Record time-stamped information about the activity of the connection.
|
boolean |
save(IRepositoryConnection object)
Save a repository connection object.
|
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTableName
public static final java.lang.String _rcsid
protected static final java.lang.String nameField
protected static final java.lang.String descriptionField
protected static final java.lang.String classNameField
protected static final java.lang.String maxCountField
protected static final java.lang.String configField
protected static final java.lang.String groupNameField
protected static final java.lang.String authorityNameField
protected static java.util.Random random
protected final RepositoryHistoryManager historyManager
protected final ThrottleSpecManager throttleSpecManager
protected final ICacheManager cacheManager
protected final IThreadContext threadContext
protected final ILockManager lockManager
protected final java.lang.String repositoriesLock
protected static final int FETCH_MAX
public RepositoryConnectionManager(IThreadContext threadContext, IDBInterface database) throws ManifoldCFException
threadContext
- is the thread context.ManifoldCFException
public void install() throws ManifoldCFException
install
in interface IRepositoryConnectionManager
ManifoldCFException
public void deinstall() throws ManifoldCFException
deinstall
in interface IRepositoryConnectionManager
ManifoldCFException
public void exportConfiguration(java.io.OutputStream os) throws java.io.IOException, ManifoldCFException
exportConfiguration
in interface IRepositoryConnectionManager
java.io.IOException
ManifoldCFException
public void importConfiguration(java.io.InputStream is) throws java.io.IOException, ManifoldCFException
importConfiguration
in interface IRepositoryConnectionManager
java.io.IOException
ManifoldCFException
public IRepositoryConnection[] getAllConnections() throws ManifoldCFException
getAllConnections
in interface IRepositoryConnectionManager
ManifoldCFException
public IRepositoryConnection load(java.lang.String name) throws ManifoldCFException
load
in interface IRepositoryConnectionManager
name
- is the name of the repository connection.ManifoldCFException
public IRepositoryConnection[] loadMultiple(java.lang.String[] names) throws ManifoldCFException
loadMultiple
in interface IRepositoryConnectionManager
names
- are the names to load.ManifoldCFException
protected int loadMultipleInternal(IRepositoryConnection[] rval, int outputIndex, java.lang.String[] fetchNames, int inputIndex, int length) throws ManifoldCFException
ManifoldCFException
public IRepositoryConnection create() throws ManifoldCFException
create
in interface IRepositoryConnectionManager
ManifoldCFException
public boolean save(IRepositoryConnection object) throws ManifoldCFException
save
in interface IRepositoryConnectionManager
object
- is the object to save.ManifoldCFException
public void delete(java.lang.String name) throws ManifoldCFException
delete
in interface IRepositoryConnectionManager
name
- is the name of the connection to delete. If the
name does not exist, no error is returned.ManifoldCFException
public boolean isGroupReferenced(java.lang.String groupName) throws ManifoldCFException
isGroupReferenced
in interface IRepositoryConnectionManager
groupName
- is the group name.ManifoldCFException
public java.lang.String[] findConnectionsForConnector(java.lang.String className) throws ManifoldCFException
findConnectionsForConnector
in interface IRepositoryConnectionManager
className
- is the class name of the connector.ManifoldCFException
public boolean checkConnectorExists(java.lang.String name) throws ManifoldCFException
checkConnectorExists
in interface IRepositoryConnectionManager
name
- is the name of the connection to check.ManifoldCFException
public java.lang.String getConnectionNameColumn()
getConnectionNameColumn
in interface IRepositoryConnectionManager
public void cleanUpHistoryData(java.lang.String connectionName) throws ManifoldCFException
cleanUpHistoryData
in interface IRepositoryConnectionManager
connectionName
- is the connection whose history records should be removed.ManifoldCFException
public void cleanUpHistoryData(long timeCutoff) throws ManifoldCFException
cleanUpHistoryData
in interface IRepositoryConnectionManager
timeCutoff
- is the timestamp to delete older rows before.ManifoldCFException
public void recordHistory(java.lang.String connectionName, java.lang.Long startTime, java.lang.String activityType, java.lang.Long dataSize, java.lang.String entityIdentifier, java.lang.String resultCode, java.lang.String resultDescription, java.lang.String[] childIdentifiers) throws ManifoldCFException
recordHistory
in interface IRepositoryConnectionManager
connectionName
- is the connection to which the record belongs. If the connection is deleted, the
corresponding records will also be deleted. Cannot be null.startTime
- is either null or the time since the start of epoch in milliseconds (Jan 1, 1970). Every
activity has an associated time; the startTime field records when the activity began. A null value
indicates that the start time and the finishing time are the same.activityType
- is a string which is fully interpretable only in the context of the connector involved, which is
used to categorize what kind of activity is being recorded. For example, a web connector might record a
"fetch document" activity, while the framework might record "ingest document", "job start", "job finish",
"job abort", etc. Cannot be null.dataSize
- is the number of bytes of data involved in the activity, or null if not applicable.entityIdentifier
- is a (possibly long) string which identifies the object involved in the history record.
The interpretation of this field will differ from connector to connector. May be null.resultCode
- contains a terse description of the result of the activity. The description is limited in
size to 255 characters, and can be interpreted only in the context of the current connector. May be null.resultDescription
- is a (possibly long) human-readable string which adds detail, if required, to the result
described in the resultCode field. This field is not meant to be queried on. May be null.childIdentifiers
- is a set of child entity identifiers associated with this activity. May be null.ManifoldCFException
public long countHistoryRows(java.lang.String connectionName, FilterCriteria criteria) throws ManifoldCFException
countHistoryRows
in interface IRepositoryConnectionManager
connectionName
- is the name of the connection.criteria
- is the filtering criteria, which selects the records of interest.ManifoldCFException
public long getMaxRows() throws ManifoldCFException
getMaxRows
in interface IRepositoryConnectionManager
ManifoldCFException
public IResultSet genHistorySimple(java.lang.String connectionName, FilterCriteria criteria, SortOrder sort, int startRow, int maxRowCount) throws ManifoldCFException
genHistorySimple
in interface IRepositoryConnectionManager
connectionName
- is the name of the connection.criteria
- is the filtering criteria, which selects the records of interest.sort
- is the sorting order, which can specify sort based on the result columns.startRow
- is the first row to include (beginning with 0)maxRowCount
- is the maximum number of rows to include.ManifoldCFException
public IResultSet genHistoryActivityCount(java.lang.String connectionName, FilterCriteria criteria, SortOrder sort, BucketDescription idBucket, long interval, int startRow, int maxRowCount) throws ManifoldCFException
genHistoryActivityCount
in interface IRepositoryConnectionManager
connectionName
- is the name of the connection.criteria
- is the filtering criteria, which selects the records of interest.sort
- is the sorting order, which can specify sort based on the result columns.idBucket
- is the description of the bucket based on processed entity identifiers.interval
- is the time interval, in milliseconds, to locate. There will be one row in the resultset
for each distinct idBucket value, and the returned activity count will the maximum found over the
specified interval size.startRow
- is the first row to include (beginning with 0)maxRowCount
- is the maximum number of rows to include.ManifoldCFException
public IResultSet genHistoryByteCount(java.lang.String connectionName, FilterCriteria criteria, SortOrder sort, BucketDescription idBucket, long interval, int startRow, int maxRowCount) throws ManifoldCFException
genHistoryByteCount
in interface IRepositoryConnectionManager
connectionName
- is the name of the connection.criteria
- is the filtering criteria, which selects the records of interest.sort
- is the sorting order, which can specify sort based on the result columns.idBucket
- is the description of the bucket based on processed entity identifiers.interval
- is the time interval, in milliseconds, to locate. There will be one row in the resultset
for each distinct idBucket value, and the returned activity count will the maximum found over the
specified interval size.startRow
- is the first row to include (beginning with 0)maxRowCount
- is the maximum number of rows to include.ManifoldCFException
public IResultSet genHistoryResultCodes(java.lang.String connectionName, FilterCriteria criteria, SortOrder sort, BucketDescription resultCodeBucket, BucketDescription idBucket, int startRow, int maxRowCount) throws ManifoldCFException
genHistoryResultCodes
in interface IRepositoryConnectionManager
connectionName
- is the name of the connection.criteria
- is the filtering criteria, which selects the records of interest.sort
- is the sorting order, which can specify sort based on the result columns.resultCodeBucket
- is the description of the bucket based on processed result codes.idBucket
- is the description of the bucket based on processed entity identifiers.startRow
- is the first row to include (beginning with 0)maxRowCount
- is the maximum number of rows to include.ManifoldCFException
protected static java.lang.String getRepositoryConnectionsKey()
protected static java.lang.String getRepositoryConnectionKey(java.lang.String connectionName)
connectionName
- is the name of the connector.protected RepositoryConnection[] getRepositoryConnectionsMultiple(java.lang.String[] connectionNames) throws ManifoldCFException
connectionNames
- are a list of connection names.ManifoldCFException
protected int maxClauseGetRepositoryConnectionsChunk()
protected void getRepositoryConnectionsChunk(RepositoryConnection[] rval, java.util.Map returnIndex, java.util.ArrayList params) throws ManifoldCFException
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.ManifoldCFException