com.universaldevices.upnp
Class UDControlPoint

java.lang.Object
  extended by com.universaldevices.upnp.UDControlPoint
All Implemented Interfaces:
SSDPListener, UDDeviceStateListener

public class UDControlPoint
extends java.lang.Object
implements SSDPListener, UDDeviceStateListener

UDControlPoint is the representation of UPnP ControlPoint.

All UPnP traffic/events are intercepted and notified to the appropriate listeners. Node: UDControlPoint is an intergral part of UDI Network and Services Layer and, as such, a lot of care should be taken in using the methods/attributes therein independently.

Author:
UD Architect

Field Summary
static char ALL_DEVICES_ON_LINE_AND_AUTHENTICATED
           
static java.util.ArrayList<com.universaldevices.device.model.elec.IElectricityListener> autoDRListeners
          An ArrayList of Auto DR listeners of type IElectricityListener
static java.util.ArrayList<com.universaldevices.device.model.climate.IClimateListener> climateListeners
          An ArrayList of Climate listeners of type IClimateListener
static java.util.Hashtable<java.lang.String,UDProxyDevice> devices
          A Hashtable of UDProxyDevices representing ISYs indexed using their uuid
static java.lang.String deviceType
          The filter used to limit the types of devices which are handled in UDControlPoint
static java.util.ArrayList<com.universaldevices.device.model.elec.IEMonitorListener> electricityListeners
          an ArrayList of Electricity listeners of type IEMonitorListener
static java.util.ArrayList<com.universaldevices.device.model.elec.IEMeterListener> eMeterListeners
          An ArrayList of AMI/EMeter listeners of type IEMeterListener
static UDProxyDevice firstDevice
          First ever ISY discovered by UDControlPoint
static java.util.Hashtable<java.lang.String,UDFolder> folders
          A Hashtable of all the folders (UDGroup) in all the discovered ISYs
static java.util.ArrayList<com.universaldevices.device.model.gas.IGasMeterListener> gasMeterListeners
          an ArrayList of Gas listeners of type IGasMeterListener
static java.util.Hashtable<java.lang.String,UDGroup> groups
          A Hashtable of all the groups/scenes (UDGroup) in all the discovered ISYs
static java.util.ArrayList<IModelChangeListener> modelListeners
          An ArrayList of model listeners of type IModelChangeListener
static java.util.Hashtable<java.lang.String,UDProxyDevice> other_devices
          A Hashtable of UDProxyDevices representing non-ISYs indexed using their uuid
static java.util.ArrayList<ISecuritySystemChangeListener> securitySystemListeners
          An ArrayList of security system listeners of type ISecuritySystemChangeListener
static char SOME_DEVICES_OFF_LINE
           
static char SOME_DEVICES_UNAUTHENTICATED
           
static java.util.ArrayList<ISystemAlertsListener> systemAlertsListeners
          An ArrayList of System Alert listeners of type ISystemAlertsListener
static java.util.ArrayList<com.universaldevices.device.model.zigbee.IZigbeeEventListener> zigbeeListeners
          an ArrayList of Electricity listeners of type IZigbeeEventListener
 
Method Summary
 void addClimateListener(com.universaldevices.device.model.climate.IClimateListener listener)
          Adds a IClimateListener to the list of listeners
 void addDevice(UDProxyDevice edev)
          Adds an embedded device
 void addDevices(java.lang.String lanDevices, java.net.URL base)
          Manually add devices to the list of devices supported by UDControlPoint
 void addElectricityListener(com.universaldevices.device.model.elec.IElectricityListener listener)
          Adds a IElectricityListener to the list of listeners
 void addEMeterListener(com.universaldevices.device.model.elec.IEMeterListener listener)
          Adds a IEMeterListener to the list of listeners
 void addEMonitorListener(com.universaldevices.device.model.elec.IEMonitorListener listener)
          Adds a IEMonitorListener to the list of listeners
 void addEventListener(java.lang.String webServiceName, UDIEventListener listener)
          Registers a listener for events from a specific Web Service.
