org.ogf.graap.wsag.server.engine
Class TemplateValidator

java.lang.Object
  extended by org.ogf.graap.wsag.server.engine.TemplateValidator

public class TemplateValidator
extends Object

The TemplateValidator implements the required methods to validate the compliance of an agreement offer with respect to the creation constraints that are defined in the template that was used to create the offer.

Author:
Oliver Waeldrich

Constructor Summary
TemplateValidator()
           
 
Method Summary
 ValidatorType getConfiguration()
          Returns the validator configuration.
static void main(String[] args)
          Command line invocation of the validator.
 void setConfiguration(ValidatorType configuration)
          Sets the validator configuration.
 boolean validate(AgreementOffer offer, AgreementTemplateType template)
          Validates an agreement offer against a template.
 boolean validate(AgreementOffer offer, AgreementTemplateType template, StringBuffer error)
          Validates an agreement offer against a template.
 boolean validate(AgreementOfferDocument offer, TemplateDocument template)
          Validates an agreement offer document against a template document.
 boolean validate(NegotiationOfferType offer, AgreementTemplateType template)
          Validates a negotiation offer against a template.
 boolean validate(NegotiationOfferType offer, NegotiationOfferType counterOffer)
          Validates a negotiation counter offer against a negotiation offer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateValidator

public TemplateValidator()
Method Detail

main

public static void main(String[] args)
Command line invocation of the validator. For program parameters see info message.

Parameters:
args - program arguments, see info

validate

public boolean validate(AgreementOfferDocument offer,
                        TemplateDocument template)
Validates an agreement offer document against a template document.

Parameters:
offer - the offer to validate
template - the template containing the creation constraints
Returns:
true if the offer is valid, otherwise false

validate

public boolean validate(AgreementOffer offer,
                        AgreementTemplateType template,
                        StringBuffer error)
Validates an agreement offer against a template.

Parameters:
offer - the offer to validate
template - the template containing the creation constraints
error - contains the error message if the validation process failed
Returns:
true if the offer is valid, otherwise false

validate

public boolean validate(AgreementOffer offer,
                        AgreementTemplateType template)
Validates an agreement offer against a template.

Parameters:
offer - the offer to validate
template - the template containing the creation constraints
Returns:
true if the offer is valid, otherwise false

validate

public boolean validate(NegotiationOfferType offer,
                        AgreementTemplateType template)
Validates a negotiation offer against a template.

Parameters:
offer - the offer to validate
template - the template containing the creation constraints
Returns:
true if the offer is valid, otherwise false

validate

public boolean validate(NegotiationOfferType offer,
                        NegotiationOfferType counterOffer)
Validates a negotiation counter offer against a negotiation offer.

Parameters:
offer - the offer containing the negotiation constraints
counterOffer - the counter offer to validate
Returns:
true if the offer is valid, otherwise false

getConfiguration

public ValidatorType getConfiguration()
Returns the validator configuration.

Returns:
the validator configuration

setConfiguration

public void setConfiguration(ValidatorType configuration)
Sets the validator configuration. The configuration contains a set of XML schemas that are used to validate the XML documents (template, offer, couonter offer).

Parameters:
configuration - the validator configuration


Copyright © 2008-2012. All Rights Reserved.