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