org.apache.synapse.mediators.builtin
Class PropertyMediator

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

public class PropertyMediator
extends AbstractMediator

The property mediator would save(or remove) a named property as a local property of the Synapse Message Context or as a property of the Axis2 Message Context or as a Transport Header. Properties set this way could be extracted through the XPath extension function "synapse:get-property(scope,prop-name)"


Field Summary
static int ACTION_REMOVE
           
static int ACTION_SET
          The Action - set or remove
 
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
 
Constructor Summary
PropertyMediator()
           
 
Method Summary
 int getAction()
           
 SynapseXPath getExpression()
           
 int getGroup()
           
 String getName()
           
 Pattern getPattern()
           
 String getScope()
           
 String getType()
          Returns the class name of the mediator
 Object getValue()
           
 OMElement getValueElement()
           
 boolean mediate(MessageContext synCtx)
          Sets a property into the current (local) Synapse Context or into the Axis Message Context or into Transports Header and removes above properties from the corresponding locations.
 void setAction(int action)
           
 void setExpression(SynapseXPath expression)
           
 void setExpression(SynapseXPath expression, String type)
           
 void setGroup(int group)
           
 void setName(String name)
           
 void setPattern(Pattern pattern)
           
 void setScope(String scope)
           
 void setValue(String value)
           
 void setValue(String value, String type)
          Set the value to be set by this property mediator and the data type to be used when setting the value.
 void setValueElement(OMElement valueElement)
           
 
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, configure, disableStatistics, enableStatistics, getAspectConfiguration, getDescription, getLog, getTraceState, handleException, handleException, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, setDescription, setEffectiveTraceState, setTraceState, shouldTrace, traceOrDebug, traceOrDebugWarn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_SET

public static final int ACTION_SET
The Action - set or remove

See Also:
Constant Field Values

ACTION_REMOVE

public static final int ACTION_REMOVE
See Also:
Constant Field Values
Constructor Detail

PropertyMediator

public PropertyMediator()
Method Detail

mediate

public boolean mediate(MessageContext synCtx)
Sets a property into the current (local) Synapse Context or into the Axis Message Context or into Transports Header and removes above properties from the corresponding locations.

Parameters:
synCtx - the message context
Returns:
true always

getName

public String getName()

setName

public void setName(String name)

getValue

public Object getValue()

setValue

public void setValue(String value)

setValue

public void setValue(String value,
                     String type)
Set the value to be set by this property mediator and the data type to be used when setting the value. Accepted type names are defined in XMLConfigConstants.DATA_TYPES enumeration. Passing null as the type implies that 'STRING' type should be used.

Parameters:
value - the value to be set as a string
type - the type name

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

getValueElement

public OMElement getValueElement()

setValueElement

public void setValueElement(OMElement valueElement)

getExpression

public SynapseXPath getExpression()

setExpression

public void setExpression(SynapseXPath expression)

setExpression

public void setExpression(SynapseXPath expression,
                          String type)

getScope

public String getScope()

setScope

public void setScope(String scope)

getAction

public int getAction()

setAction

public void setAction(int action)

getPattern

public Pattern getPattern()

setPattern

public void setPattern(Pattern pattern)

getGroup

public int getGroup()

setGroup

public void setGroup(int group)


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