ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1340089 [1/2] - in /webservices/wss4j/branches/swssf: ./ rampart-policy/ streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/ streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ streaming-ws-security/src/main/java/org...
Date Fri, 18 May 2012 13:29:03 GMT
Author: coheigea
Date: Fri May 18 13:29:02 2012
New Revision: 1340089

URL: http://svn.apache.org/viewvc?rev=1340089&view=rev
Log:
Picking up WSS4J 1.6.5 + some bug fixes + dev work from WSS4J trunk

Added:
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectConfirmationDataBean.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/resources/saml2-xacml2-profile.xml
Modified:
    webservices/wss4j/branches/swssf/pom.xml
    webservices/wss4j/branches/swssf/rampart-policy/pom.xml
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLBootstrap.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLUtil.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ActionBean.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeBean.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeStatementBean.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthDecisionStatementBean.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthenticationStatementBean.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ConditionsBean.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/KeyInfoBean.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectBean.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectLocalityBean.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1Constants.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2ComponentBuilder.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2Constants.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/saml/SAMLTokenTest.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/crypto/MerlinBase.java

Modified: webservices/wss4j/branches/swssf/pom.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/pom.xml?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/pom.xml (original)
+++ webservices/wss4j/branches/swssf/pom.xml Fri May 18 13:29:02 2012
@@ -46,7 +46,8 @@
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <xmlsec.version>1.5.2</xmlsec.version>
-        <wss4j.version>1.6.4</wss4j.version>
+        <wss4j.version>1.6.5</wss4j.version>
+        <neethi.version>3.0.2</neethi.version>
     </properties>
 
     <dependencyManagement>
@@ -69,7 +70,7 @@
             <dependency>
                 <groupId>org.apache.neethi</groupId>
                 <artifactId>neethi</artifactId>
-                <version>3.0.2-SNAPSHOT</version>
+                <version>${neethi.version}</version>
             </dependency>
             <dependency>
                 <groupId>org.codehaus.woodstox</groupId>

Modified: webservices/wss4j/branches/swssf/rampart-policy/pom.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/rampart-policy/pom.xml?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/rampart-policy/pom.xml (original)
+++ webservices/wss4j/branches/swssf/rampart-policy/pom.xml Fri May 18 13:29:02 2012
@@ -39,7 +39,7 @@
         <dependency>
             <groupId>org.apache.neethi</groupId>
             <artifactId>neethi</artifactId>
-            <version>3.0.2-SNAPSHOT</version>
+            <version>3.0.2</version>
         </dependency>
         <dependency>
             <groupId>commons-lang</groupId>

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLBootstrap.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLBootstrap.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLBootstrap.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLBootstrap.java Fri May 18 13:29:02 2012
@@ -54,6 +54,7 @@ public class OpenSAMLBootstrap extends D
             "/saml2-metadata-query-config.xml",
             "/saml2-assertion-delegation-restriction-config.xml",
             "/saml2-ecp-config.xml",
+            "/saml2-xacml2-profile.xml",
             "/xacml10-saml2-profile-config.xml",
             "/xacml11-saml2-profile-config.xml",
             "/xacml20-context-config.xml",

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLUtil.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLUtil.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/OpenSAMLUtil.java Fri May 18 13:29:02 2012
@@ -36,22 +36,26 @@ import javax.xml.namespace.QName;
  * <p/>
  * Created on May 18, 2009
  */
