Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • M12
  • M24
  • M30
  • TestForUpdateSite
5 results

Target

Select target project
  • DECIDE_Public/DECIDE_Components
1 result
Select Git revision
  • master
  • M12
  • M24
  • M30
  • TestForUpdateSite
5 results
Show changes
Commits on Source (2)
Showing
with 1585 additions and 916 deletions
......@@ -8,6 +8,8 @@
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
*.iml
.idea/
# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
......@@ -122,3 +124,6 @@ local.properties
.cache-main
.scala_dependencies
.worksheet
#Windows specific
*~
This diff is collapsed.
# DECIDE Application Controller
# DECIDE Application Controller Library
The Application Controller Library provides a consistent way for handling the AppDescription and History json files to every project that has to operate on these files.
......@@ -6,6 +6,7 @@ The Application Controller Library provides a consistent way for handling the Ap
1. [Features](#features)
1. [Installation](#installation)
1. [Getting started](#getting-started)
1. [Validation Exception Handling](#validation-exception-handling)
1. [The Model](#the-model)
1. [The Interface](#the-interface)
1. [License](#license)
......@@ -20,14 +21,14 @@ The Application Controller Library provides a consistent way for handling the Ap
The project is available via Git repository. If you have access, do the following steps:
```shell
```bash
$> git clone https://gitlab.fokus.fraunhofer.de/DECIDE/app-controller.git
$> cd app-controller
```
The project uses Maven as build tool. After build you will find the jar and a fat jar in the target directory. To build use the follwoing command:
```shell
```bash
$> mvn clean package
```
......@@ -60,8 +61,8 @@ AppManager appManager = AppManager.open(String gitRef, String username, String p
AppDescription appDescription = appManager.getAppDescription();
// do something with the AppDescription
//then save
// then save
appManager.writeAndSync(appDescription, "Added new Microservices");
// close the AppManager
......@@ -77,12 +78,33 @@ try (AppManager appManager = AppManager.open("https://git.ref/", "username", "pa
AppDescription appDescription = appManager.getAppDescription();
//work on the AppDescription & save it with AppManager
appManager.writeAndSync(appDescription, "Added NFRs");
} catch (IOException e) {
} catch (AppManagerException | IOException e) {
e.printStackTrace();
}
```
For further examples please take a look at the test cases.
## Validation Exception Handling
A `DECIDEValidationException` is usually a wrapper for the underlying validation library validation errors. The AppController utilizes the JSON Schema Validator from everit-org. You can easily access the original `ValidationException` if you need more details beyond the main message.
```java
try {
AppDescription appDescription = appManager.getAppDescription();
} catch (DECIDEValidationException e) {
ValidationException original = (ValidationException)e.getCause();
// get a list of all sub messages
List<String> messages = original.getAllMessages();
// get all sub exceptions. Each one is again a ValidationException
List<ValidationException> original.getCausingExceptions();
// getting a fancy pretty printed json structure containing all sub errors
String json = original.getJSON().toString(4);
} catch (IOEXception e) {
}
```
Please note that `DECIDEValidationException` is also a subclass of `AppManagerException`.
## The Model
......@@ -125,4 +147,4 @@ This class encapsulates the history model inside the app context. Therefore it c
## License
[Eclipse Public License version 2.0.](LICENSE.txt)
\ No newline at end of file
[GNU Affero General Public License Version 3](LICENSE.txt)
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>eu.DECIDEh2020</groupId>
<artifactId>app-controller</artifactId>
<version>0.0.12</version>
<version>0.0.16-SNAPSHOT</version>
<distributionManagement>
<repository>
<id>paca</id>
<name>Paca Releases Repo</name>
<url>https://paca.fokus.fraunhofer.de/repository/maven-releases/</url>
</repository>
<snapshotRepository>
<id>paca</id>
<url>https://paca.fokus.fraunhofer.de/repository/maven-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<scm>
<connection>scm:git:https://${GITLAB_USER_LDAP}:${GITLAB_USER_PASSWORD}@gitlab.fokus.fraunhofer.de/${CI_PROJECT_PATH}</connection>
<url>https://${GITLAB_USER_LDAP}:${GITLAB_USER_PASSWORD}@gitlab.fokus.fraunhofer.de/${CI_PROJECT_PATH}</url>
<developerConnection>scm:git:https://${GITLAB_USER_LDAP}:${GITLAB_USER_PASSWORD}@gitlab.fokus.fraunhofer.de/${CI_PROJECT_PATH}</developerConnection>
<tag>HEAD</tag>
</scm>
<repositories>
<repository>
<id>jgit-repository</id>
......@@ -17,26 +35,27 @@
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>4.11.0.201803080745-r</version>
<version>5.1.1.201809181055-r</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.5</version>
<version>2.9.6</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.5</version>
<version>2.9.6</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.5</version>
<version>2.9.6</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
......@@ -58,6 +77,14 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
......@@ -77,6 +104,8 @@
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>true</minimizeJar>
<shadedArtifactAttached>true</shadedArtifactAttached>
<filters>
<filter>
<artifact>*:*</artifact>
......@@ -87,12 +116,10 @@
</excludes>
</filter>
</filters>
<outputFile>${project.build.directory}/${project.artifactId}-${project.version}-fat.jar</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Path;
import java.util.Collections;
import java.util.UUID;
import com.fasterxml.jackson.core.JsonParseException;
......@@ -55,7 +67,7 @@ public class AppDescriptionFactory {
appDescription.setVersion("0.2.2-alpha");
appDescription.setHighTechnologicalRisk(false);
appDescription.setMicroservices(Collections.singletonList(createMicroservice("Default")));
appDescription.getMicroservices().add(createMicroservice("Default"));
return appDescription;
}
......@@ -65,7 +77,7 @@ public class AppDescriptionFactory {
microservice.setId(UUID.randomUUID().toString());
microservice.setName(name);
microservice.setEndpoints(Collections.singletonList("http://mircroservice1.com/service"));
microservice.getEndpoints().add("http://mircroservice1.com/service");
return microservice;
}
......
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager;
import eu.DECIDEh2020.appManager.models.AppDescription;
......@@ -72,4 +85,9 @@ public class AppDescriptionHelper {
}
public String getMicroserviceName(String id) {
Microservice microservice = appDescription.getMicroservices().stream().filter(m -> m.getId().equalsIgnoreCase(id)).findFirst().orElse(null);
return microservice != null ? microservice.getName() : null;
}
}
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import eu.DECIDEh2020.appManager.exceptions.AppManagerException;
import eu.DECIDEh2020.appManager.exceptions.DECIDEValidationException;
import eu.DECIDEh2020.appManager.models.AppDescription;
import eu.DECIDEh2020.appManager.persistence.GitHandler;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -166,6 +181,10 @@ public class AppManager implements Closeable {
}
}
public void reset() {
gitHandler.resetAll();
}
@Override
public void close() throws IOException {
try {
......
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import eu.DECIDEh2020.appManager.exceptions.DECIDEValidationException;
......@@ -9,6 +21,7 @@ import eu.DECIDEh2020.appManager.models.HistoryEntry;
import org.everit.json.schema.Schema;
import org.everit.json.schema.ValidationException;
import org.everit.json.schema.loader.SchemaLoader;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONTokener;
import org.slf4j.Logger;
......@@ -57,7 +70,8 @@ public class HistoryFactory {
public static void validateHistory(List<HistoryEntry> history) throws DECIDEValidationException {
try {
schema.validate(new ObjectMapper().writeValueAsString(history));
// must be a JSONArrat because the schema in optimus_history.schema.json declares it as an array -> otherwise the validation throws an error that a JSONObject must begin with '{'
schema.validate(new JSONArray(new ObjectMapper().writeValueAsString(history)));
} catch (JsonProcessingException e) {
log.error("json to string", e);
throw new DECIDEValidationException(e);
......@@ -69,7 +83,7 @@ public class HistoryFactory {
public static void validateHistory(JsonNode history) throws DECIDEValidationException {
try {
schema.validate(history.toString());
schema.validate(new JSONArray(history.toString()));
} catch (ValidationException e) {
log.error("validating json", e);
throw new DECIDEValidationException(e);
......
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import eu.DECIDEh2020.appManager.exceptions.AppManagerException;
import eu.DECIDEh2020.appManager.exceptions.DECIDEValidationException;
import eu.DECIDEh2020.appManager.models.HistoryEntry;
import eu.DECIDEh2020.appManager.persistence.GitHandler;
import org.eclipse.jgit.api.errors.GitAPIException;
......@@ -26,7 +40,7 @@ public class HistoryManager {
private boolean strict = true;
public static HistoryManager create(GitHandler gitHandler) {
static HistoryManager create(GitHandler gitHandler) {
return new HistoryManager(gitHandler);
}
......@@ -50,16 +64,20 @@ public class HistoryManager {
this.strict = strict;
}
public List<HistoryEntry> getHistory() throws AppManagerException, IOException {
public List<HistoryEntry> getHistory() throws DECIDEValidationException, IOException {
return Arrays.asList(new ObjectMapper().treeToValue(getHistoryAsTree(), HistoryEntry[].class));
}
public ArrayNode getHistoryAsTree() throws AppManagerException, IOException {
public List<HistoryEntry> getHistory(Path path) throws AppManagerException, IOException {
return HistoryFactory.loadHistory(path);
}
public ArrayNode getHistoryAsTree() throws DECIDEValidationException, IOException {
ObjectMapper mapper = new ObjectMapper();
JsonNode history = mapper.createArrayNode();
Path path = gitHandler.getRepository().getPath().resolve(descriptor);
if (Files.exists(path)) {
history = mapper.readTree(path.resolve(descriptor).toFile());
history = mapper.readTree(path.toFile());
if (strict) {
HistoryFactory.validateHistory(history);
}
......
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager.exceptions;
public class AppManagerException extends Exception {
......
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager.exceptions;
public class DECIDEValidationException extends AppManagerException {
......
......@@ -2,15 +2,16 @@
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* Eclipse Public License version 2.0 which accompanies
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* https://opensource.org/licenses/EPL-2.0
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
*
* Torben Jastrow (Fraunhofer FOKUS)
* Simon Dutkowski Fraunhofer FOKUS
*
* **Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu */
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager.models;
import java.util.ArrayList;
......@@ -52,7 +53,7 @@ public class AppDescription {
private Monitoring monitoring;
private String appInstanceId;
private String applicationInstanceId;
private Map<String, JsonNode> additionalProperties = new HashMap<>();
......@@ -176,12 +177,12 @@ public class AppDescription {
this.recommendedPatterns = recommendedPatterns;
}
public String getAppInstanceId() {
return appInstanceId;
public String getApplicationInstanceId() {
return applicationInstanceId;
}
public void setAppInstanceId(String appInstanceId) {
this.appInstanceId = appInstanceId;
public void setApplicationInstanceId(String applicationInstanceId) {
this.applicationInstanceId = applicationInstanceId;
}
@JsonAnyGetter
......
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager.models;
import com.fasterxml.jackson.annotation.*;
......@@ -12,16 +25,26 @@ import java.util.Map;
@JsonInclude(Include.NON_EMPTY)
public class AvailabilityNfr extends Nfr {
private double quantitativeAvailability;
private String abstractValue;
private Double value;
private String unit;
public double getQuantitativeAvailability() {
return quantitativeAvailability;
public String getAbstractValue() {
return abstractValue;
}
public void setAbstractValue(String abstractValue) {
this.abstractValue = abstractValue;
}
public Double getValue() {
return value;
}
public void setQuantitativeAvailability(double quantitativeAvailability) {
this.quantitativeAvailability = quantitativeAvailability;
public void setValue(double value) {
this.value = value;
}
public String getUnit() {
......
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager.models;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
......@@ -13,13 +26,12 @@ import java.util.Map;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Container {
private String id;
private String name;
private String imageName;
private String imageTag;
private String dockerPrivateRegistryIp;
private int dockerPrivateRegistryPort;
private Integer dockerPrivateRegistryPort;
private String hostname;
private String restart;
......@@ -31,31 +43,23 @@ public class Container {
private List<String> networks = new ArrayList<>();
private Map<String, String> volumeMapping = new HashMap<>();
private List<VolumeMapping> volumeMapping = new ArrayList<>();
private List<String> environment = new ArrayList<>();
private String consulKvProviderNodeName;
private boolean addConsulService;
private Integer addConsulService;
private int consulServicePort;
private Integer consulServicePort;
private boolean addConsulTraefikRules;
private Integer addConsulTraefikRules;
private Map<Integer, Integer> portMapping = new HashMap<>();
private List<PortMapping> portMapping = new ArrayList<>();
private Endpoint endpoints;
private List<Endpoint> endpoints = new ArrayList<>();
private Map<String, JsonNode> additionalProperties = new HashMap<>();
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
......@@ -88,11 +92,11 @@ public class Container {
this.dockerPrivateRegistryIp = dockerPrivateRegistryIp;
}
public int getDockerPrivateRegistryPort() {
public Integer getDockerPrivateRegistryPort() {
return dockerPrivateRegistryPort;
}
public void setDockerPrivateRegistryPort(int dockerPrivateRegistryPort) {
public void setDockerPrivateRegistryPort(Integer dockerPrivateRegistryPort) {
this.dockerPrivateRegistryPort = dockerPrivateRegistryPort;
}
......@@ -144,11 +148,11 @@ public class Container {
this.networks = networks;
}
public Map<String, String> getVolumeMapping() {
public List<VolumeMapping> getVolumeMapping() {
return volumeMapping;
}
public void setVolumeMapping(Map<String, String> volumeMapping) {
public void setVolumeMapping(List<VolumeMapping> volumeMapping) {
this.volumeMapping = volumeMapping;
}
......@@ -168,38 +172,46 @@ public class Container {
this.consulKvProviderNodeName = consulKvProviderNodeName;
}
public boolean isAddConsulService() {
public Integer getAddConsulService() {
return addConsulService;
}
public void setAddConsulService(boolean addConsulService) {
public void setAddConsulService(Integer addConsulService) {
this.addConsulService = addConsulService;
}
public boolean isAddConsulTraefikRules() {
return addConsulTraefikRules;
}
public void setAddConsulTraefikRules(boolean addConsulTraefikRules) {
this.addConsulTraefikRules = addConsulTraefikRules;
}
public Map<Integer, Integer> getPortMapping() {
public List<PortMapping> getPortMapping() {
return portMapping;
}
public void setPortMapping(Map<Integer, Integer> portMapping) {
public void setPortMapping(List<PortMapping> portMapping) {
this.portMapping = portMapping;
}
public Endpoint getEndpoints() {
public List<Endpoint> getEndpoints() {
return endpoints;
}
public void setEndpoints(Endpoint endpoints) {
public void setEndpoints(List<Endpoint> endpoints) {
this.endpoints = endpoints;
}
public Integer getConsulServicePort() {
return consulServicePort;
}
public void setConsulServicePort(Integer consulServicePort) {
this.consulServicePort = consulServicePort;
}
public void setAddConsulTraefikRules(Integer addConsulTraefikRules) {
this.addConsulTraefikRules = addConsulTraefikRules;
}
public Integer getAddConsulTraefikRules() {
return addConsulTraefikRules;
}
@JsonAnyGetter
public Map<String, JsonNode> getAdditionalProperties() {
return additionalProperties;
......
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager.models;
import com.fasterxml.jackson.annotation.JsonInclude;
......@@ -6,16 +19,26 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
@JsonInclude(Include.NON_EMPTY)
public class CostNfr extends Nfr {
private double quantitativeCost;
private String abstractValue;
private Double value;
private String unit;
public double getQuantitativeCost() {
return quantitativeCost;
public String getAbstractValue() {
return abstractValue;
}
public void setAbstractValue(String abstractValue) {
this.abstractValue = abstractValue;
}
public void setQuantitativeCost(double quantitativeCost) {
this.quantitativeCost = quantitativeCost;
public Double getValue() {
return value;
}
public void setValue(Double value) {
this.value = value;
}
public String getUnit() {
......@@ -25,4 +48,5 @@ public class CostNfr extends Nfr {
public void setUnit(String unit) {
this.unit = unit;
}
}
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager.models;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
......@@ -9,8 +22,8 @@ public class DetachableResource {
private String id;
private String name;
private boolean db;
private boolean sql;
private Boolean db;
private Boolean sql;
private String specificDb;
private String size;
private String classification;
......@@ -28,11 +41,11 @@ public class DetachableResource {
this.id = id;
}
public boolean isDb() {
public Boolean isDb() {
return db;
}
public void setDb(boolean db) {
public void setDb(Boolean db) {
this.db = db;
}
......@@ -48,11 +61,11 @@ public class DetachableResource {
this.name = name;
}
public boolean isSql() {
public Boolean isSql() {
return sql;
}
public void setSql(boolean sql) {
public void setSql(Boolean sql) {
this.sql = sql;
}
......
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager.models;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
......@@ -8,9 +21,9 @@ import com.fasterxml.jackson.annotation.JsonInclude;
public class Endpoint {
private String protocol;
private int port;
private boolean skipRule;
private boolean containerNameOverride;
private Integer port;
private Integer skipRule;
private String containerNameOverride;
public String getProtocol() {
return protocol;
......@@ -20,27 +33,27 @@ public class Endpoint {
this.protocol = protocol;
}
public int getPort() {
public Integer getPort() {
return port;
}
public void setPort(int port) {
public void setPort(Integer port) {
this.port = port;
}
public boolean isSkipRule() {
public Integer getSkipRule() {
return skipRule;
}
public void setSkipRule(boolean skipRule) {
public void setSkipRule(Integer skipRule) {
this.skipRule = skipRule;
}
public boolean isContainerNameOverride() {
public String getContainerNameOverride() {
return containerNameOverride;
}
public void setContainerNameOverride(boolean containerNameOverride) {
public void setContainerNameOverride(String containerNameOverride) {
this.containerNameOverride = containerNameOverride;
}
......
......@@ -2,14 +2,14 @@
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* <<licensing_schema_to_be_decided>> which accompanies
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* https://opensource.org/licenses/EPL-2.0
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Majid Salehi Ghamsari Fraunhofer FOKUS
**Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager.models;
......
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager.models;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
......
/*
* Copyright (c) 2017 Fraunhofer FOKUS.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the
* GNU AGPL v3 which accompanies
* this distribution, and is available at
* http://www.gnu.org/licenses/agpl.txt
*
* Contributors:
* Simon Dutkowski Fraunhofer FOKUS
*
* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu
*/
package eu.DECIDEh2020.appManager.models;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.node.ObjectNode;
import java.util.HashMap;
import java.util.Map;
import java.util.ArrayList;
import java.util.List;
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
......@@ -12,7 +26,9 @@ public class HistoryEntry {
private String date;
private Map<String, HistoricalDeployment> deployments = new HashMap<>();
private SchemaElement schema = new SchemaElement();
private List<ObjectNode> slaBreaches = new ArrayList<>();
public String getDate() {
return date;
......@@ -22,12 +38,20 @@ public class HistoryEntry {
this.date = date;
}
public Map<String, HistoricalDeployment> getDeployments() {
return deployments;
public SchemaElement getSchema() {
return schema;
}
public void setSchema(SchemaElement schema) {
this.schema = schema;
}
public List<ObjectNode> getSlaBreaches() {
return slaBreaches;
}
public void setDeployments(Map<String, HistoricalDeployment> deployments) {
this.deployments = deployments;
public void setSlaBreaches(List<ObjectNode> slaBreaches) {
this.slaBreaches = slaBreaches;
}
}