KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgroups > auth > AuthToken


1 package org.jgroups.auth;
2
3 import org.jgroups.util.Streamable;
4 import org.jgroups.Message;
5 import org.apache.commons.logging.Log;
6 import org.apache.commons.logging.LogFactory;
7
8 import java.io.Serializable JavaDoc;
9 import java.util.Properties JavaDoc;
10 /**
11  * Abstract AuthToken class used by implementations of AUTH, e.g. SimpleToken, X509Token1_5
12  * @author Chris Mills
13  */

14 public abstract class AuthToken implements Serializable JavaDoc, Streamable{
15     protected final Log log = LogFactory.getLog(this.getClass());
16     /**
17      * Used to return the full package and class name of the implementation. This is used by the AUTH protocol to create an instance of the implementation.
18      * @return a java.lang.String object of the package and class name
19      */

20     public abstract String JavaDoc getName();
21     /**
22      * Called during the setup of the AUTH protocol to pass property values from the JGroups config XML document to the implementing class.
23      * @param properties a java.util.Properties object of config parameters
24      */

25     public abstract void setValue(Properties JavaDoc properties);
26     /**
27      * This method should be implemented to perform the actual authentication of joining members.
28      * @param token the token sent by the joiner
29      * @param msg the Message object containing the actual JOIN_REQ
30      * @return true if authenticaion passed or false if it failed.
31      */

32     public abstract boolean authenticate(AuthToken token, Message msg);
33 }
34
Popular Tags