org.ow2.carol.cmi.smart.message
Class ClassRequest

java.lang.Object
  extended by org.ow2.carol.cmi.smart.message.ClassRequest
All Implemented Interfaces:
Message

public class ClassRequest
extends java.lang.Object
implements Message

Sends a request with the classname that is wanted.

Author:
The new CMI team, Florent Benoit

Field Summary
 
Fields inherited from interface org.ow2.carol.cmi.smart.api.Message
HEADER_SIZE, INT_BYTE_SIZE
 
Constructor Summary
ClassRequest(java.nio.ByteBuffer dataBuffer)
          Builds a message by using the data contains in the bytebuffer.
ClassRequest(java.lang.String className)
          Builds a new message with the given class name.
 
Method Summary
protected  java.lang.String decode(java.nio.ByteBuffer buffer)
          Decode the string encoded in the bytebuffer in UTF-8 format.
protected  java.nio.ByteBuffer encode(java.lang.String str)
          Encode the given string into a bytebuffer.
 java.lang.String getClassName()
          Gets the class name of this message.
 java.nio.ByteBuffer getMessage()
          Gets a message to send.
 java.nio.ByteBuffer getMessageContent()
          Gets the content of this message (only this part, not the header).
 byte getOperationCode()
          Gets the OperationCode of this message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassRequest

public ClassRequest(java.lang.String className)
Builds a new message with the given class name.

Parameters:
className - the given name

ClassRequest

public ClassRequest(java.nio.ByteBuffer dataBuffer)
Builds a message by using the data contains in the bytebuffer.

Parameters:
dataBuffer - the data of the message to extract.
Method Detail

getMessage

public java.nio.ByteBuffer getMessage()
Gets a message to send.

Specified by:
getMessage in interface Message
Returns:
the bytebuffer to send

getOperationCode

public byte getOperationCode()
Gets the OperationCode of this message.

Specified by:
getOperationCode in interface Message
Returns:
the operation code.

getMessageContent

public java.nio.ByteBuffer getMessageContent()
Gets the content of this message (only this part, not the header).

Returns:
the content of this message.

getClassName

public java.lang.String getClassName()
Gets the class name of this message.

Returns:
the name of the class.

encode

protected java.nio.ByteBuffer encode(java.lang.String str)
Encode the given string into a bytebuffer.

Parameters:
str - the given string
Returns:
a bytebuffer with UTF-8 encoded string

decode

protected java.lang.String decode(java.nio.ByteBuffer buffer)
Decode the string encoded in the bytebuffer in UTF-8 format.

Parameters:
buffer - the given buffer to analyze.
Returns:
the decoded string


Copyright © 2008 OW2 Consortium. All Rights Reserved.