synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ind...@apache.org
Subject svn commit: r600437 - in /webservices/synapse/trunk/java/modules/extensions/src: main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java test/java/org/apache/synapse/mediators/throttle/ThrottleMediatorTest.java
Date Mon, 03 Dec 2007 07:01:54 GMT
Author: indika
Date: Sun Dec  2 23:01:53 2007
New Revision: 600437

URL: http://svn.apache.org/viewvc?rev=600437&view=rev
Log:
change according to the api change in wso2throttle - for compilation errors ,please locally
build wso2throttle () 
https://wso2.org/repos/wso2/branches/wsas/java/2.1/commons/throttle

Modified:
    webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java
    webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/throttle/ThrottleMediatorTest.java

Modified: webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java?rev=600437&r1=600436&r2=600437&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java
(original)
+++ webservices/synapse/trunk/java/modules/extensions/src/main/java/org/apache/synapse/mediators/throttle/ThrottleMediator.java
Sun Dec  2 23:01:53 2007
@@ -322,10 +322,10 @@
      */
     private boolean throttleByAccessRate(MessageContext synCtx, org.apache.axis2.context.MessageContext
axisMC, ConfigurationContext cc, boolean traceOrDebugOn, boolean traceOn) {
 
-        Object callerId = null;
+        String callerId = null;
         boolean canAccess = true;
         //remote ip of the caller
-        Object remoteIP = axisMC.getPropertyNonReplicable(
+        String remoteIP = (String) axisMC.getPropertyNonReplicable(
             org.apache.axis2.context.MessageContext.REMOTE_ADDR);
         //domain name of the caller
         String domainName = (String) axisMC.getPropertyNonReplicable(NhttpConstants.REMOTE_HOST);
@@ -527,6 +527,6 @@
 
     public void setId(String id) {
         this.id = id;
-        this.key = ThrottleConstants.THROTTLE_PROPERTY_PREFIX + id + ThrottleConstants.CAC_KEY;
+        this.key = ThrottleConstants.THROTTLE_PROPERTY_PREFIX + id + ThrottleConstants.CAC_SUFFIX;
     }
 }

Modified: webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/throttle/ThrottleMediatorTest.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/throttle/ThrottleMediatorTest.java?rev=600437&r1=600436&r2=600437&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/throttle/ThrottleMediatorTest.java
(original)
+++ webservices/synapse/trunk/java/modules/extensions/src/test/java/org/apache/synapse/mediators/throttle/ThrottleMediatorTest.java
Sun Dec  2 23:01:53 2007
@@ -229,7 +229,7 @@
 
             }
             //IP based throttling
-            Object remoteIP = synContext.getProperty(REMOTE_ADDR);
+            String remoteIP = (String)synContext.getProperty(REMOTE_ADDR);
             if (remoteIP == null) {
                 throw new ThrottleException("IP address of the caller can not find - Currently
only support caller-IP base access control" +
                         "- Thottling will not happen ");



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


Mime
View raw message