Interface GatewayContext

    • Field Detail


        static final java.lang.String 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 Detail

      • getUserSourceManager

        UserSourceManager getUserSourceManager()
        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.
      • getScheduleManager

        ScheduleManager getScheduleManager()
        Get the manager that holds all of the defined schedules. Schedules are used in alarm notification.
      • 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

        java.util.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

        javax.sql.DataSource createDataSource​(java.util.Properties connectionProps)
                                       throws java.lang.Exception
        Will create a javax.sql.DataSource that uses connection pooling through apache's DBCP2
      • 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

        java.util.concurrent.ExecutorService getExecutorService()
      • getScheduledExecutorService

        java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
      • getSystemProperties

        SystemPropertiesRecord getSystemProperties()
        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);
      • 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.
        The correct NamedQueryManager implementation for the scope.
      • getStateMessage

        java.lang.String getStateMessage()
        May return a string describing why the context is in its current state
      • getMessageDispatchManager

        MessageDispatchManager getMessageDispatchManager()
        The MessageDispatchManager is used to send script messages to message handlers running on clients and the Gateway.
      • 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.
      • getMetricHistoryManager

        MetricHistoryManager getMetricHistoryManager()
        Returns the MetricHistoryManager, which allows system metric history to be stored for a limited amount of time.
      • getWebAuthStrategyAdapter

        java.util.Optional<WebAuthStrategyAdapter> getWebAuthStrategyAdapter​(@Nonnull
                                                                             java.lang.String type)
        Get the WebAuthStrategyAdapter registered with the given type
        type - the registered adapter type string
        An Optional containing the WebAuthStrategyAdapter registered with the given type or an empty Optional if there exists no adapter registered with the given type