com.universaldevices.upnp
Class UDProxyDevice

java.lang.Object
  extended by com.universaldevices.upnp.UDProxyDevice
All Implemented Interfaces:
IUpdateHandler

public class UDProxyDevice
extends java.lang.Object
implements IUpdateHandler

The UDProxyDevice is the proxy between the client and ISY.

All operations to be performed on ISY must use the methods implemented herein to assure consistent behavior.

Author:
UD Architect

Field Summary
static char ADD_NODE_AND_CRAWL_NO_LINKS
          Used as the 4th parameter in addNode(String, String, String, char) to signify that the newly added device shall Retain all its links and New devices shall be added based on those links as necessary Groups/Scenes shall not be created based on the found links
static char ADD_NODE_AND_CRAWL_WITH_LINKS
          Used as the 4th parameter in addNode(String, String, String, char) to signify that the newly added device shall Retain all its links and New devices shall be added based on those links as necessary and Every newly found device shall be scanned till all links are exhausted Groups/Scenes shall be created based on the found links
static char ADD_NODE_AND_RESET
          Used as the 4th parameter in addNode(String, String, String, char) to signify that the newly added device shall be reset and overwritten with new values/links
 java.util.Hashtable<java.lang.String,UDControl> controls
          A Hashtable of all the controls
protected  java.lang.String descriptionURL
           
static char DISCOVER_NODE_AND_CRAWL_NO_LINKS
          Used as the parameter in cancelNodesDiscovery(char) to signify that the newly linked device shall Retain all its links and New devices shall be added based on those links as necessary Groups/Scenes shall not be created based on the found links
static char DISCOVER_NODE_AND_CRAWL_WITH_LINKS
          Used as parameter in cancelNodesDiscovery(char) to signify that the newly linked device shall Retain all its links and New devices shall be added based on those links as necessary and Every newly found device shall be scanned till all links are exhausted Groups/Scenes are created based on those links
static char DISCOVER_NODE_AND_RESET
          Used as the parameter in cancelNodesDiscovery(char) to signify that the newly linked device shall be reset and overwritten with new values/links
static char DISCOVER_NODE_FAMILY_RCS_ZIGBEE
           
static char DISCOVER_NODE_FAMILY_ZWAVE_EXCLUDE
          Used as the 4th parameter in addNode(String, String, String, char) to start excluding Z-Wave devices, and removing them from ISY if they exist.
static char DISCOVER_NODE_FAMILY_ZWAVE_INCLUDE
          Used as the 4th parameter in addNode(String, String, String, char) to start including/adding Z-Wave devices to the ISY.
 boolean isAuthenticated
          Whether or not a session has been created and authenticated.
 boolean isOnline
          Whether or not the device is on line
 java.util.Hashtable<java.lang.String,UDNode> nodes
          A Hashtable of all the nodes (not groups/scenes) associated/linked to ISY.
static char RESTORE_CONF_FILES_ONLY
          Used for UD Presentation Layer functionality only
static char RESTORE_NETWORK_WITH_LINKS
          Used as the parameter in restoreDevicesFromNodes(char) to signify that groups/scenes will be regenerated from the logical representations stored in ISY
static char RESTORE_NETWORK_WITHOUT_LINKS
          Used as the parameter in restoreDevicesFromNodes(char) to signify that groups/scenes will not be re-generated from the logical representations stored in ISY.
 short securityLevel
          UPnP Security levels which may be any of the following: UPnPSecurity.NO_SECURITY
UPnPSecurity.SECURITY_LEVEL_1 - clear text authentication, with xml signatures
UPnPSecurity.SECURITY_LEVEL_2 - encrypted (bulk key) authentication, with xml signatures
UPnPSecurity.SECURITY_LEVEL_3 - RSA cryptography with xml signatures
 UPnPSecurity upnpSecurity
          The UPnPSecurity object which handles all UPnPSecurity transformations
 java.lang.String uuid
          The uuid (uniquely identies the ISY on the network) of ISY
 
Constructor Summary
UDProxyDevice(java.lang.String uuid, java.lang.String descriptionURL, UDDeviceStateListener deviceListener)
          Constructor
UDProxyDevice(UDDeviceStateListener deviceListener)
          Constructor Called by UDControlPoint when a new device is discovered
 
Method Summary
 boolean addDDNSHost(java.lang.String host, java.lang.String ip)
           
 boolean addFolder(java.lang.String address, java.lang.String name)
          Adds a UDFolder to ISY
 boolean addGroup(java.lang.String address, java.lang.String name, char flag)
          Adds a UDGroup to ISY
 boolean addNode(java.lang.String newAddress, java.lang.String newName, java.lang.String type, char flag)
          Adds a UDNode to ISY
 boolean addNode(java.lang.String newAddress, java.lang.String newName, java.lang.String type, java.lang.String family, char flag)
          Adds a UDNode to ISY
 boolean addUserFile(java.lang.String path, byte[] image)
           
 boolean authenticate(java.lang.String userid, java.lang.String pwd)
          Authenticates a userid/password pair with ISY.
 boolean cancelNodesDiscovery(char action)
          Cancels UDNode discovery.
 boolean cancelNodesDiscovery(char action, java.lang.String family)
          Cancels UDNode discovery.
 boolean clearConfiguration()
          Deletes all the configuration files within ISY
 boolean clearLastError()
           
 void clearSubscriptionID()
          Clears the subscription id.
 boolean configure()
          Configures this object
 boolean configureSecuritySystem(java.lang.String name, java.lang.StringBuffer diml)
          Configures an attached security system
 boolean deleteFile(java.lang.String path, IUpdaterClient view)
           
 boolean discoverNodes(java.lang.String type)
          Starts UDNode discovery.
 boolean discoverNodes(java.lang.String type, char action)
          Starts UDNode discovery.
 boolean discoverNodes(java.lang.String type, char action, java.lang.String family)
          Starts UDNode discovery.
 boolean ensureSubscription()
           
 boolean expireSessionKeys()
          Expires the session keys
 boolean getAlgorithmsAndProtocols()
          Gets supported security paramters
 boolean getAllTriggerStatus(java.lang.String key, com.universaldevices.common.xml.UDXmlParser parser)
           
 java.lang.String getApplication()
          Returns the application name
 java.lang.String getAppVersion()
          Returns the application version
 java.lang.String getArchivePath()
          Returns the archive url
 UDAutoUpdate.UDPlatform getAutoUpdateCode()
          Returns the Update Code (for upgrades) if any
 java.lang.String getBuildTimestamp()
          Returns the firmware build timestamp
 java.lang.String getContentList(java.lang.String path, java.lang.String ext, boolean summaryOnly)
          Returns the summary of all content list entries for a given directory/fileExtension pair
 DDNSHost getDDNSHost()
           
 java.lang.String getDebugLevel()
          Returns the debug level which is used in the event viewer
 java.lang.String getDevicetype()
          Returns ISY's device type
 java.lang.String getErrorLog()
          Returns ISY's current error log file
 java.lang.String getExternalURL()
          Returns ISY's external URL
 java.lang.String getFile(java.lang.StringBuffer url)
          Gets a file using REST
 FileSystemStat getFileSystemStatus()
           
 java.lang.Object getFloorPlan()
          Retrieves the floor plan from ISY
 java.lang.String getFriendlyName()
          Returns ISY's friendly name
 java.net.InetSocketAddress getHostAddress()
          Returns ISY's host address
 java.lang.String getIcon()
          Returns the application's Icon url
 java.lang.String getInternalURL()
          Returns ISY's Local/LAN URL
 java.lang.Boolean getIsSubscribed()
           
 java.lang.String getISYConfig()
          Convenience method:
Returns the ISY configuration as a string
 java.lang.String getIsyStartupTime()
           
protected  long getLastAlive()
          Returns the last communications time with ISY
 LastError getLastError()
           
 boolean getLifetimeSequenceBase()
          Gets the LifeTimeSequenceBase from ISY
 java.lang.String getLog()
          Returns ISY's current log file
 java.lang.String getMake()
          Returns the application's make
 java.lang.String getManufacturerURL()
          Returns the application's manufacturer URL
protected  int getMaxAge()
          Returns the max age for this proxy
 int getMaxSSLStrength()
           
 java.lang.String getModel()
          Returns the application's model
 NetworkConfig getNetworkConfig()
           
 java.lang.String getNetworkName()
          Returns the network name
 UDNode getNode(java.lang.String id)
          Retrieves a UDNode based on the given node address (String)
 boolean getNodeDeviceProperties(java.lang.String nodeAddr)
          Gets Node Device Properties for the given node, using the registered parser.
 boolean getNodeDeviceProperties(java.lang.String node, UDNodeDevicePropertiesParser parser)
          Retrieves the device properties for the given node
 UDNodeProperties getNodeProperties(java.lang.String node)
          Retrieves the node properties for the given node
 java.lang.String getNodesConfig()
          Convenience method:
Returns the nodes configuration as a string
 int getNumNotifications()
          Deprecated.  
 boolean getNumPendingNotifications()
          Deprecated.  
 java.lang.String getPlatform()
          Returns the application's platform
 UDNode getPrimaryNode(java.lang.String id)
          Retrieves the primary UDNode based on the given node address for any node defined for the device.
 java.lang.String getProductDescription()
          Returns the product description.
 int getProductId()
          Returns the product ID.
 ProductInfo getProductInfo()
           
 com.universaldevices.device.model.programs.UDPrograms getPrograms()
           
 boolean getPublicKeys()
          Retrieves the RSA Public Keys from ISY
 UDNode getRootNode()
           
 java.lang.String getSCPDURL()
          Returns UPnP's Service Descripton
 java.lang.String getSecuritySystemConfig(java.lang.String name)
          Returns the configuration for an attached security system
 java.lang.String getSecuritySystemURLs(java.lang.String name)
          Returns a diml representation of all the configured URLs to access an attached security
system
 java.lang.String getServiceType()
          Returns the service type
 com.universaldevices.model.notifications.SMTPConfig getSMTPConfig()
          Retrieves the currently set SMTPConfig in ISY
 java.lang.String getSubscriptionID()
          Returns the subscription id
 java.lang.String getSystemConfiguration()
          Returns a UDML/DIML list of all the ISY system configuration
 java.lang.String getSystemConfiguration(java.lang.String path, java.lang.String pattern)
          Returns a UDML/DIML list of all the ISY system configuration
 byte[] getSystemConfigurationFile(java.lang.String name)
          Returns the contents of an ISY system configuration file
 com.universaldevices.common.datetime.DateTime getSystemDateTime()
          Returns ISY's system date/time related attributes
 SystemOptions getSystemOptions()
          Retrieves the currently set SystemOptions in ISY
 SystemStatus getSystemStatus()
          Returns ISY's system status
 UDControl getSysUpdateControl()
          Returns the UDControl for system updates
 java.net.URL getURLBase()
          Returns ISY's URL base
 java.lang.String getUserDirectoryListing(java.lang.String path, java.lang.String pattern)
          Returns directory listings for the user directory
 byte[] getUserFile(java.lang.String name)
          Returns the contents of an ISY user configuration file
 java.lang.String getVariables(int varType)
          Sets the debug level which is used in the event viewer
 boolean installModule(java.lang.String mid)
          Install the given Module from ISY's configuration.
 boolean internetAccess(char flag)
          Enables/disables internet access
 boolean is27Compliant()
           
 boolean is28Compliant()
           
 boolean is310Compliant()
           
 boolean is320Compliant()
           
 boolean isClientAuthenticated()
          Returns true if the client is authenticated
 boolean isCommunicatable()
          Returns true if we can still communicate with ISY
 boolean isD2dEnabled()
          Returns true if triggers are enabled
 boolean isDDNSHostAvailable(java.lang.String host)
           
 boolean isDefaultCert()
           
 boolean isDeviceInDiscoveryMode()
          Returns true if in discovery mode
 boolean isDisclaimerAgreedTo()
           
 boolean isElk2()
           
 boolean isIrEnabled()
          Returns true if IR is enabled
 boolean isIsy26()
          Returns true if the box is an ISY 26.
 boolean isIsy99()
          Returns true if the box is an ISY 99.
 boolean isIsyPro()
          Returns true if the box is a PRO version of the ISY.
 boolean isPortalClient()
           
 boolean isRemotelyAccessed()
           
protected  boolean isResetting()
          Returns true if ISY is in the process of rebooting
 boolean isSecurityEnabled()
           
 boolean isSubscribed()
           
 boolean isUsingSSL()
           
 boolean isViewable()
          Library Internal use only
 boolean loadTriggers(java.lang.StringBuffer key, com.universaldevices.common.xml.UDXmlParser parser)
          Returns all triggers
 void lostSession()
          Handles session loss clean up
 boolean makeUserDirectory(java.lang.String path)
          Makes a user directory
 boolean manageModules()
          Manages the modules which have to be either installed/uninstalled
 boolean moveNode(java.lang.String id, java.lang.String gid, char flag)
          Moves a UDNode to a UDGroup
 boolean moveUserObject(java.lang.String oldName, java.lang.String newName)
          Renames or moves a user object including a directory
protected  void offLine()
          ISY no longer reachable
protected  void onLine()
          ISY is on line
static boolean processDescriptionURL(java.lang.String url, UDProxyDevice dev)
           
static boolean processDescriptionURL(java.lang.String url, UDProxyDevice dev, boolean show_error)
           
 boolean processSecurityRequest(java.lang.String request_type, java.lang.String security_code)
          Processes a security system request (if one is attached); the parameters
for this method are all security system specific.
 boolean proveSubscription()
          Forces a heartbeat message to be sent back through our subscription, proving definitively that the subscription is active.
 boolean queryAll()
          Queries the whole network
 boolean queryAll(java.lang.String address, boolean isGroup)
          Queries a UDNode or a UDGroup within ISY
 boolean reboot(java.lang.String code)
          Reboots ISY;
 boolean refreshNodes()
          Refreshes the node/group structure
 boolean removeDDNSHost(java.lang.String host)
           
 boolean removeFolder(java.lang.String id)
          Permanently removes a UDFolder from ISY
 boolean removeFromGroup(java.lang.String id, java.lang.String gid)
          Removes a UDNode from a UDGroup
 boolean removeGroup(java.lang.String id)
          Permanently removes a UDGroup from ISY
 boolean removeModem()
          Removes the Modem attached to ISY
 boolean removeNode(java.lang.String address)
          Permanently removes a UDNode from ISY
 boolean removeUserDirectory(java.lang.String path, boolean deleteContentsOnly)
          Removes a user directory
 boolean removeUserObject(java.lang.String path, boolean isFolder)
          Removes a user file or directory
 boolean renameFolder(java.lang.String address, java.lang.String newName)
          Renames a UDFolder in ISY
 boolean renameGroup(java.lang.String address, java.lang.String newName)
          Renames a UDGroup in ISY
 boolean renameNetwork(java.lang.String name)
          Renames the network
 boolean renameNode(java.lang.String address, java.lang.String newName)
          Renames a UDNode in ISY
 boolean replaceDevice(java.lang.String oldDevice, java.lang.String newDevice, java.lang.String newFirmware)
          Replaces the oldDevice with the newDevice
 boolean replaceModem()
          Replaces the Modem attached to ISY
 IUpdaterResponse requestProgramUpdate(java.lang.String path, int content_len)
          Prepares for a file update
 IUpdaterResponse requestProgramUpdate(java.lang.String path, int content_len, char flag)
           
 IUpdaterResponse requestUserFileUpdate(java.lang.String path, int content_len)
           
 boolean resetAllNotifications()
          Resets any pending notifications
 boolean resetErrorLog()
          Completely resets ISY's error log
 boolean resetLog()
          Completely resets ISY's log
 boolean restoreDeviceFromNode(java.lang.String id)
          Restores the physical device from the logical node configured within ISY.
 boolean restoreDevicesFromNodes(char flag)
          Restores physical devices from the logical nodes configured within ISY.
 boolean restoreLink(java.lang.String ctlNodeId, java.lang.String rspNodeId)
          Restores the link data to between the controller and responder.
 boolean restoreNodesFromDevice(java.lang.String id)
          Restores the nodes based on the information in the physical device.
 boolean saveAndProcessSystemConfigurationFile(java.lang.String name, java.lang.String content)
          Saves the contents of an ISY system configuration file and processes it
 boolean saveFloorPlan(java.lang.StringBuffer diml)
          Saves the floor plan to ISY
 boolean saveNodeProperties(java.lang.String address, java.lang.StringBuffer diml)
          Saves the node properties to ISY
 boolean saveSystemConfigurationFile(java.lang.String name, byte[] image)
           
 boolean saveSystemConfigurationFile(java.lang.String name, java.lang.String content)
          Saves the contents of an ISY system configuration file
 boolean saveSystemConfigurationFile(java.lang.String name, java.lang.String content, char flag)
           
 boolean saveSystemConfigurationImage(java.lang.String name, byte[] image, char flag)
           
 boolean saveTrigger(java.lang.String key, int id, java.lang.StringBuffer pgm)
          Saves a D2D trigger program in ISY
 boolean sendD2DCommand(java.lang.String key, java.lang.String cmd, int id)
           
 boolean sendD2DCommand(java.lang.String key, java.lang.String cmd, int id, java.lang.String xml)
           
 boolean sendD2DCommand(java.lang.String key, java.lang.String cmd, java.lang.String mask)
           
 java.lang.Object sendDeviceSpecific(java.lang.String command, java.lang.String node, java.lang.String option, char flag, java.lang.StringBuffer specs)
          Supports Device specific services
 java.lang.Object sendDeviceSpecific(java.lang.String command, java.lang.String node, java.lang.String param1, java.lang.String param2, java.lang.StringBuffer specs)
          Supports Device specific services
 boolean sendTestEmail(java.lang.String id)
          Sends a test email to check SMTP configuration
 void setAutoUpdateCode(UDAutoUpdate.UDPlatform updateCode)
          Sets the Update code
 boolean setBatchMode(int batchMode)
          Renames or moves a user object including a directory
 boolean setBatteryDeviceWriteMode(int mode)
          Renames or moves a user object including a directory
 boolean setDebugLevel(int level)
          Sets the debug level which is used in the event viewer
protected  void setDeviceInDiscovery(boolean b)
          Sets the flag which indicates ISY is in Linking mode
 boolean SetDeviceLinkingMode(char flag)
          Sets the device linking mode.
 boolean setDisclaimerAgreedTo()
           
 void setExternalURL(java.lang.String externalURL)
          Sets ISY's external URL
