example
Class MyISYInsteonClient

java.lang.Object
  extended by com.universaldevices.client.UDClient
      extended by com.udi.isy.jsdk.ISYClient
          extended by com.udi.isy.jsdk.insteon.ISYInsteonClient
              extended by example.MyISYInsteonClient
All Implemented Interfaces:
IModelChangeListener

public class MyISYInsteonClient
extends ISYInsteonClient

This class implements a very simple ISY client which prints out events as they occur in ISY

Author:
UD Architect

Field Summary
 
Fields inherited from interface com.universaldevices.device.model.IModelChangeListener
UD_BATCH_MODE_CHANGED_ACTION, UD_BATTERY_DEVICE_WRITE_MODE_CHANGED_ACTION, UD_CLIENT_HEART_BEAT_EVENT, UD_DEVICE_SPECIFIC_EVENT, UD_DISCOVERING_NODES_ACTION, UD_DISCOVERING_NODES_COMPLETE_ACTION, UD_FOLDER_ADDED_ACTION, UD_FOLDER_REMOVED_ACTION, UD_FOLDER_RENAMED_ACTION, UD_GROUP_ADDED_ACTION, UD_GROUP_REMOVED_ACTION, UD_GROUP_RENAMED_ACTION, UD_INTERNET_ACCESS_DISABLED_ACTION, UD_INTERNET_ACCESS_ENABLED_ACTION, UD_INTERNET_ACCESS_EVENT, UD_INTERNET_ACCESS_FAILED_ACTION, UD_NETWORK_RENAMED_ACTION, UD_NODE_ADDED_ACTION, UD_NODE_CHANGE_LINK_ACTION, UD_NODE_CLEAR_ERROR_ACTION, UD_NODE_DEVICE_ID_CHANGED, UD_NODE_DEVICE_PROPERTY_CHANGED, UD_NODE_ENABLED_ACTION, UD_NODE_HAS_PENDING_DEVICE_WRITES_ACTION, UD_NODE_IN_ERROR_ACTION, UD_NODE_MOVED_ACTION, UD_NODE_PARENT_CHANGED_ACTION, UD_NODE_POWER_INFO_CHANGED_ACTION, UD_NODE_REMOVED_ACTION, UD_NODE_REMOVED_FROM_GROUP_ACTION, UD_NODE_RENAMED_ACTION, UD_NODE_REVISED_ACTION, UD_NODE_WRITING_TO_DEVICE_ACTION, UD_NODES_UPDATED_EVENT, UD_NOTIFICATION_SETTINGS_UPDATED_ACTION, UD_NTP_COMM_FAILED_ACTION, UD_NTP_SETTINGS_UPDATED_ACTION, UD_PROGRESS_EVENT_UPDATE, UD_PROGRESS_UPDATED_EVENT, UD_SYS_CONFIG_UPDATED_EVENT, UD_SYSTEM_BUSY_EVENT, UD_SYSTEM_IS_BUSY_ACTION, UD_SYSTEM_IS_IDLE_ACTION, UD_SYSTEM_IS_IN_SAFE_MODE_ACTION, UD_SYSTEM_IS_NOT_BUSY_ACTION, UD_TIME_CHANGED_ACTION, UD_TIME_CONFIG_CHANGED_ACTION, UD_TRIGGER_EVENT_GET_STATUS, UD_TRIGGER_EVENT_INFO_STRING, UD_TRIGGER_EVENT_KEY_CHANGED, UD_TRIGGER_EVENT_LEARN_IR, UD_TRIGGER_EVENT_SCHEDULE, UD_TRIGGER_EVENT_STATUS, UD_TRIGGER_EVENT_VAR_INIT, UD_TRIGGER_EVENT_VAR_STATUS, UD_TRIGGER_UPDATED_EVENT
 
Constructor Summary
MyISYInsteonClient()
          Constructor Registers this class as IModelChangeListener
 
