Class AppPushConfigs

java.lang.Object
com.iizix.server.push.engine.AppPushConfigs

public final class AppPushConfigs extends Object
Finds the push configuration of an application: its .iiziPush container, which holds the VAPID key pair, the VAPID subject, the Firebase project ID and the Firebase service account.

* is the iiziSystem application, whose container serves the iiziRun clients that name no application; any other ID is looked up among the server's loaded applications, and its first module project that carries a .iiziPush answers. Nothing is cached: an application can be hot-deployed, and the container is a live property tree the lookup costs two map reads.

Author:
Christopher Mindus
  • Field Details

    • ALL_APPS

      public static final String ALL_APPS
      The application ID of the server's own iiziRun subscriptions.
      See Also:
  • Constructor Details

    • AppPushConfigs

      public AppPushConfigs(Function<String, PushProps> lookup)
      Constructor with a custom lookup, for tests.
      Parameters:
      lookup - Maps an application ID, * included, to its container or null.
  • Method Details

    • forServer

      public static AppPushConfigs forServer(IServer server)
      Creates the lookup over a running server.
      Parameters:
      server - The server.
      Returns:
      The configs.
    • get

      public PushProps get(String appId)
      Gets the push container of an application.
      Parameters:
      appId - The application ID, * for the iiziSystem application.
      Returns:
      The container, or null when the application is unknown or has none.
    • dispose

      public void dispose()
      Disposes of the Push Notification when iiziServer is shut-down.