|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.universaldevices.device.model.UDNode
com.universaldevices.device.model.UDGroup
public class UDGroup
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
Field Summary | |
---|---|
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. |
Fields inherited from class com.universaldevices.device.model.UDNode |
---|
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 Summary | |
---|---|
UDGroup(java.lang.String address,
java.lang.String name)
Constructor |
|
UDGroup(XMLElement xml,
java.lang.Object dev)
Constructor |
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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
UDNode
in
this group. The Hashtable index is the address of the
UDNode
Constructor Detail |
---|
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 groupMethod Detail |
---|
public void init()
init
in class UDNode
public 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
group
UDNode
addresses which belong to this
group and this deviceUDNode
public void removeDevice(java.lang.Object dev)
UDProxyDevice
from a group
dev
- - 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 to
UDNode
,
UDProxyDevice
public short getRole(java.lang.String nodeId, java.lang.Object device)
UDNode
plays in this group
nodeId
- - the address of the UDNode
to be checkeddevice
- - the UDProxyDevice
to which the node belongs
to
UDNode
,
UDProxyDevice
public boolean setRole(java.lang.String nodeId, java.lang.String role, java.lang.Object device)
UDNode
plays in this group
nodeId
- - the address of the UDNode
to be checkedrole
- - the new role of the UDNode
to be setdevice
- - the UDProxyDevice
to which the node belongs
to
UDNode
,
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
to
UDNode
,
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |