summaryrefslogtreecommitdiffstats
path: root/aai-core/src/main/java
diff options
context:
space:
mode:
authorKajur, Harish (vk250x) <vk250x@att.com>2018-11-01 17:50:54 -0400
committerKajur, Harish (vk250x) <vk250x@att.com>2018-11-01 17:51:02 -0400
commit7bfc30305b9341999e74f19f747bb7d3c77f6414 (patch)
tree8f8ba1c9c1cfcdf2bb926df4f5bd9b7f2a7f7276 /aai-core/src/main/java
parentc2ccad8c88d6eec83e8abb0eb4bab6f65cb74912 (diff)
Fix bug on create created ts and modified ts
where on create the values should be the same but it ends up being different sometimes Issue-ID: AAI-1832 Change-Id: Ia8cfb75a5812e6b59f8000a820cf3605ab17eb2b Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
Diffstat (limited to 'aai-core/src/main/java')
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java b/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java
index e8c03bdd..7a2c447e 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java
@@ -96,6 +96,7 @@ public class DBSerializer {
private final Loader loader;
private final String baseURL;
private double dbTimeMsecs = 0;
+ private long currentTimeMillis;
private SchemaVersions schemaVersions;
/**
@@ -117,6 +118,7 @@ public class DBSerializer {
this.version = version;
this.loader = SpringContextAware.getBean(LoaderFactory.class).createLoaderForVersion(introspectionType, version);
this.baseURL = AAIConfig.get(AAIConstants.AAI_SERVER_URL_BASE);
+ this.currentTimeMillis = System.currentTimeMillis();
initBeans();
}
@@ -156,14 +158,14 @@ public class DBSerializer {
* @param isNewVertex the is new vertex
*/
public void touchStandardVertexProperties(Vertex v, boolean isNewVertex) {
-
- String timeNowInSec = Long.toString(System.currentTimeMillis());
+ String timeNowInSec = Long.toString(currentTimeMillis);
+
if (isNewVertex) {
v.property(AAIProperties.SOURCE_OF_TRUTH, this.sourceOfTruth);
v.property(AAIProperties.CREATED_TS, timeNowInSec);
v.property(AAIProperties.AAI_UUID, UUID.randomUUID().toString());
}
- v.property(AAIProperties.RESOURCE_VERSION, timeNowInSec );
+ v.property(AAIProperties.RESOURCE_VERSION, timeNowInSec);
v.property(AAIProperties.LAST_MOD_TS, timeNowInSec);
v.property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, this.sourceOfTruth);