Package io.token.sdk
Class ServerBuilder
- java.lang.Object
-
- io.token.sdk.AbstractServerBuilder<ServerBuilder>
-
- io.token.sdk.ServerBuilder
-
public final class ServerBuilder extends AbstractServerBuilder<ServerBuilder>
Builds a gRPC server instance that is used to process requests from Token as far as a bank integration is concerned. There are the interfaces that a bank needs to implement:AccountService
- used to retrieve account balance, list transactions, etcAccountLinkingService
- used to retrieve bank authorization payloadTransferService
- used to process bank transfers using existing railsStorageService
- used by Bank Service to persist data. This is only used if Bank Service is hosted by the bank.NotificationService
- used to send notifications to different subscribers.AccountManagementService
- used to receive notifications when accounts or unlinked.ConsentManagementService
- used to receive notification when consent created or revoked.HealthCheckService
- used to perform health checks.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.token.rpc.server.RpcServer
build()
Builds the new gRPC server instance.static ServerBuilder
forConfig(com.typesafe.config.Config config)
Creates the gRPC server builder from aConfig
instance.static ServerBuilder
forPort(int port)
Creates the gRPC server builder with port to listen on.ServerBuilder
withTls(java.lang.String certFile, java.lang.String keyFile, java.lang.String trustedCertFile)
Configures mutual TLS without ACL.ServerBuilder
withTls(java.lang.String certFile, java.lang.String keyFile, java.lang.String trustedCertFile, java.util.List<java.lang.String> acl)
Configures mutual TLS.-
Methods inherited from class io.token.sdk.AbstractServerBuilder
registerInterceptor, reportErrorDetails, withAccountLinkingService, withAccountManagementService, withAccountService, withConsentManagementService, withHealthCheckService, withNotificationService, withStorageService, withTransferService
-
-
-
-
Method Detail
-
forConfig
public static ServerBuilder forConfig(com.typesafe.config.Config config)
Creates the gRPC server builder from aConfig
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 formatkeyFile
- PKCS8 private key file in PEM formattrustedCertFile
- trusted certificate collection file in PEM formatacl
- 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 formatkeyFile
- PKCS8 private key file in PEM formattrustedCertFile
- 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 theServer.start()
call.- Returns:
- gRPC server instance
-
-