public synchronized void handleSecurityRuleGroupsRemoveEvent(SecurityRuleGroups ruleGroups) { Uuid tenantId = ruleGroups.getTenantId(); UserLogicalNetworkCache uln = this.ulnStore.get(tenantId); if (uln == null) { LOG.error("FABMGR: ERROR: handleSecurityRuleGroupsRemoveEvent: uln is null"); return; } if (!uln.isSecurityRuleGroupsAlreadyCached(ruleGroups)) { LOG.error("FABMGR: ERROR: handleSecurityRuleGroupsRemoveEvent: ruleGroups not in cache"); return; } uln.addRequestRemoveSecurityRuleGroups(ruleGroups); /* * Notify worker thread to start work */ this.workerThreadLock.release(); }
public synchronized void handleSecurityRuleGroupsCreateEvent(SecurityRuleGroups ruleGroups) { Uuid tenantId = ruleGroups.getTenantId(); this.createUlnCacheIfNotExist(tenantId); UserLogicalNetworkCache uln = this.ulnStore.get(tenantId); if (uln == null) { LOG.error("FABMGR: ERROR: handleSecurityRuleGroupsCreateEvent: uln is null"); return; } if (uln.isSecurityRuleGroupsAlreadyCached(ruleGroups) == true) { LOG.error("FABMGR: ERROR: handleSecurityRuleGroupsCreateEvent: ruleGroups already exist"); return; } uln.cacheSecurityRuleGroups(ruleGroups); this.workerThreadLock.release(); }
return false; if (!Objects.equals(_tenantId, other.getTenantId())) { return false;
public synchronized void handleSecurityRuleGroupsUpdateEvent(SecurityRuleGroups ruleGroups) { Uuid tenantId = ruleGroups.getTenantId(); if (this.isUlnAlreadyInCache(tenantId) == false) { LOG.error(
public SecurityRuleGroupsBuilder(SecurityRuleGroups base) { if (base.getKey() == null) { this._key = new SecurityRuleGroupsKey( base.getUuid() ); this._uuid = base.getUuid(); } else { this._key = base.getKey(); this._uuid = _key.getUuid(); } this._description = base.getDescription(); this._name = base.getName(); this._ports = base.getPorts(); this._securityRuleGroup = base.getSecurityRuleGroup(); this._tenantId = base.getTenantId(); if (base instanceof SecurityRuleGroupsImpl) { SecurityRuleGroupsImpl impl = (SecurityRuleGroupsImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.logical.faas.security.rules.rev151013.security.rule.groups.attributes.security.rule.groups.container.SecurityRuleGroups> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.faas.logical.faas.security.rules.rev151013.security.rule.groups.attributes.security.rule.groups.container.SecurityRuleGroups>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
private static void removeSecurityGroupsFromDsIfExists(Uuid tenantId, Uuid securityGroupId, boolean updateExistingRefs) { Optional<SecurityRuleGroups> oldOption = removeIfExists(UlnIidFactory.securityGroupsIid(tenantId, securityGroupId)); /* * Make sure other logical network nodes links are updated as well */ if (oldOption.isPresent() && updateExistingRefs) { SecurityRuleGroups securityRuleGroups = oldOption.get(); if (securityRuleGroups.getPorts() != null) { for (Uuid portId : securityRuleGroups.getPorts()) { Port port = UlnDatastoreApi.readPortFromDs(securityRuleGroups.getTenantId(), portId); if (port != null && port.getSecurityRulesGroups() != null) { Set<Uuid> set = new HashSet<>(port.getSecurityRulesGroups()); if (set.remove(securityRuleGroups.getUuid())) { PortBuilder builder = new PortBuilder(port); builder.setSecurityRulesGroups(new ArrayList<>(set)); UlnDatastoreApi.submitPortToDs(builder.build(), false); } } } } } }
SecurityRuleGroups dsSecurityGroups = readSecurityGroupsFromDs(newSecurityGroups.getTenantId(), newSecurityGroups.getUuid()); if (dsSecurityGroups != null) { UlnIidFactory.securityGroupsIid(updatedSecurityGroups.getTenantId(), updatedSecurityGroups.getUuid()), updatedSecurityGroups, true); if (submitToDs(t)) { Port port = UlnDatastoreApi.readPortFromDs(updatedSecurityGroups.getTenantId(), portId); if (port != null) { Set<Uuid> set = new HashSet<>();