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 FormConstructor and Description |
---|
SimpleToken() |
SimpleToken(String authvalue) |
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.
|
String |
getAuthValue() |
String |
getName()
Used to return the full package and class name of the implementation.
|
void |
readFrom(DataInputStream in)
Required to deserialize the object when read in from the wire
|
void |
setAuthValue(String auth_value) |
void |
writeTo(DataOutputStream out)
Required to serialize the object to pass across the wire
|
public SimpleToken()
public SimpleToken(String authvalue)
public String getName()
AuthToken
public String getAuthValue()
public void setAuthValue(String auth_value)
public boolean authenticate(AuthToken token, Message msg)
AuthToken
authenticate
in class AuthToken
token
- the token sent by the joinermsg
- the Message object containing the actual JOIN_REQpublic void writeTo(DataOutputStream out) throws IOException
out
- IOException
public void readFrom(DataInputStream in) throws IOException, IllegalAccessException, InstantiationException
in
- IOException
IllegalAccessException
InstantiationException
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.