yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 1 | /* |
| 2 | * To change this template, choose Tools | Templates |
| 3 | * and open the template in the editor. |
| 4 | */ |
| 5 | package net.onrc.onos.graph; |
| 6 | |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 7 | import com.tinkerpop.blueprints.Vertex; |
| 8 | import com.tinkerpop.frames.FramedGraph; |
| 9 | import com.tinkerpop.frames.structures.FramedVertexIterable; |
| 10 | import com.tinkerpop.gremlin.java.GremlinPipeline; |
| 11 | import java.util.ArrayList; |
| 12 | import java.util.Iterator; |
| 13 | import java.util.List; |
| 14 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects; |
yoshitomo | b292c62 | 2013-11-23 14:35:58 -0800 | [diff] [blame] | 15 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IBaseObject; |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 16 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IDeviceObject; |
| 17 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry; |
| 18 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath; |
yoshitomo | b292c62 | 2013-11-23 14:35:58 -0800 | [diff] [blame] | 19 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IIpv4Address; |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 20 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject; |
| 21 | import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject; |
| 22 | import net.onrc.onos.ofcontroller.core.ISwitchStorage; |
yoshi | b3c83c1 | 2013-12-03 00:58:13 -0800 | [diff] [blame^] | 23 | import net.onrc.onos.ofcontroller.util.FlowEntryId; |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 24 | import net.onrc.onos.ofcontroller.util.FlowId; |
| 25 | |
| 26 | /** |
| 27 | * |
| 28 | * @author nickkaranatsios |
| 29 | */ |
| 30 | public abstract class DBOperation implements IDBOperation { |
| 31 | |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 32 | protected DBConnection conn; |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 33 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 34 | /** |
| 35 | * Search and get an active switch object with DPID. |
| 36 | * @param dpid DPID of the switch |
| 37 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 38 | @Override |
| 39 | public ISwitchObject searchActiveSwitch(String dpid) { |
| 40 | ISwitchObject sw = searchSwitch(dpid); |
| 41 | if ((sw != null) |
| 42 | && sw.getState().equals(ISwitchStorage.SwitchState.ACTIVE.toString())) { |
| 43 | return sw; |
| 44 | } |
| 45 | return null; |
| 46 | } |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 47 | |
| 48 | /** |
| 49 | * Create a new switch and return the created switch object. |
| 50 | * @param dpid DPID of the switch |
| 51 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 52 | @Override |
| 53 | public ISwitchObject newSwitch(final String dpid) { |
| 54 | ISwitchObject obj = (ISwitchObject) conn.getFramedGraph().addVertex(null, ISwitchObject.class); |
| 55 | if (obj != null) { |
| 56 | obj.setType("switch"); |
| 57 | obj.setDPID(dpid); |
| 58 | } |
| 59 | return obj; |
| 60 | } |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 61 | |
| 62 | /** |
| 63 | * Get all switch objects. |
| 64 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 65 | @Override |
| 66 | public Iterable<ISwitchObject> getAllSwitches() { |
| 67 | Iterable<ISwitchObject> switches = conn.getFramedGraph().getVertices("type", "switch", ISwitchObject.class); |
| 68 | return switches; |
| 69 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 70 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 71 | /** |
| 72 | * Get all inactive switch objects. |
| 73 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 74 | @Override |
| 75 | public Iterable<ISwitchObject> getInactiveSwitches() { |
| 76 | Iterable<ISwitchObject> switches = conn.getFramedGraph().getVertices("type", "switch", ISwitchObject.class); |
| 77 | List<ISwitchObject> inactiveSwitches = new ArrayList<ISwitchObject>(); |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 78 | |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 79 | for (ISwitchObject sw : switches) { |
| 80 | if (sw.getState().equals(ISwitchStorage.SwitchState.INACTIVE.toString())) { |
| 81 | inactiveSwitches.add(sw); |
| 82 | } |
| 83 | } |
| 84 | return inactiveSwitches; |
| 85 | } |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 86 | |
| 87 | /** |
| 88 | * Get all flow entries objects where their switches are not updated. |
| 89 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 90 | @Override |
| 91 | public Iterable<INetMapTopologyObjects.IFlowEntry> getAllSwitchNotUpdatedFlowEntries() { |
| 92 | //TODO: Should use an enum for flow_switch_state |
| 93 | return conn.getFramedGraph().getVertices("switch_state", "FE_SWITCH_NOT_UPDATED", INetMapTopologyObjects.IFlowEntry.class); |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 94 | |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 95 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 96 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 97 | /** |
| 98 | * Remove specified switch. |
| 99 | * @param sw switch object to remove |
| 100 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 101 | @Override |
| 102 | public void removeSwitch(ISwitchObject sw) { |
| 103 | conn.getFramedGraph().removeVertex(sw.asVertex()); |
| 104 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 105 | |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 106 | @Override |
| 107 | public IPortObject newPort(String dpid, Short portNum) { |
| 108 | IPortObject obj = (IPortObject) conn.getFramedGraph().addVertex(null, IPortObject.class); |
| 109 | if (obj != null) { |
| 110 | obj.setType("port"); |
| 111 | String id = dpid + portNum.toString(); |
| 112 | obj.setPortId(id); |
| 113 | obj.setNumber(portNum); |
| 114 | } |
| 115 | return obj; |
| 116 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 117 | |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 118 | /** |
| 119 | * Create a port having specified port number. |
| 120 | * |
| 121 | * @param portNumber port number |
| 122 | */ |
| 123 | @Deprecated |
| 124 | public IPortObject newPort(Short portNumber) { |
| 125 | IPortObject obj = (IPortObject) conn.getFramedGraph().addVertex(null, IPortObject.class); |
| 126 | if (obj != null) { |
| 127 | obj.setType("port"); |
| 128 | obj.setNumber(portNumber); |
| 129 | } |
| 130 | return obj; |
| 131 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 132 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 133 | /** |
| 134 | * Search and get a port object of specified switch and port number. |
| 135 | * @param dpid DPID of a switch |
| 136 | * @param number port number of the switch's port |
| 137 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 138 | @Override |
| 139 | public IPortObject searchPort(String dpid, Short number) { |
| 140 | String id = dpid + number.toString(); |
| 141 | return (conn.getFramedGraph() != null && conn.getFramedGraph().getVertices("port_id", id).iterator().hasNext()) |
| 142 | ? (IPortObject) conn.getFramedGraph().getVertices("port_id", id, IPortObject.class).iterator().next() : null; |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 143 | |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 144 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 145 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 146 | /** |
| 147 | * Remove the specified switch port. |
| 148 | * @param port switch port object to remove |
| 149 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 150 | @Override |
| 151 | public void removePort(IPortObject port) { |
| 152 | if (conn.getFramedGraph() != null) { |
| 153 | conn.getFramedGraph().removeVertex(port.asVertex()); |
| 154 | } |
| 155 | } |
| 156 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 157 | /** |
| 158 | * Create and return a device object. |
| 159 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 160 | @Override |
| 161 | public IDeviceObject newDevice() { |
| 162 | IDeviceObject obj = (IDeviceObject) conn.getFramedGraph().addVertex(null, IDeviceObject.class); |
| 163 | if (obj != null) { |
| 164 | obj.setType("device"); |
| 165 | } |
| 166 | return obj; |
| 167 | } |
| 168 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 169 | /** |
| 170 | * Get all devices. |
| 171 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 172 | @Override |
| 173 | public Iterable<IDeviceObject> getDevices() { |
| 174 | return conn.getFramedGraph() != null ? conn.getFramedGraph().getVertices("type", "device", IDeviceObject.class) : null; |
| 175 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 176 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 177 | /** |
| 178 | * Remove the specified device. |
| 179 | * @param dev a device object to remove |
| 180 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 181 | @Override |
| 182 | public void removeDevice(IDeviceObject dev) { |
| 183 | if (conn.getFramedGraph() != null) { |
| 184 | conn.getFramedGraph().removeVertex(dev.asVertex()); |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | /** |
| 189 | * Create and return a flow path object. |
| 190 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 191 | @Override |
| 192 | public IFlowPath newFlowPath() { |
| 193 | IFlowPath flowPath = (IFlowPath)conn.getFramedGraph().addVertex(null, IFlowPath.class); |
| 194 | if (flowPath != null) { |
| 195 | flowPath.setType("flow"); |
| 196 | } |
| 197 | return flowPath; |
| 198 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 199 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 200 | /** |
| 201 | * Get a flow path object with a flow entry. |
| 202 | * @param flowEntry flow entry object |
| 203 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 204 | @Override |
| 205 | public IFlowPath getFlowPathByFlowEntry(INetMapTopologyObjects.IFlowEntry flowEntry) { |
| 206 | GremlinPipeline<Vertex, IFlowPath> pipe = new GremlinPipeline<Vertex, IFlowPath>(); |
| 207 | pipe.start(flowEntry.asVertex()); |
| 208 | pipe.out("flow"); |
| 209 | FramedVertexIterable<IFlowPath> r = new FramedVertexIterable(conn.getFramedGraph(), (Iterable) pipe, IFlowPath.class); |
| 210 | return r.iterator().hasNext() ? r.iterator().next() : null; |
| 211 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 212 | |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 213 | |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 214 | /** |
| 215 | * Search and get a switch object with DPID. |
| 216 | * |
| 217 | * @param dpid DPID of the switch |
| 218 | */ |
| 219 | @Override |
| 220 | public ISwitchObject searchSwitch(final String dpid) { |
| 221 | return (conn.getFramedGraph() != null && conn.getFramedGraph().getVertices("dpid", dpid).iterator().hasNext()) |
| 222 | ? (ISwitchObject) (conn.getFramedGraph().getVertices("dpid", dpid, ISwitchObject.class).iterator().next()) : null; |
| 223 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 224 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 225 | /** |
| 226 | * Get all active switch objects. |
| 227 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 228 | @Override |
| 229 | public Iterable<ISwitchObject> getActiveSwitches() { |
| 230 | Iterable<ISwitchObject> switches = conn.getFramedGraph().getVertices("type", "switch", ISwitchObject.class); |
| 231 | List<ISwitchObject> activeSwitches = new ArrayList<ISwitchObject>(); |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 232 | |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 233 | for (ISwitchObject sw : switches) { |
| 234 | if (sw.getState().equals(ISwitchStorage.SwitchState.ACTIVE.toString())) { |
| 235 | activeSwitches.add(sw); |
| 236 | } |
| 237 | } |
| 238 | return activeSwitches; |
| 239 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 240 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 241 | /** |
| 242 | * Search and get a device object having specified MAC address. |
| 243 | * @param macAddr MAC address to search and get |
| 244 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 245 | @Override |
| 246 | public IDeviceObject searchDevice(String macAddr) { |
| 247 | return (conn.getFramedGraph() != null && conn.getFramedGraph().getVertices("dl_addr", macAddr).iterator().hasNext()) |
| 248 | ? (IDeviceObject) conn.getFramedGraph().getVertices("dl_addr", macAddr, IDeviceObject.class).iterator().next() : null; |
| 249 | |
| 250 | } |
| 251 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 252 | /** |
| 253 | * Search and get a flow path object with specified flow ID. |
| 254 | * @param flowId flow ID to search |
| 255 | */ |
yoshi | b3c83c1 | 2013-12-03 00:58:13 -0800 | [diff] [blame^] | 256 | @Override |
| 257 | public IFlowPath searchFlowPath(final FlowId flowId) { |
| 258 | return conn.getFramedGraph().getVertices("flow_id", flowId.toString()).iterator().hasNext() |
| 259 | ? (IFlowPath) conn.getFramedGraph().getVertices("flow_id", flowId.toString(), |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 260 | IFlowPath.class).iterator().next() : null; |
| 261 | } |
| 262 | |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 263 | /** |
| 264 | * Get all flow path objects. |
| 265 | */ |
yoshi | b3c83c1 | 2013-12-03 00:58:13 -0800 | [diff] [blame^] | 266 | @Override |
| 267 | public Iterable<IFlowPath> getAllFlowPaths() { |
| 268 | Iterable<IFlowPath> flowPaths = conn.getFramedGraph().getVertices("type", "flow", IFlowPath.class); |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 269 | |
| 270 | List<IFlowPath> nonNullFlows = new ArrayList<IFlowPath>(); |
| 271 | |
| 272 | for (IFlowPath fp : flowPaths) { |
| 273 | if (fp.getFlowId() != null) { |
| 274 | nonNullFlows.add(fp); |
| 275 | } |
| 276 | } |
| 277 | return nonNullFlows; |
| 278 | } |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 279 | |
| 280 | /** |
yoshi | b3c83c1 | 2013-12-03 00:58:13 -0800 | [diff] [blame^] | 281 | * Remove the specified flow path. |
| 282 | * @param flowPath flow path object to remove |
| 283 | */ |
| 284 | @Override |
| 285 | public void removeFlowPath(IFlowPath flowPath) { |
| 286 | conn.getFramedGraph().removeVertex(flowPath.asVertex()); |
| 287 | } |
| 288 | |
| 289 | /** |
| 290 | * Search and get a flow entry object with flow entry ID. |
| 291 | * @param flowEntryId flow entry ID to search |
| 292 | */ |
| 293 | @Override |
| 294 | public IFlowEntry searchFlowEntry(FlowEntryId flowEntryId) { |
| 295 | return conn.getFramedGraph().getVertices("flow_entry_id", flowEntryId.toString()).iterator().hasNext() |
| 296 | ? (IFlowEntry)conn.getFramedGraph().getVertices("flow_entry_id", flowEntryId.toString(), |
| 297 | IFlowEntry.class).iterator().next() : null; |
| 298 | } |
| 299 | |
| 300 | /** |
| 301 | * Get all flow entry objects. |
| 302 | */ |
| 303 | @Override |
| 304 | public Iterable<IFlowEntry> getAllFlowEntries() { |
| 305 | return conn.getFramedGraph().getVertices("type", "flow_entry", IFlowEntry.class); |
| 306 | } |
| 307 | |
| 308 | /** |
| 309 | * Remove the specified flow entry. |
| 310 | * @param flowEntry flow entry object to remove |
| 311 | */ |
| 312 | @Override |
| 313 | public void removeFlowEntry(IFlowEntry flowEntry) { |
| 314 | conn.getFramedGraph().removeVertex(flowEntry.asVertex()); |
| 315 | } |
| 316 | |
| 317 | /** |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 318 | * Create and return a flow entry object. |
| 319 | */ |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 320 | @Override |
| 321 | public IFlowEntry newFlowEntry() { |
| 322 | IFlowEntry flowEntry = (IFlowEntry) conn.getFramedGraph().addVertex(null, IFlowEntry.class); |
| 323 | if (flowEntry != null) { |
| 324 | flowEntry.setType("flow_entry"); |
| 325 | } |
| 326 | return flowEntry; |
| 327 | } |
| 328 | |
| 329 | |
yoshitomo | b292c62 | 2013-11-23 14:35:58 -0800 | [diff] [blame] | 330 | public IIpv4Address newIpv4Address() { |
| 331 | return newVertex("ipv4Address", IIpv4Address.class); |
| 332 | } |
yoshi | 2dd767c | 2013-11-27 23:39:06 -0800 | [diff] [blame] | 333 | |
yoshitomo | b292c62 | 2013-11-23 14:35:58 -0800 | [diff] [blame] | 334 | private <T extends IBaseObject> T newVertex(String type, Class<T> vertexType) { |
yoshi | 9247b81 | 2013-11-27 11:26:14 -0800 | [diff] [blame] | 335 | T newVertex = (T) conn.getFramedGraph().addVertex(null, vertexType); |
yoshitomo | b292c62 | 2013-11-23 14:35:58 -0800 | [diff] [blame] | 336 | if (newVertex != null) { |
| 337 | newVertex.setType(type); |
| 338 | } |
| 339 | return newVertex; |
| 340 | } |
yoshi | c455c01 | 2013-11-27 10:35:50 -0800 | [diff] [blame] | 341 | |
yoshitomo | b292c62 | 2013-11-23 14:35:58 -0800 | [diff] [blame] | 342 | public IIpv4Address searchIpv4Address(int intIpv4Address) { |
| 343 | return searchForVertex("ipv4_address", intIpv4Address, IIpv4Address.class); |
| 344 | } |
| 345 | |
| 346 | |
| 347 | public IIpv4Address ensureIpv4Address(int intIpv4Address) { |
| 348 | IIpv4Address ipv4Vertex = searchIpv4Address(intIpv4Address); |
| 349 | if (ipv4Vertex == null) { |
| 350 | ipv4Vertex = newIpv4Address(); |
| 351 | ipv4Vertex.setIpv4Address(intIpv4Address); |
| 352 | } |
| 353 | return ipv4Vertex; |
| 354 | } |
| 355 | |
| 356 | |
| 357 | private <T> T searchForVertex(String propertyName, Object propertyValue, Class<T> vertexType) { |
| 358 | if (conn.getFramedGraph() != null) { |
| 359 | Iterator<T> it = conn.getFramedGraph().getVertices(propertyName, propertyValue, vertexType).iterator(); |
| 360 | if (it.hasNext()) { |
| 361 | return it.next(); |
| 362 | } |
| 363 | } |
| 364 | return null; |
| 365 | } |
| 366 | |
| 367 | public void removeIpv4Address(IIpv4Address ipv4Address) { |
| 368 | conn.getFramedGraph().removeVertex(ipv4Address.asVertex()); |
| 369 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 370 | |
yoshi | b3c83c1 | 2013-12-03 00:58:13 -0800 | [diff] [blame^] | 371 | /** |
| 372 | * Get the instance of GraphDBConnection assigned to this class. |
| 373 | */ |
yoshi | 7594aef | 2013-11-27 09:27:07 -0800 | [diff] [blame] | 374 | @Override |
| 375 | public IDBConnection getDBConnection() { |
| 376 | return conn; |
| 377 | } |
yoshi | b3c83c1 | 2013-12-03 00:58:13 -0800 | [diff] [blame^] | 378 | |
| 379 | @Override |
| 380 | public void commit() { |
| 381 | conn.commit(); |
| 382 | } |
| 383 | |
| 384 | @Override |
| 385 | public void rollback() { |
| 386 | conn.rollback(); |
| 387 | } |
| 388 | |
| 389 | @Override |
| 390 | public void close() { |
| 391 | conn.close(); |
| 392 | } |
yoshi | 0451f28 | 2013-11-22 15:48:55 -0800 | [diff] [blame] | 393 | } |