public static Uuid getDefaultInstance(String defaultValue) { return new Uuid(defaultValue); }
private void handleInterfaceEventAdd(final String neutronPortUuid, Long dpId, final Uuid interfaceUuid) { neutronPortToDpIdCache.put(neutronPortUuid, new ImmutablePair<>(dpId, interfaceUuid)); LOG.debug("handleInterfaceEvent add cache entry NeutronPortUuid {} : dpid {}, ifUuid {}", neutronPortUuid, dpId, interfaceUuid.getValue()); }
private void handleInterfaceEventDelete(final OvsdbTerminationPointAugmentation intf, final Long dpId) { // Remove entry from neutronPortToDpIdCache based on interface uuid for (Map.Entry<String, Pair<Long, Uuid>> entry : neutronPortToDpIdCache.entrySet()) { final String currPortUuid = entry.getKey(); if (intf.getInterfaceUuid().equals(entry.getValue().getRight())) { LOG.debug("handleInterfaceEventDelete remove cache entry NeutronPortUuid {} : dpid {}, ifUuid {}", currPortUuid, dpId, intf.getInterfaceUuid().getValue()); neutronPortToDpIdCache.remove(currPortUuid); break; } } }
public static String getRouterIdfromVpnInstance(DataBroker broker,String vpnName){ InstanceIdentifier<VpnMap> vpnMapIdentifier = InstanceIdentifier.builder(VpnMaps.class) .child(VpnMap.class, new VpnMapKey(new Uuid(vpnName))).build(); Optional<VpnMap> optionalVpnMap = read(broker, LogicalDatastoreType.CONFIGURATION, vpnMapIdentifier); if (optionalVpnMap.isPresent()) { return optionalVpnMap.get().getRouterId().getValue(); } return null; }
private AutoattachKey getAutoAttachKeyToRemove(Node node, UUID autoAttachUuid) { final List<Autoattach> autoAttachList = node.getAugmentation(OvsdbNodeAugmentation.class).getAutoattach(); if (autoAttachList == null || autoAttachList.isEmpty()) { return null; } for (final Autoattach autoAttach : autoAttachList) { if (autoAttach.getAutoattachUuid() .equals(new Uuid(autoAttachUuid.toString()))) { return autoAttach.getKey(); } } return null; } }
@ConstructorProperties("value") public Uuid(java.lang.String _value) { if (_value != null) { check_valueLength(_value); } Preconditions.checkNotNull(_value, "Supplied value may not be null"); for (Pattern p : patterns) { Preconditions.checkArgument(p.matcher(_value).matches(), "Supplied value \"%s\" does not match required pattern \"%s\"", _value, p); } this._value = _value; }
private void handleRouterGatewayUpdated(Port routerGwPort) { Uuid routerId = new Uuid(routerGwPort.getDeviceId()); Router router = NeutronvpnUtils.getNeutronRouter(dataBroker, routerId); if (router == null) { LOG.warn("No router found for router GW port {} router id {}", routerGwPort.getUuid(), routerId.getValue()); return; } gwMacResolver.sendArpRequestsToExtGateways(router); }
private QosEntriesKey getQosEntriesKey(Node node, UUID qosUuid) { List<QosEntries> qosList = node.getAugmentation(OvsdbNodeAugmentation.class).getQosEntries(); if (qosList == null || qosList.isEmpty()) { LOG.debug("Deleting Qos {}, Ovsdb Node {} does not have a Qos list.", qosUuid.toString(), node); return null; } Iterator<QosEntries> itr = qosList.iterator(); Uuid quUuid = new Uuid(qosUuid.toString()); while (itr.hasNext()) { QosEntries qos = itr.next(); if (qos.getQosUuid().equals(quUuid)) { return qos.getKey(); } } LOG.debug("Deleted Queue {} not found in Ovsdb Node {}", qosUuid.toString(), node); return null; }
@VisibleForTesting static boolean isRuleIdEqual(SecurityRule one, SecurityRule two) { checkNotNull(one); checkNotNull(two); return one.getSecurityGroupId().equals(two.getSecurityGroupId()); }
@ConstructorProperties("value") public Uuid(String _value) { if (_value != null) { check_valueLength(_value); } Objects.requireNonNull(_value, "Supplied value may not be null"); CodeHelpers.checkPattern(_value, patterns, regexes); this._value = _value; }
public static Uuid getDefaultInstance(String defaultValue) { return new Uuid(defaultValue); }
private void handleInterfaceEventAdd(final String neutronPortUuid, Long dpId, final Uuid interfaceUuid) { neutronPortToDpIdCache.put(neutronPortUuid, new ImmutablePair<>(dpId, interfaceUuid)); LOG.debug("handleInterfaceEvent add cache entry NeutronPortUuid {} : dpid {}, ifUuid {}", neutronPortUuid, dpId, interfaceUuid.getValue()); }
private void handleInterfaceEventDelete(final OvsdbTerminationPointAugmentation intf, final Long dpId) { // Remove entry from neutronPortToDpIdCache based on interface uuid for (Map.Entry<String, Pair<Long, Uuid>> entry : neutronPortToDpIdCache.entrySet()) { final String currPortUuid = entry.getKey(); if (intf.getInterfaceUuid().equals(entry.getValue().getRight())) { LOG.debug("handleInterfaceEventDelete remove cache entry NeutronPortUuid {} : dpid {}, ifUuid {}", currPortUuid, dpId, intf.getInterfaceUuid().getValue()); neutronPortToDpIdCache.remove(currPortUuid); break; } } }
private QueuesKey getQueueKey(Node node, UUID queueUuid) { List<Queues> queueList = node.getAugmentation(OvsdbNodeAugmentation.class).getQueues(); if (queueList == null || queueList.isEmpty()) { LOG.debug("Deleting Queue {}, Ovsdb Node {} does not have a Queue list.", queueUuid.toString(), node); return null; } Iterator<Queues> itr = queueList.iterator(); Uuid quUuid = new Uuid(queueUuid.toString()); while (itr.hasNext()) { Queues queue = itr.next(); if (queue.getQueueUuid().equals(quUuid)) { return queue.getKey(); } } LOG.debug("Deleted Queue {} not found in Ovsdb Node {}", queueUuid.toString(), node); return null; }
public static Optional<SecurityGroup> findSecurityGroup(Uuid secGrpUuid, @Nullable SecurityGroups securityGroups) { Preconditions.checkNotNull(secGrpUuid); if (securityGroups == null || securityGroups.getSecurityGroup() == null) { return Optional.absent(); } for (SecurityGroup secGroup : securityGroups.getSecurityGroup()) { if (secGrpUuid.equals(secGroup.getUuid())) { return Optional.of(secGroup); } } return Optional.absent(); }
public static Uuid getDefaultInstance(String defaultValue) { return new Uuid(defaultValue); }
public void unregisterEpFromLneLayer2(Uuid tenantId, NodeId fabricId, NodeId lswId, Uuid epUuid) { VContainerConfigMgr vcMgr = this.vcConfigDataMgrList.get(tenantId); if (vcMgr == null) { LOG.error("FABMGR: ERROR: unregisterEpFromLneLayer2: vcMgr is null: tenantId={}", tenantId.getValue()); return; // -----> } if (fabricId == null) { LOG.error("FABMGR: ERROR: unregisterEpFromLneLayer2: vfabricId is null: {}", tenantId.getValue()); return; // ----> } this.netNodeServiceProvider.unregisterEndpoint(tenantId, fabricId, lswId, epUuid); }
protected static List<Uuid> getNeutronRouterSubnetIds(DataBroker broker, Uuid routerId) { logger.debug("getNeutronRouterSubnetIds for {}", routerId.getValue()); List<Uuid> subnetIdList = new ArrayList<>(); Optional<Subnetmaps> subnetMaps = read(broker, LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.builder (Subnetmaps.class).build()); if (subnetMaps.isPresent() && subnetMaps.get().getSubnetmap() != null) { for (Subnetmap subnetmap : subnetMaps.get().getSubnetmap()) { if (routerId.equals(subnetmap.getRouterId())) { subnetIdList.add(subnetmap.getId()); } } } logger.debug("returning from getNeutronRouterSubnetIds for {}", routerId.getValue()); return subnetIdList; }
public static Optional<SecurityRule> findSecurityRule(Uuid uuid, @Nullable SecurityRules securityRules) { if (securityRules == null || securityRules.getSecurityRule() == null) { return Optional.absent(); } for (SecurityRule secRule : securityRules.getSecurityRule()) { if (secRule.getUuid().equals(uuid)) { return Optional.of(secRule); } } return Optional.absent(); }