Package org.openremote.agent.protocol
Class AgentModelProvider
java.lang.Object
org.openremote.agent.protocol.AgentModelProvider
- All Implemented Interfaces:
org.openremote.model.AssetModelProvider
Enables scanning of descriptors in the agent module
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.openremote.model.asset.AssetDescriptor<?>[]AllowsAssetDescriptors to be explicitly defined; ifAssetModelProvider.useAutoScan()is true then this option is ignored.Map<Class<? extends org.openremote.model.asset.Asset<?>>,List<org.openremote.model.value.AttributeDescriptor<?>>> GetAttributeDescriptors that should be associated with the specifiedAssettype; these are combined with anyAttributeDescriptors already associated with the givenAssettype.Map<Class<? extends org.openremote.model.asset.Asset<?>>,List<org.openremote.model.value.MetaItemDescriptor<?>>> GetMetaItemDescriptors that should be associated with the specifiedAssettype; these are combined with anyMetaItemDescriptors already associated with the givenAssettype.Map<Class<? extends org.openremote.model.asset.Asset<?>>,List<org.openremote.model.value.ValueDescriptor<?>>> GetValueDescriptors that should be associated with the specifiedAssettype; these are combined with anyValueDescriptors already associated with the givenAssettype.voidCalled when the full Asset model has been initialised which givesAssetModelProviders the chance to do additional work (e.g.booleanIndicates if the containing JAR of thisAssetModelProvidershould be auto scanned forAssetimplementations; descriptors are then extracted using reflection from these classes.
-
Constructor Details
-
AgentModelProvider
public AgentModelProvider()
-
-
Method Details
-
useAutoScan
public boolean useAutoScan()Description copied from interface:org.openremote.model.AssetModelProviderIndicates if the containing JAR of thisAssetModelProvidershould be auto scanned forAssetimplementations; descriptors are then extracted using reflection from these classes.- Specified by:
useAutoScanin interfaceorg.openremote.model.AssetModelProvider
-
getAssetDescriptors
public org.openremote.model.asset.AssetDescriptor<?>[] getAssetDescriptors()Description copied from interface:org.openremote.model.AssetModelProviderAllowsAssetDescriptors to be explicitly defined; ifAssetModelProvider.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:
getAssetDescriptorsin interfaceorg.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.AssetModelProviderGetAttributeDescriptors that should be associated with the specifiedAssettype; these are combined with anyAttributeDescriptors already associated with the givenAssettype. Any duplicate conflicts will generate anIllegalStateExceptionduringValueUtilinitialisation.- Specified by:
getAttributeDescriptorsin interfaceorg.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.AssetModelProviderGetMetaItemDescriptors that should be associated with the specifiedAssettype; these are combined with anyMetaItemDescriptors already associated with the givenAssettype. Any duplicate conflicts will generate anIllegalStateExceptionduringValueUtilinitialisation.If
AssetModelProvider.useAutoScan()is true and this is also defined then the results will be combined with those returned by scanning.- Specified by:
getMetaItemDescriptorsin interfaceorg.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.AssetModelProviderGetValueDescriptors that should be associated with the specifiedAssettype; these are combined with anyValueDescriptors already associated with the givenAssettype. Any duplicate conflicts will generate anIllegalStateExceptionduringValueUtilinitialisation. Shouldn't contain anyValueDescriptors of type array (i.e. ones obtained by callingValueDescriptor.asArray()or ones whereValueDescriptor.getType()returns a class thatClass.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:
getValueDescriptorsin interfaceorg.openremote.model.AssetModelProvider
-
onAssetModelFinished
public void onAssetModelFinished()Description copied from interface:org.openremote.model.AssetModelProviderCalled when the full Asset model has been initialised which givesAssetModelProviders the chance to do additional work (e.g. add constraints such as allowed values based on available asset types).- Specified by:
onAssetModelFinishedin interfaceorg.openremote.model.AssetModelProvider
-