Esri Geoportal Server
1.0

com.esri.gpt.catalog.arcims
Class ImsMetadataAdminDao

java.lang.Object
  extended by com.esri.gpt.framework.sql.BaseDao
      extended by com.esri.gpt.catalog.arcims.ImsMetadataAdminDao

public class ImsMetadataAdminDao
extends BaseDao

Database access object associated with the ArcIMS metadata administration table.


Field Summary
static int SYNCSTATUS_SYNCHRONIZED
          Status code for synchronized records = 1
static int SYNCSTATUS_UNSYNCHRONIZED
          Status code for unsynchronized records = 0
 
Constructor Summary
protected ImsMetadataAdminDao()
          Default constructor.
  ImsMetadataAdminDao(RequestContext requestContext)
          Constructs with an associated request context.
 
Method Summary
 int countReferencedRecords()
          Gets the count of records (non-folder) from the ADMIN table that are referenced within the ArcIMS metadata table.
 int countUnreferencedRecords()
          Gets the count of records from the ADMIN table that are not referenced within the ArcIMS metadata table.
 void createIndex(Schema schema, PublicationRecord record)
          Creates index.
 void deleteIndex(PublicationRecord record)
          Deletes index.
 int deleteRecord(Publisher publisher, MmdQueryCriteria criteria)
          Deletes records matching criteria.
 int deleteRecord(String uuid)
          Deletes a metadata administration record.
 int deleteUnreferencedRecords(int maxValuesForIndex)
          Deletes records from the ADMIN table that are not referenced within the ArcIMS metadata table.
 String findExistingSourceUri(String uuid)
          Finds source URI from metadata UUID.
 String findExistingUuid(String fileIdentifier, String sourceUri)
          Checks for an existing metadata document UUID for a document that is about to be published.
 String findUuid(String id)
          Checks for an existing metadata document UUID based upon a supplied UUID or FileIdentifier.
 boolean hadUnalteredDraftDocuments()
          Gets the status indicating whether or not documents in draft mode were unaltered by an update.
 void onRecordsSynchronized(StringSet uuids)
          Updates the synchronization status code (SYNCSTATUS_SYNCHRONIZED) for the supplied UUIDs.
 String queryAclByUUID(String uuid)
          Queries the acl associated with a document.
 String queryApprovalStatus(String uuid)
          Queries the approval status associated with a document.
 boolean queryIndexEnabled(String uuid)
          Checks if current record is eligible to be found.
 String queryOwnerDN(String uuid)
          Determines the distinguished name associated with the owner of a document.
 String queryOwnerName(String uuid)
          Queries the ArcIMS owner name associated with a document.
 StringSet querySiteUuid(String siteUuid)
          Finds documents harvested from the specific site.
 Timestamp queryUpdateDate(String uuid)
          Queries the system update date associated with a document.
 StringSet readUuidsForSynchronization(int maxUuids)
          Reads the UUIDs for the currently unsynchronized records.
 void resetSynchronizationStatus()
          Resets the synchronization status code (SYNCSTATUS_UNSYNCHRONIZED) for all records.
 int transferOwnership(Publisher publisher, MmdQueryCriteria criteria, int localId)
          Transfers ownership for records matching criteria.
 int unindexRecord(String uuid)
          Unindexes record.
 int updateAcl(Publisher publisher, MmdQueryCriteria criteria, String acl)
          Updates the acl for records matching criteria.
 int updateAcl(Publisher publisher, StringSet uuids, String acl)
          Updates the acl for a set of UUIDs.
 int updateApprovalStatus(Publisher publisher, MmdQueryCriteria criteria, MmdEnums.ApprovalStatus approvalStatus)
          Updates the approval status for records matching criteria.
 int updateApprovalStatus(Publisher publisher, StringSet uuids, MmdEnums.ApprovalStatus approvalStatus)
          Updates the approval status for a set of UUIDs.
 int updateRecord(Schema schema, PublicationRecord record)
          Updates metadata administration record following publication.
 
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
 

Field Detail

SYNCSTATUS_SYNCHRONIZED

public static final int SYNCSTATUS_SYNCHRONIZED
Status code for synchronized records = 1

See Also:
Constant Field Values

SYNCSTATUS_UNSYNCHRONIZED

public static final int SYNCSTATUS_UNSYNCHRONIZED
Status code for unsynchronized records = 0

See Also:
Constant Field Values
Constructor Detail

ImsMetadataAdminDao

protected ImsMetadataAdminDao()
Default constructor.


ImsMetadataAdminDao

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

Parameters:
requestContext - the request context
Method Detail