Method Summary
 void cleanUp()
          Implement any cleanup Routines necessary here
 void onDeviceOffLine()
          This method is invoked with the library does not receive announcements from ISY and considers it offline
 void onDeviceOnLine()
          This method is invoked when a currently known ISY (UDProxyDevice) is back on line
 void onDeviceSpecific(java.lang.String arg1, java.lang.String node, XMLElement arg2)
          Notifies the client of any device specific changes.
 void onDiscoveringNodes()
          This method is invoked when ISY goes into Linking mode
 void onFolderRemoved(java.lang.String folderAddress)
          This method is called when a Folder is removed
 void onFolderRenamed(UDFolder folder)
          This method is called when a Folder is renamed
 void onGroupRemoved(java.lang.String groupAddress)
          This method is invoked when a group/scene is removed
 void onGroupRenamed(UDGroup group)
          This method is invoked when a group/scene is renamed
 void onInternetAccessDisabled()
          This method is invoked when internet access is disabled on ISY
 void onInternetAccessEnabled(java.lang.String url)
          This method is invoked with internet access is enabled on ISY
 void onModelChanged(UDControl control, java.lang.Object value, UDNode node)
          This method is invoked everytime there's a change in the state of a control for a node (Insteon Device)
 void onNetworkRenamed(java.lang.String newName)
          This method is invoked when the network is renamed.
 void onNewDeviceAnnounced(UDProxyDevice device)
          This method is called when a new ISY is announced or discovered on the network.
 void onNewFolder(UDFolder folder)
          This method is called when a new folder is created
 void onNewGroup(UDGroup newGroup)
          This method is called when a new group/scene has been created
 void onNewNode(UDNode newNode)
          This method is called when a new node (Insteon Device) has been added
 void onNodeDeviceIdChanged(UDProxyDevice device, UDNode node)
          Notifies the client that the address of the device represented by this node has changed.
 void onNodeDevicePropertiesRefreshed(UDProxyDevice device, UDNode node)
          Notifies the client that all the devices properties for a node were refreshed
 void onNodeDevicePropertiesRefreshedComplete(UDProxyDevice proxyDevice)
          Called after the properties for one or more nodes has been refreshed.
 void onNodeDevicePropertyChanged(UDProxyDevice device, UDNode node, com.universaldevices.common.properties.UDProperty<?> property)
          Notifies the client that a node property has changed
 void onNodeDiscoveryStopped()
          This method is invoked when ISY is no longer in Linking mode
 void onNodeEnabled(UDNode node, boolean b)
          This method is called with a node is enabled or disabled
 void onNodeError(UDNode node)
          This method is called when an Insteon Device does not correctly communicate with ISY
 void onNodeErrorCleared(UDProxyDevice arg0, UDNode arg1)
          Notifies the client that a node (device) in the system no longer has an error (communications or otherwise)
 void onNodeHasPendingDeviceWrites(UDNode node, boolean hasPending)
          This method is called when the node has pending device writes
 void onNodeIsWritingToDevice(UDNode node, boolean isWriting)
          This method is called when the device associated with the node is being programmed (written to)
 void onNodeMovedAsMaster(UDNode node, UDGroup group)
          This method is invoked when a node (Insteon Device) has been moved to a scene as controller/master
 void onNodeMovedAsSlave(UDNode node, UDGroup group)
          This method is invoked when a node (Insteon Device) has been moved to a scene as responder/slave
 void onNodeParentChanged(UDNode node, UDNode newParent)
          This method is called when the parent of a node has changed
 void onNodePowerInfoChanged(UDNode node)
          This method is called when the power information has changed for a node
 void onNodeRemoved(java.lang.String nodeAddress)
          This method is called when a node (Insteon Device) has been permanently removed from ISY
 void onNodeRemovedFromGroup(UDNode node, UDGroup group)
          This method is called when a node (Insteon Device) is removed from a scene
 void onNodeRenamed(UDNode node)
          This method is invoked when a node (Insteon Device) is renamed
 void onNodeRevised(UDProxyDevice device, UDNode node)
          Notifies the client of the revision of a node (device) to the system.
 void onNodeToGroupRoleChanged(UDNode node, UDGroup group, char new_role)
          This method is called when a node's role changes in the given group (master/slave role)
 void onProgress(java.lang.String arg1, XMLElement arg2)
          Notifies the client of the progress of actions currently being taken.
 void onSystemConfigChanged(java.lang.String event, XMLElement eventInfo)
          Notifies the client that system configurations have change
 void onSystemStatus(boolean busy)
          This method is invoked when the state of the system (whether or not busy) is changed
 void onTriggerStatus(java.lang.String arg1, XMLElement arg2)
          This method is invoked when trigger status changes
 
