FileDocCategorySizeDatePackage
SupportingTokens.javaAPI DocExample7441Tue May 29 16:56:48 BST 2007com.sun.xml.ws.security.impl.policy

SupportingTokens

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

Fields Summary
private com.sun.xml.ws.security.policy.AlgorithmSuite
algSuite
private List
spList
private List
epList
private List
seList
private List
eeList
private boolean
isServer
private List
_tokenList
private boolean
populated
Constructors Summary
public SupportingTokens()
Creates a new instance of SupportingTokens

    
               
      
    
public SupportingTokens(com.sun.xml.ws.policy.sourcemodel.AssertionData name, Collection nestedAssertions, com.sun.xml.ws.policy.AssertionSet nestedAlternative)

        super(name,nestedAssertions,nestedAlternative);
        
    
Methods Summary
public voidaddToken(com.sun.xml.ws.security.policy.Token token)

        if(_tokenList == null){
            _tokenList = new ArrayList<Token>();
            //Workaround - workaround to remove duplicate UsernameToken : uncomment this
            //_tokenList.add(token);
        }
        //Workaround - comment
        _tokenList.add(token);
    
public com.sun.xml.ws.security.policy.AlgorithmSuitegetAlgorithmSuite()

        populate();
        return algSuite;
    
public java.util.IteratorgetEncryptedElements()

        populate();
        return eeList.iterator();
    
public java.util.IteratorgetEncryptedParts()

        populate();
        return epList.iterator();
    
public java.lang.StringgetIncludeToken()

        return "";
    
public java.util.IteratorgetSignedElements()

        populate();
        return seList.iterator();
    
public java.util.IteratorgetSignedParts()

        populate();
        return spList.iterator();
    
public java.lang.StringgetTokenId()

        return "";
    
public java.util.IteratorgetTokens()

        populate();
        if ( _tokenList != null ) {
            return _tokenList.iterator();
        }
        return Collections.emptyList().iterator();
    
private synchronized voidpopulate()

        
        if(!populated){
            NestedPolicy policy = this.getNestedPolicy();
            if(policy == null){
                if(logger.getLevel() == Level.FINE){
                    logger.log(Level.FINE,"NestedPolicy is null");
                }
                populated = true;
                return;
            }
            AssertionSet as = policy.getAssertionSet();
            Iterator<PolicyAssertion> ast = as.iterator();
            while(ast.hasNext()){
                PolicyAssertion assertion = ast.next();
                if(PolicyUtil.isAlgorithmAssertion(assertion)){
                    this.algSuite = (AlgorithmSuite) assertion;
                }else if(PolicyUtil.isToken(assertion)){
                    addToken((Token)assertion);
                    //this._tokenList.add((Token)assertion);
                }else if(PolicyUtil.isSignedParts(assertion)){
                    spList.add((SignedParts) assertion);
                }else if(PolicyUtil.isSignedElements(assertion)){
                    seList.add((SignedElements)assertion);
                }else if(PolicyUtil.isEncryptParts(assertion)){
                    epList.add((EncryptedParts)assertion);
                }else if(PolicyUtil.isEncryptedElements(assertion)){
                    eeList.add((EncryptedElements)assertion);
                }else{
                    if(!assertion.isOptional()){
                        if(logger.getLevel() == Level.SEVERE){
                            logger.log(Level.SEVERE,"SP0100.invalid.security.assertion",new Object[]{assertion,"SupportingTokens"});
                        }
                        if(isServer){
                            throw new UnsupportedPolicyAssertion("Policy assertion "+
                                    assertion+" is not supported under SupportingTokens assertion");
                        }
                    }
                }
            }
            populated = true;
        }
    
public voidsetAlgorithmSuite(com.sun.xml.ws.security.policy.AlgorithmSuite algSuite)

        this.algSuite =algSuite;
    
public voidsetIncludeToken(java.lang.String type)