use of org.opendaylight.genius.itm.utils.TunnelEndPointInfo in project genius by opendaylight.
the class DpnTepStateCache method getInterfaceFromCache.
public Interface getInterfaceFromCache(String tunnelName) {
TunnelEndPointInfo endPointInfo = getTunnelEndPointInfoFromCache(tunnelName);
BigInteger srcDpnId = new BigInteger(endPointInfo.getSrcEndPointInfo());
BigInteger dstDpnId = new BigInteger(endPointInfo.getDstEndPointInfo());
Interface iface = null;
int monitoringInt = 1000;
DpnTepInterfaceInfo dpnTepInfo = getDpnTepInterface(srcDpnId, dstDpnId);
if (dpnTepInfo != null) {
List<DPNTEPsInfo> srcDpnTEPsInfo = dpnTepsInfoCache.getDPNTepListFromDPNId(Collections.singletonList(srcDpnId));
List<DPNTEPsInfo> dstDpnTEPsInfo = dpnTepsInfoCache.getDPNTepListFromDPNId(Collections.singletonList(dstDpnId));
iface = ItmUtils.buildTunnelInterface(srcDpnId, tunnelName, String.format("%s %s", ItmUtils.convertTunnelTypetoString(dpnTepInfo.getTunnelType()), "Trunk Interface"), true, dpnTepInfo.getTunnelType(), srcDpnTEPsInfo.get(0).getTunnelEndPoints().get(0).getIpAddress(), dstDpnTEPsInfo.get(0).getTunnelEndPoints().get(0).getIpAddress(), srcDpnTEPsInfo.get(0).getTunnelEndPoints().get(0).getGwIpAddress(), srcDpnTEPsInfo.get(0).getTunnelEndPoints().get(0).getVLANID(), true, dpnTepInfo.isMonitoringEnabled(), TunnelMonitoringTypeBfd.class, monitoringInt, true, null);
}
return iface;
}
use of org.opendaylight.genius.itm.utils.TunnelEndPointInfo in project genius by opendaylight.
the class DpnTepStateCache method addTunnelEndPointInfoToCache.
// Start: TunnelEndPoint Cache accessors
private void addTunnelEndPointInfoToCache(String tunnelName, String srcEndPtInfo, String dstEndPtInfo) {
TunnelEndPointInfo tunnelEndPointInfo = new TunnelEndPointInfoBuilder().setSrcEndPointInfo(srcEndPtInfo).setDstEndPointInfo(dstEndPtInfo).build();
tunnelEndpointMap.put(tunnelName, tunnelEndPointInfo);
}
Aggregations