jarol.messages
Interface MessagePart

All Known Subinterfaces:
MessageFooter, MessageHeader
All Known Implementing Classes:
Message

public interface MessagePart

Base interface for message parts (headers, footers and payload).

Version:
0.1
Author:
Eduardo Marques

Method Summary
 void dump(java.io.PrintStream ps)
          Dump object in human readable form.
 void serialize(Buffer buffer)
          Serialization method.
 int serialSize()
          Get serialization size.
 void unserialize(Buffer buffer)
          De-serialization method for the header.
 void validate()
          Validation method
 

Method Detail

serialSize

int serialSize()
Get serialization size.

Returns:
the serialization size for the header

serialize

void serialize(Buffer buffer)
               throws InvalidMessageException
Serialization method.

Parameters:
buffer - the output buffer
Throws:
InvalidMessageException - if validation fails

unserialize

void unserialize(Buffer buffer)
                 throws InvalidMessageException
De-serialization method for the header.

Parameters:
buffer - the input buffer
Throws:
InvalidMessageException - if validation fails

dump

void dump(java.io.PrintStream ps)
Dump object in human readable form.

Parameters:
ps - the stream for printing

validate

void validate()
              throws InvalidMessageException
Validation method

Throws:
InvalidMessageException - if the contents of this message part are invalid