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

SecureConversationToken

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

Fields Summary
private static QName
itQname
private com.sun.xml.ws.policy.NestedPolicy
bootstrapPolicy
private String
id
protected String
includeToken
private boolean
populated
private com.sun.xml.ws.policy.PolicyAssertion
rdKey
private Set
referenceType
private Issuer
issuer
private String
tokenType
private AssertionFitness
fitness
Constructors Summary
public SecureConversationToken()
Creates a new instance of SecureConversationToken

               
      
        UUID uid = UUID.randomUUID();
        id= uid.toString();
    
public SecureConversationToken(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 com.sun.xml.ws.policy.NestedPolicygetBootstrapPolicy()

        populate();
        return bootstrapPolicy;
    
public java.lang.StringgetIncludeToken()

        populate();
        return includeToken;
    
public IssuergetIssuer()

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

        return id;
    
public java.util.SetgetTokenRefernceTypes()

        populate();
        if(referenceType == null ){
            return Collections.emptySet();
        }
        return referenceType;
    
public java.lang.StringgetTokenType()

        populate();
        return this.tokenType;
    
public booleanisRequireDerivedKeys()

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

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

        if(!populated){
            String tmp = getAttributeValue(itQname);
            if(tmp != null)
                includeToken = tmp;
            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> paItr = as.iterator();
            while(paItr.hasNext()){
                PolicyAssertion assertion = paItr.next();
                if(PolicyUtil.isBootstrapPolicy(assertion)){
                    bootstrapPolicy = assertion.getNestedPolicy();
                }else if(PolicyUtil.isRequireDerivedKeys(assertion)){
                    rdKey =  assertion;
                }else if(PolicyUtil.isRequireExternalUriReference(assertion)){
                    if(referenceType == null){
                        referenceType =new HashSet<String>();
                    }
                    referenceType.add(assertion.getName().getLocalPart().intern());
                }else if(PolicyUtil.isSC10SecurityContextToken(assertion)){
                    tokenType = assertion.getName().getLocalPart();
                }else{
                    if(!assertion.isOptional()){
                        log_invalid_assertion(assertion, isServer,SecureConversationToken);
                        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 voidsetIncludeToken(java.lang.String type)

        Map<QName, String> attrs = this.getAttributes();
        QName itQname = new QName(Constants.SECURITY_POLICY_NS, Constants.IncludeToken);
        attrs.put(itQname,type);
    
public AssertionFitnessvalidate(boolean isServer)

        return populate(isServer);