Class MultiConnectParam.Builder

    • Method Detail

      • withHosts

        public MultiConnectParam.Builder withHosts​(@NonNull
                                                   @NonNull java.util.List<ServerAddress> hosts)
        Sets the addresses.
        Parameters:
        hosts - hosts serverAddresses
        Returns:
        Builder
      • withQueryNodeSingleSearch

        public MultiConnectParam.Builder withQueryNodeSingleSearch​(@NonNull
                                                                   @NonNull QueryNodeSingleSearch queryNodeSingleSearch)
        Sets single search for query node listener.
        Parameters:
        queryNodeSingleSearch - query node single search for listener
        Returns:
        Builder
      • withConnectTimeout

        public MultiConnectParam.Builder withConnectTimeout​(long connectTimeout,
                                                            @NonNull
                                                            @NonNull java.util.concurrent.TimeUnit timeUnit)
        Sets the connection timeout value of client channel. The timeout value must be greater than zero.
        Overrides:
        withConnectTimeout in class ConnectParam.Builder
        Parameters:
        connectTimeout - timeout value
        timeUnit - timeout unit
        Returns:
        Builder
      • withKeepAliveTime

        public MultiConnectParam.Builder withKeepAliveTime​(long keepAliveTime,
                                                           @NonNull
                                                           @NonNull java.util.concurrent.TimeUnit timeUnit)
        Sets the keep-alive time value of client channel. The keep-alive value must be greater than zero.
        Overrides:
        withKeepAliveTime in class ConnectParam.Builder
        Parameters:
        keepAliveTime - keep-alive value
        timeUnit - keep-alive unit
        Returns:
        Builder
      • withKeepAliveTimeout

        public MultiConnectParam.Builder withKeepAliveTimeout​(long keepAliveTimeout,
                                                              @NonNull
                                                              @NonNull java.util.concurrent.TimeUnit timeUnit)
        Sets the keep-alive timeout value of client channel. The timeout value must be greater than zero.
        Overrides:
        withKeepAliveTimeout in class ConnectParam.Builder
        Parameters:
        keepAliveTimeout - timeout value
        timeUnit - timeout unit
        Returns:
        Builder
      • withIdleTimeout

        public MultiConnectParam.Builder withIdleTimeout​(long idleTimeout,
                                                         @NonNull
                                                         @NonNull java.util.concurrent.TimeUnit timeUnit)
        Sets the idle timeout value of client channel. The timeout value must be larger than zero.
        Overrides:
        withIdleTimeout in class ConnectParam.Builder
        Parameters:
        idleTimeout - timeout value
        timeUnit - timeout unit
        Returns:
        Builder
      • withRpcDeadline

        public MultiConnectParam.Builder withRpcDeadline​(long deadline,
                                                         @NonNull
                                                         @NonNull java.util.concurrent.TimeUnit timeUnit)
        Set a deadline for how long you are willing to wait for a reply from the server. With a deadline setting, the client will wait when encounter fast RPC fail caused by network fluctuations. The deadline value must be larger than or equal to zero. Default value is 0, deadline is disabled.
        Overrides:
        withRpcDeadline in class ConnectParam.Builder
        Parameters:
        deadline - deadline value
        timeUnit - deadline unit
        Returns:
        Builder
      • withAuthorization

        public MultiConnectParam.Builder withAuthorization​(java.lang.String username,
                                                           java.lang.String password)
        Sets the username and password for this connection
        Overrides:
        withAuthorization in class ConnectParam.Builder
        Parameters:
        username - current user
        password - password
        Returns:
        Builder
      • withAuthorization

        public MultiConnectParam.Builder withAuthorization​(@NonNull
                                                           @NonNull java.lang.String authorization)
        Sets the secure for this connection
        Overrides:
        withAuthorization in class ConnectParam.Builder
        Parameters:
        authorization - the authorization info that has included the encoded username and password info
        Returns:
        Builder
      • withClientKeyPath

        public MultiConnectParam.Builder withClientKeyPath​(@NonNull
                                                           @NonNull java.lang.String clientKeyPath)
        Set the client.key path for tls two-way authentication, only takes effect when "secure" is True.
        Overrides:
        withClientKeyPath in class ConnectParam.Builder
        Parameters:
        clientKeyPath - path of client.key
        Returns:
        Builder
      • withClientPemPath

        public MultiConnectParam.Builder withClientPemPath​(@NonNull
                                                           @NonNull java.lang.String clientPemPath)
        Set the client.pem path for tls two-way authentication, only takes effect when "secure" is True.
        Overrides:
        withClientPemPath in class ConnectParam.Builder
        Parameters:
        clientPemPath - path of client.pem
        Returns:
        Builder
      • withCaPemPath

        public MultiConnectParam.Builder withCaPemPath​(@NonNull
                                                       @NonNull java.lang.String caPemPath)
        Set the ca.pem path for tls two-way authentication, only takes effect when "secure" is True.
        Overrides:
        withCaPemPath in class ConnectParam.Builder
        Parameters:
        caPemPath - path of ca.pem
        Returns:
        Builder
      • withServerPemPath

        public MultiConnectParam.Builder withServerPemPath​(@NonNull
                                                           @NonNull java.lang.String serverPemPath)
        Set the server.pem path for tls two-way authentication, only takes effect when "secure" is True.
        Overrides:
        withServerPemPath in class ConnectParam.Builder
        Parameters:
        serverPemPath - path of server.pem
        Returns:
        Builder
      • withServerName

        public MultiConnectParam.Builder withServerName​(@NonNull
                                                        @NonNull java.lang.String serverName)
        Set target name override for SSL host name checking, only takes effect when "secure" is True. Note: this value is passed to grpc.ssl_target_name_override
        Overrides:
        withServerName in class ConnectParam.Builder
        Parameters:
        serverName - path of server.pem
        Returns:
        Builder