static void addFolder(java.lang.String name)
          This method adds a folder (UDFolder)
protected static void addFolder(UDFolder folder, java.lang.Object dev)
          Adds a folder when in initialization mode
 void addGasMeterListener(com.universaldevices.device.model.gas.IGasMeterListener listener)
          Adds a IGasMeterListener to the list of listeners
static void addGroup(java.lang.String name, char type)
          This method adds a group/scene (UDGroup)
static void addGroup(java.lang.String name, java.lang.String id, char type)
          This method adds a group/scene (UDGroup)
protected static void addGroup(UDGroup group, java.lang.Object dev)
          Adds a group when in initialization mode
 void addRawEventListener(UDRawEventListener listener)
          Registers a listener for all events, normally used only for logging and/or debug purposes.
 void addSecuritySystemChangeListener(ISecuritySystemChangeListener listener)
          Adds a ISecuritySystemChangeListener to the list of listeners
 void addSystemAlertsListener(ISystemAlertsListener listener)
          Adds a IElectricityListener to the list of listeners
 void addUDModelChangeListener(IModelChangeListener listener)
          Adds a IModelChangeListener to the list of listeners
 void addZigbeeListener(com.universaldevices.device.model.zigbee.IZigbeeEventListener listener)
          Adds a IZigbeeEventListener to the list of listeners
 void deviceRemoved(java.lang.String uuid)
          A device was removed (got a bye byte)
 void deviceStateChanged(UDProxyDevice device, java.lang.String control, java.lang.String action, java.lang.String node, XMLElement ei, boolean is_group)
          ISY's state changed
static char getAllDevicesStatus()
          Returns the general status of all the devices
 com.universaldevices.common.properties.UDPropertyFactory getDefaultPropertyFactory()
           
static int getFreePort()
          Gets a free port from the pool of available ports Note: do not use this method independently
static UDGroup getGroupWhereNodeIsMaster(java.lang.String nodeId, UDProxyDevice device)
          Returns the group where the specified node plays the role of a controller/master
static UDControlPoint getInstance()
          This method has to be called after Start() has been called
 UDNodeDevicePropertiesProcessor getNodeDevicePropertiesProcessor()
           
static java.util.ArrayList<UDGroup> getNodeGroups(java.lang.String nodeId, UDProxyDevice device)
          Returns all the groups a node belongs to
static java.lang.String getRootDeviceGroupAddress(UDProxyDevice device)
          Returns the address for the root group
static boolean isSupportMultipleDevices()
          Returns whether or not UDControlPoint should keep track of multiple devices with
the same type.
static void MinimalStart()
          Creates a UDControlPoint instance but does not
start any of the services
 void newDeviceAnnounced(java.lang.String uuid, java.lang.String type, java.lang.String descURL, int max_age)
          A devices was added to the network
 void newServiceAnnounced(java.lang.String uuid, java.lang.String type, java.lang.String descURL)
          A service was removed from the network
 void offLine(UDProxyDevice device)
          Device is offLine or not responding
 void onLine(UDProxyDevice device)
          Device is onLine
 void registerDefaultPropertyFactory(com.universaldevices.common.properties.UDPropertyFactory propertyFactory)
          Registers the default property factory to use when parsing properties.
 void registerEventProcessor(java.lang.String webServiceName, UDIEventProcessor processor)
          Registers an Event processor for a given Web Service whose responsibility is to call back all listeners registered to the processor.
 void removeClimateListeners(com.universaldevices.device.model.climate.IClimateListener listener)
          Removes the IClimateListener from the list of listeners
 void removeElectricityListener(com.universaldevices.device.model.elec.IElectricityListener listener)
          Removes the IElectricityListener from the list of listeners
 void removeEMeterListener(com.universaldevices.device.model.elec.IEMeterListener listener)
          Removes a IEMeterListener to the list of listeners
 void removeEMonitorListener(com.universaldevices.device.model.elec.IEMonitorListener listener)
          Removes the IEMonitorListener from the list of listeners
 void removeEventListener(java.lang.String webServiceName, UDIEventListener listener)
          Removes a listener for events from a specific Web Service.
 void removeEventProcessor(java.lang.String webServiceName)
          Removes the Event processor for a given Web Service.
