Commit 4cdf1a3d authored by Spiros Koulouzis's avatar Spiros Koulouzis

set time on creation

parent 11cfec9a
...@@ -70,7 +70,7 @@ public class AnsibleOutputService { ...@@ -70,7 +70,7 @@ public class AnsibleOutputService {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername(); String owner = user.getUsername();
ownedObject.setOwner(owner); ownedObject.setOwner(owner);
ownedObject.setTimestamp(System.currentTimeMillis());
return ansibleOutputDao.save(ownedObject); return ansibleOutputDao.save(ownedObject);
} }
......
...@@ -66,7 +66,7 @@ public class BenchmarkResultService { ...@@ -66,7 +66,7 @@ public class BenchmarkResultService {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername(); String owner = user.getUsername();
ownedObject.setOwner(owner); ownedObject.setOwner(owner);
ownedObject.setTimestamp(System.currentTimeMillis());
return benchmarkResultDao.save(ownedObject); return benchmarkResultDao.save(ownedObject);
} }
......
...@@ -43,7 +43,7 @@ public class CloudCredentialsService { ...@@ -43,7 +43,7 @@ public class CloudCredentialsService {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername(); String owner = user.getUsername();
ownedObject.setOwner(owner); ownedObject.setOwner(owner);
ownedObject.setTimestamp(System.currentTimeMillis());
return dao.save(ownedObject); return dao.save(ownedObject);
} }
......
...@@ -109,7 +109,7 @@ public class ConfigurationService { ...@@ -109,7 +109,7 @@ public class ConfigurationService {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername(); String owner = user.getUsername();
ownedObject.setOwner(owner); ownedObject.setOwner(owner);
ownedObject.setTimestamp(System.currentTimeMillis());
return dao.save(ownedObject); return dao.save(ownedObject);
} }
......
...@@ -127,7 +127,7 @@ public class DeployService { ...@@ -127,7 +127,7 @@ public class DeployService {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername(); String owner = user.getUsername();
ownedObject.setOwner(owner); ownedObject.setOwner(owner);
ownedObject.setTimestamp(System.currentTimeMillis());
return deployDao.save(ownedObject); return deployDao.save(ownedObject);
} }
...@@ -335,7 +335,6 @@ public class DeployService { ...@@ -335,7 +335,6 @@ public class DeployService {
private DeployResponse handleResponse(List<MessageParameter> params, DeployRequest deployInfo) throws KeyException, IOException, Exception { private DeployResponse handleResponse(List<MessageParameter> params, DeployRequest deployInfo) throws KeyException, IOException, Exception {
DeployResponse deployResponse = new DeployResponse(); DeployResponse deployResponse = new DeployResponse();
deployResponse.setTimestamp(System.currentTimeMillis());
for (MessageParameter p : params) { for (MessageParameter p : params) {
String name = p.getName(); String name = p.getName();
...@@ -346,7 +345,6 @@ public class DeployService { ...@@ -346,7 +345,6 @@ public class DeployService {
k.setKey(value); k.setKey(value);
k.setType(Key.KeyType.PRIVATE); k.setType(Key.KeyType.PRIVATE);
KeyPair pair = new KeyPair(); KeyPair pair = new KeyPair();
pair.setTimestamp(System.currentTimeMillis());
pair.setPrivateKey(k); pair.setPrivateKey(k);
deployResponse.setKey(pair); deployResponse.setKey(pair);
save(deployResponse); save(deployResponse);
......
...@@ -61,7 +61,7 @@ public class KeyPairService { ...@@ -61,7 +61,7 @@ public class KeyPairService {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername(); String owner = user.getUsername();
ownedObject.setOwner(owner); ownedObject.setOwner(owner);
ownedObject.setTimestamp(System.currentTimeMillis());
return dao.save(ownedObject); return dao.save(ownedObject);
} }
......
...@@ -68,7 +68,7 @@ public class MonitorringMessageService { ...@@ -68,7 +68,7 @@ public class MonitorringMessageService {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername(); String owner = user.getUsername();
ownedObject.setOwner(owner); ownedObject.setOwner(owner);
ownedObject.setTimestamp(System.currentTimeMillis());
return dao.save(ownedObject); return dao.save(ownedObject);
} }
} }
...@@ -94,7 +94,6 @@ public class PlannerService { ...@@ -94,7 +94,6 @@ public class PlannerService {
SimplePlanContainer simplePlan = P2PConverter.transfer(jsonArrayString.toString(), "vm_user", domainName, cloudProvider); SimplePlanContainer simplePlan = P2PConverter.transfer(jsonArrayString.toString(), "vm_user", domainName, cloudProvider);
PlanResponse topLevel = new PlanResponse(); PlanResponse topLevel = new PlanResponse();
topLevel.setTimestamp(System.currentTimeMillis());
topLevel.setLevel(0); topLevel.setLevel(0);
topLevel.setToscaID(toscaId); topLevel.setToscaID(toscaId);
topLevel.setName("planner_output_all.yml"); topLevel.setName("planner_output_all.yml");
...@@ -103,7 +102,6 @@ public class PlannerService { ...@@ -103,7 +102,6 @@ public class PlannerService {
Set<String> loweLevelPlansIDs = new HashSet<>(); Set<String> loweLevelPlansIDs = new HashSet<>();
for (String lowLevelNames : map.keySet()) { for (String lowLevelNames : map.keySet()) {
PlanResponse lowLevelPlan = new PlanResponse(); PlanResponse lowLevelPlan = new PlanResponse();
lowLevelPlan.setTimestamp(System.currentTimeMillis());
lowLevelPlan.setLevel(1); lowLevelPlan.setLevel(1);
lowLevelPlan.setToscaID(toscaId); lowLevelPlan.setToscaID(toscaId);
lowLevelPlan.setName(lowLevelNames); lowLevelPlan.setName(lowLevelNames);
...@@ -195,7 +193,7 @@ public class PlannerService { ...@@ -195,7 +193,7 @@ public class PlannerService {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername(); String owner = user.getUsername();
ownedObject.setOwner(owner); ownedObject.setOwner(owner);
ownedObject.setTimestamp(System.currentTimeMillis());
return planDao.save(ownedObject); return planDao.save(ownedObject);
} }
......
...@@ -93,7 +93,7 @@ public class ProvisionService { ...@@ -93,7 +93,7 @@ public class ProvisionService {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername(); String owner = user.getUsername();
ownedObject.setOwner(owner); ownedObject.setOwner(owner);
ownedObject.setTimestamp(System.currentTimeMillis());
return provisionDao.save(ownedObject); return provisionDao.save(ownedObject);
} }
...@@ -637,7 +637,6 @@ public class ProvisionService { ...@@ -637,7 +637,6 @@ public class ProvisionService {
ProvisionRequest provisionRequest, ProvisionResponse provisionResponse, boolean saveUserKeys, boolean saveDeployerKeyI) throws Exception { ProvisionRequest provisionRequest, ProvisionResponse provisionResponse, boolean saveUserKeys, boolean saveDeployerKeyI) throws Exception {
if (provisionResponse == null) { if (provisionResponse == null) {
provisionResponse = new ProvisionResponse(); provisionResponse = new ProvisionResponse();
provisionResponse.setTimestamp(System.currentTimeMillis());
} }
List<DeployParameter> deployParameters = new ArrayList<>(); List<DeployParameter> deployParameters = new ArrayList<>();
......
...@@ -42,7 +42,7 @@ public class ScriptService { ...@@ -42,7 +42,7 @@ public class ScriptService {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername(); String owner = user.getUsername();
ownedObject.setOwner(owner); ownedObject.setOwner(owner);
ownedObject.setTimestamp(System.currentTimeMillis());
return dao.save(ownedObject); return dao.save(ownedObject);
} }
......
...@@ -64,7 +64,6 @@ public class SimplePlannerService { ...@@ -64,7 +64,6 @@ public class SimplePlannerService {
Message plannerReturnedMessage = (planner.call(plannerInvokationMessage)); Message plannerReturnedMessage = (planner.call(plannerInvokationMessage));
List<MessageParameter> planFiles = plannerReturnedMessage.getParameters(); List<MessageParameter> planFiles = plannerReturnedMessage.getParameters();
topLevel = new PlanResponse(); topLevel = new PlanResponse();
topLevel.setTimestamp(System.currentTimeMillis());
Set<String> ids = topLevel.getLoweLevelPlanIDs(); Set<String> ids = topLevel.getLoweLevelPlanIDs();
if (ids == null) { if (ids == null) {
ids = new HashSet<>(); ids = new HashSet<>();
...@@ -84,7 +83,6 @@ public class SimplePlannerService { ...@@ -84,7 +83,6 @@ public class SimplePlannerService {
topLevel.setKvMap(Converter.ymlString2Map(p.getValue())); topLevel.setKvMap(Converter.ymlString2Map(p.getValue()));
} else { } else {
lowerLevelPlan = new PlanResponse(); lowerLevelPlan = new PlanResponse();
lowerLevelPlan.setTimestamp(System.currentTimeMillis());
lowerLevelPlan.setName(name); lowerLevelPlan.setName(name);
lowerLevelPlan.setKvMap(Converter.ymlString2Map(p.getValue())); lowerLevelPlan.setKvMap(Converter.ymlString2Map(p.getValue()));
lowerLevelPlan.setLevel(1); lowerLevelPlan.setLevel(1);
......
...@@ -134,7 +134,7 @@ public class ToscaService { ...@@ -134,7 +134,7 @@ public class ToscaService {
User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String owner = user.getUsername(); String owner = user.getUsername();
ownedObject.setOwner(owner); ownedObject.setOwner(owner);
ownedObject.setTimestamp(System.currentTimeMillis());
return dao.save(ownedObject); return dao.save(ownedObject);
} }
......
...@@ -70,7 +70,6 @@ public class CloudConfigurationController0 { ...@@ -70,7 +70,6 @@ public class CloudConfigurationController0 {
throw new NullKeyIDException(); throw new NullKeyIDException();
} }
CloudCredentials cloudCredentials = new CloudCredentials(); CloudCredentials cloudCredentials = new CloudCredentials();
cloudCredentials.setTimestamp(System.currentTimeMillis());
cloudCredentials.setAccessKeyId(configure.keyid); cloudCredentials.setAccessKeyId(configure.keyid);
cloudCredentials.setSecretKey(configure.key); cloudCredentials.setSecretKey(configure.key);
...@@ -80,7 +79,6 @@ public class CloudConfigurationController0 { ...@@ -80,7 +79,6 @@ public class CloudConfigurationController0 {
try { try {
nl.uva.sne.drip.drip.commons.data.v1.external.Key key1 = new nl.uva.sne.drip.drip.commons.data.v1.external.Key(); nl.uva.sne.drip.drip.commons.data.v1.external.Key key1 = new nl.uva.sne.drip.drip.commons.data.v1.external.Key();
KeyPair pair = new KeyPair(); KeyPair pair = new KeyPair();
pair.setTimestamp(System.currentTimeMillis());
key1.setKey(key0.content); key1.setKey(key0.content);
Map<String, String> attributes = new HashMap<>(); Map<String, String> attributes = new HashMap<>();
attributes.put("domain_name", key0.domain_name); attributes.put("domain_name", key0.domain_name);
...@@ -110,7 +108,6 @@ public class CloudConfigurationController0 { ...@@ -110,7 +108,6 @@ public class CloudConfigurationController0 {
throw new NullKeyIDException(); throw new NullKeyIDException();
} }
CloudCredentials cloudCredentials = new CloudCredentials(); CloudCredentials cloudCredentials = new CloudCredentials();
cloudCredentials.setTimestamp(System.currentTimeMillis());
// cloudCredentials.setKeyIdAlias(configure.geniKeyAlias); // cloudCredentials.setKeyIdAlias(configure.geniKeyAlias);
cloudCredentials.setAccessKeyId(configure.geniKey); cloudCredentials.setAccessKeyId(configure.geniKey);
cloudCredentials.setSecretKey(configure.geniKeyPass); cloudCredentials.setSecretKey(configure.geniKeyPass);
...@@ -123,7 +120,6 @@ public class CloudConfigurationController0 { ...@@ -123,7 +120,6 @@ public class CloudConfigurationController0 {
key1.setKey(key0.content); key1.setKey(key0.content);
key1.setType(Key.KeyType.PUBLIC); key1.setType(Key.KeyType.PUBLIC);
KeyPair pair = new KeyPair(); KeyPair pair = new KeyPair();
pair.setTimestamp(System.currentTimeMillis());
pair.setPublicKey(key1); pair.setPublicKey(key1);
pair = keyService.save(pair); pair = keyService.save(pair);
loginKeyIDs.add(pair.getId()); loginKeyIDs.add(pair.getId());
...@@ -138,7 +134,6 @@ public class CloudConfigurationController0 { ...@@ -138,7 +134,6 @@ public class CloudConfigurationController0 {
key1.setKey(key0.content); key1.setKey(key0.content);
key1.setType(Key.KeyType.PRIVATE); key1.setType(Key.KeyType.PRIVATE);
KeyPair pair = new KeyPair(); KeyPair pair = new KeyPair();
pair.setTimestamp(System.currentTimeMillis());
pair.setPrivateKey(key1); pair.setPrivateKey(key1);
pair = keyService.save(pair); pair = keyService.save(pair);
loginKeyIDs.add(pair.getId()); loginKeyIDs.add(pair.getId());
......
...@@ -84,7 +84,6 @@ public class ProvisionController0 { ...@@ -84,7 +84,6 @@ public class ProvisionController0 {
String provision(@RequestBody Upload upload) { String provision(@RequestBody Upload upload) {
ProvisionResponse resp = new ProvisionResponse(); ProvisionResponse resp = new ProvisionResponse();
resp.setTimestamp(System.currentTimeMillis());
CloudCredentials cloudCred = cloudCredentialsService.findAll().get(0); CloudCredentials cloudCred = cloudCredentialsService.findAll().get(0);
String cloudCredID = cloudCred.getId(); String cloudCredID = cloudCred.getId();
List<String> idList = new ArrayList<>(); List<String> idList = new ArrayList<>();
......
...@@ -138,7 +138,6 @@ public class CloudCredentialsController { ...@@ -138,7 +138,6 @@ public class CloudCredentialsController {
attributes.put("domain_name", FilenameUtils.removeExtension(originalFileName)); attributes.put("domain_name", FilenameUtils.removeExtension(originalFileName));
key.setAttributes(attributes); key.setAttributes(attributes);
KeyPair pair = new KeyPair(); KeyPair pair = new KeyPair();
pair.setTimestamp(System.currentTimeMillis());
pair.setPrivateKey(key); pair.setPrivateKey(key);
pair = keyService.save(pair); pair = keyService.save(pair);
// loginKeyIDs.add(pair.getId()); // loginKeyIDs.add(pair.getId());
......
...@@ -139,7 +139,6 @@ public class KeyPairController { ...@@ -139,7 +139,6 @@ public class KeyPairController {
KeyPair geta() throws Exception { KeyPair geta() throws Exception {
try { try {
KeyPair pair = new KeyPair(); KeyPair pair = new KeyPair();
pair.setTimestamp(System.currentTimeMillis());
Key pk = new Key(); Key pk = new Key();
Map<String, String> attributes = new HashMap<>(); Map<String, String> attributes = new HashMap<>();
attributes.put("domain_name", "Virginia"); attributes.put("domain_name", "Virginia");
......
...@@ -206,7 +206,6 @@ public class Converter { ...@@ -206,7 +206,6 @@ public class Converter {
public static PlanResponse File2Plan1(Attribute p0) { public static PlanResponse File2Plan1(Attribute p0) {
PlanResponse p1 = new PlanResponse(); PlanResponse p1 = new PlanResponse();
p1.setTimestamp(System.currentTimeMillis());
p1.setLevel(Integer.valueOf(p0.level)); p1.setLevel(Integer.valueOf(p0.level));
p1.setName(p0.name); p1.setName(p0.name);
String yaml = p0.content.replaceAll("\\\\n", "\n"); String yaml = p0.content.replaceAll("\\\\n", "\n");
......
...@@ -34,7 +34,7 @@ public class OwnedObject { ...@@ -34,7 +34,7 @@ public class OwnedObject {
@Id @Id
private String id; private String id;
private Long timestamp; private Long timestamp = System.currentTimeMillis();
@NotNull @NotNull
private String owner; private String owner;
...@@ -77,9 +77,4 @@ public class OwnedObject { ...@@ -77,9 +77,4 @@ public class OwnedObject {
return timestamp; return timestamp;
} }
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment