fedora.server.search
Class FieldSearchSQLImpl

java.lang.Object
  extended byfedora.server.StdoutLogging
      extended byfedora.server.search.FieldSearchSQLImpl
All Implemented Interfaces:
FieldSearch, Logging

public class FieldSearchSQLImpl
extends StdoutLogging
implements FieldSearch

Title: FieldSearchSQLImpl.java

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

-----------------------------------------------------------------------------

License and Copyright: The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/.

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The entire file consists of original code. Copyright © 2002-2005 by The Rector and Visitors of the University of Virginia and Cornell University. All rights reserved.

-----------------------------------------------------------------------------

Version:
$Id: FieldSearchSQLImpl.java,v 1.30 2005/01/11 20:06:07 cwilper Exp $
Author:
cwilper@cs.cornell.edu

Field Summary
static java.lang.String[] DB_COLUMN_NAMES
           
 
Fields inherited from class fedora.server.StdoutLogging
CONFIG, FINE, FINER, FINEST, INFO, SEVERE, WARNING
 
Constructor Summary
FieldSearchSQLImpl(ConnectionPool cPool, RepositoryReader repoReader, int maxResults, int maxSecondsPerSession, Logging logTarget)
          Construct a FieldSearchSQLImpl.
 
Method Summary
 boolean delete(java.lang.String pid)
          Remove an object from the search indexes.
 FieldSearchResult findObjects(java.lang.String[] resultFields, int maxResults, FieldSearchQuery query)
          Search across specific fields and return the desired fields.
static java.lang.String getDbValueCaseSensitive(java.util.List dcItem)
           
 FieldSearchResult resumeFindObjects(java.lang.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 fedora.server.StdoutLogging
logConfig, logFine, logFiner, logFinest, loggingConfig, loggingFine, loggingFiner, loggingFinest, loggingInfo, loggingSevere, loggingWarning, logInfo, logSevere, logWarning, setLogLevel
 
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 java.lang.String[] DB_COLUMN_NAMES
Constructor Detail

FieldSearchSQLImpl

public FieldSearchSQLImpl(ConnectionPool cPool,
                          RepositoryReader repoReader,
                          int maxResults,
                          int maxSecondsPerSession,
                          Logging logTarget)
Construct a FieldSearchSQLImpl.

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
logTarget - where to send log messages
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(java.lang.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(java.lang.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(java.lang.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

getDbValueCaseSensitive

public static java.lang.String getDbValueCaseSensitive(java.util.List dcItem)