static void removeFolder(java.lang.String id)
          Removes a folder
 void removeGasMeterListener(com.universaldevices.device.model.gas.IGasMeterListener listener)
          Removes the IGasMeterListener from the list of listeners
static void removeGroup(java.lang.String id)
          Removes a group/scene
 void removeRawEventListener(UDRawEventListener listener)
          Removes a listener for all events, normally used only for logging and/or debug purposes.
 void removeSecuritySystemChangeListener(ISecuritySystemChangeListener listener)
          Removes the ISecuritySystemChangeListener from the list of listeners
 void removeSystemAlertsListener(ISystemAlertsListener listener)
          Removes the ISystemAlertsListener from the list of listeners
 void removeUDModelChangeListener(IModelChangeListener listener)
          Removes the IModelChangeListener from the list of listeners
 void removeZigbeeListener(com.universaldevices.device.model.zigbee.IZigbeeEventListener listener)
          Removes the IZigbeeEventListener from the list of listeners
static void renameGroup(java.lang.String id, java.lang.String name)
          Renames a group/scene
 void search(java.lang.String uuid, boolean asynch)
          Starts a UPnP search for the given uuid, if one is found, then
SSDPListener.searchResult(boolean, String, String) method is called
 void searchForRootDevices()
          Starts a search for UPnP Root Devices
 void searchResult(boolean isUD, java.lang.String uuid, java.lang.String descURL)
          Results of a search request
 void serviceRemoved(java.lang.String uuid, java.lang.String type)
          A service was removed
static void setDeviceTypeFilter(java.lang.String deviceType)
          Sets the device type filter
static void setFreePort(int port)
          Makes a port available to be reused again
 void setSearching(boolean is_searching)
          Sets whether or not we are searching the network
static void setSupportMultipleDevices(boolean supportMultipleDevices)
          Sets whether or not UDControlPoint should keep track of multiple devices with
the same type.
static void Start()
          Starts ControlPoint services
static void StartServices()
          Starts
- SSDPClient
static void Stop()
          Stops all the activities of the UDControlPoint
static void stopActiveThreads()
           
static void stopOnlineDevices()
           
 void systemStatus(UDProxyDevice device, java.lang.String event)
          Notifies all the IModelChangeListeners of system status changes (busy, ready, progress update)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

devices

public static java.util.Hashtable<java.lang.String,UDProxyDevice> devices
A Hashtable of UDProxyDevices representing ISYs indexed using their uuid


other_devices

public static java.util.Hashtable<java.lang.String,UDProxyDevice> other_devices
A Hashtable of UDProxyDevices representing non-ISYs indexed using their uuid


modelListeners

public static java.util.ArrayList<IModelChangeListener> modelListeners
An ArrayList of model listeners of type IModelChangeListener


securitySystemListeners

public static java.util.ArrayList<ISecuritySystemChangeListener> securitySystemListeners
An ArrayList of security system listeners of type ISecuritySystemChangeListener


autoDRListeners

public static java.util.ArrayList<com.universaldevices.device.model.elec.IElectricityListener> autoDRListeners
An ArrayList of Auto DR listeners of type IElectricityListener


eMeterListeners

public static java.util.ArrayList<com.universaldevices.device.model.elec.IEMeterListener> eMeterListeners
An ArrayList of AMI/EMeter listeners of type IEMeterListener


systemAlertsListeners

public static java.util.ArrayList<ISystemAlertsListener> systemAlertsListeners
An ArrayList of System Alert listeners of type ISystemAlertsListener


