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

RelToken

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

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

    
           
          
        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.isRelTokenType(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,RelToken);
                        fitness = AssertionFitness.HAS_UNKNOWN_ASSERTION;
                    }
                }
            }
            populated = true;
        }
        return fitness;
    
public AssertionFitnessvalidate(boolean isServer)

        return populate(isServer);