本文整理汇总了Java中org.onosproject.ospf.controller.area.OspfProcessImpl类的典型用法代码示例。如果您正苦于以下问题:Java OspfProcessImpl类的具体用法?Java OspfProcessImpl怎么用?Java OspfProcessImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OspfProcessImpl类属于org.onosproject.ospf.controller.area包,在下文中一共展示了OspfProcessImpl类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testUpdateConfig1
import org.onosproject.ospf.controller.area.OspfProcessImpl; //导入依赖的package包/类
/**
* Tests updateConfig() method.
*/
@Test
public void testUpdateConfig1() throws Exception {
ospfProcess = new OspfProcessImpl();
ospfArea = new OspfAreaImpl();
ospfInterface = new OspfInterfaceImpl();
ospfInterfaces = new ArrayList();
ospfInterface.setIpAddress(Ip4Address.valueOf("10.10.10.5"));
ospfInterfaces.add(ospfInterface);
ospfArea.setAreaId(Ip4Address.valueOf("2.2.2.2"));
ospfArea.setOspfInterfaceList(ospfInterfaces);
ospfProcess.setProcessId("10.10.10.10");
ospfAreas = new ArrayList();
ospfAreas.add(ospfArea);
ospfProcess.setAreas(ospfAreas);
ospfProcesses = new ArrayList();
ospfProcesses.add(ospfProcess);
controller.updateConfig(ospfProcesses);
assertThat(controller, is(notNullValue()));
}
示例2: setUp
import org.onosproject.ospf.controller.area.OspfProcessImpl; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
ospfProcess = new OspfProcessImpl();
ospfArea = createOspfArea();
ospfAreas.add(ospfArea);
ospfProcess.setAreas(ospfAreas);
ospfProcesses.add(ospfProcess);
controller = new Controller();
topologyForDeviceAndLink = new TopologyForDeviceAndLinkImpl();
ospfNbr = new OspfNbrImpl(ospfArea, ospfInterface, ip4Address1,
ip4Address2, 2, topologyForDeviceAndLink);
ospfNbr.setNeighborId(ip4Address1);
ospfNbr.setRouterPriority(0);
ospfNbr.setNeighborDr(ip4Address3);
ospfInterface.addNeighbouringRouter(ospfNbr);
ospfInterfaceChannelHandler = new OspfInterfaceChannelHandler(controller, ospfProcesses);
}
示例3: processes
import org.onosproject.ospf.controller.area.OspfProcessImpl; //导入依赖的package包/类
/**
* Returns list of OSPF process from the json nodes.
*
* @param jsonNodes represents one or more OSPF process configuration
* @return list of OSPF processes.
*/
public static List<OspfProcess> processes(JsonNode jsonNodes) {
List<OspfProcess> ospfProcesses = new ArrayList<>();
if (jsonNodes == null) {
return ospfProcesses;
}
//From each Process nodes, get area and related interface details.
jsonNodes.forEach(jsonNode -> {
List<OspfArea> areas = new ArrayList<>();
//Get configured areas for the process.
for (JsonNode areaNode : jsonNode.path(AREAS)) {
List<OspfInterface> interfaceList = new ArrayList<>();
for (JsonNode interfaceNode : areaNode.path(INTERFACE)) {
OspfInterface ospfInterface = interfaceDetails(interfaceNode);
if (ospfInterface != null) {
interfaceList.add(ospfInterface);
}
}
//Get the area details
OspfArea area = areaDetails(areaNode);
if (area != null) {
area.setOspfInterfaceList(interfaceList);
areas.add(area);
}
}
OspfProcess process = new OspfProcessImpl();
process.setProcessId(jsonNode.path(PROCESSID).asText());
process.setAreas(areas);
ospfProcesses.add(process);
});
return ospfProcesses;
}
示例4: setUp
import org.onosproject.ospf.controller.area.OspfProcessImpl; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
controller = new Controller();
maps = new HashMap<String, Long>();
ospfProcess = new OspfProcessImpl();
ospfArea = new OspfAreaImpl();
ospfInterface = new OspfInterfaceImpl();
ospfInterfaces = new ArrayList();
ospfInterface.setIpAddress(Ip4Address.valueOf("1.1.1.1"));
ospfInterfaces.add(ospfInterface);
ospfArea.setAreaId(Ip4Address.valueOf("2.2.2.2"));
ospfArea.setOspfInterfaceList(ospfInterfaces);
ospfProcess.setProcessId("10.10.10.10");
ospfAreas = new ArrayList();
ospfAreas.add(ospfArea);
ospfProcess.setAreas(ospfAreas);
ospfProcesses = new ArrayList();
ospfProcesses.add(ospfProcess);
ospfProcess1 = new OspfProcessImpl();
ospfProcess1.setProcessId("11.11.11.11");
ospfArea1 = new OspfAreaImpl();
ospfArea1.setAreaId(Ip4Address.valueOf("2.2.2.2"));
ospfArea1.setOspfInterfaceList(ospfInterfaces);
ospfAreas.add(ospfArea1);
ospfProcess1.setAreas(ospfAreas);
ospfProcesses.add(ospfProcess1);
connectedChannels = new ArrayList<>();
}
示例5: testDeleteConfig
import org.onosproject.ospf.controller.area.OspfProcessImpl; //导入依赖的package包/类
/**
* Tests deleteConfig() method.
*/
@Test
public void testDeleteConfig() throws Exception {
ospfProcess = new OspfProcessImpl();
ospfArea = new OspfAreaImpl();
ospfInterface = new OspfInterfaceImpl();
ospfInterfaces = new ArrayList();
ospfInterface.setIpAddress(Ip4Address.valueOf("10.10.10.5"));
ospfInterfaces.add(ospfInterface);
ospfArea.setAreaId(Ip4Address.valueOf("2.2.2.2"));
ospfArea.setOspfInterfaceList(ospfInterfaces);
ospfProcess.setProcessId("10.10.10.10");
areas = new ArrayList();
areas.add(ospfArea);
ospfProcess.setAreas(areas);
ospfProcesses = new ArrayList();
ospfProcesses.add(ospfProcess);
process1 = new OspfProcessImpl();
process1.setProcessId("11.11.11.11");
ospfArea1 = new OspfAreaImpl();
ospfArea1.setAreaId(Ip4Address.valueOf("2.2.2.2"));
ospfArea1.setOspfInterfaceList(ospfInterfaces);
areas.add(ospfArea1);
process1.setAreas(areas);
ospfProcesses.add(process1);
ospfController.deleteConfig(ospfProcesses, "INTERFACE");
assertThat(ospfController, is(notNullValue()));
}