climateListeners

public static java.util.ArrayList<com.universaldevices.device.model.climate.IClimateListener> climateListeners
An ArrayList of Climate listeners of type IClimateListener


electricityListeners

public static java.util.ArrayList<com.universaldevices.device.model.elec.IEMonitorListener> electricityListeners
an ArrayList of Electricity listeners of type IEMonitorListener


gasMeterListeners

public static java.util.ArrayList<com.universaldevices.device.model.gas.IGasMeterListener> gasMeterListeners
an ArrayList of Gas listeners of type IGasMeterListener


zigbeeListeners

public static java.util.ArrayList<com.universaldevices.device.model.zigbee.IZigbeeEventListener> zigbeeListeners
an ArrayList of Electricity listeners of type IZigbeeEventListener


firstDevice

public static UDProxyDevice firstDevice
First ever ISY discovered by UDControlPoint


deviceType

public static java.lang.String deviceType
The filter used to limit the types of devices which are handled in UDControlPoint


groups

public static java.util.Hashtable<java.lang.String,UDGroup> groups
A Hashtable of all the groups/scenes (UDGroup) in all the discovered ISYs


folders

public static java.util.Hashtable<java.lang.String,UDFolder> folders
A Hashtable of all the folders (UDGroup) in all the discovered ISYs


ALL_DEVICES_ON_LINE_AND_AUTHENTICATED

public static char ALL_DEVICES_ON_LINE_AND_AUTHENTICATED

SOME_DEVICES_OFF_LINE

public static char SOME_DEVICES_OFF_LINE

SOME_DEVICES_UNAUTHENTICATED

public static char SOME_DEVICES_UNAUTHENTICATED
Method Detail

registerEventProcessor

public void registerEventProcessor(java.lang.String webServiceName,
                                   UDIEventProcessor processor)
Registers an Event processor for a given Web Service whose responsibility is to call back all listeners registered to the processor. NOTE: This is used to register the actual Web Service Implementation, use addEventListener(java.lang.String, com.universaldevices.upnp.UDIEventListener) to add a listener for your application.

Parameters:
webServiceName - The web service of this processor
processor - The event processor

removeEventProcessor

public void removeEventProcessor(java.lang.String webServiceName)
Removes the Event processor for a given Web Service. NOTE: This is used to remove the actual Web Service Implementation, use removeEventListener(java.lang.String, com.universaldevices.upnp.UDIEventListener) to remove a listener for your application.

Parameters:
webServiceName - The web service of the processor to remove

addEventListener

public void addEventListener(java.lang.String webServiceName,
                             UDIEventListener listener)
Registers a listener for events from a specific Web Service.

Parameters:
webServiceName -
listener -

removeEventListener

public void removeEventListener(java.lang.String webServiceName,
                                UDIEventListener listener)
Removes a listener for events from a specific Web Service.

Parameters:
webServiceName -
listener -

addRawEventListener

public void addRawEventListener(UDRawEventListener listener)
Registers a listener for all events, normally used only for logging and/or debug purposes.

Parameters:
webServiceName -
listener -

removeRawEventListener

public void removeRawEventListener(UDRawEventListener listener)
Removes a listener for all events, normally used only for logging and/or debug purposes.

Parameters:
webServiceName -
listener -

getDefaultPropertyFactory

public com.universaldevices.common.properties.UDPropertyFactory getDefaultPropertyFactory()

getNodeDevicePropertiesProcessor

public UDNodeDevicePropertiesProcessor getNodeDevicePropertiesProcessor()

registerDefaultPropertyFactory

public void registerDefaultPropertyFactory(com.universaldevices.common.properties.UDPropertyFactory propertyFactory)
Registers the default property factory to use when parsing properties.

Parameters:
propertyFactory - - The default UDPropertyFactory.

addUDModelChangeListener

public void addUDModelChangeListener(IModelChangeListener listener)
Adds a IModelChangeListener to the list of listeners

