org.objectweb.tribe.messages
Class FragmentedMessage

java.lang.Object
  extended byorg.objectweb.tribe.messages.ByteMessage
      extended byorg.objectweb.tribe.messages.FragmentedMessage
All Implemented Interfaces:
java.io.Serializable

public class FragmentedMessage
extends ByteMessage

This class defines a FragmentedMessage to be used as a facility to send a large message in smaller chunks if the underlying network is not capable of fragmentation.

Version:
1.0
Author:
Emmanuel Cecchet
See Also:
Serialized Form

Constructor Summary
FragmentedMessage(int messageSize)
          Creates a new FragmentedMessage object
 
Method Summary
 byte[] getFragmentData()
          Return the fragment data
 int getFragmentId()
          Get the identifier of this fragment
 java.lang.String getMessageId()
          Return the message identifier
 int getMessageSize()
          Get the total message size (for all fragments)
 void setFragment(int fragmentId, byte[] buf)
          Sets the next fragment in the message
 
Methods inherited from class org.objectweb.tribe.messages.ByteMessage
getContent, setContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FragmentedMessage

public FragmentedMessage(int messageSize)
Creates a new FragmentedMessage object

Parameters:
messageSize - the overall message size
Method Detail

getFragmentData

public byte[] getFragmentData()
Return the fragment data

Returns:
byte array containing the fragment data

getFragmentId

public int getFragmentId()
Get the identifier of this fragment

Returns:
fragment number

getMessageId

public java.lang.String getMessageId()
Return the message identifier

Returns:
message identifier

getMessageSize

public int getMessageSize()
Get the total message size (for all fragments)

Returns:
overall message size

setFragment

public void setFragment(int fragmentId,
                        byte[] buf)
Sets the next fragment in the message

Parameters:
fragmentId - fragment number
buf - fragment data


Copyright © 2004 - ObjectWeb Consortium - All Rights Reserved.