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

SamlToken

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

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

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

        return populate(isServer);