org.fcrepo.server.search
Class FieldSearchSQLImpl

java.lang.Object
  extended by org.fcrepo.server.search.FieldSearchSQLImpl
All Implemented Interfaces:
FieldSearch

public class FieldSearchSQLImpl
extends Object
implements FieldSearch

A FieldSearch implementation that uses a relational database as a backend.

Author:
Chris Wilper

Field Summary
static String[] DB_COLUMN_NAMES
           
static String[] DB_COLUMN_NAMES_NODC
           
 
Constructor Summary
FieldSearchSQLImpl(ConnectionPool cPool, RepositoryReader repoReader, int maxResults, int maxSecondsPerSession)
          Construct a FieldSearchSQLImpl that indexes DC fields.
FieldSearchSQLImpl(ConnectionPool cPool, RepositoryReader repoReader, int maxResults, int maxSecondsPerSession, boolean indexDCFields)
          Construct a FieldSearchSQLImpl that indexes DC fields only if specified.
 
Method Summary
 boolean delete(String pid)
          Remove an object from the search indexes.
 FieldSearchResult findObjects(String[] resultFields, int maxResults, FieldSearchQuery query)
          Search across specific fields and return the desired fields.
 FieldSearchResult resumeFindObjects(String sessionToken)
          Resume an in-progress search across specific fields and return the desired fields.
 void update(DOReader reader)
          Update the search indexes with information from the provided DOReader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DB_COLUMN_NAMES

public static String[] DB_COLUMN_NAMES

DB_COLUMN_NAMES_NODC

public static String[] DB_COLUMN_NAMES_NODC
Constructor Detail

FieldSearchSQLImpl

public FieldSearchSQLImpl(ConnectionPool cPool,
                          RepositoryReader repoReader,
                          int maxResults,
                          int maxSecondsPerSession)
Construct a FieldSearchSQLImpl that indexes DC fields.

Parameters:
cPool - the ConnectionPool with connections to the db containing the fields
repoReader - the RepositoryReader to use when getting the original values of the fields
maxResults - the maximum number of results to return at a time, regardless of what the user might request
maxSecondsPerSession - maximum number of seconds per session.

FieldSearchSQLImpl

public FieldSearchSQLImpl(ConnectionPool cPool,
                          RepositoryReader repoReader,
                          int maxResults,
                          int maxSecondsPerSession,
                          boolean indexDCFields)
Construct a FieldSearchSQLImpl that indexes DC fields only if specified.

Parameters:
cPool - the ConnectionPool with connections to the db containing the fields
repoReader - the RepositoryReader to use when getting the original values of the fields
maxResults - the maximum number of results to return at a time, regardless of what the user might request
maxSecondsPerSession - maximum number of seconds per session.
indexDCFields - whether DC field values should be examined and updated in the database. If false, queries will behave as if no values had been specified for the DC fields.
Method Detail

update

public void update(DOReader reader)
            throws ServerException
Description copied from interface: FieldSearch
Update the search indexes with information from the provided DOReader.

Specified by:
update in interface FieldSearch
Parameters:
reader - the DOReader containing all the field information for the object
Throws:
ServerException - if anything went wrong

delete

public boolean delete(String pid)
               throws ServerException
Description copied from interface: FieldSearch
Remove an object from the search indexes.

Specified by:
delete in interface FieldSearch
Parameters:
pid - the unique id of the object whose info should be removed
Returns:
true if object successfully removed; false otherwise.
Throws:
ServerException - if anything went wrong

findObjects

public FieldSearchResult findObjects(String[] resultFields,
                                     int maxResults,
                                     FieldSearchQuery query)
                              throws UnrecognizedFieldException,
                                     ObjectIntegrityException,
                                     RepositoryConfigurationException,
                                     StreamIOException,
                                     ServerException,
                                     StorageDeviceException
Description copied from interface: FieldSearch
Search across specific fields and return the desired fields.

Specified by:
findObjects in interface FieldSearch
Parameters:
resultFields - the desired fields
maxResults - the maximum number of results the client wants
query - the query
Returns:
FieldSearchResult the results
Throws:
ServerException - if anything went wrong
UnrecognizedFieldException
ObjectIntegrityException
RepositoryConfigurationException
StreamIOException
StorageDeviceException

resumeFindObjects

public FieldSearchResult resumeFindObjects(String sessionToken)
                                    throws UnrecognizedFieldException,
                                           ObjectIntegrityException,
                                           RepositoryConfigurationException,
                                           StreamIOException,
                                           ServerException,
                                           UnknownSessionTokenException
Description copied from interface: FieldSearch
Resume an in-progress search across specific fields and return the desired fields.

Specified by:
resumeFindObjects in interface FieldSearch
Parameters:
sessionToken - the token of the session in which the remaining results can be found
Returns:
FieldSearchResult the results
Throws:
ServerException - if anything went wrong
UnrecognizedFieldException
ObjectIntegrityException
RepositoryConfigurationException
StreamIOException
UnknownSessionTokenException


Copyright © 2012 DuraSpace. All Rights Reserved.