本文整理了Java中org.cybergarage.upnp.Action.getOutputArgumentList()
方法的一些代码示例,展示了Action.getOutputArgumentList()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Action.getOutputArgumentList()
方法的具体详情如下:
包路径:org.cybergarage.upnp.Action
类名称:Action
方法名:getOutputArgumentList
暂无
代码示例来源:origin: i2p/i2p.i2p
/**
* @return the external IPv4 address the NAT thinks we have. Blocking.
* null if we can't find it.
*/
private String getNATAddress() {
Service service;
synchronized(lock) {
if(!isNATPresent())
return null;
service = _service;
}
Action getIP = service.getAction("GetExternalIPAddress");
if(getIP == null || !getIP.postControlAction())
return null;
Argument a = getIP.getOutputArgumentList().getArgument("NewExternalIPAddress");
if (a == null)
return null;
String rv = a.getValue();
// I2P some devices return 0.0.0.0 when not connected
if ("0.0.0.0".equals(rv) || rv == null || rv.length() <= 0)
return null;
return rv;
}
代码示例来源:origin: i2p/i2p.i2p
private String toString(String action, String arg, Service serv) {
synchronized(toStringLock) {
if ((!action.equals(_lastAction)) ||
(!serv.equals(_lastService)) ||
_lastArgumentList == null) {
Action getIP = serv.getAction(action);
if(getIP == null || !getIP.postControlAction()) {
_lastAction = null;
return null;
}
_lastAction = action;
_lastService = serv;
_lastArgumentList = getIP.getOutputArgumentList();
}
Argument a = _lastArgumentList.getArgument(arg);
if (a == null)
return "";
String rv = a.getValue();
return DataHelper.escapeHTML(rv);
}
}
代码示例来源:origin: i2p/i2p.i2p
/**
* @return the reported downstream bit rate in bits per second. -1 if it's not available. Blocking.
*/
private int getDownstreamMaxBitRate() {
Service service;
synchronized(lock) {
if(!isNATPresent() || thinksWeAreDoubleNatted)
return -1;
service = _service;
}
Action getIP = service.getAction("GetLinkLayerMaxBitRates");
if(getIP == null || !getIP.postControlAction())
return -1;
Argument a = getIP.getOutputArgumentList().getArgument("NewDownstreamMaxBitRate");
if (a == null)
return -1;
try {
return Integer.parseInt(a.getValue());
} catch (NumberFormatException nfe) {
return -1;
}
}
代码示例来源:origin: i2p/i2p.i2p
/**
* @return the reported upstream bit rate in bits per second. -1 if it's not available. Blocking.
*/
private int getUpstreamMaxBitRate() {
Service service;
synchronized(lock) {
if(!isNATPresent() || thinksWeAreDoubleNatted)
return -1;
service = _service;
}
Action getIP = service.getAction("GetLinkLayerMaxBitRates");
if(getIP == null || !getIP.postControlAction())
return -1;
Argument a = getIP.getOutputArgumentList().getArgument("NewUpstreamMaxBitRate");
if (a == null)
return -1;
try {
return Integer.parseInt(a.getValue());
} catch (NumberFormatException nfe) {
return -1;
}
}
代码示例来源:origin: apache/felix
public String[] getOutputArgumentNames() {
// TODO to check
ArgumentList argsList=act.getOutputArgumentList();
if(argsList.size()==0){
return null;
}
String [] outArgs=new String[argsList.size()];
for(int i=0;i<argsList.size();i++){
outArgs[i]=argsList.getArgument(i).getName();
}
return outArgs;
}
代码示例来源:origin: org.apache.felix/org.apache.felix.upnp.basedriver
public String[] getOutputArgumentNames() {
// TODO to check
ArgumentList argsList=act.getOutputArgumentList();
if(argsList.size()==0){
return null;
}
String [] outArgs=new String[argsList.size()];
for(int i=0;i<argsList.size();i++){
outArgs[i]=argsList.getArgument(i).getName();
}
return outArgs;
}
代码示例来源:origin: cybergarage/cybergarage-upnp
public void powerOn(String deviceType)
{
Device dev = getDevice(deviceType);
if (dev == null)
return;
Action getPowerAct = dev.getAction("GetPower");
if (getPowerAct.postControlAction() == false)
return;
ArgumentList outArgList = getPowerAct.getOutputArgumentList();
String powerState = outArgList.getArgument(0).getValue();
String newPowerState = (powerState.compareTo("1") == 0) ? "0" : "1";
Action setPowerAct = dev.getAction("SetPower");
setPowerAct.setArgumentValue("Power", newPowerState);
setPowerAct.postControlAction();
}
代码示例来源:origin: cybergarage/cybergarage-upnp
boolean ctrlRes = action.postControlAction();
if (ctrlRes == true) {
ArgumentList outArgList = action.getOutputArgumentList();
int nArgs = outArgList.size();
if (nArgs == 0)
代码示例来源:origin: org.apache.felix/org.apache.felix.upnp.basedriver
Properties inArgs = null;
ArgumentList alIn = upnpAct.getInputArgumentList();
ArgumentList alOut = upnpAct.getOutputArgumentList();
String[] inArg = osgiAct.getInputArgumentNames();
boolean invalidAction=false;
代码示例来源:origin: apache/felix
Properties inArgs = null;
ArgumentList alIn = upnpAct.getInputArgumentList();
ArgumentList alOut = upnpAct.getOutputArgumentList();
String[] inArg = osgiAct.getInputArgumentNames();
boolean invalidAction=false;
代码示例来源:origin: org.apache.felix/org.apache.felix.upnp.basedriver
ArgumentList outArgs=act.getOutputArgumentList();
if(outArgs.size()==0){
return null;
代码示例来源:origin: apache/felix
ArgumentList outArgs=act.getOutputArgumentList();
if(outArgs.size()==0){
return null;
内容来源于网络,如有侵权,请联系作者删除!