blob: 75e240f10241b02d106a09e0731aa41764a21cb5 [file] [log] [blame]
Brian O'Connorb876bf12014-10-02 14:59:37 -07001package org.onlab.onos.net.intent;
2
3/**
4 * A list of intent operations.
5 */
Thomas Vachuska1fb982f2014-10-22 14:09:17 -07006@Deprecated
Brian O'Connorb876bf12014-10-02 14:59:37 -07007public 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}