Project JXTA

net.jxta.endpoint
Interface Message


public interface Message

Message defines the interface of messages sent or received to or from a endpoint and pipes. Applications are expected to implement this class in order to exchange messages.

Since:
JXTA 1.0
See Also:
EndpointAddress, InputPipe, OutputPipe, Pipe

Method Summary
 Message dup()
          Duplicates the message.
 java.util.Enumeration getNames()
          Returns an Enumeation of all the available chunks of data in the message
 int getSize(java.lang.String atag)
          Get the size of a particular tag's data in the message.
 java.io.InputStream pop(java.lang.String name)
          Gets a chunk of data associated with the name
 void push(java.lang.String name, java.io.InputStream inputStream)
          Push a chunk of data into the message.
 

Method Detail

push

public void push(java.lang.String name,
                 java.io.InputStream inputStream)
          throws java.io.IOException
Push a chunk of data into the message.
Parameters:
name - is the name of the chunk of data
inputStream - is an inputStream to the data to be pushed.
Since:
JXTA 1.0

pop

public java.io.InputStream pop(java.lang.String name)
                        throws java.io.IOException
Gets a chunk of data associated with the name
Parameters:
name - contains the name of the chunk of data to get
Returns:
InputStream an inputStream to the chunk of data
Since:
JXTA 1.0

getSize

public int getSize(java.lang.String atag)
Get the size of a particular tag's data in the message.
Parameters:
atag - the name of the tag whose size to get
Returns:
the size of the data in the message for the specified tag
Since:
JXTA 1.0

getNames

public java.util.Enumeration getNames()
Returns an Enumeation of all the available chunks of data in the message
Returns:
an Enumeation of all the available chunks of data in the message
Since:
JXTA 1.0

dup

public Message dup()
            throws java.io.IOException
Duplicates the message. This duplicate must be a real copy
Returns:
Message a Message that is a copy of the original message
Since:
JXTA 1.0

Project JXTA