hadUnalteredDraftDocuments

public boolean hadUnalteredDraftDocuments()
Gets the status indicating whether or not documents in draft mode were unaltered by an update.
The approval status of a document in draft mode can only be altered by publishing the document from the online editor.

Returns:
true if draft documents were unaltered

countReferencedRecords

public int countReferencedRecords()
                           throws SQLException
Gets the count of records (non-folder) from the ADMIN table that are referenced within the ArcIMS metadata table.

Returns:
count of referenced records
Throws:
SQLException - if a database exception occurs

countUnreferencedRecords

public int countUnreferencedRecords()
                             throws SQLException
Gets the count of records from the ADMIN table that are not referenced within the ArcIMS metadata table.

Returns:
the count of unreferenced records in ADMIN table
Throws:
SQLException - if a database exception occurs

deleteRecord

public int deleteRecord(String uuid)
                 throws SQLException,
                        CatalogIndexException
Deletes a metadata administration record.
Records are only deleted from the ADMIN table if they are not references within ArcIMS metadata table.

Parameters:
uuid - the UUID for the record to delete
Returns:
the number of rows affected
Throws:
SQLException - if a database exception occurs
CatalogIndexException - if a document indexing exception occurs

deleteRecord

public int deleteRecord(Publisher publisher,
                        MmdQueryCriteria criteria)
                 throws Exception
Deletes records matching criteria.

Parameters:
criteria - filter criteria
publisher - publisher
Returns:
the number of rows affected
Throws:
Exception - if performing operation fails

transferOwnership

public int transferOwnership(Publisher publisher,
                             MmdQueryCriteria criteria,
                             int localId)
                      throws Exception
Transfers ownership for records matching criteria.

Parameters:
localId - new owner local id
criteria - filter criteria
publisher - publisher
Returns:
the number of rows affected
Throws:
Exception - if transferring ownership fails

unindexRecord

public int unindexRecord(String uuid)
                  throws SQLException,
                         CatalogIndexException
Unindexes record.

Parameters:
uuid - the UUID for the record to delete
Returns:
the number of rows affected
Throws:
SQLException - if a database exception occurs
CatalogIndexException - if a document indexing exception occurs

deleteUnreferencedRecords

public int deleteUnreferencedRecords(int maxValuesForIndex)
                              throws SQLException,
                                     CatalogIndexException
Deletes records from the ADMIN table that are not referenced within the ArcIMS metadata table.

Parameters:
maxValuesForIndex - the maximum number to collect for catalog index deletion
Returns:
the number of rows affected
Throws:
SQLException - if a database exception occurs
CatalogIndexException - if a document indexing exception occurs

findExistingUuid

public String findExistingUuid(String fileIdentifier,
                               String sourceUri)
                        throws SQLException
Checks for an existing metadata document UUID for a document that is about to be published.

Parameters:
fileIdentifier - the file identifier to check
sourceUri - the source uri to check
Returns:
the existing document UUID (empty string if none)
Throws:
SQLException - if a database exception occurs

findExistingSourceUri

public String findExistingSourceUri(String uuid)
                             throws SQLException
Finds source URI from metadata UUID.

Parameters:
uuid - metadata UUID
Returns:
source URI or empty string if no source URI available
Throws:
SQLException - if a database exception occurs

findUuid

public String findUuid(String id)
                throws SQLException
Checks for an existing metadata document UUID based upon a supplied UUID or FileIdentifier.

Parameters:
id - the UUID of FileIdentifier to check
Returns:
the existing document UUID (empty string if none)
Throws:
SQLException - if a database exception occurs

onRecordsSynchronized

public void onRecordsSynchronized(StringSet uuids)
                           throws SQLException
Updates the synchronization status code (SYNCSTATUS_SYNCHRONIZED) for the supplied UUIDs.

Parameters:
uuids - the collection of UUIDs to update
Throws:
SQLException - if a database exception occurs

queryAclByUUID

public String queryAclByUUID(String uuid)
                      throws SQLException
Queries the acl associated with a document.

Parameters:
uuid - the document UUID
Returns:
the acl xml string (empty string if not found)
Throws:
SQLException - if a database exception occurs

queryApprovalStatus

public String queryApprovalStatus(String uuid)
                           throws SQLException
Queries the approval status associated with a document.

Parameters:
uuid - the document UUID
Returns:
the approval status (empty string if not found)
Throws:
SQLException - if a database exception occurs

queryOwnerDN

public String queryOwnerDN(String uuid)
                    throws SQLException
Determines the distinguished name associated with the owner of a document.

