public class DemoToken extends AuthToken implements AUTH.UpHandler
| 限定符和类型 | 类和说明 |
|---|---|
static class |
DemoToken.DemoHeader |
protected static class |
DemoToken.Entry |
| 限定符和类型 | 字段和说明 |
|---|---|
protected long |
block_time |
protected static short |
ID |
protected java.util.Map<Address,DemoToken.Entry> |
pending_requests |
| 构造器和说明 |
|---|
DemoToken() |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
protected static final short ID
protected long block_time
protected final java.util.Map<Address,DemoToken.Entry> pending_requests
public java.lang.String getName()
AuthTokenpublic boolean authenticate(AuthToken token, Message msg)
AuthTokenauthenticate 在类中 AuthTokentoken - the token sent by the joinermsg - the Message object containing the actual JOIN_REQpublic void writeTo(java.io.DataOutput out)
throws java.lang.Exception
StreamablewriteTo 在接口中 Streamablejava.lang.Exceptionpublic void readFrom(java.io.DataInput in)
throws java.lang.Exception
StreamablereadFrom 在接口中 Streamablejava.lang.Exceptionpublic int size()
AuthTokenpublic boolean handleUpEvent(Event evt)
AUTH.UpHandlerhandleUpEvent 在接口中 AUTH.UpHandlerevt - the eventprotected static byte[] generateRandomBytes()
protected static byte[] encrypt(byte[] buf)
protected static long hash(byte[] buf)