Project JXTA

net.jxta.impl.endpoint
Interface TransportProtocol

All Known Implementing Classes:
HttpTransport, TcpTransport

public interface TransportProtocol

This interface defines the API that must implement all the Transport Protocols Messangers


Method Summary
 void close()
          closes this TransportProtocol.
 net.jxta.endpoint.EndpointAddress getLocalAddress()
          Returns an EndpointAddress of the local endpoint manage by the TransportProtocol
 EndpointMessanger getMessanger(net.jxta.endpoint.EndpointAddress dest, java.lang.String destPeerId, int type)
          Creates and return an EndpointMessanger for sending Message's
 java.lang.String getProtocolName()
          Returns a String containing the canonical name of this protocol, as it appears in an EndpointAddress.
 void init(Endpoint p)
          Initialise this instance of the TransportProtocol.
 boolean isConnected()
          Returns true if the Transport Protocol can establish connection to the remote host (like TCP).
 boolean isFast()
          Returns true if the Transport Protocol is fast.
 boolean ping(net.jxta.endpoint.EndpointAddress addr)
          Returns true if the target address is reachable.
 void propagate(net.jxta.endpoint.Message msg, java.lang.String serviceName, java.lang.String serviceParams, java.lang.String prunePeer)
          Propagates a Message on this TransportProtocol
 

Method Detail

getMessanger

public EndpointMessanger getMessanger(net.jxta.endpoint.EndpointAddress dest,
                                      java.lang.String destPeerId,
                                      int type)
                               throws java.io.IOException
Creates and return an EndpointMessanger for sending Message's
Parameters:
dest - EndpointAddress of the destination
type - type of the messanger as defined in the class Endpoint
Returns:
an EndpointMessanger.

propagate

public void propagate(net.jxta.endpoint.Message msg,
                      java.lang.String serviceName,
                      java.lang.String serviceParams,
                      java.lang.String prunePeer)
               throws java.io.IOException
Propagates a Message on this TransportProtocol
Parameters:
msg - the Message to be propagated
serviceName - is a String containing the name of the service
serviceParams - is a String containing the parameters associated to the service. The combination of serviceName and serviceParams is the what must have been registered to the Endpoint's demux.
prunePeer - peer which should not receive the propagated message
msg - the Message to be propagated

close

public void close()
closes this TransportProtocol.

init

public void init(Endpoint p)
Initialise this instance of the TransportProtocol. XXX: this method prototype will need to be revisited when the configuration framework will be completed.

getProtocolName

public java.lang.String getProtocolName()
Returns a String containing the canonical name of this protocol, as it appears in an EndpointAddress.
Returns:
a String containing the name of the protocol

getLocalAddress

public net.jxta.endpoint.EndpointAddress getLocalAddress()
Returns an EndpointAddress of the local endpoint manage by the TransportProtocol
Returns:
an EndpointAddress containing the local address

isFast

public boolean isFast()
Returns true if the Transport Protocol is fast. The notion of being fast is relative, but any mailbox type of protocols should return false.

isConnected

public boolean isConnected()
Returns true if the Transport Protocol can establish connection to the remote host (like TCP).

ping

public boolean ping(net.jxta.endpoint.EndpointAddress addr)
Returns true if the target address is reachable. Otherwise returns false.

Project JXTA