blob: d0cf90f710524e2ff3403027e9f44d24bd4a00e3 [file] [log] [blame]
Pankaj Berde1b8a42f2013-02-15 08:25:03 -08001package net.floodlightcontroller.core;
2
Pankaj Berde2497e542013-02-19 18:51:24 -08003import java.util.List;
4
5import net.floodlightcontroller.devicemanager.SwitchPort;
6
Pankaj Berde1b8a42f2013-02-15 08:25:03 -08007import org.codehaus.jackson.annotate.JsonIgnore;
8import org.codehaus.jackson.annotate.JsonProperty;
9
10import com.tinkerpop.blueprints.Direction;
11import com.tinkerpop.frames.Adjacency;
12import com.tinkerpop.frames.Incidence;
13import com.tinkerpop.frames.Property;
14import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy;
15import com.tinkerpop.frames.VertexFrame;
16
17public interface INetMapTopologyObjects {
18
19public interface IBaseObject extends VertexFrame {
20
21 @JsonProperty("state")
22 @Property("state")
23 public String getState();
24 @Property("state")
25 public void setState(final String state);
26
27 @JsonIgnore
28 @Property("type")
29 public String getType();
30 @Property("type")
31 public void setType(final String type);
32
33}
34
35public interface ISwitchObject extends IBaseObject{
36
37 @JsonProperty("dpid")
38 @Property("dpid")
39 public String getDPID();
40
41 @Property("dpid")
42 public void setDPID(String dpid);
43
44 @JsonProperty("ports")
45 @Adjacency(label="on")
46 public Iterable<IPortObject> getPorts();
47
48 @Adjacency(label="on")
49 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
73 @JsonIgnore
74 @Adjacency(label="host")
75 public Iterable<IDeviceObject> getDevices();
76
77 @Adjacency(label="host")
78 public void setDevice(final IDeviceObject device);
79
80 @Adjacency(label="host")
81 public void removeDevice(final IDeviceObject device);
82
83// @JsonIgnore
84// @Adjacency(label="link")
85// public Iterable<ILinkObject> getLinks();
86 }
87
88 public interface IDeviceObject extends IBaseObject {
89
90 @JsonProperty("mac")
91 @Property("dl_addr")
92 public String getMACAddress();
93 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -080094 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080095
96 @JsonProperty("ipv4")
97 @Property("nw_addr")
98 public String getIPAddress();
99 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800100 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800101
102 @JsonIgnore
103 @Incidence(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800104 public Iterable<IPortObject> getAttachedPorts();
105
106 @JsonIgnore
107 @Incidence(label="host",direction=Direction.IN)
108 public void setHostPort(final IPortObject port);
109
110 @JsonIgnore
111 @Incidence(label="host",direction=Direction.IN)
112 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800113
114 @JsonIgnore
115 @GremlinGroovy("_().in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800116 public Iterable<ISwitchObject> getSwitch();
117
118 @JsonProperty("AttachmentPoint")
119 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
120 public List<SwitchPort> getAttachmentPoints();
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800121 }
122}