private static void isSupportedAclType(final Acl acl) { checkArgument(SUPPORTED_ACL_TYPES.contains(acl.getAclType()), "Unsupported Acl type %s detected for acl %s, allowed types are %s", acl.getAclType(), acl.getAclName(), SUPPORTED_ACL_TYPES); }
private static void hasConsistentAceTypeForAclType(final Acl acl) { checkTypesSame(acl.getAccessListEntries().getAce(), acl.getAclName(), checkNotNull(ACL_ACE_PAIRS.get(acl.getAclType()), "Unsupported ACL type %s for ACL %s", acl.getAclType(), acl.getAclName())); }
private static boolean isAssigned(@Nonnull final Acl acl, @Nonnull final WriteContext writeContext) { final String aclName = acl.getAclName(); final Class<? extends AclBase> aclType = acl.getAclType(); final Interfaces interfaces = writeContext.readAfter(InstanceIdentifier.create(Interfaces.class)).get(); return interfaces.getInterface().stream() .map(i -> Optional.ofNullable(i.getAugmentation(VppInterfaceAugmentation.class)) .map(aug -> aug.getIetfAcl()) .map(ietfAcl -> ietfAcl.getAccessLists()) .map(accessLists -> accessLists.getAcl()) ) .flatMap(iacl -> iacl.isPresent() ? iacl.get().stream() : Stream.empty()) .filter(assignedAcl -> aclName.equals(assignedAcl.getName()) && aclType.equals(assignedAcl.getType())) .findFirst().isPresent(); } }
return false; if (!Objects.equals(_aclType, other.getAclType())) { return false;
final Class<? extends AclBase> aclType = acl.getAclType(); final String aclName = acl.getAclName();
return false; if (!Objects.equals(_aclType, other.getAclType())) { return false;
public AclBuilder(Acl base) { if (base.key() == null) { this.key = new AclKey( base.getAclName(), base.getAclType() ); this._aclName = base.getAclName(); this._aclType = base.getAclType(); } else { this.key = base.key(); this._aclName = key.getAclName(); this._aclType = key.getAclType(); } this._accessListEntries = base.getAccessListEntries(); this._aclOperData = base.getAclOperData(); if (base instanceof AclImpl) { AclImpl impl = (AclImpl) base; if (!impl.augmentation.isEmpty()) { this.augmentation = new HashMap<>(impl.augmentation); } } else if (base instanceof AugmentationHolder) { @SuppressWarnings("unchecked") AugmentationHolder<Acl> casted =(AugmentationHolder<Acl>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
public AclBuilder(Acl base) { if (base.getKey() == null) { this._key = new AclKey( base.getAclName(), base.getAclType() ); this._aclName = base.getAclName(); this._aclType = base.getAclType(); } else { this._key = base.getKey(); this._aclName = _key.getAclName(); this._aclType = _key.getAclType(); } this._accessListEntries = base.getAccessListEntries(); this._aclOperData = base.getAclOperData(); if (base instanceof AclImpl) { AclImpl impl = (AclImpl) 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.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.Acl> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160708.access.lists.Acl>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }