edu.harvard.hul.ois.jhove.handler
Class AuditHandler

java.lang.Object
  extended by edu.harvard.hul.ois.jhove.HandlerBase
      extended by edu.harvard.hul.ois.jhove.handler.XmlHandler
          extended by edu.harvard.hul.ois.jhove.handler.AuditHandler
All Implemented Interfaces:
OutputHandler

public class AuditHandler
extends XmlHandler

JHOVE audit output handler, derived from the standard JHOVE XML handler. It is expected that this class will be used as the parent for other, more interesting output handlers. Subclasses should override the implementations of the Impl methods, e.g., endDirectoryImpl ().

See Also:
JHOVE XML output handler

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.harvard.hul.ois.jhove.HandlerBase
HandlerBase.SynchronizedDateFormat
 
Field Summary
protected  java.lang.String _home
          Home directory of the audit.
protected  java.util.Map _mimeType
          Number of files processed by MIME type.
protected  int _nAudit
          Number of files audited.
protected  java.util.Map _stateMap
          State map.
protected  java.util.Stack _stateStack
          State stack.
protected  long _t0
          Initial time.
 
Fields inherited from class edu.harvard.hul.ois.jhove.HandlerBase
_app, _base, _date, _defaultParams, _encoding, _init, _je, _level, _logger, _name, _note, _param, _release, _rights, _specification, _vendor, _writer, date, dateTime, iso8601
 
Constructor Summary
AuditHandler()
          Instantiate a AudiHandler object.
 
Method Summary
 void endDirectory()
          Callback indicating a directory is finished being processed.
 void endDirectoryImpl(AuditState state)
          Local extension to the standard callback indicating a directory is finished being processed.
 boolean okToProcess(java.lang.String filepath)
          Determine whether or not to process the file.
 boolean okToProcessImpl(java.lang.String filepath, AuditState state)
          Local extension to standard callback that determines whether or not to process the file.
 void show(RepInfo info)
          Outputs the information contained in a RepInfo object
 void showFooter()
          Do the final output.
 void showFooterImpl(AuditState state)
          Local extension to the standard callback that does the final output.
 void showHeader()
          Do the initial output.
 AuditState showHeaderImpl(java.lang.String directory)
          Local extension to the standard callback that does the initial output.
 void showImpl(RepInfo info, AuditState state)
          Local extension to the standard callback that outputs the information contained in a RepInfo object
 void startDirectory(java.lang.String directory)
          Callback indicating a new directory is being processed.
 void startDirectoryImpl(AuditState state)
          Local extension to the standard callback indicating a new directory is being processed.
 
Methods inherited from class edu.harvard.hul.ois.jhove.handler.XmlHandler
rationalToString, show, show, show, show, showAESAudioMetadata, showAgent, showArrayProperty, showChangeHistory10, showChangeHistory20, showChecksum, showDocument, showIdentifier, showMessage, showNisoBasicDigitalObjectInformation10, showNisoBasicDigitalObjectInformation20, showNisoBasicImageInformation10, showNisoBasicImageInformation20, showNisoBasicImageParameters02, showNisoChangeHistory02, showNisoImageAssessmentMetadata10, showNisoImageAssessmentMetadata20, showNisoImageCaptureMetadata10, showNisoImageCaptureMetadata20, showNisoImageCreation02, showNisoImageMetadata, showNisoImageMetadata02, showNisoImageMetadata10, showNisoImageMetadata20, showNisoImagingPerformanceAssessment02, showProperty, showSignature, showTextMDMetadata, valueToString
 
Methods inherited from class edu.harvard.hul.ois.jhove.HandlerBase
analyze, applyDefaultParams, close, doctype, doctype, doubleArray, element, element, element, element, elementEnd, elementStart, elementStart, getDate, getEncoding, getIndent, getName, getNote, getRelease, getRights, getSpecification, getVendor, init, integerArray, integerArray, longArray, param, rationalArray, rationalArray10, reset, resetParams, setApp, setBase, setDefaultParams, setEncoding, setWriter, toDateTime, xmlDecl, xmlDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_home

protected java.lang.String _home
Home directory of the audit.


_mimeType

protected java.util.Map _mimeType
Number of files processed by MIME type.


_stateMap

protected java.util.Map _stateMap
State map.


_stateStack

protected java.util.Stack _stateStack
State stack.


_t0

protected long _t0
Initial time.


_nAudit

protected int _nAudit
Number of files audited.

Constructor Detail

AuditHandler

public AuditHandler()
Instantiate a AudiHandler object.

Method Detail

endDirectory

public final void endDirectory()
Callback indicating a directory is finished being processed. Prop the state stack and place the current directory file count into the directory hash.

Specified by:
endDirectory in interface OutputHandler
Overrides:
endDirectory in class HandlerBase

endDirectoryImpl

public void endDirectoryImpl(AuditState state)
Local extension to the standard callback indicating a directory is finished being processed.

Parameters:
state - Audit handler state

okToProcess

public final boolean okToProcess(java.lang.String filepath)
Determine whether or not to process the file.

Specified by:
okToProcess in interface OutputHandler
Overrides:
okToProcess in class HandlerBase
Parameters:
filepath - File pathname

okToProcessImpl

public boolean okToProcessImpl(java.lang.String filepath,
                               AuditState state)
Local extension to standard callback that determines whether or not to process the file.

Parameters:
filepath - File pathname
state - Audit handler state

show

public void show(RepInfo info)
Outputs the information contained in a RepInfo object

Specified by:
show in interface OutputHandler
Overrides:
show in class XmlHandler
Parameters:
info - Object representation information

showImpl

public void showImpl(RepInfo info,
                     AuditState state)
Local extension to the standard callback that outputs the information contained in a RepInfo object

Parameters:
info - Object representation information
state - Audit handler state

showFooter

public void showFooter()
Do the final output. This should be in a suitable format for including multiple files between the header and the footer, and the XML of the header and footer must balance out.

Specified by:
showFooter in interface OutputHandler
Overrides:
showFooter in class XmlHandler

showFooterImpl

public void showFooterImpl(AuditState state)
Local extension to the standard callback that does the final output. This should be in a suitable format for including multiple files between the header and the footer, and the XML of the header and footer must balance out.

Parameters:
state - Audit handler state

showHeader

public void showHeader()
Do the initial output. This should be in a suitable format for including multiple files between the header and the footer, and the XML of the header and footer must balance out.

Specified by:
showHeader in interface OutputHandler
Overrides:
showHeader in class XmlHandler

showHeaderImpl

public AuditState showHeaderImpl(java.lang.String directory)
Local extension to the standard callback that does the initial output. This should be in a suitable format for including multiple files between the header and the footer, and the XML of the header and footer must balance out.

Parameters:
directory - Current directory filepath

startDirectory

public void startDirectory(java.lang.String directory)
Callback indicating a new directory is being processed. Additional state information can be added to the AuditState object in the showHeaderImpl() method before it is pushed onto the stack.

Specified by:
startDirectory in interface OutputHandler
Overrides:
startDirectory in class HandlerBase
Parameters:
directory - Directory path

startDirectoryImpl

public void startDirectoryImpl(AuditState state)
Local extension to the standard callback indicating a new directory is being processed.

Parameters:
state - Audit handler state