Parameters:
listener - - a IModelChangeListener to be added
See Also:
IModelChangeListener

removeUDModelChangeListener

public void removeUDModelChangeListener(IModelChangeListener listener)
Removes the IModelChangeListener from the list of listeners

Parameters:
listener - - the IModelChangeListener to be removed
See Also:
IModelChangeListener

addSecuritySystemChangeListener

public void addSecuritySystemChangeListener(ISecuritySystemChangeListener listener)
Adds a ISecuritySystemChangeListener to the list of listeners

Parameters:
listener - - a ISecuritySystemChangeListener to be added
See Also:
ISecuritySystemChangeListener

removeSecuritySystemChangeListener

public void removeSecuritySystemChangeListener(ISecuritySystemChangeListener listener)
Removes the ISecuritySystemChangeListener from the list of listeners

Parameters:
listener - - the ISecuritySystemChangeListener to be removed
See Also:
ISecuritySystemChangeListener

addElectricityListener

public void addElectricityListener(com.universaldevices.device.model.elec.IElectricityListener listener)
Adds a IElectricityListener to the list of listeners

Parameters:
listener - - a IElectricityListener to be added
See Also:
IElectricityListener

removeElectricityListener

public void removeElectricityListener(com.universaldevices.device.model.elec.IElectricityListener listener)
Removes the IElectricityListener from the list of listeners

Parameters:
listener - - the IElectricityListener to be removed
See Also:
IElectricityListener

addEMeterListener

public void addEMeterListener(com.universaldevices.device.model.elec.IEMeterListener listener)
Adds a IEMeterListener to the list of listeners

Parameters:
listener - - a IEMeterListener to be added
See Also:
IEMeterListener

removeEMeterListener

public void removeEMeterListener(com.universaldevices.device.model.elec.IEMeterListener listener)
Removes a IEMeterListener to the list of listeners

Parameters:
listener - - a IEMeterListener to be added
See Also:
IEMeterListener

addSystemAlertsListener

public void addSystemAlertsListener(ISystemAlertsListener listener)
Adds a IElectricityListener to the list of listeners

Parameters:
listener - - a IElectricityListener to be added
See Also:
ISecuritySystemChangeListener

removeSystemAlertsListener

public void removeSystemAlertsListener(ISystemAlertsListener listener)
Removes the ISystemAlertsListener from the list of listeners

Parameters:
listener - - the ISystemAlertsListener to be removed
See Also:
ISecuritySystemChangeListener

addClimateListener

public void addClimateListener(com.universaldevices.device.model.climate.IClimateListener listener)
Adds a IClimateListener to the list of listeners

Parameters:
listener - - a IClimateListener to be added
See Also:
IClimateListener

removeClimateListeners

public void removeClimateListeners(com.universaldevices.device.model.climate.IClimateListener listener)
Removes the IClimateListener from the list of listeners

Parameters:
listener - - the IClimateListener to be removed
See Also:
IClimateListener

addEMonitorListener

public void addEMonitorListener(com.universaldevices.device.model.elec.IEMonitorListener listener)
Adds a IEMonitorListener to the list of listeners

Parameters:
listener - - a IEMonitorListener to be added
See Also:
IEMonitorListener

removeEMonitorListener

public void removeEMonitorListener(com.universaldevices.device.model.elec.IEMonitorListener listener)
Removes the IEMonitorListener from the list of listeners

Parameters:
listener - - the IEMonitorListener to be removed
See Also:
IEMonitorListener

addGasMeterListener

public void addGasMeterListener(com.universaldevices.device.model.gas.IGasMeterListener listener)
Adds a IGasMeterListener to the list of listeners

Parameters:
listener - - a IGasMeterListener to be added
See Also:
IGasMeterListener

removeGasMeterListener

public void removeGasMeterListener(com.universaldevices.device.model.gas.IGasMeterListener listener)
Removes the IGasMeterListener from the list of listeners