protected  void setFriendlyName(java.lang.String name)
          Sets the ISY's friendly name
protected  void setLastAlive(long lastAlive)
          Sets the last time ISY was communicated with
protected  void setMaxAge(int max_age)
          Sets the max age for this proxy
 boolean setNodeDeviceProperties(java.lang.String xml)
          Sets some or all of the device properties for the given node
 boolean setNodeEnabled(java.lang.String node, boolean b)
          Enables/disables a node.
 boolean setNodePowerInfo(java.lang.String node, int deviceClass, int wattage, int dutyCyclePeriod)
          Power management functions
 boolean setNTP(SystemOptions conf)
          Sets NTP part of the SystemOptions in ISY
protected  void setNumNotifications(int num)
          Deprecated.  
 boolean setParent(java.lang.String node, int nodeType, java.lang.String parent, int parentType)
          Sets a parent for a node
protected  void setResetting(boolean isResetting)
          Sets the flag which indicates that ISY is rebooting/resetting
 void setReuseSocketForSubscription(boolean v)
           
 boolean setSessionKeys()
          Creates the session keys
 boolean setSMTPConfig(com.universaldevices.model.notifications.SMTPConfig conf)
          Sets the SMTPConfig in ISY
 boolean setSystemDateTime(com.universaldevices.common.datetime.DateTime dt)
          Sets ISY's system date/time/latitude/longitude
 boolean setSystemOptions(SystemOptions conf)
          Sets the SystemOptions in ISY
 boolean setUserCredentials(java.lang.String userid, java.lang.String pwd)
          Sets the main userid/pwd pair for ISY
 boolean setVariable(int varId, int varType, int value, boolean isInitValue)
          Sets the debug level which is used in the event viewer
 void setViewable(boolean isViewable)
          Library Internal use only
 void Stop()
          Stops the services associated with this device
 boolean submitGroupRequest(java.lang.String control, java.lang.String action, java.lang.String node)
          Submits a group change request
 boolean submitRequest(java.lang.String control, java.lang.String action, java.lang.String node)
          Submits a node change request
 com.universaldevices.rest.UDRestResponse submitRESTRequest(java.lang.String url)
          Submits a REST request and returns the results in String
 boolean submitSOAPRequest(java.lang.String soapAction, java.lang.StringBuffer body)
          Submits a raw SOAP request to ISY
 UDHTTPResponse submitSOAPRequest(java.lang.String soapAction, java.lang.StringBuffer body, short signatureType, boolean encrypt, boolean keep_alive)
           
 UDHTTPResponse submitSOAPRequest(java.lang.String soapAction, java.lang.StringBuffer body, short signatureType, boolean encrypt, boolean keep_alive, boolean longTimeout)
          Same as submitSOAPRequest without attributes
 UDHTTPResponse submitSOAPRequest(java.lang.String soapAction, java.lang.StringBuffer body, java.lang.String attributes, short signatureType, boolean encrypt, boolean keep_alive, boolean longTimeout)
           
 UDHTTPResponse submitSOAPRequest(java.lang.String serviceName, java.lang.String soapAction, java.lang.StringBuffer body, short signatureType, boolean encrypt, boolean keep_alive)
          same as above but using a service name
 UDHTTPResponse submitSOAPRequest(java.lang.String serviceName, java.lang.String soapAction, java.lang.StringBuffer body, short signatureType, boolean encrypt, boolean keep_alive, boolean longTimeout)
          Same as submitSOAPRequest without attributes
 UDHTTPResponse submitSOAPRequest(java.lang.String serviceName, java.lang.String soapAction, java.lang.StringBuffer body, java.lang.String attributes, short signatureType, boolean encrypt, boolean keep_alive, boolean longTimeout)
          Same as above with the addition of a service name
 boolean submitUDMLRequest(java.lang.String control, java.lang.String action, java.lang.String node, char flag)
          Submits a UDML/DIML request to ISY
 void subscribeToEvents(boolean reuseSocket)
          Subscribes to ISY's events
 boolean supportsErrorDriverControl()
           
 boolean synchWithNTS()
          Synchronizes ISY with a Network Time Server
 byte[] testNetworkResource(java.lang.String id, char flag)
          Tests a network resource
 java.lang.String toString()
          Simply returns the uuid of this device
 void unsubscribeFromEvents()
          Unsubscribes from the ISY events
 boolean uploadFile(java.lang.String path, byte[] body, char flag, IUpdaterClient view)
          Uploads a file
 boolean verifyUpdatePackage(java.io.InputStream is, long size)
          Given an inputstream, this method figures out if the update package containing the inputstream meets the criteria for an update package for this device
 boolean writeUpdatesToDevice(java.lang.String nodeId)
          Writes all pending device data changes to the device (such as new/deleted device links, on levels, etc.)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ADD_NODE_AND_RESET

public static char ADD_NODE_AND_RESET
Used as the 4th parameter in addNode(String, String, String, char) to signify that the newly added device shall be reset and overwritten with new values/links


ADD_NODE_AND_CRAWL_WITH_LINKS

public static char ADD_NODE_AND_CRAWL_WITH_LINKS
Used as the 4th parameter in addNode(String, String, String, char) to signify that the newly added device shall


ADD_NODE_AND_CRAWL_NO_LINKS

public static char ADD_NODE_AND_CRAWL_NO_LINKS
Used as the 4th parameter in addNode(String, String, String, char) to signify that the newly added device shall


DISCOVER_NODE_AND_RESET

public static char DISCOVER_NODE_AND_RESET
Used as the parameter in cancelNodesDiscovery(char) to signify that the newly linked device shall be reset and overwritten with new values/links


DISCOVER_NODE_AND_CRAWL_WITH_LINKS

public static char DISCOVER_NODE_AND_CRAWL_WITH_LINKS
Used as parameter in cancelNodesDiscovery(char) to signify that the newly linked device shall


DISCOVER_NODE_AND_CRAWL_NO_LINKS

public static char DISCOVER_NODE_AND_CRAWL_NO_LINKS
Used as the parameter in cancelNodesDiscovery(char) to signify that the newly linked device shall


DISCOVER_NODE_FAMILY_RCS_ZIGBEE

public static char DISCOVER_NODE_FAMILY_RCS_ZIGBEE

DISCOVER_NODE_FAMILY_ZWAVE_INCLUDE

public static char DISCOVER_NODE_FAMILY_ZWAVE_INCLUDE
Used as the 4th parameter in addNode(String, String, String, char) to start including/adding Z-Wave devices to the ISY.


DISCOVER_NODE_FAMILY_ZWAVE_EXCLUDE

public static char DISCOVER_NODE_FAMILY_ZWAVE_EXCLUDE
Used as the 4th parameter in addNode(String, String, String, char) to start excluding Z-Wave devices, and removing them from ISY if they exist.


RESTORE_NETWORK_WITH_LINKS

public static char RESTORE_NETWORK_WITH_LINKS
Used as the parameter in restoreDevicesFromNodes(char) to signify that groups/scenes will be regenerated from the logical representations stored in ISY


RESTORE_NETWORK_WITHOUT_LINKS

public static char RESTORE_NETWORK_WITHOUT_LINKS
Used as the parameter in restoreDevicesFromNodes(char) to signify that groups/scenes will not be re-generated from the logical representations stored in ISY. This method is good for testing


RESTORE_CONF_FILES_ONLY

public static char RESTORE_CONF_FILES_ONLY
Used for UD Presentation Layer functionality only


uuid

public java.lang.String uuid
The uuid (uniquely identies the ISY on the network) of ISY


isAuthenticated

public volatile boolean isAuthenticated
Whether or not a session has been created and authenticated.

This attribute should be used by clients to correctly identify the state of the device in relationship to the client


isOnline

public volatile boolean isOnline
Whether or not the device is on line


controls

public java.util.Hashtable<java.lang.String,UDControl> controls
A Hashtable of all the controls

All controls associated with the ISY and indexed based on the control's name

See Also:
UDControl

nodes

public java.util.Hashtable<java.lang.String,UDNode> nodes
A Hashtable of all the nodes (not groups/scenes) associated/linked to ISY.

See Also:
UDNode

upnpSecurity

public UPnPSecurity upnpSecurity
The UPnPSecurity object which handles all UPnPSecurity transformations


securityLevel

public short securityLevel
UPnP Security levels which may be any of the following: UPnPSecurity.NO_SECURITY
UPnPSecurity.SECURITY_LEVEL_1 - clear text authentication, with xml signatures
UPnPSecurity.SECURITY_LEVEL_2 - encrypted (bulk key) authentication, with xml signatures
UPnPSecurity.SECURITY_LEVEL_3 - RSA cryptography with xml signatures


descriptionURL

protected java.lang.String descriptionURL
Constructor Detail

UDProxyDevice

public UDProxyDevice(UDDeviceStateListener deviceListener)
Constructor Called by UDControlPoint when a new device is discovered

Parameters:
deviceListener - - there's only one and that is UDControlPoint
See Also:
UDControlPoint

UDProxyDevice

public UDProxyDevice(java.lang.String uuid,
                     java.lang.String descriptionURL,
                     UDDeviceStateListener deviceListener)
Constructor

Called by UDControlPoint when a new (ISY) device is discovered

