本文整理匯總了Java中org.onosproject.ospf.controller.DeviceInformation類的典型用法代碼示例。如果您正苦於以下問題:Java DeviceInformation類的具體用法?Java DeviceInformation怎麽用?Java DeviceInformation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DeviceInformation類屬於org.onosproject.ospf.controller包,在下文中一共展示了DeviceInformation類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: constructDeviceForBroadCastTopology
import org.onosproject.ospf.controller.DeviceInformation; //導入依賴的package包/類
private void constructDeviceForBroadCastTopology(OspfArea ospfArea) {
for (Map.Entry<Ip4Address, List<Ip4Address>> entry : networkLsaMap.entrySet()) {
Ip4Address key = entry.getKey();
DeviceInformation deviceInformationForDr = createDeviceInformation(false, key, key, key,
key, ospfArea.areaId(), true);
String dr = "device:" + key;
setDeviceInformationMap(dr, deviceInformationForDr);
List<Ip4Address> value = entry.getValue();
for (Ip4Address connectedRouter : value) {
if (!connectedRouter.equals(ospfArea.routerId())) {
DeviceInformation deviceInformationAttachedRouters =
createDeviceInformation(false, connectedRouter, key, connectedRouter,
key, ospfArea.areaId(), false);
String attachedRouters = "device:" + connectedRouter;
setDeviceInformationMap(attachedRouters, deviceInformationAttachedRouters);
String linkIdKey = "linkId:" + key + "-" + connectedRouter;
addLocalLink(linkIdKey, key, key, connectedRouter, true, false);
}
}
}
}
示例2: setDeviceInformationMap
import org.onosproject.ospf.controller.DeviceInformation; //導入依賴的package包/類
/**
* Sets device information.
*
* @param key key used to add in map
* @param deviceInformationMap device information instance
*/
public void setDeviceInformationMap(String key, DeviceInformation deviceInformationMap) {
if (deviceInformationMap != null) {
this.deviceInformationMap.put(key, deviceInformationMap);
}
}
示例3: setDeviceInformationMapForPointToPoint
import org.onosproject.ospf.controller.DeviceInformation; //導入依賴的package包/類
/**
* Sets deviceInformation as map for Point-To-Point..
*
* @param key key to store device information
* @param deviceInformationMap device information instance
*/
public void setDeviceInformationMapForPointToPoint(String key, DeviceInformation deviceInformationMap) {
if (deviceInformationMap != null) {
this.deviceInformationMapForPointToPoint.put(key, deviceInformationMap);
}
}
示例4: 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;
}
示例5: 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();
}
示例6: testDeviceInformation
import org.onosproject.ospf.controller.DeviceInformation; //導入依賴的package包/類
/**
* Tests deviceInformation() method.
*/
@Test
public void testDeviceInformation() throws Exception {
topologyForDeviceAndLink.setDeviceInformationMap("1.1.1.1", new DeviceInformationImpl());
DeviceInformation deviceInformation = topologyForDeviceAndLink.deviceInformation("1.1.1.1");
assertThat(deviceInformation, is(notNullValue()));
}
示例7: deviceInformationMap
import org.onosproject.ospf.controller.DeviceInformation; //導入依賴的package包/類
/**
* Gets device information.
*
* @return device information
*/
public Map<String, DeviceInformation> deviceInformationMap() {
return deviceInformationMap;
}
示例8: deviceInformationMapForPointToPoint
import org.onosproject.ospf.controller.DeviceInformation; //導入依賴的package包/類
/**
* Gets deviceInformation as map for Point-To-Point.
*
* @return deviceInformationMap
*/
public Map<String, DeviceInformation> deviceInformationMapForPointToPoint() {
return deviceInformationMapForPointToPoint;
}
示例9: deviceInformationMapToDelete
import org.onosproject.ospf.controller.DeviceInformation; //導入依賴的package包/類
/**
* Gets deviceInformation as map.
*
* @return deviceInformationMap to delete from core
*/
public Map<String, DeviceInformation> deviceInformationMapToDelete() {
return deviceInformationMapToDelete;
}
示例10: setDeviceInformationMapToDelete
import org.onosproject.ospf.controller.DeviceInformation; //導入依賴的package包/類
/**
* Sets device information for removal.
*
* @param key ket used to add in map
* @param deviceInformationMapToDelete map from device information to remove
*/
public void setDeviceInformationMapToDelete(String key, DeviceInformation deviceInformationMapToDelete) {
if (deviceInformationMapToDelete != null) {
this.deviceInformationMapToDelete.put(key, deviceInformationMapToDelete);
}
}