public class ESBRecord
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
CONTENT_TYPE_BYTES
Represents the Bytes Content-Type
|
static java.lang.String |
CONTENT_TYPE_BYTES_STR |
static int |
CONTENT_TYPE_OBJECT
Represents unknown (object) content type
|
static int |
CONTENT_TYPE_TEXT
Represents the Text Content-Type
|
static java.lang.String |
CONTENT_TYPE_TEXT_STR |
static int |
CONTENT_TYPE_XML
Represents the XML Content-Type
|
static java.lang.String |
CONTENT_TYPE_XML_STR |
static java.lang.String |
PROP_CORRELATION_ID |
static java.lang.String |
PROP_DESTINATION |
static java.lang.String |
PROP_MESSAGE_ID |
static java.lang.String |
PROP_PRIORITY |
static java.lang.String |
PROP_REPLY_TO |
static java.lang.String |
PROP_TIMESTAMP |
static java.lang.String |
PROP_TTL |
Constructor and Description |
---|
ESBRecord()
Constructs an instance of ESBRecord
|
Modifier and Type | Method and Description |
---|---|
void |
addAttachment(java.lang.String id,
javax.activation.DataHandler content)
Adds an Attachment to the ESBRecord
|
static java.lang.String |
base64Encode(byte[] blob)
return Base64BinaryValue as String
|
void |
clearProperties()
clears the properties
|
java.lang.Object |
clone()
Clones the ESBRecord
|
javax.activation.DataHandler |
getAttachment(java.lang.String id)
Returns attachment with the specified id.
|
byte[] |
getBinaryContent()
Returns the blob if the content type is binary
|
boolean |
getBooleanProperty(java.lang.String string)
Returns the value of specified property as type boolean.
|
byte |
getByteProperty(java.lang.String string)
Returns the value of specified property as type byte.
|
javax.xml.transform.Source |
getContent()
Retrieve the content of the message
|
java.lang.String |
getContentAsString()
Retrieves the content of the message as string
|
int |
getContentType()
Returns the type of the Content.
|
double |
getDoubleProperty(java.lang.String string)
Returns the value of specified property as type Double .
|
float |
getFloatProperty(java.lang.String string)
Returns the value of specified property as type Long.
|
int |
getIntProperty(java.lang.String string)
Returns the value of specified property as type Integer .
|
java.lang.String |
getJMSCorrelationID()
Returns the MSCorrelationID as type String.
|
long |
getLongProperty(java.lang.String string)
Returns the value of specified property as type Long.
|
javax.xml.namespace.QName |
getName()
Returns the
QName of this message. |
java.lang.Object |
getObjectProperty(java.lang.String string)
Returns the value of specified property as type Object.
|
java.util.Map |
getProperties()
Returns the Map containing the Properties.
|
java.util.Map |
getPropertiesClone()
Returns properties clone for object
|
java.lang.Object |
getProperty(java.lang.String name)
Retrieve the value of the specified message property.
|
java.lang.String |
getPropertyAsString(java.lang.String name)
Retrieves the value of the specified message property as String.
|
Keys |
getPropertyNames()
Lists all the properties by name for this message
|
static int |
getPropertyType(java.lang.Object propValue)
Returns property record for class
|
int |
getPropertyType(java.lang.String name) |
java.util.Map |
getPropertyTypesClone()
Returns propertyTypes clone for object
|
javax.security.auth.Subject |
getSecuritySubject()
Returns security subject associated with this message.
|
short |
getShortProperty(java.lang.String string)
Returns the value of specified property as type short.
|
javax.xml.transform.Source |
getSource(org.w3c.dom.Node contentNode)
Converts the specified Dom
Node to DOMSource |
javax.xml.transform.Source |
getSource(java.lang.String contentXML)
Converts the specified String ot
SAXSource |
java.lang.String |
getStringProperty(java.lang.String string)
Returns the value of specified property as type String.
|
java.lang.String |
getText()
Returns the text as type String.
|
java.util.Iterator |
listAttachments()
Returns the List of attachment IDs
|
void |
loadContent(byte[] blob)
Sets the specified byte[] as the content of the message
|
void |
loadContent(org.w3c.dom.Node contentNode)
Sets the specified DOMNode as the content of the message
|
void |
loadContent(java.lang.String contentXML)
Sets the specified XML as the content of the message
|
void |
loadProperties(ESBRecord record,
boolean bOverwrite)
properties are overwriiten if passed boolean is true
|
boolean |
propertyExists(java.lang.String string)
checks the existence of the property.
|
void |
removeAttachment(java.lang.String id)
Removes the attachment with the specified id.
|
void |
setBooleanProperty(java.lang.String string,
boolean b)
Sets the boolean property for given string value
|
void |
setByteProperty(java.lang.String string,
byte b)
Sets the byte property for given string
|
void |
setContent(javax.xml.transform.Source content)
Set the content of the message
|
void |
setContentType(int contentType)
Sets the Content type of the ESB Record.
|
void |
setDoubleProperty(java.lang.String string,
double v)
Sets the double property for given string
|
void |
setFloatProperty(java.lang.String string,
float v)
Sets the float property for given string
|
void |
setIntProperty(java.lang.String string,
int i)
Sets the int property for given string
|
void |
setJMSCorrelationID(java.lang.String correlationID)
sets the JMSCorrelationID.
|
void |
setLongProperty(java.lang.String string,
long l)
Sets the long property for given string
|
void |
setName(javax.xml.namespace.QName qname)
Sets the name of the message.
|
void |
setObjectProperty(java.lang.String string,
java.lang.Object object)
Sets the Object property for given string
|
void |
setProperty(java.lang.String name,
int propertyType,
java.lang.Object value)
Set a message property to the message
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
Set a message property to the message
|
void |
setSecuritySubject(javax.security.auth.Subject subject)
Sets security subject for object
|
void |
setShortProperty(java.lang.String string,
short i)
Sets the short property for given string
|
void |
setStringProperty(java.lang.String string,
java.lang.String string1)
Sets the string property for given string
|
void |
setText(java.lang.String string)
sets the text of type String.
|
static org.w3c.dom.Node |
toDOM(javax.xml.transform.Source source)
Utility method to get the DOM equivalent of the specified
Source object |
static org.w3c.dom.Node |
toDOM(java.lang.String source)
Utility method to get the DOM equivalent of the specified String object
|
public static final java.lang.String PROP_MESSAGE_ID
public static final java.lang.String PROP_DESTINATION
public static final java.lang.String PROP_REPLY_TO
public static final java.lang.String PROP_TIMESTAMP
public static final java.lang.String PROP_CORRELATION_ID
public static final java.lang.String PROP_PRIORITY
public static final java.lang.String PROP_TTL
public static final int CONTENT_TYPE_XML
public static final int CONTENT_TYPE_TEXT
public static final int CONTENT_TYPE_BYTES
public static final int CONTENT_TYPE_OBJECT
public static final java.lang.String CONTENT_TYPE_XML_STR
public static final java.lang.String CONTENT_TYPE_TEXT_STR
public static final java.lang.String CONTENT_TYPE_BYTES_STR
public static int getPropertyType(java.lang.Object propValue)
propValue
- public static org.w3c.dom.Node toDOM(javax.xml.transform.Source source) throws ESBException
Source
objectsource
- Source to be converted to DOMNode
equivalent of Source
ESBException
- error converting Source
to Dom Node
public static org.w3c.dom.Node toDOM(java.lang.String source) throws ESBException
source
- String to be converted to DOMNode
equivalent of String
ESBException
- error converting String
to Dom Node
public static java.lang.String base64Encode(byte[] blob)
blob
- public javax.xml.namespace.QName getName()
QName
of this message.
Name of the message can be used for Message Identificationpublic int getContentType()
CONTENT_TYPE_XML
, CONTENT_TYPE_TEXT
or CONTENT_TYPE_BYTES
public java.lang.Object getProperty(java.lang.String name) throws ESBException
name
- name of the propertyESBException
public int getPropertyType(java.lang.String name)
name
- public java.lang.String getPropertyAsString(java.lang.String name) throws ESBException
name
- name of the propertyESBException
public boolean getBooleanProperty(java.lang.String string) throws ESBException
string
- name of the propertyESBException
public byte getByteProperty(java.lang.String string) throws ESBException
string
- name of the propertyESBException
public short getShortProperty(java.lang.String string) throws ESBException
string
- name of the propertyESBException
public int getIntProperty(java.lang.String string) throws ESBException
string
- name of the propertyESBException
public long getLongProperty(java.lang.String string) throws ESBException
string
- of the propertyESBException
public float getFloatProperty(java.lang.String string) throws ESBException
string
- of the propertyESBException
public double getDoubleProperty(java.lang.String string) throws ESBException
string
- of the propertyESBException
public java.lang.String getStringProperty(java.lang.String string) throws ESBException
string
- of the propertyESBException
public java.lang.Object getObjectProperty(java.lang.String string) throws ESBException
string
- of the propertyESBException
public java.util.Map getProperties()
public Keys getPropertyNames()
public void setBooleanProperty(java.lang.String string, boolean b) throws ESBException
string
- propertyNameb
- boolean value set for the propertyESBException
public void setByteProperty(java.lang.String string, byte b) throws ESBException
string
- propertyNameb
- byte value set for the propertyESBException
public void setShortProperty(java.lang.String string, short i) throws ESBException
string
- propertyNamei
- short value set for the propertyESBException
public void setIntProperty(java.lang.String string, int i) throws ESBException
string
- propertyNamei
- integer value set for the propertyESBException
public void setLongProperty(java.lang.String string, long l) throws ESBException
string
- propertyNamel
- long value set for the propertyESBException
public void setFloatProperty(java.lang.String string, float v) throws ESBException
string
- propertyNamev
- float value set for the propertyESBException
public void setDoubleProperty(java.lang.String string, double v) throws ESBException
string
- propertyNamev
- double value set for the propertyESBException
public void setStringProperty(java.lang.String string, java.lang.String string1) throws ESBException
string
- propertyNamestring1
- string value to be set for the propertyESBException
public void setObjectProperty(java.lang.String string, java.lang.Object object) throws ESBException
string
- propertyNameobject
- object set for the propertyESBException
public java.lang.String getText() throws ESBException
ESBException
public void setText(java.lang.String string)
string
- setting the text with this valuepublic java.lang.String getJMSCorrelationID() throws ESBException
ESBException
public void setJMSCorrelationID(java.lang.String correlationID) throws ESBException
correlationID
- setting the JMSCorrelationID with this valueESBException
public void clearProperties() throws ESBException
ESBException
public boolean propertyExists(java.lang.String string)
string
- The property to be checkedpublic byte[] getBinaryContent() throws ESBException
ESBException
public javax.xml.transform.Source getContent()
Source
contentpublic java.util.Map getPropertiesClone()
public java.util.Map getPropertyTypesClone()
public java.lang.String getContentAsString() throws ESBException
ESBException
public javax.activation.DataHandler getAttachment(java.lang.String id)
id
- representing the attachementpublic javax.security.auth.Subject getSecuritySubject()
public javax.xml.transform.Source getSource(java.lang.String contentXML)
SAXSource
contentXML
- string to be convertedSAXSource
public javax.xml.transform.Source getSource(org.w3c.dom.Node contentNode)
Node
to DOMSource
contentNode
- Dom Node
to be convertedDOMSource
public void setContentType(int contentType)
CONTENT_TYPE_XML
.
CONTENT_TYPE_XML
, CONTENT_TYPE_TEXT
or CONTENT_TYPE_BYTES
contentType
- content type to be set.public void setName(javax.xml.namespace.QName qname)
qname
- name of the messagepublic void setProperty(java.lang.String name, java.lang.Object value)
name
- property namevalue
- value of the propertypublic void setProperty(java.lang.String name, int propertyType, java.lang.Object value)
name
- property namevalue
- value of the propertypropertyType
- public void setContent(javax.xml.transform.Source content)
content
- message contentpublic void setSecuritySubject(javax.security.auth.Subject subject)
subject
- security credentials for the messagepublic void loadProperties(ESBRecord record, boolean bOverwrite)
record
- bOverwrite
- public java.lang.Object clone()
clone
in class java.lang.Object
java.lang.RuntimeException
- if unable to clone ESBRecordpublic void addAttachment(java.lang.String id, javax.activation.DataHandler content) throws ESBException
id
- id of the attachmentcontent
- Attachment handlerESBException
public void removeAttachment(java.lang.String id) throws ESBException
id
- attachment id.ESBException
public java.util.Iterator listAttachments()
public void loadContent(java.lang.String contentXML)
contentXML
- public void loadContent(byte[] blob)
blob
- public void loadContent(org.w3c.dom.Node contentNode)
contentNode
-