Methods inherited from class com.udi.isy.jsdk.insteon.ISYInsteonClient
addNewScene, brightenDevice, brightenScene, dimDevice, dimScene, getDevicesSceneAttributesForAController, getDevicesSceneAttributesForAScene, isLinking, moveNodeToSceneAsMaster, moveNodeToSceneAsSlave, setDeviceOnLevel, setDeviceOnLevelForAScene, setDeviceOnLevelForASceneController, setDeviceRampRate, setDeviceRampRateForAScene, setDeviceRampRateForASceneController, setMasterLinkingMode, setSlaveLinkingMode, start, startDeviceManualChangeDown, startDeviceManualChangeUp, startLinking, startSceneManualChangeDown, startSceneManualChangeUp, stopDeviceManualChange, stopLinking, stopSceneManualChange, turnDeviceFastOff, turnDeviceFastOn, turnDeviceOff, turnDeviceOn, turnSceneFastOff, turnSceneFastOn, turnSceneOff, turnSceneOn
 
Methods inherited from class com.udi.isy.jsdk.ISYClient
addFolder, addGroup, addNode, cancelNodesDiscovery, changeGroupState, changeNodeState, disableInternetAccess, discoverNodes, enableInternetAccess, getCurrValue, getLog, getNumPendingNotifications, getSystemDateTime, getSystemOptions, getSystemStatus, isISYReady, moveNode, onDeviceOffLine, onDeviceOnLine, onDeviceSpecific, onDiscoveringNodes, onFolderRemoved, onFolderRenamed, onGroupRemoved, onGroupRenamed, onInternetAccessUpdated, onModelChanged, onNetworkRenamed, onNewFolder, onNewGroup, onNewNode, onNodeDiscoveryStopped, onNodeEnabled, onNodeError, onNodeHasPendingDeviceWrites, onNodeIsWritingToDevice, onNodeMoved, onNodeParentChanged, onNodePowerInfoChanged, onNodeRemoved, onNodeRemovedFromGroup, onNodeRenamed, onNodeToGroupRoleChanged, onProgress, onSystemConfigChanged, onSystemStatus, onTriggerStatus, queryGroup, queryNode, reboot, removeeFolder, removeFromGroup, removeGroup, removeNode, renameFolder, renameGroup, renameNetwork, renameNode, resetAllNotifications, resetLog, saveSystemDateTime, saveSystemOptions, setParent, start, updateUserCredentials
 
Methods inherited from class com.universaldevices.client.UDClient
addUDErrorListener, addUDModelChangeListener, authenticate, getControls, getDevice, getGroups, getNodes, isStarted, onNewDevice, removeUDErrorListener, removeUDModelChangeListener, setStarted, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyISYInsteonClient

public MyISYInsteonClient()
Constructor Registers this class as IModelChangeListener

See Also:
IModelChangeListener
Method Detail

onNewDeviceAnnounced

public void onNewDeviceAnnounced(UDProxyDevice device)
This method is called when a new ISY is announced or discovered on the network. For this sample, we simply authenticate ourselves

Specified by:
onNewDeviceAnnounced in class UDClient
See Also:
UDClient.getDevice(), UDClient.onNewDevice(UDProxyDevice)

