You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ru...@apache.org on 2006/06/02 08:35:46 UTC

svn commit: r411066 - in /webservices/axis2/trunk/java/modules/security/src/org/apache: axis2/security/rahas/ rampart/util/

Author: ruchithf
Date: Thu Jun  1 23:35:45 2006
New Revision: 411066

URL: http://svn.apache.org/viewvc?rev=411066&view=rev
Log:
s/Rahas/Conversation

Added:
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationCallbackHandler.java
      - copied, changed from r410070, webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasCallbackHandler.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationConfiguration.java
      - copied, changed from r410070, webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasConfiguration.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationException.java
      - copied, changed from r410070, webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasException.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationHandlerConstants.java
      - copied, changed from r410070, webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasHandlerConstants.java
Removed:
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasCallbackHandler.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasConfiguration.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasException.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasHandlerConstants.java
Modified:
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Receiver.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/STSRequester.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Sender.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Util.java
    webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/MessageOptimizer.java

Copied: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationCallbackHandler.java (from r410070, webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasCallbackHandler.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationCallbackHandler.java?p2=webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationCallbackHandler.java&p1=webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasCallbackHandler.java&r1=410070&r2=411066&rev=411066&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasCallbackHandler.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationCallbackHandler.java Thu Jun  1 23:35:45 2006
@@ -29,11 +29,11 @@
  * This is ths callback handler used to extract he secure conversation
  * session key for a given context identifier
  */
-public class RahasCallbackHandler implements CallbackHandler {
+public class ConversationCallbackHandler implements CallbackHandler {
 
-    private RahasConfiguration config;
+    private ConversationConfiguration config;
     
-    public RahasCallbackHandler(RahasConfiguration config) {
+    public ConversationCallbackHandler(ConversationConfiguration config) {
         this.config = config;
     }
     

Copied: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationConfiguration.java (from r410070, webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasConfiguration.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationConfiguration.java?p2=webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationConfiguration.java&p1=webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasConfiguration.java&r1=410070&r2=411066&rev=411066&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationConfiguration.java Thu Jun  1 23:35:45 2006
@@ -39,9 +39,9 @@
 import java.util.Properties;
 
 /**
- * Configuration manager for Rahas
+ * Configuration manager for Ramapart-SecConv
  */
-public class RahasConfiguration {
+public class ConversationConfiguration {
     
     public final static String RAHAS_CONFIG = "rahas-configuration";
     
@@ -99,7 +99,7 @@
      * This is the <code>Crypto</code> impl class name.
      * 
      * This will ONLY be set via the message context as a property using 
-     * <code>org.apache.axis2.security.rahas.RahasHandlerConstants#CRYPTO_PROPERTIES_KEY<code>. 
+     * <code>org.apache.axis2.security.rahas.ConversationHandlerConstants#CRYPTO_PROPERTIES_KEY<code>. 
      * 
      * @see org.apache.ws.security.components.crypto.Crypto
      * @see org.apache.ws.security.components.crypto.Merlin
@@ -139,7 +139,7 @@
     
     private boolean provideEntropy;
     
-    public static RahasConfiguration load(MessageContext msgCtx, boolean sender)
+    public static ConversationConfiguration load(MessageContext msgCtx, boolean sender)
             throws Exception {
         Parameter param = msgCtx.getParameter(RAHAS_CONFIG);
         if(param == null) {
@@ -154,7 +154,7 @@
                 
                 OMElement confElem = elem.getFirstElement();
                 
-                RahasConfiguration config = new RahasConfiguration();
+                ConversationConfiguration config = new ConversationConfiguration();
                 
                 config.msgCtx = msgCtx;
                 msgCtx.setProperty(RAHAS_CONFIG, config);
@@ -184,7 +184,7 @@
                 
                 //Get the action<->ctx-identifier map
                 config.contextMap = (Hashtable) msgCtx
-                        .getProperty(RahasHandlerConstants.CONTEXT_MAP_KEY);
+                        .getProperty(ConversationHandlerConstants.CONTEXT_MAP_KEY);
 
                 //Convert the Envelop to DOOM
                 config.doc = Axis2Util.getDocumentFromSOAPEnvelope(msgCtx
@@ -198,7 +198,7 @@
                 if(sender) {
                     if(!msgCtx.isServerSide()) {
                         //Client side sender
-                        if (config.scope.equals(RahasConfiguration.SCOPE_OPERATION)) {
+                        if (config.scope.equals(ConversationConfiguration.SCOPE_OPERATION)) {
                             // Operation scope
                             String action = msgCtx.getSoapAction();
                             config.contextIdentifier = (String) config.getContextMap()
@@ -218,9 +218,9 @@
                         //Server side sender
                         OperationContext opCtx = msgCtx.getOperationContext();
                         MessageContext inMsgCtx;
-                        RahasConfiguration inConfig = null;
+                        ConversationConfiguration inConfig = null;
                         if(opCtx != null && (inMsgCtx = opCtx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE)) != null) {
-                            inConfig = (RahasConfiguration)inMsgCtx.getProperty(RAHAS_CONFIG);
+                            inConfig = (ConversationConfiguration)inMsgCtx.getProperty(RAHAS_CONFIG);
                         }
                         if(inConfig != null && inConfig.contextIdentifier != null) {
                             config.contextIdentifier = inConfig.contextIdentifier;
@@ -228,7 +228,7 @@
                             OMElement token = config.tokenStore.getToken(config.contextIdentifier).getToken();
                             config.sct = new SecurityContextToken((Element)config.doc.importNode((Element)token, true));
                         } else {
-                            throw new RahasException("canotFindContextIdentifier");
+                            throw new ConversationException("canotFindContextIdentifier");
                         }
                         
                         config.setClassLoader(msgCtx.getAxisService().getClassLoader());
@@ -237,10 +237,10 @@
 
                 //Crypto properties
                 config.cryptoProperties = (Properties)msgCtx
-                        .getProperty(RahasHandlerConstants.CRYPTO_PROPERTIES_KEY);
+                        .getProperty(ConversationHandlerConstants.CRYPTO_PROPERTIES_KEY);
 
                 config.cryptoClassName = (String) msgCtx
-                        .getProperty(RahasHandlerConstants.CRYPTO_CLASS_KEY);
+                        .getProperty(ConversationHandlerConstants.CRYPTO_CLASS_KEY);
                 
                 config.passwordCallbackRef = (CallbackHandler)msgCtx
                         .getProperty(WSHandlerConstants.PW_CALLBACK_REF);
@@ -249,11 +249,11 @@
                 
                 return config;
             } else {
-                throw new RahasException("missingConfiguration",
+                throw new ConversationException("missingConfiguration",
                         new String[] { RAHAS_CONFIG });
             }
         } else {
-            throw new RahasException("expectedParameterMissing",
+            throw new ConversationException("expectedParameterMissing",
                     new String[] { RAHAS_CONFIG });
         }
         
@@ -261,9 +261,9 @@
 
     /**
      * @param elem
-     * @throws RahasException
+     * @throws ConversationException
      */
-    private static String getStringValue(OMElement elem) throws RahasException {
+    private static String getStringValue(OMElement elem) throws ConversationException {
         if(elem != null) {
             String tempVal = elem.getText();
             return tempVal;
@@ -272,14 +272,14 @@
     }
 
     /**
-     * Generate the Axis2 parameter representing RahasConfiguration
+     * Generate the Axis2 parameter representing ConversationConfiguration
      * @return
      */
     public Parameter getParameter() {
         Parameter param = new Parameter();
         OMElement element = this.getOMElement();
         OMElement paramElem = element.getOMFactory().createOMElement("parameter", null);
-        paramElem.addAttribute("name", RahasConfiguration.RAHAS_CONFIG, null);
+        paramElem.addAttribute("name", ConversationConfiguration.RAHAS_CONFIG, null);
         paramElem.addChild(element);
         param.setParameterElement(paramElem);
         return param;
@@ -334,11 +334,11 @@
      * the wsa:Action/soapAction or the service address, depending on the scope.
      * 
      * @param identifier The security context identifier
-     * @throws RahasException 
+     * @throws ConversationException 
      *      If scope is "operation" and the wsa:Action is not available.
      *      If scope is "service" and the wsa:To is missing.  
      */
-    protected void resgisterContext(String identifier) throws RahasException {
+    protected void resgisterContext(String identifier) throws ConversationException {
         this.contextIdentifier = identifier;
         
         if(this.scope.equals(SCOPE_OPERATION)) {
@@ -346,14 +346,14 @@
             if(action != null) {
                 this.getContextMap().put(action, identifier);
             } else {
-                throw new RahasException("missingWSAAction");
+                throw new ConversationException("missingWSAAction");
             }
         } else {
             String to = msgCtx.getTo().getAddress();
             if(to != null) {
                 this.getContextMap().put(to, identifier);
             } else {
-                throw new RahasException("missingWSATo");
+                throw new ConversationException("missingWSATo");
             }
         }
         //TODO
@@ -425,7 +425,7 @@
             
             //Context map should be global
             this.msgCtx.getConfigurationContext().setProperty(
-                    RahasHandlerConstants.CONTEXT_MAP_KEY, contextMap);
+                    ConversationHandlerConstants.CONTEXT_MAP_KEY, contextMap);
         }
         
         return contextMap;

Copied: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationException.java (from r410070, webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasException.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationException.java?p2=webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationException.java&p1=webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasException.java&r1=410070&r2=411066&rev=411066&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasException.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationException.java Thu Jun  1 23:35:45 2006
@@ -20,7 +20,7 @@
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
-public class RahasException extends Exception {
+public class ConversationException extends Exception {
     
     private static final long serialVersionUID = 8674795537585339704L;
 
@@ -37,7 +37,7 @@
         }
     }
     
-    public RahasException(String faultCode, Object[] args) {
+    public ConversationException(String faultCode, Object[] args) {
         super(getMessage(faultCode, args));
         this.faultCode = getFaultCode(faultCode);
         this.faultString = getMessage(faultCode, args);
@@ -53,17 +53,17 @@
         return code;
     }
 
-    public RahasException(String faultCode) {
+    public ConversationException(String faultCode) {
         this(faultCode, (Object[])null);
     }
     
-    public RahasException(String faultCode, Object[] args, Throwable e) {
+    public ConversationException(String faultCode, Object[] args, Throwable e) {
         super(getMessage(faultCode, args),e);
         this.faultCode = faultCode;
         this.faultString = getMessage(faultCode, args);
     }
     
-    public RahasException(String faultCode, Throwable e) {
+    public ConversationException(String faultCode, Throwable e) {
         this(faultCode, null, e);
     }
 

Copied: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationHandlerConstants.java (from r410070, webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasHandlerConstants.java)
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationHandlerConstants.java?p2=webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationHandlerConstants.java&p1=webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasHandlerConstants.java&r1=410070&r2=411066&rev=411066&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/RahasHandlerConstants.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/ConversationHandlerConstants.java Thu Jun  1 23:35:45 2006
@@ -17,9 +17,9 @@
 package org.apache.axis2.security.rahas;
 
 /**
- * Constants of the Rahas handlers
+ * Constants of the Conversation handlers
  */
-public interface RahasHandlerConstants {
+public interface ConversationHandlerConstants {
 
     /**
      * Key to hod the map of security context identifiers against the 

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Receiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Receiver.java?rev=411066&r1=411065&r2=411066&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Receiver.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Receiver.java Thu Jun  1 23:35:45 2006
@@ -50,7 +50,7 @@
             }
             
             // Parse the configuration
-            RahasConfiguration config = RahasConfiguration.load(msgContext,
+            ConversationConfiguration config = ConversationConfiguration.load(msgContext,
                     false);
             
             
@@ -67,7 +67,7 @@
             
             WSSecurityEngine secEngine = new WSSecurityEngine();
             secEngine.processSecurityHeader(config.getDocument(), null,
-                    new RahasCallbackHandler(config), config
+                    new ConversationCallbackHandler(config), config
                             .getCrypto());
 
             //Convert back to llom since the inflow cannot use llom
@@ -75,8 +75,8 @@
                     config.getDocument()));
             
         } catch (Exception e) {
-            if (e instanceof RahasException) {
-                RahasException re = (RahasException) e;
+            if (e instanceof ConversationException) {
+                ConversationException re = (ConversationException) e;
                 throw new AxisFault(re.getFaultString(), re.getFaultCode());
             } else {
                 throw new AxisFault(e.getMessage());

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/STSRequester.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/STSRequester.java?rev=411066&r1=411065&r2=411066&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/STSRequester.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/STSRequester.java Thu Jun  1 23:35:45 2006
@@ -42,7 +42,7 @@
 
 public class STSRequester {
     
-    public static void issueRequest(RahasConfiguration config) throws RahasException, AxisFault {
+    public static void issueRequest(ConversationConfiguration config) throws ConversationException, AxisFault {
         MessageContext msgCtx = config.getMsgCtx();
         AxisService axisService = new AxisService("SecurityTokenService");
         QName rstQn = new QName("requestSecurityToken");
@@ -121,7 +121,7 @@
             
         } catch (Exception e) {
             e.printStackTrace();
-            throw new RahasException(e.getMessage());
+            throw new ConversationException(e.getMessage());
         }
     }
     

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Sender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Sender.java?rev=411066&r1=411065&r2=411066&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Sender.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Sender.java Thu Jun  1 23:35:45 2006
@@ -47,7 +47,7 @@
 import java.security.cert.X509Certificate;
 
 /**
- * Rahas outflow handler
+ * Conversation outflow handler
  */
 public class Sender implements Handler {
 
@@ -64,8 +64,8 @@
                 return;
             }
             
-            //Parse the rahas configuration
-            RahasConfiguration config = RahasConfiguration.load(msgContext, true);
+            //Parse the Conversation configuration
+            ConversationConfiguration config = ConversationConfiguration.load(msgContext, true);
             msgContext.setEnvelope((SOAPEnvelope) config.getDocument()
                     .getDocumentElement());
             
@@ -88,8 +88,8 @@
 
         } catch (Exception e) {
             e.printStackTrace();
-            if(e instanceof RahasException) {
-                RahasException re = (RahasException)e;
+            if(e instanceof ConversationException) {
+                ConversationException re = (ConversationException)e;
                 throw new AxisFault(re.getFaultString(), re.getFaultCode());
             } else {
                 throw new AxisFault(e.getMessage());
@@ -112,13 +112,13 @@
      * @param config
      * @throws Exception
      */
-    private void createRSTR(RahasConfiguration config) throws Exception {
+    private void createRSTR(ConversationConfiguration config) throws Exception {
         
         WSSecEncryptedKey encrKeyBuilder = new WSSecEncryptedKey();
         Crypto crypto = Util.getCryptoInstace(config);
         String encryptionUser = config.getEncryptionUser();
         if(encryptionUser == null) {
-            throw new RahasException("missingEncryptionUser");
+            throw new ConversationException("missingEncryptionUser");
         }
         X509Certificate cert = crypto.getCertificates(encryptionUser)[0];
         
@@ -171,7 +171,7 @@
         
     }
     
-    private void constructMessage(RahasConfiguration config) throws Exception {
+    private void constructMessage(ConversationConfiguration config) throws Exception {
         
         Crypto crypto = Util.getCryptoInstace(config);
 

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Util.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Util.java?rev=411066&r1=411065&r2=411066&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Util.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/axis2/security/rahas/Util.java Thu Jun  1 23:35:45 2006
@@ -46,8 +46,8 @@
      * @return
      * @throws RahasException
      */
-    public static Crypto getCryptoInstace(RahasConfiguration config)
-            throws RahasException {
+    public static Crypto getCryptoInstace(ConversationConfiguration config)
+            throws ConversationException {
         if (config.getCrypto() != null) {
             return config.getCrypto();
         } else {
@@ -66,14 +66,14 @@
                             .getCryptoPropertiesFile());
                 }
             } else {
-                throw new RahasException("cannotCrateCryptoInstance");
+                throw new ConversationException("cannotCrateCryptoInstance");
             }
             config.setCrypto(crypto);
             return crypto;
         }
     }
 
-    public static void processRSTR(OMElement rstr, RahasConfiguration config)
+    public static void processRSTR(OMElement rstr, ConversationConfiguration config)
             throws Exception {
         // Extract the SecurityContextToken
         OMElement rstElem = rstr.getFirstChildWithName(new QName(
@@ -88,7 +88,7 @@
                 token = new Token(sct.getIdentifier(), sctElem);
                 config.resgisterContext(sct.getIdentifier());
             } else {
-                throw new RahasException("sctMissingInResponse");
+                throw new ConversationException("sctMissingInResponse");
             }
         } else {
             throw new TrustException("reqestedSecTokMissing");
@@ -141,7 +141,7 @@
     }
     
     private static CallbackHandler getCallbackHandlerInstance(
-            RahasConfiguration config) throws Exception {
+            ConversationConfiguration config) throws Exception {
         if (config.getPasswordCallbackRef() != null) {
             return config.getPasswordCallbackRef();
         } else if (config.getPasswordCallbackClass() != null) {
@@ -155,7 +155,7 @@
                 return (CallbackHandler) clazz.newInstance();
             }
         } else {
-            throw new RahasException("noInfoForCBhandler");
+            throw new ConversationException("noInfoForCBhandler");
         }
     }
 

Modified: webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/MessageOptimizer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/MessageOptimizer.java?rev=411066&r1=411065&r2=411066&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/MessageOptimizer.java (original)
+++ webservices/axis2/trunk/java/modules/security/src/org/apache/rampart/util/MessageOptimizer.java Thu Jun  1 23:35:45 2006
@@ -58,6 +58,7 @@
 			while (cipherValueElements.hasNext()) {
 				OMElement element = (OMElement) cipherValueElements.next();
 				OMText text = (OMText)element.getFirstOMChild();
+                System.out.println(text.getText().length());
 				text.setOptimize(true);
 			}
 		}



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org