當前位置: 首頁>>代碼示例>>Java>>正文


Java DeviceInformation.setAlreadyCreated方法代碼示例

本文整理匯總了Java中org.onosproject.ospf.controller.DeviceInformation.setAlreadyCreated方法的典型用法代碼示例。如果您正苦於以下問題:Java DeviceInformation.setAlreadyCreated方法的具體用法?Java DeviceInformation.setAlreadyCreated怎麽用?Java DeviceInformation.setAlreadyCreated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.onosproject.ospf.controller.DeviceInformation的用法示例。


在下文中一共展示了DeviceInformation.setAlreadyCreated方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDeviceInformation

import org.onosproject.ospf.controller.DeviceInformation; //導入方法依賴的package包/類
/**
 * Creates device object from parameters.
 *
 * @param alreadyCreated device already created or not
 * @param deviceId       device id
 * @param neighborId     neighbor's id
 * @param routerId       router's id
 * @param interfaceId    interface id
 * @param areaId         area id
 * @param isDr           true if router is DR else false
 */
private DeviceInformation createDeviceInformation(boolean alreadyCreated, Ip4Address deviceId,
                                                  Ip4Address neighborId, Ip4Address routerId,
                                                  Ip4Address interfaceId, Ip4Address areaId,
                                                  boolean isDr) {
    DeviceInformation deviceInformation = new DeviceInformationImpl();
    deviceInformation.setAlreadyCreated(alreadyCreated);
    deviceInformation.setDeviceId(deviceId);
    deviceInformation.setNeighborId(neighborId);
    deviceInformation.setRouterId(routerId);
    deviceInformation.addInterfaceId(interfaceId);
    deviceInformation.setAreaId(areaId);
    deviceInformation.setDr(isDr);
    return deviceInformation;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:26,代碼來源:TopologyForDeviceAndLinkImpl.java

示例2: createDeviceAndLinkFromNetworkLsa

import org.onosproject.ospf.controller.DeviceInformation; //導入方法依賴的package包/類
/**
 * Creates device and link instance from the network LSA parameters.
 *
 * @param ospfLsa  OSPF LSA instance
 * @param ospfArea OSPF area instance
 */
private void createDeviceAndLinkFromNetworkLsa(OspfLsa ospfLsa, OspfArea ospfArea) {
    NetworkLsa networkLsa = (NetworkLsa) ospfLsa;
    Ip4Address linkStateId = Ip4Address.valueOf(networkLsa.linkStateId());
    Set<Ip4Address> drList = networkLsaMap.keySet();
    try {
        Ip4Address drToReplace = null;
        for (Ip4Address drIp : drList) {
            if (!drIp.equals(linkStateId)) {
                if (OspfUtil.sameNetwork(drIp, linkStateId, networkLsa.networkMask())) {
                    drToReplace = drIp;
                    String key = "device:" + drToReplace;
                    DeviceInformation deleteDr = deviceInformation(key);
                    if (deleteDr != null) {
                        deleteDr.setAlreadyCreated(true);
                        setDeviceInformationMapToDelete(key, deleteDr);
                    }

                    networkLsaMap.remove(drToReplace);
                    break;
                }
            }
        }
        networkLsaMap.put(linkStateId, networkLsa.attachedRouters());

    } catch (Exception e) {
        log.debug("Error::TopologyForDeviceAndLinkImpl:: {}", e.getMessage());
    }
    constructDeviceForBroadCastTopology(ospfArea);
    disp();

}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:38,代碼來源:TopologyForDeviceAndLinkImpl.java


注:本文中的org.onosproject.ospf.controller.DeviceInformation.setAlreadyCreated方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。