/*
 * NIST HL7 Web Service
 * ProfileValidationInterface.java Jun 1, 2007
 *
 * This code was produced by the National Institute of Standards and
 * Technology (NIST). See the "nist.disclaimer" file given in the distribution
 * for information on the use and redistribution of this software.
 */

package gov.nist.hl7.ws.profilevalidation;

/**
 * This interface provides a simple interface for validating a profile.
 * This interface is intended for use in a web-service environment. Parameters and return
 * values are intentionally made to be simple objects.
 *
 * @author Sydney Henrard (NIST)
 */
public interface ProfileValidationInterface {

    /**
     * Set the Profile
     * @param xmlProfile a Profile encoded as an XML String
     * @param profileId an id to identify the Profile (value used in the report)
     * @return true if the Profile has been set
     */
    boolean setProfile(String xmlProfile, String profileId) throws Exception;

    /**
     * Set the ProfileValidationContext
     * @param xmlProfileValidationContext a ProfileValidationContext encoded as an XML String
     * @return true if the ProfileValidationContext has been set
     */
    boolean setProfileValidationContext(String xmlProfileValidationContext) throws Exception;

    /**
     * Validate the Profile using the ProfileValidationContext. If no ProfileValidationContext is set,
     * a default one is used
     * @return true if the Profile is valid using the ProfileValidationContext
     */
    boolean validate() throws Exception;

    /**
     * Get the ProfileValidationReport associated with the previous validation
     * @return a String object that contains an XML report of the profile validation results
     */
    String getProfileValidationReport() throws Exception;

    /**
     * Get the messsage of the last exception caught
     * @return a String containing the last exception message
     */
    String getLastExceptionMessage();
}
