if (!Objects.equals(_constraints, other.getConstraints())) { return false; if (!Objects.equals(_key, other.getKey())) { return false; if (!Objects.equals(_order, other.getOrder())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
public ConstraintsBuilder(Constraints base) { if (base.getKey() == null) { this._key = new ConstraintsKey( base.getOrder() ); this._order = base.getOrder(); } else { this._key = base.getKey(); this._order = _key.getOrder(); } this._constraints = base.getConstraints(); if (base instanceof ConstraintsImpl) { ConstraintsImpl impl = (ConstraintsImpl) 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.intent.rev150122.intent.Constraints> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.Constraints>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
private void pushFlowsByPortNumber(final NodeId nodeId, final FlowAction flowAction) { for (Constraints cons : intent.getConstraints()) { /** * Code block for security rules flow matches */ if(cons.getConstraints() instanceof ClassificationConstraint) { ClassificationConstraint portConstraint = (ClassificationConstraint) cons.getConstraints(); pushPortFlows(portConstraint, nodeId, flowAction); } } }
public ConstraintsBuilder(Constraints base) { if (base.getKey() == null) { this._key = new ConstraintsKey( base.getOrder() ); this._order = base.getOrder(); } else { this._key = base.getKey(); this._order = _key.getOrder(); } this._constraints = base.getConstraints(); if (base instanceof ConstraintsImpl) { ConstraintsImpl impl = (ConstraintsImpl) 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.intent.rev150122.intent.Constraints> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.Constraints>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
private boolean isProtectedOrSlowRoute(Constraints constraints) { boolean result = false; if (FailoverConstraint.class.isAssignableFrom(constraints.getClass())) { final FailoverConstraint failoverConstraint = (FailoverConstraint) constraints.getConstraints(); final FailoverType failoverType = failoverConstraint.getFailoverConstraint().getFailoverSelector(); result = failoverType != null ? equals(FailoverType.SlowReroute) : false; } else if (ProtectionConstraint.class.isAssignableFrom(constraints.getClass())) { final ProtectionConstraint protectionConstraint = (ProtectionConstraint) constraints.getConstraints(); result = protectionConstraint.getProtectionConstraint().isIsProtected(); } return result; } }
if (other.getConstraints() != null) { return false; } else if(!_constraints.equals(other.getConstraints())) { return false; if (other.getKey() != null) { return false; } else if(!_key.equals(other.getKey())) { return false; if (other.getOrder() != null) { return false; } else if(!_order.equals(other.getOrder())) { return false; if (!e.getValue().equals(other.getAugmentation(e.getKey()))) { return false;
/** * Checks the Constraint name is present in the constraint container. * @param intent Intent * @param actionContainer Action * @param endPointGroups List of Endpoints * @return boolean */ private boolean checkQosConstraint(final Intent intent, final Action actionContainer, final List<String> endPointGroups) { //Check for constrain name in the intent. final org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.constraints.Constraints constraintContainer = intent.getConstraints().get(0).getConstraints(); if (!constraintContainer.getImplementedInterface().isAssignableFrom(QosConstraint.class)) { return false; } final String qosName = ((QosConstraint)constraintContainer).getQosConstraint().getQosName(); LOG.info("QosConstraint is set to: {}", qosName); if (qosName != null) { //Set the values to QosConstraintManager qosConstraintManager.setQosName(qosName); qosConstraintManager.setEndPointGroups(endPointGroups); qosConstraintManager.setAction(actionContainer); qosConstraintManager.setConstraint(constraintContainer); } else { LOG.trace("QoS Name is not set"); return false; } return true; }
if (c.getConstraints() instanceof BandwidthConstraint) { constraint = (BandwidthConstraint) c.getConstraints();