Class GatewayContextDecorator
- java.lang.Object
-
- com.inductiveautomation.ignition.gateway.model.GatewayContextDecorator
-
- All Implemented Interfaces:
ExecutionManagerFactory
,CommonContext
,GatewayContext
public abstract class GatewayContextDecorator extends java.lang.Object implements GatewayContext
Simple abstract decorator forGatewayContext
-
-
Field Summary
-
Fields inherited from interface com.inductiveautomation.ignition.gateway.model.GatewayContext
SERVLET_CONTEXT_KEY
-
-
Constructor Summary
Constructors Constructor Description GatewayContextDecorator(GatewayContext gatewayContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.sql.DataSource
createDataSource(java.util.Properties connectionProps)
Will create a javax.sql.DataSource that uses connection pooling through apache's DBCP2XMLDeserializer
createDeserializer()
Returns an instance of the XMLDeserializer that can be used to deserialize project resources.ExecutionManager
createExecutionManager(java.lang.String name, int threadCount)
Creates a new, private execution engine.ExecutionManager
createExecutionManager(java.lang.String name, int threadCount, java.util.concurrent.ThreadFactory factory)
AlarmManager
getAlarmManager()
The alarm manager is the central hub for alarming.AuditManager
getAuditManager()
DatasourceManager
getDatasourceManager()
java.util.List<EdgeEdition>
getEdgeEditions()
Returns a list of currently available Edge editions (either licensed or in trial).EdgeSystemPropertiesRecord
getEdgeSystemProperties()
Convenience function to look up the EdgeSystemPropertiesRecord.com.google.common.eventbus.EventBus
getEventBus()
This is a generic event bus that can be used by any part of Ignition within a single scope (jvm)ExecutionManager
getExecutionManager()
Returns the shared execution manager for the gateway.java.util.concurrent.ExecutorService
getExecutorService()
FunctionFactory
getExpressionFunctionFactory()
Returns the core function factory used by expressions.GatewayNetworkManager
getGatewayAreaNetworkManager()
GatewaySessionManager
getGatewaySessionManager()
HistoryManager
getHistoryManager()
HttpClientManager
getHttpClientManager()
IdpAdapterManager
getIdpAdapterManager()
ImageManager
getImageManager()
java.util.UUID
getInstanceToken()
Returns a UUID that is generated fresh every time the context starts up.LaunchManager
getLaunchManager()
LicenseManager
getLicenseManager()
LicenseState
getLicenseState(java.lang.String moduleId)
Returns the license state for the given moduleDBInterface
getLocalDBInterface()
PersistenceInterface
getLocalPersistenceInterface()
Returns an interface to the persistence system that bypasses redundancy, and goes directly to the internal database.GatewayLoggingManager
getLoggingManager()
MessageDispatchManager
getMessageDispatchManager()
The MessageDispatchManager is used to send script messages to message handlers running on clients and the Gateway.MetricHistoryManager
getMetricHistoryManager()
Returns the MetricHistoryManager, which allows system metric history to be stored for a limited amount of time.com.codahale.metrics.MetricRegistry
getMetricRegistry()
Returns the Gateway MetricRegistry, where various metrics like meters and gauges can be accessed.java.lang.Object
getModule(java.lang.String id)
Returns the hook class for another module, used for modules that deal with each other's models.ModuleManager
getModuleManager()
ModuleServicesManager
getModuleServicesManager()
NamedQueryManager
getNamedQueryManager()
Returns the appropriate named query rpc for the context.NativeLibraryManager
getNativeLibraryManager()
TheNativeLibraryManager
can be used to load gateway-scoped native libraries on a ClassLoader that is reachable by all modules.OpcConnectionManager
getOpcManager()
PerformanceMonitor
getPerformanceMonitor()
PersistenceInterface
getPersistenceInterface()
Returns an interface to the internal database persistence system.GatewayProgressManager
getProgressManager()
ProjectManager
getProjectManager()
RedundancyManager
getRedundancyManager()
java.util.concurrent.ScheduledExecutorService
getScheduledExecutorService()
ScheduleManager
getScheduleManager()
Get the manager that holds all of the defined schedules.SchemaUpdater
getSchemaUpdater()
ScriptManager
getScriptManager()
Returns the ScriptManager that can be used to execute Python scripts.SecurityLevelManager
getSecurityLevelManager()
SecurityZoneManager
getSecurityZoneManager()
SmtpManager
getSmtpManager()
ContextState
getState()
java.lang.String
getStateMessage()
May return a string describing why the context is in its current stateSyncManager
getSyncManager()
SystemManager
getSystemManager()
SystemPropertiesRecord
getSystemProperties()
Convenience function to look up the SystemPropertiesRecord.GatewayTagHistoryManager
getTagHistoryManager()
GatewayTagManager
getTagManager()
Returns the manager that provides access to Ignition's tag system.TaskManager
getTaskManager()
TelemetryManager
getTelemetryManager()
UserSourceManager
getUserSourceManager()
This manager holds all of the configured user sources in the system.java.util.Optional<WebAuthStrategyAdapter>
getWebAuthStrategyAdapter(java.lang.String type)
Get theWebAuthStrategyAdapter
registered with the given typeWebResourceManager
getWebResourceManager()
-
-
-
Constructor Detail
-
GatewayContextDecorator
public GatewayContextDecorator(@Nonnull GatewayContext gatewayContext)
-
-
Method Detail
-
getDatasourceManager
public DatasourceManager getDatasourceManager()
- Specified by:
getDatasourceManager
in interfaceGatewayContext
-
getUserSourceManager
public UserSourceManager getUserSourceManager()
Description copied from interface:GatewayContext
This manager holds all of the configured user sources in the system. User sources are used for authentication and managing users' contact info, schedules, etc.- Specified by:
getUserSourceManager
in interfaceGatewayContext
-
getSecurityZoneManager
public SecurityZoneManager getSecurityZoneManager()
- Specified by:
getSecurityZoneManager
in interfaceGatewayContext
-
getScheduleManager
public ScheduleManager getScheduleManager()
Description copied from interface:GatewayContext
Get the manager that holds all of the defined schedules. Schedules are used in alarm notification.- Specified by:
getScheduleManager
in interfaceGatewayContext
-
getAuditManager
public AuditManager getAuditManager()
- Specified by:
getAuditManager
in interfaceGatewayContext
-
getAlarmManager
public AlarmManager getAlarmManager()
Description copied from interface:GatewayContext
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.- Specified by:
getAlarmManager
in interfaceGatewayContext
-
getInstanceToken
public java.util.UUID getInstanceToken()
Description copied from interface:GatewayContext
Returns a UUID that is generated fresh every time the context starts up.- Specified by:
getInstanceToken
in interfaceGatewayContext
-
getLocalDBInterface
public DBInterface getLocalDBInterface()
- Specified by:
getLocalDBInterface
in interfaceGatewayContext
-
getPersistenceInterface
public PersistenceInterface getPersistenceInterface()
Description copied from interface:GatewayContext
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.- Specified by:
getPersistenceInterface
in interfaceGatewayContext
-
getLocalPersistenceInterface
public PersistenceInterface getLocalPersistenceInterface()
Description copied from interface:GatewayContext
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- Specified by:
getLocalPersistenceInterface
in interfaceGatewayContext
-
createDataSource
public javax.sql.DataSource createDataSource(java.util.Properties connectionProps) throws java.lang.Exception
Description copied from interface:GatewayContext
Will create a javax.sql.DataSource that uses connection pooling through apache's DBCP2- Specified by:
createDataSource
in interfaceGatewayContext
- Throws:
java.lang.Exception
-
getSchemaUpdater
public SchemaUpdater getSchemaUpdater()
- Specified by:
getSchemaUpdater
in interfaceGatewayContext
-
getExecutionManager
public ExecutionManager getExecutionManager()
Description copied from interface:GatewayContext
Returns the shared execution manager for the gateway. Only schedule tasks in here that will not block, which could cause thread starvation.- Specified by:
getExecutionManager
in interfaceGatewayContext
-
getExecutorService
public java.util.concurrent.ExecutorService getExecutorService()
- Specified by:
getExecutorService
in interfaceGatewayContext
-
getScheduledExecutorService
public java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
- Specified by:
getScheduledExecutorService
in interfaceGatewayContext
-
getRedundancyManager
public RedundancyManager getRedundancyManager()
- Specified by:
getRedundancyManager
in interfaceGatewayContext
-
getGatewaySessionManager
public GatewaySessionManager getGatewaySessionManager()
- Specified by:
getGatewaySessionManager
in interfaceGatewayContext
-
getModuleServicesManager
public ModuleServicesManager getModuleServicesManager()
- Specified by:
getModuleServicesManager
in interfaceGatewayContext
-
getSystemProperties
public SystemPropertiesRecord getSystemProperties()
Description copied from interface:GatewayContext
Convenience function to look up the SystemPropertiesRecord. Make sure not to call this if you already have a session open, because you can't open 2 sessions in the same thread. Instead, just use:session.find(SystemPropertiesRecord.META, SQueryMode.SBASIC, 0L);
- Specified by:
getSystemProperties
in interfaceGatewayContext
-
getOpcManager
public OpcConnectionManager getOpcManager()
- Specified by:
getOpcManager
in interfaceGatewayContext
-
getTagHistoryManager
public GatewayTagHistoryManager getTagHistoryManager()
- Specified by:
getTagHistoryManager
in interfaceGatewayContext
-
getHistoryManager
public HistoryManager getHistoryManager()
- Specified by:
getHistoryManager
in interfaceGatewayContext
-
getSmtpManager
public SmtpManager getSmtpManager()
- Specified by:
getSmtpManager
in interfaceGatewayContext
-
getImageManager
public ImageManager getImageManager()
- Specified by:
getImageManager
in interfaceGatewayContext
-
getNamedQueryManager
public NamedQueryManager getNamedQueryManager()
Description copied from interface:GatewayContext
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.- Specified by:
getNamedQueryManager
in interfaceGatewayContext
- Returns:
- The correct NamedQueryManager implementation for the scope.
-
getState
public ContextState getState()
- Specified by:
getState
in interfaceGatewayContext
-
getStateMessage
public java.lang.String getStateMessage()
Description copied from interface:GatewayContext
May return a string describing why the context is in its current state- Specified by:
getStateMessage
in interfaceGatewayContext
-
getProjectManager
public ProjectManager getProjectManager()
- Specified by:
getProjectManager
in interfaceGatewayContext
-
getModuleManager
public ModuleManager getModuleManager()
- Specified by:
getModuleManager
in interfaceGatewayContext
-
getLicenseManager
public LicenseManager getLicenseManager()
- Specified by:
getLicenseManager
in interfaceGatewayContext
-
getLaunchManager
public LaunchManager getLaunchManager()
- Specified by:
getLaunchManager
in interfaceGatewayContext
-
getPerformanceMonitor
public PerformanceMonitor getPerformanceMonitor()
- Specified by:
getPerformanceMonitor
in interfaceGatewayContext
-
getProgressManager
public GatewayProgressManager getProgressManager()
- Specified by:
getProgressManager
in interfaceGatewayContext
-
getNativeLibraryManager
public NativeLibraryManager getNativeLibraryManager()
Description copied from interface:GatewayContext
TheNativeLibraryManager
can be used to load gateway-scoped native libraries on a ClassLoader that is reachable by all modules.- Specified by:
getNativeLibraryManager
in interfaceGatewayContext
- Returns:
- The
NativeLibraryManager
.
-
getMessageDispatchManager
public MessageDispatchManager getMessageDispatchManager()
Description copied from interface:GatewayContext
The MessageDispatchManager is used to send script messages to message handlers running on clients and the Gateway.- Specified by:
getMessageDispatchManager
in interfaceGatewayContext
-
getGatewayAreaNetworkManager
public GatewayNetworkManager getGatewayAreaNetworkManager()
- Specified by:
getGatewayAreaNetworkManager
in interfaceGatewayContext
-
getTaskManager
public TaskManager getTaskManager()
- Specified by:
getTaskManager
in interfaceGatewayContext
-
getLoggingManager
public GatewayLoggingManager getLoggingManager()
- Specified by:
getLoggingManager
in interfaceCommonContext
- Specified by:
getLoggingManager
in interfaceGatewayContext
-
getMetricRegistry
public com.codahale.metrics.MetricRegistry getMetricRegistry()
Description copied from interface:GatewayContext
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.- Specified by:
getMetricRegistry
in interfaceGatewayContext
-
getMetricHistoryManager
public MetricHistoryManager getMetricHistoryManager()
Description copied from interface:GatewayContext
Returns the MetricHistoryManager, which allows system metric history to be stored for a limited amount of time.- Specified by:
getMetricHistoryManager
in interfaceGatewayContext
-
getScriptManager
public ScriptManager getScriptManager()
Description copied from interface:CommonContext
Returns the ScriptManager that can be used to execute Python scripts.- Specified by:
getScriptManager
in interfaceCommonContext
-
createDeserializer
public XMLDeserializer createDeserializer()
Description copied from interface:CommonContext
Returns an instance of the XMLDeserializer that can be used to deserialize project resources. Note that this is the only safe way to obtain an instance of XMLDeserializer, because the context will pass the new deserializer around to all loaded modules, giving them a chance to initialize any custom deserialization deletes on it first.- Specified by:
createDeserializer
in interfaceCommonContext
-
getExpressionFunctionFactory
public FunctionFactory getExpressionFunctionFactory()
Description copied from interface:CommonContext
Returns the core function factory used by expressions. Includes extension functions registered by modules.- Specified by:
getExpressionFunctionFactory
in interfaceCommonContext
-
getModule
public java.lang.Object getModule(java.lang.String id)
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 plugin's designer hook uses this to get FactoryPMI's palette.- Specified by:
getModule
in interfaceCommonContext
-
getLicenseState
public LicenseState getLicenseState(java.lang.String moduleId)
Description copied from interface:CommonContext
Returns the license state for the given module- Specified by:
getLicenseState
in interfaceCommonContext
-
getEventBus
public com.google.common.eventbus.EventBus getEventBus()
Description copied from interface:CommonContext
This is a generic event bus that can be used by any part of Ignition within a single scope (jvm)- Specified by:
getEventBus
in interfaceCommonContext
-
createExecutionManager
public ExecutionManager createExecutionManager(java.lang.String name, int threadCount)
Description copied from interface:ExecutionManagerFactory
Creates a new, private execution engine. Use this if you have tasks that may block waiting for other things to complete, so that you don't clog up the shared execution engine.- Specified by:
createExecutionManager
in interfaceExecutionManagerFactory
-
createExecutionManager
public ExecutionManager createExecutionManager(java.lang.String name, int threadCount, java.util.concurrent.ThreadFactory factory)
- Specified by:
createExecutionManager
in interfaceExecutionManagerFactory
-
getTagManager
public GatewayTagManager getTagManager()
Description copied from interface:CommonContext
Returns the manager that provides access to Ignition's tag system.- Specified by:
getTagManager
in interfaceCommonContext
- Specified by:
getTagManager
in interfaceGatewayContext
-
getSystemManager
public SystemManager getSystemManager()
- Specified by:
getSystemManager
in interfaceGatewayContext
-
getWebResourceManager
public WebResourceManager getWebResourceManager()
- Specified by:
getWebResourceManager
in interfaceGatewayContext
-
getHttpClientManager
public HttpClientManager getHttpClientManager()
- Specified by:
getHttpClientManager
in interfaceGatewayContext
- Returns:
- the
HttpClientManager
-
getSecurityLevelManager
public SecurityLevelManager getSecurityLevelManager()
- Specified by:
getSecurityLevelManager
in interfaceGatewayContext
- Returns:
- the
SecurityLevelManager
-
getIdpAdapterManager
public IdpAdapterManager getIdpAdapterManager()
- Specified by:
getIdpAdapterManager
in interfaceGatewayContext
- Returns:
- the
IdpAdapterManager
-
getWebAuthStrategyAdapter
public java.util.Optional<WebAuthStrategyAdapter> getWebAuthStrategyAdapter(@Nonnull java.lang.String type)
Description copied from interface:GatewayContext
Get theWebAuthStrategyAdapter
registered with the given type- Specified by:
getWebAuthStrategyAdapter
in interfaceGatewayContext
- Parameters:
type
- the registered adapter type string- Returns:
- An
Optional
containing theWebAuthStrategyAdapter
registered with the given type or an empty Optional if there exists no adapter registered with the given type
-
getEdgeSystemProperties
public EdgeSystemPropertiesRecord getEdgeSystemProperties()
Description copied from interface:GatewayContext
Convenience function to look up the EdgeSystemPropertiesRecord. Make sure not to call this if you already have a session open, because you can't open 2 sessions in the same thread. Instead, just use:session.find(EdgeSystemPropertiesRecord.META, SQueryMode.SBASIC, 0L);
- Specified by:
getEdgeSystemProperties
in interfaceGatewayContext
-
getSyncManager
public SyncManager getSyncManager()
- Specified by:
getSyncManager
in interfaceGatewayContext
- Returns:
- the
SyncManager
that handles syncing data between two systems.
-
getEdgeEditions
public java.util.List<EdgeEdition> getEdgeEditions()
Description copied from interface:CommonContext
Returns a list of currently available Edge editions (either licensed or in trial). Does not check if any required modules are installed and running.- Specified by:
getEdgeEditions
in interfaceCommonContext
-
getTelemetryManager
public TelemetryManager getTelemetryManager()
- Specified by:
getTelemetryManager
in interfaceGatewayContext
- Returns:
- the TelemetryManager used to gather statistics about the os, vm, and Ignition configuration.
-
-