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); } } }
@Override public void execute(final Intent intent, final FlowAction flowAction) { try { final Action actionContainer = IntentUtils.getAction(intent); final List<String> endPointGroups = IntentUtils.extractEndPointGroup(intent); final Map<String, Map<String, String>> subjectDetails = MappingServiceUtils.extractSubjectDetails(intent, intentMappingService); mplsIntentFlowManager.setEndPointGroups(endPointGroups); mplsIntentFlowManager.setAction(actionContainer); mplsIntentFlowManager.setSubjectsMapping(subjectDetails); if (intent.getConstraints() != null) { for (Constraints constraints : intent.getConstraints()) { generateMplsFlows(intent, flowAction, constraints); } } } catch (IntentElementNotFoundException | IntentInvalidException ie) { //TODO: Perform fail over LOG.error(ie.getMessage()); } }
return false; if (!Objects.equals(_constraints, other.getConstraints())) { 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; }
public IntentBuilder(Intent base) { if (base.getKey() == null) { this._key = new IntentKey( base.getId() ); this._id = base.getId(); } else { this._key = base.getKey(); this._id = _key.getId(); } this._actions = base.getActions(); this._conditions = base.getConditions(); this._constraints = base.getConstraints(); this._detailedStatusMessage = base.getDetailedStatusMessage(); this._status = base.getStatus(); this._subjects = base.getSubjects(); if (base instanceof IntentImpl) { IntentImpl impl = (IntentImpl) 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.intents.Intent> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intents.Intent>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
if (other.getConstraints() != null) { return false; } else if(!_constraints.equals(other.getConstraints())) { return false;
this._constraints = base.getConstraints(); this._detailedStatusMessage = base.getDetailedStatusMessage(); this._qosConfig = base.getQosConfig();
for (Constraints c : intent.getConstraints()) { if (c.getConstraints() instanceof BandwidthConstraint) { constraint = (BandwidthConstraint) c.getConstraints();