Project JXTA

net.jxta.impl.rendezvous.edge
Class RdvConnection

java.lang.Object
  extended bynet.jxta.impl.rendezvous.PeerConnection
      extended bynet.jxta.impl.rendezvous.edge.RdvConnection
All Implemented Interfaces:
EventListener, OutgoingMessageEventListener

public class RdvConnection
extends PeerConnection

Manages a connection with a client or a rendezvous peer.


Field Summary
protected  long beginRenewalAt
           
protected  int cachedModCount
           
protected  PeerAdvertisement cachedPeerAdvertisement
           
protected  long leasedTil
           
 
Fields inherited from class net.jxta.impl.rendezvous.PeerConnection
cachedMessenger, connected, endpoint, group, peerid, peerName
 
Constructor Summary
RdvConnection(PeerGroup group, RendezVousServiceImpl rdvService, ID peer)
          Constructor for the PeerConnection object
 
Method Summary
 void connect(PeerAdvertisement padv, long leaseDuration, long earlyRenewal)
          Declare that we are connected.
 long getRenewal()
          Time at which the lease needs renewal in absolute milliseconds.
 boolean peerAdvertisementHasChanged()
           
protected  void setLease(long leaseDuration)
          Set the lease duration in relative milliseconds.
 void setLease(long leaseDuration, long earlyRenewal)
          Set the lease duration in relative milliseconds.
 String toString()
          
 
Methods inherited from class net.jxta.impl.rendezvous.PeerConnection
connect, equals, finalize, getCachedMessenger, getCachedMessenger, getLeaseEnd, getPeerID, getPeerName, hashCode, isConnected, messageSendFailed, messageSendSucceeded, sendMessage, setConnected, setPeerName
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

leasedTil

protected long leasedTil

beginRenewalAt

protected long beginRenewalAt

cachedPeerAdvertisement

protected PeerAdvertisement cachedPeerAdvertisement

cachedModCount

protected int cachedModCount
Constructor Detail

RdvConnection

public RdvConnection(PeerGroup group,
                     RendezVousServiceImpl rdvService,
                     ID peer)
Constructor for the PeerConnection object

Parameters:
group - group context
Method Detail

toString

public String toString()

Overrides:
toString in class PeerConnection

peerAdvertisementHasChanged

public boolean peerAdvertisementHasChanged()

setLease

protected void setLease(long leaseDuration)
Set the lease duration in relative milliseconds.

Overrides:
setLease in class PeerConnection
Parameters:
leaseDuration - the lease duration in relative milliseconds.

setLease

public void setLease(long leaseDuration,
                     long earlyRenewal)
Set the lease duration in relative milliseconds.

Parameters:
leaseDuration - the lease duration in relative milliseconds.
earlyRenewal - amount of time in relative milliseconds before lease end to begin renewal

connect

public void connect(PeerAdvertisement padv,
                    long leaseDuration,
                    long earlyRenewal)
Declare that we are connected.


getRenewal

public long getRenewal()
Time at which the lease needs renewal in absolute milliseconds.

Returns:
The lease value

JXTA J2SE