Class GatewayHook
java.lang.Object
com.inductiveautomation.ignition.gateway.model.AbstractGatewayModuleHook
com.inductiveautomation.perspective.gateway.GatewayHook
- All Implemented Interfaces:
com.inductiveautomation.ignition.gateway.clientcomm.scriptmsg.event.SessionMessageDispatchHandler,GatewayModuleHook
public class GatewayHook
extends AbstractGatewayModuleHook
implements com.inductiveautomation.ignition.gateway.clientcomm.scriptmsg.event.SessionMessageDispatchHandler
This class is the gateway hook for loading into the Ignition platform.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GatewayHookget(GatewayContext context) static longstatic longstatic longUsed by the mounting underneath /res/module-id/* and /data/module-id/* as an alternate mounting path instead of your module id, if present.Returns the RPC implementation for this module, if any.handleMessage(com.inductiveautomation.ignition.gateway.clientcomm.scriptmsg.event.SessionMessageDispatchEvent event) voidinitializeScriptManager(ScriptManager manager) Initialize a newly-instantiated script manager.static booleanbooleanvoidmountRouteHandlers(RouteGroup routes) Provides a chance for the module to mount any route handlers it wants.voidnotifyLicenseStateChanged(LicenseState platformLicense) Notify module hook when the license state has changed.voidonMountedResourceRequest(String resourcePath, jakarta.servlet.http.HttpServletResponse response) 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/ ifGatewayModuleHook.getMountPathAlias()is implemented).voidsetup(GatewayContext gatewayContext) Called before register.voidshutdown()Called to shutdown this module.voidstartup(LicenseState activationState) Called to initialize the module.Methods inherited from class com.inductiveautomation.ignition.gateway.model.AbstractGatewayModuleHook
configureDeserializer, configureFunctionFactory, configureSerializerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.inductiveautomation.ignition.gateway.model.GatewayModuleHook
getExtensionPoints, getRecordMigrationStrategies, isFreeModule
-
Constructor Details
-
GatewayHook
public GatewayHook()
-
-
Method Details
-
get
-
getComponentModelDelegateRegistry
-
getAuthTokenManager
-
setup
Description copied from interface:GatewayModuleHookCalled before register. The module can create data structures, loggers, etc. The module should not reach out to other parts of the system and expect them to be ready or created yet.- Specified by:
setupin interfaceGatewayModuleHook
-
startup
Description copied from interface:GatewayModuleHookCalled to initialize the module. Will only be called once. Persistence interface is available, but only in read-only mode.- Specified by:
startupin interfaceGatewayModuleHook
-
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.- Specified by:
shutdownin interfaceGatewayModuleHook
-
isMakerEditionCompatible
public boolean isMakerEditionCompatible()- Specified by:
isMakerEditionCompatiblein interfaceGatewayModuleHook- Returns:
trueif this module opts-in to participating in Ignition Maker Edition. Default isfalse. If you override this and return true, your module will become activated when running in a Maker Edition installation.
-
handleMessage
public List<String> handleMessage(com.inductiveautomation.ignition.gateway.clientcomm.scriptmsg.event.SessionMessageDispatchEvent event) - Specified by:
handleMessagein interfacecom.inductiveautomation.ignition.gateway.clientcomm.scriptmsg.event.SessionMessageDispatchHandler
-
getContext
-
getRedundancyStatus
-
notifyLicenseStateChanged
Description copied from interface:GatewayModuleHookNotify module hook when the license state has changed. This could only contain changes for the module or it could contain a change to the platform license (version, restrictions such as expiration date, sqltag count...)- Specified by:
notifyLicenseStateChangedin interfaceGatewayModuleHook- Overrides:
notifyLicenseStateChangedin classAbstractGatewayModuleHook
-
getLicenseState
-
getMountedResourceFolder
- Specified by:
getMountedResourceFolderin interfaceGatewayModuleHook- 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
Description copied from interface:GatewayModuleHookUsed by the mounting underneath /res/module-id/* and /data/module-id/* as an alternate mounting path instead of your module id, if present.- Specified by:
getMountPathAliasin interfaceGatewayModuleHook
-
mountRouteHandlers
Provides a chance for the module to mount any route handlers it wants. These will be active at /main/data/module-id/* SeeRouteGroupfor details. Will be called after startup().- Specified by:
mountRouteHandlersin interfaceGatewayModuleHook- Parameters:
routes- the routes group, used to serve data via http requests to the Ignition Gateway
-
initializeScriptManager
Description copied from interface:GatewayModuleHookInitialize a newly-instantiated script manager. This will be called exactly once for any givenScriptManagerinstance. Usually this will involve callingScriptManager.addScriptModule(String, Object), which reflectively loads the public (instance and static) java functions from the given object into the scripting environment, at the provided path.This function may be called before
GatewayModuleHook.startup(LicenseState), but never beforeGatewayModuleHook.setup(GatewayContext).- Specified by:
initializeScriptManagerin interfaceGatewayModuleHook- Overrides:
initializeScriptManagerin classAbstractGatewayModuleHook
-
getRpcImplementation
Description copied from interface:GatewayModuleHookReturns the RPC implementation for this module, if any. This is the recommended way to expose RPC functions to the Designer or Vision Client if required. The return value will be cached for the lifetime of the Gateway.- Specified by:
getRpcImplementationin interfaceGatewayModuleHook- Overrides:
getRpcImplementationin classAbstractGatewayModuleHook- See Also:
-
onMountedResourceRequest
public void onMountedResourceRequest(String resourcePath, jakarta.servlet.http.HttpServletResponse response) Description copied from interface:GatewayModuleHookCalled prior to a 'mounted resource request' being fulfilled by requests to the mounted resource servlet serving resources from /res/module-id/ (or /res/alias/ ifGatewayModuleHook.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.
- Specified by:
onMountedResourceRequestin interfaceGatewayModuleHook- Parameters:
resourcePath- path to the resource being returned by the mounted resource requestresponse- the response to read/amend.
-
isClientCacheEnabled
public static boolean isClientCacheEnabled() -
getMaxIdleTimeMs
public static long getMaxIdleTimeMs() -
getIdleTimeIntervalMs
public static long getIdleTimeIntervalMs() -
getHelloResponseTimeoutMs
public static long getHelloResponseTimeoutMs()
-