User: pra
Date: 02/03/06 09:27:50
Modified: src/main/org/jboss/mq/il/uil UILServerIL.java
UILServerILService.java
Log:
Commit of JBossMQ new JAAS based security architecture
Revision Changes Path
1.7 +24 -4 jbossmq/src/main/org/jboss/mq/il/uil/UILServerIL.java
Index: UILServerIL.java
===================================================================
RCS file: /cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/uil/UILServerIL.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- UILServerIL.java 2 Feb 2002 04:02:23 -0000 1.6
+++ UILServerIL.java 6 Mar 2002 17:27:50 -0000 1.7
@@ -30,14 +30,14 @@
import org.jboss.mq.il.ServerIL;
import org.jboss.mq.il.uil.multiplexor.SocketMultiplexor;
-import org.jboss.mq.server.JMSServer;
/**
* The JVM implementation of the ServerIL object
*
* @author Hiram Chirino ([EMAIL PROTECTED])
* @author Norbert Lataille ([EMAIL PROTECTED])
- * @version $Revision: 1.6 $
+ * @author <a href="[EMAIL PROTECTED]">Peter Antman</a>
+ * @version $Revision: 1.7 $
* @created August 16, 2001
*/
public class UILServerIL implements java.io.Serializable, Cloneable,
org.jboss.mq.il.ServerIL
@@ -62,6 +62,7 @@
final static int m_destroySubscription = 19;
final static int m_checkUser = 20;
final static int m_ping = 21;
+ final static int m_authenticate = 22;
/**
* Description of the Field
@@ -267,7 +268,26 @@
out.writeObject(password);
return (String)waitAnswer();
}
-
+
+ /**
+ * Authenticate the user
+ *
+ * @param userName Description of Parameter
+ * @param password Description of Parameter
+ * @return a sessionID
+ * @exception JMSException Description of Exception
+ * @exception Exception Description of Exception
+ */
+ public synchronized String authenticate(String userName, String password)
+ throws JMSException, Exception
+ {
+ checkConnection();
+ out.writeByte(m_authenticate);
+ out.writeObject(userName);
+ out.writeObject(password);
+ return (String)waitAnswer();
+ }
+
/**
* #Description of the Method
*
@@ -369,7 +389,7 @@
* @exception JMSException Description of Exception
* @exception Exception Description of Exception
*/
- public synchronized void destroySubscription(DurableSubscriptionID id)
+ public synchronized void destroySubscription(ConnectionToken
dc,DurableSubscriptionID id)
throws JMSException, Exception
{
checkConnection();
1.18 +18 -7 jbossmq/src/main/org/jboss/mq/il/uil/UILServerILService.java
Index: UILServerILService.java
===================================================================
RCS file:
/cvsroot/jboss/jbossmq/src/main/org/jboss/mq/il/uil/UILServerILService.java,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- UILServerILService.java 17 Feb 2002 17:51:17 -0000 1.17
+++ UILServerILService.java 6 Mar 2002 17:27:50 -0000 1.18
@@ -40,13 +40,14 @@
import org.jboss.mq.il.ServerILJMXService;
import org.jboss.mq.il.ServerILFactory;
import org.jboss.mq.il.uil.multiplexor.SocketMultiplexor;
-import org.jboss.mq.server.JMSServer;
+import org.jboss.mq.server.JMSServerInvoker;
/**
* Implements the ServerILJMXService which is used to manage the JVM IL.
*
* @author Hiram Chirino ([EMAIL PROTECTED])
- * @version $Revision: 1.17 $
+ * @author <a href="[EMAIL PROTECTED]">Peter Antman</a>
+ * @version $Revision: 1.18 $
*/
public class UILServerILService extends org.jboss.mq.il.ServerILJMXService
implements Runnable, UILServerILServiceMBean
{
@@ -54,7 +55,8 @@
/**
* Description of the Field
*/
- protected static JMSServer server;
+ // protected static JMSServerInvoker server;
+ protected JMSServerInvoker server;
final static int m_acknowledge = 1;
final static int m_addMessage = 2;
@@ -77,7 +79,8 @@
final static int m_destroySubscription = 19;
final static int m_checkUser = 20;
final static int m_ping = 21;
-
+ final static int m_authenticate = 22;
+
final static int SO_TIMEOUT = 5000;
/**
* Description of the Field
@@ -236,7 +239,10 @@
result = server.browse(connectionToken,
(Destination)in.readObject(), (String)in.readObject());
break;
case m_checkID:
- server.checkID((String)in.readObject());
+ String ID = (String)in.readObject();
+ server.checkID(ID);
+ if (connectionToken != null)
+ connectionToken.setClientID(ID);
break;
case m_connectionClosing:
server.connectionClosing(connectionToken);
@@ -253,6 +259,8 @@
break;
case m_getID:
result = server.getID();
+ if (connectionToken != null)
+ connectionToken.setClientID((String)result);
break;
case m_getTemporaryQueue:
result =
(TemporaryQueue)server.getTemporaryQueue(connectionToken);
@@ -278,7 +286,7 @@
server.unsubscribe(connectionToken, in.readInt());
break;
case m_destroySubscription:
-
server.destroySubscription((DurableSubscriptionID)in.readObject());
+
server.destroySubscription(connectionToken,(DurableSubscriptionID)in.readObject());
break;
case m_checkUser:
result = server.checkUser((String)in.readObject(),
(String)in.readObject());
@@ -286,6 +294,9 @@
case m_ping:
server.ping(connectionToken, in.readLong());
break;
+ case m_authenticate:
+ result = server.authenticate((String)in.readObject(),
(String)in.readObject());
+ break;
default:
throw new RemoteException("Bad method code !");
}
@@ -384,7 +395,7 @@
InetAddress socketAddress = serverSocket.getInetAddress();
log.info("JBossMQ UIL service available at : " + socketAddress + ":" +
serverSocket.getLocalPort());
- worker = new Thread(server.threadGroup, this, "UIL Worker");
+ worker = new Thread(server.getThreadGroup(), this, "UIL Worker");
worker.start();
/* We need to check the socketAddress against "0.0.0.0/0.0.0.0"
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development