public void setNameSpace(String ns, String value) { setAttribute("xmlns:" + ns, value); }
public void setAttribute(String name, int value) { setAttribute(name, Integer.toString(value)); }
public void setSendEvents(boolean state) { getStateVariableNode().setAttribute(SENDEVENTS, (state == true) ? SENDEVENTS_YES : SENDEVENTS_NO); }
public final static Node createEnvelopeBodyNode() { // <Envelope> Node envNode = new Node(SOAP.XMLNS + SOAP.DELIM + SOAP.ENVELOPE); envNode.setAttribute("xmlns" + SOAP.DELIM + SOAP.XMLNS, SOAP.XMLNS_URL); envNode.setAttribute(SOAP.XMLNS + SOAP.DELIM + "encodingStyle", SOAP.ENCSTYLE_URL); // <Body> Node bodyNode = new Node(SOAP.XMLNS + SOAP.DELIM + SOAP.BODY); envNode.addNode(bodyNode); return envNode; }
public void updateConfigId() { Node scpdNode = getSCPDNode(); if (scpdNode == null) return; String scpdXml = scpdNode.toString(); int configId = UPnP.caluculateConfigId(scpdXml); scpdNode.setAttribute(CONFIG_ID, configId); }
String attrName = attr.getNodeName(); String attrValue = attr.getNodeValue(); node.setAttribute(attrName, attrValue);
public void setNameSpace(String ns, String value) { setAttribute("xmlns:" + ns, value); }
public void setNameSpace(String ns, String value) { setAttribute("xmlns:" + ns, value); }
public void setAttribute(String name, int value) { setAttribute(name, Integer.toString(value)); }
private void updateConfigId(Device dev) { int configId = 0; DeviceList cdevList = dev.getDeviceList(); int cdevCnt = cdevList.size(); for (int n = 0; n < cdevCnt; n++) { Device cdev = cdevList.getDevice(n); updateConfigId(cdev); configId += cdev.getConfigId(); configId &= UPnP.CONFIGID_UPNP_ORG_MAX; } ServiceList serviceList = dev.getServiceList(); int serviceCnt = serviceList.size(); for (int n = 0; n < serviceCnt; n++) { Service service = serviceList.getService(n); service.updateConfigId(); configId += service.getConfigId(); configId &= UPnP.CONFIGID_UPNP_ORG_MAX; } Node devNode = getDeviceNode(); if (devNode == null) return; String devDescXml = devNode.toString(); configId += UPnP.caluculateConfigId(devDescXml); configId &= UPnP.CONFIGID_UPNP_ORG_MAX; devNode.setAttribute(CONFIG_ID, configId); }
private Node createResponseNode(Action action) { String actionName = action.getName(); Node actionNameResNode = new Node(SOAP.METHODNS + SOAP.DELIM + actionName + SOAP.RESPONSE); Service service = action.getService(); if (service != null) { actionNameResNode.setAttribute( "xmlns:" + SOAP.METHODNS, service.getServiceType()); } ArgumentList argList = action.getArgumentList(); int nArgs = argList.size(); for (int n=0; n<nArgs; n++) { Argument arg = argList.getArgument(n); if (arg.isOutDirection() == false) continue; Node argNode = new Node(); argNode.setName(arg.getName()); argNode.setValue(arg.getValue()); actionNameResNode.addNode(argNode); } return actionNameResNode; }
public void setSendEvents(boolean state) { getStateVariableNode().setAttribute(SENDEVENTS, (state == true) ? SENDEVENTS_YES : SENDEVENTS_NO); }
public void setSendEvents(boolean state) { getStateVariableNode().setAttribute(SENDEVENTS, (state == true) ? SENDEVENTS_YES : SENDEVENTS_NO); }
upnpErrorNode.setAttribute("xmlns", Control.XMLNS); detailNode.addNode(upnpErrorNode);
public final static Node createEnvelopeBodyNode() { // <Envelope> Node envNode = new Node(SOAP.XMLNS + SOAP.DELIM + SOAP.ENVELOPE); envNode.setAttribute("xmlns" + SOAP.DELIM + SOAP.XMLNS, SOAP.XMLNS_URL); envNode.setAttribute(SOAP.XMLNS + SOAP.DELIM + "encodingStyle", SOAP.ENCSTYLE_URL); // <Body> Node bodyNode = new Node(SOAP.XMLNS + SOAP.DELIM + SOAP.BODY); envNode.addNode(bodyNode); return envNode; }
public final static Node createEnvelopeBodyNode() { // <Envelope> Node envNode = new Node(SOAP.XMLNS + SOAP.DELIM + SOAP.ENVELOPE); envNode.setAttribute("xmlns" + SOAP.DELIM + SOAP.XMLNS, SOAP.XMLNS_URL); envNode.setAttribute(SOAP.XMLNS + SOAP.DELIM + "encodingStyle", SOAP.ENCSTYLE_URL); // <Body> Node bodyNode = new Node(SOAP.XMLNS + SOAP.DELIM + SOAP.BODY); envNode.addNode(bodyNode); return envNode; }
public void updateConfigId() { Node scpdNode = getSCPDNode(); if (scpdNode == null) return; String scpdXml = scpdNode.toString(); int configId = UPnP.caluculateConfigId(scpdXml); scpdNode.setAttribute(CONFIG_ID, configId); }
public void updateConfigId() { Node scpdNode = getSCPDNode(); if (scpdNode == null) return; String scpdXml = scpdNode.toString(); int configId = UPnP.caluculateConfigId(scpdXml); scpdNode.setAttribute(CONFIG_ID, configId); }
private static Node buildRootNode(){ Node root = new Node(RootDescription.ROOT_ELEMENT); root.setAttribute("xmlns",RootDescription.ROOT_ELEMENT_NAMESPACE); Node spec = new Node(RootDescription.SPECVERSION_ELEMENT); Node maj =new Node(RootDescription.MAJOR_ELEMENT); maj.setValue("1"); Node min =new Node(RootDescription.MINOR_ELEMENT); min.setValue("0"); spec.addNode(maj); spec.addNode(min); root.addNode(spec); return root; }
private static Node buildRootNode(){ Node root = new Node(RootDescription.ROOT_ELEMENT); root.setAttribute("xmlns",RootDescription.ROOT_ELEMENT_NAMESPACE); Node spec = new Node(RootDescription.SPECVERSION_ELEMENT); Node maj =new Node(RootDescription.MAJOR_ELEMENT); maj.setValue("1"); Node min =new Node(RootDescription.MINOR_ELEMENT); min.setValue("0"); spec.addNode(maj); spec.addNode(min); root.addNode(spec); return root; }