org.fcrepo.server.resourceIndex
Class ResourceIndexModule

java.lang.Object
  extended by org.fcrepo.server.Parameterized
      extended by org.fcrepo.server.Pluggable
          extended by org.fcrepo.server.Module
              extended by org.fcrepo.server.resourceIndex.ResourceIndexModule
All Implemented Interfaces:
Constants, ResourceIndex, org.trippi.TriplestoreReader, org.trippi.TriplestoreWriter

public class ResourceIndexModule
extends Module
implements ResourceIndex

Fedora's ResourceIndex as a configurable module.

Author:
Chris Wilper

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.fcrepo.common.Constants
Constants.FedoraHome
 
Field Summary
 
Fields inherited from interface org.fcrepo.server.resourceIndex.ResourceIndex
INDEX_LEVEL_OFF, INDEX_LEVEL_ON
 
Fields inherited from interface org.fcrepo.common.Constants
ACCESS, ACTION, API, ATOM_APIM1_0, ATOM_ZIP1_1, ATOM1_1, AUDIT, AUDIT1_0, BATCH_MODIFY, BATCH_MODIFY1_1, BE_SECURITY, BE_SECURITY1_0, BINDING_SPEC, DATASTREAM, DC, DISSEMINATOR, DS_COMPOSITE_MODEL, DS_COMPOSITE_MODEL1_0, DS_INPUT_SPEC1_0, DS_INPUT_SPEC1_1, ENVIRONMENT, FCFG, FEDORA, FEDORA_APP_CONTEXT_NAME, FEDORA_DEFAULT_APP_CONTEXT, FEDORA_HOME, FOXML, FOXML1_0, FOXML1_0_LEGACY, FOXML1_1, HTTP_REQUEST, MANAGEMENT, METHOD_MAP, METS, METS_EXT, METS_EXT1_0, METS_EXT1_0_LEGACY, METS_EXT1_1, MODEL, MULGARA, OAI_DC, OAI_DC2_0, OAI_FRIENDS, OAI_FRIENDS2_0, OAI_IDENTIFIER, OAI_IDENTIFIER2_0, OAI_PMH, OAI_PMH2_0, OAI_PROV, OAI_PROV2_0, OBJ_DATASTREAMS1_0, OBJ_HISTORY1_0, OBJ_ITEMS1_0, OBJ_METHODS1_0, OBJ_PROFILE1_0, OBJ_VALIDATION1_0, OBJECT, OLD_XLINK, PID_LIST1_0, RDF, RDF_XSD, RECOVERY, RELS_EXT, RELS_EXT1_0, RELS_INT1_0, REPO_DESC1_0, RESOURCE, SDEF, SDEF_METHOD_MAP1_0, SDEP, SDEP_METHOD_MAP1_0, SDEP_METHOD_MAP1_1, SERVICE_PROFILE, SOAP, SOAP_ENC, SUBJECT, TYPES, VIEW, WSDL, WSDL_HTTP, WSDL_MIME, XACML_POLICY, XACML_POLICY1_0, XLINK, XML_XSD, XMLNS, XSI
 
Constructor Summary
ResourceIndexModule(Map<String,String> parameters, Server server, String role)
          Instantiate the module.
 
Method Summary
 void add(List<org.jrdf.graph.Triple> triples, boolean flush)
          
 void add(org.jrdf.graph.Triple triple, boolean flush)
          
 void add(org.trippi.TripleIterator triples, boolean flush)
          
 void addObject(DOReader reader)
          Adds the appripriate triples implied by the given object to the ResourceIndex.
 void close()
          
 int countTriples(String queryLang, String tripleQuery, int limit, boolean distinct)
          
 int countTriples(String queryLang, String tupleQuery, String tripleTemplate, int limit, boolean distinct)
          
 int countTriples(org.jrdf.graph.SubjectNode subject, org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object, int limit)
          
 int countTuples(String queryLang, String tupleQuery, int limit, boolean distinct)
          
 void delete(List<org.jrdf.graph.Triple> triples, boolean flush)
          
 void delete(org.jrdf.graph.Triple triple, boolean flush)
          
 void delete(org.trippi.TripleIterator triples, boolean flush)
          
 void deleteObject(DOReader oldReader)
          Removes the triples implied by a given object from the ResourceIndex.
 void export(OutputStream out, org.trippi.RDFFormat format)
          Exports all triples in the RI.
 List<org.trippi.TripleUpdate> findBufferedUpdates(org.jrdf.graph.SubjectNode subject, org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object, int updateType)
          
 org.trippi.TripleIterator findTriples(String queryLang, String tripleQuery, int limit, boolean distinct)
          
 org.trippi.TripleIterator findTriples(String queryLang, String tupleQuery, String tripleTemplate, int limit, boolean distinct)
          
 org.trippi.TripleIterator findTriples(org.jrdf.graph.SubjectNode subject, org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object, int limit)
          
 org.trippi.TupleIterator findTuples(String queryLang, String tupleQuery, int limit, boolean distinct)
          
 void flushBuffer()
          
 Map<String,String> getAliasMap()
          
 int getBufferSize()
          
 int getIndexLevel()
          Gets the index level of the ResourceIndex.
 void initModule()
          Perform post-initialization of this module.
 String[] listTripleLanguages()
          
 String[] listTupleLanguages()
          
 void modifyObject(DOReader oldReader, DOReader newReader)
          Updates any appropriate triples implied a modified object.
 void setAliasMap(Map<String,String> aliasToPrefix)
          
 void setFlushErrorHandler(org.trippi.FlushErrorHandler h)
          
 void shutdownModule()
          Shutdown the RI module by closing the wrapped ResourceIndex.
 
