org.bitrepository.audittrails.store
Class AuditTrailServiceDAO

java.lang.Object
  extended by org.bitrepository.audittrails.store.AuditTrailServiceDAO
All Implemented Interfaces:
AuditTrailStore

public class AuditTrailServiceDAO
extends Object
implements AuditTrailStore

Audit trail storages backed by a database for preserving


Constructor Summary
AuditTrailServiceDAO(DatabaseManager databaseManager)
          Constructor.
 
Method Summary
 void addAuditTrails(AuditTrailEvents newAuditTrails, String collectionId)
          ingest audit trails into the store.
 void close()
          Closes the store.
 AuditEventIterator getAuditTrailsByIterator(String fileId, String collectionID, String contributorId, Long minSeqNumber, Long maxSeqNumber, String actorName, FileAction operation, Date startDate, Date endDate, String fingerprint, String operationID)
          Obtain AuditEventIterator for extracting audit trails from the store.
 long getPreservationSequenceNumber(String contributorId, String collectionId)
          Retrieves the preservation sequence number for the given contributor, which tells how far the preservation of the audit trails has gotten.
 boolean havePreservationKey(String contributorID, String collectionID)
          Check to see if the database knows a contributor
 int largestSequenceNumber(String contributorId, String collectionId)
          Retrieves the largest sequence number for a given contributor.
 void setPreservationSequenceNumber(String contributorId, String collectionId, long seqNumber)
          Set the preservation sequence number for the given contributor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuditTrailServiceDAO

public AuditTrailServiceDAO(DatabaseManager databaseManager)
Constructor.

Parameters:
databaseManager - The database manager
Method Detail

getAuditTrailsByIterator

public AuditEventIterator getAuditTrailsByIterator(String fileId,
                                                   String collectionID,
                                                   String contributorId,
                                                   Long minSeqNumber,
                                                   Long maxSeqNumber,
                                                   String actorName,
                                                   FileAction operation,
                                                   Date startDate,
                                                   Date endDate,
                                                   String fingerprint,
                                                   String operationID)
Description copied from interface: AuditTrailStore
Obtain AuditEventIterator for extracting audit trails from the store. When done with the iterator, the user should ensure that it is closed.

Specified by:
getAuditTrailsByIterator in interface AuditTrailStore
Parameters:
fileId - [OPTIONAL] The id of the file for restricting the extraction.
collectionID - [OPTIONAL] The id of the collection from which to retrieve audit trails.
contributorId - [OPTIONAL] The id of the contributor for restricting the extraction.
minSeqNumber - [OPTIONAL] The minimum sequence number for restricting the extraction.
maxSeqNumber - [OPTIONAL] The maximum sequence number for restricting the extraction.
actorName - [OPTIONAL] The name of the actor for restricting the extraction.
operation - [OPTIONAL] The FileAction operation for restricting the extraction.
startDate - [OPTIONAL] The earliest date for the audits for restricting the extraction.
endDate - [OPTIONAL] The latest date for the audits for restricting the extraction.
fingerprint - [OPTIONAL] The fingerprint of the certificate for the audits
operationID - [OPTIONAL] The ID of the operation (conversationID) for the audits
Returns:
The requested audit trails from the store.

addAuditTrails

public void addAuditTrails(AuditTrailEvents newAuditTrails,
                           String collectionId)
Description copied from interface: AuditTrailStore
ingest audit trails into the store.

Specified by:
addAuditTrails in interface AuditTrailStore
Parameters:
newAuditTrails - The audit trails to be ingested into the store.
collectionId - The id of the collection, where the audit trail events belong.

largestSequenceNumber

public int largestSequenceNumber(String contributorId,
                                 String collectionId)
Description copied from interface: AuditTrailStore
Retrieves the largest sequence number for a given contributor.

Specified by:
largestSequenceNumber in interface AuditTrailStore
Parameters:
contributorId - The id of the contributor to retrieve the largest sequence number from.
collectionId - The id of the collection for the sequence number of the contributor.
Returns:
The largest sequence number.

getPreservationSequenceNumber

public long getPreservationSequenceNumber(String contributorId,
                                          String collectionId)
Description copied from interface: AuditTrailStore
Retrieves the preservation sequence number for the given contributor, which tells how far the preservation of the audit trails has gotten.

Specified by:
getPreservationSequenceNumber in interface AuditTrailStore
Parameters:
contributorId - The id of the contributor.
collectionId - The id of the collection for the sequence number of the contributor.
Returns:
The preservation sequence number for the given contributor.

setPreservationSequenceNumber

public void setPreservationSequenceNumber(String contributorId,
                                          String collectionId,
                                          long seqNumber)
Description copied from interface: AuditTrailStore
Set the preservation sequence number for the given contributor.

Specified by:
setPreservationSequenceNumber in interface AuditTrailStore
Parameters:
contributorId - The id of the contributor.
collectionId - The id of the collection for the sequence number of the contributor.
seqNumber - The new preservation sequence number for the given contributor.

havePreservationKey

public boolean havePreservationKey(String contributorID,
                                   String collectionID)
Description copied from interface: AuditTrailStore
Check to see if the database knows a contributor

Specified by:
havePreservationKey in interface AuditTrailStore
Parameters:
contributorID - The ID of the contributor
collectionID - The ID of the collection;
Returns:
boolean true, if the contributor is known by the database, false otherwise.

close

public void close()
Description copied from interface: AuditTrailStore
Closes the store.

Specified by:
close in interface AuditTrailStore


Copyright © 2010-2013 The State and University Library, The Royal Library and The State Archives, Denmark. All Rights Reserved.