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

AsymmetricBinding

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

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

          
    
    
                       
      
    
public AsymmetricBinding(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.TokengetInitiatorToken()

  
        populate();       
        return initiatorToken;   
    
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.TokengetRecipientToken()

  
        populate();    
        return recipientToken; 
    
public booleangetSignatureProtection()

    
        populate();       
        return protectSignature;  
    
public booleangetTokenProtection()

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

  
        populate();     
        this.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.isLoggable(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.isInitiatorToken(assertion)){    
                    this.initiatorToken = ((com.sun.xml.ws.security.impl.policy.Token)assertion).getToken();  
                }else if(PolicyUtil.isRecipientToken(assertion)){     
                    this.recipientToken = ((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,AsymmetricBinding); 
                        fitness = AssertionFitness.HAS_UNKNOWN_ASSERTION;            
                    }             
                }      
            }   
            populated = true;     
        } 
        return fitness; 
    
public voidsetAlgorithmSuite(com.sun.xml.ws.security.policy.AlgorithmSuite algSuite)

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

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

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

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

   
        this.recipientToken = token;   
    
public voidsetSignContent(boolean contentOnly)

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

        this.protectSignature = value; 
    
    
public voidsetTokenProtection(boolean value)

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

    
        
        return populate(isServer);