FileDocCategorySizeDatePackage
AssertionValidationProcessor.javaAPI DocExample5000Tue May 29 16:56:34 BST 2007com.sun.xml.ws.policy

AssertionValidationProcessor

public final class AssertionValidationProcessor extends Object
Singleton class that provides method for assertion validation.
author
Marek Potociar (marek.potociar at sun.com)

Fields Summary
private static final com.sun.xml.ws.policy.privateutil.PolicyLogger
LOGGER
private static AssertionValidationProcessor
processor
private static final com.sun.xml.ws.policy.spi.PolicyAssertionValidator[]
validators
Constructors Summary
private AssertionValidationProcessor()
This private constructor prevents direct instantiation of this class.

     
        validators = PolicyUtils.ServiceProvider.load(PolicyAssertionValidator.class);
    
        // no instantiation outside the class.
    
Methods Summary
public static com.sun.xml.ws.policy.AssertionValidationProcessorgetInstance()
Factory method that returns singleton instance of the class.

return
singleton instance of the class.

        if (validators.length == 0) {
            throw LOGGER.logSevereException(new PolicyException(WSP_0076_NO_SERVICE_PROVIDERS_FOUND(PolicyAssertionValidator.class.getName())));
        }
        return processor;
    
public PolicyAssertionValidator.FitnessvalidateClientSide(PolicyAssertion assertion)
Validates fitness of the {@code assertion} on the client side. return client side {@code assertion} fitness

        PolicyAssertionValidator.Fitness assertionFitness = PolicyAssertionValidator.Fitness.UNKNOWN;
        for ( PolicyAssertionValidator validator : validators ) {
            assertionFitness = assertionFitness.combine(validator.validateClientSide(assertion));
            if (assertionFitness == PolicyAssertionValidator.Fitness.SUPPORTED) {
                break;
            }
        }
        
        return assertionFitness;
    
public PolicyAssertionValidator.FitnessvalidateServerSide(PolicyAssertion assertion)
Validates fitness of the {@code assertion} on the server side. return server side {@code assertion} fitness

        PolicyAssertionValidator.Fitness assertionFitness = PolicyAssertionValidator.Fitness.UNKNOWN;
        for (PolicyAssertionValidator validator : validators) {
            assertionFitness = assertionFitness.combine(validator.validateServerSide(assertion));
            if (assertionFitness == PolicyAssertionValidator.Fitness.SUPPORTED) {
                break;
            }
        }
        
        return assertionFitness;