Class ClientFactory


  • public abstract class ClientFactory
    extends java.lang.Object
    A factory class that is used to create BankClient instances.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static BankClient authenticatedBank​(io.grpc.ManagedChannel channel, java.lang.String bankMemberId, java.util.Optional<java.lang.String> bankId, io.token.security.CryptoEngine crypto)
      Creates authenticated bank client backed by the specified channel.
      static UserClient authenticatedUser​(io.grpc.ManagedChannel channel, java.lang.String memberId, io.token.security.CryptoEngine crypto)
      Creates authenticated user client backed by the specified channel.
      static UnauthenticatedClient unauthenticated​(io.grpc.ManagedChannel channel)
      Creates new unauthenticated client backed by the specified channel.
      • Methods inherited from class java.lang.Object

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

      • unauthenticated

        public static UnauthenticatedClient unauthenticated​(io.grpc.ManagedChannel channel)
        Creates new unauthenticated client backed by the specified channel.
        Parameters:
        channel - RPC channel to use
        Returns:
        newly created client
      • authenticatedBank

        public static BankClient authenticatedBank​(io.grpc.ManagedChannel channel,
                                                   java.lang.String bankMemberId,
                                                   java.util.Optional<java.lang.String> bankId,
                                                   io.token.security.CryptoEngine crypto)
        Creates authenticated bank client backed by the specified channel. The supplied signer is used to authenticate the caller for every call.
        Parameters:
        channel - RPC channel to use
        bankMemberId - the bank member id
        bankId - the bank id
        crypto - crypto engine to use for signing requests, tokens, etc
        Returns:
        newly created client
      • authenticatedUser

        public static UserClient authenticatedUser​(io.grpc.ManagedChannel channel,
                                                   java.lang.String memberId,
                                                   io.token.security.CryptoEngine crypto)
        Creates authenticated user client backed by the specified channel. The supplied signer is used to authenticate the caller for every call.
        Parameters:
        channel - RPC channel to use
        memberId - member id
        crypto - crypto engine to use for signing requests, tokens, etc
        Returns:
        newly created client