ants.p2p.security
Class EndpointSecurityManager

java.lang.Object
  extended by java.lang.Thread
      extended by ants.p2p.security.EndpointSecurityManager
All Implemented Interfaces:
java.lang.Comparable, java.lang.Runnable

public class EndpointSecurityManager
extends java.lang.Thread
implements java.lang.Comparable


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static java.lang.String cipher
           
static int cipherKeySize
           
static int DHKeyExchangeBits
           
static long inactivityTimeout
           
static int MinDHKeyExchangeBits
           
static long refreshInterval
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
EndpointSecurityManager(WarriorAnt n, SecurityRequestMessage srm)
           
EndpointSecurityManager(WarriorAnt n, java.lang.String peerId)
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 javax.crypto.Cipher getCipherDec()
           
 javax.crypto.Cipher getCipherEnc()
           
 long getLastTimeUsed()
           
 java.lang.String getPeerId()
           
 Message getSecurityMessage()
           
 boolean isRequirer()
           
 void processSecurityRequestMessage(SecurityRequestMessage srm)
           
 void processSecurityResponseMessage(SecurityResponseMessage srm)
           
 void resetLastTimeUsed()
           
 void run()
           
 void sendSecurityRequest()
           
 void setLastTimeUsed()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cipher

public static final java.lang.String cipher
See Also:
Constant Field Values

cipherKeySize

public static final int cipherKeySize
See Also:
Constant Field Values

DHKeyExchangeBits

public static final int DHKeyExchangeBits
See Also:
Constant Field Values

MinDHKeyExchangeBits

public static final int MinDHKeyExchangeBits
See Also:
Constant Field Values

inactivityTimeout

public static final long inactivityTimeout
See Also:
Constant Field Values

refreshInterval

public static final long refreshInterval
See Also:
Constant Field Values
Constructor Detail

EndpointSecurityManager

public EndpointSecurityManager(WarriorAnt n,
                               java.lang.String peerId)
                        throws java.lang.Exception
Throws:
java.lang.Exception

EndpointSecurityManager

public EndpointSecurityManager(WarriorAnt n,
                               SecurityRequestMessage srm)
                        throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

getLastTimeUsed

public long getLastTimeUsed()

resetLastTimeUsed

public void resetLastTimeUsed()

setLastTimeUsed

public void setLastTimeUsed()

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

getPeerId

public java.lang.String getPeerId()

isRequirer

public boolean isRequirer()

sendSecurityRequest

public void sendSecurityRequest()
                         throws java.lang.Exception
Throws:
java.lang.Exception

getSecurityMessage

public Message getSecurityMessage()

processSecurityResponseMessage

public void processSecurityResponseMessage(SecurityResponseMessage srm)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

getCipherEnc

public javax.crypto.Cipher getCipherEnc()

getCipherDec

public javax.crypto.Cipher getCipherDec()

processSecurityRequestMessage

public void processSecurityRequestMessage(SecurityRequestMessage srm)
                                   throws java.lang.Exception
Throws:
java.lang.Exception