Class SwitchCase

  • All Implemented Interfaces:
    ManagedLifecycle

    public class SwitchCase
    extends Object
    implements ManagedLifecycle
    A SwitchCase define a case element of Switch Mediator and It has a list mediator and a regex that is matched by its owning SwitchMediator for selection. If any SwitchCase has selected ,Then the list mediator of it, will responsible for message mediation
    • Constructor Detail

      • SwitchCase

        public SwitchCase()
    • 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)
        To delegate message mediation to list mediator
        Parameters:
        synCtx - message context to be mediated
        Returns:
        boolean value
      • getCaseMediator

        public AnonymousListMediator getCaseMediator()
        To get list mediator of this case element
        Returns:
        List mediator of switch case
      • setCaseMediator

        public void setCaseMediator​(AnonymousListMediator caseMediator)
        To set the set of case mediators
        Parameters:
        caseMediator - anonymous sequence to be used for the case mediation
      • getRegex

        public Pattern getRegex()
        To get the regular expression pattern
        Returns:
        Pattern
      • setRegex

        public void setRegex​(Pattern regex)
        To set the regular expression pattern
        Parameters:
        regex - Regular Expression to be matched
      • matches

        public boolean matches​(String value)
        To evaluate regular expression pattern to a get switch case
        Parameters:
        value - value to be tested over the regular expression of match
        Returns:
        boolean value
      • setStatisticIdForMediators

        public void setStatisticIdForMediators​(ArtifactHolder holder)