Esri Geoportal Server
1.0

com.esri.gpt.catalog.context
Class CatalogIndexAdapter

java.lang.Object
  extended by com.esri.gpt.framework.sql.BaseDao
      extended by com.esri.gpt.catalog.context.CatalogIndexAdapter
Direct Known Subclasses:
LuceneIndexAdapter

public abstract class CatalogIndexAdapter
extends BaseDao

Super-class for an adapter that maintains and searches an index of metadata documents.


Constructor Summary
CatalogIndexAdapter(RequestContext requestContext)
          Constructs with an associated request context.
 
Method Summary
abstract  int countDocuments()
          Counts the documents within the index.
 void deleteDocument(String uuid)
          Deletes a document from the index.
abstract  void deleteDocuments(String[] uuids)
          Deletes a collection of documents from the index.
protected  Logger getLogger()
          Gets the logger.
 String publishDocument(String uuid, Publisher publisher)
          Publishes a document to the index, first reading it's XML from the metadata server.
abstract  void publishDocument(String uuid, Timestamp updateDate, Schema schema, String acl)
          Publishes a document to the index based upon a metadata schema.
abstract  void purgeIndex()
          Purges the entire catalog index.
abstract  String[] queryAcls(String uuid)
          Queries the ACL values indexed for a document.
abstract  Timestamp queryModifiedDate(String uuid)
          Queries the system modified date associated with an indexed document.
 
Methods inherited from class com.esri.gpt.framework.sql.BaseDao
appendExpression, appendValueFilter, closeResultSet, closeStatement, getApplicationConfiguration, getRequestContext, logExpression, returnConnection, setRequestContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatalogIndexAdapter

public CatalogIndexAdapter(RequestContext requestContext)
Constructs with an associated request context.

Parameters:
requestContext - the request context
Method Detail

getLogger

protected Logger getLogger()
Gets the logger.

Returns:
the logger

countDocuments

public abstract int countDocuments()
                            throws CatalogIndexException
Counts the documents within the index.

Throws:
CatalogIndexException - if an exception occurs

deleteDocument

public void deleteDocument(String uuid)
                    throws CatalogIndexException
Deletes a document from the index.

Parameters:
uuid - the document UUID to delete
Throws:
CatalogIndexException - if an exception occurs

deleteDocuments

public abstract void deleteDocuments(String[] uuids)
                              throws CatalogIndexException
Deletes a collection of documents from the index.

Parameters:
uuids - the collection of document UUIDS to delete
Throws:
CatalogIndexException - if an exception occurs

publishDocument

public String publishDocument(String uuid,
                              Publisher publisher)
                       throws CatalogIndexException
Publishes a document to the index, first reading it's XML from the metadata server.
The document will not be written if the UUID is null or zero-length.
Existing documents that match the supplied UUID will be replaced.

Parameters:
uuid - the document's UUID
publisher - a publisher who has read access to the document
Returns:
the raw XML associated with the document being published
Throws:
CatalogIndexException - if an exception occurs

publishDocument

public abstract void publishDocument(String uuid,
                                     Timestamp updateDate,
                                     Schema schema,
                                     String acl)
                              throws CatalogIndexException
Publishes a document to the index based upon a metadata schema.
The document will not be written if the UUID is null or zero-length.
Existing documents that match the supplied UUID will be replaced.

Parameters:
uuid - the document's UUID
updateDate - the document's update date
schema - the evaluated schema associated with the document to be indexed
acl - an XML string represent the access control information associated the document (if null, no ACL information is indexed)
Throws:
CatalogIndexException - if an exception occurs

purgeIndex

public abstract void purgeIndex()
                         throws CatalogIndexException
Purges the entire catalog index.

Throws:
CatalogIndexException - if an exception occurs

queryAcls

public abstract String[] queryAcls(String uuid)
                            throws CatalogIndexException
Queries the ACL values indexed for a document.

Parameters:
uuid - the document UUID
Returns:
the ACL values (can be null)
Throws:
CatalogIndexException - if an exception occurs

queryModifiedDate

public abstract Timestamp queryModifiedDate(String uuid)
                                     throws CatalogIndexException
Queries the system modified date associated with an indexed document.

Parameters:
uuid - the document UUID
Returns:
the update date (null if none was found)
Throws:
CatalogIndexException - if an exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.