blob: 45772ce5a5289867a52c869ef214dc518fc5742d [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.api.batchoperation;
2
3/**
4 * An update-operation entry of a batch operation.
5 */
6public class UpdateOperation implements BatchOperationEntry {
7 public String oldTargetId;
8 public IBatchOperationTarget newTarget;
9
10 /**
11 * Creates a update-operation with specified targets.
12 *
13 * @param oldTargetId The ID to be overwritten.
14 * @param newTarget The new target to be added.
15 */
16 public UpdateOperation(String oldTargetId, IBatchOperationTarget newTarget) {
17 this.oldTargetId = oldTargetId;
18 this.newTarget = newTarget;
19 }
20
21 @Override
22 public BatchOperator getOperator() {
23 return BatchOperator.UPDATE;
24 }
25
26 /**
27 * Gets the old target ID to be overwritten.
28 *
29 * @return The old target ID to be overwritten
30 */
31 public String getOldTargetId() {
32 return oldTargetId;
33 }
34
35 /**
36 * Gets the new target object to be added.
37 *
38 * @return The new target object to be added.
39 */
40 public IBatchOperationTarget getNewTarget() {
41 return newTarget;
42 }
43
44}