Class TapkeyServiceFactoryBuilder


  • public class TapkeyServiceFactoryBuilder
    extends Object
    This class is used to build a TapkeyServiceFactory.

    The example below illustrates a default use of this class and will cover most use cases:

     TapkeyServiceFactoryBuilder b = new TapkeyServiceFactoryBuilder();
     TapkeyServiceFactory tapkeyServiceFactory = b.build(this);
     
    See Also:
    TapkeyServiceFactory
    • Constructor Detail

      • TapkeyServiceFactoryBuilder

        public TapkeyServiceFactoryBuilder​(android.app.Application application)
        Constructs a Tapkey service factory builder.
        Parameters:
        application - the app's application instance.
    • Method Detail

      • setConfig

        public TapkeyServiceFactoryBuilder setConfig​(TapkeyEnvironmentConfig config)
        Overrides the default Tapkey environment configuration with the specified one. Must only be used if suggested by Tapkey.
        Parameters:
        config - the custom Tapkey environment configuration.
        Returns:
        the TapkeyServiceFactoryBuilder instance for chaining.
      • setHttpRequestExecutor

        public TapkeyServiceFactoryBuilder setHttpRequestExecutor​(net.tpky.mc.rest.AsyncHttpRequestExecutor httpRequestExecutor)
        Reserved for internal use.
      • setWebSocketFactory

        public TapkeyServiceFactoryBuilder setWebSocketFactory​(net.tpky.mc.relay.WebSocketFactory webSocketFactory)
        Reserved for internal use.
      • setDiagnosticsHandler

        public TapkeyServiceFactoryBuilder setDiagnosticsHandler​(net.tpky.mc.diagnostics.DiagnosticsHandler diagnosticsHandler)
        Reserved for internal use.
      • setPushNotificationTokenProvider

        public TapkeyServiceFactoryBuilder setPushNotificationTokenProvider​(PushNotificationTokenProvider pushNotificationTokenProvider)
        Sets the application's push notification provider. The SDK will call this handler to request push notification registration tokens.
        Parameters:
        pushNotificationTokenProvider - the PushNotificationTokenProvider
        Returns:
        the TapkeyServiceFactoryBuilder instance for chaining.
        See Also:
        PushNotificationTokenProvider
      • setTokenRefreshHandler

        public TapkeyServiceFactoryBuilder setTokenRefreshHandler​(TokenRefreshHandler tokenRefreshHandler)
        Sets the application's token refresh handler. The SDK will call this handler to request renewal of access tokens.
        Parameters:
        tokenRefreshHandler - the TokenRefreshHandler
        Returns:
        the TapkeyServiceFactoryBuilder instance for chaining.
        See Also:
        TokenRefreshHandler
      • addDataContextMigrationListener

        public TapkeyServiceFactoryBuilder addDataContextMigrationListener​(net.tpky.mc.dao.DataContextMigrationListener dataContextMigrationListener)
        Reserved for internal use.
      • setSystemClock

        public TapkeyServiceFactoryBuilder setSystemClock​(net.tpky.mc.time.Clock systemClock)
        Overrides the system clock. This mainly makes sense in testing scenarios.
        Parameters:
        systemClock - the system clock.
        Returns:
        the TapkeyServiceFactoryBuilder instance for chaining.
      • setServerClock

        public TapkeyServiceFactoryBuilder setServerClock​(net.tpky.mc.time.ServerClock serverClock)
        Overrides the internal server clock used by various components of the SDK. If applications require access to the server clock, they must use this method to override the SDK's internal server clock and keep hold of the reference for later use.
        Parameters:
        serverClock - the ServerClock to be used by the SDK.
        Returns:
        the TapkeyServiceFactoryBuilder instance for chaining.
      • setBluetoothStack

        public TapkeyServiceFactoryBuilder setBluetoothStack​(net.tpky.mc.ble.BluetoothStack bluetoothStack)
        Reserved for internal use.
      • build

        @RequiresPermission("android.permission.INTERNET")
        public TapkeyServiceFactory build()
        Builds the service factory.
        Returns:
        the TapkeyServiceFactory with the configured properties.
        See Also:
        TapkeyServiceFactory