FileDocCategorySizeDatePackage
X509Token.javaAPI DocExample6550Tue May 29 16:56:48 BST 2007com.sun.xml.ws.security.impl.policy

X509Token

public class X509Token extends com.sun.xml.ws.policy.PolicyAssertion implements com.sun.xml.ws.security.policy.SecurityAssertionValidator, Cloneable, com.sun.xml.ws.security.policy.X509Token
author
K.Venugopal@sun.com Abhijit.Das@Sun.Com

Fields Summary
private static QName
itQname
private String
includeToken
private AssertionFitness
fitness
private boolean
populated
private String
tokenType
private HashSet
referenceType
private String
id
Creates a new instance of X509Token
private boolean
reqDK
private boolean
isServer
Constructors Summary
public X509Token()

    
      
        UUID uid = UUID.randomUUID();
        id= uid.toString();
        referenceType = new HashSet<String>();
    
public X509Token(com.sun.xml.ws.policy.sourcemodel.AssertionData name, Collection nestedAssertions, com.sun.xml.ws.policy.AssertionSet nestedAlternative)

        super(name,nestedAssertions,nestedAlternative);
        
        UUID uid = UUID.randomUUID();
        id= uid.toString();
        referenceType = new HashSet<String>();
    
Methods Summary
public voidaddTokenReferenceType(java.lang.String tokenRefType)

        referenceType.add(tokenRefType);
    
public java.lang.Objectclone()

        throw new UnsupportedOperationException("Fix me");
        //return new X509Token(this.nestedPolicy,getAttributes(),id);
    
public java.lang.StringgetIncludeToken()

        populate();
        return includeToken;
    
public java.lang.StringgetTokenId()

        return id;
    
public java.util.SetgetTokenRefernceType()

        populate();
        return referenceType;
    
public java.lang.StringgetTokenType()

        populate();
        return tokenType;
    
public booleanisRequireDerivedKeys()

        populate();
        return reqDK;
    
private voidpopulate()

        populate(false);
    
private synchronized AssertionFitnesspopulate(boolean isServer)

        if(!populated){
            if(this.getAttributeValue(itQname)!=null){
                this.includeToken = this.getAttributeValue(itQname);
            }
            NestedPolicy policy = this.getNestedPolicy();
            if(policy == null){
                if(logger.getLevel() == Level.FINE){
                    logger.log(Level.FINE,"NestedPolicy is null");
                }
                populated = true;
                return fitness;
            }
            AssertionSet assertionSet = policy.getAssertionSet();
            for(PolicyAssertion assertion: assertionSet){
                if(PolicyUtil.isTokenReferenceType(assertion)){
                    referenceType.add(assertion.getName().getLocalPart().intern());
                }else if(PolicyUtil.isTokenType(assertion)) {
                    tokenType = assertion.getName().getLocalPart();
                }else if (PolicyUtil.isRequireDerivedKeys(assertion)) {
                    reqDK = true;
                }else{
                    if(!assertion.isOptional()){
                        log_invalid_assertion(assertion, isServer,"X509Token");
                        fitness = AssertionFitness.HAS_UNKNOWN_ASSERTION;
                    }
                }
            }
            
            populated = true;
        }
        return fitness;
    
public voidsetIncludeToken(java.lang.String type)

        includeToken = type;
    
public voidsetTokenType(java.lang.String tokenType)

        this.tokenType = tokenType;
    
public AssertionFitnessvalidate(boolean isServer)

        return populate(isServer);