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

IssuedToken

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

Fields Summary
private boolean
populated
protected String
includeToken
private com.sun.xml.ws.security.policy.RequestSecurityTokenTemplate
rstTemplate
private com.sun.xml.ws.security.policy.Issuer
issuer
private static QName
itQname
private ArrayList
referenceType
private String
id
private AssertionFitness
fitness
private boolean
reqDK
Constructors Summary
public IssuedToken()
Creates a new instance of IssuedToken

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

        populate();
        return issuer;
    
public com.sun.xml.ws.security.policy.RequestSecurityTokenTemplategetRequestSecurityTokenTemplate()

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

        return id;
    
public java.util.IteratorgetTokenRefernceType()

        populate();
        return referenceType.iterator();
    
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);
            }
            if ( this.hasNestedAssertions() ) {
                Iterator <PolicyAssertion> it = this.getNestedAssertionsIterator();
                while ( it.hasNext() ) {
                    PolicyAssertion assertion = it.next();
                    if ( PolicyUtil.isIssuer(assertion) ) {
                        this.issuer = (Issuer) assertion;
                    } else if ( PolicyUtil.isRequestSecurityTokenTemplate(assertion)) {
                        this.rstTemplate = (RequestSecurityTokenTemplate) assertion;
                    }else{
                        if(!assertion.isOptional()){
                            log_invalid_assertion(assertion, isServer,IssuedToken);
                            fitness = AssertionFitness.HAS_UNKNOWN_ASSERTION;
                        }
                    }
                }
            }
            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();
            if(as == null){
                if(logger.getLevel() == Level.FINE){
                    logger.log(Level.FINE," Nested Policy is empty");
                }
                populated = true;
                return fitness;
            }
            Iterator<PolicyAssertion> ast = as.iterator();
            
            while(ast.hasNext()){
                PolicyAssertion assertion = ast.next();
                if(referenceType == null){
                    referenceType = new ArrayList<String>();
                }
                if ( PolicyUtil.isRequireDerivedKeys(assertion)) {
                    reqDK = true;
                } else if ( PolicyUtil.isRequireExternalReference(assertion)) {
                    referenceType.add(assertion.getName().getLocalPart().intern());
                } else if ( PolicyUtil.isRequireInternalReference(assertion)) {
                    referenceType.add(assertion.getName().getLocalPart().intern());
                } else{
                    if(!assertion.isOptional()){
                        log_invalid_assertion(assertion, isServer,IssuedToken);
                        fitness = AssertionFitness.HAS_UNKNOWN_ASSERTION;
                    }
                }
            }
            populated = true;
        }
        return fitness;
    
public voidsetIncludeToken(java.lang.String type)

        //includeToken = type;
        throw new UnsupportedOperationException();
    
public AssertionFitnessvalidate(boolean isServer)

        return populate(isServer);