org.apache.synapse.mediators.throttle
Class ThrottleMediator

java.lang.Object
  extended by org.apache.synapse.mediators.AbstractMediator
      extended by org.apache.synapse.mediators.throttle.ThrottleMediator
All Implemented Interfaces:
AspectConfigurable, ManagedLifecycle, Mediator, SynapseArtifact

public class ThrottleMediator
extends AbstractMediator
implements ManagedLifecycle

The Mediator for the throttling - Throttling will occur according to the ws-policy which is specified as the key for lookup from the registry or the inline policy Only support IP based throttling- Throttling can manage per IP using the throttle policy


Field Summary
 
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
 
Constructor Summary
ThrottleMediator()
           
 
Method Summary
 void destroy()
          This method should implement the destroying of the implemented parts of the configuration.
 String getId()
           
 OMElement getInLinePolicy()
          getting throttle policy which has defined as InLineXML
 Mediator getOnAcceptMediator()
           
 String getOnAcceptSeqKey()
           
 Mediator getOnRejectMediator()
           
 String getOnRejectSeqKey()
           
 String getPolicyKey()
          To get the policy key - The key for which will used to lookup policy from the registry
 void init(SynapseEnvironment se)
          This method should implement the initialization of the implemented parts of the configuration.
 boolean mediate(MessageContext synCtx)
          Invokes the mediator passing the current message for mediation.
 void setId(String id)
           
 void setInLinePolicy(OMElement inLinePolicy)
          setting throttle policy which has defined as InLineXML
 void setOnAcceptMediator(Mediator onAcceptMediator)
           
 void setOnAcceptSeqKey(String onAcceptSeqKey)
           
 void setOnRejectMediator(Mediator onRejectMediator)
           
 void setOnRejectSeqKey(String onRejectSeqKey)
           
 void setPolicyKey(String policyKey)
          To set the policy key - The key for which lookup from the registry
 
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, configure, disableStatistics, enableStatistics, getAspectConfiguration, getDescription, getLog, getTraceState, getType, 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
 

Constructor Detail

ThrottleMediator

public ThrottleMediator()
Method Detail

init

public void init(SynapseEnvironment se)
Description copied from interface: ManagedLifecycle
This method should implement the initialization of the implemented parts of the configuration.

Specified by:
init in interface ManagedLifecycle
Parameters:
se - SynapseEnvironment to be used for initialization

destroy

public void destroy()
Description copied from interface: ManagedLifecycle
This method should implement the destroying of the implemented parts of the configuration.

Specified by:
destroy in interface ManagedLifecycle

mediate

public boolean mediate(MessageContext synCtx)
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.

Specified by:
mediate in interface Mediator
Parameters:
synCtx - the current message for mediation
Returns:
true if further mediation should continue

getPolicyKey

public String getPolicyKey()
To get the policy key - The key for which will used to lookup policy from the registry

Returns:
String

setPolicyKey

public void setPolicyKey(String policyKey)
To set the policy key - The key for which lookup from the registry

Parameters:
policyKey - Value for picking policy from the registry

getInLinePolicy

public OMElement getInLinePolicy()
getting throttle policy which has defined as InLineXML

Returns:
InLine Throttle Policy

setInLinePolicy

public void setInLinePolicy(OMElement inLinePolicy)
setting throttle policy which has defined as InLineXML

Parameters:
inLinePolicy - Inline policy

getOnRejectSeqKey

public String getOnRejectSeqKey()

setOnRejectSeqKey

public void setOnRejectSeqKey(String onRejectSeqKey)

getOnRejectMediator

public Mediator getOnRejectMediator()

setOnRejectMediator

public void setOnRejectMediator(Mediator onRejectMediator)

getOnAcceptSeqKey

public String getOnAcceptSeqKey()

setOnAcceptSeqKey

public void setOnAcceptSeqKey(String onAcceptSeqKey)

getOnAcceptMediator

public Mediator getOnAcceptMediator()

setOnAcceptMediator

public void setOnAcceptMediator(Mediator onAcceptMediator)

getId

public String getId()

setId

public void setId(String id)


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