Class GatewayHook

    • Field Detail

      • CACHE_CONTROL_PROPERTY_KEY

        public static final java.lang.String CACHE_CONTROL_PROPERTY_KEY
        If VM argument is provided with this key, the string value will be applied to the Cache-Control header instead of the default settings defined by DEFAULT_RESOURCE_CACHE_CONTROL.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GatewayHook

        public GatewayHook()
    • Method Detail

      • setup

        public void setup​(GatewayContext gatewayContext)
        Description copied from interface: GatewayModuleHook
        Called to before startup. This is the chance for the module to add its extension points and update persistent records and schemas. None of the managers will be started up at this point, but the extension point managers will accept extension point types.
      • startup

        public void startup​(LicenseState activationState)
        Description copied from interface: GatewayModuleHook
        Called to initialize the module. Will only be called once. Persistence interface is available, but only in read-only mode.
      • shutdown

        public void shutdown()
        Called to shutdown this module. Note that this instance will never be started back up - a new one will be created if a restart is desired.
      • isMakerEditionCompatible

        public boolean isMakerEditionCompatible()
        Returns:
        true if this module opts-in to participating in Ignition Maker Edition. Default is false. If you override this and return true, your module will become activated when running in a Maker Edition installation.
      • getMountedResourceFolder

        public java.util.Optional<java.lang.String> getMountedResourceFolder()
        Returns:
        the path to a folder in one of the module's gateway jar files that should be mounted at /main/res/module-id/foldername
      • getMountPathAlias

        public java.util.Optional<java.lang.String> getMountPathAlias()
        Description copied from interface: GatewayModuleHook
        Used by the mounting underneath /res/module-id/* and /main/data/module-id/* as an alternate mounting path instead of your module id, if present.
      • mountRouteHandlers

        public void mountRouteHandlers​(RouteGroup routes)
        Provides a chance for the module to mount any route handlers it wants. These will be active at /main/data/module-id/* See RouteGroup for details. Will be called after startup().
        Parameters:
        routes - the routes group, used to serve data via http requests to the Ignition Gateway
      • getStatusOverviewContributor

        public java.util.Optional<OverviewContributor> getStatusOverviewContributor()
        Description copied from interface: GatewayModuleHook
        Implement this method to contribute meta data to the Status section's Systems / Overview page.
      • onMountedResourceRequest

        public void onMountedResourceRequest​(java.lang.String resourcePath,
                                             javax.servlet.http.HttpServletResponse response)
        Description copied from interface: GatewayModuleHook
        Called prior to a 'mounted resource request' being fulfilled by requests to the mounted resource servlet serving resources from /res/module-id/ (or /res/alias/ if GatewayModuleHook.getMountPathAlias() is implemented). It is called after the target resource has been successfully located.

        Primarily intended as an opportunity to amend/alter the response's headers for purposes such as establishing Cache-Control. By default, Ignition sets no additional headers on a resource request.

        Parameters:
        resourcePath - path to the resource being returned by the mounted resource request
        response - the response to read/amend.
      • isClientCacheEnabled

        public static boolean isClientCacheEnabled()