use of org.cybergarage.upnp.xml.DeviceData in project felix by apache.
the class BuildDevice method buildDevice.
private static void buildDevice(String id, Device parent, ServiceReference sr) {
Node dev = new Node(Device.ELEM_NAME);
DeviceData dd = new DeviceData();
dd.setDescriptionURI(id + "/gen-desc.xml");
dev.setUserData(dd);
Device devUPnP = new Device(dev);
devUPnP.setDeviceType(extractDeviceType(sr));
devUPnP.setFriendlyName((String) sr.getProperty(UPnPDevice.FRIENDLY_NAME));
devUPnP.setManufacture((String) sr.getProperty(UPnPDevice.MANUFACTURER));
devUPnP.setManufactureURL((String) sr.getProperty(UPnPDevice.MANUFACTURER_URL));
devUPnP.setModelDescription((String) sr.getProperty(UPnPDevice.MODEL_DESCRIPTION));
devUPnP.setModelName((String) sr.getProperty(UPnPDevice.MODEL_NAME));
devUPnP.setModelNumber((String) sr.getProperty(UPnPDevice.MODEL_NUMBER));
devUPnP.setModelURL((String) sr.getProperty(UPnPDevice.MODEL_URL));
devUPnP.setSerialNumber((String) sr.getProperty(UPnPDevice.SERIAL_NUMBER));
devUPnP.setUDN((String) sr.getProperty(UPnPDevice.UDN));
devUPnP.setUPC((String) sr.getProperty(UPnPDevice.UPC));
devUPnP.setLocation(id + "/gen-desc.xml");
addServices(id, devUPnP, sr);
addDevices(id, devUPnP, sr);
// twa: essential!!!!!!!
parent.addDevice(devUPnP);
devUPnP.setPresentationURL((String) sr.getProperty(UPnPDevice.PRESENTATION_URL));
}
use of org.cybergarage.upnp.xml.DeviceData in project felix by apache.
the class BuildDevice method buildRootDeviceNode.
private static Device buildRootDeviceNode(Node root, ServiceReference sr) {
Node dev = new Node(Device.ELEM_NAME);
root.addNode(dev);
DeviceData dd = new DeviceData();
dd.setDescriptionURI("/gen-desc.xml");
dev.setUserData(dd);
Device devUPnP = new Device(root, dev);
devUPnP.setDeviceType(extractDeviceType(sr));
devUPnP.setFriendlyName((String) sr.getProperty(UPnPDevice.FRIENDLY_NAME));
devUPnP.setManufacture((String) sr.getProperty(UPnPDevice.MANUFACTURER));
devUPnP.setManufactureURL((String) sr.getProperty(UPnPDevice.MANUFACTURER_URL));
devUPnP.setModelDescription((String) sr.getProperty(UPnPDevice.MODEL_DESCRIPTION));
devUPnP.setModelName((String) sr.getProperty(UPnPDevice.MODEL_NAME));
devUPnP.setModelNumber((String) sr.getProperty(UPnPDevice.MODEL_NUMBER));
devUPnP.setModelURL((String) sr.getProperty(UPnPDevice.MODEL_URL));
devUPnP.setSerialNumber((String) sr.getProperty(UPnPDevice.SERIAL_NUMBER));
devUPnP.setUDN((String) sr.getProperty(UPnPDevice.UDN));
devUPnP.setUPC((String) sr.getProperty(UPnPDevice.UPC));
devUPnP.setLocation("/gen-desc.xml");
addServices("", devUPnP, sr);
addDevices("", devUPnP, sr);
devUPnP.setPresentationURL((String) sr.getProperty(UPnPDevice.PRESENTATION_URL));
return devUPnP;
}
use of org.cybergarage.upnp.xml.DeviceData in project i2p.i2p by i2p.
the class Device method getDeviceData.
// //////////////////////////////////////////////
// UserData
// //////////////////////////////////////////////
private DeviceData getDeviceData() {
Node node = getDeviceNode();
DeviceData userData = (DeviceData) node.getUserData();
if (userData == null) {
userData = new DeviceData();
node.setUserData(userData);
userData.setNode(node);
}
return userData;
}
Aggregations