NeutronFloatingIP ans = new NeutronFloatingIP(); Iterator<String> i = fields.iterator(); while (i.hasNext()) { String s = i.next(); if (s.equals("id")) { ans.setFloatingIPUUID(this.getFloatingIPUUID()); ans.setFloatingNetworkUUID(this.getFloatingNetworkUUID()); ans.setPortUUID(this.getPortUUID()); ans.setFixedIPAddress(this.getFixedIPAddress()); ans.setFloatingIPAddress(this.getFloatingIPAddress()); ans.setTenantUUID(this.getTenantUUID());
public OpenDoveEGWFwdRule(NeutronFloatingIP floatingIP, String uuid2, String minProxyIP2, String maxProxyIP2, Integer vnid2) { uuid = java.util.UUID.randomUUID().toString(); tombstoneFlag = false; externalIP = floatingIP.getFloatingIPAddress(); gatewayUUID = uuid2; internalIP = floatingIP.getFixedIPAddress(); externalPort = internalPort = 0; minProxyIP = minProxyIP2; maxProxyIP = maxProxyIP2; vnid = vnid2; associatedNeutronFloatingIPUUID = floatingIP.getID(); // Set protocol to "wildcard: 0" for Now, Ideally it should be set by Neutron Layer protocol = 0; }
throw new BadRequestException("only singleton requests allowed."); NeutronFloatingIP singleton = input.getSingleton(); if (singleton.getID() == null) throw new BadRequestException("singleton UUID doesn't exist."); sourceFloatingIP.getFloatingNetworkUUID()); String floatingIP = singleton.getFloatingIPAddress(); if (floatingIP != null) { if (externNetwork.getSubnets().size() != 1) String port_id = singleton.getPortUUID(); if (port_id != null) { fixedIP = singleton.getFixedIPAddress(); if (fixedIP == null) throw new BadRequestException("request doesn't have a fixed IP address"); } else { fixedIP = port.getFixedIPs().get(0).getIpAddress(); if (singleton.getFixedIPAddress() != null && !fixedIP.equalsIgnoreCase(singleton.getFixedIPAddress())) throw new BadRequestException("mismatch in fixed IP addresses"); singleton.setFixedIPAddress(fixedIP);
NeutronFloatingIP oSS = i.next(); if ((queryID == null || queryID.equals(oSS.getID())) && (queryFloatingNetworkId == null || queryFloatingNetworkId.equals(oSS.getFloatingNetworkUUID())) && (queryPortId == null || queryPortId.equals(oSS.getPortUUID())) && (queryFixedIPAddress == null || queryFixedIPAddress.equals(oSS.getFixedIPAddress())) && (queryFloatingIPAddress == null || queryFloatingIPAddress.equals(oSS.getFloatingIPAddress())) && (queryTenantID == null || queryTenantID.equals(oSS.getTenantUUID()))) { if (fields.size() > 0) ans.add(extractFields(oSS,fields));
public void neutronFloatingIPUpdated(NeutronFloatingIP floatingIP) { // if Port-ID is null, look through all EGWFwdRules and set tombstone flag for each // if Port-ID is not null, repeat create steps (refactor) if (floatingIP.getPortUUID() == null) { OpenDoveEGWFwdRule.removeEgwFwdRulesForFloatingIP(floatingIP, this); } else { OpenDoveEGWFwdRule.mapFloatingIPtoEGWFwdRule(floatingIP, this); } } public int canDeleteFloatingIP(NeutronFloatingIP floatingIP) {
static public void removeEgwFwdRulesForFloatingIP(NeutronFloatingIP floatingIP, Object o) { IfSBDoveEGWFwdRuleCRUD egwFwdRuleCRUDif = OpenDoveCRUDInterfaces.getIfSBDoveEGWFwdRuleCRUD(o); Iterator<OpenDoveEGWFwdRule> iterator = egwFwdRuleCRUDif.getEgwFwdRules().iterator(); while (iterator.hasNext()) { OpenDoveEGWFwdRule egwFwdRule = iterator.next(); if (egwFwdRule.getAssociatedNeutronFloatingIPUUID().equalsIgnoreCase(floatingIP.getID())) { egwFwdRule.setTombstoneFlag(true); egwFwdRuleCRUDif.updateEgwFwdRule(egwFwdRule.getUUID(), egwFwdRule); } } } }
NeutronFloatingIP singleton = input.getSingleton(); if (floatingIPInterface.floatingIPExists(singleton.getID())) throw new BadRequestException("Floating IP UUID already exists."); String externalNetworkUUID = singleton.getFloatingNetworkUUID(); if (externalNetworkUUID == null) throw new BadRequestException("external network UUID doesn't exist."); throw new BadRequestException("external network isn't marked router:external"); String floatingIP = singleton.getFloatingIPAddress(); if (floatingIP != null) { if (externNetwork.getSubnets().size() != 1) String port_id = singleton.getPortUUID(); if (port_id != null) { fixedIP = singleton.getFixedIPAddress(); if (fixedIP == null) throw new BadRequestException("fixed IP address doesn't exist."); } else { fixedIP = port.getFixedIPs().get(0).getIpAddress(); if (singleton.getFixedIPAddress() != null && !fixedIP.equalsIgnoreCase(singleton.getFixedIPAddress())) throw new BadRequestException("mismatched fixed IP address in request"); singleton.setFixedIPAddress(fixedIP);
NeutronPort port = neutronPortCRUDif.getPort(floatingIP.getPortUUID()); String neutronNetwork = port.getNetworkUUID(); INeutronNetworkCRUD neutronNetworkCRUDif = NeutronCRUDInterfaces.getINeutronNetworkCRUD(o);