onDiscoveringNodes

public void onDiscoveringNodes()
This method is invoked when ISY goes into Linking mode

Specified by:
onDiscoveringNodes in class ISYClient

onNodeDiscoveryStopped

public void onNodeDiscoveryStopped()
This method is invoked when ISY is no longer in Linking mode

Specified by:
onNodeDiscoveryStopped in class ISYClient

onGroupRemoved

public void onGroupRemoved(java.lang.String groupAddress)
This method is invoked when a group/scene is removed

Specified by:
onGroupRemoved in class ISYClient
Parameters:
groupAddress - - the group's address

onGroupRenamed

public void onGroupRenamed(UDGroup group)
This method is invoked when a group/scene is renamed

Specified by:
onGroupRenamed in class ISYClient
Parameters:
group - - the UDGroup
See Also:
UDGroup

onModelChanged

public void onModelChanged(UDControl control,
                           java.lang.Object value,
                           UDNode node)
This method is invoked everytime there's a change in the state of a control for a node (Insteon Device)

Specified by:
onModelChanged in class ISYClient
Parameters:
control - - the UDControl's name
value - - the UDAction value for the UDControl
node - - the UDNode to which the change applies
See Also:
UDNode, UDControl, UDAction

onNetworkRenamed

public void onNetworkRenamed(java.lang.String newName)
This method is invoked when the network is renamed. Network is the top most node in the tree in our applet

Specified by:
onNetworkRenamed in class ISYClient
Parameters:
newName - - the new name for the network

onNewGroup

public void onNewGroup(UDGroup newGroup)
This method is called when a new group/scene has been created

Specified by:
onNewGroup in class ISYClient
Parameters:
newGroup - - the new UDGroup
See Also:
UDGroup

onNewNode

public void onNewNode(UDNode newNode)
This method is called when a new node (Insteon Device) has been added

Specified by:
onNewNode in class ISYClient
Parameters:
newNode - - the new UDNode
See Also:
UDNode

onNodeError

public void onNodeError(UDNode node)
This method is called when an Insteon Device does not correctly communicate with ISY

Specified by:
onNodeError in class ISYClient
Parameters:
node - - the UDNode in error
See Also:
UDNode

onNodeEnabled

public void onNodeEnabled(UDNode node,
                          boolean b)
This method is called with a node is enabled or disabled

Specified by:
onNodeEnabled in class ISYClient
Parameters:
node -
b -
See Also:
UDProxyDevice, UDNode

onNodeRemoved

public void onNodeRemoved(java.lang.String nodeAddress)
This method is called when a node (Insteon Device) has been permanently removed from ISY

Specified by:
onNodeRemoved in class ISYClient
Parameters:
nodeAddress - - the address of the UDNode removed
See Also:
UDNode

onNodeRemovedFromGroup

public void onNodeRemovedFromGroup(UDNode node,
                                   UDGroup group)
This method is called when a node (Insteon Device) is removed from a scene

Specified by:
onNodeRemovedFromGroup in class ISYClient
Parameters:
node - - the UDNode removed
group - - the UDGroup from which the node was removed
See Also:
UDNode, UDGroup

onNodeToGroupRoleChanged

public void onNodeToGroupRoleChanged(UDNode node,
                                     UDGroup group,
                                     char new_role)
This method is called when a node's role changes in the given group (master/slave role)

Specified by:
onNodeToGroupRoleChanged in class ISYClient
Parameters:
node - - the UDNode whose role changed
group - - the UDGroup whose role to the node changed
new_role - - the new role which the node plays in the group; currently this value is restricted to Constants.NODE_IS_MASTER i.e. this node is either a master/controller of this group or a slave/responder

onNodeRenamed

public void onNodeRenamed(UDNode node)
This method is invoked when a node (Insteon Device) is renamed

Specified by:
onNodeRenamed in class ISYClient
Parameters:
node - - the UDNode which was renamed
See Also:
UDNode