Parameters:
uuid - - the uuid of the device
descriptionURL - - the url where the description of services may be found
deviceListener - - there's only one and that is UDControlPoint
See Also:
UDControlPoint
Method Detail

supportsErrorDriverControl

public boolean supportsErrorDriverControl()

configure

public boolean configure()
Configures this object

Called by UDControlPoint Configures this device based on the configuration DIML/XML returned from ISY

Returns:
- true if successful, false otherwise
See Also:
UDControlPoint

refreshNodes

public boolean refreshNodes()
Refreshes the node/group structure

Called by UDControlPoint Retrieves all the nodes/groups/scenes and any relationship thereof from ISY and creates the appropriate objectes UDNode and UDGroup The UDNodes are stored in the nodes attribute of this object The UDGroups are stored in the groups attribute of the UDControlPoint

Returns:
- true if successful, false otherwise

getProductId

public int getProductId()
Returns the product ID.

Returns:
The product ID (see PID_xxxx values)

getProductDescription

public java.lang.String getProductDescription()
Returns the product description.

Returns:
The product description.

isIsyPro

public boolean isIsyPro()
Returns true if the box is a PRO version of the ISY.

Returns:
true if the box is a PRO version of the ISY.

isIsy99

public boolean isIsy99()
Returns true if the box is an ISY 99.

Returns:
Returns true if the box is an ISY 99.

isIsy26

public boolean isIsy26()
Returns true if the box is an ISY 26.

Returns:
Returns true if the box is an ISY 26.

getNode

public UDNode getNode(java.lang.String id)
Retrieves a UDNode based on the given node address (String)

Parameters:
id - - the id/address of the node to get
Returns:
- if found, the UDNode with the given id, null otherwise

getPrimaryNode

public UDNode getPrimaryNode(java.lang.String id)
Retrieves the primary UDNode based on the given node address for any node defined for the device. (String)

Parameters:
id - - the id/address of any node defined for the device.
Returns:
- if found, the primary UDNode for the device, null otherwise

toString

public java.lang.String toString()
Simply returns the uuid of this device

Overrides:
toString in class java.lang.Object

Stop

public void Stop()
Stops the services associated with this device

Note: this method is invoked at appropriate times by the UDI's Network and Services Layers and, as such, should not be invoked independently.
Stops all the services:
- Unsubscribes from ISY
- Expires session keys (security) if any
- Puts the device in off line mode


lostSession

public void lostSession()
Handles session loss clean up

This method is called when the device is unreachable and thus cannot be stopped (using the Stop() method) Note: this method is invoked at appropriate times by the UDI's Network and Services Layers and, as such, should not be invoked independently


offLine

protected void offLine()
ISY no longer reachable

Called by UDControlPoint when the device is no longer reachable


onLine

protected void onLine()
ISY is on line

Called by UDControlPoint when the device starts advertising/announcing its existence on the network


setReuseSocketForSubscription

public void setReuseSocketForSubscription(boolean v)

subscribeToEvents

public void subscribeToEvents(boolean reuseSocket)
Subscribes to ISY's events

Parameters:
reuseSocket - - whether or not to reuse the initiating socket to receive events. It's always more efficient to reuse sockets.

unsubscribeFromEvents

public void unsubscribeFromEvents()
Unsubscribes from the ISY events

Unsubscription causes the ISY to no longer to try and send notifications to this proxy


proveSubscription

public boolean proveSubscription()
Forces a heartbeat message to be sent back through our subscription, proving definitively that the subscription is active.

Returns:
True if we have an active subscription

ensureSubscription

public boolean ensureSubscription()

processDescriptionURL

public static boolean processDescriptionURL(java.lang.String url,
                                            UDProxyDevice dev,
                                            boolean show_error)

processDescriptionURL

public static boolean processDescriptionURL(java.lang.String url,
                                            UDProxyDevice dev)

submitSOAPRequest

public UDHTTPResponse submitSOAPRequest(java.lang.String soapAction,
                                        java.lang.StringBuffer body,
                                        java.lang.String attributes,
                                        short signatureType,
                                        boolean encrypt,
                                        boolean keep_alive,
                                        boolean longTimeout)
Parameters:
soapAction -
body -
attributes - - attributes to be injected into the service call. Note that attributes are added as is
signatureType -
Returns:
Assumptions on the namespaces (to save space): " ; "";

submitSOAPRequest

public UDHTTPResponse submitSOAPRequest(java.lang.String soapAction,
                                        java.lang.StringBuffer body,
                                        short signatureType,
                                        boolean encrypt,
                                        boolean keep_alive,
                                        boolean longTimeout)
Same as submitSOAPRequest without attributes

Parameters:
soapAction -
body -
signatureType -
encrypt -
keep_alive -
longTimeout -
Returns:
UDHTTPResponse

submitSOAPRequest

public UDHTTPResponse submitSOAPRequest(java.lang.String serviceName,
                                        java.lang.String soapAction,
                                        java.lang.StringBuffer body,
                                        java.lang.String attributes,
                                        short signatureType,
                                        boolean encrypt,
                                        boolean keep_alive,
                                        boolean longTimeout)
Same as above with the addition of a service name

Parameters:
serviceName -
soapAction -
body -
attributes -
signatureType -
encrypt -
keep_alive -
longTimeout -
Returns:
UDHTTPResponse

submitSOAPRequest

public UDHTTPResponse submitSOAPRequest(java.lang.String serviceName,
                                        java.lang.String soapAction,
                                        java.lang.StringBuffer body,
                                        short signatureType,
                                        boolean encrypt,
                                        boolean keep_alive,
                                        boolean longTimeout)
Same as submitSOAPRequest without attributes

Parameters:
serviceName -
soapAction -
body -
signatureType -
encrypt -
keep_alive -
longTimeout -
Returns:
UDHTTPResponse

submitSOAPRequest

public UDHTTPResponse submitSOAPRequest(java.lang.String soapAction,
                                        java.lang.StringBuffer body,
                                        short signatureType,
                                        boolean encrypt,
                                        boolean keep_alive)
Parameters:
soapAction -
body -
signatureType -
Returns:
Assumptions on the namespaces (to save space): " ; "";

submitSOAPRequest

public UDHTTPResponse submitSOAPRequest(java.lang.String serviceName,
                                        java.lang.String soapAction,
                                        java.lang.StringBuffer body,
                                        short signatureType,
                                        boolean encrypt,
                                        boolean keep_alive)
same as above but using a service name

Parameters:
serviceName -
soapAction -
body -
signatureType -
encrypt -
keep_alive -
Returns:
UDHTTPResponse

submitSOAPRequest

public boolean submitSOAPRequest(java.lang.String soapAction,
                                 java.lang.StringBuffer body)
Submits a raw SOAP request to ISY

Parameters:
soapAction - The SOAP command (eg. "addNode")
body - The body of the message (parameters in XML)
Returns:
true if successful, false otherwise

submitUDMLRequest

public boolean submitUDMLRequest(java.lang.String control,
                                 java.lang.String action,
                                 java.lang.String node,
                                 char flag)
Submits a UDML/DIML request to ISY

This method submits a UDML/DIML request to ISY to affect the behavior of one of the UDNodes or UDGroups

Parameters:
control - - the name of the UDControl to be affected
action - - the name of the UDAction to be affected
node - - the id of the UDNode or UDGroup to be affected
flag - - the type of node: possible values are Constants.NODE_IS_A_GROUP ~Constants.NODE_IS_A_GROUP (not a group)
Returns:
- true if successful, false otherwise
See Also:
UDNode, UDGroup, UDControl, UDAction

submitRequest

public boolean submitRequest(java.lang.String control,
                             java.lang.String action,
                             java.lang.String node)
Submits a node change request

Convenience method to submit a UDML request to a UDNode but not a UDGroup

Parameters:
control - - the name of the UDControl to be affected
action - - the name of the UDAction to be affected
node - - the id of the UDNode
Returns:
- true if successful, false otherwise
See Also:
UDNode, UDGroup, UDControl, UDAction

submitGroupRequest

public boolean submitGroupRequest(java.lang.String control,
                                  java.lang.String action,
                                  java.lang.String node)
Submits a group change request

Convenience method to submit a UDML request to a UDGroup but not a UDNode

Parameters:
control - - the name of the UDControl to be affected
action - - the name of the UDAction to be affected
node - - the id of the UDGroup to be affected
Returns:
- true if successful, false otherwise
See Also:
UDNode, UDGroup, UDControl, UDAction

requestProgramUpdate

public IUpdaterResponse requestProgramUpdate(java.lang.String path,
                                             int content_len,
                                             char flag)

uploadFile

public boolean uploadFile(java.lang.String path,
                          byte[] body,
                          char flag,
                          IUpdaterClient view)
Uploads a file

This method uses POST

Specified by:
uploadFile in interface IUpdateHandler
Parameters:
path - - the file's path
body - - the body
flag - - 0x02= delete
view - - if there's a client which listens for the update process

deleteFile

public boolean deleteFile(java.lang.String path,
                          IUpdaterClient view)

isPortalClient

public boolean isPortalClient()

requestUserFileUpdate

public IUpdaterResponse requestUserFileUpdate(java.lang.String path,
                                              int content_len)

requestProgramUpdate

public IUpdaterResponse requestProgramUpdate(java.lang.String path,
                                             int content_len)
