use of org.cybergarage.xml.Node in project i2p.i2p by i2p.
the class Device method setNMPRMode.
// //////////////////////////////////////////////
// NMPR
// //////////////////////////////////////////////
public void setNMPRMode(boolean flag) {
Node devNode = getDeviceNode();
if (devNode == null)
return;
if (flag == true) {
devNode.setNode(UPnP.INMPR03, UPnP.INMPR03_VERSION);
devNode.removeNode(Device.URLBASE_NAME);
} else {
devNode.removeNode(UPnP.INMPR03);
}
}
use of org.cybergarage.xml.Node in project i2p.i2p by i2p.
the class Service method addAction.
public void addAction(Action a) {
Iterator<Argument> i = a.getArgumentList().iterator();
while (i.hasNext()) {
Argument arg = i.next();
arg.setService(this);
}
Node scdpNode = getSCPDNode();
Node actionListNode = scdpNode.getNode(ActionList.ELEM_NAME);
if (actionListNode == null) {
actionListNode = new Node(ActionList.ELEM_NAME);
scdpNode.addNode(actionListNode);
}
actionListNode.addNode(a.getActionNode());
}
use of org.cybergarage.xml.Node in project i2p.i2p by i2p.
the class Service method getSCPDData.
public byte[] getSCPDData() {
Node scpdNode = getSCPDNode();
if (scpdNode == null)
return new byte[0];
// Thanks for Mikael Hakman (04/25/05)
String desc = new String();
desc += UPnP.XML_DECLARATION;
desc += "\n";
desc += scpdNode.toString();
return desc.getBytes();
}
use of org.cybergarage.xml.Node in project i2p.i2p by i2p.
the class Service method getSCPDNode.
private Node getSCPDNode() {
ServiceData data = getServiceData();
Node scpdNode = data.getSCPDNode();
if (scpdNode != null)
return scpdNode;
// Thanks for Jaap (Sep 18, 2010)
Device rootDev = getRootDevice();
if (rootDev == null)
return null;
String scpdURLStr = getSCPDURL();
try {
URL scpdUrl = new URL(rootDev.getAbsoluteURL(scpdURLStr));
scpdNode = getSCPDNode(scpdUrl);
if (scpdNode != null) {
data.setSCPDNode(scpdNode);
return scpdNode;
}
} catch (Exception e) {
// I2P
Debug.warning(e);
}
return null;
}
use of org.cybergarage.xml.Node in project i2p.i2p by i2p.
the class Service method getActionList.
// //////////////////////////////////////////////
// actionList
// //////////////////////////////////////////////
public ActionList getActionList() {
ActionList actionList = new ActionList();
Node scdpNode = getSCPDNode();
if (scdpNode == null)
return actionList;
Node actionListNode = scdpNode.getNode(ActionList.ELEM_NAME);
if (actionListNode == null)
return actionList;
int nNode = actionListNode.getNNodes();
for (int n = 0; n < nNode; n++) {
Node node = actionListNode.getNode(n);
if (Action.isActionNode(node) == false)
continue;
Action action = new Action(serviceNode, node);
actionList.add(action);
}
return actionList;
}
Aggregations