Package io.token

Class TokenClient.Builder<T extends TokenClient.Builder<T>>

  • Enclosing class:
    TokenClient

    public static class TokenClient.Builder<T extends TokenClient.Builder<T>>
    extends java.lang.Object
    Used to create a new TokenClient instances.
    • Field Detail

      • port

        protected int port
      • useSsl

        protected boolean useSsl
      • hostName

        protected java.lang.String hostName
      • timeoutMs

        protected long timeoutMs
      • devKey

        protected java.lang.String devKey
      • sslConfig

        protected io.token.rpc.SslConfig sslConfig
      • featureCodes

        protected java.util.List<java.lang.String> featureCodes
    • Constructor Detail

      • Builder

        public Builder()
        Creates new builder instance with the defaults initialized.
    • Method Detail

      • hostName

        public T hostName​(java.lang.String hostName)
        Sets the host name of the Token Gateway Service to connect to.
        Parameters:
        hostName - host name, e.g. 'api.token.io'
        Returns:
        this builder instance
      • port

        public T port​(int port)
        Sets the port of the Token Gateway Service to connect to.
        Parameters:
        port - port number
        Returns:
        this builder instance
      • timeout

        public T timeout​(long timeoutMs)
        Sets timeoutMs that is used for the RPC calls.
        Parameters:
        timeoutMs - RPC call timeoutMs
        Returns:
        this builder instance
      • withKeyStore

        public T withKeyStore​(KeyStore keyStore)
        Sets the keystore to be used with the SDK.
        Parameters:
        keyStore - the keystore to be used
        Returns:
        this builder instance
      • withCryptoEngine

        public T withCryptoEngine​(CryptoEngineFactory cryptoEngineFactory)
        Sets the crypto engine to be used with the SDK.
        Parameters:
        cryptoEngineFactory - the crypto engine factory to use
        Returns:
        this builder instance
      • withSslConfig

        public T withSslConfig​(io.token.rpc.SslConfig sslConfig)
        Sets configuration parameters for tls client. Can be used to specify specific trusted certificates.
        Parameters:
        sslConfig - tls configuration to use
        Returns:
        this builder instance
      • devKey

        public T devKey​(java.lang.String devKey)
        Sets the developer key to be used with the SDK.
        Parameters:
        devKey - developer key
        Returns:
        this builder instance
      • withFeatureCodes

        public T withFeatureCodes​(java.lang.String... featureCodes)
        Sets the feature codes to be used with the client.
        Parameters:
        featureCodes - feature codes
        Returns:
        this builder instance
      • getHeaders

        protected io.grpc.Metadata getHeaders()
      • getPlatform

        protected java.lang.String getPlatform()