Commit a812ba2c authored by Spiros Koulouzis's avatar Spiros Koulouzis

changed to timestamp

parent b59b6e78
......@@ -232,7 +232,7 @@ public class DeployService {
private DeployResponse handleResponse(List<MessageParameter> params, DeployRequest deployInfo) throws KeyException, IOException {
DeployResponse deployResponse = new DeployResponse();
deployResponse.setCreationDate(System.currentTimeMillis());
deployResponse.setTimestamp(System.currentTimeMillis());
for (MessageParameter p : params) {
String name = p.getName();
......@@ -243,7 +243,7 @@ public class DeployService {
k.setKey(value);
k.setType(Key.KeyType.PRIVATE);
KeyPair pair = new KeyPair();
pair.setCreationDate(System.currentTimeMillis());
pair.setTimestamp(System.currentTimeMillis());
pair.setPrivateKey(k);
deployResponse.setKey(pair);
save(deployResponse);
......
......@@ -86,7 +86,7 @@ public class PlannerService {
SimplePlanContainer simplePlan = P2PConverter.convert(jsonArrayString.toString(), "vm_user", "Ubuntu 16.04", "swarm");
PlanResponse topLevel = new PlanResponse();
topLevel.setCreationDate(System.currentTimeMillis());
topLevel.setTimestamp(System.currentTimeMillis());
topLevel.setLevel(0);
topLevel.setToscaID(toscaId);
topLevel.setName("planner_output_all.yml");
......@@ -95,7 +95,7 @@ public class PlannerService {
Set<String> loweLevelPlansIDs = new HashSet<>();
for (String lowLevelNames : map.keySet()) {
PlanResponse lowLevelPlan = new PlanResponse();
lowLevelPlan.setCreationDate(System.currentTimeMillis());
lowLevelPlan.setTimestamp(System.currentTimeMillis());
lowLevelPlan.setLevel(1);
lowLevelPlan.setToscaID(toscaId);
lowLevelPlan.setName(lowLevelNames);
......
......@@ -128,7 +128,7 @@ public class ProvisionService {
// + File.separator + "ec2_provisioner_provisoned3.json");
List<MessageParameter> params = response.getParameters();
ProvisionResponse provisionResponse = new ProvisionResponse();
provisionResponse.setCreationDate(System.currentTimeMillis());
provisionResponse.setTimestamp(System.currentTimeMillis());
for (MessageParameter p : params) {
String name = p.getName();
if (name.toLowerCase().contains("exception")) {
......
......@@ -64,7 +64,7 @@ public class SimplePlannerService {
Message plannerReturnedMessage = (planner.call(plannerInvokationMessage));
List<MessageParameter> planFiles = plannerReturnedMessage.getParameters();
topLevel = new PlanResponse();
topLevel.setCreationDate(System.currentTimeMillis());
topLevel.setTimestamp(System.currentTimeMillis());
Set<String> ids = topLevel.getLoweLevelPlanIDs();
if (ids == null) {
ids = new HashSet<>();
......@@ -84,7 +84,7 @@ public class SimplePlannerService {
topLevel.setKvMap(Converter.ymlString2Map(p.getValue()));
} else {
lowerLevelPlan = new PlanResponse();
lowerLevelPlan.setCreationDate(System.currentTimeMillis());
lowerLevelPlan.setTimestamp(System.currentTimeMillis());
lowerLevelPlan.setName(name);
lowerLevelPlan.setKvMap(Converter.ymlString2Map(p.getValue()));
lowerLevelPlan.setLevel(1);
......
......@@ -70,7 +70,7 @@ public class CloudConfigurationController0 {
throw new NullKeyIDException();
}
CloudCredentials cloudCredentials = new CloudCredentials();
cloudCredentials.setCreationDate(System.currentTimeMillis());
cloudCredentials.setTimestamp(System.currentTimeMillis());
cloudCredentials.setAccessKeyId(configure.keyid);
cloudCredentials.setSecretKey(configure.key);
......@@ -80,7 +80,7 @@ public class CloudConfigurationController0 {
try {
nl.uva.sne.drip.data.v1.external.Key key1 = new nl.uva.sne.drip.data.v1.external.Key();
KeyPair pair = new KeyPair();
pair.setCreationDate(System.currentTimeMillis());
pair.setTimestamp(System.currentTimeMillis());
key1.setKey(key0.content);
Map<String, String> attributes = new HashMap<>();
attributes.put("domain_name", key0.domain_name);
......@@ -110,7 +110,7 @@ public class CloudConfigurationController0 {
throw new NullKeyIDException();
}
CloudCredentials cloudCredentials = new CloudCredentials();
cloudCredentials.setCreationDate(System.currentTimeMillis());
cloudCredentials.setTimestamp(System.currentTimeMillis());
// cloudCredentials.setKeyIdAlias(configure.geniKeyAlias);
cloudCredentials.setAccessKeyId(configure.geniKey);
cloudCredentials.setSecretKey(configure.geniKeyPass);
......@@ -123,7 +123,7 @@ public class CloudConfigurationController0 {
key1.setKey(key0.content);
key1.setType(Key.KeyType.PUBLIC);
KeyPair pair = new KeyPair();
pair.setCreationDate(System.currentTimeMillis());
pair.setTimestamp(System.currentTimeMillis());
pair.setPublicKey(key1);
pair = keyService.save(pair);
loginKeyIDs.add(pair.getId());
......@@ -138,7 +138,7 @@ public class CloudConfigurationController0 {
key1.setKey(key0.content);
key1.setType(Key.KeyType.PRIVATE);
KeyPair pair = new KeyPair();
pair.setCreationDate(System.currentTimeMillis());
pair.setTimestamp(System.currentTimeMillis());
pair.setPrivateKey(key1);
pair = keyService.save(pair);
loginKeyIDs.add(pair.getId());
......
......@@ -84,7 +84,7 @@ public class ProvisionController0 {
String provision(@RequestBody Upload upload) {
ProvisionResponse resp = new ProvisionResponse();
resp.setCreationDate(System.currentTimeMillis());
resp.setTimestamp(System.currentTimeMillis());
CloudCredentials cloudCred = cloudCredentialsService.findAll().get(0);
String cloudCredID = cloudCred.getId();
List<String> idList = new ArrayList<>();
......
......@@ -132,7 +132,7 @@ public class CloudCredentialsController {
attributes.put("domain_name", FilenameUtils.removeExtension(originalFileName));
key.setAttributes(attributes);
KeyPair pair = new KeyPair();
pair.setCreationDate(System.currentTimeMillis());
pair.setTimestamp(System.currentTimeMillis());
pair.setPrivateKey(key);
pair = keyService.save(pair);
loginKeyIDs.add(pair.getId());
......@@ -208,7 +208,7 @@ public class CloudCredentialsController {
public @ResponseBody
CloudCredentials geta() {
CloudCredentials cloudCredentials = new CloudCredentials();
cloudCredentials.setCreationDate(System.currentTimeMillis());
cloudCredentials.setTimestamp(System.currentTimeMillis());
cloudCredentials.setAccessKeyId("AKIAITY3KHZUQ6M7YBSQ");
cloudCredentials.setCloudProviderName("ec2");
cloudCredentials.setSecretKey("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");
......
......@@ -139,7 +139,7 @@ public class KeyPairController {
KeyPair geta() {
try {
KeyPair pair = new KeyPair();
pair.setCreationDate(System.currentTimeMillis());
pair.setTimestamp(System.currentTimeMillis());
Key pk = new Key();
Map<String, String> attributes = new HashMap<>();
attributes.put("domain_name", "Virginia");
......
......@@ -200,7 +200,7 @@ public class Converter {
public static PlanResponse File2Plan1(Attribute p0) {
PlanResponse p1 = new PlanResponse();
p1.setCreationDate(System.currentTimeMillis());
p1.setTimestamp(System.currentTimeMillis());
p1.setLevel(Integer.valueOf(p0.level));
p1.setName(p0.name);
String yaml = p0.content.replaceAll("\\\\n", "\n");
......
......@@ -32,7 +32,7 @@ public class OwnedObject {
@Id
private String id;
private Long creationDate;
private Long timestamp;
@NotNull
private String owner;
......@@ -67,17 +67,15 @@ public class OwnedObject {
}
/**
* @return the creationDate
* @return the timestamp
*/
public Long getCreationDate() {
return creationDate;
public Long getTimestamp() {
return timestamp;
}
/**
* @param creationDate the creationDate to set
*/
public void setCreationDate(Long creationDate) {
this.creationDate = creationDate;
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
}
/*
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
......
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