Class ThriftClients

java.lang.Object
com.linecorp.armeria.client.thrift.ThriftClients

@UnstableApi public final class ThriftClients extends Object
Creates a new Thrift client that connects to a URI or an EndpointGroup.
  • Method Summary

    Modifier and Type
    Method
    Description
    builder(com.linecorp.armeria.common.Scheme scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup)
    Returns a new ThriftClientBuilder that builds the client that connects to the specified EndpointGroup with the specified Scheme.
    builder(com.linecorp.armeria.common.SessionProtocol protocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup)
    Returns a new ThriftClientBuilder that builds the Thrift client that connects to the specified EndpointGroup with the specified SessionProtocol and ThriftSerializationFormats.BINARY.
    Returns a new ThriftClientBuilder that builds the client that connects to the specified uri.
    builder(String scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup)
    Returns a new ThriftClientBuilder that builds the client that connects to the specified EndpointGroup with the specified scheme.
    builder(URI uri)
    Returns a new ThriftClientBuilder that builds the client that connects to the specified URI.
    static <T> T
    newClient(com.linecorp.armeria.common.Scheme scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, Class<T> clientType)
    Creates a new Thrift client that connects to the specified EndpointGroup with the specified Scheme using the default ClientFactory.
    static <T> T
    newClient(com.linecorp.armeria.common.SessionProtocol protocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, Class<T> clientType)
    Creates a new Thrift client that connects to the specified EndpointGroup with the specified SessionProtocol and ThriftSerializationFormats.BINARY using the default ClientFactory.
    static <T> T
    newClient(com.linecorp.armeria.common.SessionProtocol protocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, String path, Class<T> clientType)
    Creates a new client that connects to the specified EndpointGroup with the specified SessionProtocol, path and ThriftSerializationFormats.BINARY using the default ClientFactory.
    static <T> T
    newClient(String scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, Class<T> clientType)
    Creates a new Thrift client that connects to the specified EndpointGroup with the specified scheme using the default ClientFactory.
    static <T> T
    newClient(String scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, String path, Class<T> clientType)
    Creates a new Thrift client that connects to the specified EndpointGroup with the specified scheme and path using the default ClientFactory.
    static <T> T
    newClient(String uri, Class<T> clientType)
    Creates a new Thrift client that connects to the specified uri using the default ClientFactory.
    static <T> T
    newClient(URI uri, Class<T> clientType)
    Creates a new Thrift client that connects to the specified URI using the default ClientFactory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • newClient

      public static <T> T newClient(String uri, Class<T> clientType)
      Creates a new Thrift client that connects to the specified uri using the default ClientFactory.

      Note that if a SerializationFormat is not specified in the Scheme component of the uri, ThriftSerializationFormats.BINARY will be used by default.

      Parameters:
      uri - the URI of the server endpoint
      clientType - the type of the new Thrift client
      Throws:
      IllegalArgumentException - if the specified uri is invalid, or the specified clientType is an unsupported Thrift client stub.
    • newClient

      public static <T> T newClient(URI uri, Class<T> clientType)
      Creates a new Thrift client that connects to the specified URI using the default ClientFactory.

      Note that if a SerializationFormat is not specified in the Scheme component of the uri, ThriftSerializationFormats.BINARY will be used by default.

      Parameters:
      uri - the URI of the server endpoint
      clientType - the type of the new Thrift client
      Throws:
      IllegalArgumentException - if the specified uri is invalid, or the specified clientType is an unsupported Thrift client stub.
    • newClient

      public static <T> T newClient(String scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, Class<T> clientType)
      Creates a new Thrift client that connects to the specified EndpointGroup with the specified scheme using the default ClientFactory.

      Note that if a SerializationFormat is not specified in the Scheme component of the uri, ThriftSerializationFormats.BINARY will be used by default.

      Parameters:
      scheme - the Scheme represented as a String
      endpointGroup - the server EndpointGroup
      clientType - the type of the new Thrift client
      Throws:
      IllegalArgumentException - if the specified scheme is invalid or the specified clientType is an unsupported Thrift client stub.
    • newClient

      public static <T> T newClient(com.linecorp.armeria.common.Scheme scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, Class<T> clientType)
      Creates a new Thrift client that connects to the specified EndpointGroup with the specified Scheme using the default ClientFactory.

      Note that if a SerializationFormat is not specified in the Scheme component of the uri, ThriftSerializationFormats.BINARY will be used by default.

      Parameters:
      scheme - the Scheme
      endpointGroup - the server EndpointGroup
      clientType - the type of the new Thrift client
      Throws:
      IllegalArgumentException - if the specified Scheme is invalid or the specified clientType is an unsupported Thrift client stub.
    • newClient

      public static <T> T newClient(String scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, String path, Class<T> clientType)
      Creates a new Thrift client that connects to the specified EndpointGroup with the specified scheme and path using the default ClientFactory.

      Note that if a SerializationFormat is not specified in the Scheme component of the uri, ThriftSerializationFormats.BINARY will be used by default.

      Parameters:
      scheme - the Scheme represented as a String
      endpointGroup - the server EndpointGroup
      path - the path to the endpoint
      clientType - the type of the new client
      Throws:
      IllegalArgumentException - if the specified Scheme is invalid or the specified clientType is an unsupported Thrift client stub.
    • newClient

      public static <T> T newClient(com.linecorp.armeria.common.SessionProtocol protocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, Class<T> clientType)
      Creates a new Thrift client that connects to the specified EndpointGroup with the specified SessionProtocol and ThriftSerializationFormats.BINARY using the default ClientFactory.
      Parameters:
      protocol - the SessionProtocol
      endpointGroup - the server EndpointGroup
      clientType - the type of the new Thrift client
      Throws:
      IllegalArgumentException - if the clientType is an unsupported Thrift client stub.
    • newClient

      public static <T> T newClient(com.linecorp.armeria.common.SessionProtocol protocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup, String path, Class<T> clientType)
      Creates a new client that connects to the specified EndpointGroup with the specified SessionProtocol, path and ThriftSerializationFormats.BINARY using the default ClientFactory.
      Parameters:
      protocol - the SessionProtocol
      endpointGroup - the server EndpointGroup
      path - the path to the endpoint
      clientType - the type of the new client
      Throws:
      IllegalArgumentException - if the clientType is an unsupported Thrift client stub.
    • builder

      public static ThriftClientBuilder builder(String uri)
      Returns a new ThriftClientBuilder that builds the client that connects to the specified uri.

      Note that if a SerializationFormat is not specified in the Scheme component of the uri, ThriftSerializationFormats.BINARY will be used by default.

      Throws:
      IllegalArgumentException - if the specified uri is invalid, or the uri's scheme contains an invalid SerializationFormat.
    • builder

      public static ThriftClientBuilder builder(URI uri)
      Returns a new ThriftClientBuilder that builds the client that connects to the specified URI.

      Note that if a SerializationFormat is not specified in the Scheme component of the URI, ThriftSerializationFormats.BINARY will be used by default.

      Throws:
      IllegalArgumentException - if the specified URI is invalid, or the URI's scheme contains an invalid SerializationFormat.
    • builder

      public static ThriftClientBuilder builder(String scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup)
      Returns a new ThriftClientBuilder that builds the client that connects to the specified EndpointGroup with the specified scheme.

      Note that if a SerializationFormat is not specified in the given scheme, ThriftSerializationFormats.BINARY will be used by default.

      Throws:
      IllegalArgumentException - if the scheme is invalid.
    • builder

      public static ThriftClientBuilder builder(com.linecorp.armeria.common.SessionProtocol protocol, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup)
      Returns a new ThriftClientBuilder that builds the Thrift client that connects to the specified EndpointGroup with the specified SessionProtocol and ThriftSerializationFormats.BINARY.
    • builder

      public static ThriftClientBuilder builder(com.linecorp.armeria.common.Scheme scheme, com.linecorp.armeria.client.endpoint.EndpointGroup endpointGroup)
      Returns a new ThriftClientBuilder that builds the client that connects to the specified EndpointGroup with the specified Scheme.

      Note that if SerializationFormat.NONE is specified in the Scheme, ThriftSerializationFormats.BINARY will be used by default.