本文整理汇总了Java中net.i2cat.netconf.rpc.Reply.getContain方法的典型用法代码示例。如果您正苦于以下问题:Java Reply.getContain方法的具体用法?Java Reply.getContain怎么用?Java Reply.getContain使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.i2cat.netconf.rpc.Reply
的用法示例。
在下文中一共展示了Reply.getContain方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseResponse
import net.i2cat.netconf.rpc.Reply; //导入方法依赖的package包/类
public void parseResponse(Object responseMessage, Object model) throws ActionException {
// FIXME This "if" is important because it resets the model if we want to update it
if (this.modelToUpdate == null)
this.modelToUpdate = new ComputerSystem();
String message;
try {
System routerModel = (System) model;
/* getting interface information */
if (responseMessage instanceof Reply) {
Reply rpcReply = (Reply) responseMessage;
message = rpcReply.getContain();
} else {
throw new CommandException("Error parsing response: the response is not a Reply message");
}
if (message != null) {
/* Parse interface info */
routerModel = parseInterfaces(routerModel, message);
/* Parse protocols info */
// Protocols parsing should be done before parsing routing-options:
// Protocol parser creates classes in the model that require being updated by routing-options parser.
// That's the case of RouteCalculationServices which routerID is set by RoutingOptionsParser
routerModel = parseProtocols(routerModel, message);
/* Parse routing options info */
routerModel = parseRoutingOptions(routerModel, message);
}
} catch (Exception e) {
throw new ActionException(e);
}
}
示例2: parseResponse
import net.i2cat.netconf.rpc.Reply; //导入方法依赖的package包/类
@Override
public void parseResponse(Object responseMessage, Object model) throws ActionException {
if (this.modelToUpdate == null)
this.modelToUpdate = new ComputerSystem();
String message;
try {
System routerModel = (System) model;
/* getting interface information */
if (responseMessage instanceof Reply) {
Reply rpcReply = (Reply) responseMessage;
message = rpcReply.getContain();
} else {
throw new CommandException("Error parsing response: the response is not a Reply message");
}
routerModel.removeAllremoveManagedSystemElementByType(ComputerSystem.class);
if (message != null) {
routerModel = parseInterface(routerModel, message);
routerModel = FilterInterface(routerModel);
routerModel = parseRoutingOptions(routerModel, message);
}
} catch (Exception e) {
throw new ActionException(e);
}
}
示例3: parseResponse
import net.i2cat.netconf.rpc.Reply; //导入方法依赖的package包/类
public void parseResponse(Object responseMessage, Object model) throws ActionException {
String message;
try {
org.opennaas.extensions.router.model.System routerModel = (org.opennaas.extensions.router.model.System) model;
DigesterEngine listLogicalRoutersParser = new ListLogicalRoutersParser();
// DigesterEngine logicalInterfParser = new IPConfigurationInterfaceParser();
listLogicalRoutersParser.init();
/* getting interface information */
if (responseMessage instanceof Reply) {
Reply rpcReply = (Reply) responseMessage;
message = rpcReply.getContain();
} else {
throw new CommandException("Error parsing response: the response is not a Reply message");
}
listLogicalRoutersParser.configurableParse(new ByteArrayInputStream(message.getBytes()));
for (Object idLogicalRouter : listLogicalRoutersParser.getMapElements().values()) {
ComputerSystem system = new ComputerSystem();
system.setName((String) idLogicalRouter);
routerModel.addSystem(system);
}
} catch (Exception e) {
throw new ActionException(e);
}
}
示例4: parseResponse
import net.i2cat.netconf.rpc.Reply; //导入方法依赖的package包/类
@Override
public void parseResponse(Object responseMessage, Object model) throws ActionException {
/* the model have to be null and we have to initialize */
// FIXME This "if" is important because it resets the model if we want to update it
if (this.modelToUpdate == null)
this.modelToUpdate = new ComputerSystem();
String message;
try {
System routerModel = (System) model;
/* getting interface information */
if (responseMessage instanceof Reply) {
Reply rpcReply = (Reply) responseMessage;
message = rpcReply.getContain();
} else {
throw new CommandException("Error parsing response: the response is not a Reply message");
}
if (message != null) {
/* Parse LR info */
routerModel = parseLRs(routerModel, message);
/* Parse interface info */
routerModel = parseInterfaces(routerModel, message);
/* Parse routing options info */
// Routing options parsing should be done after parsing protocols (protocols is required):
// Protocol parser creates classes in the model that require being updated by routing-options parser.
// That's the case of RouteCalculationServices which routerID is set by RoutingOptionsParser
routerModel = parseRoutingOptions(routerModel, message);
}
} catch (Exception e) {
throw new ActionException(e);
}
}
示例5: testPrepareRestoreAction
import net.i2cat.netconf.rpc.Reply; //导入方法依赖的package包/类
@Test
public void testPrepareRestoreAction() throws Exception {
String uri = System.getProperty("protocol.uri");
if (uri == null || uri.equals("${protocol.uri}")) {
uri = "mock://user:[email protected]:2212/mocksubsystem";
}
String compare = null;
String toCompare = null;
Query query = QueryFactory.newGetConfig("running", "<configuration></configuration>", null);
Reply reply = sendNetconfMessage(query, uri);
compare = reply.getContain();
IAction action = new MockAction();
action.setActionID("mockAction");
queueManagerCapability.queueAction(action);
action = new CorruptedAction();
action.setActionID("corruptedAction");
queueManagerCapability.queueAction(action);
boolean isChecked = false;
try {
queueManagerCapability.execute();
} catch (Exception e) {
if (e instanceof CapabilityException)
isChecked = true;
}
if (!uri.startsWith("mock:"))
Assert.assertTrue(isChecked);
reply = sendNetconfMessage(query, uri);
toCompare = reply.getContain();
Assert.assertEquals(compare, toCompare);
}