本文整理汇总了Java中org.onosproject.ospf.controller.LinkInformation类的典型用法代码示例。如果您正苦于以下问题:Java LinkInformation类的具体用法?Java LinkInformation怎么用?Java LinkInformation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LinkInformation类属于org.onosproject.ospf.controller包,在下文中一共展示了LinkInformation类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLinksToDelete
import org.onosproject.ospf.controller.LinkInformation; //导入依赖的package包/类
private void getLinksToDelete(Set<Ip4Address> list, Ip4Address value, OspfArea ospfArea) {
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
Ip4Address secondValue = (Ip4Address) iterator.next();
if (!value.equals("0.0.0.0")) {
if ((!value.equals(secondValue))) {
if ((!secondValue.equals(ospfArea.routerId()))) {
String key = "link:" + value.toString() + "-" + secondValue.toString();
String key1 = "link:" + secondValue.toString() + "-" + value.toString();
LinkInformation linkDetails = getLinkInformation(key);
LinkInformation linkDetailsOther = getLinkInformation(key1);
linkInformationMapForPointToPoint.put(key, linkDetails);
linkInformationMapForPointToPoint.put(key1, linkDetailsOther);
}
}
}
}
}
示例2: addLocalLink
import org.onosproject.ospf.controller.LinkInformation; //导入依赖的package包/类
/**
* Adds link information to LinkInformationMap.
*
* @param advertisingRouter advertising router
* @param linkData link data address
* @param linkSrc link source address
* @param linkDest link destination address
* @param opaqueEnabled opaque enabled or not
* @param linkSrcIdNotRouterId link source id or not
*/
public void addLocalLink(String advertisingRouter, Ip4Address linkData, Ip4Address linkSrc, Ip4Address linkDest,
boolean opaqueEnabled, boolean linkSrcIdNotRouterId) {
String linkKey = "link:";
LinkInformation linkInformation = new LinkInformationImpl();
linkInformation.setLinkId(advertisingRouter);
linkInformation.setLinkSourceId(linkSrc);
linkInformation.setLinkDestinationId(linkDest);
linkInformation.setAlreadyCreated(false);
linkInformation.setLinkSrcIdNotRouterId(linkSrcIdNotRouterId);
linkInformation.setInterfaceIp(linkData);
if (linkDest != null) {
linkInformation.setLinkSrcIdNotRouterId(false);
}
linkKey = linkKey + "-" + linkSrc + "-" + linkDest;
setLinkInformationMap(linkKey, linkInformation);
}
示例3: addLocalLinkForPointToPoint
import org.onosproject.ospf.controller.LinkInformation; //导入依赖的package包/类
/**
* Adds link information to LinkInformationMap for PointToPoint.
*
* @param advertisingRouter advertising router
* @param linkData link data
* @param linkSrc link source
* @param linkDest link destination
* @param opaqueEnabled whether opaque is enabled or not
* @param linkSrcIdNotRouterId whether link is source id or router id
*/
public void addLocalLinkForPointToPoint(String advertisingRouter, Ip4Address linkData, Ip4Address linkSrc,
Ip4Address linkDest, boolean opaqueEnabled, boolean linkSrcIdNotRouterId) {
String linkKey = "link:";
LinkInformation linkInformation = new LinkInformationImpl();
linkInformation.setLinkId(advertisingRouter);
linkInformation.setLinkSourceId(linkSrc);
linkInformation.setLinkDestinationId(linkDest);
linkInformation.setAlreadyCreated(false);
linkInformation.setLinkSrcIdNotRouterId(linkSrcIdNotRouterId);
linkInformation.setInterfaceIp(linkData);
if (linkDest != null) {
linkInformation.setLinkSrcIdNotRouterId(false);
}
linkKey = linkKey + "-" + linkSrc + "-" + linkDest;
setLinkInformationMapForPointToPoint(linkKey, linkInformation);
}
示例4: removeLinks
import org.onosproject.ospf.controller.LinkInformation; //导入依赖的package包/类
/**
* Removes links from LinkInformationMap.
*
* @param routerId router id
*/
public void removeLinks(Ip4Address routerId) {
Map<String, LinkInformation> linkInformationMapLocal = linkInformationMap;
if (linkInformationMapLocal != null) {
for (Map.Entry<String, LinkInformation> entry : linkInformationMap.entrySet()) {
String key = entry.getKey();
boolean check = key.contains(routerId.toString());
LinkInformation linkInformation = linkInformationMap.get(key);
boolean check1 = (linkInformation.linkDestinationId() == routerId) ? true : false;
if (check || check1) {
toRemove.add(key);
}
}
removeLinkFromMap();
}
}
示例5: getLinksToDelete
import org.onosproject.ospf.controller.LinkInformation; //导入依赖的package包/类
private void getLinksToDelete(Set<Ip4Address> list, Ip4Address value, OspfArea ospfArea) {
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
Ip4Address secondValue = (Ip4Address) iterator.next();
if (!value.toString().equals("0.0.0.0")) {
if ((!value.equals(secondValue))) {
if ((!secondValue.equals(ospfArea.routerId()))) {
String key = "link:" + value.toString() + "-" + secondValue.toString();
String key1 = "link:" + secondValue.toString() + "-" + value.toString();
LinkInformation linkDetails = getLinkInformation(key);
LinkInformation linkDetailsOther = getLinkInformation(key1);
linkInformationMapForPointToPoint.put(key, linkDetails);
linkInformationMapForPointToPoint.put(key1, linkDetailsOther);
}
}
}
}
}
示例6: getLinkInformation
import org.onosproject.ospf.controller.LinkInformation; //导入依赖的package包/类
private LinkInformation getLinkInformation(String key) {
LinkInformation linkInformation = this.linkInformationMap.get(key);
return linkInformation;
}
示例7: linkInformationMap
import org.onosproject.ospf.controller.LinkInformation; //导入依赖的package包/类
/**
* Gets link information as map.
*
* @return link information as map
*/
public Map<String, LinkInformation> linkInformationMap() {
return linkInformationMap;
}
示例8: setLinkInformationMap
import org.onosproject.ospf.controller.LinkInformation; //导入依赖的package包/类
/**
* Sets link information in map.
*
* @param key key used to add in map
* @param linkInformationMap link information instance
*/
public void setLinkInformationMap(String key, LinkInformation linkInformationMap) {
if (!this.linkInformationMap.containsKey(key)) {
this.linkInformationMap.put(key, linkInformationMap);
}
}
示例9: linkInformationMapForPointToPoint
import org.onosproject.ospf.controller.LinkInformation; //导入依赖的package包/类
/**
* Gets linkInformation as map for PointToPoint.
*
* @return linkInformationMap
*/
public Map<String, LinkInformation> linkInformationMapForPointToPoint() {
return linkInformationMap;
}
示例10: setLinkInformationMapForPointToPoint
import org.onosproject.ospf.controller.LinkInformation; //导入依赖的package包/类
/**
* Sets linkInformation as map for PointToPoint.
*
* @param key key to store link information
* @param linkInformationMap link information instance
*/
public void setLinkInformationMapForPointToPoint(String key, LinkInformation linkInformationMap) {
if (!this.linkInformationMap.containsKey(key)) {
this.linkInformationMap.put(key, linkInformationMap);
}
}