Expose force Create/Delete to Object
Change-Id: I8732ef95ddebf0af3d5c1694bf11adb2c02b5229
diff --git a/src/main/java/net/onrc/onos/datastore/RCObject.java b/src/main/java/net/onrc/onos/datastore/RCObject.java
index 23a2139..0ac0d49 100644
--- a/src/main/java/net/onrc/onos/datastore/RCObject.java
+++ b/src/main/java/net/onrc/onos/datastore/RCObject.java
@@ -205,6 +205,17 @@
this.version = table.create(key, value);
}
+ public void forceCreate() {
+
+ if (this.propertyMap == null) {
+ log.warn("No object map was set. Setting empty Map.");
+ setObjectMap(new HashMap<Object, Object>());
+ }
+ serializeAndSetValue();
+
+ this.version = table.forceCreate(key, value);
+ }
+
/**
* Read an Object from DataStore.
*
@@ -250,6 +261,10 @@
this.version = table.delete(key, this.version);
}
+ public void forceDelete() {
+ this.version = table.forceDelete(key);
+ }
+
/**
* Multi-read RCObjects.
*