Project JXTA

net.jxta.protocol
Class PeerInfoAdvertisement

java.lang.Object
  |
  +--net.jxta.document.Advertisement
        |
        +--net.jxta.protocol.PeerInfoAdvertisement

public abstract class PeerInfoAdvertisement
extends Advertisement


Constructor Summary
PeerInfoAdvertisement()
           
 
Method Summary
static java.lang.String getAdvertisementType()
          returns the advertisement type
 java.util.Enumeration getIncomingTrafficChannels()
          Get an enumeration of incoming traffic channels on this peer.
 long getIncomingTrafficOnChannel(java.lang.String channel)
          Get the number of bytes recieved on the specified channel.
 int getLastIncomingMessageTime()
          Get the time in seconds since this peer last recieved a message in seconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
 int getLastOutgoingMessageTime()
          Get the time in seconds since this peer last sent a message in seconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
 java.util.Enumeration getOutgoingTrafficChannels()
          Get an enumeration of outgoing traffic channels on this peer.
 long getOutgoingTrafficOnChannel(java.lang.String channel)
          Get the number of bytes sent on the specified channel.
 java.lang.String getSourcePid()
          returns the sender's pid
 java.lang.String getTargetPid()
          returns the target pid
 int getTimestamp()
          returns the time when this peer was last polled
 int getUptime()
          returns the number of seconds since this peer was started
 void setIncomingTrafficElement(java.lang.String channel, long bytes)
          Set the number of bytes recieved on the specified channel.
 void setLastIncomingMessageTime(int t)
          Set the time in seconds since this peer last recieved a message in seconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
 void setLastOutgoingMessageTime(int t)
          Set the time in seconds since this peer last sent a message in seconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
 void setOutgoingTrafficElement(java.lang.String channel, long bytes)
          Set the number of bytes sent on the specified channel.
 void setSourcePid(java.lang.String pid)
          sets the sender's pid
 void setTargetPid(java.lang.String pid)
          sets the target's pid
 void setTimestamp(int seconds)
          sets the time when this peer was last polled
 void setUptime(int seconds)
          sets the number of seconds since this peer was started
 
Methods inherited from class net.jxta.document.Advertisement
getDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeerInfoAdvertisement

public PeerInfoAdvertisement()
Method Detail

getAdvertisementType

public static java.lang.String getAdvertisementType()
returns the advertisement type
Returns:
a string
Since:
JXTA 1.0

getSourcePid

public java.lang.String getSourcePid()
returns the sender's pid
Returns:
a string representing the peer's id
Since:
JXTA 1.0

setSourcePid

public void setSourcePid(java.lang.String pid)
sets the sender's pid
Parameters:
pid - a string representing a peer's id
Since:
JXTA 1.0

getTargetPid

public java.lang.String getTargetPid()
returns the target pid
Returns:
a string representing the peer's id
Since:
JXTA 1.0

setTargetPid

public void setTargetPid(java.lang.String pid)
sets the target's pid
Parameters:
pid - a string representing a peer's id
Since:
JXTA 1.0

getUptime

public int getUptime()
returns the number of seconds since this peer was started
Returns:
the number of seconds
Since:
JXTA 1.0

setUptime

public void setUptime(int seconds)
sets the number of seconds since this peer was started
Parameters:
seconds - the number of seconds since this peer was started
Since:
JXTA 1.0

getTimestamp

public int getTimestamp()
returns the time when this peer was last polled
Returns:
int time in seconds when this peer was last polled in seconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
Since:
JXTA 1.0

setTimestamp

public void setTimestamp(int seconds)
sets the time when this peer was last polled
Parameters:
seconds - time in seconds when this peer was last polled in seconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
Since:
JXTA 1.0

getLastIncomingMessageTime

public int getLastIncomingMessageTime()
Get the time in seconds since this peer last recieved a message in seconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
Returns:
time in seconds

setLastIncomingMessageTime

public void setLastIncomingMessageTime(int t)
Set the time in seconds since this peer last recieved a message in seconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
Parameters:
t - time in seconds

getLastOutgoingMessageTime

public int getLastOutgoingMessageTime()
Get the time in seconds since this peer last sent a message in seconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
Returns:
time in seconds

setLastOutgoingMessageTime

public void setLastOutgoingMessageTime(int t)
Set the time in seconds since this peer last sent a message in seconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
Parameters:
t - time in seconds

getIncomingTrafficChannels

public java.util.Enumeration getIncomingTrafficChannels()
Get an enumeration of incoming traffic channels on this peer. A channel represents traffic generated by a particular service. A service may open more than one data channel.
Returns:
an enumeration of String

getIncomingTrafficOnChannel

public long getIncomingTrafficOnChannel(java.lang.String channel)
Get the number of bytes recieved on the specified channel.
Returns:
number of bytes recieved

setIncomingTrafficElement

public void setIncomingTrafficElement(java.lang.String channel,
                                      long bytes)
Set the number of bytes recieved on the specified channel.
Parameters:
channel - service name
long - number of bytes recieved

getOutgoingTrafficChannels

public java.util.Enumeration getOutgoingTrafficChannels()
Get an enumeration of outgoing traffic channels on this peer. A channel represents traffic generated by a particular service. A service may open more than one data channel.
Returns:
an enumeration of String

getOutgoingTrafficOnChannel

public long getOutgoingTrafficOnChannel(java.lang.String channel)
Get the number of bytes sent on the specified channel.
Returns:
number of bytes sent

setOutgoingTrafficElement

public void setOutgoingTrafficElement(java.lang.String channel,
                                      long bytes)
Set the number of bytes sent on the specified channel.
Parameters:
channel - service name
long - number of bytes sent

Project JXTA