|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.soa.esb.actions.routing.ObjectToFileWriter
public class ObjectToFileWriter
Object to file writing processor.
Writes an Object to a file based on the "file" property specified by the action configuration. This "file" property can specify a file or directory. If the file is a directory, the class generates a file name based on the return from a call toUUID.randomUUID() and the file extension value specified in
the "ext" property (default of "obj").
If the message is a byte array it's writen to the file as is, otherwise the toString method is called on the
message object and the resulting String bytes are writen to the file based on the "encoding" specified in the action
configuration (see below).
Sample Action Configuration:
<Action name="Write-To-X-File" processor="ObjectToFileWriter">
<property name="file" value="file:///..." /> <!-- File/Directory name. Supports URI or non-URI based names. -->
<property name="append" value="true/false" /> <!-- Only relevant if the file is not a directory. Default of "false". -->
<property name="ext" value="dat" /> <!-- Only relevant if the file is a directory. Default of "obj". -->
<property name="encoding" value="UTF-8" /> <!-- Default of "UTF-8". -->
</Action>
| Field Summary | |
|---|---|
static java.lang.String |
FILE_APPEND
|
static java.lang.String |
FILE_ENC
|
static java.lang.String |
FILE_EXT
|
static java.lang.String |
FILE_NAME
|
| Constructor Summary | |
|---|---|
ObjectToFileWriter(java.lang.String actionName,
java.util.List<KeyValuePair> properties)
Public constructor. |
|
| Method Summary | |
|---|---|
java.io.Serializable |
getErrorNotification(Message message)
Get the "Error" notification message for this processor. |
java.io.Serializable |
getOkNotification(Message message)
Get the "OK" notification message for this processor. |
Message |
process(Message message)
Perform the processing action on the message |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FILE_NAME
public static final java.lang.String FILE_APPEND
public static final java.lang.String FILE_EXT
public static final java.lang.String FILE_ENC
| Constructor Detail |
|---|
public ObjectToFileWriter(java.lang.String actionName,
java.util.List<KeyValuePair> properties)
throws ConfigurationException
actionName - Action name.properties - Action Properties.
ConfigurationException - Action not properly configured.| Method Detail |
|---|
public Message process(Message message)
throws ActionProcessingException
ActionProcessor
process in interface ActionProcessormessage - The message to be processed.
ActionProcessingException - Exception during payload processing.public java.io.Serializable getOkNotification(Message message)
ActionProcessor
getOkNotification in interface ActionProcessormessage - The message Object.
public java.io.Serializable getErrorNotification(Message message)
ActionProcessor
getErrorNotification in interface ActionProcessormessage - The message Object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||