当前位置: 首页>>代码示例>>Java>>正文


Java Reply.getContain方法代码示例

本文整理汇总了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);
		}
	}
 
开发者ID:dana-i2cat,项目名称:opennaas-routing-nfv,代码行数:37,代码来源:GetOSPFConfigAction.java

示例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);

	}
}
 
开发者ID:dana-i2cat,项目名称:opennaas-routing-nfv,代码行数:34,代码来源:GetTunnelConfigurationAction.java

示例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);
	}

}
 
开发者ID:dana-i2cat,项目名称:opennaas-routing-nfv,代码行数:30,代码来源:ListLogicalRoutersAction.java

示例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);
	}
}
 
开发者ID:dana-i2cat,项目名称:opennaas-routing-nfv,代码行数:38,代码来源:GetConfigurationAction.java

示例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);
}
 
开发者ID:dana-i2cat,项目名称:opennaas-routing-nfv,代码行数:36,代码来源:PrepareCommitRollbackTest.java


注:本文中的net.i2cat.netconf.rpc.Reply.getContain方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。