public class SimpleToken extends AuthToken
This is an example of using a preshared token for authentication purposes. All members of the group have to have the same string value in the JGroups config.
JGroups config parameters:
AuthToken,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TOKEN_ATTR |
| Constructor and Description |
|---|
SimpleToken() |
SimpleToken(java.lang.String token) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticate(AuthToken token,
Message msg)
This method should be implemented to perform the actual authentication of joining members.
|
java.lang.String |
getName()
Used to return the full package and class name of the implementation.
|
void |
readFrom(java.io.DataInputStream in)
Required to deserialize the object when read in from the wire
|
void |
setValue(java.util.Properties properties)
Called during the setup of the AUTH protocol to pass property values from the JGroups config XML document to the implementing class.
|
void |
writeTo(java.io.DataOutputStream out)
Required to serialize the object to pass across the wire
|
public static final java.lang.String TOKEN_ATTR
public SimpleToken()
public SimpleToken(java.lang.String token)
public void setValue(java.util.Properties properties)
AuthTokenpublic java.lang.String getName()
AuthTokenpublic boolean authenticate(AuthToken token, Message msg)
AuthTokenauthenticate in class AuthTokentoken - the token sent by the joinermsg - the Message object containing the actual JOIN_REQpublic void writeTo(java.io.DataOutputStream out)
throws java.io.IOException
out - java.io.IOExceptionpublic void readFrom(java.io.DataInputStream in)
throws java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
in - java.io.IOExceptionjava.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionCopyright ? 1998-2008 Bela Ban. All Rights Reserved.