samples.mediators
Class BinaryExtractMediator

java.lang.Object
  extended by org.apache.synapse.mediators.AbstractMediator
      extended by samples.mediators.BinaryExtractMediator
All Implemented Interfaces:
AspectConfigurable, Mediator, SynapseArtifact

public class BinaryExtractMediator
extends AbstractMediator

This mediator analyze a binary message and convert binary to a given datatype and set is as a message property. User can use the message property for CBR. User has to set the offset : where to start length : how many bytes to read binaryEncodig : utf-8, utf-16, ASCII, Base64 VariableName : property name set with the decoded value in the message context These values should set as parameters from the synapse configuration layer.


Field Summary
 
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
trace, traceState
 
Constructor Summary
BinaryExtractMediator()
           
 
Method Summary
 String getBinaryEncoding()
           
 int getDataType()
           
 int getLength()
           
 int getOffset()
           
 int getTraceState()
          Returns the tracing state
 String getType()
          Returns the class name of the mediator
 String getVariableName()
           
 boolean mediate(MessageContext msgCtx)
          Invokes the mediator passing the current message for mediation.
 void setBinaryEncoding(String binaryEncoding)
           
 void setDataType(int dataType)
           
 void setLength(int length)
           
 void setOffset(int offset)
           
 void setTraceState(int traceState)
          Set the tracing state variable
 void setVariableName(String variableName)
           
 
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, configure, disableStatistics, enableStatistics, getAspectConfiguration, getDescription, getLog, handleException, handleException, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, setDescription, setEffectiveTraceState, shouldTrace, traceOrDebug, traceOrDebugWarn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryExtractMediator

public BinaryExtractMediator()
Method Detail

mediate

public boolean mediate(MessageContext msgCtx)
Description copied from interface: Mediator
Invokes the mediator passing the current message for mediation. Each mediator performs its mediation action, and returns true if mediation should continue, or false if further mediation should be aborted.

Parameters:
msgCtx - the current message for mediation
Returns:
true if further mediation should continue

getType

public String getType()
Description copied from class: AbstractMediator
Returns the class name of the mediator

Specified by:
getType in interface Mediator
Overrides:
getType in class AbstractMediator
Returns:
the class name of the mediator

setTraceState

public void setTraceState(int traceState)
Description copied from class: AbstractMediator
Set the tracing state variable

Specified by:
setTraceState in interface Mediator
Overrides:
setTraceState in class AbstractMediator
Parameters:
traceState - the new tracing state for this mediator (see SynapseConstants)

getTraceState

public int getTraceState()
Description copied from class: AbstractMediator
Returns the tracing state

Specified by:
getTraceState in interface Mediator
Overrides:
getTraceState in class AbstractMediator
Returns:
the tracing state for this mediator (see SynapseConstants)

getLength

public int getLength()

setLength

public void setLength(int length)

getDataType

public int getDataType()

setDataType

public void setDataType(int dataType)

getOffset

public int getOffset()

setOffset

public void setOffset(int offset)

getBinaryEncoding

public String getBinaryEncoding()

setBinaryEncoding

public void setBinaryEncoding(String binaryEncoding)

getVariableName

public String getVariableName()

setVariableName

public void setVariableName(String variableName)


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.