Commit 94b5e917 authored by Maria A. Serrano's avatar Maria A. Serrano

Merge branch 'ikl-dev' into 'master'

Ikerlan: add security and communication related attributes

See merge request elastic-sa/dataclay!1
parents 93bd24b9 708f779c
......@@ -9,6 +9,12 @@ public class Application {
/** Application name. */
private String name;
/** Application security attribute. */
private boolean isSecure = true;
/** Application's information nature (E.x: Video stream, location data). */
private String infoNature;
/** Application master process. */
private Master master;
......@@ -19,7 +25,7 @@ public class Application {
* Application constructor.
* @param appName Name of the application
*/
public Application(final String appName) {
public Application(final String appName) { //TODO Add infonature in the constructor when it is fully defined
this.name = appName;
}
......@@ -30,7 +36,7 @@ public class Application {
public void setMaster(final Master themaster) {
this.master = themaster;
}
/**
* Add a new woker to the application.
......@@ -78,12 +84,39 @@ public class Application {
return this.name;
}
/**
* Get application security status
* @return isSecure
*/
public boolean isSecure() {
return this.isSecure;
}
/**
* Get application information status
* @return isSecure
*/
public String getInfoNature() {
return this.infoNature;
}
/**
* Set application's information nature.
* @param infonature Application's information nature
*/
public void setInfoNature(String infoNature) {
this.infoNature = infoNature ;
}
@Override
public String toString() {
String result = "Application: " + name + " \n";
result += " - master: " + master.toString() + "\n";
result += " - workers: " + workers + "\n";
result += " - active workers: " + getActiveWorkers() + "\n";
result += " - info nature: " + getInfoNature() + "\n";
result += " - is secure: " + Boolean.toString(isSecure()) + "\n";
return result;
}
}
......@@ -20,6 +20,9 @@ public class Node extends DataClayObject {
/** Node Energy capacity. */
private int energyCapacity;
/** Node Communication cost. */
private int communicationCost;
/** List of all masters present in a given node. */
private ArrayList<Master> masters = new ArrayList<>();
......@@ -38,6 +41,7 @@ public class Node extends DataClayObject {
this.address = nodeAddress;
this.cpuCapacity = cpuCapacity;
this.energyCapacity = energyCapacity;
this.communicationCost = 0;
}
......@@ -105,6 +109,22 @@ public class Node extends DataClayObject {
public void setName(String name) {
this.name = name;
}
/**
* Get node communication cost.
* @return Node communication cost.
*/
public String getCommunicationCost() {
return communicationCost;
}
/**
* Set node communication cost.
* @param communicationCost Node communicationCost to set.
*/
public void setCommunicationCost(String communicationCost) {
this.communicationCost = communicationCost;
}
/**
* Adds a master in the given node in order to be able to traverse the other way around.
......
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