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


Java OspfController类代码示例

本文整理汇总了Java中org.onosproject.ospf.controller.OspfController的典型用法代码示例。如果您正苦于以下问题:Java OspfController类的具体用法?Java OspfController怎么用?Java OspfController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OspfController类属于org.onosproject.ospf.controller包,在下文中一共展示了OspfController类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildLsaLists

import org.onosproject.ospf.controller.OspfController; //导入依赖的package包/类
/**
 * Builds all LSA lists with LSA details.
 */
private void buildLsaLists() {
    this.ospfController = get(OspfController.class);
    List<OspfProcess> listOfProcess = ospfController.getAllConfiguredProcesses();
    Iterator<OspfProcess> itrProcess = listOfProcess.iterator();
    while (itrProcess.hasNext()) {
        OspfProcess ospfProcess = itrProcess.next();
        if (process.equalsIgnoreCase(ospfProcess.processId())) {
            List<OspfArea> listAreas = ospfProcess.areas();
            Iterator<OspfArea> itrArea = listAreas.iterator();
            while (itrArea.hasNext()) {
                OspfArea area = itrArea.next();
                List<LsaHeader> lsas = area.database()
                        .getAllLsaHeaders(false, area.isOpaqueEnabled());
                List<LsaHeader> tmpLsaList = new ArrayList<>(lsas);
                log.debug("OSPFController::size of database::" + (lsas != null ? lsas.size() : null));
                Iterator<LsaHeader> itrLsaHeader = tmpLsaList.iterator();
                areaList.add(area);
                if (itrLsaHeader != null) {
                    while (itrLsaHeader.hasNext()) {
                        LsaHeader header = itrLsaHeader.next();
                        populateLsaLists(header, area);
                    }
                }
            }
        }
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:31,代码来源:ApplicationOspfCommand.java

示例2: buildNeighborInformation

import org.onosproject.ospf.controller.OspfController; //导入依赖的package包/类
/**
 * Builds OSPF neighbor information.
 */
private void buildNeighborInformation() {
    try {
        this.ospfController = get(OspfController.class);
        List<OspfProcess> listOfProcess = ospfController.getAllConfiguredProcesses();
        boolean flag = false;
        printNeighborsFormat();
        Iterator<OspfProcess> itrProcess = listOfProcess.iterator();
        while (itrProcess.hasNext()) {
            OspfProcess process = itrProcess.next();
            List<OspfArea> listAreas = process.areas();
            Iterator<OspfArea> itrArea = listAreas.iterator();
            while (itrArea.hasNext()) {
                OspfArea area = itrArea.next();
                List<OspfInterface> itrefaceList = area.ospfInterfaceList();
                for (OspfInterface interfc : itrefaceList) {
                    List<OspfNbr> nghbrList = new ArrayList<>(interfc.listOfNeighbors().values());
                    for (OspfNbr neigbor : nghbrList) {
                        print("%-20s%-20s%-20s%-20s%-20s\n", neigbor.neighborId(), neigbor.routerPriority(),
                              neigbor.getState() + "/" + checkDrBdrOther(neigbor.neighborIpAddr().toString(),
                                                                         neigbor.neighborDr().toString(),
                                                                         neigbor.neighborBdr().toString()),
                              neigbor.neighborIpAddr().toString(), interfc.ipAddress());
                    }
                }
            }
        }
    } catch (Exception ex) {
        print("Error occured while Ospf controller getting called" + ex.getMessage());
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:34,代码来源:ApplicationOspfCommand.java

示例3: isValid

import org.onosproject.ospf.controller.OspfController; //导入依赖的package包/类
@Override
public boolean isValid() {
    this.ospfController = DefaultServiceDirectory.getService(OspfController.class);

    return true;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:7,代码来源:OspfAppConfig.java

示例4: setOspfController

import org.onosproject.ospf.controller.OspfController; //导入依赖的package包/类
public void setOspfController(OspfController ospfController) {
    this.ospfController = ospfController;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:4,代码来源:OspfCfgProvider.java


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