ants.p2p
Class NeighbourAnt
java.lang.Object
java.lang.Thread
ants.p2p.NeighbourAnt
- All Implemented Interfaces:
- Neighbour, java.lang.Runnable
public class NeighbourAnt
- extends java.lang.Thread
- implements Neighbour
Nested classes/interfaces inherited from class java.lang.Thread |
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary |
NeighbourAnt(Ant local,
java.lang.String ip,
int port,
int remoteServerPort,
javax.crypto.Cipher enc,
javax.crypto.Cipher dec,
java.net.Socket s,
boolean isRequirer,
long timeElapsed)
|
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, yield |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
bandwidthLimit
public static int bandwidthLimit
queryBandwidthLimit
public static int queryBandwidthLimit
maxQueryRatePerMinute
public static final int maxQueryRatePerMinute
- See Also:
- Constant Field Values
totalCompressedSizeOut
public static double totalCompressedSizeOut
totalUncompressionSizeOut
public static double totalUncompressionSizeOut
totalCompressedSizeIn
public static double totalCompressedSizeIn
totalUncompressionSizeIn
public static double totalUncompressionSizeIn
totalQueryCompressedSizeOut
public static double totalQueryCompressedSizeOut
totalQueryCompressedSizeIn
public static double totalQueryCompressedSizeIn
totalDataCompressedSizeOut
public static double totalDataCompressedSizeOut
totalDataCompressedSizeIn
public static double totalDataCompressedSizeIn
totalControlCompressedSizeOut
public static double totalControlCompressedSizeOut
totalControlCompressedSizeIn
public static double totalControlCompressedSizeIn
totalDownloaded
public static double totalDownloaded
totalUploaded
public static double totalUploaded
NeighbourAnt
public NeighbourAnt(Ant local,
java.lang.String ip,
int port,
int remoteServerPort,
javax.crypto.Cipher enc,
javax.crypto.Cipher dec,
java.net.Socket s,
boolean isRequirer,
long timeElapsed)
throws java.io.IOException
- Throws:
java.io.IOException
incQueuedMessages
public void incQueuedMessages()
- Specified by:
incQueuedMessages
in interface Neighbour
decQueuedMessages
public void decQueuedMessages()
- Specified by:
decQueuedMessages
in interface Neighbour
getQueuedMessages
public long getQueuedMessages()
- Specified by:
getQueuedMessages
in interface Neighbour
getTimeElapsed
public long getTimeElapsed()
getLastProbedAt
public long getLastProbedAt()
getLastActiveDownloadTime
public long getLastActiveDownloadTime()
getLastActiveUploadTime
public long getLastActiveUploadTime()
setLastActiveDownloadTime
public void setLastActiveDownloadTime()
setLastActiveUploadTime
public void setLastActiveUploadTime()
isConnected
public boolean isConnected()
isRequirer
public boolean isRequirer()
terminate
public void terminate()
getIdent
public java.lang.String getIdent()
- Specified by:
getIdent
in interface Neighbour
getAnt
public Ant getAnt()
- Specified by:
getAnt
in interface Neighbour
getRemoteId
public java.lang.String getRemoteId()
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
route
public SenderThread route(Message m)
- Specified by:
route
in interface Neighbour
send
public void send(Message m)
throws java.lang.Exception
- Specified by:
send
in interface Neighbour
- Throws:
java.lang.Exception
updateOutStats
public static void updateOutStats(Message m,
long size)
updateInStats
public static void updateInStats(Message m,
long size)
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
- Overrides:
run
in class java.lang.Thread
setFailure
public void setFailure()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Thread
getTotalCompressionGainOut
public static int getTotalCompressionGainOut()
getTotalCompressionGainIn
public static int getTotalCompressionGainIn()