com.cafesoft.core.message
Class EndPointRegistrationMessageTranslator

java.lang.Object
  |
  +--com.cafesoft.core.message.DefaultMessageTranslator
        |
        +--com.cafesoft.core.message.EndPointRegistrationMessageTranslator
All Implemented Interfaces:
MessageTranslator

public class EndPointRegistrationMessageTranslator
extends DefaultMessageTranslator

Encodes and decodes EndPointRegistration messages. These messages are used as part of the "EndPoint Regisration Protocol", which identifies and local MessageSender or MessageReceiver with a remote host.

This translator will either decode packets and construct an EndPointRegistrationBody object, or will encode a EndPointRegisrationBody object into packets.

Since:
2/26/02

Field Summary
 
Fields inherited from class com.cafesoft.core.message.DefaultMessageTranslator
logger, objectPool, support
 
Constructor Summary
EndPointRegistrationMessageTranslator()
          Creates an EndPointRegistrationMessageTranslator
 
Method Summary
 int getMessageType()
          Override the Message type to return a system-defined type.
protected  void onDecode(MessageInputStream input, Message message)
          Template method for decoding a message input stream into a message.
protected  void onEncode(Message message, MessageOutputStream output)
          Template method for encoding a message into a message output stream.
 
Methods inherited from class com.cafesoft.core.message.DefaultMessageTranslator
addMessageTranslatorListener, decode, encode, initialize, removeMessageTranslatorListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EndPointRegistrationMessageTranslator

public EndPointRegistrationMessageTranslator()
Creates an EndPointRegistrationMessageTranslator

Method Detail

onDecode

protected void onDecode(MessageInputStream input,
                        Message message)
                 throws MessageTranslatorException
Template method for decoding a message input stream into a message.

Overrides:
onDecode in class DefaultMessageTranslator
Parameters:
input - the encoded MessageInputStream from which to read
message - the Message into which to decode
MessageTranslatorException

onEncode

protected void onEncode(Message message,
                        MessageOutputStream output)
                 throws MessageTranslatorException
Template method for encoding a message into a message output stream.

Overrides:
onEncode in class DefaultMessageTranslator
Parameters:
message - the Message from which to encode
output - the encoded MessageOutputStream into which to write
MessageTranslatorException

getMessageType

public int getMessageType()
Override the Message type to return a system-defined type.

NOTE: The message type is not the content-type of the message it is the type of message being sent. Therefore, type refers to Application messages, Error messages, and Connection messages.

Overrides:
getMessageType in class DefaultMessageTranslator
Returns:
an integer value representing the type of message being sent


Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.