blob: 589c9317c088fcf1b0cfb967625f66346d23983f [file] [log] [blame]
Pankaj Berde1b8a42f2013-02-15 08:25:03 -08001package net.floodlightcontroller.core;
2
3import org.codehaus.jackson.annotate.JsonIgnore;
4import org.codehaus.jackson.annotate.JsonProperty;
5
6import com.tinkerpop.blueprints.Direction;
7import com.tinkerpop.frames.Adjacency;
8import com.tinkerpop.frames.Incidence;
9import com.tinkerpop.frames.Property;
10import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy;
11import com.tinkerpop.frames.VertexFrame;
12
13public interface INetMapTopologyObjects {
14
15public interface IBaseObject extends VertexFrame {
16
17 @JsonProperty("state")
18 @Property("state")
19 public String getState();
Pankaj Berde1cde50b2013-02-19 20:16:06 -080020
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080021 @Property("state")
22 public void setState(final String state);
23
24 @JsonIgnore
25 @Property("type")
26 public String getType();
27 @Property("type")
28 public void setType(final String type);
29
30}
31
32public interface ISwitchObject extends IBaseObject{
33
34 @JsonProperty("dpid")
35 @Property("dpid")
36 public String getDPID();
37
38 @Property("dpid")
39 public void setDPID(String dpid);
40
41 @JsonProperty("ports")
42 @Adjacency(label="on")
43 public Iterable<IPortObject> getPorts();
44
45 @Adjacency(label="on")
Pankaj Berdeda809572013-02-22 15:31:20 -080046 public IPortObject getPort(final short port_num);
47
48 @Adjacency(label="on")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080049 public void addPort(final IPortObject port);
50
51 @Adjacency(label="on")
52 public void removePort(final IPortObject port);
53
54 @JsonIgnore
55 @GremlinGroovy("_().out('on').out('host')")
56 public Iterable<IDeviceObject> getDevices();
57 }
58
59 public interface IPortObject extends IBaseObject{
60
61 @JsonProperty("number")
62 @Property("number")
63 public Short getNumber();
64
65 @JsonProperty("desc")
66 @Property("desc")
67 public String getDesc();
68
69 @JsonIgnore
70 @Incidence(label="on",direction = Direction.IN)
71 public ISwitchObject getSwitch();
72
Pankaj Berdeac1a8c32013-02-26 17:45:57 -080073
74 @JsonProperty("devices")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080075 @Adjacency(label="host")
76 public Iterable<IDeviceObject> getDevices();
77
78 @Adjacency(label="host")
79 public void setDevice(final IDeviceObject device);
80
81 @Adjacency(label="host")
82 public void removeDevice(final IDeviceObject device);
83
84// @JsonIgnore
85// @Adjacency(label="link")
86// public Iterable<ILinkObject> getLinks();
87 }
88
89 public interface IDeviceObject extends IBaseObject {
90
91 @JsonProperty("mac")
92 @Property("dl_addr")
93 public String getMACAddress();
94 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -080095 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080096
97 @JsonProperty("ipv4")
98 @Property("nw_addr")
99 public String getIPAddress();
100 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800101 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800102
103 @JsonIgnore
104 @Incidence(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800105 public Iterable<IPortObject> getAttachedPorts();
106
107 @JsonIgnore
108 @Incidence(label="host",direction=Direction.IN)
109 public void setHostPort(final IPortObject port);
110
111 @JsonIgnore
112 @Incidence(label="host",direction=Direction.IN)
113 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800114
115 @JsonIgnore
116 @GremlinGroovy("_().in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800117 public Iterable<ISwitchObject> getSwitch();
118
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800119/* @JsonProperty("dpid")
120 @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
121 public Iterable<String> getSwitchDPID();
122
123 @JsonProperty("number")
124 @GremlinGroovy("_().in('host').transform{it.number}")
125 public Iterable<Short> getPortNumber();
126
Pankaj Berde2497e542013-02-19 18:51:24 -0800127 @JsonProperty("AttachmentPoint")
128 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
Pankaj Berdeac1a8c32013-02-26 17:45:57 -0800129 public Iterable<SwitchPort> getAttachmentPoints();*/
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800130 }
Pavlin Radoslavovb6f53542013-03-01 16:02:14 -0800131
132public interface IFlowPath extends IBaseObject {
133 @Property("flow_id")
134 public String getFlowId();
135
136 @Property("flow_id")
137 public void setFlowId(String flowId);
138
139 @Property("installer_id")
140 public String getInstallerId();
141
142 @Property("installer_id")
143 public void setInstallerId(String installerId);
144
145 @Property("src_switch")
146 public String getSrcSwitch();
147
148 @Property("src_switch")
149 public void setSrcSwitch(String srcSwitch);
150
151 @Property("src_port")
152 public Short getSrcPort();
153
154 @Property("src_port")
155 public void setSrcPort(Short srcPort);
156
157 @Property("dst_switch")
158 public String getDstSwitch();
159
160 @Property("dst_switch")
161 public void setDstSwitch(String dstSwitch);
162
163 @Property("dst_port")
164 public Short getDstPort();
165
166 @Property("dst_port")
167 public void setDstPort(Short dstPort);
168
169 @Adjacency(label="flow", direction=Direction.IN)
170 public Iterable<IFlowEntry> getFlowEntries();
171
172 @Adjacency(label="flow", direction=Direction.IN)
173 public void addFlowEntry(final IFlowEntry flowEntry);
174
175 @Adjacency(label="flow", direction=Direction.IN)
176 public void removeFlowEntry(final IFlowEntry flowEntry);
177 }
178
179public interface IFlowEntry extends IBaseObject {
180 @Property("flow_entry_id")
181 public String getFlowEntryId();
182
183 @Property("flow_entry_id")
184 public void setFlowEntryId(String flowEntryId);
185
186 @Property("switch_dpid")
187 public String getSwitchDpid();
188
189 @Property("switch_dpid")
190 public void setSwitchDpid(String switchDpid);
191
192 @Property("in_port")
193 public Short getInPort();
194
195 @Property("in_port")
196 public void setInPort(Short inPort);
197
198 @Property("out_port")
199 public Short getOutPort();
200
201 @Property("out_port")
202 public void setOutPort(Short outPort);
203
204 @Property("user_state")
205 public String getUserState();
206
207 @Property("user_state")
208 public void setUserState(String userState);
209
210 @Property("switch_state")
211 public String getSwitchState();
212
213 @Property("switch_state")
214 public void setSwitchState(String switchState);
215
216 @Property("error_state_type")
217 public String getErrorStateType();
218
219 @Property("error_state_type")
220 public void setErrorStateType(String errorStateType);
221
222 @Property("error_state_code")
223 public String getErrorStateCode();
224
225 @Property("error_state_code")
226 public void setErrorStateCode(String errorStateCode);
227 }
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800228}