Class ANDPolicy

  • All Implemented Interfaces:
    DocumentProtocolRoutingPolicy, com.yahoo.messagebus.routing.RoutingPolicy

    public class ANDPolicy
    extends Object
    implements DocumentProtocolRoutingPolicy
    An AND policy is a routing policy that can be used to write simple routes that split a message between multiple other destinations. It can either be configured in a routing config, which will then produce a policy that always selects all configured recipients, or it can be configured using the policy parameter (i.e. a string following the name of the policy). Note that configured recipients take precedence over recipients configured in the parameter string.
    Author:
    Simon Thoresen Hult
    • Constructor Detail

      • ANDPolicy

        public ANDPolicy​(String param)
        Constructs a new AND policy that requires all recipients to be ok for it to merge their replies to an ok reply. I.e. all errors in all child replies are copied into the merged reply.
        Parameters:
        param - A string of recipients to select unless recipients have been configured.
    • Method Detail

      • select

        public void select​(com.yahoo.messagebus.routing.RoutingContext context)
        Specified by:
        select in interface com.yahoo.messagebus.routing.RoutingPolicy
      • merge

        public void merge​(com.yahoo.messagebus.routing.RoutingContext context)
        Specified by:
        merge in interface com.yahoo.messagebus.routing.RoutingPolicy
      • destroy

        public void destroy()
        Specified by:
        destroy in interface com.yahoo.messagebus.routing.RoutingPolicy