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

SymmetricBinding

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

Fields Summary
private AssertionFitness
fitness
boolean
populated
com.sun.xml.ws.security.policy.Token
protectionToken
com.sun.xml.ws.security.policy.Token
signatureToken
com.sun.xml.ws.security.policy.Token
encryptionToken
com.sun.xml.ws.security.policy.MessageLayout
layout
com.sun.xml.ws.security.policy.AlgorithmSuite
algSuite
boolean
includeTimestamp
boolean
contentOnly
String
protectionOrder
boolean
protectToken
boolean
protectSignature
Constructors Summary
public SymmetricBinding()
Creates a new instance of SymmetricBinding

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

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

 
        populate();      
        if(algSuite == null){         
            algSuite = new  com.sun.xml.ws.security.impl.policy.AlgorithmSuite();          
            logger.log(Level.FINE, "Using Default Algorithm Suite Basic128");    
        
        }    
        return algSuite;    
    
public com.sun.xml.ws.security.policy.TokengetEncryptionToken()

    
        populate();      
        return encryptionToken;    
    
public com.sun.xml.ws.security.policy.MessageLayoutgetLayout()

        populate();         
        return layout;         
    
public java.lang.StringgetProtectionOrder()

        
        populate();         
        return protectionOrder;        
    
public com.sun.xml.ws.security.policy.TokengetProtectionToken()

 
        populate();  
        return protectionToken; 
    
public booleangetSignatureProtection()

    
        populate();         
        return protectSignature;       
    
public com.sun.xml.ws.security.policy.TokengetSignatureToken()

  
        populate();       
        return signatureToken;      
    
public booleangetTokenProtection()

    
        populate();         
        return protectToken;    
    
public voidincludeTimeStamp(boolean value)

   
        includeTimestamp = value;            
    
public booleanisIncludeTimeStamp()

      
        populate();           
        return includeTimestamp;      
    
public booleanisSignContent()

 
        populate();         
        return contentOnly;       
    
private voidpopulate()

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

     
        if(!populated){                      
            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> ast = as.iterator();       
            while(ast.hasNext()){                           
                PolicyAssertion assertion = ast.next();     
                if(PolicyUtil.isSignatureToken(assertion)){  
                    this.signatureToken = ((com.sun.xml.ws.security.impl.policy.Token)assertion).getToken();      
                }else if(PolicyUtil.isEncryptionToken(assertion)){ 
                    this.encryptionToken =((com.sun.xml.ws.security.impl.policy.Token)assertion).getToken();   
                }else if(PolicyUtil.isProtectionToken(assertion)){                   
                    this.protectionToken = ((com.sun.xml.ws.security.impl.policy.Token)assertion).getToken(); 
                }else if(PolicyUtil.isAlgorithmAssertion(assertion)){    
                    this.algSuite = (AlgorithmSuite) assertion;         
                }else if(PolicyUtil.isIncludeTimestamp(assertion)){      
                    this.includeTimestamp = true;                        
                }else if(PolicyUtil.isEncryptBeforeSign(assertion)){       
                    this.protectionOrder = ENCRYPT_SIGN;                 
                }else if (PolicyUtil.isSignBeforeEncrypt(assertion)){
                    this.protectionOrder = SIGN_ENCRYPT;
                }else if(PolicyUtil.isContentOnlyAssertion(assertion)){  
                    this.contentOnly = false;                            
                }else if(PolicyUtil.isMessageLayout(assertion)){         
                    layout = ((Layout)assertion).getMessageLayout();     
                }else if(PolicyUtil.isProtectTokens(assertion)){         
                    this.protectToken = true;                            
                }else if(PolicyUtil.isEncryptSignature(assertion)){      
                    this.protectSignature = true;                        
                }else{                                    
                    if(!assertion.isOptional()){         
                        log_invalid_assertion(assertion, isServer,SymmetricBinding);   
                        fitness = AssertionFitness.HAS_UNKNOWN_ASSERTION;    
                    }                              
                }             
            }                   
            populated = true;     
        }             
        return fitness;
    
public voidsetAlgorithmSuite(com.sun.xml.ws.security.policy.AlgorithmSuite algSuite)

    
        this.algSuite = algSuite;         
    
public voidsetEncryptionToken(com.sun.xml.ws.security.policy.Token token)

  
        encryptionToken = token ;          
    
public voidsetLayout(com.sun.xml.ws.security.policy.MessageLayout layout)

    
        this.layout = layout;          
    
public voidsetProtectionOrder(java.lang.String order)

        this.protectionOrder = order;       
    
public voidsetProtectionToken(com.sun.xml.ws.security.policy.Token token)

  
        protectionToken = token;    
    
public voidsetSignContent(boolean contentOnly)

  
        
        this.contentOnly = contentOnly;
    
public voidsetSignatureProtection(boolean value)

         
        
        this.protectSignature = value;     
    
public voidsetSignatureToken(com.sun.xml.ws.security.policy.Token token)

  
        signatureToken = token;  
    
public voidsetTokenProtection(boolean value)

 
        this.protectToken = value;      
    
public AssertionFitnessvalidate(boolean isServer)

    
        return populate(isServer);