Class DeviceExtensionPoint<S>

java.lang.Object
com.inductiveautomation.ignition.gateway.config.AbstractExtensionPoint<S>
com.inductiveautomation.ignition.gateway.opcua.server.api.DeviceExtensionPoint<S>
Type Parameters:
S - the type of settings used by the Device provided by this extension point.
All Implemented Interfaces:
ExtensionPoint<S>, Comparable<ExtensionPoint<S>>

public abstract class DeviceExtensionPoint<S> extends AbstractExtensionPoint<S>
Base class for ExtensionPoints that provide a Device implementation.
  • Field Details

    • DEVICE_RESOURCE_TYPE

      public static final ResourceType DEVICE_RESOURCE_TYPE
      The ResourceType used by all Devices in the configuration resource collection.
  • Constructor Details

    • DeviceExtensionPoint

      protected DeviceExtensionPoint(String typeId, String nameKey, String descriptionKey, @NotNull @NotNull Class<S> settingsType)
  • Method Details

    • settingsType

      public Optional<Class<S>> settingsType()
      Returns:
      the Class of the settings object for this ExtensionPoint, if it has one. If this ExtensionPoint does not have settings, return Optional.empty(). By default, this method returns the class of the object returned from ExtensionPoint.defaultSettings(), if one is provided.
    • resourceType

      public final ResourceType resourceType()
      Description copied from interface: ExtensionPoint
      The resource type shared by all types of this extension point. This is used to group extension points together. For example, all alarm journal types would share the same resource type, but have different typeIds.
    • createDevice

      public final Device createDevice(DeviceContext context, ExtensionPointConfig<DeviceProfileConfig,?> config)
    • createDevice

      protected abstract Device createDevice(DeviceContext context, DeviceProfileConfig profileConfig, S deviceConfig)
      Create a new Device instance using the provided profile and device configuration.
      Parameters:
      context - the DeviceContext.
      profileConfig - the DeviceProfileConfig.
      deviceConfig - the device-specific configuration.
      Returns:
      a new Device instance.
    • healthCheck

      public com.codahale.metrics.health.HealthCheck.Result healthCheck(Device device, String deviceName)
      Check the health of the provided Device.

      The provided Device will be an instance created by this extension point.

      The default implementation returns a healthy HealthCheck.Result with the status from Device.getStatus(). Subclasses may override to further interpret the status as healthy or unhealthy, or to use other criteria entirely.

      Parameters:
      device - the Device instance to check the health of.
      deviceName - the name of the Device instance.
      Returns:
      a HealthCheck.Result indicating whether the device is healthy.
    • getSamplingMetrics

      public Optional<SamplingMetrics> getSamplingMetrics(Device device, String deviceName)
      If a Device acquires data via sampling, return a SamplingMetrics that will be used to generate sampling diagnostics.
      Parameters:
      device - the Device instance.
      deviceName - the name of the device.
      Returns:
      a SamplingMetrics instance, or Optional.empty() if this Device does not acquire data via sampling.