fedora.server.validation
Class DOValidatorModule

java.lang.Object
  extended byfedora.server.Parameterized
      extended byfedora.server.Pluggable
          extended byfedora.server.Module
              extended byfedora.server.validation.DOValidatorModule
All Implemented Interfaces:
DOValidator, Logging

public class DOValidatorModule
extends Module
implements DOValidator

Title: DOValidatorModule.java

Description: Module Wrapper for DOValidatorImpl.java.

-----------------------------------------------------------------------------

License and Copyright: The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/.

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The entire file consists of original code. Copyright © 2002-2005 by The Rector and Visitors of the University of Virginia and Cornell University. All rights reserved.

-----------------------------------------------------------------------------

Version:
$Id: DOValidatorModule.java,v 1.18 2005/01/11 20:06:09 cwilper Exp $
Author:
payette@cs.cornell.edu

Constructor Summary
DOValidatorModule(java.util.Map moduleParameters, Server server, java.lang.String role)
          Constructs a new DOValidatorModule
 
Method Summary
 void postInitModule()
          Second stage of Module initialization.
 void validate(java.io.File objectAsFile, java.lang.String format, int validationType, java.lang.String phase)
          Validates a digital object.
 void validate(java.io.InputStream objectAsStream, java.lang.String format, int validationType, java.lang.String phase)
          Validates a digital object.
 
Methods inherited from class fedora.server.Module
getRole, getServer, initModule, logConfig, logFine, logFiner, logFinest, loggingConfig, loggingFine, loggingFiner, loggingFinest, loggingInfo, loggingSevere, loggingWarning, logInfo, logSevere, logWarning, shutdownModule
 
Methods inherited from class fedora.server.Pluggable
getHelp, getOptionalParameters, getParameterHelp, getRequiredModuleRoles, getRequiredParameters
 
Methods inherited from class fedora.server.Parameterized
getParameter, getParameters, parameterNames, setParameter, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOValidatorModule

public DOValidatorModule(java.util.Map moduleParameters,
                         Server server,
                         java.lang.String role)
                  throws ModuleInitializationException,
                         ServerException

Constructs a new DOValidatorModule

Parameters:
moduleParameters - The name/value pair map of module parameters.
server - The server instance.
role - The module role name.
Throws:
ModuleInitializationException - If initialization values are invalid or initialization fails for some other reason.
ServerException
Method Detail

postInitModule

public void postInitModule()
                    throws ModuleInitializationException
Description copied from class: Module
Second stage of Module initialization. This is guaranteed to run after all Module's initModule() methods have run.

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

validate

public void validate(java.io.InputStream objectAsStream,
                     java.lang.String format,
                     int validationType,
                     java.lang.String phase)
              throws ServerException

Validates a digital object.

Specified by:
validate in interface DOValidator
Parameters:
objectAsStream - The digital object provided as a bytestream.
validationType - The level of validation to perform on the digital object. This is an integer from 0-2 with the following meanings: 0 = VALIDATE_ALL (do all validation levels) 1 = VALIDATE_XML_SCHEMA (perform only XML Schema validation) 2 = VALIDATE_SCHEMATRON (perform only Schematron Rules validation)
phase - The stage in the work flow for which the validation should be contextualized. "ingest" = the object is in the submission format for the ingest stage phase "store" = the object is in the authoritative format for the final storage phase
Throws:
ServerException - If validation fails for any reason.

validate

public void validate(java.io.File objectAsFile,
                     java.lang.String format,
                     int validationType,
                     java.lang.String phase)
              throws ServerException

Validates a digital object.

Specified by:
validate in interface DOValidator
Parameters:
objectAsFile - The digital object provided as a file.
validationType - The level of validation to perform on the digital object. This is an integer from 0-2 with the following meanings: 0 = VALIDATE_ALL (do all validation levels) 1 = VALIDATE_XML_SCHEMA (perform only XML Schema validation) 2 = VALIDATE_SCHEMATRON (perform only Schematron Rules validation)
phase - The stage in the work flow for which the validation should be contextualized. "ingest" = the object is in the submission format for the ingest stage phase "store" = the object is in the authoritative format for the final storage phase
Throws:
ServerException - If validation fails for any reason.