onNodeMovedAsMaster

public void onNodeMovedAsMaster(UDNode node,
                                UDGroup group)
This method is invoked when a node (Insteon Device) has been moved to a scene as controller/master

Specified by:
onNodeMovedAsMaster in class ISYClient
Parameters:
node - - the UDNode which has just moved
group - - the UDGroup to which the node moved to
See Also:
UDNode, UDGroup

onNodeMovedAsSlave

public void onNodeMovedAsSlave(UDNode node,
                               UDGroup group)
This method is invoked when a node (Insteon Device) has been moved to a scene as responder/slave

Specified by:
onNodeMovedAsSlave in class ISYClient
Parameters:
node - - the UDNode which has just moved
group - - the UDGroup to which the node moved to
See Also:
UDNode, UDGroup

onDeviceOffLine

public void onDeviceOffLine()
This method is invoked with the library does not receive announcements from ISY and considers it offline

Specified by:
onDeviceOffLine in class ISYClient
See Also:
UDProxyDevice

onDeviceOnLine

public void onDeviceOnLine()
This method is invoked when a currently known ISY (UDProxyDevice) is back on line

Specified by:
onDeviceOnLine in class ISYClient
See Also:
UDProxyDevice

onSystemStatus

public void onSystemStatus(boolean busy)
This method is invoked when the state of the system (whether or not busy) is changed

Specified by:
onSystemStatus in class ISYClient
Parameters:
busy - - whether or not ISY is busy

onInternetAccessDisabled

public void onInternetAccessDisabled()
This method is invoked when internet access is disabled on ISY

Specified by:
onInternetAccessDisabled in class ISYClient

onInternetAccessEnabled

public void onInternetAccessEnabled(java.lang.String url)
This method is invoked with internet access is enabled on ISY

Specified by:
onInternetAccessEnabled in class ISYClient
Parameters:
url - - the external fully qualified url through which ISY can be accessed

onTriggerStatus

public void onTriggerStatus(java.lang.String arg1,
                            XMLElement arg2)
This method is invoked when trigger status changes

Specified by:
onTriggerStatus in class ISYClient
Parameters:
arg1 - - the status
arg2 - - extra information

onDeviceSpecific

public void onDeviceSpecific(java.lang.String arg1,
                             java.lang.String node,
                             XMLElement arg2)
Description copied from class: ISYClient
Notifies the client of any device specific changes.

Specified by:
onDeviceSpecific in class ISYClient
Parameters:
arg1 - The action to perform based on this event
arg2 - Detailed status information

onProgress

public void onProgress(java.lang.String arg1,
                       XMLElement arg2)
Description copied from class: ISYClient
Notifies the client of the progress of actions currently being taken.

Specified by:
onProgress in class ISYClient
Parameters:
arg1 - The action to perform based on this event
arg2 - Detailed status information

cleanUp

public void cleanUp()
Implement any cleanup Routines necessary here

Overrides:
cleanUp in class UDClient

onSystemConfigChanged

public void onSystemConfigChanged(java.lang.String event,
                                  XMLElement eventInfo)
Description copied from class: ISYClient
Notifies the client that system configurations have change

Specified by:
onSystemConfigChanged in class ISYClient
Parameters:
event - - can be any of
eventInfo - - the extra event information XMLElement IModelChangeListener.UD_TIME_CHANGED_ACTION
IModelChangeListener.UD_TIME_CONFIG_CHANGED_ACTION
IModelChangeListener.UD_NTP_SETTINGS_UPDATED_ACTION
IModelChangeListener.UD_NOTIFICATION_SETTINGS_UPDATED_ACTION
IModelChangeListener.UD_NTP_COMM_FAILED_ACTION

onFolderRemoved

public void onFolderRemoved(java.lang.String folderAddress)
Description copied from class: ISYClient
This method is called when a Folder is removed

