[jboss-svn-commits] JBL Code SVN: r29470 - in labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta: tests/src/org/jboss/soa/esb/actions/security and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Sep 25 07:39:29 EDT 2009


Author: beve
Date: 2009-09-25 07:39:28 -0400 (Fri, 25 Sep 2009)
New Revision: 29470

Modified:
   labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/actions/security/JBossSTSAction.java
   labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/actions/security/JBossSTSActionUnitTest.java
Log:
Using the initialize method to create the WSTrustClient


Modified: labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/actions/security/JBossSTSAction.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/actions/security/JBossSTSAction.java	2009-09-25 10:49:54 UTC (rev 29469)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/src/org/jboss/soa/esb/actions/security/JBossSTSAction.java	2009-09-25 11:39:28 UTC (rev 29470)
@@ -33,6 +33,7 @@
 import org.jboss.internal.soa.esb.assertion.AssertArgument;
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
 import org.jboss.soa.esb.actions.ActionProcessingException;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.message.Message;
@@ -49,10 +50,10 @@
  * This action support issueing SAML Assertions using JBossSTS (Security Token Service).
  * <p/>
  * 
- * This action simulates the actions that a web service client would take to request that STS issue a security 
+ * This action simulates the actions that a web service client would take to request that a STS issue a security 
  * token that can be used to access a web service. 
  * When making the request to STS, the client can use WS-Security or transport-layer mechanisms to identify itself. In 
- * the current implementation we are using WS-Security to authenicate using UsernameToken. This is simple username/passwd 
+ * the current implementation we are using WS-Security to authenicate using UsernameToken. This is a simple username/passwd 
  * which is configured in the jboss-sts-client.properites file.
  * 
  * Usage:
@@ -94,6 +95,7 @@
     private STSClientConfig wsTrustConfig;
     private final String tokenType;
     private boolean addAssertionToEsbAuthRequest;
+    private STSClient wsTrustClient;
 
     public JBossSTSAction(final ConfigTree config) throws ConfigurationException
     {
@@ -101,13 +103,18 @@
         tokenType = config.getRequiredAttribute(TOKEN_TYPE_OPTION);
         addAssertionToEsbAuthRequest = config.getBooleanAttribute(ADD_TO_ESB_AUTH_REQUEST, false);
     }
+    
+    @Override
+    public void initialise() throws ActionLifecycleException
+    {
+        wsTrustClient = createWSTrustClient();
+    }
 
     public Message process(final Message message) throws ActionProcessingException
     {
         AssertArgument.isNotNull(message, "message");
         try
         {
-            final STSClient wsTrustClient = createWSTrustClient(message);
             final Element assertion = wsTrustClient.issueToken(tokenType);
             
             if (log.isDebugEnabled())
@@ -145,7 +152,7 @@
         }
     }
     
-    STSClient createWSTrustClient(final Message message) throws ActionProcessingException
+    STSClient createWSTrustClient() throws ActionLifecycleException
     {
         try
         {
@@ -153,7 +160,7 @@
         }
         catch (final ParsingException e)
         {
-            throw new ActionProcessingException(e.getMessage(), e);
+            throw new ActionLifecycleException(e.getMessage(), e);
 	    }
     }
     

Modified: labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/actions/security/JBossSTSActionUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/actions/security/JBossSTSActionUnitTest.java	2009-09-25 10:49:54 UTC (rev 29469)
+++ labs/jbossesb/workspace/dbevenius/saml_support/product/rosetta/tests/src/org/jboss/soa/esb/actions/security/JBossSTSActionUnitTest.java	2009-09-25 11:39:28 UTC (rev 29470)
@@ -123,7 +123,7 @@
         }
 
         @Override
-        STSClient createWSTrustClient(Message message) throws ActionProcessingException
+        STSClient createWSTrustClient() 
         {
             return client;
         }



More information about the jboss-svn-commits mailing list