Project JXTA

net.jxta.protocol
Class PeerInfoResponseMessage

java.lang.Object
  |
  +--net.jxta.protocol.PeerInfoResponseMessage

public abstract class PeerInfoResponseMessage
extends java.lang.Object

This abstract class define the PeerInfoService advertisement

This message is part of the Peer PeerInfoService protocol

 <xs:element name="PeerInfoResponse" type="jxta:PeerInfoResponse"/>

 <xs:complexType name="PeerInfoResponse">
     <xs:element name="sourcePid" type="xs:anyURI"/>
     <xs:element name="targetPid" type="xs:anyURI"/>
     <xs:element name="uptime" type="xs:unsignedLong" minOccurs="0"/>
     <xs:element name="timestamp" type="xs:unsignedLong" minOccurs="0"/>
     <xs:element name="response" type="xs:anyType" minOccurs="0"/>
 	   <xs:element name="traffic" type="jxta:piptraffic" minOccurs="0"/>
 </xs:complexType>

 <xs:complexType name="piptraffic">
     <xs:element name="lastIncomingMessageAt" type="xs:unsignedLong" minOccurs="0"/>
     <xs:element name="lastOutgoingMessageAt" type="xs:unsignedLong" minOccurs="0"/>
     <xs:element name="in" type="jxta:piptrafficinfo" minOccurs="0"/>
     <xs:element name="out" type="jxta:piptrafficinfo" minOccurs="0"/>
 </xs:complexType>

 <xs:complexType name="piptrafficinfo">
     <xs:element name="transport" type="xs:unsignedLong" maxOccurs="unbounded">
         <xs:attribute name="endptaddr" type="xs:anyURI"/>
     </xs:element>
 </xs:complexType>
 

Since:
JXTA 1.0

Constructor Summary
PeerInfoResponseMessage()
           
 
Method Summary
abstract  Document getDocument(MimeMediaType encodeAs)
           
 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.
 long getLastIncomingMessageTime()
          Get the time in milliseconds since this peer last recieved a message in milliseconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
 long getLastOutgoingMessageTime()
          Get the time in milliseconds since this peer last sent a message in milliseconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
static java.lang.String getMessageType()
          returns the Message type
 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.
 Element getResponse()
          returns the response
 ID getSourcePid()
          returns the sender's pid
 ID getTargetPid()
          returns the target pid
 long getTimestamp()
          returns the time when this peer was last polled
 long getUptime()
          returns the number of milliseconds 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(long t)
          Set the time in milliseconds since this peer last recieved a message in milliseconds since "the epoch", namely January 1, 1970, 00:00:00 GMT.
 void setLastOutgoingMessageTime(long t)
          Set the time in milliseconds since this peer last sent a message in milliseconds 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 setResponse(Element response)
          sets the request
 void setSourcePid(ID pid)
          sets the sender's pid
 void setTargetPid(ID pid)
          sets the target's pid
 void setTimestamp(long milliseconds)
          sets the time when this peer was last polled
 void setUptime(long milliseconds)
          sets the number of milliseconds since this peer was started
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeerInfoResponseMessage

public PeerInfoResponseMessage()
Method Detail

getMessageType

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

getSourcePid

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

setSourcePid

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

getTargetPid

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

setTargetPid

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

getResponse

public Element getResponse()
returns the response
Returns:
a structured document representing request
Since:
JXTA 1.0

setResponse

public void setResponse(Element response)
sets the request
Parameters:
request - a structured document representing a peerinfo request
Since:
JXTA 1.0

getUptime

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

setUptime

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

getTimestamp

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

setTimestamp

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

getLastIncomingMessageTime

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

setLastIncomingMessageTime

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

getLastOutgoingMessageTime

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

setLastOutgoingMessageTime

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

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

getDocument

public abstract Document getDocument(MimeMediaType encodeAs)

Project JXTA