Parameters:
uuid - the document UUID
Returns:
the owner's distinguished name(empty string if not found)
Throws:
SQLException - if a database exception occurs

queryOwnerName

public String queryOwnerName(String uuid)
                      throws SQLException
Queries the ArcIMS owner name associated with a document.

Parameters:
uuid - the document UUID
Returns:
the owner name (empty string if not found)
Throws:
SQLException - if a database exception occurs

queryUpdateDate

public Timestamp queryUpdateDate(String uuid)
                          throws SQLException
Queries the system update date associated with a document.

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

querySiteUuid

public StringSet querySiteUuid(String siteUuid)
                        throws SQLException
Finds documents harvested from the specific site.

Parameters:
siteUuid - harvest site UUID
Returns:
collection of documents UUID
Throws:
SQLException - if a database exception occurs

readUuidsForSynchronization

public StringSet readUuidsForSynchronization(int maxUuids)
                                      throws SQLException
Reads the UUIDs for the currently unsynchronized records.

Parameters:
maxUuids - the maximum number to read
Returns:
the set of UUIDs
Throws:
SQLException - if a database exception occurs

resetSynchronizationStatus

public void resetSynchronizationStatus()
                                throws SQLException
Resets the synchronization status code (SYNCSTATUS_UNSYNCHRONIZED) for all records.

Throws:
SQLException - if a database exception occurs

updateAcl

public int updateAcl(Publisher publisher,
                     MmdQueryCriteria criteria,
                     String acl)
              throws Exception
Updates the acl for records matching criteria.

Parameters:
publisher - the publisher executing this request
criteria - filter criteria
acl - the new acl
Returns:
the number of rows affected
Throws:
SQLException - if a database exception occurs
CatalogIndexException - if a document indexing exception occurs
Exception

updateAcl

public int updateAcl(Publisher publisher,
                     StringSet uuids,
                     String acl)
              throws SQLException,
                     CatalogIndexException
Updates the acl for a set of UUIDs.

Parameters:
publisher - the publisher executing this request
uuids - the set of uuids to update
acl - the new acl
Returns:
the number of rows affected
Throws:
SQLException - if a database exception occurs
CatalogIndexException - if a document indexing exception occurs

updateApprovalStatus

public int updateApprovalStatus(Publisher publisher,
                                StringSet uuids,
                                MmdEnums.ApprovalStatus approvalStatus)
                         throws SQLException,
                                CatalogIndexException
Updates the approval status for a set of UUIDs.
Documents if "draft" status will not be updated by the method.

Parameters:
uuids - the set of uuids to update
approvalStatus - the new approval status
Returns:
the number of rows affected
Throws:
SQLException - if a database exception occurs
CatalogIndexException - if a document indexing exception occurs

queryIndexEnabled

public boolean queryIndexEnabled(String uuid)
                          throws SQLException
Checks if current record is eligible to be found. If the record doesn't exist it will return false. If the record is not repository it will return true. If the record is a repository it will return value of the FINDABLE.

Parameters:
uuid - record UUID
Returns:
true if record is eligible to be found
Throws:
SQLException - if accessing database fails

updateApprovalStatus

public int updateApprovalStatus(Publisher publisher,
                                MmdQueryCriteria criteria,
                                MmdEnums.ApprovalStatus approvalStatus)
                         throws Exception
Updates the approval status for records matching criteria.
Documents if "draft" status will not be updated by the method.

Parameters:
criteria - filter criteria
approvalStatus - the new approval status
Returns:
the number of rows affected
Throws:
SQLException - if a database exception occurs
CatalogIndexException - if a document indexing exception occurs
Exception

updateRecord

public int updateRecord(Schema schema,
                        PublicationRecord record)
                 throws SQLException,
                        CatalogIndexException
Updates metadata administration record following publication.

Parameters:
schema - the associated schema
record - the associated metadata document
Returns:
the number of rows affected
Throws:
SQLException - if a database exception occurs
CatalogIndexException - if a document indexing exception occurs

createIndex

public void createIndex(Schema schema,
                        PublicationRecord record)
                 throws SQLException,
                        CatalogIndexException
Creates index.

Parameters:
schema - schema
record - publication record
Throws:
SQLException - if accessing database fails
CatalogIndexException - if accessing index file fails

deleteIndex

public void deleteIndex(PublicationRecord record)
                 throws CatalogIndexException,
                        SQLException
Deletes index.

Parameters:
record - publication record
Throws:
SQLException - if accessing database fails
CatalogIndexException - if accessing index file fails

Esri Geoportal Server
1.0

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