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 StringThe 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 DBCP2default Optional<GatewayAiContext> The alarm manager is the central hub for alarming.default DiagnosticsManagerReturns the shared execution manager for the gateway.default com.codahale.metrics.health.HealthCheckRegistryReturns theImportExportManagerfor the gateway import/export system (.gwexfiles).Returns a UUID that is generated fresh every time the context starts up.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.MetricRegistryReturns the Gateway MetricRegistry, where various metrics like meters and gauges can be accessed.Returns theModuleServicesManager, which is responsible for managing the lifecycle of ModuleServices and ModuleServiceConsumers.Returns the appropriate named query rpc for the context.TheNativeLibraryManagercan be used to load gateway-scoped native libraries on a ClassLoader that is reachable by all modules.Get the manager that holds all of the defined schedules.getState()May return a string describing why the context is in its current stateReturns theStoreAndForwardManagerthat 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 TelemetryManagerThis manager holds all the configured user sources in the system.Methods inherited from interface CommonContext
createDeserializer, getEdgeEditions, getEventBus, getExpressionFunctionFactory, getLicenseState, getScriptManagerMethods inherited from interface 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. -
createDataSource
Will create a javax.sql.DataSource that uses connection pooling through apache's DBCP2- Throws:
Exception
-
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:CommonContextReturns the manager that provides access to Ignition's tag system.- Specified by:
getTagManagerin interfaceCommonContext
-
getTagHistoryManager
TagHistoryManager getTagHistoryManager() -
getStoreAndForwardManager
StoreAndForwardManager getStoreAndForwardManager()Returns theStoreAndForwardManagerthat 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() -
getLicenseManager
LicenseManager getLicenseManager() -
getLocalizationManager
LocalizationManager getLocalizationManager() -
getPerformanceMonitor
PerformanceMonitor getPerformanceMonitor() -
getProgressManager
GatewayProgressManager getProgressManager() -
getWebResourceManager
WebResourceManager getWebResourceManager() -
getNativeLibraryManager
NativeLibraryManager getNativeLibraryManager()TheNativeLibraryManagercan 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:
getLoggingManagerin 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
SyncManagerthat 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
-
getImportExportManager
ImportExportManager getImportExportManager()Returns theImportExportManagerfor the gateway import/export system (.gwexfiles). -
getAiContext
- Returns:
- the gateway-scoped
GatewayAiContextwhen the AI module is installed and active, or empty otherwise.
-