FileDocCategorySizeDatePackage
KerberosToken.javaAPI DocExample6102Tue May 29 16:56:46 BST 2007com.sun.xml.ws.security.impl.policy

KerberosToken

public class KerberosToken extends com.sun.xml.ws.policy.PolicyAssertion implements com.sun.xml.ws.security.policy.SecurityAssertionValidator, com.sun.xml.ws.security.policy.KerberosToken
author
mayank.mishra@Sun.com

Fields Summary
private AssertionFitness
fitness
private String
id
private List
tokenRefType
private boolean
populated
private QName
itQname
private String
includeTokenType
private com.sun.xml.ws.policy.PolicyAssertion
rdKey
private String
tokenType
private boolean
isServer
Constructors Summary
public KerberosToken(com.sun.xml.ws.policy.sourcemodel.AssertionData name, Collection nestedAssertions, com.sun.xml.ws.policy.AssertionSet nestedAlternative)
Creates a new instance of KerberosToken

    
           
          
        super(name,nestedAssertions,nestedAlternative);
        UUID id = UUID.randomUUID();
        this.id = id.toString();
    
Methods Summary
public java.lang.StringgetIncludeToken()

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

        return id;
    
public java.util.IteratorgetTokenRefernceType()

        if ( tokenRefType != null ) {
            return tokenRefType.iterator();
        } else {
            return Collections.emptyList().iterator();
        }
    
public java.lang.StringgetTokenType()

        populate();
        return tokenType;
    
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();
            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.isKerberosTokenType(assertion)){
                    tokenType = assertion.getName().getLocalPart().intern();
                }else if(PolicyUtil.isRequireDerivedKeys(assertion)){
                    rdKey = assertion;
                }else if(PolicyUtil.isRequireKeyIR(assertion)){
                    if(tokenRefType == null){
                        tokenRefType = new ArrayList<String>();
                    }
                    tokenRefType.add(assertion.getName().getLocalPart().intern());
                } else{
                    if(!assertion.isOptional()){
                        log_invalid_assertion(assertion, isServer,KerberosToken);
                        fitness = AssertionFitness.HAS_UNKNOWN_ASSERTION;
                    }
                }
            }
            populated = true;
        }
        return fitness;
    
public AssertionFitnessvalidate(boolean isServer)

        return populate(isServer);