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

Token

public class Token extends com.sun.xml.ws.policy.PolicyAssertion implements com.sun.xml.ws.security.policy.SecurityAssertionValidator, com.sun.xml.ws.security.policy.Token
author
K.Venugopal@sun.com

Fields Summary
private static QName
itQname
private String
_includeToken
private String
_id
private boolean
populated
private com.sun.xml.ws.security.policy.Token
_token
private AssertionFitness
fitness
Constructors Summary
public Token()
Creates a new instance of Token

               
    
     
        UUID uid = UUID.randomUUID();
        _id= uid.toString();
    
public Token(QName name)

        UUID uid = UUID.randomUUID();
        _id= uid.toString();
    
public Token(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();
    
Methods Summary
public java.lang.StringgetIncludeToken()

        populate();
        return _includeToken;
    
public com.sun.xml.ws.security.policy.TokengetToken()

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

        
        return _id;
    
private voidpopulate()

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

        if(!populated){
             String tValue = getAttributeValue(itQname);
             if(tValue != null){
                 _includeToken = tValue;
             }
            NestedPolicy policy = this.getNestedPolicy();
            if(policy == null){
                if(logger.getLevel() == Level.FINE){
                    logger.log(Level.FINE,"NestedPolicy is null");
                }
                populated = true;
                return fitness;
            }
            AssertionSet as = policy.getAssertionSet();
            Iterator<PolicyAssertion> ast = as.iterator();
            while(ast.hasNext()){
                PolicyAssertion assertion = ast.next();
                if(PolicyUtil.isToken(assertion)){
                    _token = (com.sun.xml.ws.security.policy.Token)assertion;
                }else{
                    if(!assertion.isOptional()){
                        log_invalid_assertion(assertion, isServer,"Token");
                        fitness = AssertionFitness.HAS_UNKNOWN_ASSERTION;
                    }
                }
            }
            
            populated = true;
        }
        return fitness;
    
public voidsetIncludeToken(java.lang.String type)

    
public voidsetToken(com.sun.xml.ws.security.policy.Token token)

        //TODO
    
public AssertionFitnessvalidate(boolean isServer)

        return populate(isServer);