public class UDGroup extends UDNode
UDGroup
represents a collection of UDNode
s.
Since a group is also a node in the device tree, as such, this class extends UDNode
.
In some cases (such as Insteon), a UDGroup represents a scene where each UDNode
may play a role in the scene (such as controller vs. responder)
Note:UDGroup
is created/instantiated by the underlying UD Network and
Services Layers and should not be created independently
UDNode
Modifier and Type | Field and Description |
---|---|
java.util.Hashtable<java.lang.Object,java.util.Set<java.lang.String>> |
deviceNodes
A Hashtable of a Set of addresses for
UDNode . |
java.util.Hashtable<java.lang.String,java.lang.String> |
groupNodeFlags
A Hashtable of flags (roles) for each
UDNode in
this group. |
address, dcPeriod, deviceClass, isEnabled, name, parent, parentName, parentType, type, typeReadable, UD_HIERARCHY_NODE_TYPE_FOLDER, UD_HIERARCHY_NODE_TYPE_GROUP, UD_HIERARCHY_NODE_TYPE_NODE, UD_HIERARCHY_NODE_TYPE_NOTSET, UD_PRODUCT_FAMILY_ADR, UD_PRODUCT_FAMILY_BRULTECH, UD_PRODUCT_FAMILY_DEFAULT, UD_PRODUCT_FAMILY_GNC, UD_PRODUCT_FAMILY_INSTEON, UD_PRODUCT_FAMILY_RCS, UD_PRODUCT_FAMILY_UDI, UD_PRODUCT_FAMILY_UPB, UD_PRODUCT_FAMILY_ZWAVE, uuid, wattage
Constructor and Description |
---|
UDGroup(java.lang.String address,
java.lang.String name)
Constructor
|
UDGroup(XMLElement xml,
java.lang.Object dev)
Constructor
|
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
addDevice(java.lang.Object device)
Adds a
UDProxyDevice to the list of devices (ISYs)
which this group belongs to. |
void |
addNode(java.lang.String id,
java.lang.Object device)
Adds a
UDNode to this group. |
void |
addNodes(java.util.Set<java.lang.String> nodes,
java.lang.Object device)
Adds a Set of
UDNode s to this group. |
java.util.Set<java.lang.String> |
getMembers(java.lang.Object device)
Returns the Set of Node addresses for the members of this group
|
java.lang.String |
getPhysicalGroupAddress() |
short |
getRole(java.lang.String nodeId,
java.lang.Object device)
Returns the role the given
UDNode plays in this group |
boolean |
hasNoDevices()
Returns whether or not this group is empty.
|
void |
init()
Initializes this object
|
boolean |
isMemberOf(java.lang.String nodeId,
java.lang.Object device)
Returns whether or not the given
UDNode is a member of
this group. |
boolean |
isNodeMaster(java.lang.String nodeId,
java.lang.Object device)
Returns whether or not the given
UDNode is the master
(controller) for this group. |
void |
processElement(XMLElement child,
java.lang.Object device)
Processes an XML/DIML representation of the attributes of a
UDGroup . |
void |
removeDevice(java.lang.Object dev)
Removes a
UDProxyDevice from a group |
void |
removeNode(java.lang.String id,
java.lang.Object device)
Removes an associated
UDNode from this group. |
boolean |
setRole(java.lang.String nodeId,
java.lang.String role,
java.lang.Object device)
Set the role the given
UDNode plays in this group |
compareTo, equals, getAction, getControls, getDeviceType, getFamilyId, getFormattedDeviceId, getHasPendingDeviceWrites, getNodeDeviceProperties, getNodeFlag, getPrimaryNode, getResponderType, getRxEndpointMask, getSubgroup, getTxEndpointMask, isController, isDefaultFamilyId, isDevicePrimaryNode, isInError, isQueryable, isResponder, isRootNode, isWritingToDevice, refresh, revise, setDeviceType, setDeviceType, setFamilyId, setFormattedDeviceId, setHasPendingDeviceWrites, setIsController, setIsInError, setIsQueryable, setIsResponder, setIsWritingToDevice, setNodeDeviceProperties, setNodeFlag, setParentType, setPrimaryNode, setResponderType, setRxEndpointMask, setSubgroup, setTxEndpointMask, setType, toString, updateState
public java.util.Hashtable<java.lang.Object,java.util.Set<java.lang.String>> deviceNodes
UDNode
.
The entries are found based on UDProxyDevice
.public java.util.Hashtable<java.lang.String,java.lang.String> groupNodeFlags
public UDGroup(XMLElement xml, java.lang.Object dev)
Is called by the underlying UD Network and Services Layers based
on the (XML) nodes configuration retrieved from the deivce (ISY).
Note: Should not be used independently
xml
- - the xml/diml representation of a groupdev
- - the device (UDProxyDevice
public UDGroup(java.lang.String address, java.lang.String name)
Is called by the underlying UD Network and Services Layers based on a given address and given name Note: Should not be used independently
address
- - the address to be used for this group (must be unique)name
- - the name to be used for this grouppublic java.lang.String getPhysicalGroupAddress()
public void removeNode(java.lang.String id, java.lang.Object device)
UDNode
from this group.
Note: this operation does
not remove the actual node from this group in the
device (ISY).
To do that, UDProxyDevice.removeFromGroup(java.lang.String, java.lang.String)
should be used instead.
id
- - the address of the node to be removeddevice
- - the UDProxyDevice
to which the node
belongs toUDNode
public java.util.Set<java.lang.String> addDevice(java.lang.Object device)
UDProxyDevice
to the list of devices (ISYs)
which this group belongs to.
As there might be more than one ISY on the network, this method
captures the relationship of one group
to many devices.
i.e. We may have a Entertainment Room group which
spans three ISYs of 1) Insteon Enabled 2) Aprilaire and 3) Nuvo
device
- - the UDProxyDevice
to be added to this
groupUDNode
addresses which belong to this
group and this deviceUDNode
public void removeDevice(java.lang.Object dev)
UDProxyDevice
from a groupdev
- - the UDProxyDevice
addDevice(java.lang.Object)
public void addNode(java.lang.String id, java.lang.Object device)
UDNode
to this group.
Note: this operation does
not add the actual node to this group in the
device (ISY).
To do that, UDProxyDevice.moveNode(java.lang.String, java.lang.String, char)
should be used instead.
id
- - the address of the UDNode
to be addeddevice
- - the UDProxyDevice
to which this node
belongs toUDNode
public boolean hasNoDevices()
i.e. No devices (ISY) have
this group nor are there any UDNode
s for this group
public boolean isMemberOf(java.lang.String nodeId, java.lang.Object device)
UDNode
is a member of
this group.nodeId
- - the address of the UDNode
to be checked for
membershipdevice
- - the UDProxyDevice
that the UDNode
belongs toUDNode
,
UDProxyDevice
public short getRole(java.lang.String nodeId, java.lang.Object device)
UDNode
plays in this groupnodeId
- - the address of the UDNode
to be checkeddevice
- - the UDProxyDevice
to which the node belongs
toUDNode
,
UDProxyDevice
public boolean setRole(java.lang.String nodeId, java.lang.String role, java.lang.Object device)
UDNode
plays in this groupnodeId
- - the address of the UDNode
to be checkedrole
- - the new role of the UDNode
to be setdevice
- - the UDProxyDevice
to which the node belongs
toUDNode
,
UDProxyDevice
public boolean isNodeMaster(java.lang.String nodeId, java.lang.Object device)
UDNode
is the master
(controller) for this group.nodeId
- - the address of the UDNode
to be checkeddevice
- - the UDProxyDevice
to which the node belongs
toUDNode
,
UDProxyDevice
public void addNodes(java.util.Set<java.lang.String> nodes, java.lang.Object device)
UDNode
s to this group.
Note: This method is utilized by the underlying UD Network and Services Layers and, as such, should not be invoked independently
nodes
- - a Set
of UDNode
addressesdevice
- - the UDProxyDevice
to which these nodes belong topublic java.util.Set<java.lang.String> getMembers(java.lang.Object device)
device
- - the device for which this is a grouppublic void processElement(XMLElement child, java.lang.Object device)
UDGroup
.
Note: Should not be used independently
processElement
in class UDNode