Class TopologyPlan

java.lang.Object
org.acemq.amqp.api.TopologyPlan

public final class TopologyPlan extends Object
What applying a Topology would do, worked out before anything is done.

The point of producing this rather than simply declaring is that it can be read. Declaring blindly is how a topology change reaches production unreviewed and fails there; a plan can be printed in a build log, attached to a pull request, or refused.

  • Method Details

    • of

      public static TopologyPlan of(List<TopologyPlan.Action> actions)
      Parameters:
      actions - what the plan proposes, in the order it would be carried out
      Returns:
      the plan
    • actions

      public List<TopologyPlan.Action> actions()
    • changes

      public List<TopologyPlan.Action> changes()
      Returns:
      only the actions that would change the broker
    • drift

      public List<TopologyPlan.Action> drift()
      Returns:
      the items that exist but do not match. Separate from changes() because applying the plan will not fix them: AMQP forbids changing these settings in place, so every one of these is a decision for a person
    • hasDrift

      public boolean hasDrift()
      Returns:
      whether anything exists with settings the topology disagrees with
    • hasChanges

      public boolean hasChanges()
      Returns:
      whether applying this plan would change anything
    • render

      public String render()
      Renders the plan the way a build log or a review wants to read it.
      Returns:
      a human-readable, line-per-action rendering
    • toString

      public String toString()
      Overrides:
      toString in class Object