Methods inherited from class org.fcrepo.server.Module
getRole, getServer, postInitModule
 
Methods inherited from class org.fcrepo.server.Pluggable
getHelp, getOptionalParameters, getParameterHelp, getRequiredModuleRoles, getRequiredParameters
 
Methods inherited from class org.fcrepo.server.Parameterized
getParameter, getParameter, getParameter, getParameterList, getParameters, getParameters, parameterNames, setParameter, setParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceIndexModule

public ResourceIndexModule(Map<String,String> parameters,
                           Server server,
                           String role)
                    throws ModuleInitializationException
Instantiate the module.

Throws:
ModuleInitializationException
Method Detail

initModule

public void initModule()
                throws ModuleInitializationException
Perform post-initialization of this module. ResourceIndexModule takes the following parameters:

Overrides:
initModule in class Module
Throws:
ModuleInitializationException - If initialization values are invalid or initialization fails for some other reason.

shutdownModule

public void shutdownModule()
                    throws ModuleShutdownException
Shutdown the RI module by closing the wrapped ResourceIndex.

Overrides:
shutdownModule in class Module
Throws:
ModuleShutdownException - if any error occurs while closing.

getIndexLevel

public int getIndexLevel()
Gets the index level of the ResourceIndex.

Specified by:
getIndexLevel in interface ResourceIndex
Returns:
the current index level of the RI, which is either INDEX_LEVEL_OFF or INDEX_LEVEL_ON.

addObject

public void addObject(DOReader reader)
               throws ResourceIndexException
Adds the appripriate triples implied by the given object to the ResourceIndex.

Specified by:
addObject in interface ResourceIndex
Parameters:
reader - The given object to index.
Throws:
ResourceIndexException - If the triples can't be added for any reason.

modifyObject

public void modifyObject(DOReader oldReader,
                         DOReader newReader)
                  throws ResourceIndexException
Updates any appropriate triples implied a modified object.

Specified by:
modifyObject in interface ResourceIndex
Parameters:
oldReader - Pre-modification version of the oject.
newReader - Post-modification version of the object.
Throws:
ResourceIndexException - If the triples can't be updated for any reason.

deleteObject

public void deleteObject(DOReader oldReader)
                  throws ResourceIndexException
Removes the triples implied by a given object from the ResourceIndex.

Specified by:
deleteObject in interface ResourceIndex
Parameters:
oldReader - Object whose triples shall be removed from the index.
Throws:
ResourceIndexException - If the triples can't be removed for any reason.

export

public void export(OutputStream out,
                   org.trippi.RDFFormat format)
            throws ResourceIndexException
Exports all triples in the RI.

Specified by:
export in interface ResourceIndex
Parameters:
out - the output stream to which the RDF should be written. The caller is responsible for eventually closing this stream.
format - the output format (RDF_XML, TURTLE, N_TRIPLESs, etc).
Throws:
ResourceIndexException - if triples in the RI cannot be serialized for any reason.

setAliasMap

public void setAliasMap(Map<String,String> aliasToPrefix)
                 throws org.trippi.TrippiException

Specified by:
setAliasMap in interface org.trippi.TriplestoreReader
Throws:
org.trippi.TrippiException

getAliasMap

public Map<String,String> getAliasMap()
                               throws org.trippi.TrippiException

Specified by:
getAliasMap in interface org.trippi.TriplestoreReader
Throws:
org.trippi.TrippiException

findTuples

public org.trippi.TupleIterator findTuples(String queryLang,
                                           String tupleQuery,
                                           int limit,
                                           boolean distinct)
                                    throws org.trippi.TrippiException

Specified by:
findTuples in interface org.trippi.TriplestoreReader
Throws:
org.trippi.TrippiException

countTuples

public int countTuples(String queryLang,
                       String tupleQuery,
                       int limit,
                       boolean distinct)
                throws org.trippi.TrippiException

Specified by:
countTuples in interface org.trippi.TriplestoreReader
Throws:
org.trippi.TrippiException

findTriples

