commit | d1ba0e224f637db0dd7d893da67a8adb5da978bb | [log] [tgz] |
---|---|---|
author | TeruU <t-uchida@onlab.us> | Mon Feb 10 11:44:15 2014 -0800 |
committer | Gerrit Code Review <gerrit2@onos-services> | Thu Mar 13 17:38:42 2014 -0700 |
tree | 9fc401660c125dd445f835bd0eed1c331af590ae | |
parent | ba5c52f2b3f7998df9812c70b5cb8c06130531ea [diff] |
Cherry-pick from https://gerrit.onos.onlab.us/#/c/337/ Add a rollback method for clearing cache of IDeviceObject. Call the rollback method in Forwarding.class. Change-Id: I32c85708a5595c7cd70f239eaefd1f2f96812de1
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/IDeviceStorage.java b/src/main/java/net/onrc/onos/ofcontroller/core/IDeviceStorage.java index 2eddadf..9818b1b 100644 --- a/src/main/java/net/onrc/onos/ofcontroller/core/IDeviceStorage.java +++ b/src/main/java/net/onrc/onos/ofcontroller/core/IDeviceStorage.java
@@ -14,6 +14,8 @@ public IDeviceObject getDeviceByIP(int ipv4Address); public void changeDeviceAttachments(IDevice device); public void changeDeviceIPv4Address(IDevice device); + public void rollback(); + public void commit(); public void addOnosDevice(OnosDevice onosDevice); }
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java b/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java index 0699491..94954a6 100644 --- a/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java +++ b/src/main/java/net/onrc/onos/ofcontroller/core/internal/DeviceStorageImpl.java
@@ -162,6 +162,20 @@ } /*** + * This function is for closing the DB transaction properly. + * After you use any DB operation, to clear the cache of transaction, it should be called. + */ + @Override + public void rollback() { + ope.rollback(); + } + + @Override + public void commit(){ + ope.commit(); + } + + /*** * This function is for getting the Device from the DB by IP address of the device. * @param ip The device ip address you want to get from the DB. * @return IDeviceObject you want to get.