blob: 1cf6f7b7b81d5ffc55a93b83f97a0acd16788fd8 [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();
Pankaj Berde1cde50b2013-02-19 20:16:06 -080024
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080025 @Property("state")
26 public void setState(final String state);
27
28 @JsonIgnore
29 @Property("type")
30 public String getType();
31 @Property("type")
32 public void setType(final String type);
33
34}
35
36public interface ISwitchObject extends IBaseObject{
37
38 @JsonProperty("dpid")
39 @Property("dpid")
40 public String getDPID();
41
42 @Property("dpid")
43 public void setDPID(String dpid);
44
45 @JsonProperty("ports")
46 @Adjacency(label="on")
47 public Iterable<IPortObject> getPorts();
48
49 @Adjacency(label="on")
Pankaj Berdeda809572013-02-22 15:31:20 -080050 public IPortObject getPort(final short port_num);
51
52 @Adjacency(label="on")
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080053 public void addPort(final IPortObject port);
54
55 @Adjacency(label="on")
56 public void removePort(final IPortObject port);
57
58 @JsonIgnore
59 @GremlinGroovy("_().out('on').out('host')")
60 public Iterable<IDeviceObject> getDevices();
61 }
62
63 public interface IPortObject extends IBaseObject{
64
65 @JsonProperty("number")
66 @Property("number")
67 public Short getNumber();
68
69 @JsonProperty("desc")
70 @Property("desc")
71 public String getDesc();
72
73 @JsonIgnore
74 @Incidence(label="on",direction = Direction.IN)
75 public ISwitchObject getSwitch();
76
77 @JsonIgnore
78 @Adjacency(label="host")
79 public Iterable<IDeviceObject> getDevices();
80
81 @Adjacency(label="host")
82 public void setDevice(final IDeviceObject device);
83
84 @Adjacency(label="host")
85 public void removeDevice(final IDeviceObject device);
86
87// @JsonIgnore
88// @Adjacency(label="link")
89// public Iterable<ILinkObject> getLinks();
90 }
91
92 public interface IDeviceObject extends IBaseObject {
93
94 @JsonProperty("mac")
95 @Property("dl_addr")
96 public String getMACAddress();
97 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -080098 public void setMACAddress(String macaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -080099
100 @JsonProperty("ipv4")
101 @Property("nw_addr")
102 public String getIPAddress();
103 @Property("dl_addr")
Pankaj Berde2497e542013-02-19 18:51:24 -0800104 public void setIPAddress(String ipaddr);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800105
106 @JsonIgnore
107 @Incidence(label="host",direction = Direction.IN)
Pankaj Berde2497e542013-02-19 18:51:24 -0800108 public Iterable<IPortObject> getAttachedPorts();
109
110 @JsonIgnore
111 @Incidence(label="host",direction=Direction.IN)
112 public void setHostPort(final IPortObject port);
113
114 @JsonIgnore
115 @Incidence(label="host",direction=Direction.IN)
116 public void removeHostPort(final IPortObject port);
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800117
118 @JsonIgnore
119 @GremlinGroovy("_().in('host').in('on')")
Pankaj Berde2497e542013-02-19 18:51:24 -0800120 public Iterable<ISwitchObject> getSwitch();
121
122 @JsonProperty("AttachmentPoint")
123 @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
124 public List<SwitchPort> getAttachmentPoints();
Pankaj Berde1b8a42f2013-02-15 08:25:03 -0800125 }
126}