public static String convertIpAddressToString(IpAddress ipAddress) { Preconditions.checkNotNull(ipAddress, "Supplied IpAddress value must not be null"); try { Preconditions.checkArgument(ipAddress.getIpv4Address().getValue() != null); return ipAddress.getIpv4Address().getValue(); } catch (Exception e) { LOG.debug("Supplied IpAddress value ({}) is not an instance of IPv4", ipAddress.toString()); } Preconditions.checkArgument(ipAddress.getIpv6Address().getValue() != null); return ipAddress.getIpv6Address().getValue(); }
public void updateAddress(AddressUpdateEvent event) { checkNotNull(event); checkNotNull(event.getAddress()); addressTracker.addAddress(AtriumIpAddress.valueOf(event.getAddress().getIp().toString()), event.getAddress()); }
.child(ExternalTunnel.class, ItmUtils.getExternalTunnelKey(extIp.toString(), teps.getDPNID().toString(), tunType));
private InstanceIdentifier<TerminationPoint> createTP(final IpAddress addr, final InstanceIdentifier<Node> sni, final Boolean inControl, final ReadWriteTransaction trans) { final String url = "ip://" + addr.toString(); final TerminationPointKey tpk = new TerminationPointKey(new TpId(url)); final TerminationPointBuilder tpb = new TerminationPointBuilder(); tpb.setKey(tpk).setTpId(tpk.getTpId()); tpb.addAugmentation(TerminationPoint1.class, new TerminationPoint1Builder().setIgpTerminationPointAttributes( new IgpTerminationPointAttributesBuilder().setTerminationPointType( new IpBuilder().setIpAddress(Lists.newArrayList(addr)).build()).build()).build()); final NodeKey nk = new NodeKey(new NodeId(url)); final NodeBuilder nb = new NodeBuilder(); nb.setKey(nk).setNodeId(nk.getNodeId()); nb.setTerminationPoint(Lists.newArrayList(tpb.build())); if (sni != null) { nb.setSupportingNode(Lists.newArrayList(createSupportingNode(InstanceIdentifier.keyOf(sni).getNodeId(), inControl))); } final InstanceIdentifier<Node> nid = this.target.child(Node.class, nb.getKey()); trans.put(LogicalDatastoreType.OPERATIONAL, nid, nb.build()); return nid.child(TerminationPoint.class, tpb.getKey()); }
private ServiceFunction updateLispData(Lisp lispLocation, ServiceFunction serviceFunction) { Object[] methodParameters = { LispAddressUtil.toIpPrefixEid(lispLocation.getEid(), 0) }; MappingRecord reply = (MappingRecord) SfcLispUtil.submitCallable( new SfcLispFlowMappingApi(lfmService, SfcLispFlowMappingApi.Method.GET_MAPPING, methodParameters), OpendaylightSfc.getOpendaylightSfcObj().getExecutor()); if (reply == null) { return serviceFunction; } for (LocatorRecord locator : reply.getLocatorRecord()) { Address address = locator.getRloc().getAddress(); if (address instanceof ApplicationData) { ApplicationData applicationData = (ApplicationData) address; Ip locatorType = SfcLispUtil.createLocator(applicationData); SfDataPlaneLocatorName name = new SfDataPlaneLocatorName(lispLocation.getEid().toString()); SfDataPlaneLocatorKey key = new SfDataPlaneLocatorKey(name); SfDataPlaneLocator loc = new SfDataPlaneLocatorBuilder().setLocatorType(locatorType).setKey(key).setName(name).build(); ServiceFunctionBuilder fb = new ServiceFunctionBuilder(serviceFunction); fb.getSfDataPlaneLocator().add(loc); return fb.build(); } } return serviceFunction; }
Ip locatorType = SfcLispUtil.createLocator(applicationData); DataPlaneLocator dpl = new DataPlaneLocatorBuilder().setLocatorType(locatorType).build(); SffDataPlaneLocatorName name = new SffDataPlaneLocatorName(lispLocation.getEid().toString()); SffDataPlaneLocatorKey key = new SffDataPlaneLocatorKey(name); SffDataPlaneLocator loc =