|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.MessageHistory
public class MessageHistory
Simply act as a pen register of messages sent in and out of the router. This will be pulled out later on, but is useful now for debugging. (with clock synchronization, this will generate a log that can be used to analyze the entire network, if everyone provides their logs honestly)
Field Summary | |
---|---|
static boolean |
DEFAULT_KEEP_MESSAGE_HISTORY
|
static java.lang.String |
DEFAULT_MESSAGE_HISTORY_FILENAME
|
static java.lang.String |
PROP_KEEP_MESSAGE_HISTORY
config property determining whether we want to debug with the message history |
static java.lang.String |
PROP_MESSAGE_HISTORY_FILENAME
config property determining where we want to log the message history, if we're keeping one |
Constructor Summary | |
---|---|
MessageHistory(RouterContext context)
|
Method Summary | |
---|---|
void |
droppedFragmentedMessage(long messageId,
java.lang.String status)
|
void |
droppedInboundMessage(long messageId,
Hash from,
java.lang.String info)
|
void |
droppedOtherMessage(I2NPMessage message,
Hash from)
We received another message we weren't waiting for and don't know how to handle |
void |
droppedTunnelDataMessageUnknown(long msgId,
long tunnelId)
|
void |
droppedTunnelGatewayMessageUnknown(long msgId,
long tunnelId)
|
void |
droppedTunnelMessage(TunnelId id,
long msgId,
java.util.Date expiration,
Hash from)
We don't know about the given tunnel, so we are dropping a message sent to us by the given router |
void |
fragmentMessage(long messageId,
int numFragments,
int totalLength,
java.util.List messageIds,
java.lang.Object tunnel,
java.lang.String msg)
|
void |
fragmentMessage(long messageId,
int numFragments,
int totalLength,
java.util.List messageIds,
java.lang.String msg)
|
(package private) boolean |
getDoLog()
|
(package private) java.lang.String |
getFilename()
|
void |
initialize(boolean forceReinitialize)
Initialize the message history according to the router's configuration. |
static void |
main(java.lang.String[] args)
|
void |
messageProcessingError(long messageId,
java.lang.String messageType,
java.lang.String error)
There was an error processing the given message that was received |
void |
receiveMessage(java.lang.String messageType,
long messageId,
long expiration,
boolean isValid)
|
void |
receiveMessage(java.lang.String messageType,
long messageId,
long expiration,
Hash from,
boolean isValid)
We just received a message from the peer |
void |
receivePayloadMessage(long messageId)
Receive a payload message to distribute to a client |
void |
receiveTunnelCreate(TunnelId createTunnel,
Hash nextPeer,
java.util.Date expire,
boolean ok,
Hash sourceRoutePeer)
The local router has received a request to join the createTunnel with the next hop being nextPeer, and we should send our decision to join it through sourceRoutePeer |
void |
receiveTunnelFragment(long messageId,
int fragmentId,
java.lang.Object status)
|
void |
receiveTunnelFragmentComplete(long messageId)
|
void |
replyTimedOut(OutNetMessage sentMessage)
The message wanted a reply but no reply came in the time expected |
void |
requestTunnelCreate(TunnelId createTunnel,
TunnelId outTunnel,
Hash peerRequested,
Hash nextPeer,
TunnelId replyTunnel,
Hash replyThrough)
We are requesting that the peerRequested create the tunnel specified with the given nextPeer, and we are sending that request to them through outTunnel with a request that the reply is sent back to us through replyTunnel on the given replyThrough router. |
void |
sendMessage(java.lang.String messageType,
long messageId,
long expiration,
Hash peer,
boolean sentOk,
java.lang.String info)
We just sent a message to the peer |
void |
sendPayloadMessage(long messageId,
boolean successfullySent,
long timeToSend)
Note that the sending of a payload message completed (successfully or as a failure) |
(package private) void |
setDoLog(boolean log)
|
(package private) void |
setPauseFlushes(boolean doPause)
|
void |
shitlist(Hash peer,
java.lang.String reason)
We shitlisted the peer |
void |
tunnelDispatched(long messageId,
long tunnelId,
long toTunnel,
Hash toPeer,
java.lang.String type)
|
void |
tunnelDispatched(long messageId,
long innerMessageId,
long tunnelId,
java.lang.String type)
|
void |
tunnelDispatched(long messageId,
long tunnelId,
java.lang.String type)
|
void |
tunnelDispatched(java.lang.String info)
|
void |
tunnelFailed(TunnelId tunnel)
The local router has detected a failure in the given tunnel |
void |
tunnelJoined(java.lang.String state,
HopConfig tunnel)
The local router has joined the given tunnel operating in the given state. |
void |
tunnelJoined(java.lang.String state,
TunnelInfo tunnel)
The local router has joined the given tunnel operating in the given state. |
void |
tunnelParticipantRejected(Hash peer,
java.lang.String msg)
|
void |
tunnelRejected(Hash peer,
TunnelId tunnel,
Hash replyThrough,
java.lang.String reason)
The peer did not accept the tunnel join for the given reason |
void |
tunnelRequestTimedOut(Hash peer,
TunnelId tunnel)
The peer did not accept the tunnel join for the given reason (this may be because of a timeout or an explicit refusal). |
void |
tunnelValid(TunnelInfo tunnel,
long timeToTest)
Note that we have reason to believe that the given tunnel is valid, since we could do something through it in the given amount of time |
void |
unshitlist(Hash peer)
We unshitlisted the peer |
void |
wrap(java.lang.String bodyMessageType,
long bodyMessageId,
java.lang.String containerMessageType,
long containerMessageId)
Note that we're wrapping the given message within another message (via tunnel/garlic) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROP_KEEP_MESSAGE_HISTORY
public static final boolean DEFAULT_KEEP_MESSAGE_HISTORY
public static final java.lang.String PROP_MESSAGE_HISTORY_FILENAME
public static final java.lang.String DEFAULT_MESSAGE_HISTORY_FILENAME
Constructor Detail |
---|
public MessageHistory(RouterContext context)
Method Detail |
---|
void setDoLog(boolean log)
boolean getDoLog()
void setPauseFlushes(boolean doPause)
java.lang.String getFilename()
public void initialize(boolean forceReinitialize)
public void requestTunnelCreate(TunnelId createTunnel, TunnelId outTunnel, Hash peerRequested, Hash nextPeer, TunnelId replyTunnel, Hash replyThrough)
createTunnel
- tunnel being createdoutTunnel
- tunnel we are sending this request outpeerRequested
- peer asked to participate in the tunnelnextPeer
- who peerRequested should forward messages to (or null if it is the endpoint)replyTunnel
- the tunnel sourceRoutePeer should forward the source routed message toreplyThrough
- the gateway of the tunnel that the sourceRoutePeer will be sending topublic void receiveTunnelCreate(TunnelId createTunnel, Hash nextPeer, java.util.Date expire, boolean ok, Hash sourceRoutePeer)
createTunnel
- tunnel being joinednextPeer
- next hop in the tunnel (or null if this is the endpoint)expire
- when this tunnel expiresok
- whether we will join the tunnelsourceRoutePeer
- peer through whom we should send our garlic routed ok throughpublic void tunnelJoined(java.lang.String state, TunnelInfo tunnel)
state
- {"free inbound", "allocated inbound", "inactive inbound", "outbound", "participant", "pending"}tunnel
- tunnel joinedpublic void tunnelJoined(java.lang.String state, HopConfig tunnel)
state
- {"free inbound", "allocated inbound", "inactive inbound", "outbound", "participant", "pending"}tunnel
- tunnel joinedpublic void tunnelDispatched(java.lang.String info)
public void tunnelDispatched(long messageId, long tunnelId, java.lang.String type)
public void tunnelDispatched(long messageId, long tunnelId, long toTunnel, Hash toPeer, java.lang.String type)
public void tunnelDispatched(long messageId, long innerMessageId, long tunnelId, java.lang.String type)
public void tunnelFailed(TunnelId tunnel)
tunnel
- tunnel failedpublic void tunnelValid(TunnelInfo tunnel, long timeToTest)
tunnel
- tunnel in questiontimeToTest
- milliseconds to verify the tunnelpublic void tunnelRejected(Hash peer, TunnelId tunnel, Hash replyThrough, java.lang.String reason)
public void tunnelParticipantRejected(Hash peer, java.lang.String msg)
public void tunnelRequestTimedOut(Hash peer, TunnelId tunnel)
public void droppedTunnelMessage(TunnelId id, long msgId, java.util.Date expiration, Hash from)
id
- tunnel ID we received a message forfrom
- peer that sent us this message (if known)public void droppedOtherMessage(I2NPMessage message, Hash from)
public void droppedInboundMessage(long messageId, Hash from, java.lang.String info)
public void replyTimedOut(OutNetMessage sentMessage)
sentMessage
- message sent that didn't receive a replypublic void messageProcessingError(long messageId, java.lang.String messageType, java.lang.String error)
messageId
- message receivedmessageType
- type of message receivederror
- error message related to the processing of the messagepublic void shitlist(Hash peer, java.lang.String reason)
public void unshitlist(Hash peer)
public void sendMessage(java.lang.String messageType, long messageId, long expiration, Hash peer, boolean sentOk, java.lang.String info)
messageType
- class name for the message object (e.g. DatabaseFindNearestMessage, TunnelMessage, etc)messageId
- the unique message id of the message being sent (not including any tunnel or garlic wrapped
message ids)expiration
- the expiration for the message sentpeer
- router that the message was sent tosentOk
- whether the message was sent successfullypublic void receiveMessage(java.lang.String messageType, long messageId, long expiration, Hash from, boolean isValid)
messageType
- class name for the message object (e.g. DatabaseFindNearestMessage, TunnelMessage, etc)messageId
- the unique message id of the message received (not including any tunnel or garlic wrapped
message ids)expiration
- the expiration for the message receivedfrom
- router that the message was sent from (or null if we don't know)isValid
- whether the message is valid (non duplicates, etc)public void receiveMessage(java.lang.String messageType, long messageId, long expiration, boolean isValid)
public void wrap(java.lang.String bodyMessageType, long bodyMessageId, java.lang.String containerMessageType, long containerMessageId)
bodyMessageType
- class name for the message contained (e.g. DatabaseFindNearestMessage, DataMessage, etc)bodyMessageId
- the unique message id of the messagecontainerMessageType
- class name for the message containing the body message (e.g. TunnelMessage, GarlicMessage, etc)containerMessageId
- the unique message id of the messagepublic void receivePayloadMessage(long messageId)
public void sendPayloadMessage(long messageId, boolean successfullySent, long timeToSend)
messageId
- message that the payload message was sent insuccessfullySent
- whether the message was delivered to the peer successfullytimeToSend
- how long it took to send the messagepublic void receiveTunnelFragment(long messageId, int fragmentId, java.lang.Object status)
public void receiveTunnelFragmentComplete(long messageId)
public void droppedFragmentedMessage(long messageId, java.lang.String status)
public void fragmentMessage(long messageId, int numFragments, int totalLength, java.util.List messageIds, java.lang.String msg)
public void fragmentMessage(long messageId, int numFragments, int totalLength, java.util.List messageIds, java.lang.Object tunnel, java.lang.String msg)
public void droppedTunnelDataMessageUnknown(long msgId, long tunnelId)
public void droppedTunnelGatewayMessageUnknown(long msgId, long tunnelId)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |