Class TransportClient

    • Field Detail

      • CLIENT_TRANSPORT_NODES_SAMPLER_INTERVAL

        public static final Setting<TimeValue> CLIENT_TRANSPORT_NODES_SAMPLER_INTERVAL
      • CLIENT_TRANSPORT_PING_TIMEOUT

        public static final Setting<TimeValue> CLIENT_TRANSPORT_PING_TIMEOUT
      • CLIENT_TRANSPORT_IGNORE_CLUSTER_NAME

        public static final Setting<java.lang.Boolean> CLIENT_TRANSPORT_IGNORE_CLUSTER_NAME
      • CLIENT_TRANSPORT_SNIFF

        public static final Setting<java.lang.Boolean> CLIENT_TRANSPORT_SNIFF
      • TRANSPORT_CLIENT_FEATURE

        public static final java.lang.String TRANSPORT_CLIENT_FEATURE
        See Also:
        Constant Field Values
    • Constructor Detail

      • TransportClient

        public TransportClient​(Settings settings,
                               java.util.Collection<java.lang.Class<? extends Plugin>> plugins)
        Creates a new TransportClient with the given settings and plugins
      • TransportClient

        protected TransportClient​(Settings settings,
                                  Settings defaultSettings,
                                  java.util.Collection<java.lang.Class<? extends Plugin>> plugins,
                                  TransportClient.HostFailureListener hostFailureListener)
        Creates a new TransportClient with the given settings, defaults and plugins.
        Parameters:
        settings - the client settings
        defaultSettings - default settings that are merged after the plugins have added it's additional settings.
        plugins - the client plugins
    • Method Detail

      • addPlugins

        protected static java.util.Collection<java.lang.Class<? extends Plugin>> addPlugins​(java.util.Collection<java.lang.Class<? extends Plugin>> collection,
                                                                                            java.lang.Class<? extends Plugin>... plugins)
      • addPlugins

        protected static java.util.Collection<java.lang.Class<? extends Plugin>> addPlugins​(java.util.Collection<java.lang.Class<? extends Plugin>> collection,
                                                                                            java.util.Collection<java.lang.Class<? extends Plugin>> plugins)
      • connectedNodes

        public java.util.List<DiscoveryNode> connectedNodes()
        Returns the current connected transport nodes that this client will use.

        The nodes include all the nodes that are currently alive based on the transport addresses provided.

      • filteredNodes

        public java.util.List<DiscoveryNode> filteredNodes()
        The list of filtered nodes that were not connected to, for example, due to mismatch in cluster name.
      • listedNodes

        public java.util.List<DiscoveryNode> listedNodes()
        Returns the listed nodes in the transport client (ones added to it).
      • addTransportAddress

        public TransportClient addTransportAddress​(TransportAddress transportAddress)
        Adds a transport address that will be used to connect to.

        The Node this transport address represents will be used if its possible to connect to it. If it is unavailable, it will be automatically connected to once it is up.

        In order to get the list of all the current connected nodes, please see connectedNodes().

      • addTransportAddresses

        public TransportClient addTransportAddresses​(TransportAddress... transportAddress)
        Adds a list of transport addresses that will be used to connect to.

        The Node this transport address represents will be used if its possible to connect to it. If it is unavailable, it will be automatically connected to once it is up.

        In order to get the list of all the current connected nodes, please see connectedNodes().

      • removeTransportAddress

        public TransportClient removeTransportAddress​(TransportAddress transportAddress)
        Removes a transport address from the list of transport addresses that are used to connect to.
      • close

        public void close()
        Closes the client.