blob: 93d64591e24894bec3f7aca51b2d1b3d52278fa2 [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.api.intent;
2
3import java.util.List;
4
5import net.onrc.onos.api.batchoperation.BatchOperation;
6import net.onrc.onos.api.batchoperation.IBatchOperationTarget;
7import net.onrc.onos.api.flowmanager.IFlow;
8
9/**
10 * The base class for the connectivity abstraction. It allows applications to
11 * specify end hosts, apply some basic filtering to traffic, and constrain
12 * traffic.
13 * <p>
14 * This class is sub-classed to provide other intent types like shortest path
15 * connectivity and bandwidth constrained shortest path connectivity.
16 * <p>
17 * The reasoning behind "intent" is that the applications can provide some
18 * abstract representation of how traffic should flow be handled by the
19 * networking, allowing the network OS to compile, reserve and optimize the
20 * data-plane to satisfy those constraints.
21 */
22public abstract class Intent implements IBatchOperationTarget {
23 protected String id;
24
25 /**
26 * Constructor.
27 *
28 * @param id ID for this Intent object.
29 */
30 public Intent(String id) {
31 this.id = id;
32 }
33
34 /**
35 * Gets ID for this Intent object.
36 *
37 * @return ID for this Intent object.
38 */
39 @Override
40 public String getId() {
41 return id;
42 }
43
44 /**
45 * Compiles this Intent object to the list of FlowOperations.
46 * <p>
47 * All Intent object must implement this method and IntentRuntimeModule use
48 * this method to process this Intent.
49 *
50 * @return The list of FlowOperations of this Intent.
51 */
52 public abstract List<BatchOperation<IFlow>> compile();
53}