if (!Objects.equals(_action, other.getAction())) { 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 ActionsBuilder(Actions base) { if (base.getKey() == null) { this._key = new ActionsKey( base.getOrder() ); this._order = base.getOrder(); } else { this._key = base.getKey(); this._order = _key.getOrder(); } this._action = base.getAction(); if (base instanceof ActionsImpl) { ActionsImpl impl = (ActionsImpl) 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.Actions> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.Actions>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
/** * To get the action from the intent. * * @return action type. */ private String getAction(Intent intent) { Action action = intent.getActions().get(0).getAction(); String actionType = null; if (action instanceof Allow) { actionType = "allow"; } else if (action instanceof Block) { actionType = "block"; } else { throw new IntentElementNotFoundException("VTN Renderer supports only allow or block: {}" + intent.getId()); } return actionType; } }
public ActionsBuilder(Actions base) { if (base.getKey() == null) { this._key = new ActionsKey( base.getOrder() ); this._order = base.getOrder(); } else { this._key = base.getKey(); this._order = _key.getOrder(); } this._action = base.getAction(); if (base instanceof ActionsImpl) { ActionsImpl impl = (ActionsImpl) 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.Actions> casted =(AugmentationHolder<org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.Actions>) base; if (!casted.augmentations().isEmpty()) { this.augmentation = new HashMap<>(casted.augmentations()); } } }
org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.actions.Action actionContainer = (org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.actions.Action) intent.getActions().get(0).getAction(); Set<Endpoint> sources; Set<Endpoint> destinations;
if (other.getAction() != null) { return false; } else if(!_action.equals(other.getAction())) { 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;
private Contract getDefaultContract() { ContractBuilder contractBuilder = new ContractBuilder().setId(new ContractId(this.contractId)); Subject subject = null; Action action = intent.getActions().get(0).getAction(); if (action instanceof Block) { subject = this.getBlockSubject(); } else if (action instanceof Allow) { subject = this.getAllowSubject(); } else { LOG.warn("The specified action is not recognized {}", action); } List<SubjectName> subjectNames = new ArrayList<>(); subjectNames.add(subject.getName()); contractBuilder.setSubject(ImmutableList.of(subject)); contractBuilder.setClause(ImmutableList.of(new ClauseBuilder() .setName(new ClauseName(DEFAULT_CONTRACT)) .setSubjectRefs(subjectNames) .build())); return contractBuilder.build(); }
/** * To set the ingress and egress data to redirect cache * @param intent :intent */ private void addSfcNodeInfoToCache(Intent intent) { String intentId = intent.getId().getValue(); RedirectNodeData redirectNodeData = redirectNodeCache.get(intentId); if (redirectNodeData == null) { addIntentToCache(intent); redirectNodeData = redirectNodeCache.get(intentId); } Redirect actionContainer = (Redirect) intent.getActions().get(0).getAction(); org.opendaylight.yang.gen.v1.urn.opendaylight.intent.rev150122.intent.actions.action.redirect.Redirect redirectForService = actionContainer.getRedirect(); String serviceName = redirectForService.getServiceName(); String[] redirectSfcDataList = readRedirectSfcData(serviceName); redirectNodeData.setIngressNodeId(redirectSfcDataList[0]); redirectNodeData.setEgressNodeId(redirectSfcDataList[1]); deleteArpFlow(new NodeId(extractTopologyNodeId(redirectSfcDataList[0]).getValue())); deleteArpFlow(new NodeId(extractTopologyNodeId(redirectSfcDataList[1]).getValue())); }
public static BandwidthOnDemandParameters parseBandwidthOnDemand(Intent intent) { Action action = !actions.isEmpty() ? actions.get(0).getAction() : null;