本文整理汇总了Java中com.owera.xapsws.ParameterList类的典型用法代码示例。如果您正苦于以下问题:Java ParameterList类的具体用法?Java ParameterList怎么用?Java ParameterList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParameterList类属于com.owera.xapsws包,在下文中一共展示了ParameterList类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: convert
import com.owera.xapsws.ParameterList; //导入依赖的package包/类
public static Unittype convert(com.owera.xaps.dbi.Unittype ut) {
if (ut == null)
return null;
String name = ut.getName();
// String matcherId = ut.getMatcherId();
String vendor = ut.getVendor();
String description = ut.getDescription();
String protocol = ut.getProtocol().toString();
UnittypeParameter[] utParams = ut.getUnittypeParameters().getUnittypeParameters();
Parameter[] parameterArray = new Parameter[utParams.length];
int i = 0;
for (UnittypeParameter utp : utParams) {
Parameter p = new Parameter(utp.getName(), utp.getFlag().getFlag(), null);
parameterArray[i++] = p;
}
ParameterList parameters = new ParameterList(parameterArray);
return new Unittype(name, null, vendor, description, protocol, parameters);
}
示例2: main
import com.owera.xapsws.ParameterList; //导入依赖的package包/类
public static void main(String[] args) {
try {
XAPSWSProxy tp = new XAPSWSProxy();
// Choose 1 out of 2 options:
// Send traffic to redirect-URL - the Web Service Server will log XML to file
tp.setEndpoint("http://localhost/xapsws/redirect");
// Send traffic directly to Web Service Server:
// tp.setEndpoint("http://localhost/xapsws/services/xAPSWS");
// Populate data on unit, profile and unittype, add two parameters to set on the unit
Unit unit = new Unit();
unit.setSerialNumber("012345678902");
Profile p = new Profile();
p.setName("Default");
Unittype ut = new Unittype();
ut.setName("NPA201E");
Parameter[] parameterArr = new Parameter[2];
parameterArr[0] = new Parameter("InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.Line.1.SIP.AuthPassword", "freyrsSipPassword", null);
parameterArr[1] = new Parameter("InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.Line.1.SIP.AuthUserName", "freyrsSipUsername", "AC");
ParameterList parameters = new ParameterList(parameterArr);
unit.setParameters(parameters);
unit.setProfile(p);
unit.setUnittype(ut);
// Populate login object
Login login = new Login("user", "pass");
// Perform login and service
AddOrChangeUnitRequest auReq = new AddOrChangeUnitRequest(login, unit);
// Response received
AddOrChangeUnitResponse auRes = tp.addOrChangeUnit(auReq);
// Dump some data to sysout, loop through parameter list of unit
System.out.println("UnitId: " + auRes.getUnit().getUnitId());
ParameterList parameterList = auRes.getUnit().getParameters();
if (parameterList != null && parameterList.getParameterArray() != null) {
int counter = 0;
for (Parameter param : parameterList.getParameterArray()) {
System.out.println("Parameter-" + counter + ": " + param.getName() + " = " + param.getValue() + " (" + param.getFlags() + ")");
counter++;
}
}
} catch (Throwable t) {
System.err.println("Throwable: " + t);
t.printStackTrace();
}
}
示例3: main
import com.owera.xapsws.ParameterList; //导入依赖的package包/类
public static void main(String[] args) {
try {
XAPSWSProxy tp = new XAPSWSProxy();
// tp.setEndpoint("http://pingcom.xaps-hosting.net/xapsws/services/xAPSWS");
tp.setEndpoint("http://pingcom.xaps-hosting.net/xapsws/redirect");
// tp.setEndpoint("http://xaps-a.owera.com/xapsws/services/xAPSWS");
Unit unit = new Unit();
// Unittype ut = new Unittype();
// ut.setName("NPA201E-Cellip");
// Profile p = new Profile();
// p.setName("Default");
// unit.setUnitId("AB");
// unit.setSerialNumber("0021%");
unit.setUnitId("002194-NPA201E-00219401CE2E");
// unit.setSerialNumber("%");
// Parameter[] parameterArr = new Parameter[1];
// parameterArr[0] = new Parameter("System.X_OWERA-COM.Device.MAC", "012345678901", "EQ");
// parameterArr[1] = new Parameter("System.X_TEST_OWERA-COM.Place", "Stavanger", "E");
// ParameterList parameters = new ParameterList(parameterArr);
// unit.setParameters(parameters);
// unit.setUnittype(ut);
// unit.setProfile(p);
// Login login = new Login("teamf1", "teamf1123");
Login login = new Login("cellip", "cellip123");
GetUnitsRequest auReq = new GetUnitsRequest(login, unit);
GetUnitsResponse auRes = tp.getUnits(auReq);
System.out.println("More units: " + auRes.isMoreUnits());
if (auRes.getUnits() != null && auRes.getUnits().getUnitArray() != null) {
int unitCounter = 0;
for (Unit u : auRes.getUnits().getUnitArray()) {
System.out.println(unitCounter + " UnitId: " + u.getUnitId());
ParameterList parameterList = u.getParameters();
if (parameterList != null && parameterList.getParameterArray() != null) {
int counter = 0;
for (Parameter param : parameterList.getParameterArray()) {
System.out.println(unitCounter + " Parameter-" + counter + ": " + param.getName() + " = " + param.getValue() + " (" + param.getFlags() + ")");
counter++;
}
}
unitCounter++;
}
}
} catch (Throwable t) {
System.err.println("Throwable: " + t);
}
}