Class AgentModelProvider

java.lang.Object
org.openremote.agent.protocol.AgentModelProvider
All Implemented Interfaces:
org.openremote.model.AssetModelProvider

public class AgentModelProvider extends Object implements org.openremote.model.AssetModelProvider
Enables scanning of descriptors in the agent module
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.openremote.model.asset.AssetDescriptor<?>[]
    Allows AssetDescriptors to be explicitly defined; if AssetModelProvider.useAutoScan() is true then this option is ignored.
    Map<Class<? extends org.openremote.model.asset.Asset<?>>,List<org.openremote.model.value.AttributeDescriptor<?>>>
    Get AttributeDescriptors that should be associated with the specified Asset type; these are combined with any AttributeDescriptors already associated with the given Asset type.
    Map<Class<? extends org.openremote.model.asset.Asset<?>>,List<org.openremote.model.value.MetaItemDescriptor<?>>>
    Get MetaItemDescriptors that should be associated with the specified Asset type; these are combined with any MetaItemDescriptors already associated with the given Asset type.
    Map<Class<? extends org.openremote.model.asset.Asset<?>>,List<org.openremote.model.value.ValueDescriptor<?>>>
    Get ValueDescriptors that should be associated with the specified Asset type; these are combined with any ValueDescriptors already associated with the given Asset type.
    void
    Called when the full Asset model has been initialised which gives AssetModelProviders the chance to do additional work (e.g.
    boolean
    Indicates if the containing JAR of this AssetModelProvider should be auto scanned for Asset implementations; descriptors are then extracted using reflection from these classes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AgentModelProvider

      public AgentModelProvider()
  • Method Details

    • useAutoScan

      public boolean useAutoScan()
      Description copied from interface: org.openremote.model.AssetModelProvider
      Indicates if the containing JAR of this AssetModelProvider should be auto scanned for Asset implementations; descriptors are then extracted using reflection from these classes.
      Specified by:
      useAutoScan in interface org.openremote.model.AssetModelProvider
    • getAssetDescriptors

      public org.openremote.model.asset.AssetDescriptor<?>[] getAssetDescriptors()
      Description copied from interface: org.openremote.model.AssetModelProvider
      Allows AssetDescriptors to be explicitly defined; if AssetModelProvider.useAutoScan() is true then this option is ignored.

      If AssetModelProvider.useAutoScan() is true and this is also defined then the results will be combined with those returned by scanning.

      Specified by:
      getAssetDescriptors in interface org.openremote.model.AssetModelProvider
    • getAttributeDescriptors

      public Map<Class<? extends org.openremote.model.asset.Asset<?>>,List<org.openremote.model.value.AttributeDescriptor<?>>> getAttributeDescriptors()
      Description copied from interface: org.openremote.model.AssetModelProvider
      Get AttributeDescriptors that should be associated with the specified Asset type; these are combined with any AttributeDescriptors already associated with the given Asset type. Any duplicate conflicts will generate an IllegalStateException during ValueUtil initialisation.
      Specified by:
      getAttributeDescriptors in interface org.openremote.model.AssetModelProvider
    • getMetaItemDescriptors

      public Map<Class<? extends org.openremote.model.asset.Asset<?>>,List<org.openremote.model.value.MetaItemDescriptor<?>>> getMetaItemDescriptors()
      Description copied from interface: org.openremote.model.AssetModelProvider
      Get MetaItemDescriptors that should be associated with the specified Asset type; these are combined with any MetaItemDescriptors already associated with the given Asset type. Any duplicate conflicts will generate an IllegalStateException during ValueUtil initialisation.

      If AssetModelProvider.useAutoScan() is true and this is also defined then the results will be combined with those returned by scanning.

      Specified by:
      getMetaItemDescriptors in interface org.openremote.model.AssetModelProvider
    • getValueDescriptors

      public Map<Class<? extends org.openremote.model.asset.Asset<?>>,List<org.openremote.model.value.ValueDescriptor<?>>> getValueDescriptors()
      Description copied from interface: org.openremote.model.AssetModelProvider
      Get ValueDescriptors that should be associated with the specified Asset type; these are combined with any ValueDescriptors already associated with the given Asset type. Any duplicate conflicts will generate an IllegalStateException during ValueUtil initialisation. Shouldn't contain any ValueDescriptors of type array (i.e. ones obtained by calling ValueDescriptor.asArray() or ones where ValueDescriptor.getType() returns a class that Class.isArray() returns true for.

      If AssetModelProvider.useAutoScan() is true and this is also defined then the results will be combined with those returned by scanning.

      Specified by:
      getValueDescriptors in interface org.openremote.model.AssetModelProvider
    • onAssetModelFinished

      public void onAssetModelFinished()
      Description copied from interface: org.openremote.model.AssetModelProvider
      Called when the full Asset model has been initialised which gives AssetModelProviders the chance to do additional work (e.g. add constraints such as allowed values based on available asset types).
      Specified by:
      onAssetModelFinished in interface org.openremote.model.AssetModelProvider