Specified by:
onFolderRemoved in class ISYClient
Parameters:
folderAddress - - the address for the folder
See Also:
UDFolder

onFolderRenamed

public void onFolderRenamed(UDFolder folder)
Description copied from class: ISYClient
This method is called when a Folder is renamed

Specified by:
onFolderRenamed in class ISYClient
Parameters:
folder - - the UDFolder which has been renamed
See Also:
UDFolder

onNewFolder

public void onNewFolder(UDFolder folder)
Description copied from class: ISYClient
This method is called when a new folder is created

Specified by:
onNewFolder in class ISYClient
Parameters:
folder - - the UDFolder which has been renamed
See Also:
UDFolder

onNodeHasPendingDeviceWrites

public void onNodeHasPendingDeviceWrites(UDNode node,
                                         boolean hasPending)
Description copied from class: ISYClient
This method is called when the node has pending device writes

Specified by:
onNodeHasPendingDeviceWrites in class ISYClient
Parameters:
node - - the UDNode which has pending device writes
hasPending - - whether or not there's pending device writes
See Also:
UDNode

onNodeIsWritingToDevice

public void onNodeIsWritingToDevice(UDNode node,
                                    boolean isWriting)
Description copied from class: ISYClient
This method is called when the device associated with the node is being programmed (written to)

Specified by:
onNodeIsWritingToDevice in class ISYClient
Parameters:
node - - the UDNode which might be programmed
isWriting - - whether or not the node is being programmed
See Also:
UDNode

onNodeParentChanged

public void onNodeParentChanged(UDNode node,
                                UDNode newParent)
Description copied from class: ISYClient
This method is called when the parent of a node has changed

Specified by:
onNodeParentChanged in class ISYClient
Parameters:
node - - the UDNode for which the parent has changed
newParent - - the UDNode which is the parent for the node
See Also:
UDNode

onNodePowerInfoChanged

public void onNodePowerInfoChanged(UDNode node)
Description copied from class: ISYClient
This method is called when the power information has changed for a node

Specified by:
onNodePowerInfoChanged in class ISYClient
Parameters:
node - - the UDNode which might be programmed
See Also:
UDNode

onNodeDeviceIdChanged

public void onNodeDeviceIdChanged(UDProxyDevice device,
                                  UDNode node)
Description copied from interface: IModelChangeListener
Notifies the client that the address of the device represented by this node has changed.

Parameters:
device - - the UDProxyDevice originating this event
node - - the UDNode

onNodeDevicePropertiesRefreshed

public void onNodeDevicePropertiesRefreshed(UDProxyDevice device,
                                            UDNode node)
Description copied from interface: IModelChangeListener
Notifies the client that all the devices properties for a node were refreshed

node - The UDNode that changed

onNodeDevicePropertiesRefreshedComplete

public void onNodeDevicePropertiesRefreshedComplete(UDProxyDevice proxyDevice)
Description copied from interface: IModelChangeListener
Called after the properties for one or more nodes has been refreshed.


onNodeDevicePropertyChanged

public void onNodeDevicePropertyChanged(UDProxyDevice device,
                                        UDNode node,
                                        com.universaldevices.common.properties.UDProperty<?> property)
Description copied from interface: IModelChangeListener
Notifies the client that a node property has changed

node - The UDNode that changed
property - The property that changed.

onNodeRevised

public void onNodeRevised(UDProxyDevice device,
                          UDNode node)
Description copied from interface: IModelChangeListener
Notifies the client of the revision of a node (device) to the system.

Parameters:
device - - the UDProxyDevice originating this event
node - - the new UDNode which was revised

onNodeErrorCleared

public void onNodeErrorCleared(UDProxyDevice arg0,
                               UDNode arg1)
Description copied from interface: IModelChangeListener
Notifies the client that a node (device) in the system no longer has an error (communications or otherwise)

Parameters:
arg0 - - the UDProxyDevice originating this event
arg1 - - the UDNode that was in error