-public class OpenSAMLUtil {
-    private static final org.apache.commons.logging.Log log =
+public final class OpenSAMLUtil {
+    private static final org.apache.commons.logging.Log LOG =
             org.apache.commons.logging.LogFactory.getLog(OpenSAMLUtil.class);
 
     private static XMLObjectBuilderFactory builderFactory;
     private static MarshallerFactory marshallerFactory;
     private static UnmarshallerFactory unmarshallerFactory;
     private static boolean samlEngineInitialized = false;
+    
+    private OpenSAMLUtil() {
+        // Complete
+    }
 
     /**
      * Initialise the SAML library
      */
     public synchronized static void initSamlEngine() {
         if (!samlEngineInitialized) {
-            if (log.isDebugEnabled()) {
-                log.debug("Initilizing the opensaml2 library...");
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Initilizing the opensaml2 library...");
             }
             try {
                 OpenSAMLBootstrap.bootstrap();
@@ -59,11 +63,11 @@ public class OpenSAMLUtil {
                 marshallerFactory = Configuration.getMarshallerFactory();
                 unmarshallerFactory = Configuration.getUnmarshallerFactory();
                 samlEngineInitialized = true;
-                if (log.isDebugEnabled()) {
-                    log.debug("opensaml2 library bootstrap complete");
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("opensaml2 library bootstrap complete");
                 }
             } catch (ConfigurationException e) {
-                log.error(
+                LOG.error(
                         "Unable to bootstrap the opensaml2 library - all SAML operations will fail",
                         e
                 );
@@ -79,7 +83,15 @@ public class OpenSAMLUtil {
      * @throws UnmarshallingException
      */
     public static XMLObject fromDom(Element root) throws WSSecurityException {
+        if (root == null) {
+            LOG.debug("Attempting to unmarshal a null element!");
+            throw new WSSecurityException("Error unmarshalling a SAML assertion");
+        }
         Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(root);
+        if (unmarshaller == null) {
+            LOG.debug("Unable to find an unmarshaller for element: " + root.getLocalName());
+            throw new WSSecurityException("Error unmarshalling a SAML assertion");
+        }
         try {
             return unmarshaller.unmarshall(root);
         } catch (UnmarshallingException ex) {
@@ -119,36 +131,7 @@ public class OpenSAMLUtil {
                 throw new WSSecurityException("Error marshalling a SAML assertion", ex);
             }
 
-            // Sign the assertion if the signature element is present.
-            if (xmlObject instanceof org.opensaml.saml2.core.Assertion) {
-                org.opensaml.saml2.core.Assertion saml2 =
-                        (org.opensaml.saml2.core.Assertion) xmlObject;
-                // if there is a signature, but it hasn't already been signed
-                if (saml2.getSignature() != null) {
-                    if (log.isDebugEnabled()) {
-                        log.debug("Signing SAML v2.0 assertion...");
-                    }
-                    try {
-                        Signer.signObject(saml2.getSignature());
-                    } catch (SignatureException ex) {
-                        throw new WSSecurityException("Error signing a SAML assertion", ex);
-                    }
-                }
-            } else if (xmlObject instanceof org.opensaml.saml1.core.Assertion) {
-                org.opensaml.saml1.core.Assertion saml1 =
-                        (org.opensaml.saml1.core.Assertion) xmlObject;
-                // if there is a signature, but it hasn't already been signed
-                if (saml1.getSignature() != null) {
-                    if (log.isDebugEnabled()) {
-                        log.debug("Signing SAML v1.1 assertion...");
-                    }
-                    try {
-                        Signer.signObject(saml1.getSignature());
-                    } catch (SignatureException ex) {
-                        throw new WSSecurityException("Error signing a SAML assertion", ex);
-                    }
-                }
-            }
+            signXMLObject(xmlObject);
         } finally {
             if (frag != null) {
                 while (doc.getFirstChild() != null) {
@@ -159,6 +142,65 @@ public class OpenSAMLUtil {
         }
         return element;
     }
+    
+    private static void signXMLObject(XMLObject xmlObject) throws WSSecurityException {
+        if (xmlObject instanceof org.opensaml.saml1.core.Response) {
+            org.opensaml.saml1.core.Response response = 
+                    (org.opensaml.saml1.core.Response)xmlObject;
+            
+            // Sign any Assertions
+            if (response.getAssertions() != null) {
+                for (org.opensaml.saml1.core.Assertion assertion : response.getAssertions()) {
+                    signObject(assertion.getSignature());
+                }
+            }
+            
+            signObject(response.getSignature());
+        } else if (xmlObject instanceof org.opensaml.saml2.core.Response) {
+            org.opensaml.saml2.core.Response response = 
+                    (org.opensaml.saml2.core.Response)xmlObject;
+            
+            // Sign any Assertions
+            if (response.getAssertions() != null) {
+                for (org.opensaml.saml2.core.Assertion assertion : response.getAssertions()) {
+                    signObject(assertion.getSignature());
+                }
+            }
+            
+            signObject(response.getSignature());
+        } else if (xmlObject instanceof org.opensaml.saml2.core.Assertion) {
+            org.opensaml.saml2.core.Assertion saml2 = 
+                    (org.opensaml.saml2.core.Assertion) xmlObject;
+            
+            signObject(saml2.getSignature());
+        } else if (xmlObject instanceof org.opensaml.saml1.core.Assertion) {
+            org.opensaml.saml1.core.Assertion saml1 = 
+                    (org.opensaml.saml1.core.Assertion) xmlObject;
+            
+            signObject(saml1.getSignature());
+        } else if (xmlObject instanceof org.opensaml.saml2.core.RequestAbstractType) {
+            org.opensaml.saml2.core.RequestAbstractType request = 
+                    (org.opensaml.saml2.core.RequestAbstractType) xmlObject;
+            
+            
+            signObject(request.getSignature());
+        } else if (xmlObject instanceof org.opensaml.saml1.core.Request) {
+            org.opensaml.saml1.core.Request request = 
+                    (org.opensaml.saml1.core.Request) xmlObject;
+            
+            signObject(request.getSignature());
+        }
+    }
+    
+    private static void signObject(Signature signature) throws WSSecurityException {
+        if (signature != null) {
+            try {
+                Signer.signObject(signature);
+            } catch (SignatureException ex) {
+                throw new WSSecurityException("Error signing a SAML assertion", ex);
+            }
+        }
+    }
 
     /**
      * Method buildSignature ...
@@ -170,7 +212,7 @@ public class OpenSAMLUtil {
         QName qName = Signature.DEFAULT_ELEMENT_NAME;
         XMLObjectBuilder<Signature> builder = builderFactory.getBuilder(qName);
         if (builder == null) {
-            log.error(
+            LOG.error(
                     "Unable to retrieve builder for object QName "
                             + qName
             );

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java Fri May 18 13:29:02 2012
@@ -106,6 +106,11 @@ public class SAMLAssertionWrapper {
      * Default DSA Signature algorithm used for signing.
      */
     private final String defaultDSASignatureAlgorithm = SignatureConstants.ALGO_ID_SIGNATURE_DSA;
+    
+    /**
+     * Whether this object was instantiated with a DOM Element or an XMLObject initially
+     */
+    private final boolean fromDOM;
 
     /**
      * Constructor AssertionWrapper creates a new AssertionWrapper instance.
@@ -117,6 +122,7 @@ public class SAMLAssertionWrapper {
         OpenSAMLUtil.initSamlEngine();
 
         parseElement(element);
+        fromDOM = true;
     }
 
     /**
@@ -159,6 +165,7 @@ public class SAMLAssertionWrapper {
                             + (xmlObject != null ? xmlObject.getClass().getName() : xmlObject)
             );
         }
+        fromDOM = false;
     }
 
 
@@ -167,9 +174,11 @@ public class SAMLAssertionWrapper {
 
         if (samlCallback.getAssertionElement() != null) {
             parseElement(samlCallback.getAssertionElement());
+            fromDOM = true;
         } else {
             // If not then parse the SAMLCallback object
             parseCallback(samlCallback);
+            fromDOM = false;
         }
     }
 
@@ -181,6 +190,13 @@ public class SAMLAssertionWrapper {
     }
 
     public Element toDOM(Document doc) throws WSSecurityException {
+        if (fromDOM && assertionElement != null) {
+            parseElement(assertionElement);
+            if (doc != null) {
+                return (Element)doc.importNode(assertionElement, true);
+            }
+            return assertionElement;
+        }
         assertionElement = OpenSAMLUtil.toDom(xmlObject, doc);
         return assertionElement;
     }

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ActionBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ActionBean.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ActionBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ActionBean.java Fri May 18 13:29:02 2012
@@ -23,20 +23,20 @@ package org.swssf.wss.impl.saml.bean;
 /**
  * Class SamlAction represents the raw data required by the <code>AssertionWrapper</code> when
  * creating the <code>Action</code> element of the SAML Authorization Decision Statement.
- * <p/>
+ *
  * Created on May 19, 2009
  */
 public class ActionBean {
 
-    /**
+    /** 
      * A URI reference representing the namespace in which the name of the specified action is to be
-     * interpreted. If this element is absent, the namespace
-     * urn:oasis:names:tc:SAML:1.0:action:rwedcnegation specified in Section 7.2.2 is in effect.
+     * interpreted. If this element is absent, the namespace 
+     * urn:oasis:names:tc:SAML:1.0:action:rwedcnegation specified in Section 7.2.2 is in effect.  
      */
     private String actionNamespace;
 
-    /**
-     * An action sought to be performed on the specified resource (i.e. Read, Write, Update, Delete)
+    /** 
+     * An action sought to be performed on the specified resource (i.e. Read, Write, Update, Delete) 
      */
     private String contents;
 
@@ -50,7 +50,7 @@ public class ActionBean {
      * Constructor SamlAction creates a new SamlAction instance.
      *
      * @param actionNamespace of type String
-     * @param contents        of type String
+     * @param contents of type String
      */
     public ActionBean(String actionNamespace, String contents) {
         this.actionNamespace = actionNamespace;
@@ -92,7 +92,7 @@ public class ActionBean {
     public void setContents(String contents) {
         this.contents = contents;
     }
-
+    
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
@@ -105,7 +105,7 @@ public class ActionBean {
         } else if (contents != null && !contents.equals(that.contents)) {
             return false;
         }
-
+        
         if (actionNamespace == null && that.actionNamespace != null) {
             return false;
         } else if (actionNamespace != null && !actionNamespace.equals(that.actionNamespace)) {

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeBean.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeBean.java Fri May 18 13:29:02 2012
@@ -19,8 +19,8 @@
 
 package org.swssf.wss.impl.saml.bean;
 
-import java.util.ArrayList;
 import java.util.List;
+import java.util.ArrayList;
 
 /**
  * Class SamlAttribute represents an instance of a SAML attribute.
@@ -43,9 +43,9 @@ public class AttributeBean {
 
     /**
      * Constructor SamlAttribute creates a new SamlAttribute instance.
-     *
-     * @param simpleName      of type String
-     * @param qualifiedName   of type String
+     * 
+     * @param simpleName of type String
+     * @param qualifiedName of type String
      * @param attributeValues of type List<String>
      */
     public AttributeBean(String simpleName, String qualifiedName, List<String> attributeValues) {
@@ -71,16 +71,16 @@ public class AttributeBean {
     public void setSimpleName(String simpleName) {
         this.simpleName = simpleName;
     }
-
+    
     /**
      * Method getNameFormat returns the nameFormat of this SamlAttribute object
-     *
+     * 
      * @return he nameFormat of this SamlAttribute object
      */
     public String getNameFormat() {
         return nameFormat;
     }
-
+    
     /**
      * Method setNameFormat sets the nameFormat of this SamlAttribute object.
      *
@@ -125,7 +125,7 @@ public class AttributeBean {
     public void setAttributeValues(List<String> attributeValues) {
         this.attributeValues = attributeValues;
     }
-
+    
     /**
      * Method setCustomAttributeValues sets the attributeValues of this SamlAttribute object.
      * This method allows the user to specify OpenSAML XMLObject attributes.
@@ -135,7 +135,7 @@ public class AttributeBean {
     public void setCustomAttributeValues(List<?> customAttributeValues) {
         this.customAttributeValues = customAttributeValues;
     }
-
+    
     /**
      * Method getCustomAttributeValues returns the attributeValues of this SamlAttribute object.
      *
@@ -157,26 +157,26 @@ public class AttributeBean {
         } else if (attributeValues != null && !attributeValues.equals(that.attributeValues)) {
             return false;
         }
-
+        
         if (customAttributeValues == null && that.customAttributeValues != null) {
             return false;
-        } else if (customAttributeValues != null
+        } else if (customAttributeValues != null 
                 && !customAttributeValues.equals(that.customAttributeValues)) {
             return false;
         }
-
+        
         if (qualifiedName == null && that.qualifiedName != null) {
             return false;
         } else if (qualifiedName != null && !qualifiedName.equals(that.qualifiedName)) {
             return false;
         }
-
+        
         if (nameFormat == null && that.nameFormat != null) {
             return false;
         } else if (nameFormat != null && !nameFormat.equals(that.nameFormat)) {
             return false;
         }
-
+        
         if (simpleName == null && that.simpleName != null) {
             return false;
         } else if (simpleName != null && !simpleName.equals(that.simpleName)) {

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeStatementBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeStatementBean.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeStatementBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AttributeStatementBean.java Fri May 18 13:29:02 2012
@@ -19,13 +19,13 @@
 
 package org.swssf.wss.impl.saml.bean;
 
-import java.util.ArrayList;
 import java.util.List;
+import java.util.ArrayList;
 
 
 /**
  * Class SamlAttributeStatement represents a SAML attribute statement
- * <p/>
+ *
  * Created on May 20, 2009
  */
 public class AttributeStatementBean {
@@ -38,16 +38,15 @@ public class AttributeStatementBean {
     public AttributeStatementBean() {
         attributeBeans = new ArrayList<AttributeBean>();
     }
-
+    
     /**
      * Constructor SamlAttributeStatement creates a new SamlAttributeStatement instance.
-     *
-     * @param subject        A new SubjectBean instance
+     * @param subject A new SubjectBean instance
      * @param attributeBeans A list of Attributes
      */
     public AttributeStatementBean(
-            SubjectBean subject,
-            List<AttributeBean> attributeBeans
+        SubjectBean subject,
+        List<AttributeBean> attributeBeans
     ) {
         this.subject = subject;
         this.attributeBeans = attributeBeans;
@@ -66,6 +65,7 @@ public class AttributeStatementBean {
      * Method setSamlAttributes sets the samlAttributes of this SamlAttributeStatement object.
      *
      * @param attributeBeans the samlAttributes of this SamlAttributeStatement object.
+     *
      */
     public void setSamlAttributes(List<AttributeBean> attributeBeans) {
         this.attributeBeans = attributeBeans;
@@ -73,7 +73,6 @@ public class AttributeStatementBean {
 
     /**
      * Get the Subject
-     *
      * @return the Subject
      */
     public SubjectBean getSubject() {
@@ -82,7 +81,6 @@ public class AttributeStatementBean {
 
     /**
      * Set the Subject
-     *
      * @param subject the SubjectBean instance to set
      */
     public void setSubject(SubjectBean subject) {
@@ -101,7 +99,7 @@ public class AttributeStatementBean {
         } else if (attributeBeans != null && !attributeBeans.equals(that.attributeBeans)) {
             return false;
         }
-
+        
         if (subject == null && that.subject != null) {
             return false;
         } else if (subject != null && !subject.equals(that.subject)) {

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthDecisionStatementBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthDecisionStatementBean.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthDecisionStatementBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthDecisionStatementBean.java Fri May 18 13:29:02 2012
@@ -19,47 +19,45 @@
 
 package org.swssf.wss.impl.saml.bean;
 
-import java.util.ArrayList;
 import java.util.List;
+import java.util.ArrayList;
 
 
 /**
  * Class SamlDecision represents the raw data to be used by the <code>AssertionWrapper</code> when
  * creating SAML Authorization Decision Statements.
- * <p/>
+ *
  * Created on May 19, 2009
  */
 public class AuthDecisionStatementBean {
 
-    /**
-     * The SAML subject
+    /** 
+     * The SAML subject  
      */
     private SubjectBean subject;
 
-    /**
-     * enum representing the possible decision types as specified in the SAML spec
+    /** 
+     * enum representing the possible decision types as specified in the SAML spec 
      */
-    public enum Decision {
-        PERMIT, INDETERMINATE, DENY
-    }
+    public enum Decision {PERMIT, INDETERMINATE, DENY}
 
-    /**
-     * The decision rendered by the SAML authority with respect to the specified resource
+    /** 
+     * The decision rendered by the SAML authority with respect to the specified resource 
      */
     private Decision decision;
 
-    /**
-     * A URI reference identifying the resource to which access authorization is sought
+    /** 
+     * A URI reference identifying the resource to which access authorization is sought 
      */
     private String resource;
 
-    /**
-     * The set of actions authorized to be performed on the specified resource (one or more)
+    /** 
+     * The set of actions authorized to be performed on the specified resource (one or more) 
      */
     private List<ActionBean> actionBeans;
 
-    /**
-     * A set of assertions that the SAML authority relied on in making the decision (optional)
+    /** 
+     * A set of assertions that the SAML authority relied on in making the decision (optional) 
      */
     private Object evidence;
 
@@ -73,18 +71,18 @@ public class AuthDecisionStatementBean {
     /**
      * Constructor SamlDecision creates a new SamlDecision instance.
      *
-     * @param decision    of type Decision
-     * @param resource    of type String
-     * @param subject     of type SubjectBean
-     * @param evidence    of type Object
+     * @param decision of type Decision
+     * @param resource of type String
+     * @param subject of type SubjectBean
+     * @param evidence of type Object
      * @param actionBeans of type List<SamlAction>
      */
     public AuthDecisionStatementBean(
-            Decision decision,
-            String resource,
-            SubjectBean subject,
-            Object evidence,
-            List<ActionBean> actionBeans
+        Decision decision, 
+        String resource, 
+        SubjectBean subject,
+        Object evidence,
+        List<ActionBean> actionBeans
     ) {
         this.decision = decision;
         this.resource = resource;
@@ -167,7 +165,6 @@ public class AuthDecisionStatementBean {
 
     /**
      * Get the Subject
-     *
      * @return the Subject
      */
     public SubjectBean getSubject() {
@@ -176,13 +173,12 @@ public class AuthDecisionStatementBean {
 
     /**
      * Set the Subject
-     *
      * @param subject the SubjectBean instance to set
      */
     public void setSubject(SubjectBean subject) {
         this.subject = subject;
     }
-
+    
     @Override
     public boolean equals(Object o) {
         if (this == o) return true;
@@ -195,25 +191,25 @@ public class AuthDecisionStatementBean {
         } else if (subject != null && !subject.equals(that.subject)) {
             return false;
         }
-
+        
         if (decision == null && that.decision != null) {
             return false;
         } else if (decision != null && !decision.equals(that.decision)) {
             return false;
         }
-
+        
         if (evidence == null && that.evidence != null) {
             return false;
         } else if (evidence != null && !evidence.equals(that.evidence)) {
             return false;
         }
-
+        
         if (actionBeans == null && that.actionBeans != null) {
             return false;
         } else if (actionBeans != null && !actionBeans.equals(that.actionBeans)) {
             return false;
         }
-
+        
         if (resource == null && that.resource != null) {
             return false;
         } else if (resource != null && !resource.equals(that.resource)) {

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthenticationStatementBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthenticationStatementBean.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthenticationStatementBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/AuthenticationStatementBean.java Fri May 18 13:29:02 2012
@@ -25,7 +25,7 @@ import org.joda.time.DateTime;
 /**
  * Class AuthenticationStatementBean represents the raw data required to create
  * a SAML v1.1 or v2.0 authentication statement.
- * <p/>
+ *
  * Created on May 20, 2009
  */
 public class AuthenticationStatementBean {
@@ -43,15 +43,15 @@ public class AuthenticationStatementBean
 
     /**
      * Construct a new AuthenticationStatementBean
-     *
-     * @param subject               the Subject to set
-     * @param authenticationMethod  the Authentication Method to set
+     * 
+     * @param subject the Subject to set 
+     * @param authenticationMethod the Authentication Method to set
      * @param authenticationInstant the Authentication Instant to set
      */
     public AuthenticationStatementBean(
-            SubjectBean subject,
-            String authenticationMethod,
-            DateTime authenticationInstant
+        SubjectBean subject, 
+        String authenticationMethod,
+        DateTime authenticationInstant
     ) {
         this.subject = subject;
         this.authenticationMethod = authenticationMethod;
@@ -60,7 +60,6 @@ public class AuthenticationStatementBean
 
     /**
      * Get the Subject
-     *
      * @return the subject
      */
     public SubjectBean getSubject() {
@@ -69,7 +68,6 @@ public class AuthenticationStatementBean
 
     /**
      * Set the subject
-     *
      * @param subject the SubjectBean instance to set
      */
     public void setSubject(SubjectBean subject) {
@@ -78,7 +76,6 @@ public class AuthenticationStatementBean
 
     /**
      * Get the authentication method
-     *
      * @return the authentication method
      */
     public String getAuthenticationMethod() {
@@ -87,7 +84,6 @@ public class AuthenticationStatementBean
 
     /**
      * Set the authentication method
-     *
      * @param authenticationMethod the authentication method
      */
     public void setAuthenticationMethod(String authenticationMethod) {
@@ -96,7 +92,6 @@ public class AuthenticationStatementBean
 
     /**
      * Get the authentication instant
-     *
      * @return the authentication instant
      */
     public DateTime getAuthenticationInstant() {
@@ -105,16 +100,15 @@ public class AuthenticationStatementBean
 
     /**
      * Set the authentication instant
-     *
      * @param authenticationInstant the authentication instant
      */
     public void setAuthenticationInstant(DateTime authenticationInstant) {
         this.authenticationInstant = authenticationInstant;
     }
-
+    
     /**
      * Get Subject Locality.
-     *
+     * 
      * @return the subjectLocality
      */
     public final SubjectLocalityBean getSubjectLocality() {
@@ -123,16 +117,16 @@ public class AuthenticationStatementBean
 
     /**
      * Set Subject Locality.
-     *
+     * 
      * @param subjectLocality the subjectLocality to set
      */
     public final void setSubjectLocality(final SubjectLocalityBean subjectLocality) {
         this.subjectLocality = subjectLocality;
     }
-
+    
     /**
      * Get the session index.
-     *
+     * 
      * @return the sessionIndex
      */
     public final String getSessionIndex() {
@@ -141,7 +135,7 @@ public class AuthenticationStatementBean
 
     /**
      * Set the session index.
-     *
+     * 
      * @param sessionIndex the sessionIndex to set
      */
     public final void setSessionIndex(final String sessionIndex) {
@@ -157,25 +151,25 @@ public class AuthenticationStatementBean
 
         if (authenticationInstant == null && that.authenticationInstant != null) {
             return false;
-        } else if (authenticationInstant != null
-                && !authenticationInstant.equals(that.authenticationInstant)) {
+        } else if (authenticationInstant != null 
+            && !authenticationInstant.equals(that.authenticationInstant)) {
             return false;
         }
-
+        
         if (authenticationMethod == null && that.authenticationMethod != null) {
             return false;
-        } else if (authenticationMethod != null
-                && !authenticationMethod.equals(that.authenticationMethod)) {
+        } else if (authenticationMethod != null 
+            && !authenticationMethod.equals(that.authenticationMethod)) {
             return false;
         }
-
+        
         if (subject == null && that.subject != null) {
             return false;
-        } else if (subject != null
-                && !subject.equals(that.subject)) {
+        } else if (subject != null 
+            && !subject.equals(that.subject)) {
             return false;
         }
-
+        
         if (subjectLocality == null && that.subjectLocality != null) {
             return false;
         } else if (subjectLocality != null && !subjectLocality.equals(that.subjectLocality)) {

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ConditionsBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ConditionsBean.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ConditionsBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/ConditionsBean.java Fri May 18 13:29:02 2012
@@ -25,7 +25,7 @@ import org.joda.time.DateTime;
 /**
  * Class ConditionsBean represents a SAML Conditions object (can be used to create
  * both SAML v1.1 and v2.0 statements)
- * <p/>
+ *
  * Created on May 20, 2009
  */
 public class ConditionsBean {
@@ -44,27 +44,27 @@ public class ConditionsBean {
      * Constructor ConditionsBean creates a new ConditionsBean instance.
      *
      * @param notBefore The notBefore instance
-     * @param notAfter  The notAfter instance
+     * @param notAfter The notAfter instance
      */
     public ConditionsBean(
-            DateTime notBefore,
-            DateTime notAfter
+        DateTime notBefore, 
+        DateTime notAfter
     ) {
         this.notBefore = notBefore;
         this.notAfter = notAfter;
     }
-
+    
     /**
      * Constructor ConditionsBean creates a new ConditionsBean instance.
      *
      * @param tokenPeriodMinutes how long the token is valid for in minutes
      */
     public ConditionsBean(
-            int tokenPeriodMinutes
+        int tokenPeriodMinutes
     ) {
         this.tokenPeriodMinutes = tokenPeriodMinutes;
     }
-
+    
     /**
      * Get the notBefore instance
      *
@@ -82,7 +82,7 @@ public class ConditionsBean {
     public void setNotBefore(DateTime notBefore) {
         this.notBefore = notBefore;
     }
-
+    
     /**
      * Get the notAfter instance
      *
@@ -100,7 +100,7 @@ public class ConditionsBean {
     public void setNotAfter(DateTime notAfter) {
         this.notAfter = notAfter;
     }
-
+    
     /**
      * Get the tokenPeriodMinutes of this object.
      *
@@ -118,7 +118,7 @@ public class ConditionsBean {
     public void setTokenPeriodMinutes(int tokenPeriodMinutes) {
         this.tokenPeriodMinutes = tokenPeriodMinutes;
     }
-
+    
     /**
      * Get the audienceURI instance
      *
@@ -151,23 +151,23 @@ public class ConditionsBean {
         ConditionsBean that = (ConditionsBean) o;
 
         if (tokenPeriodMinutes != that.tokenPeriodMinutes) return false;
-
+        
         if (notBefore == null && that.notBefore != null) {
             return false;
         } else if (notBefore != null && !notBefore.equals(that.notBefore)) {
             return false;
         }
-
+        
         if (notAfter == null && that.notAfter != null) {
             return false;
         } else if (notAfter != null && !notAfter.equals(that.notAfter)) {
-            return false;
+            return false; 
         }
-
+        
         if (audienceURI == null && that.audienceURI != null) {
             return false;
         } else if (audienceURI != null && !audienceURI.equals(that.audienceURI)) {
-            return false;
+            return false; 
         }
 
         return true;

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/KeyInfoBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/KeyInfoBean.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/KeyInfoBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/KeyInfoBean.java Fri May 18 13:29:02 2012
@@ -19,21 +19,21 @@
 
 package org.swssf.wss.impl.saml.bean;
 
-import org.w3c.dom.Element;
-
 import java.security.PublicKey;
 import java.security.cert.X509Certificate;
 
+import org.w3c.dom.Element;
+
 
 /**
  * Class KeyInfoBean represents a KeyInfo structure that will be embedded in a SAML Subject.
  */
 public class KeyInfoBean {
-
+    
     public enum CERT_IDENTIFIER {
         X509_CERT, X509_ISSUER_SERIAL, KEY_VALUE
     }
-
+    
     private X509Certificate cert;
     private CERT_IDENTIFIER certIdentifier = CERT_IDENTIFIER.X509_CERT;
     private PublicKey publicKey;
@@ -62,7 +62,7 @@ public class KeyInfoBean {
     public void setCertificate(X509Certificate cert) {
         this.cert = cert;
     }
-
+    
     /**
      * Method getPublicKey returns the public key of this KeyInfoBean object.
      *
@@ -80,7 +80,7 @@ public class KeyInfoBean {
     public void setPublicKey(PublicKey publicKey) {
         this.publicKey = publicKey;
     }
-
+    
     /**
      * Method getCertIdentifer returns the cert identifer of this KeyInfoBean object.
      *
@@ -98,7 +98,7 @@ public class KeyInfoBean {
     public void setCertIdentifer(CERT_IDENTIFIER certIdentifier) {
         this.certIdentifier = certIdentifier;
     }
-
+    
     /**
      * Method getElement returns the DOM Element of this KeyInfoBean object.
      *
@@ -116,7 +116,7 @@ public class KeyInfoBean {
     public void setElement(Element keyInfoElement) {
         this.keyInfoElement = keyInfoElement;
     }
-
+    
     /**
      * Method equals ...
      *
@@ -136,13 +136,13 @@ public class KeyInfoBean {
         } else if (cert != null && !cert.equals(that.cert)) {
             return false;
         }
-
+        
         if (publicKey == null && that.publicKey != null) {
             return false;
         } else if (publicKey != null && !publicKey.equals(that.publicKey)) {
             return false;
         }
-
+        
         if (keyInfoElement == null && that.keyInfoElement != null) {
             return false;
         } else if (keyInfoElement != null && !keyInfoElement.equals(that.keyInfoElement)) {

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectBean.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectBean.java Fri May 18 13:29:02 2012
@@ -24,7 +24,7 @@ import org.swssf.wss.impl.saml.builder.S
 /**
  * Class SubjectBean represents a SAML subject (can be used to create
  * both SAML v1.1 and v2.0 statements)
- * <p/>
+ *
  * Created on May 20, 2009
  */
 public class SubjectBean {
@@ -33,6 +33,7 @@ public class SubjectBean {
     private String subjectNameQualifier;
     private String subjectConfirmationMethod;
     private KeyInfoBean keyInfo;
+    private SubjectConfirmationDataBean subjectConfirmationData;
 
     /**
      * Constructor SubjectBean creates a new SubjectBean instance.
@@ -43,33 +44,33 @@ public class SubjectBean {
     /**
      * Constructor SubjectBean creates a new SubjectBean instance.
      *
-     * @param subjectName               of type String
-     * @param subjectNameQualifier      of type String
+     * @param subjectName of type String
+     * @param subjectNameQualifier of type String
      * @param subjectConfirmationMethod of type String
      */
     public SubjectBean(
-            String subjectName,
-            String subjectNameQualifier,
-            String subjectConfirmationMethod
+        String subjectName, 
+        String subjectNameQualifier, 
+        String subjectConfirmationMethod
     ) {
         this.subjectName = subjectName;
         this.subjectNameQualifier = subjectNameQualifier;
         this.subjectConfirmationMethod = subjectConfirmationMethod;
     }
-
+    
     /**
      * Constructor SubjectBean creates a new SubjectBean instance.
      *
-     * @param subjectName               of type String
-     * @param subjectNameQualifier      of type String
+     * @param subjectName of type String
+     * @param subjectNameQualifier of type String
      * @param subjectConfirmationMethod of type String
-     * @param subjectNameIDFormat       of type String
+     * @param subjectNameIDFormat of type String
      */
     public SubjectBean(
-            String subjectName,
-            String subjectNameQualifier,
-            String subjectConfirmationMethod,
-            String subjectNameIDFormat
+        String subjectName, 
+        String subjectNameQualifier, 
+        String subjectConfirmationMethod,
+        String subjectNameIDFormat
     ) {
         this(subjectName, subjectNameQualifier, subjectConfirmationMethod);
         this.subjectNameIDFormat = subjectNameIDFormat;
@@ -92,7 +93,7 @@ public class SubjectBean {
     public void setSubjectName(String subjectName) {
         this.subjectName = subjectName;
     }
-
+    
     /**
      * Method getSubjectNameQualifier returns the subjectNameQualifier of this SubjectBean object.
      *
@@ -110,7 +111,7 @@ public class SubjectBean {
     public void setSubjectNameQualifier(String subjectNameQualifier) {
         this.subjectNameQualifier = subjectNameQualifier;
     }
-
+    
     /**
      * Method getSubjectConfirmationMethod returns the subjectConfirmationMethod of
      * this SubjectBean object.
@@ -125,15 +126,15 @@ public class SubjectBean {
      * Method setSubjectConfirmationMethod sets the subjectConfirmationMethod of
      * this SubjectBean object.
      *
-     * @param subjectConfirmationMethod the subjectConfirmationMethod of this
-     *                                  SubjectBean object.
+     * @param subjectConfirmationMethod the subjectConfirmationMethod of this 
+     *        SubjectBean object.
      */
     public void setSubjectConfirmationMethod(String subjectConfirmationMethod) {
         this.subjectConfirmationMethod = subjectConfirmationMethod;
     }
-
+    
     /**
-     * Method getSubjectNameIDFormat returns the subjectNameIDFormat of this SubjectBean
+     * Method getSubjectNameIDFormat returns the subjectNameIDFormat of this SubjectBean 
      * object.
      *
      * @return the subjectNameIDFormat (type String) of this SubjectBean object.
@@ -143,7 +144,7 @@ public class SubjectBean {
     }
 
     /**
-     * Method setSubjectNameIDFormat sets the subjectNameIDFormat of this SubjectBean
+     * Method setSubjectNameIDFormat sets the subjectNameIDFormat of this SubjectBean 
      * object.
      *
      * @param subjectNameIDFormat the subjectNameIDFormat of this SubjectBean object.
@@ -151,7 +152,7 @@ public class SubjectBean {
     public void setSubjectNameIDFormat(String subjectNameIDFormat) {
         this.subjectNameIDFormat = subjectNameIDFormat;
     }
-
+    
     /**
      * Method getKeyInfo returns the keyInfo of this SubjectBean object.
      *
@@ -169,8 +170,26 @@ public class SubjectBean {
     public void setKeyInfo(KeyInfoBean keyInfo) {
         this.keyInfo = keyInfo;
     }
+    
+    /**
+     * Set the SubjectConfirmationData of this SubjectBean object
+     * @return the SubjectConfirmationData of this SubjectBean object
+     */
+    public SubjectConfirmationDataBean getSubjectConfirmationData() {
+        return subjectConfirmationData;
+    }
 
     /**
+     * Get the SubjectConfirmationData of this SubjectBean object
+     * @param subjectConfirmationData the SubjectConfirmationData of this SubjectBean object
+     */
+    public void setSubjectConfirmationData(
+        SubjectConfirmationDataBean subjectConfirmationData
+    ) {
+        this.subjectConfirmationData = subjectConfirmationData;
+    }
+    
+    /**
      * Method equals ...
      *
      * @param o of type Object
@@ -188,33 +207,40 @@ public class SubjectBean {
         } else if (subjectName != null && !subjectName.equals(that.subjectName)) {
             return false;
         }
-
+        
         if (subjectNameQualifier == null && that.subjectNameQualifier != null) {
             return false;
-        } else if (subjectNameQualifier != null &&
-                !subjectNameQualifier.equals(that.subjectNameQualifier)) {
+        } else if (subjectNameQualifier != null && 
+            !subjectNameQualifier.equals(that.subjectNameQualifier)) {
             return false;
         }
-
+        
         if (subjectConfirmationMethod == null && that.subjectConfirmationMethod != null) {
             return false;
-        } else if (subjectConfirmationMethod != null &&
-                !subjectConfirmationMethod.equals(that.subjectConfirmationMethod)) {
+        } else if (subjectConfirmationMethod != null && 
+            !subjectConfirmationMethod.equals(that.subjectConfirmationMethod)) {
             return false;
         }
-
+        
         if (subjectNameIDFormat == null && that.subjectNameIDFormat != null) {
             return false;
-        } else if (subjectNameIDFormat != null
-                && !subjectNameIDFormat.equals(that.subjectNameIDFormat)) {
+        } else if (subjectNameIDFormat != null 
+            && !subjectNameIDFormat.equals(that.subjectNameIDFormat)) {
             return false;
         }
-
+        
         if (keyInfo == null && that.keyInfo != null) {
             return false;
         } else if (keyInfo != null && !keyInfo.equals(that.keyInfo)) {
             return false;
         }
+        
+        if (subjectConfirmationData == null && that.subjectConfirmationData != null) {
+            return false;
+        } else if (subjectConfirmationData != null 
+            && !subjectConfirmationData.equals(that.subjectConfirmationData)) {
+            return false;
+        }
 
         return true;
     }
@@ -240,6 +266,10 @@ public class SubjectBean {
         if (keyInfo != null) {
             result = 31 * result + keyInfo.hashCode();
         }
+        if (subjectConfirmationData != null) {
+            result = 31 * result + subjectConfirmationData.hashCode();
+        }
         return result;
     }
+
 }

Added: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectConfirmationDataBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectConfirmationDataBean.java?rev=1340089&view=auto
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectConfirmationDataBean.java (added)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectConfirmationDataBean.java Fri May 18 13:29:02 2012
@@ -0,0 +1,191 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.swssf.wss.impl.saml.bean;
+
+import org.joda.time.DateTime;
+
+/**
+ * Class SubjectConfirmationDataBean represents a SAML (2) SubjectConfirmationData. Please note that
+ * KeyInfo functionality is in SubjectBean for backwards compatibility reasons.
+ */
+public class SubjectConfirmationDataBean {
+    private String recipient;
+    private String address;
+    private String inResponseTo;
+    private DateTime notBefore;
+    private DateTime notAfter;
+
+    /**
+     * Constructor SubjectConfirmationDataBean creates a new SubjectConfirmationDataBean instance.
+     */
+    public SubjectConfirmationDataBean() {
+    }
+
+    /**
+     * Get the recipient of the SubjectConfirmationDataBean
+     * @return the recipient of the SubjectConfirmationDataBean
+     */
+    public String getRecipient() {
+        return recipient;
+    }
+
+    /**
+     * Set the recipient of the SubjectConfirmationDataBean
+     * @param recipient the recipient of the SubjectConfirmationDataBean
+     */
+    public void setRecipient(String recipient) {
+        this.recipient = recipient;
+    }
+
+    /**
+     * Get the address of the SubjectConfirmationDataBean
+     * @return the address of the SubjectConfirmationDataBean
+     */
+    public String getAddress() {
+        return address;
+    }
+
+    /**
+     * Set the address of the SubjectConfirmationDataBean
+     * @param address the address of the SubjectConfirmationDataBean
+     */
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    /**
+     * Get the InResponseTo element of the SubjectConfirmationDataBean
+     * @return the InResponseTo element of the SubjectConfirmationDataBean
+     */
+    public String getInResponseTo() {
+        return inResponseTo;
+    }
+
+    /**
+     * Set the InResponseTo element of the SubjectConfirmationDataBean
+     * @param inResponseTo the InResponseTo element of the SubjectConfirmationDataBean
+     */
+    public void setInResponseTo(String inResponseTo) {
+        this.inResponseTo = inResponseTo;
+    }
+
+    /**
+     * Get the NotBefore time of the SubjectConfirmationDataBean
+     * @return the NotBefore time of the SubjectConfirmationDataBean
+     */
+    public DateTime getNotBefore() {
+        return notBefore;
+    }
+
+    /**
+     * Set the NotBefore time of the SubjectConfirmationDataBean
+     * @param notBefore the NotBefore time of the SubjectConfirmationDataBean
+     */
+    public void setNotBefore(DateTime notBefore) {
+        this.notBefore = notBefore;
+    }
+
+    /**
+     * Get the NotOnOrAfter time of the SubjectConfirmationDataBean
+     * @return the NotOnOrAfter time of the SubjectConfirmationDataBean
+     */
+    public DateTime getNotAfter() {
+        return notAfter;
+    }
+
+    /**
+     * Set the NotOnOrAfter time of the SubjectConfirmationDataBean
+     * @param notAfter the NotOnOrAfter time of the SubjectConfirmationDataBean
+     */
+    public void setNotAfter(DateTime notAfter) {
+        this.notAfter = notAfter;
+    }
+    
+    /**
+     * Method equals ...
+     *
+     * @param o of type Object
+     * @return boolean
+     */
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (!(o instanceof SubjectConfirmationDataBean)) return false;
+
+        SubjectConfirmationDataBean that = (SubjectConfirmationDataBean) o;
+
+        if (recipient == null && that.recipient != null) {
+            return false;
+        } else if (recipient != null && !recipient.equals(that.recipient)) {
+            return false;
+        }
+        
+        if (address == null && that.address != null) {
+            return false;
+        } else if (address != null && !address.equals(that.address)) {
+            return false;
+        }
+        
+        if (inResponseTo == null && that.inResponseTo != null) {
+            return false;
+        } else if (inResponseTo != null && !inResponseTo.equals(that.inResponseTo)) {
+            return false;
+        }
+        
+        if (notBefore == null && that.notBefore != null) {
+            return false;
+        } else if (notBefore != null && !notBefore.equals(that.notBefore)) {
+            return false;
+        }
+        
+        if (notAfter == null && that.notAfter != null) {
+            return false;
+        } else if (notAfter != null && !notAfter.equals(that.notAfter)) {
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * @return the hashcode of this object
+     */
+    @Override
+    public int hashCode() {
+        int result = 0;
+        if (recipient != null) {
+            result = recipient.hashCode();
+        }
+        if (address != null) {
+            result = 31 * result + address.hashCode();
+        }
+        if (inResponseTo != null) {
+            result = 31 * result + inResponseTo.hashCode();
+        }
+        if (notBefore != null) {
+            result = 31 * result + notBefore.hashCode();
+        }
+        if (notAfter != null) {
+            result = 31 * result + notAfter.hashCode();
+        }
+        return result;
+    }
+
+}

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectLocalityBean.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectLocalityBean.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectLocalityBean.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/bean/SubjectLocalityBean.java Fri May 18 13:29:02 2012
@@ -24,14 +24,10 @@ package org.swssf.wss.impl.saml.bean;
  */
 public class SubjectLocalityBean {
 
-    /**
-     * The ipAddress.
-     */
+    /** The ipAddress. */
     private String ipAddress;
 
-    /**
-     * The DNS Address.
-     */
+    /** The DNS Address. */
     private String dnsAddress;
 
     /**
@@ -44,8 +40,8 @@ public class SubjectLocalityBean {
 
     /**
      * Constructor for creating a SubjectLocalityBean with ip and dns addresses.
-     *
-     * @param ipAddress  ip address
+     * 
+     * @param ipAddress ip address
      * @param dnsAddress dns address
      */
     public SubjectLocalityBean(final String ipAddress, final String dnsAddress) {
@@ -55,7 +51,7 @@ public class SubjectLocalityBean {
 
     /**
      * Get the ip address.
-     *
+     * 
      * @return the ipAddress
      */
     public final String getIpAddress() {
@@ -64,7 +60,7 @@ public class SubjectLocalityBean {
 
     /**
      * Set the ip address.
-     *
+     * 
      * @param ipAddress the ipAddress to set
      */
     public final void setIpAddress(final String ipAddress) {
@@ -73,7 +69,7 @@ public class SubjectLocalityBean {
 
     /**
      * Get the dns address.
-     *
+     * 
      * @return the dnsAddress
      */
     public final String getDnsAddress() {
@@ -82,7 +78,7 @@ public class SubjectLocalityBean {
 
     /**
      * Set the dns address.
-     *
+     * 
      * @param dnsAddress the dnsAddress to set
      */
     public final void setDnsAddress(final String dnsAddress) {

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java?rev=1340089&r1=1340088&r2=1340089&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java Fri May 18 13:29:02 2012
@@ -23,7 +23,25 @@ import org.joda.time.DateTime;
 import org.opensaml.Configuration;
 import org.opensaml.common.SAMLObjectBuilder;
 import org.opensaml.common.SAMLVersion;
-import org.opensaml.saml1.core.*;
+
+import org.opensaml.saml1.core.Action;
+import org.opensaml.saml1.core.Assertion;
+import org.opensaml.saml1.core.Attribute;
+import org.opensaml.saml1.core.AttributeStatement;
+import org.opensaml.saml1.core.AttributeValue;
+import org.opensaml.saml1.core.Audience;
+import org.opensaml.saml1.core.AudienceRestrictionCondition;
+import org.opensaml.saml1.core.AuthenticationStatement;
+import org.opensaml.saml1.core.AuthorizationDecisionStatement;
+import org.opensaml.saml1.core.Conditions;
+import org.opensaml.saml1.core.ConfirmationMethod;
+import org.opensaml.saml1.core.DecisionTypeEnumeration;
+import org.opensaml.saml1.core.Evidence;
+import org.opensaml.saml1.core.NameIdentifier;
+import org.opensaml.saml1.core.Subject;
+import org.opensaml.saml1.core.SubjectConfirmation;
+import org.opensaml.saml1.core.SubjectLocality;
+
 import org.opensaml.xml.XMLObject;
 import org.opensaml.xml.XMLObjectBuilderFactory;
 import org.opensaml.xml.schema.XSString;
@@ -33,7 +51,15 @@ import org.opensaml.xml.security.x509.X5
 import org.opensaml.xml.signature.KeyInfo;
 import org.swssf.wss.ext.WSSecurityException;
 import org.swssf.wss.impl.saml.OpenSAMLUtil;
-import org.swssf.wss.impl.saml.bean.*;
+import org.swssf.wss.impl.saml.bean.ActionBean;
+import org.swssf.wss.impl.saml.bean.AttributeBean;
+import org.swssf.wss.impl.saml.bean.AttributeStatementBean;
+import org.swssf.wss.impl.saml.bean.AuthDecisionStatementBean;
+import org.swssf.wss.impl.saml.bean.AuthenticationStatementBean;
+import org.swssf.wss.impl.saml.bean.ConditionsBean;
+import org.swssf.wss.impl.saml.bean.KeyInfoBean;
+import org.swssf.wss.impl.saml.bean.SubjectBean;
+import org.swssf.wss.impl.saml.bean.SubjectLocalityBean;
 import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import java.util.ArrayList;
@@ -45,43 +71,47 @@ import java.util.List;
  * <p/>
  * Created on May 18, 2009
  */
-public class SAML1ComponentBuilder {
-
-    private static SAMLObjectBuilder<Assertion> assertionV1Builder;
-
-    private static SAMLObjectBuilder<Conditions> conditionsV1Builder;
-
-    private static SAMLObjectBuilder<AudienceRestrictionCondition> audienceRestrictionV1Builder;
-
-    private static SAMLObjectBuilder<Audience> audienceV1Builder;
-
-    private static SAMLObjectBuilder<AuthenticationStatement> authenticationStatementV1Builder;
-
-    private static SAMLObjectBuilder<Subject> subjectV1Builder;
-
-    private static SAMLObjectBuilder<NameIdentifier> nameIdentifierV1Builder;
-
-    private static SAMLObjectBuilder<SubjectConfirmation>
-            subjectConfirmationV1Builder;
-
-    private static SAMLObjectBuilder<ConfirmationMethod> confirmationMethodV1Builder;
-
-    private static SAMLObjectBuilder<AttributeStatement>
-            attributeStatementV1Builder;
-
-    private static SAMLObjectBuilder<Attribute> attributeV1Builder;
-
-    private static XSStringBuilder stringBuilder;
-
-    private static SAMLObjectBuilder<AuthorizationDecisionStatement>
-            authorizationDecisionStatementV1Builder;
-
-    private static SAMLObjectBuilder<Action> actionElementV1Builder;
-
-    private static XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
-
-    private static SAMLObjectBuilder<SubjectLocality> subjectLocalityBuilder;
+public final class SAML1ComponentBuilder {
+    
+    private static volatile SAMLObjectBuilder<Assertion> assertionV1Builder;
+    
+    private static volatile SAMLObjectBuilder<Conditions> conditionsV1Builder;
+    
+    private static volatile SAMLObjectBuilder<AudienceRestrictionCondition> audienceRestrictionV1Builder;
+    
+    private static volatile SAMLObjectBuilder<Audience> audienceV1Builder;
+    
+    private static volatile SAMLObjectBuilder<AuthenticationStatement> authenticationStatementV1Builder;
+    
+    private static volatile SAMLObjectBuilder<Subject> subjectV1Builder;
+    
+    private static volatile SAMLObjectBuilder<NameIdentifier> nameIdentifierV1Builder;
+    
+    private static volatile SAMLObjectBuilder<SubjectConfirmation> 
+        subjectConfirmationV1Builder;
+    
+    private static volatile SAMLObjectBuilder<ConfirmationMethod> confirmationMethodV1Builder;
+    
+    private static volatile SAMLObjectBuilder<AttributeStatement> 
+        attributeStatementV1Builder;
+    
+    private static volatile SAMLObjectBuilder<Attribute> attributeV1Builder;
+    
+    private static volatile XSStringBuilder stringBuilder;
+    
+    private static volatile SAMLObjectBuilder<AuthorizationDecisionStatement> 
+        authorizationDecisionStatementV1Builder;
+    
+    private static volatile SAMLObjectBuilder<Action> actionElementV1Builder;
+    
+    private static volatile XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
+    
+    private static volatile SAMLObjectBuilder<SubjectLocality> subjectLocalityBuilder;
 
+    private SAML1ComponentBuilder() {
+        // Complete
+    }
+    
     /**
      * Create a new SAML 1.1 assertion
      *
@@ -91,20 +121,20 @@ public class SAML1ComponentBuilder {
     @SuppressWarnings("unchecked")
     public static Assertion createSamlv1Assertion(String issuer) {
         if (assertionV1Builder == null) {
-            assertionV1Builder = (SAMLObjectBuilder<Assertion>)
-                    builderFactory.getBuilder(Assertion.DEFAULT_ELEMENT_NAME);
+            assertionV1Builder = (SAMLObjectBuilder<Assertion>) 
+                builderFactory.getBuilder(Assertion.DEFAULT_ELEMENT_NAME);
             if (assertionV1Builder == null) {
                 throw new IllegalStateException(
-                        "OpenSaml engine not initialized. Please make sure to initialize the OpenSaml "
-                                + "engine prior using it"
+                    "OpenSaml engine not initialized. Please make sure to initialize the OpenSaml "
+                    + "engine prior using it"
                 );
             }
         }
-        Assertion assertion =
-                assertionV1Builder.buildObject(
-                        Assertion.DEFAULT_ELEMENT_NAME,
-                        Assertion.TYPE_NAME
-                );
+        Assertion assertion = 
+            assertionV1Builder.buildObject(
+                Assertion.DEFAULT_ELEMENT_NAME, 
+                Assertion.TYPE_NAME
+            );
         assertion.setVersion(SAMLVersion.VERSION_11);
         assertion.setIssuer(issuer);
         assertion.setIssueInstant(new DateTime()); // now
@@ -120,40 +150,40 @@ public class SAML1ComponentBuilder {
      * @return A Saml 1.1 subject
      */
     @SuppressWarnings("unchecked")
-    public static Subject createSaml1v1Subject(SubjectBean subjectBean)
-            throws org.opensaml.xml.security.SecurityException, WSSecurityException {
+    public static Subject createSaml1v1Subject(SubjectBean subjectBean) 
+        throws org.opensaml.xml.security.SecurityException, WSSecurityException {
         if (subjectV1Builder == null) {
-            subjectV1Builder = (SAMLObjectBuilder<Subject>)
-                    builderFactory.getBuilder(Subject.DEFAULT_ELEMENT_NAME);
+            subjectV1Builder = (SAMLObjectBuilder<Subject>) 
+                builderFactory.getBuilder(Subject.DEFAULT_ELEMENT_NAME);
         }
         if (nameIdentifierV1Builder == null) {
             nameIdentifierV1Builder = (SAMLObjectBuilder<NameIdentifier>)
-                    builderFactory.getBuilder(NameIdentifier.DEFAULT_ELEMENT_NAME);
+                builderFactory.getBuilder(NameIdentifier.DEFAULT_ELEMENT_NAME);
         }
         if (subjectConfirmationV1Builder == null) {
             subjectConfirmationV1Builder = (SAMLObjectBuilder<SubjectConfirmation>)
-                    builderFactory.getBuilder(SubjectConfirmation.DEFAULT_ELEMENT_NAME);
-
+                builderFactory.getBuilder(SubjectConfirmation.DEFAULT_ELEMENT_NAME);
+            
         }
         if (confirmationMethodV1Builder == null) {
             confirmationMethodV1Builder = (SAMLObjectBuilder<ConfirmationMethod>)
-                    builderFactory.getBuilder(ConfirmationMethod.DEFAULT_ELEMENT_NAME);
+                builderFactory.getBuilder(ConfirmationMethod.DEFAULT_ELEMENT_NAME);
         }
-
+        
         Subject subject = subjectV1Builder.buildObject();
         NameIdentifier nameIdentifier = nameIdentifierV1Builder.buildObject();
         SubjectConfirmation subjectConfirmation = subjectConfirmationV1Builder.buildObject();
         ConfirmationMethod confirmationMethod = confirmationMethodV1Builder.buildObject();
-
+        
         nameIdentifier.setNameQualifier(subjectBean.getSubjectNameQualifier());
         nameIdentifier.setNameIdentifier(subjectBean.getSubjectName());
         nameIdentifier.setFormat(subjectBean.getSubjectNameIDFormat());
         String confirmationMethodStr = subjectBean.getSubjectConfirmationMethod();
-
+        
         if (confirmationMethodStr == null) {
             confirmationMethodStr = SAML1Constants.CONF_SENDER_VOUCHES;
         }
-
+        
         confirmationMethod.setConfirmationMethod(confirmationMethodStr);
         subjectConfirmation.getConfirmationMethods().add(confirmationMethod);
         if (subjectBean.getKeyInfo() != null) {
@@ -162,22 +192,20 @@ public class SAML1ComponentBuilder {
         }
         subject.setNameIdentifier(nameIdentifier);
         subject.setSubjectConfirmation(subjectConfirmation);
-
+        
         return subject;
     }
-
+    
     /**
      * Create an Opensaml KeyInfo object from the parameters
-     *
      * @param keyInfo the KeyInfo bean from which to extract security credentials
      * @return the KeyInfo object
      * @throws org.opensaml.xml.security.SecurityException
-     *
      */
-    public static KeyInfo createKeyInfo(KeyInfoBean keyInfo)
-            throws org.opensaml.xml.security.SecurityException, WSSecurityException {
+    public static KeyInfo createKeyInfo(KeyInfoBean keyInfo) 
+        throws org.opensaml.xml.security.SecurityException, WSSecurityException {
         if (keyInfo.getElement() != null) {
-            return (KeyInfo) OpenSAMLUtil.fromDom(keyInfo.getElement());
+            return (KeyInfo)OpenSAMLUtil.fromDom(keyInfo.getElement());
         } else {
             // Set the certificate or public key
             BasicX509Credential keyInfoCredential = new BasicX509Credential();
@@ -186,7 +214,7 @@ public class SAML1ComponentBuilder {
             } else if (keyInfo.getPublicKey() != null) {
                 keyInfoCredential.setPublicKey(keyInfo.getPublicKey());
             }
-
+            
             // Configure how to emit the certificate
             X509KeyInfoGeneratorFactory kiFactory = new X509KeyInfoGeneratorFactory();
             KeyInfoBean.CERT_IDENTIFIER certIdentifier = keyInfo.getCertIdentifer();
@@ -216,27 +244,27 @@ public class SAML1ComponentBuilder {
     @SuppressWarnings("unchecked")
     public static Conditions createSamlv1Conditions(ConditionsBean conditionsBean) {
         if (conditionsV1Builder == null) {
-            conditionsV1Builder = (SAMLObjectBuilder<Conditions>)
-                    builderFactory.getBuilder(Conditions.DEFAULT_ELEMENT_NAME);
-
+            conditionsV1Builder = (SAMLObjectBuilder<Conditions>) 
+                builderFactory.getBuilder(Conditions.DEFAULT_ELEMENT_NAME);
+            
         }
         Conditions conditions = conditionsV1Builder.buildObject();
-
+        
         if (conditionsBean == null) {
             DateTime newNotBefore = new DateTime();
             conditions.setNotBefore(newNotBefore);
             conditions.setNotOnOrAfter(newNotBefore.plusMinutes(5));
             return conditions;
         }
-
+        
         int tokenPeriodMinutes = conditionsBean.getTokenPeriodMinutes();
         DateTime notBefore = conditionsBean.getNotBefore();
         DateTime notAfter = conditionsBean.getNotAfter();
-
+        
         if (notBefore != null && notAfter != null) {
             if (notBefore.isAfter(notAfter)) {
                 throw new IllegalStateException(
-                        "The value of notBefore may not be after the value of notAfter"
+                    "The value of notBefore may not be after the value of notAfter"
                 );
             }
             conditions.setNotBefore(notBefore);
@@ -249,16 +277,16 @@ public class SAML1ComponentBuilder {
             }
             conditions.setNotOnOrAfter(newNotBefore.plusMinutes(tokenPeriodMinutes));
         }
-
+        
         if (conditionsBean.getAudienceURI() != null) {
-            AudienceRestrictionCondition audienceRestriction =
-                    createSamlv1AudienceRestriction(conditionsBean.getAudienceURI());
+            AudienceRestrictionCondition audienceRestriction = 
+                createSamlv1AudienceRestriction(conditionsBean.getAudienceURI());
             conditions.getAudienceRestrictionConditions().add(audienceRestriction);
         }
-
+        
         return conditions;
     }
-
+    
     /**
      * Create an AudienceRestrictionCondition object
      *
@@ -266,19 +294,19 @@ public class SAML1ComponentBuilder {
      * @return an AudienceRestrictionCondition object
      */
     @SuppressWarnings("unchecked")
-    public static AudienceRestrictionCondition
+    public static AudienceRestrictionCondition 
     createSamlv1AudienceRestriction(String audienceURI) {
         if (audienceRestrictionV1Builder == null) {
-            audienceRestrictionV1Builder = (SAMLObjectBuilder<AudienceRestrictionCondition>)
-                    builderFactory.getBuilder(AudienceRestrictionCondition.DEFAULT_ELEMENT_NAME);
+            audienceRestrictionV1Builder = (SAMLObjectBuilder<AudienceRestrictionCondition>) 
+                builderFactory.getBuilder(AudienceRestrictionCondition.DEFAULT_ELEMENT_NAME);
         }
         if (audienceV1Builder == null) {
-            audienceV1Builder = (SAMLObjectBuilder<Audience>)
-                    builderFactory.getBuilder(Audience.DEFAULT_ELEMENT_NAME);
+            audienceV1Builder = (SAMLObjectBuilder<Audience>) 
+                builderFactory.getBuilder(Audience.DEFAULT_ELEMENT_NAME);
         }
-
-        AudienceRestrictionCondition audienceRestriction =
-                audienceRestrictionV1Builder.buildObject();
+       
+        AudienceRestrictionCondition audienceRestriction = 
+            audienceRestrictionV1Builder.buildObject();
         Audience audience = audienceV1Builder.buildObject();
         audience.setUri(audienceURI);
         audienceRestriction.getAudiences().add(audience);
@@ -293,43 +321,43 @@ public class SAML1ComponentBuilder {
      */
     @SuppressWarnings("unchecked")
     public static List<AuthenticationStatement> createSamlv1AuthenticationStatement(
-            List<AuthenticationStatementBean> authBeans
+        List<AuthenticationStatementBean> authBeans
     ) throws org.opensaml.xml.security.SecurityException, WSSecurityException {
-        List<AuthenticationStatement> authenticationStatements =
-                new ArrayList<AuthenticationStatement>();
-
+        List<AuthenticationStatement> authenticationStatements = 
+            new ArrayList<AuthenticationStatement>();
+        
         if (authenticationStatementV1Builder == null) {
-            authenticationStatementV1Builder = (SAMLObjectBuilder<AuthenticationStatement>)
-                    builderFactory.getBuilder(AuthenticationStatement.DEFAULT_ELEMENT_NAME);
+            authenticationStatementV1Builder = (SAMLObjectBuilder<AuthenticationStatement>) 
+                builderFactory.getBuilder(AuthenticationStatement.DEFAULT_ELEMENT_NAME);
         }
         if (subjectLocalityBuilder == null) {
-            subjectLocalityBuilder = (SAMLObjectBuilder<SubjectLocality>)
-                    builderFactory.getBuilder(SubjectLocality.DEFAULT_ELEMENT_NAME);
+            subjectLocalityBuilder = (SAMLObjectBuilder<SubjectLocality>) 
+                builderFactory.getBuilder(SubjectLocality.DEFAULT_ELEMENT_NAME);
         }
 
         if (authBeans != null && authBeans.size() > 0) {
             for (AuthenticationStatementBean statementBean : authBeans) {
-                AuthenticationStatement authenticationStatement =
-                        authenticationStatementV1Builder.buildObject(
-                                AuthenticationStatement.DEFAULT_ELEMENT_NAME,
-                                AuthenticationStatement.TYPE_NAME
-                        );
-                Subject authSubject =
-                        SAML1ComponentBuilder.createSaml1v1Subject(statementBean.getSubject());
+                AuthenticationStatement authenticationStatement = 
+                    authenticationStatementV1Builder.buildObject(
+                        AuthenticationStatement.DEFAULT_ELEMENT_NAME, 
+                        AuthenticationStatement.TYPE_NAME
+                    );
+                Subject authSubject = 
+                    SAML1ComponentBuilder.createSaml1v1Subject(statementBean.getSubject());
                 authenticationStatement.setSubject(authSubject);
 
                 if (statementBean.getAuthenticationInstant() != null) {
                     authenticationStatement.setAuthenticationInstant(
-                            statementBean.getAuthenticationInstant()
+                        statementBean.getAuthenticationInstant()
                     );
                 } else {
                     authenticationStatement.setAuthenticationInstant(new DateTime());
                 }
 
                 authenticationStatement.setAuthenticationMethod(
-                        transformAuthenticationMethod(statementBean.getAuthenticationMethod())
+                    transformAuthenticationMethod(statementBean.getAuthenticationMethod())
                 );
-
+                
                 SubjectLocalityBean subjectLocalityBean = statementBean.getSubjectLocality();
                 if (subjectLocalityBean != null) {
                     SubjectLocality subjectLocality = subjectLocalityBuilder.buildObject();
@@ -338,7 +366,7 @@ public class SAML1ComponentBuilder {
 
                     authenticationStatement.setSubjectLocality(subjectLocality);
                 }
-
+                
                 authenticationStatements.add(authenticationStatement);
             }
         }
@@ -347,7 +375,7 @@ public class SAML1ComponentBuilder {
     }
 
     /**
-     * Method transformAuthenticationMethod transforms the user-supplied authentication method
+     * Method transformAuthenticationMethod transforms the user-supplied authentication method 
      * value into one of the supported specification-compliant values.
      *
      * @param sourceMethod of type String
@@ -358,7 +386,7 @@ public class SAML1ComponentBuilder {
 
         if ("Password".equals(sourceMethod)) {
             transformedMethod = SAML1Constants.AUTH_METHOD_PASSWORD;
-        } else if (sourceMethod != null && !sourceMethod.isEmpty()) {
+        } else if (sourceMethod != null && !"".equals(sourceMethod)) {
             return sourceMethod;
         }
 
@@ -373,11 +401,11 @@ public class SAML1ComponentBuilder {
      */
     @SuppressWarnings("unchecked")
     public static List<AttributeStatement> createSamlv1AttributeStatement(
-            List<AttributeStatementBean> attributeData
+        List<AttributeStatementBean> attributeData
     ) throws org.opensaml.xml.security.SecurityException, WSSecurityException {
         if (attributeStatementV1Builder == null) {
-            attributeStatementV1Builder = (SAMLObjectBuilder<AttributeStatement>)
-                    builderFactory.getBuilder(AttributeStatement.DEFAULT_ELEMENT_NAME);
+            attributeStatementV1Builder = (SAMLObjectBuilder<AttributeStatement>) 
+                builderFactory.getBuilder(AttributeStatement.DEFAULT_ELEMENT_NAME);
         }
 
         List<AttributeStatement> attributeStatements = new ArrayList<AttributeStatement>();
@@ -386,8 +414,8 @@ public class SAML1ComponentBuilder {
             for (AttributeStatementBean statementBean : attributeData) {
                 // Create the attribute statementBean and set the subject
                 AttributeStatement attributeStatement = attributeStatementV1Builder.buildObject();
-                Subject attributeSubject =
-                        SAML1ComponentBuilder.createSaml1v1Subject(statementBean.getSubject());
+                Subject attributeSubject = 
+                    SAML1ComponentBuilder.createSaml1v1Subject(statementBean.getSubject());
                 attributeStatement.setSubject(attributeSubject);
                 // Add the individual attributes
                 for (AttributeBean values : statementBean.getSamlAttributes()) {
@@ -395,13 +423,13 @@ public class SAML1ComponentBuilder {
                     if (attributeValues == null || attributeValues.isEmpty()) {
                         attributeValues = values.getCustomAttributeValues();
                     }
-
-                    Attribute samlAttribute =
-                            createSamlv1Attribute(
-                                    values.getSimpleName(),
-                                    values.getQualifiedName(),
-                                    attributeValues
-                            );
+                    
+                    Attribute samlAttribute = 
+                        createSamlv1Attribute(
+                            values.getSimpleName(),
+                            values.getQualifiedName(), 
+                            attributeValues
+                        );
                     attributeStatement.getAttributes().add(samlAttribute);
                 }
                 // Add the completed attribute statementBean to the collection
@@ -416,36 +444,36 @@ public class SAML1ComponentBuilder {
      * Create a SAML 1.1 attribute
      *
      * @param attributeName the Attribute Name
-     * @param attributeUrn  the Attribute Qualified Name
-     * @param values        the Attribute Values
+     * @param attributeUrn the Attribute Qualified Name
+     * @param values the Attribute Values
      * @return a SAML 1.1 attribute
      */
     @SuppressWarnings("unchecked")
     public static Attribute createSamlv1Attribute(
-            String attributeName,
-            String attributeUrn,
-            List<?> values
+        String attributeName, 
+        String attributeUrn,
+        List<?> values
     ) {
         if (attributeV1Builder == null) {
-            attributeV1Builder = (SAMLObjectBuilder<Attribute>)
-                    builderFactory.getBuilder(Attribute.DEFAULT_ELEMENT_NAME);
+            attributeV1Builder = (SAMLObjectBuilder<Attribute>) 
+                builderFactory.getBuilder(Attribute.DEFAULT_ELEMENT_NAME);
         }
         if (stringBuilder == null) {
-            stringBuilder = (XSStringBuilder) builderFactory.getBuilder(XSString.TYPE_NAME);
+            stringBuilder = (XSStringBuilder)builderFactory.getBuilder(XSString.TYPE_NAME);
         }
 
         Attribute attribute = attributeV1Builder.buildObject();
         attribute.setAttributeName(attributeName);
         attribute.setAttributeNamespace(attributeUrn);
-
+        
         for (Object value : values) {
             if (value instanceof String) {
-                XSString attribute1 =
-                        stringBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME);
-                attribute1.setValue((String) value);
+                XSString attribute1 = 
+                    stringBuilder.buildObject(AttributeValue.DEFAULT_ELEMENT_NAME, XSString.TYPE_NAME);
+                attribute1.setValue((String)value);
                 attribute.getAttributeValues().add(attribute1);
             } else if (value instanceof XMLObject) {
-                attribute.getAttributeValues().add((XMLObject) value);
+                attribute.getAttributeValues().add((XMLObject)value);
             }
         }
 
@@ -455,28 +483,28 @@ public class SAML1ComponentBuilder {
     /**
      * Create SAML 1.1 Authorization Decision Statement(s)
      *
-     * @param decisionData of type List<AuthDecisionStatementBean>
+     * @param decisionData        of type List<AuthDecisionStatementBean>
      * @return a list of SAML 1.1 Authorization Decision Statement(s)
      */
     @SuppressWarnings("unchecked")
     public static List<AuthorizationDecisionStatement> createSamlv1AuthorizationDecisionStatement(
-            List<AuthDecisionStatementBean> decisionData)
-            throws org.opensaml.xml.security.SecurityException, WSSecurityException {
-        List<AuthorizationDecisionStatement> authDecisionStatements =
+            List<AuthDecisionStatementBean> decisionData) 
+        throws org.opensaml.xml.security.SecurityException, WSSecurityException {
+        List<AuthorizationDecisionStatement> authDecisionStatements = 
                 new ArrayList<AuthorizationDecisionStatement>();
         if (authorizationDecisionStatementV1Builder == null) {
-            authorizationDecisionStatementV1Builder =
-                    (SAMLObjectBuilder<AuthorizationDecisionStatement>)
-                            builderFactory.getBuilder(AuthorizationDecisionStatement.DEFAULT_ELEMENT_NAME);
-
+            authorizationDecisionStatementV1Builder = 
+                (SAMLObjectBuilder<AuthorizationDecisionStatement>) 
+                    builderFactory.getBuilder(AuthorizationDecisionStatement.DEFAULT_ELEMENT_NAME);
+            
         }
 
         if (decisionData != null && decisionData.size() > 0) {
             for (AuthDecisionStatementBean decisionStatementBean : decisionData) {
-                AuthorizationDecisionStatement authDecision =
-                        authorizationDecisionStatementV1Builder.buildObject();
-                Subject authDecisionSubject =
-                        SAML1ComponentBuilder.createSaml1v1Subject(decisionStatementBean.getSubject());
+                AuthorizationDecisionStatement authDecision = 
+                    authorizationDecisionStatementV1Builder.buildObject();
+                Subject authDecisionSubject = 
+                    SAML1ComponentBuilder.createSaml1v1Subject(decisionStatementBean.getSubject());
                 authDecision.setSubject(authDecisionSubject);
 
                 authDecision.setResource(decisionStatementBean.getResource());
@@ -486,11 +514,11 @@ public class SAML1ComponentBuilder {
                     Action actionElement = createSamlv1Action(actionBean);
                     authDecision.getActions().add(actionElement);
                 }
-
-                if (decisionStatementBean.getEvidence() instanceof Evidence) {
-                    authDecision.setEvidence((Evidence) decisionStatementBean.getEvidence());
+                
+                if (decisionStatementBean.getEvidence() instanceof Evidence) {                                    
+                    authDecision.setEvidence((Evidence)decisionStatementBean.getEvidence());
                 }
-
+                
                 authDecisionStatements.add(authDecision);
             }
         }
@@ -508,7 +536,7 @@ public class SAML1ComponentBuilder {
     public static Action createSamlv1Action(ActionBean actionBean) {
         if (actionElementV1Builder == null) {
             actionElementV1Builder = (SAMLObjectBuilder<Action>)
-                    builderFactory.getBuilder(Action.DEFAULT_ELEMENT_NAME);
+                builderFactory.getBuilder(Action.DEFAULT_ELEMENT_NAME);
         }
 
         Action actionElement = actionElementV1Builder.buildObject();
@@ -525,7 +553,7 @@ public class SAML1ComponentBuilder {
      * @return DecisionTypeEnumeration
      */
     private static DecisionTypeEnumeration transformDecisionType(
-            AuthDecisionStatementBean.Decision decision
+        AuthDecisionStatementBean.Decision decision
     ) {
         DecisionTypeEnumeration decisionTypeEnum = DecisionTypeEnumeration.DENY;
         if (decision.equals(AuthDecisionStatementBean.Decision.PERMIT)) {



Mime
View raw message