Interface GatewayContext
- All Superinterfaces:
CommonContext
,ExecutionManagerFactory
- All Known Implementing Classes:
GatewayContextDecorator
The GatewayContext is the main interface to the Ignition Gateway. It provides access to all the managers and
services that are available in the Ignition Gateway.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The string key where the instance of GatewayContext is stored under the servlet context object object. -
Method Summary
Modifier and TypeMethodDescriptioncreateDataSource
(Properties connectionProps) Will create a javax.sql.DataSource that uses connection pooling through apache's DBCP2The alarm manager is the central hub for alarming.default DiagnosticsManager
Returns the shared execution manager for the gateway.default com.codahale.metrics.health.HealthCheckRegistry
Returns a UUID that is generated fresh every time the context starts up.Returns an interface to the persistence system that bypasses redundancy, and goes directly to the internal database.The MessageDispatchManager is used to send script messages to message handlers running on clients and the Gateway.Returns the MetricHistoryManager, which allows system metric history to be stored for a limited amount of time.com.codahale.metrics.MetricRegistry
Returns the Gateway MetricRegistry, where various metrics like meters and gauges can be accessed.@Nullable GatewayModuleHook
Returns the hook class for another module, used for modules that deal with each other's models.Returns theModuleServicesManager
, which is responsible for managing the lifecycle of ModuleServices and ModuleServiceConsumers.Returns the appropriate named query rpc for the context.TheNativeLibraryManager
can be used to load gateway-scoped native libraries on a ClassLoader that is reachable by all modules.Returns an interface to the internal database persistence system.Get the manager that holds all of the defined schedules.getState()
May return a string describing why the context is in its current stateReturns theStoreAndForwardManager
that can be used for storing data to some store and forward engine.The modern way to look up and set gateway system properties.Returns the manager that provides access to Ignition's tag system.default TelemetryManager
This manager holds all the configured user sources in the system.Methods inherited from interface com.inductiveautomation.ignition.common.model.CommonContext
createDeserializer, getEdgeEditions, getEventBus, getExpressionFunctionFactory, getLicenseState, getScriptManager
Methods inherited from interface com.inductiveautomation.ignition.common.ExecutionManagerFactory
createExecutionManager, createExecutionManager
-
Field Details
-
SERVLET_CONTEXT_KEY
The string key where the instance of GatewayContext is stored under the servlet context object object. Servlets can grab the GatewayContext like so:GatewayContext context = (GatewayContext) getServletContext().getAttribute(GatewayContext.SERVLET_CONTEXT_KEY);
-
-
Method Details
-
getDatasourceManager
DatasourceManager getDatasourceManager() -
getUserSourceManager
UserSourceManager getUserSourceManager()This manager holds all the configured user sources in the system. User sources are used for authentication and managing users' contact info, schedules, etc. -
getSecurityZoneManager
SecurityZoneManager getSecurityZoneManager() -
getScheduleManager
ScheduleManager getScheduleManager()Get the manager that holds all of the defined schedules. Schedules are used in alarm notification. -
getAuditManager
AuditManager getAuditManager() -
getAlarmManager
AlarmManager getAlarmManager()The alarm manager is the central hub for alarming. It is generally used for querying, both status and historical, but can also be used to register new alarm events, and subscribe to alarm events. -
getInstanceToken
UUID getInstanceToken()Returns a UUID that is generated fresh every time the context starts up. -
getLocalDBInterface
DBInterface getLocalDBInterface() -
getPersistenceInterface
PersistenceInterface getPersistenceInterface()Returns an interface to the internal database persistence system. This version of the function (as compared to getLocalPersistenceInterface()) handles additional tasks, such as replicating data to the redundant backup, and is the version that should be used for most tasks. -
getLocalPersistenceInterface
PersistenceInterface getLocalPersistenceInterface()Returns an interface to the persistence system that bypasses redundancy, and goes directly to the internal database. In general, this should NOT be used. Instead, most module authors will want to use getPersistenceInterface(). This -
createDataSource
Will create a javax.sql.DataSource that uses connection pooling through apache's DBCP2- Throws:
Exception
-
getSchemaUpdater
SchemaUpdater getSchemaUpdater() -
getExecutionManager
ExecutionManager getExecutionManager()Returns the shared execution manager for the gateway. Only schedule tasks in here that will not block, which could cause thread starvation. -
getExecutorService
ExecutorService getExecutorService() -
getScheduledExecutorService
ScheduledExecutorService getScheduledExecutorService() -
getRedundancyManager
RedundancyManager getRedundancyManager() -
getGatewaySessionManager
GatewaySessionManager getGatewaySessionManager() -
getModuleServicesManager
ModuleServicesManager getModuleServicesManager()Returns theModuleServicesManager
, which is responsible for managing the lifecycle of ModuleServices and ModuleServiceConsumers. This system is used to allow modules to provide services to other modules. The typical pattern is that a dependant module will know about an interface that it wants to use, and it will request that interface from the ModuleServicesManager. The ModuleServicesManager will then notify the dependant module when the service is available. -
getApiTokenManager
ApiTokenManager getApiTokenManager() -
getSystemPropertiesManager
SystemPropertiesManager getSystemPropertiesManager()The modern way to look up and set gateway system properties. This method replaces getSystemProperties(), which had a dangerous dependency on a global ORM record holding gateway system properties.Available gateway system properties are listed in the GatewaySystemProperties object. Use one of the Properties in that class to get and set gateway system properties.
- Returns:
- the SystemPropertiesManager that can be used to get and set gateway system properties safely.
-
getOpcManager
OpcConnectionManager getOpcManager() -
getTagManager
GatewayTagManager getTagManager()Description copied from interface:CommonContext
Returns the manager that provides access to Ignition's tag system.- Specified by:
getTagManager
in interfaceCommonContext
-
getTagHistoryManager
TagHistoryManager getTagHistoryManager() -
getStoreAndForwardManager
StoreAndForwardManager getStoreAndForwardManager()Returns theStoreAndForwardManager
that can be used for storing data to some store and forward engine. This manager is also useful for registering different engines, sinks, and stores as well as data serializers.- Returns:
- The
StoreAndForwardManager
. - Since:
- 8.3.0
-
getEmailProfileManager
EmailProfileManager getEmailProfileManager() -
getImageManager
ImageManager getImageManager() -
getNamedQueryManager
NamedQueryManager getNamedQueryManager()Returns the appropriate named query rpc for the context. In the gateway and client, we only want to use named queries that have been saved. In the designer, we want to use the current version so that reports and bindings can be seen and used for testing before the project is saved.- Returns:
- The correct NamedQueryManager implementation for the scope.
- Since:
- 7.9.3
-
getState
ContextState getState() -
getStateMessage
String getStateMessage()May return a string describing why the context is in its current state -
getProjectManager
ProjectManager getProjectManager() -
getSystemManager
SystemManager getSystemManager() -
getConfigurationManager
ConfigurationManager getConfigurationManager() -
getModuleManager
ModuleManager getModuleManager() -
getModule
Description copied from interface:CommonContext
Returns the hook class for another module, used for modules that deal with each other's models. Example: The Reporting module's Designer hook uses this to get the Vision module's hook, in order to add components to the Vision module's palette.Note that the type of object you get back from this method is very scope specific. In the Gateway, you'll get a GatewayModuleHook, in the Designer you'll get a DesignerModuleHook, etc.
- Specified by:
getModule
in interfaceCommonContext
- Parameters:
id
- The module ID of the module you want to get the hook for.- Returns:
- The hook class for the given module, or null if the module is not installed or not present in the given scope.
-
getLicenseManager
LicenseManager getLicenseManager() -
getPerformanceMonitor
PerformanceMonitor getPerformanceMonitor() -
getProgressManager
GatewayProgressManager getProgressManager() -
getWebResourceManager
WebResourceManager getWebResourceManager() -
getNativeLibraryManager
NativeLibraryManager getNativeLibraryManager()TheNativeLibraryManager
can be used to load gateway-scoped native libraries on a ClassLoader that is reachable by all modules.- Returns:
- The
NativeLibraryManager
. - Since:
- Ignition 7.3.3
-
getMessageDispatchManager
MessageDispatchManager getMessageDispatchManager()The MessageDispatchManager is used to send script messages to message handlers running on clients and the Gateway. -
getGatewayNetworkManager
GatewayNetworkManager getGatewayNetworkManager() -
getLoggingManager
GatewayLoggingManager getLoggingManager()- Specified by:
getLoggingManager
in interfaceCommonContext
-
getMetricRegistry
com.codahale.metrics.MetricRegistry getMetricRegistry()Returns the Gateway MetricRegistry, where various metrics like meters and gauges can be accessed. *NOTE* if you have registered a metric in MetricHistoryManager, do not delete it directly from MetricRegistry! Use MetricHistoryManager.unregister() instead. -
getHealthCheckRegistry
default com.codahale.metrics.health.HealthCheckRegistry getHealthCheckRegistry() -
getMetricHistoryManager
MetricHistoryManager getMetricHistoryManager()Returns the MetricHistoryManager, which allows system metric history to be stored for a limited amount of time. -
getSecurityLevelManager
SecurityLevelManager getSecurityLevelManager()- Returns:
- the
SecurityLevelManager
-
getSyncManager
SyncManager getSyncManager()- Returns:
- the
SyncManager
that handles syncing data between two systems. - Since:
- 8.0.5
-
getServiceConnectorManager
ServiceConnectorManager getServiceConnectorManager() -
getTelemetryManager
- Returns:
- the TelemetryManager used to gather statistics about the os, vm, and Ignition configuration.
-
getDiagnosticsManager
- Returns:
- DiagnosticManager which is capable of providing a diagnostic bundle file
-
getMetricsDashboardsManager
MetricsDashboardsManager getMetricsDashboardsManager() -
getSystemEncryptionService
SystemEncryptionService getSystemEncryptionService() -
getSecretProviderManager
SecretProviderManager getSecretProviderManager() -
getRestartTasksManager
RestartTasksManager getRestartTasksManager() -
getEntityManager
EntityManager getEntityManager()- Returns:
- The Gateway-wide, shared
EntityManager
, which is used to register diagnostic entities. An entity is an abstraction that can be used to represent a configuration and/or diagnostic object in a generic way. - Since:
- 8.3.0
-