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

SpnegoContextToken

public class SpnegoContextToken extends com.sun.xml.ws.policy.PolicyAssertion implements com.sun.xml.ws.security.policy.SecurityAssertionValidator, com.sun.xml.ws.security.policy.SpnegoContextToken
author
K.Venugopal@sun.com, Mayank.Mishra@Sun.com

Fields Summary
private boolean
populated
private com.sun.xml.ws.policy.PolicyAssertion
rdKey
Boolean
requiredDerivedKeys
private String
includeTokenType
private String
id
private Issuer
issuer
private static QName
itQname
private AssertionFitness
fitness
Constructors Summary
public SpnegoContextToken()
Creates a new instance of SpnegoContextToken

               
      
        UUID uid = UUID.randomUUID();
        id= uid.toString();
    
public SpnegoContextToken(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 includeTokenType;
    
public IssuergetIssuer()

        populate();
        return this.issuer;
    
public java.lang.StringgetTokenId()

        return id;
    
public booleanisRequireDerivedKeys()

        populate();
        if (rdKey != null ) {
            return true;
        }
        return false;
    
private voidpopulate()

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

        if(!populated){
            NestedPolicy policy = this.getNestedPolicy();
            if(this.getAttributeValue(itQname) != null){
                includeTokenType = this.getAttributeValue(itQname);
            }
            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> paItr = as.iterator();
            
            while(paItr.hasNext()){
                PolicyAssertion assertion  = paItr.next();
                if(PolicyUtil.isRequireDerivedKeys(assertion)){
                    rdKey = assertion;
                } else{
                    if(!assertion.isOptional()){
                        log_invalid_assertion(assertion, isServer,"SpnegoContextToken");
                        fitness = AssertionFitness.HAS_UNKNOWN_ASSERTION;
                    }
                }
            }
            
            if ( this.hasNestedAssertions() ) {
                Iterator <PolicyAssertion> it = this.getNestedAssertionsIterator();
                while(it.hasNext()){
                    PolicyAssertion assertion = it.next();
                    if(PolicyUtil.isIssuer(assertion)){
                        issuer = (Issuer)assertion;
                    }
                }
            }
            populated = true;
        }
        return fitness;
    
public AssertionFitnessvalidate(boolean isServer)

        return populate(isServer);