toolbox.services.socket.simple.beans
Class SocketMessage

Package class diagram package SocketMessage
java.lang.Object
  extended by toolbox.services.socket.simple.beans.SocketMessage
All Implemented Interfaces:
java.io.Serializable, DaoBean

public class SocketMessage
extends java.lang.Object
implements DaoBean, java.io.Serializable

Java Bean representing a client socket messsage.

SocketMessage bean generated by the Toolbox Bean Generator.

This bean implements the DaoBean interface that allows it to be persisted by sub-class instances of the toolbox.services.dao.DaoService class.

See Also:
Serialized Form

Constructor Summary
SocketMessage()
          Default constructor to initialise the internal Map for storing bean properties.
 
Method Summary
static SocketMessage create(java.util.Map map)
          Create a new SocketMessage bean instance using the properties in the given Map as the values of the bean properties.
 java.lang.String getBody()
          Return the body property.
 java.lang.Boolean getDoBase64()
          Return the doBase64 property.
 java.util.Map getMap()
          Return the Map containing the bean properties.
 java.lang.String getMapping(java.lang.String prop)
          Return the mapped value for the provided property name.
 java.util.Map getMappings()
          Return the Map containing the property mappings.
 void setBody(java.lang.String body)
          Set the body property.
 void setDoBase64(java.lang.Boolean doBase64)
          Set the doBase64 property.
 void setMap(java.util.Map map)
          Set the Map containing the bean properties.
 java.lang.String toString()
          Return a String representation of this DaoBean instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SocketMessage

public SocketMessage()
Default constructor to initialise the internal Map for storing bean properties.

Method Detail

setDoBase64

public void setDoBase64(java.lang.Boolean doBase64)
Set the doBase64 property.

Indicates whether the body content should be decoded and encoded using base64.

Parameters:
doBase64 - New value of the doBase64 property.

getDoBase64

public java.lang.Boolean getDoBase64()
Return the doBase64 property.

Indicates whether the body content should be decoded and encoded using base64.

Returns:
Boolean containinig the value of the doBase64 property.

setBody

public void setBody(java.lang.String body)
Set the body property.

String containing the data that must be transmitted

Parameters:
body - New value of the body property.

getBody

public java.lang.String getBody()
Return the body property.

String containing the data that must be transmitted

Returns:
String containinig the value of the body property.

setMap

public void setMap(java.util.Map map)
Set the Map containing the bean properties.

Specified by:
setMap in interface DaoBean
Parameters:
map - Map containing bean properties.

getMap

public java.util.Map getMap()
Return the Map containing the bean properties.

Specified by:
getMap in interface DaoBean
Returns:
Map containing bean properties.

getMapping

public java.lang.String getMapping(java.lang.String prop)
Return the mapped value for the provided property name.

Specified by:
getMapping in interface DaoBean
Parameters:
prop - Return the mapping for this property.
Returns:
String containing the mapping for the provided property.

getMappings

public java.util.Map getMappings()
Return the Map containing the property mappings.

Specified by:
getMappings in interface DaoBean
Returns:
Map instance containing property mappings.

create

public static SocketMessage create(java.util.Map map)
                            throws java.lang.Exception
Create a new SocketMessage bean instance using the properties in the given Map as the values of the bean properties.

Property mappings are done using Java Reflection and is performed as follows:

The keys in the Map are used as the names of the bean properties. If the Map contains a key with the value name it will be translated into a method call that will invoke the setName(...) method on the target bean using the value associated with the key in the Map.

Parameters:
map - Map containing bean properties.
Returns:
SocketMessage bean instance.
Throws:
java.lang.Exception - if the bean cannot be created.

toString

public java.lang.String toString()
Return a String representation of this DaoBean instance.

Overrides:
toString in class java.lang.Object
Returns:
String representation of the properties of this bean.