Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.intent; |
| 2 | |
| 3 | /** |
| 4 | * A list of intent operations. |
| 5 | */ |
Thomas Vachuska | 1fb982f | 2014-10-22 14:09:17 -0700 | [diff] [blame^] | 6 | @Deprecated |
Brian O'Connor | b876bf1 | 2014-10-02 14:59:37 -0700 | [diff] [blame] | 7 | public class IntentBatchOperation extends |
| 8 | BatchOperation<BatchOperationEntry<IntentBatchOperation.Operator, ?>> { |
| 9 | /** |
| 10 | * The intent operators. |
| 11 | */ |
| 12 | public enum Operator { |
| 13 | ADD, |
| 14 | REMOVE, |
| 15 | } |
| 16 | |
| 17 | /** |
| 18 | * Adds an add-intent operation. |
| 19 | * |
| 20 | * @param intent the intent to be added |
| 21 | * @return the IntentBatchOperation object if succeeded, null otherwise |
| 22 | */ |
| 23 | public IntentBatchOperation addAddIntentOperation(Intent intent) { |
| 24 | return (null == super.addOperation( |
| 25 | new BatchOperationEntry<Operator, Intent>(Operator.ADD, intent))) |
| 26 | ? null : this; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Adds a remove-intent operation. |
| 31 | * |
| 32 | * @param id the ID of intent to be removed |
| 33 | * @return the IntentBatchOperation object if succeeded, null otherwise |
| 34 | */ |
| 35 | public IntentBatchOperation addRemoveIntentOperation(IntentId id) { |
| 36 | return (null == super.addOperation( |
| 37 | new BatchOperationEntry<Operator, IntentId>(Operator.REMOVE, id))) |
| 38 | ? null : this; |
| 39 | } |
| 40 | } |