Prepares for a file update

This method prepares ISY for accepting a file/program to be written in its local file system

Specified by:
requestProgramUpdate in interface IUpdateHandler
Parameters:
path - - the path to which the file is going to be written
content_len - - the length of the file to be written
Returns:
- an IUpdaterResponse which can then be used to actually write the file to ISY
See Also:
IUpdaterResponse

addNode

public boolean addNode(java.lang.String newAddress,
                       java.lang.String newName,
                       java.lang.String type,
                       char flag)
Adds a UDNode to ISY

Parameters:
newAddress - - the address of the new UDNode
newName - - the name of the new UDNode
flag - - the type of operations to be performed on the newly created node.
The possible values are:
Returns:
true if successful, false otherwise
See Also:
UDNode

addNode

public boolean addNode(java.lang.String newAddress,
                       java.lang.String newName,
                       java.lang.String type,
                       java.lang.String family,
                       char flag)
Adds a UDNode to ISY

Parameters:
newAddress - - the address of the new UDNode
newName - - the name of the new UDNode
type - - The device type
family - - The product family (@link UDNode)
flag - - the type of operations to be performed on the newly created node.
The possible values are:
Returns:
true if successful, false otherwise
See Also:
UDNode

removeNode

public boolean removeNode(java.lang.String address)
Permanently removes a UDNode from ISY

Parameters:
address - - the address of the UDNode to be removed
Returns:
- true if successful, false otherwise
See Also:
UDNode

renameNode

public boolean renameNode(java.lang.String address,
                          java.lang.String newName)
Renames a UDNode in ISY

Parameters:
address - - the address of the UDNode to be renamed
newName - - the new name for the UDNode
Returns:
- true if successful, false otherwise
See Also:
UDNode

addGroup

public boolean addGroup(java.lang.String address,
                        java.lang.String name,
                        char flag)
Adds a UDGroup to ISY

Parameters:
address - - the address of the new UDGroup
name - - the name of the new UDGroup
flag - - the type of group to be created; at the moment, the supported value for this flag is: Constants.NODE_IS_A_GROUP
Returns:
- true if successful, false otherwise
See Also:
UDGroup

addFolder

public boolean addFolder(java.lang.String address,
                         java.lang.String name)
Adds a UDFolder to ISY

Parameters:
address - - the address of the new UDGroup
name - - the name of the new UDGroup
Returns:
- true if successful, false otherwise
See Also:
UDFolder

removeGroup

public boolean removeGroup(java.lang.String id)
Permanently removes a UDGroup from ISY

Parameters:
id - - the address of the UDGroup to be removed
Returns:
- true if successful, false otherwise
See Also:
UDGroup

removeFolder

public boolean removeFolder(java.lang.String id)
Permanently removes a UDFolder from ISY

Parameters:
id - - the address of the UDFolder to be removed
Returns:
- true if successful, false otherwise
See Also:
UDFolder

renameGroup

public boolean renameGroup(java.lang.String address,
                           java.lang.String newName)
Renames a UDGroup in ISY

Parameters:
address - - the address of the UDGroup to be renamed
newName - - the new name for the UDGroup
Returns:
- true if successful, false otherwise
See Also:
UDGroup

renameFolder

public boolean renameFolder(java.lang.String address,
                            java.lang.String newName)
Renames a UDFolder in ISY

Parameters:
address - - the address of the UDFolder to be renamed
newName - - the new name for the UDFolder
Returns:
- true if successful, false otherwise
See Also:
UDFolder

moveNode

public boolean moveNode(java.lang.String id,
                        java.lang.String gid,
                        char flag)
Moves a UDNode to a UDGroup

