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

set time on creation

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