Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2005-05-23 04:35:43 +0000
committerslewis2005-05-23 04:35:43 +0000
commit855ac674f390eb717689912567376a838b22e167 (patch)
tree96cde6de2dae0a0de8f3e8c5783bdbb4021c756b
parent65c33767e735cf405e18b8a0fb3d46d29717f2bc (diff)
downloadorg.eclipse.ecf-855ac674f390eb717689912567376a838b22e167.tar.gz
org.eclipse.ecf-855ac674f390eb717689912567376a838b22e167.tar.xz
org.eclipse.ecf-855ac674f390eb717689912567376a838b22e167.zip
Added parameter to IJoinPolicy and to implementation classes
-rw-r--r--framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/app/ServerApplication.java5
-rw-r--r--framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ServerSOContainer.java8
-rw-r--r--framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IJoinPolicy.java4
3 files changed, 11 insertions, 6 deletions
diff --git a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/app/ServerApplication.java b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/app/ServerApplication.java
index 26a89bb9b..a9d3cbf02 100644
--- a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/app/ServerApplication.java
+++ b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/app/ServerApplication.java
@@ -1,6 +1,7 @@
package org.eclipse.ecf.provider.app;
import java.io.FileInputStream;
+import java.net.SocketAddress;
import java.security.PermissionCollection;
import java.util.ArrayList;
import java.util.Iterator;
@@ -37,8 +38,8 @@ public class ServerApplication {
static List servers = new ArrayList();
static class JoinListener implements IJoinPolicy {
- public PermissionCollection checkJoin(ID fromID, ID targetID, String targetGroup, Object joinData) throws SecurityException {
- System.out.println("JOIN From="+fromID+";Group="+targetGroup+";Data="+joinData);
+ public PermissionCollection checkJoin(SocketAddress addr, ID fromID, ID targetID, String targetGroup, Object joinData) throws SecurityException {
+ System.out.println("JOIN Addr="+addr+";From="+fromID+";Group="+targetGroup+";Data="+joinData);
return null;
}
diff --git a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ServerSOContainer.java b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ServerSOContainer.java
index 2ab0d031e..a2e0134c1 100644
--- a/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ServerSOContainer.java
+++ b/framework/bundles/org.eclipse.ecf.provider/src/org/eclipse/ecf/provider/generic/ServerSOContainer.java
@@ -16,6 +16,8 @@ import java.io.InvalidObjectException;
import java.io.Serializable;
import java.net.ConnectException;
import java.net.Socket;
+import java.net.SocketAddress;
+
import org.eclipse.ecf.core.ISharedObjectContainerConfig;
import org.eclipse.ecf.core.ISharedObjectContainerGroupManager;
import org.eclipse.ecf.core.SharedObjectContainerJoinException;
@@ -132,7 +134,7 @@ public class ServerSOContainer extends SOContainer implements ISharedObjectConta
throw e;
}
// Now check to see if this request is going to be allowed
- checkJoin(remoteID,target,jgm.getData());
+ checkJoin(socket.getRemoteSocketAddress(),remoteID,target,jgm.getData());
if (addNewRemoteMember(remoteID, conn)) {
// Notify existing remotes about new member
@@ -165,10 +167,10 @@ public class ServerSOContainer extends SOContainer implements ISharedObjectConta
return null;
}
}
- protected Object checkJoin(ID fromID, String target, Serializable data)
+ protected Object checkJoin(SocketAddress saddr, ID fromID, String target, Serializable data)
throws Exception {
if (this.policy != null) {
- return this.policy.checkJoin(fromID,getID(),target,data);
+ return this.policy.checkJoin(saddr,fromID,getID(),target,data);
}
return null;
}
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IJoinPolicy.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IJoinPolicy.java
index fcbc8abda..9844c1f8e 100644
--- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IJoinPolicy.java
+++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IJoinPolicy.java
@@ -9,6 +9,7 @@
package org.eclipse.ecf.core.security;
+import java.net.SocketAddress;
import java.security.PermissionCollection;
import org.eclipse.ecf.core.identity.ID;
@@ -17,6 +18,7 @@ public interface IJoinPolicy extends IContainerPolicy {
/**
* Check join request
*
+ * @param socketaddress the SocketAddress for the remote client
* @param fromID
* the ID of the container making the join request
* @param targetID
@@ -30,6 +32,6 @@ public interface IJoinPolicy extends IContainerPolicy {
* @throws SecurityException
* if join is to be refused
*/
- public PermissionCollection checkJoin(ID fromID, ID targetID,
+ public PermissionCollection checkJoin(SocketAddress socketaddress, ID fromID, ID targetID,
String targetGroup, Object joinData) throws SecurityException;
}

Back to the top