Interface RoutingUtility


public interface RoutingUtility
  • Method Details

    • reduceAddressToNodeIds

      static Set<NodeId> reduceAddressToNodeIds(List<Object> address)
      Reduces the List<Object> address to a Set<NodeId>
      Parameters:
      address -
      Returns:
      a Set<NodeId>
    • reduceAddressToSingleNodeId

      static NodeId reduceAddressToSingleNodeId(List<Object> address)
      Ensures that the following List<Object> can be reduced to a single NodeId, throwing the appropriate exception in the event that there is a mismatch among any of the NodeId instances returned. This relies on each component implementing HasNodeId.
      Parameters:
      address - the List<Object> making up the address
      Returns:
      the single NodeId, throwing an exception if it could not be determined.
    • addressToString

      static String addressToString(List<Object> address)
      Converts the address, as represented by a List<Object>, to a human-readible string using the components' Object.toString() method.
      Parameters:
      address - the address
      Returns:
      the string representation
    • checkAddressComponentHasNodeId

      static HasNodeId checkAddressComponentHasNodeId(Object object)
      Ensure that the component is an instance of HasNodeId throwing a RoutingException if the object is not an instance of HasNodeId.
      Parameters:
      object - the object to check
      Returns:
      the object cast as HasNodeId
    • ensureDistinctNode

      static NodeId ensureDistinctNode(List<Object> address, NodeId nodeId0, NodeId nodeId1)
      A reducer function intended to ensure that the supplied NodeIds are all the same.
      Parameters:
      address - the original address
      nodeId0 - the first NodeId
      nodeId1 - the second NodeId
      Returns:
      the first NodeId