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


Java OspfProcessImpl类代码示例

本文整理汇总了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()));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:ControllerTest.java

示例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);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:OspfInterfaceChannelHandlerTest.java

示例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;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:39,代码来源:OspfConfigUtil.java

示例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<>();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:29,代码来源:ControllerTest.java

示例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()));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:31,代码来源:OspfControllerImplTest.java


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