blob: 2521e567aa222e4edd18f0552218ad31c46a95d5 [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;
Sho SHIMIZU308a45a2014-07-23 11:27:04 -070012import net.onrc.onos.api.intent.IntentInstaller;
Sho SHIMIZU113c0272014-07-22 22:07:26 -070013import net.onrc.onos.api.intent.IntentResolver;
Toshio Koidea03915e2014-07-01 18:39:52 -070014
15/**
16 * Implementation of Intent-Runtime Service.
17 * <p>
18 * TODO: Make all methods thread-safe. <br>
19 * TODO: Design methods to support the ReactiveForwarding and the SDN-IP.
20 */
21public class IntentRuntimeModule implements IIntentRuntimeService {
22
23 @Override
24 public boolean addIntent(Intent intent) {
25 BatchOperation<Intent> ops = new BatchOperation<Intent>();
26 ops.addAddOperation(intent);
27 return executeBatch(ops);
28 }
29
30 @Override
Toshio Koide025a9152014-07-21 11:00:34 -070031 public boolean removeIntent(IntentId id) {
Toshio Koidea03915e2014-07-01 18:39:52 -070032 BatchOperation<Intent> ops = new BatchOperation<Intent>();
33 ops.addRemoveOperation(id);
34 return executeBatch(ops);
35 }
36
37 @Override
Toshio Koide025a9152014-07-21 11:00:34 -070038 public boolean updateIntent(IntentId id, Intent intent) {
Toshio Koidea03915e2014-07-01 18:39:52 -070039 BatchOperation<Intent> ops = new BatchOperation<Intent>();
40 ops.addUpdateOperation(id, intent);
41 return executeBatch(ops);
42 }
43
44 @Override
Toshio Koide025a9152014-07-21 11:00:34 -070045 public Intent getIntent(IntentId id) {
Toshio Koidea03915e2014-07-01 18:39:52 -070046 // TODO Auto-generated method stub
47 // - retrieves intents from global distributed maps
48 return null;
49 }
50
51 @Override
52 public Collection<Intent> getIntents() {
53 // TODO Auto-generated method stub
54 // - retrieves intents from global distributed maps
55 return null;
56 }
57
58 @Override
59 public boolean executeBatch(BatchOperation<Intent> ops) {
60 // TODO Auto-generated method stub
61 // - gets flow operations using compile() method for each Intent object.
62 // - allocates resources
63 // - combines and executes flow operations using FlowManager Service.
64 // - updates global distributed maps
65 return false;
66 }
67
68 @Override
Sho SHIMIZU113c0272014-07-22 22:07:26 -070069 public <T extends Intent> void addResolver(Class<T> type, IntentResolver<T> resolver) {
70 //To change body of implemented methods use File | Settings | File Templates.
71 }
72
73 @Override
74 public <T extends Intent> void removeResolver(Class<T> type) {
75 //To change body of implemented methods use File | Settings | File Templates.
76 }
77
78 @Override
Sho SHIMIZU308a45a2014-07-23 11:27:04 -070079 public <T extends Intent> boolean addInstaller(Class<T> type, IntentInstaller<T> installer) {
80 // TODO: implement this method
81 return false;
82 }
83
84 @Override
85 public <T extends Intent> boolean removeInstaller(Class<T> type) {
86 // TODO: impelment this method
87 return false;
88 }
89
90 @Override
Toshio Koidea03915e2014-07-01 18:39:52 -070091 public Collection<IFlow> getFlows(String intentId) {
92 // TODO Auto-generated method stub
93 return null;
94 }
95
96 @Override
97 public Intent getIntentByFlow(String flowId) {
98 // TODO Auto-generated method stub
99 return null;
100 }
101
102 @Override
103 public void setConflictDetectionPolicy(ConflictDetectionPolicy policy) {
104 // TODO Auto-generated method stub
105
106 }
107
108 @Override
109 public ConflictDetectionPolicy getConflictDetectionPolicy() {
110 // TODO Auto-generated method stub
111 return null;
112 }
113
114 @Override
115 public void addEventListener(EventListener listener) {
116 // TODO Auto-generated method stub
117 // - listener for addition/removal of intents,
118 // and states changes of intents
119 }
120
121 @Override
122 public void removeEventListener(EventListener listener) {
123 // TODO Auto-generated method stub
124
125 }
126}