private Collection<FloatIpData> getAllFloatingIPsWithMetadata() { LOG.debug("getAllFloatingIPsWithMetadata : Fechting all floating Ips and it's metadata"); List<NeutronFloatingIP> neutronFloatingIps = neutronFloatingIpCache.getAllFloatingIPs(); if(neutronFloatingIps != null && !neutronFloatingIps.isEmpty()) { for (NeutronFloatingIP neutronFloatingIP : neutronFloatingIps) { if(!floatIpDataMapCache.containsKey(neutronFloatingIP.getID())){ LOG.debug("Metadata for floating ip {} is not present in the cache. " + "Fetching from data store.",neutronFloatingIP.getID()); this.getFloatingIPWithMetadata(neutronFloatingIP.getID()); } } } LOG.debug("getAllFloatingIPsWithMetadata : {} floating points found in data store",floatIpDataMapCache.size()); return floatIpDataMapCache.values(); } private FloatIpData getFloatingIPWithMetadata(String neutronFloatingId) {
/** * This method performs creation or deletion of in-bound rules into Table 30 for a existing available floating * ip, otherwise for newer one. */ private void programFlowsForFloatingIPInbound(final NeutronFloatingIP neutronFloatingIP, final Action action) { Preconditions.checkNotNull(neutronFloatingIP); final FloatIpData fid = getFloatingIPWithMetadata(neutronFloatingIP.getID()); if (fid == null) { LOG.trace("programFlowsForFloatingIPInboundAdd {} for {} uuid {} not in local cache", action, neutronFloatingIP.getFloatingIPAddress(), neutronFloatingIP.getID()); return; } programInboundIpRewriteStage1(fid.dpid, fid.ofPort, fid.segId, fid.floatingIpAddress, fid.fixedIpAddress, action); }
/** * This method performs creation or deletion of out-bound rules into Table 100 for a existing available floating * ip, otherwise for newer one. */ private void programFlowsForFloatingIPOutbound(final NeutronFloatingIP neutronFloatingIP, final Action action) { Preconditions.checkNotNull(neutronFloatingIP); final FloatIpData fid = getFloatingIPWithMetadata(neutronFloatingIP.getID()); if (fid == null) { LOG.trace("programFlowsForFloatingIPOutbound {} for {} uuid {} not in local cache", action, neutronFloatingIP.getFloatingIPAddress(), neutronFloatingIP.getID()); return; } programOutboundIpRewriteStage1(fid, action); }
@Override public boolean addFloatingIP(NeutronFloatingIP input) { if (floatingIPExists(input.getID())) { return false; } return addMd(input); }
final NeutronPort neutronPortForFloatIp = findNeutronPortForFloatingIp(neutronFloatingIP.getID()); final String neutronTenantPortUuid = neutronFloatingIP.getPortUUID(); final Pair<Long, Uuid> nodeIfPair = this.getDpIdOfNeutronPort(neutronTenantPortUuid); final FloatIpData floatIpData = new FloatIpData(dpId, ofPort, providerSegmentationId, floatingIpMac, floatingIpAddress, fixedIpAddress, neutronRouterMac); floatIpDataMapCache.put(neutronFloatingIP.getID(), floatIpData); LOG.info("Floating IP {}<->{} programmed ARP mac {} on OFport {} seg {} dpid {}", neutronFloatingIP.getFixedIPAddress(), neutronFloatingIP.getFloatingIPAddress(),
programFlowsForFloatingIPArpDelete(neutronFloatingIP.getID());
switch (s) { case "id": ans.setID(this.getID()); break; case "floating_network_id":