Parameters:
id - - the address of the UDNode to be moved
gid - - the address of the UDGroup being moved to
flag - - the relationship flag between the node and the group. Possible values: (@link Constants#NODE_IS_MASTER}: the node plays the master relationship in the group ~Constants.NODE_IS_MASTER: the node plays a slave relationship in the group
Returns:
- true if successful, false otherwise
See Also:
UDNode, UDGroup

removeFromGroup

public boolean removeFromGroup(java.lang.String id,
                               java.lang.String gid)
Removes a UDNode from a UDGroup

Parameters:
id - - the address of the UDNode being removed
gid - - the address of the UDGroup the node being removed from
Returns:
- true if successful, false otherwise
See Also:
UDNode, UDGroup

renameNetwork

public boolean renameNetwork(java.lang.String name)
Renames the network

Parameters:
name - - the new name for the network
Returns:
- true if successful, false otherwise

queryAll

public boolean queryAll(java.lang.String address,
                        boolean isGroup)
Queries a UDNode or a UDGroup within ISY

Parameters:
address - - the address of the UDNode or UDGroup to be queried
isGroup - - whether or not the address is that of a UDGroup If the group is the root group, all the nodes associated/linked to ISY shall be queried
Returns:
true if successful, false otherwise
See Also:
UDNode, UDGroup

queryAll

public boolean queryAll()
Queries the whole network


discoverNodes

public boolean discoverNodes(java.lang.String type)
Starts UDNode discovery.

In case of Insteon, this means starting a Linking session

Parameters:
type - - the option type of device being linked mostly in master mode
Returns:
- true if successful, false otherwise

discoverNodes

public boolean discoverNodes(java.lang.String type,
                             char action)
Starts UDNode discovery.

In case of Insteon, this means starting a Linking session

Parameters:
type - - The option type of device being linked mostly in master mode
action - - How the devices should be discovered.
Possible values are:
Returns:
- true if successful, false otherwise

discoverNodes

public boolean discoverNodes(java.lang.String type,
                             char action,
                             java.lang.String family)
Starts UDNode discovery.

In case of Insteon, this means starting a Linking session

Parameters:
type - - The option type of device being linked mostly in master mode
action - - How the devices should be discovered.
family - - Product driver family, or null for default family.
Possible values are:
Returns:
- true if successful, false otherwise

cancelNodesDiscovery

public boolean cancelNodesDiscovery(char action)
Cancels UDNode discovery.

In case of Insteon, this means stopping the Linking session

Parameters:
action - - what should be followed after a device is linked.
Possible values are:
Returns:
- true if successful, false otherwise

cancelNodesDiscovery

public boolean cancelNodesDiscovery(char action,
                                    java.lang.String family)
Cancels UDNode discovery.

In case of Insteon, this means stopping the Linking session

Parameters:
action - - what should be followed after a device is linked.
family - - Product driver family, or null for default family.
Possible values are:
Returns:
- true if successful, false otherwise

getSystemConfigurationFile

public byte[] getSystemConfigurationFile(java.lang.String name)
Returns the contents of an ISY system configuration file

Parameters:
name - - the name of the system configuration file
Returns:
- the contents of the system configuration file (binary) if successful, null otherwise

getContentList

public java.lang.String getContentList(java.lang.String path,
                                       java.lang.String ext,
                                       boolean summaryOnly)
Returns the summary of all content list entries for a given directory/fileExtension pair

Parameters:
path - - the content list directory (e.g. "/CONF/MAIL")
ext - - The file extension (e.g. "NTC")
Returns:
- the summary of all content list entries for a given directory/fileExtension pair.

saveSystemConfigurationImage

public boolean saveSystemConfigurationImage(java.lang.String name,
                                            byte[] image,
                                            char flag)

saveSystemConfigurationFile

public boolean saveSystemConfigurationFile(java.lang.String name,
                                           java.lang.String content,
                                           char flag)

saveAndProcessSystemConfigurationFile

public boolean saveAndProcessSystemConfigurationFile(java.lang.String name,
                                                     java.lang.String content)
Saves the contents of an ISY system configuration file and processes it

Specified by:
saveAndProcessSystemConfigurationFile in interface IUpdateHandler
Parameters:
name - The path qualified name of the system configuration file
content - The contents of the file
Returns:
- True if the contents were saved, false otherwise

saveSystemConfigurationFile

public boolean saveSystemConfigurationFile(java.lang.String name,
                                           byte[] image)

saveSystemConfigurationFile

public boolean saveSystemConfigurationFile(java.lang.String name,
                                           java.lang.String content)
Saves the contents of an ISY system configuration file

Parameters:
name - The path qualified name of the system configuration file
content - The contents of the file
Returns:
- True if the contents were saved, false otherwise

getSystemConfiguration

public java.lang.String getSystemConfiguration()
Returns a UDML/DIML list of all the ISY system configuration

It includes all the files and their paths

Returns:
- the system configuration file if successful, false otherwise

getSystemConfiguration

public java.lang.String getSystemConfiguration(java.lang.String path,
                                               java.lang.String pattern)
Returns a UDML/DIML list of all the ISY system configuration

It includes all the files and their paths

Returns:
- the system configuration file if successful, false otherwise

internetAccess

public boolean internetAccess(char flag)
Enables/disables internet access

Parameters:
flag - - possible values: Constants.ENABLE_INTERNET_ACCESS_FLAG Constants.DISABLE_INTERNET_ACCESS_FLAG
Returns:
- true if successful, false otherwise

SetDeviceLinkingMode

public boolean SetDeviceLinkingMode(char flag)
Sets the device linking mode.

Parameters:
flag - - the possible values are:
Constants.UD_LINK_MODE_SLAVE
Constants.UD_LINK_MODE_MASTER
Returns:
- true if successful, false otherwise

getSystemStatus

public SystemStatus getSystemStatus()
Returns ISY's system status

Returns:
- SystemStatus retrieved from ISY, null if failed
See Also:
SystemStatus

setSystemDateTime

public boolean setSystemDateTime(com.universaldevices.common.datetime.DateTime dt)
Sets ISY's system date/time/latitude/longitude

Parameters:
dt - - the DateTime object according to which the ISY's system date/time is set
Returns:
- true if successful, false otherwise

getSystemDateTime

public com.universaldevices.common.datetime.DateTime getSystemDateTime()
Returns ISY's system date/time related attributes

Returns:
- the DateTime object holding ISY's data/time attributes; null if failed
See Also:
DateTime

getSystemOptions

public SystemOptions getSystemOptions()
Retrieves the currently set SystemOptions in ISY

SystemOptions includes such things as email addresses, number pending, etc.

Returns:
- the current ISY SystemOptions; null if failed
See Also:
SystemOptions

setSystemOptions

public boolean setSystemOptions(SystemOptions conf)
Sets the SystemOptions in ISY

Returns:
- true if successful, false otherwise
See Also:
getSystemOptions(), SystemOptions

getSMTPConfig

public com.universaldevices.model.notifications.SMTPConfig getSMTPConfig()
Retrieves the currently set SMTPConfig in ISY

SMTPConfiguration includes such things as SMTP Server, port, etc..

Returns:
- the current ISY SMTPConfig; null if failed
See Also:
SMTPConfig

setSMTPConfig

public boolean setSMTPConfig(com.universaldevices.model.notifications.SMTPConfig conf)
Sets the SMTPConfig in ISY

Returns:
- true if successful, false otherwise
See Also:
getSMTPConfig(), SMTPConfig

sendTestEmail

public boolean sendTestEmail(java.lang.String id)
Sends a test email to check SMTP configuration


setNTP

public boolean setNTP(SystemOptions conf)
Sets NTP part of the SystemOptions in ISY

Returns:
- true if successful, false otherwise
See Also:
getSystemOptions(), SystemOptions

resetAllNotifications

public boolean resetAllNotifications()
Resets any pending notifications

Notifications are queued to be sent based on the configured interval

Returns:
- true if successful, false otherwise
See Also:
SystemOptions

getNumPendingNotifications

public boolean getNumPendingNotifications()
Deprecated. 

Gets the number of pending notifications

Gets the number of Notifications whcih are to be sent out and stores it in this object. To get the value, invoke getNumNotifications() method.

Returns:
- true if successful, false otherwise
See Also:
SystemOptions, getNumNotifications()

getLog

public java.lang.String getLog()
Returns ISY's current log file

The log file is returne in an ascii delimited tab separated format

Returns:
ISY's current log file

resetLog

public boolean resetLog()
Completely resets ISY's log

This method completely resets and removes all the ISY's log entries

Returns:
- true if successful, false otherwise

getErrorLog

public java.lang.String getErrorLog()
Returns ISY's current error log file

The log file is returned in an ascii delimited tab separated format

Returns:
ISY's current error log file

resetErrorLog

public boolean resetErrorLog()
Completely resets ISY's error log

This method completely resets and removes all the ISY's error entries

Returns:
- true if successful, false otherwise

loadTriggers

public boolean loadTriggers(java.lang.StringBuffer key,
                            com.universaldevices.common.xml.UDXmlParser parser)
Returns all triggers

Returns:
all the triggers configured in ISY; false if failed

getAllTriggerStatus

public boolean getAllTriggerStatus(java.lang.String key,
                                   com.universaldevices.common.xml.UDXmlParser parser)

saveTrigger

public boolean saveTrigger(java.lang.String key,
                           int id,
                           java.lang.StringBuffer pgm)
Saves a D2D trigger program in ISY

Parameters:
id - - The id of this program, must match the .. value in pgm
pgm - - the content of the program (...)
Returns:
- true if successful, false otherwise

sendD2DCommand

public boolean sendD2DCommand(java.lang.String key,
                              java.lang.String cmd,
                              int id,
                              java.lang.String xml)

sendD2DCommand

public boolean sendD2DCommand(java.lang.String key,
                              java.lang.String cmd,
                              int id)

sendD2DCommand

public boolean sendD2DCommand(java.lang.String key,
                              java.lang.String cmd,
                              java.lang.String mask)

saveFloorPlan

public boolean saveFloorPlan(java.lang.StringBuffer diml)
Saves the floor plan to ISY

Note: this operation is not supported in the SDK

Parameters:
diml - - the DIML/UDML representation of floorplan
Returns:
- true if successful/false otherwise

getFloorPlan

public java.lang.Object getFloorPlan()
Retrieves the floor plan from ISY

Retrieves the DIML/UDML representation of the floor plan from ISY Note: this operation is not supported in the SDK

Returns:
- the DIML/UDML representation of the floor plan

synchWithNTS

public boolean synchWithNTS()
Synchronizes ISY with a Network Time Server

Returns:
- true if successful, false otherwise

getPublicKeys

public boolean getPublicKeys()
Retrieves the RSA Public Keys from ISY

This method negotiates public keys to be used in communicating with ISY and configures the UPnPSecurity object accordingly.
This method is only applicable if securityLevel = UPnPSecurity.SECURITY_LEVEL_3

Returns:
- true if successful, false otherwise

getAlgorithmsAndProtocols

public boolean getAlgorithmsAndProtocols()
Gets supported security paramters

Gets the supported Algorithms and Protocols by ISY and configures the UPnPSecurity object accordingly

Returns:
- true if successful, false otherwise

getLifetimeSequenceBase

public boolean getLifetimeSequenceBase()
Gets the LifeTimeSequenceBase from ISY

It also configures the UPnPSecurity object accordingly. This value is important as it reduces the possiblility of replay attacks

Returns:
- true if successful, false otherwise

setSessionKeys

public boolean setSessionKeys()
Creates the session keys

Session keys are used throughout the life of the session with ISY. UPnPSecurity object is configured accordingly.

Returns:
true if successful, false otherwise

expireSessionKeys

public boolean expireSessionKeys()
Expires the session keys

This means that no longer this proxy is holding a secure session with ISY and no notifications/publications shall be forthcoming

Returns:
- true if successful, false otherwise

reboot

public boolean reboot(java.lang.String code)
Reboots ISY;

This method is fully encrypted on the wire for security purposes

Specified by:
reboot in interface IUpdateHandler
Parameters:
code - - if a code name is given, ISY is booted to that code
Returns:
- true if successful, false otherwise

authenticate

public boolean authenticate(java.lang.String userid,
                            java.lang.String pwd)
Authenticates a userid/password pair with ISY.

This method is fully encrypted on the wire for security purposes

Parameters:
userid - - the userid
pwd - - the password
Returns:
- true if authenticated, false if failed authentication

setUserCredentials

public boolean setUserCredentials(java.lang.String userid,
                                  java.lang.String pwd)
Sets the main userid/pwd pair for ISY

Parameters:
userid - - the userid
pwd - - the password
Returns:
- true if successful, false otherwise

sendDeviceSpecific

public java.lang.Object sendDeviceSpecific(java.lang.String command,
                                           java.lang.String node,
                                           java.lang.String param1,
                                           java.lang.String param2,
                                           java.lang.StringBuffer specs)
Supports Device specific services

This method is used for all device specific (such as Insteon) operations which cannot be categorized as generic ISY services

Parameters:
command - - the command to perform
node - - the UDNode affected
option - - the optional parameter to be passed in
flag - - the optional flags to be passed in
specs - - any XML document to be processed
Returns:
- if the command is successful and if it must return a result, then the result is return as an Object. It's upto the caller to decipher the meaning of the result. null if failed or if the command does not return a result

sendDeviceSpecific

public java.lang.Object sendDeviceSpecific(java.lang.String command,
                                           java.lang.String node,
                                           java.lang.String option,
                                           char flag,
                                           java.lang.StringBuffer specs)
Supports Device specific services

This method is used for all device specific (such as Insteon) operations which cannot be categorized as generic ISY services

Parameters:
command - - the command to perform
node - - the UDNode affected
option - - the optional parameter to be passed in
flag - - the optional flags to be passed in
specs - - any XML document to be processed
Returns:
- if the command is successful and if it must return a result, then the result is return as an Object. It's upto the caller to decipher the meaning of the result. null if failed or if the command does not return a result

clearConfiguration

public boolean clearConfiguration()
Deletes all the configuration files within ISY

Note: This method is similar to factory reset and should be used with extreme caution

Returns:
- true if successful, false otherwise

restoreDevicesFromNodes

public boolean restoreDevicesFromNodes(char flag)
Restores physical devices from the logical nodes configured within ISY.

This method takes all the logical node/group configurations within ISY and attempt to recreate them in the physical devices. Care should be taken to ensure that the logical representations/backups are the intended starting point

Parameters:
flag - - the type of restoration intended
The possible options are
:
Returns:
- true if successful, false otherwise

restoreDeviceFromNode

public boolean restoreDeviceFromNode(java.lang.String id)
Restores the physical device from the logical node configured within ISY.

This method takes all the logical node/group configurations within ISY and attempt to recreate them in the physical devices. Care should be taken to ensure that the logical representations/backups are the intended starting point

Parameters:
id - - the address of the device to be restored
Returns:
- true if successful, false otherwise

restoreNodesFromDevice

public boolean restoreNodesFromDevice(java.lang.String id)
Restores the nodes based on the information in the physical device.

This method replaces all the logical node/group configurations within ISY for the specified physical device. Care should be taken because some node information may lost and any pending changes to the device will also be lost.

Parameters:
id - - the address of the device
Returns:
- true if successful, false otherwise

writeUpdatesToDevice

public boolean writeUpdatesToDevice(java.lang.String nodeId)
Writes all pending device data changes to the device (such as new/deleted device links, on levels, etc.)

Parameters:
nodeId - - the address of the device to be updated.
Returns:
- true if successful, false otherwise

replaceModem

public boolean replaceModem()
Replaces the Modem attached to ISY

Modem is any device which is used for communications to physical devices linked to ISY.
In the case of Insteon, this could be a PLM.

Returns:
- true if successful, false otherwise

removeModem

public boolean removeModem()
Removes the Modem attached to ISY

Modem is any device which is used for communications to physical devices linked to ISY.
In the case of Insteon, this could be a PLM.

This is useful for cases where ISY is removed from the Network and thus all the links
from/to the modem are removed so that the devices do not report back their status to the
modem

Returns:
- true if successful, false otherwise

replaceDevice

public boolean replaceDevice(java.lang.String oldDevice,
                             java.lang.String newDevice,
                             java.lang.String newFirmware)
Replaces the oldDevice with the newDevice

This operation removes all the settings for the newDevice and replaces them
with those of the oldDevice. This also includes setting/updating triggers and schedules.

Parameters:
oldDevice - - the address of the old device
newDevice - - the address of the new device
newFirmware - - the firmware level of the new device
Returns:
- true if successful, false otherwise

restoreLink

public boolean restoreLink(java.lang.String ctlNodeId,
                           java.lang.String rspNodeId)
Restores the link data to between the controller and responder.

This operation writes the link data between the controller and responder to both devices. Normally this is done automatically, but gives the user the option to force the data to be written again.

Parameters:
ctlNodeId - - the address of the controller
rspNodeId - - the address of the responder
Returns:
- true if successful, false otherwise

getNodeDeviceProperties

public boolean getNodeDeviceProperties(java.lang.String node,
                                       UDNodeDevicePropertiesParser parser)
Retrieves the device properties for the given node

Parameters:
node - the address of the node, if null then properties for all nodes is returned
Returns:
True if successful
See Also:
UDNodeDeviceProperties

getNodeDeviceProperties

public boolean getNodeDeviceProperties(java.lang.String nodeAddr)
Gets Node Device Properties for the given node, using the registered parser.

Parameters:
nodeAddr - The address of the node
Returns:
True if successful or if not supported.

setNodeDeviceProperties

public boolean setNodeDeviceProperties(java.lang.String xml)
Sets some or all of the device properties for the given node

Parameters:
xml - xml string defining the properties to set
Returns:
True if successful
See Also:
UDNodeDeviceProperties

getNodeProperties

public UDNodeProperties getNodeProperties(java.lang.String node)
Retrieves the node properties for the given node

Parameters:
node - - the address of the node
Returns:
- the node properties as represented in UDNodeProperties
See Also:
UDNodeProperties

saveNodeProperties

public boolean saveNodeProperties(java.lang.String address,
                                  java.lang.StringBuffer diml)
Saves the node properties to ISY

Parameters:
address - - the address of the node for which the properties are saved
diml - - the DIML/UDML representation of UDNodeProperties
Returns:
- true if successful/false otherwise
See Also:
UDNodeProperties

configureSecuritySystem

public boolean configureSecuritySystem(java.lang.String name,
                                       java.lang.StringBuffer diml)
Configures an attached security system

Parameters:
name - - the name/brand of the secuirty system to configure
diml - - security system specific diml representation of its configuration
Returns:
- true if successful, false otherwise

getSecuritySystemConfig

public java.lang.String getSecuritySystemConfig(java.lang.String name)
Returns the configuration for an attached security system

Parameters:
name - - the name/brand of the security system for which the configuration is requested
Returns:
- the configuration if any, null otherwise

getSecuritySystemURLs

public java.lang.String getSecuritySystemURLs(java.lang.String name)
Returns a diml representation of all the configured URLs to access an attached security
system

Parameters:
name - - the name/brand of the security system for which the URLs are requested
Returns:
- the diml representation of all the configured URLs for the security system

processSecurityRequest

public boolean processSecurityRequest(java.lang.String request_type,
                                      java.lang.String security_code)
Processes a security system request (if one is attached); the parameters
for this method are all security system specific. i.e for each security
system, the type and code might be different

Parameters:
request_type - - the type of request such as ARM, DISARM, etc.
security_code - - the security code to Arm/Disarm the system
Returns:
- true if successful, false otherwise

getDebugLevel

public java.lang.String getDebugLevel()
Returns the debug level which is used in the event viewer

Returns:
- the debug level

setDebugLevel

public boolean setDebugLevel(int level)
Sets the debug level which is used in the event viewer

Parameters:
level -
Returns:
- true if successful, false otherwise

setVariable

public boolean setVariable(int varId,
                           int varType,
                           int value,
                           boolean isInitValue)
Sets the debug level which is used in the event viewer

Parameters:
varId - - variable ID
varType - - variable Type
value - - variable value
isInitValue - - True then set the initial value, False then set the current value.
Returns:
- true if successful, false otherwise

getVariables

public java.lang.String getVariables(int varType)
Sets the debug level which is used in the event viewer

Parameters:
varType - - variable type
Returns:
- true if successful, false otherwise

getNodesConfig

public java.lang.String getNodesConfig()
Convenience method:
Returns the nodes configuration as a string

Returns:
- nodes configuration

getISYConfig

public java.lang.String getISYConfig()
Convenience method:
Returns the ISY configuration as a string

Returns:
- nodes configuration

manageModules

public boolean manageModules()
Manages the modules which have to be either installed/uninstalled

Returns:
true if successful false otherwise

installModule

public boolean installModule(java.lang.String mid)
Install the given Module from ISY's configuration. ISY will perform a validation to make sure the module is legitimate and has been paid for

Parameters:
mid - - Module ID
Returns:
true if successful false otherwise

getUserDirectoryListing

public java.lang.String getUserDirectoryListing(java.lang.String path,
                                                java.lang.String pattern)
Returns directory listings for the user directory

Parameters:
path - - the path within the user directory; it could be empty
pattern - - the type of files in that directory; it could be empty
Returns:
- directory listing (recursive)

makeUserDirectory

public boolean makeUserDirectory(java.lang.String path)
Makes a user directory

Parameters:
path - - the path within the user directory
Returns:
true if successful, false otherwise

removeUserDirectory

public boolean removeUserDirectory(java.lang.String path,
                                   boolean deleteContentsOnly)
Removes a user directory

Parameters:
path - - the path within the user directory
deleteContentsOnly - - True then delete only the files in the directory, False then delete the directory as well
Returns:
true if successful, false otherwise

removeUserObject

public boolean removeUserObject(java.lang.String path,
                                boolean isFolder)
Removes a user file or directory

Parameters:
path - - the path within the user directory
isFolder - - whehter or not the object is a folder or a file
Returns:
true if successful, false otherwise

getUserFile

public byte[] getUserFile(java.lang.String name)
Returns the contents of an ISY user configuration file

Parameters:
name - - the name of the user configuration file
Returns:
- the contents of the user configuration file (binary) if successful, null otherwise

addUserFile

public boolean addUserFile(java.lang.String path,
                           byte[] image)

moveUserObject

public boolean moveUserObject(java.lang.String oldName,
                              java.lang.String newName)
Renames or moves a user object including a directory

Parameters:
oldName - - the old name
newName - - the new name
Returns:
true if successful, false otherwise

getFileSystemStatus

public FileSystemStat getFileSystemStatus()
Returns:
the status of the filesysetm

testNetworkResource

public byte[] testNetworkResource(java.lang.String id,
                                  char flag)
Tests a network resource

Parameters:
id - - the id for the resource
Returns:
- the response to the resource request if any otherwise

setBatchMode

public boolean setBatchMode(int batchMode)
Renames or moves a user object including a directory

Parameters:
batchMode -
Returns:
true if successful, false otherwise

setBatteryDeviceWriteMode

public boolean setBatteryDeviceWriteMode(int mode)
Renames or moves a user object including a directory

Parameters:
mode -
Returns:
true if successful, false otherwise

isCommunicatable

public boolean isCommunicatable()
Returns true if we can still communicate with ISY

Returns:
- whether or not we can communciate with the device. i.e. the device is both online and authenticate (in a session)

isClientAuthenticated

public boolean isClientAuthenticated()
Returns true if the client is authenticated

Specified by:
isClientAuthenticated in interface IUpdateHandler
Returns:
- whether or not the client is authenticated and in a session with the device

isIrEnabled

public boolean isIrEnabled()
Returns true if IR is enabled

Returns:
- whether or not IR is enabled on ISY

getNumNotifications

public int getNumNotifications()
Deprecated. 

Returns the stored number of pending notifications

Returns:
- the number of pending notifications
See Also:
SystemOptions

setNumNotifications

protected void setNumNotifications(int num)
Deprecated. 

Called by UDControlPoint to set the number of pending notifications

Parameters:
num -

isDeviceInDiscoveryMode

public boolean isDeviceInDiscoveryMode()
Returns true if in discovery mode

Returns:
- whether or not ISY is in Linking mode

setDeviceInDiscovery

protected void setDeviceInDiscovery(boolean b)
Sets the flag which indicates ISY is in Linking mode

Parameters:
b - - true if in Linking mode, false otherwise

getSCPDURL

public java.lang.String getSCPDURL()
Returns UPnP's Service Descripton

Returns:
- the UPnP service description URL

getArchivePath

public java.lang.String getArchivePath()
Returns the archive url

Returns:
- the URL/path to the archive (in applet)

isD2dEnabled

public boolean isD2dEnabled()
Returns true if triggers are enabled

Returns:
- whether or not triggers are enabled

getSysUpdateControl

public UDControl getSysUpdateControl()
Returns the UDControl for system updates

Returns:
- the UDControl associated with system updates
See Also:
UDControl

isResetting

protected boolean isResetting()
Returns true if ISY is in the process of rebooting

Called by UDControlPoint

Returns:
- whether or not ISY is rebooting/reseting itself

setResetting

protected void setResetting(boolean isResetting)
Sets the flag which indicates that ISY is rebooting/resetting

Called by UDControlPoint

Parameters:
isResetting - - true if resetting, false otherwise

getLastAlive

protected long getLastAlive()
Returns the last communications time with ISY

Called by UDControlPoint

Returns:
- the last time ISY sent out an announcement

setLastAlive

protected void setLastAlive(long lastAlive)
Sets the last time ISY was communicated with

Called by UDControlPoint

Parameters:
lastAlive - - the last time ISY sent an announcement

getMaxAge

protected int getMaxAge()
Returns the max age for this proxy

Called by UDControlPoint

Returns:
- the max age after which time we can consider ISY inoperational

setMaxAge

protected void setMaxAge(int max_age)
Sets the max age for this proxy

Called by UDControlPoint
Sets the max age for ISY

Parameters:
max_age - - the max age

getDevicetype

public java.lang.String getDevicetype()
Returns ISY's device type

Called by UDControlPoint

Returns:
- the device type

getApplication

public java.lang.String getApplication()
Returns the application name

Returns:
- the application name

getAppVersion

public java.lang.String getAppVersion()
Returns the application version

Returns:
- the application version

getPlatform

public java.lang.String getPlatform()
Returns the application's platform

Returns:
- the application platform

getBuildTimestamp

public java.lang.String getBuildTimestamp()
Returns the firmware build timestamp

Returns:
- firmware build timestamp

getMake

public java.lang.String getMake()
Returns the application's make

Returns:
- the application make

getModel

public java.lang.String getModel()
Returns the application's model

Returns:
- the application model

getFriendlyName

public java.lang.String getFriendlyName()
Returns ISY's friendly name

Returns:
- the ISY's friendly name

setFriendlyName

protected void setFriendlyName(java.lang.String name)
Sets the ISY's friendly name

Called by UDControlPoint

Parameters:
name - - the new friendly name for ISY

getManufacturerURL

public java.lang.String getManufacturerURL()
Returns the application's manufacturer URL

Returns:
- the application's manufacturer URL

getIcon

public java.lang.String getIcon()
Returns the application's Icon url

Returns:
- the application's icon

getServiceType

public java.lang.String getServiceType()
Returns the service type

Returns:
- the service type

getSubscriptionID

public java.lang.String getSubscriptionID()
Returns the subscription id

Returns:
- the subscription id (if in a session and subscribed) otherwise null

clearSubscriptionID

public void clearSubscriptionID()
Clears the subscription id.

Note: this method should not be invoked independent of UDI's Network and Services Layer


getExternalURL

public java.lang.String getExternalURL()
Returns ISY's external URL

Returns:
- the ISY's externalURL (in case internet access is enabled)

getInternalURL

public java.lang.String getInternalURL()
Returns ISY's Local/LAN URL

Returns:
- the ISY's Local/LAN URL

setExternalURL

public void setExternalURL(java.lang.String externalURL)
Sets ISY's external URL

Note: this method should not be invoked independent of UDI's Network and Services Layer

Parameters:
externalURL - - the externalURL to set

isViewable

public boolean isViewable()
Library Internal use only

This method is UDI presentation layer specific and is meaningless outside this context

Returns:
the isViewable

setViewable

public void setViewable(boolean isViewable)
Library Internal use only

This method is UDI presentation layer specific and is meaningless outside this context

Parameters:
isViewable - - the isViewable to set

getURLBase

public java.net.URL getURLBase()
Returns ISY's URL base

Returns:
- the ISY's URL base

getHostAddress

public java.net.InetSocketAddress getHostAddress()
Returns ISY's host address

Returns:
- ISY's host address

getNetworkName

public java.lang.String getNetworkName()
Returns the network name

Network is the top most node in the tree in UDI's Administrative Console

Returns:
- the networkName

getAutoUpdateCode

public UDAutoUpdate.UDPlatform getAutoUpdateCode()
Returns the Update Code (for upgrades) if any

Returns:
- the updateCode if any, null otherwise. UDAutoUpdate sets the corresponding attribute when an update is sensed.

setAutoUpdateCode

public void setAutoUpdateCode(UDAutoUpdate.UDPlatform updateCode)
Sets the Update code

UDAutoUpdate sets the corresponding attribute in case an update is sensed

Parameters:
updateCode - - the updateCode to set

isSecurityEnabled

public boolean isSecurityEnabled()
Returns:
whether or not the ISY is SSL enabled

isUsingSSL

public boolean isUsingSSL()
Returns:
- whether or not we are using SSL to communicate with this ISY

verifyUpdatePackage

public boolean verifyUpdatePackage(java.io.InputStream is,
                                   long size)
Given an inputstream, this method figures out if the update package containing the inputstream meets the criteria for an update package for this device

Specified by:
verifyUpdatePackage in interface IUpdateHandler
Parameters:
is - - the input stream
size - - the size of the intput stream
Returns:
- true if successful, false otherwise

isDefaultCert

public boolean isDefaultCert()
Returns:
- whether or not we are still using the default certificate

is27Compliant

public boolean is27Compliant()
Returns:
- true if ISY is 27 compliant

isElk2

public boolean isElk2()
Returns:
- true if ISY using new version of Elk

is28Compliant

public boolean is28Compliant()
Returns:
- true if ISY is 28 compliant

is310Compliant

public boolean is310Compliant()
Returns:
- true if ISY is 3.1 compliant

is320Compliant

public boolean is320Compliant()
Returns:
- true if ISY is 3.2 compliant

getMaxSSLStrength

public int getMaxSSLStrength()
Returns:
- maximum SSL Strength

isRemotelyAccessed

public boolean isRemotelyAccessed()

getProductInfo

public ProductInfo getProductInfo()
Returns:
the productInfo

getIsSubscribed

public java.lang.Boolean getIsSubscribed()
Returns:
whether or not we still have active subscription to ISY, or null if error occured.

isSubscribed

public boolean isSubscribed()
Returns:
True if subscribed, false if not subscribed or error occurred.

getIsyStartupTime

public java.lang.String getIsyStartupTime()
Returns:
The date/time when the ISY was started.

getLastError

public LastError getLastError()

clearLastError

public boolean clearLastError()

getNetworkConfig

public NetworkConfig getNetworkConfig()
Specified by:
getNetworkConfig in interface IUpdateHandler

getDDNSHost

public DDNSHost getDDNSHost()

isDDNSHostAvailable

public boolean isDDNSHostAvailable(java.lang.String host)

addDDNSHost

public boolean addDDNSHost(java.lang.String host,
                           java.lang.String ip)

removeDDNSHost

public boolean removeDDNSHost(java.lang.String host)

setNodeEnabled

public boolean setNodeEnabled(java.lang.String node,
                              boolean b)
Enables/disables a node. This feature is useful for devices that might not be plugged in

Parameters:
node - - The address of the node to be enabled
b - - whether or not the node is enabled
Returns:
- true if successful, false otherwise

setParent

public boolean setParent(java.lang.String node,
                         int nodeType,
                         java.lang.String parent,
                         int parentType)
Sets a parent for a node

Parameters:
node - - The address of the node to have parent set
nodeType - - The type of the node
parent - - The address of the parent
parentType - - The type of the parent
Returns:
- true if successful, false otherwise

setNodePowerInfo

public boolean setNodePowerInfo(java.lang.String node,
                                int deviceClass,
                                int wattage,
                                int dutyCyclePeriod)
Power management functions


getRootNode

public UDNode getRootNode()

isDisclaimerAgreedTo

public boolean isDisclaimerAgreedTo()

setDisclaimerAgreedTo

public boolean setDisclaimerAgreedTo()

getFile

public java.lang.String getFile(java.lang.StringBuffer url)
Gets a file using REST

Parameters:
url - - relative to base
Returns:
- the content of the URL if any, null otherwise

submitRESTRequest

public com.universaldevices.rest.UDRestResponse submitRESTRequest(java.lang.String url)
Submits a REST request and returns the results in String

Parameters:
url - - relative to base
Returns:
- the content of the URL if any, null otherwise

getPrograms

public com.universaldevices.device.model.programs.UDPrograms getPrograms()
Returns:
all programs UDPrograms