Parameters:
listener - - the IGasMeterListener to be removed
See Also:
IGasMeterListener

addZigbeeListener

public void addZigbeeListener(com.universaldevices.device.model.zigbee.IZigbeeEventListener listener)
Adds a IZigbeeEventListener to the list of listeners

Parameters:
listener - - a IZigbeeEventListener to be added
See Also:
IZigbeeEventListener

removeZigbeeListener

public void removeZigbeeListener(com.universaldevices.device.model.zigbee.IZigbeeEventListener listener)
Removes the IZigbeeEventListener from the list of listeners

Parameters:
listener - - the IZigbeeEventListener to be removed
See Also:
IZigbeeEventListener

addDevices

public void addDevices(java.lang.String lanDevices,
                       java.net.URL base)
Manually add devices to the list of devices supported by UDControlPoint

This method is especially important when firewall issues stop UPnP traffic through and if you wish to add a device bound to a static IP address

Parameters:
lanDevices - - a comma separated list of uuid&descriptionURL for each device
base - - the URL base of where the client is pointing to (such as http://192.168.0.126:2626/0/p). If this is a local (not browser based) client, the base may be null.

setSearching

public void setSearching(boolean is_searching)
Sets whether or not we are searching the network

Searching for other UPnP devices?

Specified by:
setSearching in interface SSDPListener
Parameters:
is_searching - - true if we are already searching, false otherwise

searchForRootDevices

public void searchForRootDevices()
Starts a search for UPnP Root Devices


deviceRemoved

public void deviceRemoved(java.lang.String uuid)
A device was removed (got a bye byte)

This method is called by SSDPClient when a device is removed from the network.

Note: do not use this method independently

Specified by:
deviceRemoved in interface SSDPListener
Parameters:
uuid - - the uuid of the device removed

newDeviceAnnounced

public void newDeviceAnnounced(java.lang.String uuid,
                               java.lang.String type,
                               java.lang.String descURL,
                               int max_age)
A devices was added to the network

This method is called by SSDPClient when a device is added to the network. Note: do not use this method independently

Specified by:
newDeviceAnnounced in interface SSDPListener
Parameters:
uuid - - the uuid of the device added
type - - the type of the device added
descURL - - the URL where the description of the service may be retrieved from
max_age - - the maximum amount of time this advertisement is valid and after which time we can consider the device dead (if not followed by another advertisement)

newServiceAnnounced

public void newServiceAnnounced(java.lang.String uuid,
                                java.lang.String type,
                                java.lang.String descURL)
A service was removed from the network

This method is called by SSDPClient when a service is added to the network. Note: this method is not implemented; subclasses may choose to implement this method

Specified by:
newServiceAnnounced in interface SSDPListener
Parameters:
uuid - - the uuid of the service added
type - - the type of the service added
descURL - - the URL where the description of the service may be retrieved from

serviceRemoved

public void serviceRemoved(java.lang.String uuid,
                           java.lang.String type)
A service was removed

This method is called by SSDPClient when a service is removed from the network. Note: this method is not implemented; subclasses may choose to implement this method

Specified by:
serviceRemoved in interface SSDPListener
Parameters:
uuid - - the uuid of the device/service removed
type - - the type of the service removed

search

public void search(java.lang.String uuid,
                   boolean asynch)
Starts a UPnP search for the given uuid, if one is found, then
SSDPListener.searchResult(boolean, String, String) method is called

Parameters:
uuid - - the uuid of the device/service we're searching for
asynch - - whether or not the search is synchronous (wait for the result)
See Also:
UDProxyDevice

searchResult

public void searchResult(boolean isUD,
                         java.lang.String uuid,
                         java.lang.String descURL)
Results of a search request

This method is called by SSDPClient when a search request was successful Note: do not use this method independently

Specified by:
searchResult in interface SSDPListener
Parameters:
isUD - - whether or not the discovered device is an ISY
uuid - - the uuid of the device
descURL - - the URL where the description of the device may be found

deviceStateChanged

public void deviceStateChanged(UDProxyDevice device,
                               java.lang.String control,
                               java.lang.String action,
                               java.lang.String node,
                               XMLElement ei,
                               boolean is_group)
ISY's state changed

This method is called by UDProxyDevice when any change is detected in ISY and, subsequently, all IModelChangeListeners are notified

Specified by:
deviceStateChanged in interface UDDeviceStateListener
Parameters:
device - - the device (UDProxyDevice) where the change took place
control - - the [name of] the control which was affected
action - - the [name of] the action (with in the context of a control) which was performed
node - - the [address of] the node which was affected
ei - - general event information to be processed by clients
is_group - - whether or not the affected node is a group/scene
See Also:
UDControl, UDAction, UDNode, UDProxyDevice

offLine

public void offLine(UDProxyDevice device)
Device is offLine or not responding

Note: do not use this method independently

Specified by:
offLine in interface UDDeviceStateListener
Parameters:
device - - the which is now offline
See Also:
UDProxyDevice

onLine

public void onLine(UDProxyDevice device)
Device is onLine

Note: do not use this method independently

Specified by:
onLine in interface UDDeviceStateListener
Parameters:
device - - the which is now online
See Also:
UDProxyDevice

addDevice

public void addDevice(UDProxyDevice edev)
Adds an embedded device

Note: this method is not implemented nor are embedded UPnP devices supported

Parameters:
edev - - the embedded UDProxyDevice to be added

setDeviceTypeFilter

public static void setDeviceTypeFilter(java.lang.String deviceType)
Sets the device type filter

Filter limits the types of devices UDControlPoint is goint to maintain in its list of active devices

Parameters:
deviceType - - the String representation of device type

setFreePort

public static void setFreePort(int port)
Makes a port available to be reused again

Note: do not use this method independently

Parameters:
port - - the port which is now available

getInstance

public static UDControlPoint getInstance()
This method has to be called after Start() has been called

Returns:
The one and the only one instance of UDControlPoint

stopActiveThreads

public static void stopActiveThreads()

stopOnlineDevices

public static void stopOnlineDevices()

Stop

public static void Stop()
Stops all the activities of the UDControlPoint

-Stops the SSDPClient if running
-Clears the lists of devices
-Clears the list of groups/scenes


Start

public static void Start()
Starts ControlPoint services

- Creates the UDControlPoint instance - SSDPClient


MinimalStart

public static void MinimalStart()
Creates a UDControlPoint instance but does not
start any of the services


StartServices

public static void StartServices()

Starts
- SSDPClient


getFreePort

public static int getFreePort()
Gets a free port from the pool of available ports
Note
: do not use this method independently

Returns:
- the port which is available/free

getAllDevicesStatus

public static char getAllDevicesStatus()
Returns the general status of all the devices

All devices that are associated with this instance of UDControlPoint

Returns:
- any of the follwoing:
ALL_DEVICES_ON_LINE_AND_AUTHENTICATED
SOME_DEVICES_OFF_LINE
SOME_DEVICES_UNAUTHENTICATED

addGroup

public static void addGroup(java.lang.String name,
                            java.lang.String id,
                            char type)
This method adds a group/scene (UDGroup)

The new created group/scene is added to all the devices (UDProxyDevice) associated with this UDControlPoint

Parameters:
name - - the name of the group to be created
id - - the address of the group
type - - must always be Constants.NODE_IS_A_GROUP
See Also:
UDGroup, UDProxyDevice

addGroup

public static void addGroup(java.lang.String name,
                            char type)
This method adds a group/scene (UDGroup)

The new created group/scene is added to all the devices (UDProxyDevice) associated with this UDControlPoint This method generates and guarantees unique ids for each group

Parameters:
name - - the name of the group to be created
type - - must always be Constants.NODE_IS_A_GROUP
See Also:
UDGroup, UDProxyDevice

addFolder

public static void addFolder(java.lang.String name)
This method adds a folder (UDFolder)

The new created folder is added to all the devices (UDProxyDevice) associated with this UDControlPoint This method guarantees unique ids for each folder

Parameters:
name - - the folder of the group to be created
See Also:
UDFolder, UDProxyDevice

addGroup

protected static void addGroup(UDGroup group,
                               java.lang.Object dev)
Adds a group when in initialization mode

This method is invoked by UDProxyDevice upon initialization. In effect, UDProxyDevice reads the nodes configuration DIML/XML and, for each group, calls this method.

Parameters:
group - - the UDGroup being added
dev - - the UDProxyDevice this event was originated from

addFolder

protected static void addFolder(UDFolder folder,
                                java.lang.Object dev)
Adds a folder when in initialization mode

This method is invoked by UDProxyDevice upon initialization. In effect, UDProxyDevice reads the nodes configuration DIML/XML and, for each group, calls this method.

Parameters:
folder - - the UDFolder being added
dev - - the UDProxyDevice this event was originated from

removeGroup

public static void removeGroup(java.lang.String id)
Removes a group/scene

This method removes a group/scene (UDGroup) from all the devices (UDProxyDevice) associated with UDControlPoint

Parameters:
id - - the uuid/id of the group/scene to be removed

removeFolder

public static void removeFolder(java.lang.String id)
Removes a folder

This method removes a folder (UDFolder) from all the devices (UDProxyDevice) associated with UDControlPoint

Parameters:
id - - the uuid/id of the folder to be removed

renameGroup

public static void renameGroup(java.lang.String id,
                               java.lang.String name)
Renames a group/scene

This method renames a group/scene (UDGroup) in all the devices (UDProxyDevice) associated with UDControlPoint This method guarantees unique ids for each group

Parameters:
id - - the uuid/id of the group to be renamed
name - - the new name for the group

getGroupWhereNodeIsMaster

public static UDGroup getGroupWhereNodeIsMaster(java.lang.String nodeId,
                                                UDProxyDevice device)
Returns the group where the specified node plays the role of a controller/master

Parameters:
nodeId - - the id of the node to be checked
device - - the UDProxyDevice to which the node is linked/attached to
Returns:
- if found, the UDGroup where the node is a controller/master; otherwise, null

getNodeGroups

public static java.util.ArrayList<UDGroup> getNodeGroups(java.lang.String nodeId,
                                                         UDProxyDevice device)
Returns all the groups a node belongs to

Returns an ArrayList of all the UDGroups which the specified node (UDNode) belongs to

Parameters:
nodeId - - the id of the node being investigated
device - - the device to which the node is linked/attached
Returns:
- an ArrayList of all the UDGroups which the specified node (UDNode) belongs to

getRootDeviceGroupAddress

public static java.lang.String getRootDeviceGroupAddress(UDProxyDevice device)
Returns the address for the root group

Root group is the logical representation of ISY

Parameters:
device - - the UDProxyDevice for which we want the group address
Returns:
- the root group address/id

systemStatus

public void systemStatus(UDProxyDevice device,
                         java.lang.String event)
Notifies all the IModelChangeListeners of system status changes (busy, ready, progress update)

Specified by:
systemStatus in interface UDDeviceStateListener
Parameters:
device - - the ISY (UDProxyDevice) originating this event
event - - the type of event
See Also:
UDProxyDevice

isSupportMultipleDevices

public static boolean isSupportMultipleDevices()
Returns whether or not UDControlPoint should keep track of multiple devices with
the same type. Default is false

Returns:
true if support multiple devices of the same type, false otherwise

setSupportMultipleDevices

public static void setSupportMultipleDevices(boolean supportMultipleDevices)
Sets whether or not UDControlPoint should keep track of multiple devices with
the same type. Default is false

Parameters:
supportMultipleDevices - the supportMultipleDevices to set