public org.trippi.TripleIterator findTriples(String queryLang,
                                             String tripleQuery,
                                             int limit,
                                             boolean distinct)
                                      throws org.trippi.TrippiException

Specified by:
findTriples in interface org.trippi.TriplestoreReader
Throws:
org.trippi.TrippiException

countTriples

public int countTriples(String queryLang,
                        String tripleQuery,
                        int limit,
                        boolean distinct)
                 throws org.trippi.TrippiException

Specified by:
countTriples in interface org.trippi.TriplestoreReader
Throws:
org.trippi.TrippiException

findTriples

public org.trippi.TripleIterator findTriples(org.jrdf.graph.SubjectNode subject,
                                             org.jrdf.graph.PredicateNode predicate,
                                             org.jrdf.graph.ObjectNode object,
                                             int limit)
                                      throws org.trippi.TrippiException

Specified by:
findTriples in interface org.trippi.TriplestoreReader
Throws:
org.trippi.TrippiException

countTriples

public int countTriples(org.jrdf.graph.SubjectNode subject,
                        org.jrdf.graph.PredicateNode predicate,
                        org.jrdf.graph.ObjectNode object,
                        int limit)
                 throws org.trippi.TrippiException

Specified by:
countTriples in interface org.trippi.TriplestoreReader
Throws:
org.trippi.TrippiException

findTriples

public org.trippi.TripleIterator findTriples(String queryLang,
                                             String tupleQuery,
                                             String tripleTemplate,
                                             int limit,
                                             boolean distinct)
                                      throws org.trippi.TrippiException

Specified by:
findTriples in interface org.trippi.TriplestoreReader
Throws:
org.trippi.TrippiException

countTriples

public int countTriples(String queryLang,
                        String tupleQuery,
                        String tripleTemplate,
                        int limit,
                        boolean distinct)
                 throws org.trippi.TrippiException

Specified by:
countTriples in interface org.trippi.TriplestoreReader
Throws:
org.trippi.TrippiException

listTupleLanguages

public String[] listTupleLanguages()

Specified by:
listTupleLanguages in interface org.trippi.TriplestoreReader

listTripleLanguages

public String[] listTripleLanguages()

Specified by:
listTripleLanguages in interface org.trippi.TriplestoreReader

close

public void close()
           throws org.trippi.TrippiException

Specified by:
close in interface org.trippi.TriplestoreReader
Throws:
org.trippi.TrippiException

add

public void add(List<org.jrdf.graph.Triple> triples,
                boolean flush)
         throws IOException,
                org.trippi.TrippiException

Specified by:
add in interface org.trippi.TriplestoreWriter
Throws:
IOException
org.trippi.TrippiException

add

public void add(org.trippi.TripleIterator triples,
                boolean flush)
         throws IOException,
                org.trippi.TrippiException

Specified by:
add in interface org.trippi.TriplestoreWriter
Throws:
IOException
org.trippi.TrippiException

add

public void add(org.jrdf.graph.Triple triple,
                boolean flush)
         throws IOException,
                org.trippi.TrippiException

Specified by:
add in interface org.trippi.TriplestoreWriter
Throws:
IOException
org.trippi.TrippiException

delete

public void delete(List<org.jrdf.graph.Triple> triples,
                   boolean flush)
            throws IOException,
                   org.trippi.TrippiException

Specified by:
delete in interface org.trippi.TriplestoreWriter
Throws:
IOException
org.trippi.TrippiException

delete

public void delete(org.trippi.TripleIterator triples,
                   boolean flush)
            throws IOException,
                   org.trippi.TrippiException

Specified by:
delete in interface org.trippi.TriplestoreWriter
Throws:
IOException
org.trippi.TrippiException

delete

public void delete(org.jrdf.graph.Triple triple,
                   boolean flush)
            throws IOException,
                   org.trippi.TrippiException

Specified by:
delete in interface org.trippi.TriplestoreWriter
Throws:
IOException
org.trippi.TrippiException

flushBuffer

public void flushBuffer()
                 throws IOException,
                        org.trippi.TrippiException

Specified by:
flushBuffer in interface org.trippi.TriplestoreWriter
Throws:
IOException
org.trippi.TrippiException

setFlushErrorHandler

public void setFlushErrorHandler(org.trippi.FlushErrorHandler h)

Specified by:
setFlushErrorHandler in interface org.trippi.TriplestoreWriter

getBufferSize

public int getBufferSize()

Specified by:
getBufferSize in interface org.trippi.TriplestoreWriter

findBufferedUpdates

public List<org.trippi.TripleUpdate> findBufferedUpdates(org.jrdf.graph.SubjectNode subject,
                                                         org.jrdf.graph.PredicateNode predicate,
                                                         org.jrdf.graph.ObjectNode object,
                                                         int updateType)

Specified by:
findBufferedUpdates in interface org.trippi.TriplestoreWriter


Copyright © 2012 DuraSpace. All Rights Reserved.