Class HasAttributeNodeSelector

  • All Implemented Interfaces:
    NodeSelector

    public final class HasAttributeNodeSelector
    extends java.lang.Object
    implements NodeSelector
    A NodeSelector that selects nodes that have a particular value for an attribute.
    • Constructor Summary

      Constructors 
      Constructor Description
      HasAttributeNodeSelector​(java.lang.String key, java.lang.String value)  
    • Method Summary

      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      void select​(java.lang.Iterable<Node> nodes)
      Select the Nodes to which to send requests.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HasAttributeNodeSelector

        public HasAttributeNodeSelector​(java.lang.String key,
                                        java.lang.String value)
    • Method Detail

      • select

        public void select​(java.lang.Iterable<Node> nodes)
        Description copied from interface: NodeSelector
        Select the Nodes to which to send requests. This is called with a mutable Iterable of Nodes in the order that the rest client would prefer to use them and implementers should remove nodes from the that should not receive the request. Implementers may iterate the nodes as many times as they need.

        This may be called twice per request: first for "living" nodes that have not been blacklisted by previous errors. If the selector removes all nodes from the list or if there aren't any living nodes then the RestClient will call this method with a list of "dead" nodes.

        Implementers should not rely on the ordering of the nodes.

        Specified by:
        select in interface NodeSelector
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object