Package io.token.sdk

Class ServerBuilder

    • Method Detail

      • forConfig

        public static ServerBuilder forConfig​(com.typesafe.config.Config config)
        Creates the gRPC server builder from a Config instance.
        Parameters:
        config - Config instance with server connection details
        Returns:
        ServerBuilder instance
      • forPort

        public static ServerBuilder forPort​(int port)
        Creates the gRPC server builder with port to listen on.
        Parameters:
        port - port to listen on
        Returns:
        ServerBuilder instance
      • withTls

        public ServerBuilder withTls​(@Nullable
                                     java.lang.String certFile,
                                     @Nullable
                                     java.lang.String keyFile,
                                     @Nullable
                                     java.lang.String trustedCertFile,
                                     @Nullable
                                     java.util.List<java.lang.String> acl)
        Configures mutual TLS.
        Parameters:
        certFile - certificate file in PEM format
        keyFile - PKCS8 private key file in PEM format
        trustedCertFile - trusted certificate collection file in PEM format
        acl - access control list - list of common names acceptable by service
        Returns:
        this builder
      • withTls

        public ServerBuilder withTls​(@Nullable
                                     java.lang.String certFile,
                                     @Nullable
                                     java.lang.String keyFile,
                                     @Nullable
                                     java.lang.String trustedCertFile)
        Configures mutual TLS without ACL.
        Parameters:
        certFile - certificate file in PEM format
        keyFile - PKCS8 private key file in PEM format
        trustedCertFile - trusted certificate collection file in PEM format
        Returns:
        this builder
      • build

        public io.token.rpc.server.RpcServer build()
        Builds the new gRPC server instance. The instance needs to be started with the Server.start() call.
        Returns:
        gRPC server instance