public class GridFSRepositoryConnector extends BaseRepositoryConnector
Modifier and Type | Field and Description |
---|---|
protected String |
acl
Endpoint acl.
|
protected static String |
ACTIVITY_FETCH
Activity name for the activity record.
|
protected String |
bucket
Endpoint bucket.
|
protected String |
db
Endpoint db.
|
protected String |
denyAcl
Endpoint denyAcl.
|
protected static HashMap |
documentKnownColumns
Special column names, as far as document queries are concerned
|
protected String |
host
Endpoint host.
|
protected long |
lastSessionFetch
Last session fetch time.
|
protected String |
password
Endpoint password.
|
protected String |
port
Endpoint port.
|
protected static String |
SERVER
Server name for declaring bin name.
|
protected com.mongodb.DB |
session
MongoDB session.
|
protected static long |
SESSION_EXPIRATION_MILLISECONDS
Session expiration milliseconds.
|
protected String |
url
Endpoint url.
|
protected String |
username
Endpoint username.
|
_rcsid
currentContext, params
GLOBAL_DENY_TOKEN, JOBMODE_CONTINUOUS, JOBMODE_ONCEONLY, MODEL_ADD, MODEL_ADD_CHANGE, MODEL_ADD_CHANGE_DELETE, MODEL_ALL, MODEL_CHAINED_ADD, MODEL_CHAINED_ADD_CHANGE, MODEL_CHAINED_ADD_CHANGE_DELETE, MODEL_PARTIAL
Constructor and Description |
---|
GridFSRepositoryConnector()
Constructer.
|
Modifier and Type | Method and Description |
---|---|
String |
addSeedDocuments(ISeedingActivity activities,
Specification spec,
String lastSeedVersion,
long seedTime,
int jobMode)
Queue "seed" documents.
|
protected void |
applyMetadata(RepositoryDocument rd,
com.mongodb.DBObject metadataMap)
Apply metadata to a repository document.
|
String |
check()
Test the connection.
|
void |
connect(ConfigParams configParams)
Connect.
|
void |
disconnect()
Close the connection.
|
void |
fillInServerParameters(Map<String,String> paramMap,
IPasswordMapperActivity mapper,
ConfigParams parameters)
Fill in a Server tab configuration parameter map for calling a Velocity
template.
|
String[] |
getActivitiesList()
Return the list of activities that this connector supports (i.e.
|
String[] |
getBinNames(String documentIdentifier)
Tell the world what model this connector uses for addSeedDocuments().
|
int |
getConnectorModel()
Tell the world what model this connector uses for addSeedDocuments().
|
int |
getMaxDocumentRequest()
Get the maximum number of documents to amalgamate together into one
batch, for this connector.
|
String[] |
getRelationshipTypes()
Return the list of relationship types that this connector recognizes.
|
protected void |
getSession()
Setup a session.
|
protected static void |
handleIOException(IOException e) |
boolean |
isConnected()
This method is called to assess whether to count this connector instance
should actually be counted as being connected.
|
void |
outputConfigurationBody(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters,
String tabName)
Output the configuration body section.
|
void |
outputConfigurationHeader(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters,
List<String> tabsArray)
Output the configuration header section.
|
void |
poll()
This method is periodically called for all connectors that are connected
but not in active use.
|
String |
processConfigurationPost(IThreadContext threadContext,
IPostParameters variableContext,
Locale locale,
ConfigParams parameters)
Process a configuration post.
|
void |
processDocuments(String[] documentIdentifiers,
IExistingVersions statuses,
Specification spec,
IProcessActivity activities,
int jobMode,
boolean usesDefaultAuthority)
Process a set of documents.
|
void |
viewConfiguration(IThreadContext threadContext,
IHTTPOutput out,
Locale locale,
ConfigParams parameters)
View configuration.
|
addSeedDocuments, addSeedDocuments, addSeedDocuments, getDocumentIdentifiers, getDocumentIdentifiers, getDocumentVersions, getDocumentVersions, getDocumentVersions, getDocumentVersions, getDocumentVersions, getDocumentVersions, getDocumentVersions, getFormCheckJavascriptMethodName, getFormPresaveCheckJavascriptMethodName, getRemainingDocumentIdentifiers, outputSpecificationBody, outputSpecificationBody, outputSpecificationBody, outputSpecificationHeader, outputSpecificationHeader, outputSpecificationHeader, outputSpecificationHeader, processDocuments, processDocuments, processDocuments, processDocuments, processSpecificationPost, processSpecificationPost, processSpecificationPost, releaseDocumentVersions, releaseDocumentVersions, requestInfo, viewSpecification, viewSpecification, viewSpecification
clearThreadContext, deinstall, getConfiguration, install, outputConfigurationBody, outputConfigurationHeader, outputConfigurationHeader, pack, packFixedList, packList, packList, processConfigurationPost, setThreadContext, unpack, unpackFixedList, unpackList, viewConfiguration
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearThreadContext, deinstall, getConfiguration, install, setThreadContext
protected static final String ACTIVITY_FETCH
protected static final String SERVER
protected static final long SESSION_EXPIRATION_MILLISECONDS
protected String username
protected String password
protected String host
protected String port
protected String db
protected String bucket
protected String url
protected String acl
protected String denyAcl
protected com.mongodb.DB session
protected long lastSessionFetch
protected static HashMap documentKnownColumns
public String[] getBinNames(String documentIdentifier)
getBinNames
in interface IRepositoryConnector
getBinNames
in class BaseRepositoryConnector
public int getConnectorModel()
getConnectorModel
in interface IRepositoryConnector
getConnectorModel
in class BaseRepositoryConnector
public String[] getActivitiesList()
getActivitiesList
in interface IRepositoryConnector
getActivitiesList
in class BaseRepositoryConnector
public void connect(ConfigParams configParams)
connect
in interface IConnector
connect
in class BaseConnector
configParams
- is the set of configuration parameters, which in this
case describe the root directory.public String check() throws ManifoldCFException
check
in interface IConnector
check
in class BaseConnector
ManifoldCFException
public void disconnect() throws ManifoldCFException
disconnect
in interface IConnector
disconnect
in class BaseConnector
ManifoldCFException
public void poll() throws ManifoldCFException
poll
in interface IConnector
poll
in class BaseConnector
ManifoldCFException
public boolean isConnected()
isConnected
in interface IConnector
isConnected
in class BaseConnector
public int getMaxDocumentRequest()
getMaxDocumentRequest
in interface IRepositoryConnector
getMaxDocumentRequest
in class BaseRepositoryConnector
public String[] getRelationshipTypes()
getRelationshipTypes
in interface IRepositoryConnector
getRelationshipTypes
in class BaseRepositoryConnector
public String addSeedDocuments(ISeedingActivity activities, Specification spec, String lastSeedVersion, long seedTime, int jobMode) throws ManifoldCFException, ServiceInterruption
addSeedDocuments
in interface IRepositoryConnector
addSeedDocuments
in class BaseRepositoryConnector
activities
- is the interface this method should use to perform whatever framework actions are desired.spec
- is a document specification (that comes from the job).seedTime
- is the end of the time range of documents to consider, exclusive.lastSeedVersionString
- is the last seeding version string for this job, or null if the job has no previous seeding version string.jobMode
- is an integer describing how the job is being run, whether continuous or once-only.ManifoldCFException
ServiceInterruption
public void processDocuments(String[] documentIdentifiers, IExistingVersions statuses, Specification spec, IProcessActivity activities, int jobMode, boolean usesDefaultAuthority) throws ManifoldCFException, ServiceInterruption
processDocuments
in interface IRepositoryConnector
processDocuments
in class BaseRepositoryConnector
documentIdentifiers
- is the set of document identifiers to process.statuses
- are the currently-stored document versions for each document in the set of document identifiers
passed in above.activities
- is the interface this method should use to queue up new document references
and ingest documents.jobMode
- is an integer describing how the job is being run, whether continuous or once-only.usesDefaultAuthority
- will be true only if the authority in use for these documents is the default one.ManifoldCFException
ServiceInterruption
protected static void handleIOException(IOException e) throws ManifoldCFException, ServiceInterruption
public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters, List<String> tabsArray) throws ManifoldCFException, IOException
outputConfigurationHeader
in interface IConnector
outputConfigurationHeader
in class BaseConnector
threadContext
- is the local thread context.out
- is the output to which any HTML should be sent.parameters
- are the configuration parameters, as they currently
exist, for this connection being configured.tabsArray
- is an array of tab names. Add to this array any tab
names that are specific to the connector.ManifoldCFException
IOException
public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName) throws ManifoldCFException, IOException
outputConfigurationBody
in interface IConnector
outputConfigurationBody
in class BaseConnector
threadContext
- is the local thread context.out
- is the output to which any HTML should be sent.parameters
- are the configuration parameters, as they currently
exist, for this connection being configured.tabName
- is the current tab name.ManifoldCFException
IOException
public String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext, Locale locale, ConfigParams parameters) throws ManifoldCFException
processConfigurationPost
in interface IConnector
processConfigurationPost
in class BaseConnector
threadContext
- is the local thread context.variableContext
- is the set of variables available from the post,
including binary file post information.parameters
- are the configuration parameters, as they currently
exist, for this connection being configured.ManifoldCFException
public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters) throws ManifoldCFException, IOException
viewConfiguration
in interface IConnector
viewConfiguration
in class BaseConnector
threadContext
- is the local thread context.out
- is the output to which any HTML should be sent.parameters
- are the configuration parameters, as they currently
exist, for this connection being configured.ManifoldCFException
IOException
protected void getSession() throws ManifoldCFException
ManifoldCFException
public void fillInServerParameters(Map<String,String> paramMap, IPasswordMapperActivity mapper, ConfigParams parameters)
paramMap
- is the map to fill inparameters
- is the current set of configuration parametersprotected void applyMetadata(RepositoryDocument rd, com.mongodb.DBObject metadataMap) throws ManifoldCFException
rd
- is the repository document to apply the metadata to.metadataMap
- is the resultset row to use to get the metadata. All
non-special columns from this row will be considered to be metadata.ManifoldCFException