Interface IPropertyProvider
-
- All Superinterfaces:
INamedObject
,IPersistable
- All Known Implementing Classes:
DataTableThing
,DataThing
,DataThingWithEvents
,FileRepositoryThing
,LogRetrievalStrategy
,NotificationHandler
,RemoteThing
,RemoteThingWithFileTransfer
,RemoteThingWithTunnels
,RemoteThingWithTunnelsAndFileTransfer
,ReportingStrategy
,SecurityMonitorThing
,StreamThing
,Thing
,User
@ThingworxExtensionApiClass(since={6,6}) public interface IPropertyProvider extends IPersistable
TheIPropertyProvider
interface indicates the implementor is capable of persisting a set of properties on the Platform, as well as defining the methods the Platform requires in order to interact with these properties.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PropertyDefinition
getInstancePropertyDefinition(java.lang.String name)
Returns the specified property definition for this instance.PropertyDefinition
getInstancePropertyDefinitionIfVisible(java.lang.String name)
Returns the specified property definition for this instance if visible.PropertyDefinitionCollection
getInstancePropertyDefinitions()
Returns a collection containing all property definitions belonging to this instance.BaseTypes
getPropertyType(java.lang.String propName)
Returns the base type defined in the specified property's definition.IPrimitiveType
getPropertyValue(java.lang.String propName)
Returns the value currently assigned to the specified property.InfoTable
getPropertyValuesAsInfoTable()
Returns anInfoTable
containing a list of the properties belonging to this instance and their values.boolean
hasProperty(java.lang.String propName)
Returnstrue
if there exists a property with the specified name.boolean
hasPropertyAndIsVisible(java.lang.String propName)
Returnstrue
if there exists a property with the specified name and is visible to the user.void
setPropertyValue(java.lang.String propertyName, IPrimitiveType value)
-
Methods inherited from interface com.thingworx.types.INamedObject
getDescription, getName
-
Methods inherited from interface com.thingworx.entities.interfaces.IPersistable
getID, hasID
-
-
-
-
Method Detail
-
getPropertyValue
@ThingworxExtensionApiMethod(since={6,6}) IPrimitiveType getPropertyValue(java.lang.String propName) throws java.lang.Exception
Returns the value currently assigned to the specified property.- Parameters:
propName
- the name of the property to retrieve the value of- Returns:
- the property's current value
- Throws:
java.lang.Exception
- if propName is null, the user is unauthorized (when applicable), or an error occurs while attempting to read from the property
-
setPropertyValue
@ThingworxExtensionApiMethod(since={6,6}) void setPropertyValue(java.lang.String propertyName, IPrimitiveType value) throws java.lang.Exception
- Parameters:
propertyName
- the name of the property that is being modifiedvalue
- the value to assign to the property- Throws:
java.lang.Exception
- If an error occurs
Assigns the provided value to the specified property.java.lang.Exception
- if propertyName is null, the user is unauthorized (when applicable), the specified property does not exist, or an error occurs when attempting to modify the property
-
getInstancePropertyDefinitions
@ThingworxExtensionApiMethod(since={6,6}) PropertyDefinitionCollection getInstancePropertyDefinitions()
Returns a collection containing all property definitions belonging to this instance.- Returns:
- a collection of property definitions
-
getInstancePropertyDefinition
@ThingworxExtensionApiMethod(since={6,6}) PropertyDefinition getInstancePropertyDefinition(java.lang.String name)
Returns the specified property definition for this instance.- Parameters:
name
- the name of the property- Returns:
- the definition of the property
-
getInstancePropertyDefinitionIfVisible
@ThingworxExtensionApiMethod(since={6,6}) PropertyDefinition getInstancePropertyDefinitionIfVisible(java.lang.String name) throws java.lang.Exception
Returns the specified property definition for this instance if visible.- Parameters:
name
- the name of the property- Returns:
- the definition of the property
- Throws:
java.lang.Exception
- if the user does not have permission to access the property
-
getPropertyValuesAsInfoTable
@ThingworxExtensionApiMethod(since={6,6}) InfoTable getPropertyValuesAsInfoTable() throws java.lang.Exception
Returns anInfoTable
containing a list of the properties belonging to this instance and their values.- Returns:
- an
InfoTable
of property names and their associated values - Throws:
java.lang.Exception
- if the user does not have permission to access the properties (when applicable), or an error occurs when attempting to read the property values
-
hasProperty
@ThingworxExtensionApiMethod(since={6,6}) boolean hasProperty(java.lang.String propName)
Returnstrue
if there exists a property with the specified name. Property names are case-sensitive.- Parameters:
propName
- the property name to check- Returns:
true
if the specified property exists
-
hasPropertyAndIsVisible
@ThingworxExtensionApiMethod(since={6,6}) boolean hasPropertyAndIsVisible(java.lang.String propName) throws java.lang.Exception
Returnstrue
if there exists a property with the specified name and is visible to the user. Property names are case-sensitive.- Parameters:
propName
- the property name to check- Returns:
true
if the specified property exists and is visible- Throws:
java.lang.Exception
- if the user does not have permission to access the property
-
getPropertyType
@ThingworxExtensionApiMethod(since={6,6}) BaseTypes getPropertyType(java.lang.String propName)
Returns the base type defined in the specified property's definition.- Parameters:
propName
- the name of the property- Returns:
- the
BaseTypes
entry corresponding to the property type
-
-