|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.auth.AuthToken org.jgroups.auth.DemoToken
public class DemoToken
AuthToken implementation which shows how to send messages back and forth in order to perform authentication. Could be used as a template for a challenge-response based AuthToken impl.
Nested Class Summary | |
---|---|
static class |
DemoToken.DemoHeader
|
protected static class |
DemoToken.Entry
|
Field Summary | |
---|---|
protected long |
block_time
|
protected static short |
ID
|
protected java.util.Map<Address,DemoToken.Entry> |
pending_requests
|
Fields inherited from class org.jgroups.auth.AuthToken |
---|
auth, log |
Constructor Summary | |
---|---|
DemoToken()
|
Method Summary | |
---|---|
boolean |
authenticate(AuthToken token,
Message msg)
This method should be implemented to perform the actual authentication of joining members. |
protected static byte[] |
encrypt(byte[] buf)
|
protected static byte[] |
generateRandomBytes()
|
java.lang.String |
getName()
Used to return the full package and class name of the implementation. |
boolean |
handleUpEvent(Event evt)
Called when an up event has been received |
protected static long |
hash(byte[] buf)
|
void |
init()
|
void |
readFrom(java.io.DataInput in)
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed |
int |
size()
The size of the marshalled AuthToken |
void |
writeTo(java.io.DataOutput out)
Write the entire state of the current object (including superclasses) to outstream. |
Methods inherited from class org.jgroups.auth.AuthToken |
---|
setAuth |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final short ID
protected long block_time
protected final java.util.Map<Address,DemoToken.Entry> pending_requests
Constructor Detail |
---|
public DemoToken()
Method Detail |
---|
public java.lang.String getName()
AuthToken
getName
in class AuthToken
public void init()
init
in class AuthToken
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_REQ
public void writeTo(java.io.DataOutput out) throws java.lang.Exception
Streamable
writeTo
in interface Streamable
java.lang.Exception
public void readFrom(java.io.DataInput in) throws java.lang.Exception
Streamable
readFrom
in interface Streamable
java.lang.Exception
public int size()
AuthToken
size
in class AuthToken
public boolean handleUpEvent(Event evt)
AUTH.UpHandler
handleUpEvent
in interface AUTH.UpHandler
evt
- the event
protected static byte[] generateRandomBytes()
protected static byte[] encrypt(byte[] buf)
protected static long hash(byte[] buf)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |