|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.impl.rendezvous.rpv.PeerViewDestination
net.jxta.impl.rendezvous.rpv.PeerViewElement
public final class PeerViewElement
An element of the PeerView.
The destination address (peerID) is part of PeerViewDestination, which implements the comparable interface. That makes it possible to sort and create ordered lists of PeerViewElements, and to search these lists while knowing only a destination address.
Constructor Summary | |
---|---|
PeerViewElement(EndpointService endpoint,
RdvAdvertisement radv)
Initialize from a RdvAdvertisement. |
Method Summary | |
---|---|
(package private) long |
getLastUpdateTime()
Return the time in absolute milliseconds at which we last updated this peer. |
RdvAdvertisement |
getRdvAdvertisement()
Get the encapsulated Peer Advertisement. |
boolean |
isAlive()
Return true if the remote peer is known to be alive,
false otherwise. |
(package private) boolean |
isInPeerView()
|
void |
messageSendFailed(OutgoingMessageEvent e)
The message identified by the event could not be sent. |
void |
messageSendSucceeded(OutgoingMessageEvent e)
The message identified by the event was successfully sent. |
boolean |
sendMessage(Message msg,
String serviceName,
String serviceParam)
Send a message to the peer which is represented by the current PeerViewElement. |
(package private) boolean |
setAlive(boolean live,
boolean doNotify)
Update the connection status based upon the result of the last message send. |
(package private) void |
setLastUpdateTime(long last)
Sets the time in absolute milliseconds at which we last updated this peer. |
(package private) void |
setPeerView(PeerView pv)
Sets the peerview |
(package private) RdvAdvertisement |
setRdvAdvertisement(RdvAdvertisement adv)
Set the encapsulated Peer Advertisement. |
String |
toString()
A simple implementation for debugging. |
Methods inherited from class net.jxta.impl.rendezvous.rpv.PeerViewDestination |
---|
compareTo, equals, getDestAddress, getPeerID, hashCode |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
PeerViewElement(EndpointService endpoint, RdvAdvertisement radv)
endpoint
- The endpoint service.radv
- the RdvAdvertisement from which to initializeMethod Detail |
---|
public String toString()
toString
in class Object
public void messageSendSucceeded(OutgoingMessageEvent e)
messageSendSucceeded
in interface OutgoingMessageEventListener
e
- the eventpublic void messageSendFailed(OutgoingMessageEvent e)
OutgoingMessageEvent.getFailure()
. Failures while sending
messages have several causes :
IOException
means that the messenger cannot
send the message and the messenger will accept no further messages
to be sent.RuntimeException
mean that the message was
not sent, but retries may or may not be possible based upon the
status returned by Messenger.isClosed()
.null
means that the message was not sent, but may
be retried. Usually the failure is due to local resource limits
being exceeded. Attempts may be made to later resend the message,
usually after waiting for congestion to clear.
messageSendFailed
in interface OutgoingMessageEventListener
e
- the eventpublic boolean isAlive()
true
if the remote peer is known to be alive,
false
otherwise.
true
if the remote peer is known to be
alive, false
otherwise.boolean setAlive(boolean live, boolean doNotify)
live
- The known liveness of our connection to this peer.doNotify
- true
will cause failure notifications to be sent.
false
makes notifications the caller's responsibility.
true
if a failure notification needs to be sent otherwise
false
.boolean isInPeerView()
void setPeerView(PeerView pv)
long getLastUpdateTime()
void setLastUpdateTime(long last)
public boolean sendMessage(Message msg, String serviceName, String serviceParam)
msg
- the message to sendserviceName
- the service name on the destination peer to
which the message will be demultiplexedserviceParam
- the service param on the destination peer
to which the message will be demultiplexed
public RdvAdvertisement getRdvAdvertisement()
RdvAdvertisement setRdvAdvertisement(RdvAdvertisement adv)
adv
- is the RdvAdvertisement to be set.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |