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