com.universaldevices.device.model
Class UDNodeDeviceProperties

java.lang.Object
  extended by com.universaldevices.device.model.UDNodeDeviceProperties

public class UDNodeDeviceProperties
extends java.lang.Object

All access to node device properties is synchronized, therefore it is always safe to use anything returned by the methods in this class.

Version:
"%I%, %G%"
Author:
Chris

Constructor Summary
UDNodeDeviceProperties()
           
 
Method Summary
 void addAll(java.util.Collection<com.universaldevices.common.properties.UDProperty<?>> ps)
          Adds or replaces all the properties in the given collection
 void addProperty(com.universaldevices.common.properties.UDProperty<?> p)
          Adds the property based on its ID, replacing an existing entry with the same ID if necessary.
 boolean containsPropertyType(java.lang.String pType)
          Returns true if the property type is recognized.
 com.universaldevices.common.properties.UDProperty<?> getByCategoryId(java.lang.String categoryId)
          Return the first property found with the specified category ID, or null if not found.
 java.util.Collection<com.universaldevices.common.properties.UDProperty<?>> getProperties()
          Returns all of the properties in a collection.
 com.universaldevices.common.properties.UDProperty<?> getProperty(java.lang.String id)
          Gets the property based on its ID, returning null if it doesn't exist.
 void removeAll()
          Removes all properties
static boolean saveProperties(UDNode node, java.util.Collection<com.universaldevices.common.properties.UDProperty<?>> props)
          Save to the ISY, All properties in the given list as changed or new node device properties for the specified node.
static boolean saveProperty(UDNode node, com.universaldevices.common.properties.UDProperty<?> prop)
          Save the specified property to the ISY.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UDNodeDeviceProperties

public UDNodeDeviceProperties()
Method Detail

removeAll

public void removeAll()
Removes all properties


getProperties

public java.util.Collection<com.universaldevices.common.properties.UDProperty<?>> getProperties()
Returns all of the properties in a collection.

Returns:
Collection

getProperty

public com.universaldevices.common.properties.UDProperty<?> getProperty(java.lang.String id)
Gets the property based on its ID, returning null if it doesn't exist.

Parameters:
id - The ID of the property to get

containsPropertyType

public boolean containsPropertyType(java.lang.String pType)
Returns true if the property type is recognized.

Parameters:
pType - The property type ID
Returns:
True if the property type is recognized.

getByCategoryId

public com.universaldevices.common.properties.UDProperty<?> getByCategoryId(java.lang.String categoryId)
Return the first property found with the specified category ID, or null if not found.

Parameters:
categoryId - The category ID
Returns:
the first property found with the specified category ID, or null if not found.

addAll

public void addAll(java.util.Collection<com.universaldevices.common.properties.UDProperty<?>> ps)
Adds or replaces all the properties in the given collection

Parameters:
ps - The list of properties to add

addProperty

public void addProperty(com.universaldevices.common.properties.UDProperty<?> p)
Adds the property based on its ID, replacing an existing entry with the same ID if necessary.

Parameters:
p - The property to add

saveProperties

public static boolean saveProperties(UDNode node,
                                     java.util.Collection<com.universaldevices.common.properties.UDProperty<?>> props)
Save to the ISY, All properties in the given list as changed or new node device properties for the specified node. Note: This does not change the client's set of node device properties, this will only happen when the ISY sends back the updated properties if the save is successful.

Parameters:
node - Node to receive the changed properties.
props - The changed properties.
Returns:
True if successful

saveProperty

public static boolean saveProperty(UDNode node,
                                   com.universaldevices.common.properties.UDProperty<?> prop)
Save the specified property to the ISY. Note: This does not change the client's set of node device properties, this will only happen when the ISY sends back the updated properties if the save is successful.

Parameters:
node - Node to receive the changed properties.
prop - The property to save.
Returns:
True if successful