Class AbstractModelAccess

java.lang.Object
de.iip_ecosphere.platform.connectors.model.AbstractModelAccess
All Implemented Interfaces:
ModelAccess
Direct Known Subclasses:
AbstractTypeMappingModelAccess

public abstract class AbstractModelAccess extends Object implements ModelAccess
Basic implementation of the model access.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • AbstractModelAccess

      protected AbstractModelAccess(AbstractModelAccess.NotificationChangedListener notificationChangedListener)
      Creates an abstract model access with notification changed listener.
      Parameters:
      notificationChangedListener - listener to be called when the notification settings have been changed, typically during initialization of the connector/model
  • Method Details

    • isDetailNotifiedItemEnabled

      protected final boolean isDetailNotifiedItemEnabled()
      Returns whether detailed notifications for monitored items is enabled.
      Returns:
      true for details, false for null
    • setDetailNotifiedItem

      public final void setDetailNotifiedItem(boolean detail)
      Description copied from interface: ModelAccess
      Whether the connector shall send detailed information about monitored changes. Intended to be used in ConnectorOutputTypeTranslator.initializeModelAccess(). [monitoring]
      Specified by:
      setDetailNotifiedItem in interface ModelAccess
      Parameters:
      detail - true for details, false for null (default)
    • useNotifications

      protected final boolean useNotifications()
      Returns whether (event-based) notifications or polling shall be used.
      Returns:
      true for notifications, false for polling
    • useNotifications

      public final void useNotifications(boolean useNotifications)
      Description copied from interface: ModelAccess
      Use notifications or polling. This is required here, as the related translator code ModelAccess.monitor(String...) depends on that. [monitoring]
      Specified by:
      useNotifications in interface ModelAccess
      Parameters:
      useNotifications - true for notifications, false for polling
    • qName

      private String qName(String init, String... names)
      Composes a qualified name.
      Parameters:
      init - the initialization for the result to be used when the first non-empty name shall be appended
      names - the names to be appended
      Returns:
      the qualified name, empty if there was nothing to compose irrespective of init
    • qName

      public String qName(String... names)
      Description copied from interface: ModelAccess
      Composes multiple names to a qualified name using ModelAccess.getQSeparator().
      Specified by:
      qName in interface ModelAccess
      Parameters:
      names - the names (may be empty but shall be ignored then)
      Returns:
      the composed qualified name, empty if no names were given
    • iqName

      public String iqName(String... names)
      Description copied from interface: ModelAccess
      Composes multiple names to a qualified instance name starting with ModelAccess.topInstancesQName() using ModelAccess.getQSeparator().
      Specified by:
      iqName in interface ModelAccess
      Parameters:
      names - the names (may be empty but shall be ignored then)
      Returns:
      the composed qualified name, empty if no names were given
    • monitor

      public void monitor(String... qNames) throws IOException
      Description copied from interface: ModelAccess
      Monitors the given qName element in the server namespace and upon changes, triggers a reception in the connector. Intended to be used in ConnectorOutputTypeTranslator.initializeModelAccess(). ConnectorParameter.getNotificationInterval() shall be used as default value if applicable. [monitoring]
      Specified by:
      monitor in interface ModelAccess
      Parameters:
      qNames - the qualified names of the elements to monitor
      Throws:
      IOException - if creating the monitor fails
    • monitorModelChanges

      public void monitorModelChanges() throws IOException
      Description copied from interface: ModelAccess
      Monitors generic model changes, in particular those not covered by ModelAccess.monitor(String...). Triggers a reception in the connector. Intended to be used in ConnectorOutputTypeTranslator.initializeModelAccess(). ConnectorParameter.getNotificationInterval() shall be used as default value if applicable. [monitoring]
      Specified by:
      monitorModelChanges in interface ModelAccess
      Throws:
      IOException - if creating the monitor fails
    • getConnectorParameter

      public abstract ConnectorParameter getConnectorParameter()
      Returns the actual connector parameters that apply for this model instance.
      Returns:
      the connector parameters