blob: ab775b92ca3ddab42d4d7a489fc40c83c958deff [file] [log] [blame]
Pankaj Berde85016ab2013-06-21 11:34:53 -07001package net.onrc.onos.graph;
2
3import java.util.ArrayList;
Jonathan Hartd6ed62b2013-11-01 13:18:25 -07004import java.util.Iterator;
Pankaj Berde85016ab2013-06-21 11:34:53 -07005import java.util.List;
6
Jonathan Hartd6ed62b2013-11-01 13:18:25 -07007import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IBaseObject;
Pankaj Berde85016ab2013-06-21 11:34:53 -07008import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IDeviceObject;
9import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
10import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
Jonathan Hartd6ed62b2013-11-01 13:18:25 -070011import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IIpv4Address;
Pankaj Berde85016ab2013-06-21 11:34:53 -070012import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
13import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
14import net.onrc.onos.ofcontroller.core.ISwitchStorage.SwitchState;
15import net.onrc.onos.ofcontroller.util.FlowEntryId;
16import net.onrc.onos.ofcontroller.util.FlowId;
17
18import com.thinkaurelius.titan.core.TitanGraph;
19import com.tinkerpop.blueprints.Vertex;
20import com.tinkerpop.frames.FramedGraph;
21import com.tinkerpop.frames.structures.FramedVertexIterable;
22import com.tinkerpop.gremlin.java.GremlinPipeline;
23
24public class GraphDBOperation implements IDBOperation {
25 private GraphDBConnection conn;
26
27 /**
28 * Create a GraphDBOperation instance from specified GraphDBConnection's instance.
29 * @param dbConnection an instance of GraphDBConnection
30 */
31 public GraphDBOperation(GraphDBConnection dbConnection) {
32 this.conn = dbConnection;
33 }
34
35 /**
36 * Create a GraphDBOperation instance from database configuration path.
37 * @param dbConfPath a path for database configuration file.
38 */
39 public GraphDBOperation(final String dbConfPath) {
40 this.conn = GraphDBConnection.getInstance(dbConfPath);
41 }
42
43 /**
44 * Create a new switch and return the created switch object.
45 * @param dpid DPID of the switch
46 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -080047 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -070048 public ISwitchObject newSwitch(String dpid) {
Yuta HIGUCHIba98be32013-12-11 17:01:08 -080049 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Pankaj Berde85016ab2013-06-21 11:34:53 -070050 ISwitchObject obj = fg.addVertex(null,ISwitchObject.class);
51 if (obj != null) {
52 obj.setType("switch");
53 obj.setDPID(dpid);
54 }
55 return obj;
56 }
57
58 /**
59 * Search and get a switch object with DPID.
Yuta HIGUCHIba98be32013-12-11 17:01:08 -080060 * @param dpid DPID of the switch
Pankaj Berde85016ab2013-06-21 11:34:53 -070061 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -080062 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -070063 public ISwitchObject searchSwitch(String dpid) {
Pankaj Berdebbd38612013-06-22 05:59:12 -070064
Pankaj Berde85016ab2013-06-21 11:34:53 -070065 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Yuta HIGUCHI701a5eb2013-12-14 09:02:43 -080066 if ( fg == null ) return null;
67 Iterator<ISwitchObject> it = fg.getVertices("dpid",dpid,ISwitchObject.class).iterator();
68 return (it.hasNext()) ? it.next() : null;
69
Pankaj Berde85016ab2013-06-21 11:34:53 -070070 }
71
72 /**
73 * Search and get an active switch object with DPID.
Yuta HIGUCHIba98be32013-12-11 17:01:08 -080074 * @param dpid DPID of the switch
Pankaj Berde85016ab2013-06-21 11:34:53 -070075 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -080076 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -070077 public ISwitchObject searchActiveSwitch(String dpid) {
Yuta HIGUCHIba98be32013-12-11 17:01:08 -080078
Pankaj Berde85016ab2013-06-21 11:34:53 -070079 ISwitchObject sw = searchSwitch(dpid);
80 if ((sw != null) &&
81 sw.getState().equals(SwitchState.ACTIVE.toString())) {
82 return sw;
83 }
84 return null;
85 }
86
87 /**
88 * Get all switch objects.
89 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -080090 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -070091 public Iterable<ISwitchObject> getAllSwitches() {
92 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
93 Iterable<ISwitchObject> switches = fg.getVertices("type","switch",ISwitchObject.class);
94 return switches;
95 }
96
97 /**
98 * Get all active switch objects.
99 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800100 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700101 public Iterable<ISwitchObject> getActiveSwitches() {
102 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
103 Iterable<ISwitchObject> switches = fg.getVertices("type","switch",ISwitchObject.class);
104 List<ISwitchObject> activeSwitches = new ArrayList<ISwitchObject>();
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800105
Pankaj Berde85016ab2013-06-21 11:34:53 -0700106 for (ISwitchObject sw: switches) {
107 if(sw.getState().equals(SwitchState.ACTIVE.toString())) {
108 activeSwitches.add(sw);
109 }
110 }
111 return activeSwitches;
112 }
113
114 /**
115 * Get all inactive switch objects.
116 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800117 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700118 public Iterable<ISwitchObject> getInactiveSwitches() {
119 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
120 Iterable<ISwitchObject> switches = fg.getVertices("type","switch",ISwitchObject.class);
121 List<ISwitchObject> inactiveSwitches = new ArrayList<ISwitchObject>();
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800122
Pankaj Berde85016ab2013-06-21 11:34:53 -0700123 for (ISwitchObject sw: switches) {
124 if(sw.getState().equals(SwitchState.INACTIVE.toString())) {
125 inactiveSwitches.add(sw);
126 }
127 }
128 return inactiveSwitches;
129 }
130
131 /**
132 * Get all flow entries' objects where their switches are not updated.
133 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800134 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700135 public Iterable<IFlowEntry> getAllSwitchNotUpdatedFlowEntries() {
136 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
137 //TODO: Should use an enum for flow_switch_state
138 return fg.getVertices("switch_state", "FE_SWITCH_NOT_UPDATED", IFlowEntry.class);
139 }
140
141 /**
142 * Remove specified switch.
143 * @param sw switch object to remove
144 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800145 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700146 public void removeSwitch(ISwitchObject sw) {
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800147 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
148 fg.removeVertex(sw.asVertex());
Pankaj Berde85016ab2013-06-21 11:34:53 -0700149 }
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800150
Pankaj Berdebbd38612013-06-22 05:59:12 -0700151 @Override
152 public IPortObject newPort(String dpid, Short portNumber) {
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800153 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Pankaj Berdebbd38612013-06-22 05:59:12 -0700154 IPortObject obj = fg.addVertex(null,IPortObject.class);
155 if (obj != null) {
156 obj.setType("port");
157 String id = dpid + portNumber.toString();
158 obj.setPortId(id);
159 obj.setNumber(portNumber);
160 }
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800161 return obj;
162
Pankaj Berdebbd38612013-06-22 05:59:12 -0700163 }
Pankaj Berde85016ab2013-06-21 11:34:53 -0700164
165 /**
166 * Create a port having specified port number.
167 * @param portNumber port number
168 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800169 @Override
Pankaj Berdebbd38612013-06-22 05:59:12 -0700170 @Deprecated
Pankaj Berde85016ab2013-06-21 11:34:53 -0700171 public IPortObject newPort(Short portNumber) {
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800172 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Pankaj Berde85016ab2013-06-21 11:34:53 -0700173 IPortObject obj = fg.addVertex(null,IPortObject.class);
174 if (obj != null) {
175 obj.setType("port");
176 obj.setNumber(portNumber);
177 }
178 return obj;
179 }
180
181 /**
182 * Search and get a port object of specified switch and port number.
183 * @param dpid DPID of a switch
184 * @param number port number of the switch's port
185 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800186 @Override
Pankaj Berdebbd38612013-06-22 05:59:12 -0700187 public IPortObject searchPort(String dpid, Short number) {
188 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Yuta HIGUCHI6039faf2013-12-11 16:28:11 -0800189 if ( fg == null ) return null;
Pankaj Berdebbd38612013-06-22 05:59:12 -0700190 String id = dpid + number.toString();
Yuta HIGUCHI6039faf2013-12-11 16:28:11 -0800191 Iterator<IPortObject> ports = fg.getVertices("port_id",id,IPortObject.class).iterator();
192 if ( ports.hasNext() ) {
193 return ports.next();
194 } else {
195 return null;
196 }
Pankaj Berde85016ab2013-06-21 11:34:53 -0700197 }
198
199 /**
200 * Remove the specified switch port.
201 * @param port switch port object to remove
202 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800203 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700204 public void removePort(IPortObject port) {
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800205 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Pankaj Berde85016ab2013-06-21 11:34:53 -0700206// EventGraph<TitanGraph> eg = conn.getEventGraph();
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800207 if (fg != null) fg.removeVertex(port.asVertex());
Pankaj Berde85016ab2013-06-21 11:34:53 -0700208 }
209
210 /**
211 * Create and return a device object.
212 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800213 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700214 public IDeviceObject newDevice() {
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800215 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Pankaj Berde85016ab2013-06-21 11:34:53 -0700216 IDeviceObject obj = fg.addVertex(null,IDeviceObject.class);
217 if (obj != null) obj.setType("device");
218 return obj;
219 }
220
221 /**
222 * Search and get a device object having specified MAC address.
223 * @param macAddr MAC address to search and get
224 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800225 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700226 public IDeviceObject searchDevice(String macAddr) {
Yuta HIGUCHI6039faf2013-12-11 16:28:11 -0800227 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
228 if ( fg == null ) return null;
229 Iterator<IDeviceObject> devices = fg.getVertices("dl_addr",macAddr, IDeviceObject.class).iterator();
230 if ( devices.hasNext() ) {
231 return devices.next();
232 } else {
233 return null;
234 }
Pankaj Berde85016ab2013-06-21 11:34:53 -0700235 }
236
237 /**
238 * Get all devices.
239 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800240 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700241 public Iterable<IDeviceObject> getDevices() {
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800242 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Pankaj Berde85016ab2013-06-21 11:34:53 -0700243 return fg != null ? fg.getVertices("type","device",IDeviceObject.class) : null;
244 }
245
246 /**
247 * Remove the specified device.
248 * @param dev a device object to remove
249 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800250 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700251 public void removeDevice(IDeviceObject dev) {
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800252 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
253 if (fg != null) fg.removeVertex(dev.asVertex());
Pankaj Berde85016ab2013-06-21 11:34:53 -0700254 }
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800255
Jonathan Hartd6ed62b2013-11-01 13:18:25 -0700256 public IIpv4Address newIpv4Address() {
257 return newVertex("ipv4Address", IIpv4Address.class);
258 }
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800259
Jonathan Hartd6ed62b2013-11-01 13:18:25 -0700260 private <T extends IBaseObject> T newVertex(String type, Class<T> vertexType) {
261 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
262 T newVertex = fg.addVertex(null, vertexType);
263 if (newVertex != null) {
264 newVertex.setType(type);
265 }
266 return newVertex;
267 }
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800268
Jonathan Hartd6ed62b2013-11-01 13:18:25 -0700269 public IIpv4Address searchIpv4Address(int intIpv4Address) {
270 return searchForVertex("ipv4_address", intIpv4Address, IIpv4Address.class);
271 }
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800272
Jonathan Hartd6ed62b2013-11-01 13:18:25 -0700273 private <T> T searchForVertex(String propertyName, Object propertyValue, Class<T> vertexType) {
274 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
275 if (fg != null) {
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800276 Iterator<T> it =
Jonathan Hartd6ed62b2013-11-01 13:18:25 -0700277 fg.getVertices(propertyName, propertyValue, vertexType).iterator();
278 if (it.hasNext()) {
279 return it.next();
280 }
281 }
282 return null;
283 }
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800284
Jonathan Hartd6ed62b2013-11-01 13:18:25 -0700285 public IIpv4Address ensureIpv4Address(int intIpv4Address) {
286 IIpv4Address ipv4Vertex = searchIpv4Address(intIpv4Address);
287 if (ipv4Vertex == null) {
288 ipv4Vertex = newIpv4Address();
289 ipv4Vertex.setIpv4Address(intIpv4Address);
290 }
291 return ipv4Vertex;
292 }
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800293
Jonathan Hart4fce4ed2013-11-01 21:29:21 -0700294 public void removeIpv4Address(IIpv4Address ipv4Address) {
295 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
296 fg.removeVertex(ipv4Address.asVertex());
297 }
Pankaj Berde85016ab2013-06-21 11:34:53 -0700298
299 /**
300 * Create and return a flow path object.
301 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800302 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700303 public IFlowPath newFlowPath() {
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800304 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Pankaj Berde85016ab2013-06-21 11:34:53 -0700305 IFlowPath flowPath = fg.addVertex(null, IFlowPath.class);
306 if (flowPath != null) flowPath.setType("flow");
307 return flowPath;
308 }
309
310 /**
311 * Search and get a flow path object with specified flow ID.
312 * @param flowId flow ID to search
313 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800314 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700315 public IFlowPath searchFlowPath(FlowId flowId) {
316 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Yuta HIGUCHI6039faf2013-12-11 16:28:11 -0800317 if ( fg == null ) return null;
318 Iterator<IFlowPath> flowpaths = fg.getVertices("flow_id", flowId.toString(), IFlowPath.class).iterator();
319 if ( flowpaths.hasNext() ) {
320 return flowpaths.next();
321 } else {
322 return null;
323 }
Pankaj Berde85016ab2013-06-21 11:34:53 -0700324 }
325
326 /**
327 * Get a flow path object with a flow entry.
328 * @param flowEntry flow entry object
329 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800330 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700331 public IFlowPath getFlowPathByFlowEntry(IFlowEntry flowEntry) {
Naoki Shiota991093a2013-12-10 14:47:18 -0800332 GremlinPipeline<Vertex, Vertex> pipe = new GremlinPipeline<Vertex, Vertex>();
333 pipe.start(flowEntry.asVertex()).out("flow");
Naoki Shiotae2f4da72013-12-09 16:34:17 -0800334 FramedVertexIterable<IFlowPath> r = new FramedVertexIterable<IFlowPath>(conn.getFramedGraph(),
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800335 pipe, IFlowPath.class);
Pankaj Berde85016ab2013-06-21 11:34:53 -0700336 return r.iterator().hasNext() ? r.iterator().next() : null;
337 }
338
339 /**
340 * Get all flow path objects.
341 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800342 @Override
343 public Iterable<IFlowPath> getAllFlowPaths() {
Pankaj Berde85016ab2013-06-21 11:34:53 -0700344 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
345 Iterable<IFlowPath> flowPaths = fg.getVertices("type", "flow", IFlowPath.class);
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800346
Pankaj Berde85016ab2013-06-21 11:34:53 -0700347 List<IFlowPath> nonNullFlows = new ArrayList<IFlowPath>();
348
349 for (IFlowPath fp: flowPaths) {
350 if (fp.getFlowId() != null) {
351 nonNullFlows.add(fp);
352 }
353 }
354 return nonNullFlows;
355 }
356
357 /**
358 * Remove the specified flow path.
359 * @param flowPath flow path object to remove
360 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800361 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700362 public void removeFlowPath(IFlowPath flowPath) {
363 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
364 fg.removeVertex(flowPath.asVertex());
365 }
366
367 /**
368 * Create and return a flow entry object.
369 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800370 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700371 public IFlowEntry newFlowEntry() {
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800372 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Pankaj Berde85016ab2013-06-21 11:34:53 -0700373 IFlowEntry flowEntry = fg.addVertex(null, IFlowEntry.class);
374 if (flowEntry != null) flowEntry.setType("flow_entry");
375 return flowEntry;
376 }
377
378 /**
379 * Search and get a flow entry object with flow entry ID.
380 * @param flowEntryId flow entry ID to search
381 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800382 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700383 public IFlowEntry searchFlowEntry(FlowEntryId flowEntryId) {
384 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Yuta HIGUCHI6039faf2013-12-11 16:28:11 -0800385 if ( fg == null ) return null;
386 Iterator<IFlowEntry> flowentries = fg.getVertices("flow_entry_id", flowEntryId.toString(), IFlowEntry.class).iterator();
387 if ( flowentries.hasNext() ) {
388 return flowentries.next();
389 } else {
390 return null;
391 }
Pankaj Berde85016ab2013-06-21 11:34:53 -0700392 }
393
394 /**
395 * Get all flow entry objects.
396 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800397 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700398 public Iterable<IFlowEntry> getAllFlowEntries() {
399 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800400
Pankaj Berde85016ab2013-06-21 11:34:53 -0700401 return fg.getVertices("type", "flow_entry", IFlowEntry.class);
402 }
403
404 /**
405 * Remove the specified flow entry.
406 * @param flowEntry flow entry object to remove
407 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800408 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700409 public void removeFlowEntry(IFlowEntry flowEntry) {
410 FramedGraph<TitanGraph> fg = conn.getFramedGraph();
411 fg.removeVertex(flowEntry.asVertex());
412 }
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800413
Pankaj Berde85016ab2013-06-21 11:34:53 -0700414 /**
415 * Get the instance of GraphDBConnection assigned to this class.
416 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800417 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700418 public IDBConnection getDBConnection() {
419 return conn;
420 }
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800421
Pankaj Berde85016ab2013-06-21 11:34:53 -0700422 /**
423 * Commit changes for the graph.
424 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800425 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700426 public void commit() {
427 conn.commit();
428 }
429
430 /**
431 * Rollback changes for the graph.
432 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800433 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700434 public void rollback() {
435 conn.rollback();
436 }
437
438 /**
439 * Close the connection of the assigned GraphDBConnection.
440 */
Yuta HIGUCHIba98be32013-12-11 17:01:08 -0800441 @Override
Pankaj Berde85016ab2013-06-21 11:34:53 -0700442 public void close() {
443 conn.close();
444 }
Pankaj Berdebbd38612013-06-22 05:59:12 -0700445
446
Pankaj Berde85016ab2013-06-21 11:34:53 -0700447}