blob: 6a2cf8c93cae54a91305166e04a23310193e8a89 [file] [log] [blame]
Toshio Koidea03915e2014-07-01 18:39:52 -07001package net.onrc.onos.core.newintent;
2
3import java.util.Collection;
4import java.util.EventListener;
5
6import net.onrc.onos.api.batchoperation.BatchOperation;
7import net.onrc.onos.api.flowmanager.ConflictDetectionPolicy;
8import net.onrc.onos.api.flowmanager.IFlow;
9import net.onrc.onos.api.intent.IIntentRuntimeService;
10import net.onrc.onos.api.intent.Intent;
11
12/**
13 * Implementation of Intent-Runtime Service.
14 * <p>
15 * TODO: Make all methods thread-safe. <br>
16 * TODO: Design methods to support the ReactiveForwarding and the SDN-IP.
17 */
18public class IntentRuntimeModule implements IIntentRuntimeService {
19
20 @Override
21 public boolean addIntent(Intent intent) {
22 BatchOperation<Intent> ops = new BatchOperation<Intent>();
23 ops.addAddOperation(intent);
24 return executeBatch(ops);
25 }
26
27 @Override
28 public boolean removeIntent(String id) {
29 BatchOperation<Intent> ops = new BatchOperation<Intent>();
30 ops.addRemoveOperation(id);
31 return executeBatch(ops);
32 }
33
34 @Override
35 public boolean updateIntent(String id, Intent intent) {
36 BatchOperation<Intent> ops = new BatchOperation<Intent>();
37 ops.addUpdateOperation(id, intent);
38 return executeBatch(ops);
39 }
40
41 @Override
42 public Intent getIntent(String id) {
43 // TODO Auto-generated method stub
44 // - retrieves intents from global distributed maps
45 return null;
46 }
47
48 @Override
49 public Collection<Intent> getIntents() {
50 // TODO Auto-generated method stub
51 // - retrieves intents from global distributed maps
52 return null;
53 }
54
55 @Override
56 public boolean executeBatch(BatchOperation<Intent> ops) {
57 // TODO Auto-generated method stub
58 // - gets flow operations using compile() method for each Intent object.
59 // - allocates resources
60 // - combines and executes flow operations using FlowManager Service.
61 // - updates global distributed maps
62 return false;
63 }
64
65 @Override
66 public Collection<IFlow> getFlows(String intentId) {
67 // TODO Auto-generated method stub
68 return null;
69 }
70
71 @Override
72 public Intent getIntentByFlow(String flowId) {
73 // TODO Auto-generated method stub
74 return null;
75 }
76
77 @Override
78 public void setConflictDetectionPolicy(ConflictDetectionPolicy policy) {
79 // TODO Auto-generated method stub
80
81 }
82
83 @Override
84 public ConflictDetectionPolicy getConflictDetectionPolicy() {
85 // TODO Auto-generated method stub
86 return null;
87 }
88
89 @Override
90 public void addEventListener(EventListener listener) {
91 // TODO Auto-generated method stub
92 // - listener for addition/removal of intents,
93 // and states changes of intents
94 }
95
96 @Override
97 public void removeEventListener(EventListener listener) {
98 // TODO Auto-generated method stub
99
100 }
101}