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

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

public class FactoryNameAnswer
extends java.lang.Object
implements Message

Server sends the factory name to the client.

Author:
The new CMI team

Field Summary
 
Fields inherited from interface org.ow2.carol.cmi.smart.api.Message
HEADER_SIZE, INT_BYTE_SIZE
 
Constructor Summary
FactoryNameAnswer(java.nio.ByteBuffer buffer)
          Create a new answer with the given buffer for the wrapped factory name.
FactoryNameAnswer(java.lang.String factoryName)
          Create a new answer with the given wrapped factory name.
 
Method Summary
protected  java.nio.ByteBuffer encode(java.lang.String str)
          Encode the given string into a bytebuffer.
 java.lang.String getFactoryName()
          Get the wrapped factory name.
 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 Operation Code of this answer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FactoryNameAnswer

public FactoryNameAnswer(java.nio.ByteBuffer buffer)
Create a new answer with the given buffer for the wrapped factory name.

Parameters:
buffer - containing the data to extract.

FactoryNameAnswer

public FactoryNameAnswer(java.lang.String factoryName)
Create a new answer with the given wrapped factory name.

Parameters:
factoryName - the given wrapped factory name.
Method Detail

getMessage

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

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

getMessageContent

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

Returns:
the content of this message.

getOperationCode

public byte getOperationCode()
Gets the Operation Code of this answer.

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

getFactoryName

public java.lang.String getFactoryName()
Get the wrapped factory name.

Returns:
the wrapped factory name.

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


Copyright © 2008 OW2 Consortium. All Rights Reserved.