diff --git a/OPTIMUS/ACSmI-client/.classpath b/OPTIMUS/ACSmI-client/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..4b1e0b42b1c0b7e3dc507d83210e27533f780ed4 --- /dev/null +++ b/OPTIMUS/ACSmI-client/.classpath @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src/gen/java"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/OPTIMUS/ACSmI-client/.project b/OPTIMUS/ACSmI-client/.project new file mode 100644 index 0000000000000000000000000000000000000000..3c91b8ee53d725d0df1f1b42b5670e1836cdc8b6 --- /dev/null +++ b/OPTIMUS/ACSmI-client/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ACSmI-client</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + </natures> +</projectDescription> diff --git a/OPTIMUS/ACSmI-client/.settings/org.eclipse.core.resources.prefs b/OPTIMUS/ACSmI-client/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000000000000000000000000000000000..4824b8026319a8fb303971008a7d59a816d58bd6 --- /dev/null +++ b/OPTIMUS/ACSmI-client/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/<project>=UTF-8 diff --git a/OPTIMUS/ACSmI-client/.settings/org.eclipse.jdt.core.prefs b/OPTIMUS/ACSmI-client/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..bbcbc93486d53c73668b275ea5daf41b66ba9c41 --- /dev/null +++ b/OPTIMUS/ACSmI-client/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/OPTIMUS/ACSmI-client/.settings/org.eclipse.m2e.core.prefs b/OPTIMUS/ACSmI-client/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..14b697b7bbb0d85e8d8ee19141a2a92d9ce211be --- /dev/null +++ b/OPTIMUS/ACSmI-client/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/OPTIMUS/ACSmI-client/.swagger-codegen-ignore b/OPTIMUS/ACSmI-client/.swagger-codegen-ignore new file mode 100644 index 0000000000000000000000000000000000000000..c5fa491b4c557bf997d5dd21797de782545dc9e5 --- /dev/null +++ b/OPTIMUS/ACSmI-client/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/OPTIMUS/ACSmI-client/.swagger-codegen/VERSION b/OPTIMUS/ACSmI-client/.swagger-codegen/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..a6254504e40175d135cea7feb34ad31fa0d0bca3 --- /dev/null +++ b/OPTIMUS/ACSmI-client/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.1 \ No newline at end of file diff --git a/OPTIMUS/ACSmI-client/pom.xml b/OPTIMUS/ACSmI-client/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..d18f48c66c83bf95a95fde0e41ffb8449921812b --- /dev/null +++ b/OPTIMUS/ACSmI-client/pom.xml @@ -0,0 +1,179 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> +<!-- <groupId>io.swagger</groupId> --> +<!-- <artifactId>swagger-jaxrs-client</artifactId> --> +<!-- <packaging>jar</packaging> --> +<!-- <name>swagger-jaxrs-client</name> --> +<!-- <description>ACSmI Services API documentation</description> --> +<!-- <version>1.0.0</version> --> + <groupId>eu.decideh2020</groupId> + <artifactId>ACSmI-client</artifactId> + <packaging>jar</packaging> + <version>2.0.0</version> + <build> + <sourceDirectory>src/main/java</sourceDirectory> + <plugins> + <plugin> + <artifactId>maven-failsafe-plugin</artifactId> + <version>2.6</version> + <executions> + <execution> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + </execution> + </executions> + </plugin> + <!--plugin> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>${jetty-version}</version> + <configuration> + <webApp> + <contextPath>/</contextPath> + </webApp> + <webAppSourceDirectory>target/${project.artifactId}-${project.version}</webAppSourceDirectory> + <stopPort>8079</stopPort> + <stopKey>stopit</stopKey> + <httpConnector> + <port></port> + <idleTimeout>60000</idleTimeout> + </httpConnector> + </configuration> + <executions> + <execution> + <id>start-jetty</id> + <phase>pre-integration-test</phase> + <goals> + <goal>start</goal> + </goals> + <configuration> + <scanIntervalSeconds>0</scanIntervalSeconds> + <daemon>true</daemon> + </configuration> + </execution> + <execution> + <id>stop-jetty</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</goal> + </goals> + </execution> + </executions> + </plugin--> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>1.9.1</version> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>src/gen/java</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-jaxrs</artifactId> + <scope>compile</scope> + <version>${swagger-core-version}</version> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <version>${logback-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-core</artifactId> + <version>${logback-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junit-version}</version> + <scope>test</scope> + </dependency> + <!-- CXF Client --> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-client</artifactId> + <version>${cxf-version}</version> + <scope>test</scope> + </dependency> + + <!-- CXF server --> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-frontend-jaxrs</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-service-description</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-ws-policy</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-wsdl</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.jaxrs</groupId> + <artifactId>jackson-jaxrs-json-provider</artifactId> + <version>${jackson-jaxrs-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.datatype</groupId> + <artifactId>jackson-datatype-joda</artifactId> + <version>${jackson-jaxrs-version}</version> + <scope>compile</scope> + </dependency> + </dependencies> + <repositories> + <repository> + <id>sonatype-snapshots</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <properties> + <java.version>1.7</java.version> + <maven.compiler.source>${java.version}</maven.compiler.source> + <maven.compiler.target>${java.version}</maven.compiler.target> + <swagger-core-version>1.5.15</swagger-core-version> + <jetty-version>9.2.9.v20150224</jetty-version> + <junit-version>4.12</junit-version> + <logback-version>1.1.7</logback-version> + <servlet-api-version>2.5</servlet-api-version> + <cxf-version>3.1.11</cxf-version> + <jackson-jaxrs-version>2.8.9</jackson-jaxrs-version> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> +</project> diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/DefinitionResourceApi.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/DefinitionResourceApi.java new file mode 100644 index 0000000000000000000000000000000000000000..330ce87e18414221dc5df1afef86b439448f74a3 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/DefinitionResourceApi.java @@ -0,0 +1,62 @@ +package eu.decideh2020.acsmi.client.api; + +import eu.decideh2020.acsmi.client.model.Definition; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; +import io.swagger.jaxrs.PATCH; + +/** + * acsmiservices API + * + * <p>acsmiservices API documentation + * + */ +@Path("/") +@Api(value = "/", description = "") +public interface DefinitionResourceApi { + + /** + * getAllDefinitions + * + */ + @GET + @Path("/api/definitions") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getAllDefinitions", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = Definition.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public List<Definition> getAllDefinitionsUsingGET(); + + /** + * getDefinition + * + */ + @GET + @Path("/api/definitions/{id}") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getDefinition", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = Definition.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public Definition getDefinitionUsingGET(@PathParam("id") Long id); +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ProfileInfoResourceApi.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ProfileInfoResourceApi.java new file mode 100644 index 0000000000000000000000000000000000000000..7151da656e421390a3106de74aff9b56ebaece99 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ProfileInfoResourceApi.java @@ -0,0 +1,46 @@ +package eu.decideh2020.acsmi.client.api; + +import eu.decideh2020.acsmi.client.model.ProfileInfoVM; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; +import io.swagger.jaxrs.PATCH; + +/** + * acsmiservices API + * + * <p>acsmiservices API documentation + * + */ +@Path("/") +@Api(value = "/", description = "") +public interface ProfileInfoResourceApi { + + /** + * getActiveProfiles + * + */ + @GET + @Path("/api/profile-info") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getActiveProfiles", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ProfileInfoVM.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public ProfileInfoVM getActiveProfilesUsingGET(); +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceAttributeTypeResourceApi.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceAttributeTypeResourceApi.java new file mode 100644 index 0000000000000000000000000000000000000000..d2c8ed3fc7271e871fd53ce4da59babe289253bf --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceAttributeTypeResourceApi.java @@ -0,0 +1,62 @@ +package eu.decideh2020.acsmi.client.api; + +import eu.decideh2020.acsmi.client.model.ServiceAttributeType; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; +import io.swagger.jaxrs.PATCH; + +/** + * acsmiservices API + * + * <p>acsmiservices API documentation + * + */ +@Path("/") +@Api(value = "/", description = "") +public interface ServiceAttributeTypeResourceApi { + + /** + * findServiceAttributeTypes + * + */ + @GET + @Path("/api/service-attribute-types") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "findServiceAttributeTypes", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceAttributeType.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public List<ServiceAttributeType> findServiceAttributeTypesUsingGET(@QueryParam("classid")String classid); + + /** + * getServiceAttributeType + * + */ + @GET + @Path("/api/service-attribute-types/{id}") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getServiceAttributeType", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceAttributeType.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public ServiceAttributeType getServiceAttributeTypeUsingGET(@PathParam("id") Long id); +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceAttributeValueResourceApi.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceAttributeValueResourceApi.java new file mode 100644 index 0000000000000000000000000000000000000000..6958862be61b328e111781c01805554c3930d854 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceAttributeValueResourceApi.java @@ -0,0 +1,96 @@ +package eu.decideh2020.acsmi.client.api; + +import eu.decideh2020.acsmi.client.model.ServiceAttributeValue; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; +import io.swagger.jaxrs.PATCH; + +/** + * acsmiservices API + * + * <p>acsmiservices API documentation + * + */ +@Path("/") +@Api(value = "/", description = "") +public interface ServiceAttributeValueResourceApi { + + /** + * createServiceAttributeValue + * + */ + @POST + @Path("/api/service-attribute-values") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "createServiceAttributeValue", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceAttributeValue.class), + @ApiResponse(code = 201, message = "Created", response = void.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public ServiceAttributeValue createServiceAttributeValueUsingPOST(ServiceAttributeValue serviceAttributeValue); + + /** + * deleteServiceAttributeValue + * + */ + @DELETE + @Path("/api/service-attribute-values/{id}") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "deleteServiceAttributeValue", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = void.class), + @ApiResponse(code = 204, message = "No Content", response = void.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class) }) + public void deleteServiceAttributeValueUsingDELETE(@PathParam("id") Long id, @QueryParam("forcedelete")String forcedelete); + + /** + * getServiceAttributeValue + * + */ + @GET + @Path("/api/service-attribute-values/{id}") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getServiceAttributeValue", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceAttributeValue.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public ServiceAttributeValue getServiceAttributeValueUsingGET(@PathParam("id") Long id); + + /** + * updateServiceAttributeValue + * + */ + @PUT + @Path("/api/service-attribute-values") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "updateServiceAttributeValue", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceAttributeValue.class), + @ApiResponse(code = 201, message = "Created", response = void.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public ServiceAttributeValue updateServiceAttributeValueUsingPUT(ServiceAttributeValue serviceAttributeValue); +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceClassAttributeResourceApi.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceClassAttributeResourceApi.java new file mode 100644 index 0000000000000000000000000000000000000000..8bafeac9d62195fa0bda5c771342a30a20152264 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceClassAttributeResourceApi.java @@ -0,0 +1,62 @@ +package eu.decideh2020.acsmi.client.api; + +import eu.decideh2020.acsmi.client.model.ServiceClassAttribute; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; +import io.swagger.jaxrs.PATCH; + +/** + * acsmiservices API + * + * <p>acsmiservices API documentation + * + */ +@Path("/") +@Api(value = "/", description = "") +public interface ServiceClassAttributeResourceApi { + + /** + * getAllServiceClassAttributes + * + */ + @GET + @Path("/api/service-class-attributes") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getAllServiceClassAttributes", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceClassAttribute.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public List<ServiceClassAttribute> getAllServiceClassAttributesUsingGET(@QueryParam("classid")String classid); + + /** + * getServiceClassAttribute + * + */ + @GET + @Path("/api/service-class-attributes/{id}") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getServiceClassAttribute", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceClassAttribute.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public ServiceClassAttribute getServiceClassAttributeUsingGET(@PathParam("id") Long id); +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceClassResourceApi.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceClassResourceApi.java new file mode 100644 index 0000000000000000000000000000000000000000..0b3243abb17cd40b27142a46c6cbf33ead701da8 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceClassResourceApi.java @@ -0,0 +1,78 @@ +package eu.decideh2020.acsmi.client.api; + +import eu.decideh2020.acsmi.client.model.ServiceClass; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; +import io.swagger.jaxrs.PATCH; + +/** + * acsmiservices API + * + * <p>acsmiservices API documentation + * + */ +@Path("/") +@Api(value = "/", description = "") +public interface ServiceClassResourceApi { + + /** + * getAllServiceClassesFullInfo + * + */ + @GET + @Path("/api/service-classes/full") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getAllServiceClassesFullInfo", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceClass.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public List<ServiceClass> getAllServiceClassesFullInfoUsingGET(); + + /** + * getAllServiceClasses + * + */ + @GET + @Path("/api/service-classes") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getAllServiceClasses", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceClass.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public List<ServiceClass> getAllServiceClassesUsingGET(); + + /** + * getServiceClass + * + */ + @GET + @Path("/api/service-classes/{id}") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getServiceClass", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceClass.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public ServiceClass getServiceClassUsingGET(@PathParam("id") Long id); +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceIncidenceResourceApi.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceIncidenceResourceApi.java new file mode 100644 index 0000000000000000000000000000000000000000..be2653ef899fa5dc20bfda9ec30ba928151f29f6 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceIncidenceResourceApi.java @@ -0,0 +1,63 @@ +package eu.decideh2020.acsmi.client.api; + +import eu.decideh2020.acsmi.client.model.ServiceIncidence; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; +import io.swagger.jaxrs.PATCH; + +/** + * acsmiservices API + * + * <p>acsmiservices API documentation + * + */ +@Path("/") +@Api(value = "/", description = "") +public interface ServiceIncidenceResourceApi { + + /** + * createServiceIncidence + * + */ + @POST + @Path("/api/service-incidences") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "createServiceIncidence", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceIncidence.class), + @ApiResponse(code = 201, message = "Created", response = void.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public ServiceIncidence createServiceIncidenceUsingPOST(ServiceIncidence serviceIncidence); + + /** + * getAllServiceIncidences + * + */ + @GET + @Path("/api/service-incidences/{id}") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getAllServiceIncidences", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceIncidence.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public List<ServiceIncidence> getAllServiceIncidencesUsingGET(@PathParam("id") Long id); +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceResourceApi.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceResourceApi.java new file mode 100644 index 0000000000000000000000000000000000000000..f5a464b296b250614e158a9cb01611c81e78450c --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/api/ServiceResourceApi.java @@ -0,0 +1,178 @@ +package eu.decideh2020.acsmi.client.api; + +import eu.decideh2020.acsmi.client.model.Service; +import eu.decideh2020.acsmi.client.model.ServiceDevOpsInfoVO; +import eu.decideh2020.acsmi.client.model.ServiceNFRInfoVO; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; +import io.swagger.jaxrs.PATCH; + +/** + * acsmiservices API + * + * <p>acsmiservices API documentation + * + */ +@Path("/") +@Api(value = "/", description = "") +public interface ServiceResourceApi { + + /** + * createService + * + */ + @POST + @Path("/api/services") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "createService", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = Service.class), + @ApiResponse(code = 201, message = "Created", response = void.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public Service createServiceUsingPOST(Service service, @QueryParam("attributes")List<String> attributes); + + /** + * deleteService + * + */ + @DELETE + @Path("/api/services/{id}") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "deleteService", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = void.class), + @ApiResponse(code = 204, message = "No Content", response = void.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class) }) + public void deleteServiceUsingDELETE(@PathParam("id") Long id, @QueryParam("forcedelete")String forcedelete); + + /** + * findServices + * + */ + @GET + @Path("/api/services/find") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "findServices", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = Service.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public List<Service> findServicesUsingGET(@QueryParam("filter")String filter); + + /** + * getAllServices + * + */ + @GET + @Path("/api/services") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getAllServices", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = Service.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public List<Service> getAllServicesUsingGET(); + + /** + * getDevOpsInfo + * + */ + @GET + @Path("/api/services/devops") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getDevOpsInfo", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceDevOpsInfoVO.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public List<ServiceDevOpsInfoVO> getDevOpsInfoUsingGET(); + + /** + * getOptimusInfo + * + */ + @GET + @Path("/api/services/optimus") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getOptimusInfo", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = Service.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public List<Service> getOptimusInfoUsingGET(@QueryParam("serviceids")List<Long> serviceids); + + /** + * getServiceNfrInfo + * + */ + @GET + @Path("/api/services/nfr") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getServiceNfrInfo", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = ServiceNFRInfoVO.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public List<ServiceNFRInfoVO> getServiceNfrInfoUsingGET(@QueryParam("serviceids")List<Long> serviceids); + + /** + * getService + * + */ + @GET + @Path("/api/services/{id}") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "getService", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = Service.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public Service getServiceUsingGET(@PathParam("id") Long id); + + /** + * updateService + * + */ + @PUT + @Path("/api/services") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "updateService", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = Service.class), + @ApiResponse(code = 201, message = "Created", response = void.class), + @ApiResponse(code = 401, message = "Unauthorized", response = void.class), + @ApiResponse(code = 403, message = "Forbidden", response = void.class), + @ApiResponse(code = 404, message = "Not Found", response = void.class) }) + public Service updateServiceUsingPUT(Service service, @QueryParam("attributes")List<String> attributes); +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/AttributeVO.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/AttributeVO.java new file mode 100644 index 0000000000000000000000000000000000000000..155c15d055ae540659c838a9f644cd4d90f218d2 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/AttributeVO.java @@ -0,0 +1,498 @@ +package eu.decideh2020.acsmi.client.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class AttributeVO { + + @ApiModelProperty(value = "") + private String checklistevalrule = null; + + @ApiModelProperty(value = "") + private String checklistvalue = null; + + @ApiModelProperty(value = "") + private Long childid = null; + + @ApiModelProperty(value = "") + private Long classattributeid = null; + + @ApiModelProperty(value = "") + private String human = null; + + @ApiModelProperty(value = "") + private Boolean ischecklist = null; + + @ApiModelProperty(value = "") + private Boolean iscommon = null; + + @ApiModelProperty(value = "") + private Boolean isenumeration = null; + + @ApiModelProperty(value = "") + private Boolean isfunctionalrequirement = null; + + @ApiModelProperty(value = "") + private Boolean ismandatory = null; + + @ApiModelProperty(value = "") + private String name = null; + + @ApiModelProperty(value = "") + private String nfrname = null; + + @ApiModelProperty(value = "") + private Long parentid = null; + + @ApiModelProperty(value = "") + private Long typeid = null; + + @ApiModelProperty(value = "") + private String unitfactor = null; + + @ApiModelProperty(value = "") + private String unitrule = null; + + @ApiModelProperty(value = "") + private String units = null; + + @ApiModelProperty(value = "") + private String unitvalue = null; + + @ApiModelProperty(value = "") + private String value = null; + + @ApiModelProperty(value = "") + private Long valueid = null; + + @ApiModelProperty(value = "") + private Integer weight = null; + /** + * Get checklistevalrule + * @return checklistevalrule + **/ + @JsonProperty("checklistevalrule") + public String getChecklistevalrule() { + return checklistevalrule; + } + + public void setChecklistevalrule(String checklistevalrule) { + this.checklistevalrule = checklistevalrule; + } + + public AttributeVO checklistevalrule(String checklistevalrule) { + this.checklistevalrule = checklistevalrule; + return this; + } + + /** + * Get checklistvalue + * @return checklistvalue + **/ + @JsonProperty("checklistvalue") + public String getChecklistvalue() { + return checklistvalue; + } + + public void setChecklistvalue(String checklistvalue) { + this.checklistvalue = checklistvalue; + } + + public AttributeVO checklistvalue(String checklistvalue) { + this.checklistvalue = checklistvalue; + return this; + } + + /** + * Get childid + * @return childid + **/ + @JsonProperty("childid") + public Long getChildid() { + return childid; + } + + public void setChildid(Long childid) { + this.childid = childid; + } + + public AttributeVO childid(Long childid) { + this.childid = childid; + return this; + } + + /** + * Get classattributeid + * @return classattributeid + **/ + @JsonProperty("classattributeid") + public Long getClassattributeid() { + return classattributeid; + } + + public void setClassattributeid(Long classattributeid) { + this.classattributeid = classattributeid; + } + + public AttributeVO classattributeid(Long classattributeid) { + this.classattributeid = classattributeid; + return this; + } + + /** + * Get human + * @return human + **/ + @JsonProperty("human") + public String getHuman() { + return human; + } + + public void setHuman(String human) { + this.human = human; + } + + public AttributeVO human(String human) { + this.human = human; + return this; + } + + /** + * Get ischecklist + * @return ischecklist + **/ + @JsonProperty("ischecklist") + public Boolean isIschecklist() { + return ischecklist; + } + + public void setIschecklist(Boolean ischecklist) { + this.ischecklist = ischecklist; + } + + public AttributeVO ischecklist(Boolean ischecklist) { + this.ischecklist = ischecklist; + return this; + } + + /** + * Get iscommon + * @return iscommon + **/ + @JsonProperty("iscommon") + public Boolean isIscommon() { + return iscommon; + } + + public void setIscommon(Boolean iscommon) { + this.iscommon = iscommon; + } + + public AttributeVO iscommon(Boolean iscommon) { + this.iscommon = iscommon; + return this; + } + + /** + * Get isenumeration + * @return isenumeration + **/ + @JsonProperty("isenumeration") + public Boolean isIsenumeration() { + return isenumeration; + } + + public void setIsenumeration(Boolean isenumeration) { + this.isenumeration = isenumeration; + } + + public AttributeVO isenumeration(Boolean isenumeration) { + this.isenumeration = isenumeration; + return this; + } + + /** + * Get isfunctionalrequirement + * @return isfunctionalrequirement + **/ + @JsonProperty("isfunctionalrequirement") + public Boolean isIsfunctionalrequirement() { + return isfunctionalrequirement; + } + + public void setIsfunctionalrequirement(Boolean isfunctionalrequirement) { + this.isfunctionalrequirement = isfunctionalrequirement; + } + + public AttributeVO isfunctionalrequirement(Boolean isfunctionalrequirement) { + this.isfunctionalrequirement = isfunctionalrequirement; + return this; + } + + /** + * Get ismandatory + * @return ismandatory + **/ + @JsonProperty("ismandatory") + public Boolean isIsmandatory() { + return ismandatory; + } + + public void setIsmandatory(Boolean ismandatory) { + this.ismandatory = ismandatory; + } + + public AttributeVO ismandatory(Boolean ismandatory) { + this.ismandatory = ismandatory; + return this; + } + + /** + * Get name + * @return name + **/ + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public AttributeVO name(String name) { + this.name = name; + return this; + } + + /** + * Get nfrname + * @return nfrname + **/ + @JsonProperty("nfrname") + public String getNfrname() { + return nfrname; + } + + public void setNfrname(String nfrname) { + this.nfrname = nfrname; + } + + public AttributeVO nfrname(String nfrname) { + this.nfrname = nfrname; + return this; + } + + /** + * Get parentid + * @return parentid + **/ + @JsonProperty("parentid") + public Long getParentid() { + return parentid; + } + + public void setParentid(Long parentid) { + this.parentid = parentid; + } + + public AttributeVO parentid(Long parentid) { + this.parentid = parentid; + return this; + } + + /** + * Get typeid + * @return typeid + **/ + @JsonProperty("typeid") + public Long getTypeid() { + return typeid; + } + + public void setTypeid(Long typeid) { + this.typeid = typeid; + } + + public AttributeVO typeid(Long typeid) { + this.typeid = typeid; + return this; + } + + /** + * Get unitfactor + * @return unitfactor + **/ + @JsonProperty("unitfactor") + public String getUnitfactor() { + return unitfactor; + } + + public void setUnitfactor(String unitfactor) { + this.unitfactor = unitfactor; + } + + public AttributeVO unitfactor(String unitfactor) { + this.unitfactor = unitfactor; + return this; + } + + /** + * Get unitrule + * @return unitrule + **/ + @JsonProperty("unitrule") + public String getUnitrule() { + return unitrule; + } + + public void setUnitrule(String unitrule) { + this.unitrule = unitrule; + } + + public AttributeVO unitrule(String unitrule) { + this.unitrule = unitrule; + return this; + } + + /** + * Get units + * @return units + **/ + @JsonProperty("units") + public String getUnits() { + return units; + } + + public void setUnits(String units) { + this.units = units; + } + + public AttributeVO units(String units) { + this.units = units; + return this; + } + + /** + * Get unitvalue + * @return unitvalue + **/ + @JsonProperty("unitvalue") + public String getUnitvalue() { + return unitvalue; + } + + public void setUnitvalue(String unitvalue) { + this.unitvalue = unitvalue; + } + + public AttributeVO unitvalue(String unitvalue) { + this.unitvalue = unitvalue; + return this; + } + + /** + * Get value + * @return value + **/ + @JsonProperty("value") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public AttributeVO value(String value) { + this.value = value; + return this; + } + + /** + * Get valueid + * @return valueid + **/ + @JsonProperty("valueid") + public Long getValueid() { + return valueid; + } + + public void setValueid(Long valueid) { + this.valueid = valueid; + } + + public AttributeVO valueid(Long valueid) { + this.valueid = valueid; + return this; + } + + /** + * Get weight + * @return weight + **/ + @JsonProperty("weight") + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + + public AttributeVO weight(Integer weight) { + this.weight = weight; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttributeVO {\n"); + + sb.append(" checklistevalrule: ").append(toIndentedString(checklistevalrule)).append("\n"); + sb.append(" checklistvalue: ").append(toIndentedString(checklistvalue)).append("\n"); + sb.append(" childid: ").append(toIndentedString(childid)).append("\n"); + sb.append(" classattributeid: ").append(toIndentedString(classattributeid)).append("\n"); + sb.append(" human: ").append(toIndentedString(human)).append("\n"); + sb.append(" ischecklist: ").append(toIndentedString(ischecklist)).append("\n"); + sb.append(" iscommon: ").append(toIndentedString(iscommon)).append("\n"); + sb.append(" isenumeration: ").append(toIndentedString(isenumeration)).append("\n"); + sb.append(" isfunctionalrequirement: ").append(toIndentedString(isfunctionalrequirement)).append("\n"); + sb.append(" ismandatory: ").append(toIndentedString(ismandatory)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nfrname: ").append(toIndentedString(nfrname)).append("\n"); + sb.append(" parentid: ").append(toIndentedString(parentid)).append("\n"); + sb.append(" typeid: ").append(toIndentedString(typeid)).append("\n"); + sb.append(" unitfactor: ").append(toIndentedString(unitfactor)).append("\n"); + sb.append(" unitrule: ").append(toIndentedString(unitrule)).append("\n"); + sb.append(" units: ").append(toIndentedString(units)).append("\n"); + sb.append(" unitvalue: ").append(toIndentedString(unitvalue)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" valueid: ").append(toIndentedString(valueid)).append("\n"); + sb.append(" weight: ").append(toIndentedString(weight)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/Definition.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/Definition.java new file mode 100644 index 0000000000000000000000000000000000000000..23e90ef52e82105f1159bd785467162a3a1fd805 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/Definition.java @@ -0,0 +1,235 @@ +package eu.decideh2020.acsmi.client.model; + +import java.util.Date; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Definition { + + @ApiModelProperty(required = true, value = "") + private String code = null; + + @ApiModelProperty(value = "") + private Date createdDate = null; + + @ApiModelProperty(value = "") + private Date deleteddate = null; + + @ApiModelProperty(value = "") + private Long id = null; + + @ApiModelProperty(required = true, value = "") + private Boolean ischeckoption = null; + + @ApiModelProperty(required = true, value = "") + private Boolean ismainattribute = null; + + @ApiModelProperty(value = "") + private Date lastModifiedDate = null; + + @ApiModelProperty(value = "") + private Long typeid = null; + + @ApiModelProperty(required = true, value = "") + private String value = null; + /** + * Get code + * @return code + **/ + @JsonProperty("code") + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Definition code(String code) { + this.code = code; + return this; + } + + /** + * Get createdDate + * @return createdDate + **/ + @JsonProperty("createdDate") + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public Definition createdDate(Date createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get deleteddate + * @return deleteddate + **/ + @JsonProperty("deleteddate") + public Date getDeleteddate() { + return deleteddate; + } + + public void setDeleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + } + + public Definition deleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + return this; + } + + /** + * Get id + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Definition id(Long id) { + this.id = id; + return this; + } + + /** + * Get ischeckoption + * @return ischeckoption + **/ + @JsonProperty("ischeckoption") + public Boolean isIscheckoption() { + return ischeckoption; + } + + public void setIscheckoption(Boolean ischeckoption) { + this.ischeckoption = ischeckoption; + } + + public Definition ischeckoption(Boolean ischeckoption) { + this.ischeckoption = ischeckoption; + return this; + } + + /** + * Get ismainattribute + * @return ismainattribute + **/ + @JsonProperty("ismainattribute") + public Boolean isIsmainattribute() { + return ismainattribute; + } + + public void setIsmainattribute(Boolean ismainattribute) { + this.ismainattribute = ismainattribute; + } + + public Definition ismainattribute(Boolean ismainattribute) { + this.ismainattribute = ismainattribute; + return this; + } + + /** + * Get lastModifiedDate + * @return lastModifiedDate + **/ + @JsonProperty("lastModifiedDate") + public Date getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + public Definition lastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + + /** + * Get typeid + * @return typeid + **/ + @JsonProperty("typeid") + public Long getTypeid() { + return typeid; + } + + public void setTypeid(Long typeid) { + this.typeid = typeid; + } + + public Definition typeid(Long typeid) { + this.typeid = typeid; + return this; + } + + /** + * Get value + * @return value + **/ + @JsonProperty("value") + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public Definition value(String value) { + this.value = value; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Definition {\n"); + + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" deleteddate: ").append(toIndentedString(deleteddate)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ischeckoption: ").append(toIndentedString(ischeckoption)).append("\n"); + sb.append(" ismainattribute: ").append(toIndentedString(ismainattribute)).append("\n"); + sb.append(" lastModifiedDate: ").append(toIndentedString(lastModifiedDate)).append("\n"); + sb.append(" typeid: ").append(toIndentedString(typeid)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ProfileInfoVM.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ProfileInfoVM.java new file mode 100644 index 0000000000000000000000000000000000000000..a6f40bf49de66fe4600167cdbc8a23e704b26d2a --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ProfileInfoVM.java @@ -0,0 +1,87 @@ +package eu.decideh2020.acsmi.client.model; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ProfileInfoVM { + + @ApiModelProperty(value = "") + private List<String> activeProfiles = null; + + @ApiModelProperty(value = "") + private String ribbonEnv = null; + /** + * Get activeProfiles + * @return activeProfiles + **/ + @JsonProperty("activeProfiles") + public List<String> getActiveProfiles() { + return activeProfiles; + } + + public void setActiveProfiles(List<String> activeProfiles) { + this.activeProfiles = activeProfiles; + } + + public ProfileInfoVM activeProfiles(List<String> activeProfiles) { + this.activeProfiles = activeProfiles; + return this; + } + + public ProfileInfoVM addActiveProfilesItem(String activeProfilesItem) { + this.activeProfiles.add(activeProfilesItem); + return this; + } + + /** + * Get ribbonEnv + * @return ribbonEnv + **/ + @JsonProperty("ribbonEnv") + public String getRibbonEnv() { + return ribbonEnv; + } + + public void setRibbonEnv(String ribbonEnv) { + this.ribbonEnv = ribbonEnv; + } + + public ProfileInfoVM ribbonEnv(String ribbonEnv) { + this.ribbonEnv = ribbonEnv; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileInfoVM {\n"); + + sb.append(" activeProfiles: ").append(toIndentedString(activeProfiles)).append("\n"); + sb.append(" ribbonEnv: ").append(toIndentedString(ribbonEnv)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/Service.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/Service.java new file mode 100644 index 0000000000000000000000000000000000000000..27896b4849365bd094bbdc802660c6995da2f8da --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/Service.java @@ -0,0 +1,380 @@ +package eu.decideh2020.acsmi.client.model; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +import eu.decideh2020.acsmi.client.model.AttributeVO; +import eu.decideh2020.acsmi.client.model.ServiceIncidence; + +public class Service { + + @ApiModelProperty(value = "") + private List<AttributeVO> attributes = null; + + @ApiModelProperty(value = "") + private Date createdDate = null; + + @ApiModelProperty(value = "") + private Date deleteddate = null; + + @ApiModelProperty(value = "") + private List<byte[]> firstcontract = null; + + @ApiModelProperty(value = "") + private Long id = null; + + @ApiModelProperty(value = "") + private List<ServiceIncidence> incidences = null; + + @ApiModelProperty(value = "") + private Date lastModifiedDate = null; + + @ApiModelProperty(value = "") + private Double match = null; + + @ApiModelProperty(value = "") + private List<String> matchingattributelist = null; + + @ApiModelProperty(value = "") + private List<byte[]> secondcontract = null; + + @ApiModelProperty(required = true, value = "") + private Long serviceclassid = null; + + @ApiModelProperty(value = "") + private String serviceclassname = null; + + @ApiModelProperty(required = true, value = "") + private String servicename = null; + + @ApiModelProperty(value = "") + private List<byte[]> thirdcontract = null; + /** + * Get attributes + * @return attributes + **/ + @JsonProperty("attributes") + public List<AttributeVO> getAttributes() { + return attributes; + } + + public void setAttributes(List<AttributeVO> attributes) { + this.attributes = attributes; + } + + public Service attributes(List<AttributeVO> attributes) { + this.attributes = attributes; + return this; + } + + public Service addAttributesItem(AttributeVO attributesItem) { + this.attributes.add(attributesItem); + return this; + } + + /** + * Get createdDate + * @return createdDate + **/ + @JsonProperty("createdDate") + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public Service createdDate(Date createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get deleteddate + * @return deleteddate + **/ + @JsonProperty("deleteddate") + public Date getDeleteddate() { + return deleteddate; + } + + public void setDeleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + } + + public Service deleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + return this; + } + + /** + * Get firstcontract + * @return firstcontract + **/ + @JsonProperty("firstcontract") + public List<byte[]> getFirstcontract() { + return firstcontract; + } + + public void setFirstcontract(List<byte[]> firstcontract) { + this.firstcontract = firstcontract; + } + + public Service firstcontract(List<byte[]> firstcontract) { + this.firstcontract = firstcontract; + return this; + } + + public Service addFirstcontractItem(byte[] firstcontractItem) { + this.firstcontract.add(firstcontractItem); + return this; + } + + /** + * Get id + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Service id(Long id) { + this.id = id; + return this; + } + + /** + * Get incidences + * @return incidences + **/ + @JsonProperty("incidences") + public List<ServiceIncidence> getIncidences() { + return incidences; + } + + public void setIncidences(List<ServiceIncidence> incidences) { + this.incidences = incidences; + } + + public Service incidences(List<ServiceIncidence> incidences) { + this.incidences = incidences; + return this; + } + + public Service addIncidencesItem(ServiceIncidence incidencesItem) { + this.incidences.add(incidencesItem); + return this; + } + + /** + * Get lastModifiedDate + * @return lastModifiedDate + **/ + @JsonProperty("lastModifiedDate") + public Date getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + public Service lastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + + /** + * Get match + * @return match + **/ + @JsonProperty("match") + public Double getMatch() { + return match; + } + + public void setMatch(Double match) { + this.match = match; + } + + public Service match(Double match) { + this.match = match; + return this; + } + + /** + * Get matchingattributelist + * @return matchingattributelist + **/ + @JsonProperty("matchingattributelist") + public List<String> getMatchingattributelist() { + return matchingattributelist; + } + + public void setMatchingattributelist(List<String> matchingattributelist) { + this.matchingattributelist = matchingattributelist; + } + + public Service matchingattributelist(List<String> matchingattributelist) { + this.matchingattributelist = matchingattributelist; + return this; + } + + public Service addMatchingattributelistItem(String matchingattributelistItem) { + this.matchingattributelist.add(matchingattributelistItem); + return this; + } + + /** + * Get secondcontract + * @return secondcontract + **/ + @JsonProperty("secondcontract") + public List<byte[]> getSecondcontract() { + return secondcontract; + } + + public void setSecondcontract(List<byte[]> secondcontract) { + this.secondcontract = secondcontract; + } + + public Service secondcontract(List<byte[]> secondcontract) { + this.secondcontract = secondcontract; + return this; + } + + public Service addSecondcontractItem(byte[] secondcontractItem) { + this.secondcontract.add(secondcontractItem); + return this; + } + + /** + * Get serviceclassid + * @return serviceclassid + **/ + @JsonProperty("serviceclassid") + public Long getServiceclassid() { + return serviceclassid; + } + + public void setServiceclassid(Long serviceclassid) { + this.serviceclassid = serviceclassid; + } + + public Service serviceclassid(Long serviceclassid) { + this.serviceclassid = serviceclassid; + return this; + } + + /** + * Get serviceclassname + * @return serviceclassname + **/ + @JsonProperty("serviceclassname") + public String getServiceclassname() { + return serviceclassname; + } + + public void setServiceclassname(String serviceclassname) { + this.serviceclassname = serviceclassname; + } + + public Service serviceclassname(String serviceclassname) { + this.serviceclassname = serviceclassname; + return this; + } + + /** + * Get servicename + * @return servicename + **/ + @JsonProperty("servicename") + public String getServicename() { + return servicename; + } + + public void setServicename(String servicename) { + this.servicename = servicename; + } + + public Service servicename(String servicename) { + this.servicename = servicename; + return this; + } + + /** + * Get thirdcontract + * @return thirdcontract + **/ + @JsonProperty("thirdcontract") + public List<byte[]> getThirdcontract() { + return thirdcontract; + } + + public void setThirdcontract(List<byte[]> thirdcontract) { + this.thirdcontract = thirdcontract; + } + + public Service thirdcontract(List<byte[]> thirdcontract) { + this.thirdcontract = thirdcontract; + return this; + } + + public Service addThirdcontractItem(byte[] thirdcontractItem) { + this.thirdcontract.add(thirdcontractItem); + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Service {\n"); + + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" deleteddate: ").append(toIndentedString(deleteddate)).append("\n"); + sb.append(" firstcontract: ").append(toIndentedString(firstcontract)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" incidences: ").append(toIndentedString(incidences)).append("\n"); + sb.append(" lastModifiedDate: ").append(toIndentedString(lastModifiedDate)).append("\n"); + sb.append(" match: ").append(toIndentedString(match)).append("\n"); + sb.append(" matchingattributelist: ").append(toIndentedString(matchingattributelist)).append("\n"); + sb.append(" secondcontract: ").append(toIndentedString(secondcontract)).append("\n"); + sb.append(" serviceclassid: ").append(toIndentedString(serviceclassid)).append("\n"); + sb.append(" serviceclassname: ").append(toIndentedString(serviceclassname)).append("\n"); + sb.append(" servicename: ").append(toIndentedString(servicename)).append("\n"); + sb.append(" thirdcontract: ").append(toIndentedString(thirdcontract)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceAttributeType.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceAttributeType.java new file mode 100644 index 0000000000000000000000000000000000000000..4d19c28bf8f27d73ed28feadfa0b484d4e4c7785 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceAttributeType.java @@ -0,0 +1,389 @@ +package eu.decideh2020.acsmi.client.model; + +import java.util.Date; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ServiceAttributeType { + + @ApiModelProperty(value = "") + private String checklistevalrule = null; + + @ApiModelProperty(value = "") + private Long childid = null; + + @ApiModelProperty(value = "") + private Date createdDate = null; + + @ApiModelProperty(value = "") + private Date deleteddate = null; + + @ApiModelProperty(value = "") + private Long id = null; + + @ApiModelProperty(required = true, value = "") + private Boolean ischecklist = null; + + @ApiModelProperty(required = true, value = "") + private Boolean iscommon = null; + + @ApiModelProperty(required = true, value = "") + private Boolean isenumeration = null; + + @ApiModelProperty(required = true, value = "") + private Boolean isfunctionalrequirement = null; + + @ApiModelProperty(value = "") + private Date lastModifiedDate = null; + + @ApiModelProperty(required = true, value = "") + private String name = null; + + @ApiModelProperty(value = "") + private String nfrname = null; + + @ApiModelProperty(value = "") + private Long parentid = null; + + @ApiModelProperty(value = "") + private String unitfactor = null; + + @ApiModelProperty(value = "") + private String unitrule = null; + + @ApiModelProperty(value = "") + private String units = null; + /** + * Get checklistevalrule + * @return checklistevalrule + **/ + @JsonProperty("checklistevalrule") + public String getChecklistevalrule() { + return checklistevalrule; + } + + public void setChecklistevalrule(String checklistevalrule) { + this.checklistevalrule = checklistevalrule; + } + + public ServiceAttributeType checklistevalrule(String checklistevalrule) { + this.checklistevalrule = checklistevalrule; + return this; + } + + /** + * Get childid + * @return childid + **/ + @JsonProperty("childid") + public Long getChildid() { + return childid; + } + + public void setChildid(Long childid) { + this.childid = childid; + } + + public ServiceAttributeType childid(Long childid) { + this.childid = childid; + return this; + } + + /** + * Get createdDate + * @return createdDate + **/ + @JsonProperty("createdDate") + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public ServiceAttributeType createdDate(Date createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get deleteddate + * @return deleteddate + **/ + @JsonProperty("deleteddate") + public Date getDeleteddate() { + return deleteddate; + } + + public void setDeleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + } + + public ServiceAttributeType deleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + return this; + } + + /** + * Get id + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public ServiceAttributeType id(Long id) { + this.id = id; + return this; + } + + /** + * Get ischecklist + * @return ischecklist + **/ + @JsonProperty("ischecklist") + public Boolean isIschecklist() { + return ischecklist; + } + + public void setIschecklist(Boolean ischecklist) { + this.ischecklist = ischecklist; + } + + public ServiceAttributeType ischecklist(Boolean ischecklist) { + this.ischecklist = ischecklist; + return this; + } + + /** + * Get iscommon + * @return iscommon + **/ + @JsonProperty("iscommon") + public Boolean isIscommon() { + return iscommon; + } + + public void setIscommon(Boolean iscommon) { + this.iscommon = iscommon; + } + + public ServiceAttributeType iscommon(Boolean iscommon) { + this.iscommon = iscommon; + return this; + } + + /** + * Get isenumeration + * @return isenumeration + **/ + @JsonProperty("isenumeration") + public Boolean isIsenumeration() { + return isenumeration; + } + + public void setIsenumeration(Boolean isenumeration) { + this.isenumeration = isenumeration; + } + + public ServiceAttributeType isenumeration(Boolean isenumeration) { + this.isenumeration = isenumeration; + return this; + } + + /** + * Get isfunctionalrequirement + * @return isfunctionalrequirement + **/ + @JsonProperty("isfunctionalrequirement") + public Boolean isIsfunctionalrequirement() { + return isfunctionalrequirement; + } + + public void setIsfunctionalrequirement(Boolean isfunctionalrequirement) { + this.isfunctionalrequirement = isfunctionalrequirement; + } + + public ServiceAttributeType isfunctionalrequirement(Boolean isfunctionalrequirement) { + this.isfunctionalrequirement = isfunctionalrequirement; + return this; + } + + /** + * Get lastModifiedDate + * @return lastModifiedDate + **/ + @JsonProperty("lastModifiedDate") + public Date getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + public ServiceAttributeType lastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + + /** + * Get name + * @return name + **/ + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public ServiceAttributeType name(String name) { + this.name = name; + return this; + } + + /** + * Get nfrname + * @return nfrname + **/ + @JsonProperty("nfrname") + public String getNfrname() { + return nfrname; + } + + public void setNfrname(String nfrname) { + this.nfrname = nfrname; + } + + public ServiceAttributeType nfrname(String nfrname) { + this.nfrname = nfrname; + return this; + } + + /** + * Get parentid + * @return parentid + **/ + @JsonProperty("parentid") + public Long getParentid() { + return parentid; + } + + public void setParentid(Long parentid) { + this.parentid = parentid; + } + + public ServiceAttributeType parentid(Long parentid) { + this.parentid = parentid; + return this; + } + + /** + * Get unitfactor + * @return unitfactor + **/ + @JsonProperty("unitfactor") + public String getUnitfactor() { + return unitfactor; + } + + public void setUnitfactor(String unitfactor) { + this.unitfactor = unitfactor; + } + + public ServiceAttributeType unitfactor(String unitfactor) { + this.unitfactor = unitfactor; + return this; + } + + /** + * Get unitrule + * @return unitrule + **/ + @JsonProperty("unitrule") + public String getUnitrule() { + return unitrule; + } + + public void setUnitrule(String unitrule) { + this.unitrule = unitrule; + } + + public ServiceAttributeType unitrule(String unitrule) { + this.unitrule = unitrule; + return this; + } + + /** + * Get units + * @return units + **/ + @JsonProperty("units") + public String getUnits() { + return units; + } + + public void setUnits(String units) { + this.units = units; + } + + public ServiceAttributeType units(String units) { + this.units = units; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAttributeType {\n"); + + sb.append(" checklistevalrule: ").append(toIndentedString(checklistevalrule)).append("\n"); + sb.append(" childid: ").append(toIndentedString(childid)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" deleteddate: ").append(toIndentedString(deleteddate)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ischecklist: ").append(toIndentedString(ischecklist)).append("\n"); + sb.append(" iscommon: ").append(toIndentedString(iscommon)).append("\n"); + sb.append(" isenumeration: ").append(toIndentedString(isenumeration)).append("\n"); + sb.append(" isfunctionalrequirement: ").append(toIndentedString(isfunctionalrequirement)).append("\n"); + sb.append(" lastModifiedDate: ").append(toIndentedString(lastModifiedDate)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" nfrname: ").append(toIndentedString(nfrname)).append("\n"); + sb.append(" parentid: ").append(toIndentedString(parentid)).append("\n"); + sb.append(" unitfactor: ").append(toIndentedString(unitfactor)).append("\n"); + sb.append(" unitrule: ").append(toIndentedString(unitrule)).append("\n"); + sb.append(" units: ").append(toIndentedString(units)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceAttributeValue.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceAttributeValue.java new file mode 100644 index 0000000000000000000000000000000000000000..b3580d163bd96d1c7f979bbe23a7e3c895b82008 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceAttributeValue.java @@ -0,0 +1,235 @@ +package eu.decideh2020.acsmi.client.model; + +import java.util.Date; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ServiceAttributeValue { + + @ApiModelProperty(value = "") + private String checklistvalue = null; + + @ApiModelProperty(value = "") + private Date createdDate = null; + + @ApiModelProperty(value = "") + private Date deleteddate = null; + + @ApiModelProperty(value = "") + private Long id = null; + + @ApiModelProperty(value = "") + private Date lastModifiedDate = null; + + @ApiModelProperty(required = true, value = "") + private Long serviceattributetypeid = null; + + @ApiModelProperty(value = "") + private String serviceattributevalue = null; + + @ApiModelProperty(required = true, value = "") + private Long serviceid = null; + + @ApiModelProperty(value = "") + private String unitvalue = null; + /** + * Get checklistvalue + * @return checklistvalue + **/ + @JsonProperty("checklistvalue") + public String getChecklistvalue() { + return checklistvalue; + } + + public void setChecklistvalue(String checklistvalue) { + this.checklistvalue = checklistvalue; + } + + public ServiceAttributeValue checklistvalue(String checklistvalue) { + this.checklistvalue = checklistvalue; + return this; + } + + /** + * Get createdDate + * @return createdDate + **/ + @JsonProperty("createdDate") + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public ServiceAttributeValue createdDate(Date createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get deleteddate + * @return deleteddate + **/ + @JsonProperty("deleteddate") + public Date getDeleteddate() { + return deleteddate; + } + + public void setDeleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + } + + public ServiceAttributeValue deleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + return this; + } + + /** + * Get id + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public ServiceAttributeValue id(Long id) { + this.id = id; + return this; + } + + /** + * Get lastModifiedDate + * @return lastModifiedDate + **/ + @JsonProperty("lastModifiedDate") + public Date getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + public ServiceAttributeValue lastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + + /** + * Get serviceattributetypeid + * @return serviceattributetypeid + **/ + @JsonProperty("serviceattributetypeid") + public Long getServiceattributetypeid() { + return serviceattributetypeid; + } + + public void setServiceattributetypeid(Long serviceattributetypeid) { + this.serviceattributetypeid = serviceattributetypeid; + } + + public ServiceAttributeValue serviceattributetypeid(Long serviceattributetypeid) { + this.serviceattributetypeid = serviceattributetypeid; + return this; + } + + /** + * Get serviceattributevalue + * @return serviceattributevalue + **/ + @JsonProperty("serviceattributevalue") + public String getServiceattributevalue() { + return serviceattributevalue; + } + + public void setServiceattributevalue(String serviceattributevalue) { + this.serviceattributevalue = serviceattributevalue; + } + + public ServiceAttributeValue serviceattributevalue(String serviceattributevalue) { + this.serviceattributevalue = serviceattributevalue; + return this; + } + + /** + * Get serviceid + * @return serviceid + **/ + @JsonProperty("serviceid") + public Long getServiceid() { + return serviceid; + } + + public void setServiceid(Long serviceid) { + this.serviceid = serviceid; + } + + public ServiceAttributeValue serviceid(Long serviceid) { + this.serviceid = serviceid; + return this; + } + + /** + * Get unitvalue + * @return unitvalue + **/ + @JsonProperty("unitvalue") + public String getUnitvalue() { + return unitvalue; + } + + public void setUnitvalue(String unitvalue) { + this.unitvalue = unitvalue; + } + + public ServiceAttributeValue unitvalue(String unitvalue) { + this.unitvalue = unitvalue; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceAttributeValue {\n"); + + sb.append(" checklistvalue: ").append(toIndentedString(checklistvalue)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" deleteddate: ").append(toIndentedString(deleteddate)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" lastModifiedDate: ").append(toIndentedString(lastModifiedDate)).append("\n"); + sb.append(" serviceattributetypeid: ").append(toIndentedString(serviceattributetypeid)).append("\n"); + sb.append(" serviceattributevalue: ").append(toIndentedString(serviceattributevalue)).append("\n"); + sb.append(" serviceid: ").append(toIndentedString(serviceid)).append("\n"); + sb.append(" unitvalue: ").append(toIndentedString(unitvalue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceClass.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceClass.java new file mode 100644 index 0000000000000000000000000000000000000000..1c247c3d261df0d54647b52f93fc4266bd1ab8f7 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceClass.java @@ -0,0 +1,232 @@ +package eu.decideh2020.acsmi.client.model; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +import eu.decideh2020.acsmi.client.model.AttributeVO; + +public class ServiceClass { + + @ApiModelProperty(value = "") + private List<AttributeVO> commonattributes = null; + + @ApiModelProperty(value = "") + private Date createdDate = null; + + @ApiModelProperty(value = "") + private Date deleteddate = null; + + @ApiModelProperty(value = "") + private List<AttributeVO> functionalattributes = null; + + @ApiModelProperty(value = "") + private Long id = null; + + @ApiModelProperty(value = "") + private Date lastModifiedDate = null; + + @ApiModelProperty(value = "") + private List<AttributeVO> nonfunctionalattributes = null; + + @ApiModelProperty(required = true, value = "") + private String serviceclassname = null; + /** + * Get commonattributes + * @return commonattributes + **/ + @JsonProperty("commonattributes") + public List<AttributeVO> getCommonattributes() { + return commonattributes; + } + + public void setCommonattributes(List<AttributeVO> commonattributes) { + this.commonattributes = commonattributes; + } + + public ServiceClass commonattributes(List<AttributeVO> commonattributes) { + this.commonattributes = commonattributes; + return this; + } + + public ServiceClass addCommonattributesItem(AttributeVO commonattributesItem) { + this.commonattributes.add(commonattributesItem); + return this; + } + + /** + * Get createdDate + * @return createdDate + **/ + @JsonProperty("createdDate") + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public ServiceClass createdDate(Date createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get deleteddate + * @return deleteddate + **/ + @JsonProperty("deleteddate") + public Date getDeleteddate() { + return deleteddate; + } + + public void setDeleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + } + + public ServiceClass deleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + return this; + } + + /** + * Get functionalattributes + * @return functionalattributes + **/ + @JsonProperty("functionalattributes") + public List<AttributeVO> getFunctionalattributes() { + return functionalattributes; + } + + public void setFunctionalattributes(List<AttributeVO> functionalattributes) { + this.functionalattributes = functionalattributes; + } + + public ServiceClass functionalattributes(List<AttributeVO> functionalattributes) { + this.functionalattributes = functionalattributes; + return this; + } + + public ServiceClass addFunctionalattributesItem(AttributeVO functionalattributesItem) { + this.functionalattributes.add(functionalattributesItem); + return this; + } + + /** + * Get id + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public ServiceClass id(Long id) { + this.id = id; + return this; + } + + /** + * Get lastModifiedDate + * @return lastModifiedDate + **/ + @JsonProperty("lastModifiedDate") + public Date getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + public ServiceClass lastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + + /** + * Get nonfunctionalattributes + * @return nonfunctionalattributes + **/ + @JsonProperty("nonfunctionalattributes") + public List<AttributeVO> getNonfunctionalattributes() { + return nonfunctionalattributes; + } + + public void setNonfunctionalattributes(List<AttributeVO> nonfunctionalattributes) { + this.nonfunctionalattributes = nonfunctionalattributes; + } + + public ServiceClass nonfunctionalattributes(List<AttributeVO> nonfunctionalattributes) { + this.nonfunctionalattributes = nonfunctionalattributes; + return this; + } + + public ServiceClass addNonfunctionalattributesItem(AttributeVO nonfunctionalattributesItem) { + this.nonfunctionalattributes.add(nonfunctionalattributesItem); + return this; + } + + /** + * Get serviceclassname + * @return serviceclassname + **/ + @JsonProperty("serviceclassname") + public String getServiceclassname() { + return serviceclassname; + } + + public void setServiceclassname(String serviceclassname) { + this.serviceclassname = serviceclassname; + } + + public ServiceClass serviceclassname(String serviceclassname) { + this.serviceclassname = serviceclassname; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceClass {\n"); + + sb.append(" commonattributes: ").append(toIndentedString(commonattributes)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" deleteddate: ").append(toIndentedString(deleteddate)).append("\n"); + sb.append(" functionalattributes: ").append(toIndentedString(functionalattributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" lastModifiedDate: ").append(toIndentedString(lastModifiedDate)).append("\n"); + sb.append(" nonfunctionalattributes: ").append(toIndentedString(nonfunctionalattributes)).append("\n"); + sb.append(" serviceclassname: ").append(toIndentedString(serviceclassname)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceClassAttribute.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceClassAttribute.java new file mode 100644 index 0000000000000000000000000000000000000000..47dd786d1b2c86f4365f2fdd1dcfa905db12c98e --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceClassAttribute.java @@ -0,0 +1,345 @@ +package eu.decideh2020.acsmi.client.model; + +import java.util.Date; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ServiceClassAttribute { + + @ApiModelProperty(value = "") + private Long childid = null; + + @ApiModelProperty(value = "") + private Date createdDate = null; + + @ApiModelProperty(value = "") + private Date deleteddate = null; + + @ApiModelProperty(value = "") + private Long id = null; + + @ApiModelProperty(value = "") + private Boolean ischecklist = null; + + @ApiModelProperty(value = "") + private Boolean isenumeration = null; + + @ApiModelProperty(value = "") + private Boolean isfunctionalrequirement = null; + + @ApiModelProperty(required = true, value = "") + private Boolean ismandatory = null; + + @ApiModelProperty(value = "") + private Date lastModifiedDate = null; + + @ApiModelProperty(value = "") + private Long parentid = null; + + @ApiModelProperty(required = true, value = "") + private Long serviceattributetypeid = null; + + @ApiModelProperty(value = "") + private String serviceattributetypename = null; + + @ApiModelProperty(required = true, value = "") + private Long serviceclassid = null; + + @ApiModelProperty(required = true, value = "") + private Integer weight = null; + /** + * Get childid + * @return childid + **/ + @JsonProperty("childid") + public Long getChildid() { + return childid; + } + + public void setChildid(Long childid) { + this.childid = childid; + } + + public ServiceClassAttribute childid(Long childid) { + this.childid = childid; + return this; + } + + /** + * Get createdDate + * @return createdDate + **/ + @JsonProperty("createdDate") + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public ServiceClassAttribute createdDate(Date createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get deleteddate + * @return deleteddate + **/ + @JsonProperty("deleteddate") + public Date getDeleteddate() { + return deleteddate; + } + + public void setDeleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + } + + public ServiceClassAttribute deleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + return this; + } + + /** + * Get id + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public ServiceClassAttribute id(Long id) { + this.id = id; + return this; + } + + /** + * Get ischecklist + * @return ischecklist + **/ + @JsonProperty("ischecklist") + public Boolean isIschecklist() { + return ischecklist; + } + + public void setIschecklist(Boolean ischecklist) { + this.ischecklist = ischecklist; + } + + public ServiceClassAttribute ischecklist(Boolean ischecklist) { + this.ischecklist = ischecklist; + return this; + } + + /** + * Get isenumeration + * @return isenumeration + **/ + @JsonProperty("isenumeration") + public Boolean isIsenumeration() { + return isenumeration; + } + + public void setIsenumeration(Boolean isenumeration) { + this.isenumeration = isenumeration; + } + + public ServiceClassAttribute isenumeration(Boolean isenumeration) { + this.isenumeration = isenumeration; + return this; + } + + /** + * Get isfunctionalrequirement + * @return isfunctionalrequirement + **/ + @JsonProperty("isfunctionalrequirement") + public Boolean isIsfunctionalrequirement() { + return isfunctionalrequirement; + } + + public void setIsfunctionalrequirement(Boolean isfunctionalrequirement) { + this.isfunctionalrequirement = isfunctionalrequirement; + } + + public ServiceClassAttribute isfunctionalrequirement(Boolean isfunctionalrequirement) { + this.isfunctionalrequirement = isfunctionalrequirement; + return this; + } + + /** + * Get ismandatory + * @return ismandatory + **/ + @JsonProperty("ismandatory") + public Boolean isIsmandatory() { + return ismandatory; + } + + public void setIsmandatory(Boolean ismandatory) { + this.ismandatory = ismandatory; + } + + public ServiceClassAttribute ismandatory(Boolean ismandatory) { + this.ismandatory = ismandatory; + return this; + } + + /** + * Get lastModifiedDate + * @return lastModifiedDate + **/ + @JsonProperty("lastModifiedDate") + public Date getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + public ServiceClassAttribute lastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + + /** + * Get parentid + * @return parentid + **/ + @JsonProperty("parentid") + public Long getParentid() { + return parentid; + } + + public void setParentid(Long parentid) { + this.parentid = parentid; + } + + public ServiceClassAttribute parentid(Long parentid) { + this.parentid = parentid; + return this; + } + + /** + * Get serviceattributetypeid + * @return serviceattributetypeid + **/ + @JsonProperty("serviceattributetypeid") + public Long getServiceattributetypeid() { + return serviceattributetypeid; + } + + public void setServiceattributetypeid(Long serviceattributetypeid) { + this.serviceattributetypeid = serviceattributetypeid; + } + + public ServiceClassAttribute serviceattributetypeid(Long serviceattributetypeid) { + this.serviceattributetypeid = serviceattributetypeid; + return this; + } + + /** + * Get serviceattributetypename + * @return serviceattributetypename + **/ + @JsonProperty("serviceattributetypename") + public String getServiceattributetypename() { + return serviceattributetypename; + } + + public void setServiceattributetypename(String serviceattributetypename) { + this.serviceattributetypename = serviceattributetypename; + } + + public ServiceClassAttribute serviceattributetypename(String serviceattributetypename) { + this.serviceattributetypename = serviceattributetypename; + return this; + } + + /** + * Get serviceclassid + * @return serviceclassid + **/ + @JsonProperty("serviceclassid") + public Long getServiceclassid() { + return serviceclassid; + } + + public void setServiceclassid(Long serviceclassid) { + this.serviceclassid = serviceclassid; + } + + public ServiceClassAttribute serviceclassid(Long serviceclassid) { + this.serviceclassid = serviceclassid; + return this; + } + + /** + * Get weight + * @return weight + **/ + @JsonProperty("weight") + public Integer getWeight() { + return weight; + } + + public void setWeight(Integer weight) { + this.weight = weight; + } + + public ServiceClassAttribute weight(Integer weight) { + this.weight = weight; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceClassAttribute {\n"); + + sb.append(" childid: ").append(toIndentedString(childid)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" deleteddate: ").append(toIndentedString(deleteddate)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" ischecklist: ").append(toIndentedString(ischecklist)).append("\n"); + sb.append(" isenumeration: ").append(toIndentedString(isenumeration)).append("\n"); + sb.append(" isfunctionalrequirement: ").append(toIndentedString(isfunctionalrequirement)).append("\n"); + sb.append(" ismandatory: ").append(toIndentedString(ismandatory)).append("\n"); + sb.append(" lastModifiedDate: ").append(toIndentedString(lastModifiedDate)).append("\n"); + sb.append(" parentid: ").append(toIndentedString(parentid)).append("\n"); + sb.append(" serviceattributetypeid: ").append(toIndentedString(serviceattributetypeid)).append("\n"); + sb.append(" serviceattributetypename: ").append(toIndentedString(serviceattributetypename)).append("\n"); + sb.append(" serviceclassid: ").append(toIndentedString(serviceclassid)).append("\n"); + sb.append(" weight: ").append(toIndentedString(weight)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceDevOpsInfoVO.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceDevOpsInfoVO.java new file mode 100644 index 0000000000000000000000000000000000000000..bf006c106c09aeae553be2100294c7b324defc17 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceDevOpsInfoVO.java @@ -0,0 +1,102 @@ +package eu.decideh2020.acsmi.client.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ServiceDevOpsInfoVO { + + @ApiModelProperty(value = "") + private Integer numservices = null; + + @ApiModelProperty(value = "") + private String providername = null; + + @ApiModelProperty(value = "") + private String serviceclassname = null; + /** + * Get numservices + * @return numservices + **/ + @JsonProperty("numservices") + public Integer getNumservices() { + return numservices; + } + + public void setNumservices(Integer numservices) { + this.numservices = numservices; + } + + public ServiceDevOpsInfoVO numservices(Integer numservices) { + this.numservices = numservices; + return this; + } + + /** + * Get providername + * @return providername + **/ + @JsonProperty("providername") + public String getProvidername() { + return providername; + } + + public void setProvidername(String providername) { + this.providername = providername; + } + + public ServiceDevOpsInfoVO providername(String providername) { + this.providername = providername; + return this; + } + + /** + * Get serviceclassname + * @return serviceclassname + **/ + @JsonProperty("serviceclassname") + public String getServiceclassname() { + return serviceclassname; + } + + public void setServiceclassname(String serviceclassname) { + this.serviceclassname = serviceclassname; + } + + public ServiceDevOpsInfoVO serviceclassname(String serviceclassname) { + this.serviceclassname = serviceclassname; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceDevOpsInfoVO {\n"); + + sb.append(" numservices: ").append(toIndentedString(numservices)).append("\n"); + sb.append(" providername: ").append(toIndentedString(providername)).append("\n"); + sb.append(" serviceclassname: ").append(toIndentedString(serviceclassname)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceIncidence.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceIncidence.java new file mode 100644 index 0000000000000000000000000000000000000000..103f02a144487c98c55aea7ab190cd3a94033423 --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceIncidence.java @@ -0,0 +1,191 @@ +package eu.decideh2020.acsmi.client.model; + +import java.util.Date; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ServiceIncidence { + + @ApiModelProperty(value = "") + private Date createdDate = null; + + @ApiModelProperty(value = "") + private Date deleteddate = null; + + @ApiModelProperty(required = true, value = "") + private String detail = null; + + @ApiModelProperty(value = "") + private Long id = null; + + @ApiModelProperty(value = "") + private Date lastModifiedDate = null; + + @ApiModelProperty(required = true, value = "") + private Long serviceid = null; + + @ApiModelProperty(required = true, value = "") + private Date timestamp = null; + /** + * Get createdDate + * @return createdDate + **/ + @JsonProperty("createdDate") + public Date getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(Date createdDate) { + this.createdDate = createdDate; + } + + public ServiceIncidence createdDate(Date createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get deleteddate + * @return deleteddate + **/ + @JsonProperty("deleteddate") + public Date getDeleteddate() { + return deleteddate; + } + + public void setDeleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + } + + public ServiceIncidence deleteddate(Date deleteddate) { + this.deleteddate = deleteddate; + return this; + } + + /** + * Get detail + * @return detail + **/ + @JsonProperty("detail") + public String getDetail() { + return detail; + } + + public void setDetail(String detail) { + this.detail = detail; + } + + public ServiceIncidence detail(String detail) { + this.detail = detail; + return this; + } + + /** + * Get id + * @return id + **/ + @JsonProperty("id") + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public ServiceIncidence id(Long id) { + this.id = id; + return this; + } + + /** + * Get lastModifiedDate + * @return lastModifiedDate + **/ + @JsonProperty("lastModifiedDate") + public Date getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + public ServiceIncidence lastModifiedDate(Date lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + + /** + * Get serviceid + * @return serviceid + **/ + @JsonProperty("serviceid") + public Long getServiceid() { + return serviceid; + } + + public void setServiceid(Long serviceid) { + this.serviceid = serviceid; + } + + public ServiceIncidence serviceid(Long serviceid) { + this.serviceid = serviceid; + return this; + } + + /** + * Get timestamp + * @return timestamp + **/ + @JsonProperty("timestamp") + public Date getTimestamp() { + return timestamp; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + public ServiceIncidence timestamp(Date timestamp) { + this.timestamp = timestamp; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceIncidence {\n"); + + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" deleteddate: ").append(toIndentedString(deleteddate)).append("\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" lastModifiedDate: ").append(toIndentedString(lastModifiedDate)).append("\n"); + sb.append(" serviceid: ").append(toIndentedString(serviceid)).append("\n"); + sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceNFRInfoVO.java b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceNFRInfoVO.java new file mode 100644 index 0000000000000000000000000000000000000000..80a7c2e2913fb895ffed41ce5bb9209b4d2c957d --- /dev/null +++ b/OPTIMUS/ACSmI-client/src/gen/java/eu/decideh2020/acsmi/client/model/ServiceNFRInfoVO.java @@ -0,0 +1,168 @@ +package eu.decideh2020.acsmi.client.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ServiceNFRInfoVO { + + @ApiModelProperty(value = "") + private String nfrmetric = null; + + @ApiModelProperty(value = "") + private String nfrname = null; + + @ApiModelProperty(value = "") + private String nfrvalue = null; + + @ApiModelProperty(value = "") + private String serviceclassname = null; + + @ApiModelProperty(value = "") + private Long serviceid = null; + + @ApiModelProperty(value = "") + private String servicename = null; + /** + * Get nfrmetric + * @return nfrmetric + **/ + @JsonProperty("nfrmetric") + public String getNfrmetric() { + return nfrmetric; + } + + public void setNfrmetric(String nfrmetric) { + this.nfrmetric = nfrmetric; + } + + public ServiceNFRInfoVO nfrmetric(String nfrmetric) { + this.nfrmetric = nfrmetric; + return this; + } + + /** + * Get nfrname + * @return nfrname + **/ + @JsonProperty("nfrname") + public String getNfrname() { + return nfrname; + } + + public void setNfrname(String nfrname) { + this.nfrname = nfrname; + } + + public ServiceNFRInfoVO nfrname(String nfrname) { + this.nfrname = nfrname; + return this; + } + + /** + * Get nfrvalue + * @return nfrvalue + **/ + @JsonProperty("nfrvalue") + public String getNfrvalue() { + return nfrvalue; + } + + public void setNfrvalue(String nfrvalue) { + this.nfrvalue = nfrvalue; + } + + public ServiceNFRInfoVO nfrvalue(String nfrvalue) { + this.nfrvalue = nfrvalue; + return this; + } + + /** + * Get serviceclassname + * @return serviceclassname + **/ + @JsonProperty("serviceclassname") + public String getServiceclassname() { + return serviceclassname; + } + + public void setServiceclassname(String serviceclassname) { + this.serviceclassname = serviceclassname; + } + + public ServiceNFRInfoVO serviceclassname(String serviceclassname) { + this.serviceclassname = serviceclassname; + return this; + } + + /** + * Get serviceid + * @return serviceid + **/ + @JsonProperty("serviceid") + public Long getServiceid() { + return serviceid; + } + + public void setServiceid(Long serviceid) { + this.serviceid = serviceid; + } + + public ServiceNFRInfoVO serviceid(Long serviceid) { + this.serviceid = serviceid; + return this; + } + + /** + * Get servicename + * @return servicename + **/ + @JsonProperty("servicename") + public String getServicename() { + return servicename; + } + + public void setServicename(String servicename) { + this.servicename = servicename; + } + + public ServiceNFRInfoVO servicename(String servicename) { + this.servicename = servicename; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ServiceNFRInfoVO {\n"); + + sb.append(" nfrmetric: ").append(toIndentedString(nfrmetric)).append("\n"); + sb.append(" nfrname: ").append(toIndentedString(nfrname)).append("\n"); + sb.append(" nfrvalue: ").append(toIndentedString(nfrvalue)).append("\n"); + sb.append(" serviceclassname: ").append(toIndentedString(serviceclassname)).append("\n"); + sb.append(" serviceid: ").append(toIndentedString(serviceid)).append("\n"); + sb.append(" servicename: ").append(toIndentedString(servicename)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/ACSmI-client/target/ACSmI-client-2.0.0.jar b/OPTIMUS/ACSmI-client/target/ACSmI-client-2.0.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..e46f94756e638b24413effea3f47f7618b123827 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/ACSmI-client-2.0.0.jar differ diff --git a/OPTIMUS/ACSmI-client/target/classes/META-INF/MANIFEST.MF b/OPTIMUS/ACSmI-client/target/classes/META-INF/MANIFEST.MF new file mode 100644 index 0000000000000000000000000000000000000000..204c769a2421d82529aa95dc6fcc15fb30a5f7cf --- /dev/null +++ b/OPTIMUS/ACSmI-client/target/classes/META-INF/MANIFEST.MF @@ -0,0 +1,5 @@ +Manifest-Version: 1.0 +Built-By: 106819 +Build-Jdk: 1.8.0_144 +Created-By: Maven Integration for Eclipse + diff --git a/OPTIMUS/ACSmI-client/target/classes/META-INF/maven/eu.decideh2020/ACSmI-client/pom.properties b/OPTIMUS/ACSmI-client/target/classes/META-INF/maven/eu.decideh2020/ACSmI-client/pom.properties new file mode 100644 index 0000000000000000000000000000000000000000..2bc6ac029c68566acc022e9a0d6a228e3c8a2504 --- /dev/null +++ b/OPTIMUS/ACSmI-client/target/classes/META-INF/maven/eu.decideh2020/ACSmI-client/pom.properties @@ -0,0 +1,7 @@ +#Generated by Maven Integration for Eclipse +#Thu Nov 22 16:06:07 CET 2018 +version=2.0.0 +groupId=eu.decideh2020 +m2e.projectName=ACSmI-client +m2e.projectLocation=D\:\\W\\2017-Decide\\workspace\\ACSmIDiscovery\\jaxrs-cxf-client-client +artifactId=ACSmI-client diff --git a/OPTIMUS/ACSmI-client/target/classes/META-INF/maven/eu.decideh2020/ACSmI-client/pom.xml b/OPTIMUS/ACSmI-client/target/classes/META-INF/maven/eu.decideh2020/ACSmI-client/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..d18f48c66c83bf95a95fde0e41ffb8449921812b --- /dev/null +++ b/OPTIMUS/ACSmI-client/target/classes/META-INF/maven/eu.decideh2020/ACSmI-client/pom.xml @@ -0,0 +1,179 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> +<!-- <groupId>io.swagger</groupId> --> +<!-- <artifactId>swagger-jaxrs-client</artifactId> --> +<!-- <packaging>jar</packaging> --> +<!-- <name>swagger-jaxrs-client</name> --> +<!-- <description>ACSmI Services API documentation</description> --> +<!-- <version>1.0.0</version> --> + <groupId>eu.decideh2020</groupId> + <artifactId>ACSmI-client</artifactId> + <packaging>jar</packaging> + <version>2.0.0</version> + <build> + <sourceDirectory>src/main/java</sourceDirectory> + <plugins> + <plugin> + <artifactId>maven-failsafe-plugin</artifactId> + <version>2.6</version> + <executions> + <execution> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + </execution> + </executions> + </plugin> + <!--plugin> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>${jetty-version}</version> + <configuration> + <webApp> + <contextPath>/</contextPath> + </webApp> + <webAppSourceDirectory>target/${project.artifactId}-${project.version}</webAppSourceDirectory> + <stopPort>8079</stopPort> + <stopKey>stopit</stopKey> + <httpConnector> + <port></port> + <idleTimeout>60000</idleTimeout> + </httpConnector> + </configuration> + <executions> + <execution> + <id>start-jetty</id> + <phase>pre-integration-test</phase> + <goals> + <goal>start</goal> + </goals> + <configuration> + <scanIntervalSeconds>0</scanIntervalSeconds> + <daemon>true</daemon> + </configuration> + </execution> + <execution> + <id>stop-jetty</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</goal> + </goals> + </execution> + </executions> + </plugin--> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>1.9.1</version> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>src/gen/java</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-jaxrs</artifactId> + <scope>compile</scope> + <version>${swagger-core-version}</version> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <version>${logback-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-core</artifactId> + <version>${logback-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junit-version}</version> + <scope>test</scope> + </dependency> + <!-- CXF Client --> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-client</artifactId> + <version>${cxf-version}</version> + <scope>test</scope> + </dependency> + + <!-- CXF server --> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-frontend-jaxrs</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-service-description</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-ws-policy</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-wsdl</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.jaxrs</groupId> + <artifactId>jackson-jaxrs-json-provider</artifactId> + <version>${jackson-jaxrs-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.datatype</groupId> + <artifactId>jackson-datatype-joda</artifactId> + <version>${jackson-jaxrs-version}</version> + <scope>compile</scope> + </dependency> + </dependencies> + <repositories> + <repository> + <id>sonatype-snapshots</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <properties> + <java.version>1.7</java.version> + <maven.compiler.source>${java.version}</maven.compiler.source> + <maven.compiler.target>${java.version}</maven.compiler.target> + <swagger-core-version>1.5.15</swagger-core-version> + <jetty-version>9.2.9.v20150224</jetty-version> + <junit-version>4.12</junit-version> + <logback-version>1.1.7</logback-version> + <servlet-api-version>2.5</servlet-api-version> + <cxf-version>3.1.11</cxf-version> + <jackson-jaxrs-version>2.8.9</jackson-jaxrs-version> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> +</project> diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/DefinitionResourceApi.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/DefinitionResourceApi.class new file mode 100644 index 0000000000000000000000000000000000000000..400de40293c1ee425d99fee0e8f2d6d6bc0b5535 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/DefinitionResourceApi.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ProfileInfoResourceApi.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ProfileInfoResourceApi.class new file mode 100644 index 0000000000000000000000000000000000000000..c4113013c9f0dc0ccde2783d0f8d0ab9c3f68f89 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ProfileInfoResourceApi.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceAttributeTypeResourceApi.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceAttributeTypeResourceApi.class new file mode 100644 index 0000000000000000000000000000000000000000..84efb2181387114a662dfba582bc53de62c04a5e Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceAttributeTypeResourceApi.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceAttributeValueResourceApi.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceAttributeValueResourceApi.class new file mode 100644 index 0000000000000000000000000000000000000000..6f0d711c978a9a10b1e35c74d3831554dd73c98c Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceAttributeValueResourceApi.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceClassAttributeResourceApi.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceClassAttributeResourceApi.class new file mode 100644 index 0000000000000000000000000000000000000000..41c95125a75137424fbeb8f88deb35871b24ec5c Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceClassAttributeResourceApi.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceClassResourceApi.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceClassResourceApi.class new file mode 100644 index 0000000000000000000000000000000000000000..304b3d22d28069b04eb58743c6263047eb7955a2 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceClassResourceApi.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceIncidenceResourceApi.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceIncidenceResourceApi.class new file mode 100644 index 0000000000000000000000000000000000000000..9735a06809907c61fbeae59edddc8b5f52424215 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceIncidenceResourceApi.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceResourceApi.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceResourceApi.class new file mode 100644 index 0000000000000000000000000000000000000000..86af599c87b0530242d9c8eae7f5d669e3b9a430 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/api/ServiceResourceApi.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/AttributeVO.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/AttributeVO.class new file mode 100644 index 0000000000000000000000000000000000000000..833d53ed017146c43d5dc561723af8fab113aeb7 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/AttributeVO.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/Definition.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/Definition.class new file mode 100644 index 0000000000000000000000000000000000000000..6e5aaab8a225cb74b94763b6263cd3c121c84821 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/Definition.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ProfileInfoVM.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ProfileInfoVM.class new file mode 100644 index 0000000000000000000000000000000000000000..370caa68b9d13be617b2f9383c68410c5b232ce1 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ProfileInfoVM.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/Service.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/Service.class new file mode 100644 index 0000000000000000000000000000000000000000..8a3b2f90e07388c80e521d6fd92cbbd112401ed9 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/Service.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceAttributeType.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceAttributeType.class new file mode 100644 index 0000000000000000000000000000000000000000..e642c4289e8f5344572c3be43607b7a91c546e41 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceAttributeType.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceAttributeValue.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceAttributeValue.class new file mode 100644 index 0000000000000000000000000000000000000000..758868a19a7843a5016f6ad1c49e66ac8aa14b17 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceAttributeValue.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceClass.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceClass.class new file mode 100644 index 0000000000000000000000000000000000000000..d86b533f5a1999e83558ff5dda1c1e0909e0f5ad Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceClass.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceClassAttribute.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceClassAttribute.class new file mode 100644 index 0000000000000000000000000000000000000000..f48744de5ae664ed7e6db9672700ff3721194041 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceClassAttribute.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceDevOpsInfoVO.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceDevOpsInfoVO.class new file mode 100644 index 0000000000000000000000000000000000000000..a96b94ffd30692b19110b2b8d3b53396e0a56a74 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceDevOpsInfoVO.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceIncidence.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceIncidence.class new file mode 100644 index 0000000000000000000000000000000000000000..6d858751fdad7c1259e4d01d4a4ee8a44312edf7 Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceIncidence.class differ diff --git a/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceNFRInfoVO.class b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceNFRInfoVO.class new file mode 100644 index 0000000000000000000000000000000000000000..7b345f31f43b2185ee522e7866f2e15735dc68df Binary files /dev/null and b/OPTIMUS/ACSmI-client/target/classes/eu/decideh2020/acsmi/client/model/ServiceNFRInfoVO.class differ diff --git a/OPTIMUS/ACSmI-client/target/maven-archiver/pom.properties b/OPTIMUS/ACSmI-client/target/maven-archiver/pom.properties new file mode 100644 index 0000000000000000000000000000000000000000..c1a3352716cff11e007c138fb5487b3477fb00ba --- /dev/null +++ b/OPTIMUS/ACSmI-client/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Mon Nov 12 16:46:40 CET 2018 +version=2.0.0 +groupId=eu.decideh2020 +artifactId=ACSmI-client diff --git a/OPTIMUS/ACSmI-client/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/OPTIMUS/ACSmI-client/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000000000000000000000000000000000000..9db8b3ecc5792ba1c599732aa86a6b05bee62d4f --- /dev/null +++ b/OPTIMUS/ACSmI-client/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,19 @@ +eu\decideh2020\acsmi\client\model\ServiceDevOpsInfoVO.class +eu\decideh2020\acsmi\client\api\DefinitionResourceApi.class +eu\decideh2020\acsmi\client\model\ServiceIncidence.class +eu\decideh2020\acsmi\client\api\ServiceClassResourceApi.class +eu\decideh2020\acsmi\client\api\ServiceAttributeTypeResourceApi.class +eu\decideh2020\acsmi\client\api\ServiceResourceApi.class +eu\decideh2020\acsmi\client\model\Service.class +eu\decideh2020\acsmi\client\model\AttributeVO.class +eu\decideh2020\acsmi\client\model\ServiceAttributeType.class +eu\decideh2020\acsmi\client\model\Definition.class +eu\decideh2020\acsmi\client\model\ServiceAttributeValue.class +eu\decideh2020\acsmi\client\api\ServiceAttributeValueResourceApi.class +eu\decideh2020\acsmi\client\model\ProfileInfoVM.class +eu\decideh2020\acsmi\client\model\ServiceClass.class +eu\decideh2020\acsmi\client\model\ServiceNFRInfoVO.class +eu\decideh2020\acsmi\client\model\ServiceClassAttribute.class +eu\decideh2020\acsmi\client\api\ProfileInfoResourceApi.class +eu\decideh2020\acsmi\client\api\ServiceClassAttributeResourceApi.class +eu\decideh2020\acsmi\client\api\ServiceIncidenceResourceApi.class diff --git a/OPTIMUS/ACSmI-client/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/OPTIMUS/ACSmI-client/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000000000000000000000000000000000000..09546fcf501e6017244fdeaa0facc002b2d888e4 --- /dev/null +++ b/OPTIMUS/ACSmI-client/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,19 @@ +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\model\ServiceAttributeValue.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\model\ServiceClass.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\model\Service.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\model\ServiceNFRInfoVO.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\model\ProfileInfoVM.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\api\ServiceResourceApi.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\api\ServiceClassAttributeResourceApi.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\model\ServiceDevOpsInfoVO.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\model\ServiceAttributeType.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\model\Definition.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\model\ServiceClassAttribute.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\api\ProfileInfoResourceApi.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\api\ServiceAttributeTypeResourceApi.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\api\DefinitionResourceApi.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\model\AttributeVO.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\api\ServiceAttributeValueResourceApi.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\model\ServiceIncidence.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\api\ServiceClassResourceApi.java +D:\W\2017-Decide\workspace\ACSmIDiscovery\jaxrs-cxf-client-client\src\gen\java\eu\decideh2020\acsmi\client\api\ServiceIncidenceResourceApi.java diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/.classpath b/OPTIMUS/eu.DECIDEh2020.optimus/.classpath index 30053e4229555ad8497d7e9268025170d30dcc79..fb5e1534d90b0d55cc35426e42d6ddf24066f5ff 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/.classpath +++ b/OPTIMUS/eu.DECIDEh2020.optimus/.classpath @@ -1,14 +1,21 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> - <classpathentry exported="true" kind="lib" path="bin/"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> + <classpathentry exported="true" kind="lib" path="libs/app-controller-0.0.16-SNAPSHOT.jar"/> + <classpathentry exported="true" kind="lib" path="libs/optimus-client-2.0.0.jar"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="lib" path="D:/W/2017-Decide/workspace/json-simple-1.1.1.jar"> + <classpathentry including="**/*.java" kind="src" output="target/classes" path="src"> <attributes> - <attribute name="org.eclipse.jst.component.dependency" value="../"/> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> - <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/> - <classpathentry kind="output" path="bin"/> + <classpathentry combineaccessrules="false" kind="src" path="/eu.DECIDEh2020.architect.plugin"/> + <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/libs"/> + <classpathentry combineaccessrules="false" kind="src" path="/AppController"/> + <classpathentry kind="output" path="target/classes"/> </classpath> diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/.gitignore b/OPTIMUS/eu.DECIDEh2020.optimus/.gitignore index 902b8491e843899c6921a7e3ac3fed5a26102b24..11a15a7c4d73015c572c86ac01ed36e638bd4148 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/.gitignore +++ b/OPTIMUS/eu.DECIDEh2020.optimus/.gitignore @@ -1,2 +1,3 @@ bin/ -.settings/ \ No newline at end of file +.settings/ +/lib/ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/.project b/OPTIMUS/eu.DECIDEh2020.optimus/.project index 2e1c08ac930add15476fcac25fad7d4cbfe846f6..af501ef94fcad032c481917e15e554e24dbc9b3e 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/.project +++ b/OPTIMUS/eu.DECIDEh2020.optimus/.project @@ -30,8 +30,14 @@ <arguments> </arguments> </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> </buildSpec> <natures> + <nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> <nature>org.eclipse.pde.PluginNature</nature> diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/META-INF/MANIFEST.MF b/OPTIMUS/eu.DECIDEh2020.optimus/META-INF/MANIFEST.MF index 3baf2dd38a18e20db1a2de1f096c687b726479f0..e9b9edd7f31cd6132bace95cc9086fb1613b8413 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/META-INF/MANIFEST.MF +++ b/OPTIMUS/eu.DECIDEh2020.optimus/META-INF/MANIFEST.MF @@ -10,6 +10,62 @@ Require-Bundle: org.eclipse.jface.text, org.eclipse.ui.ide, org.eclipse.core.runtime, com.googlecode.json-simple;bundle-version="1.1.1", - org.eclipse.json;bundle-version="1.0.100" + org.eclipse.json;bundle-version="1.0.100", + org.eclipse.swt, + org.eclipse.jst.ws.cxf.consumption.core;bundle-version="1.0.400", + org.eclipse.jst.ws.cxf.consumption.ui;bundle-version="1.0.400", + org.eclipse.jst.ws.cxf.core;bundle-version="1.1.300", + org.eclipse.jst.ws.cxf.creation.core;bundle-version="1.0.500", + org.eclipse.jst.ws.cxf.creation.ui;bundle-version="1.0.300", + org.eclipse.jst.ws.cxf.doc.user;bundle-version="1.0.300", + org.eclipse.jst.ws.cxf.ui;bundle-version="1.0.300", + org.eclipse.jst.ws.jaxrs.core;bundle-version="1.0.700", + org.eclipse.jst.ws.jaxrs.ui;bundle-version="1.0.700", + org.eclipse.m2e.wtp.jaxrs;bundle-version="1.3.3", + com.google.gson;bundle-version="2.7.0", + com.google.guava;bundle-version="21.0.0", + com.google.inject;bundle-version="3.0.0", + eu.DECIDEh2020.architect.plugin;bundle-version="1.0.0" Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Bundle-ClassPath: bin/ +Bundle-ClassPath: ., + libs/asm-5.0.4.jar, + libs/commons-lang3-3.2.1.jar, + libs/cxf-core-3.1.11.jar, + libs/cxf-rt-frontend-jaxrs-3.1.11.jar, + libs/cxf-rt-rs-client-3.1.11.jar, + libs/cxf-rt-rs-service-description-3.1.11.jar, + libs/cxf-rt-transports-http-3.1.11.jar, + libs/cxf-rt-ws-policy-3.1.11.jar, + libs/cxf-rt-wsdl-3.1.11.jar, + libs/guava-20.0.jar, + libs/jackson-dataformat-yaml-2.8.7.jar, + libs/jackson-datatype-joda-2.9.5.jar, + libs/jackson-jaxrs-base-2.9.5.jar, + libs/jackson-jaxrs-json-provider-2.9.5.jar, + libs/jackson-module-jaxb-annotations-2.9.5.jar, + libs/javassist-3.21.0-GA.jar, + libs/javax.annotation-api-1.2.jar, + libs/javax.ws.rs-api-2.0.1.jar, + libs/joda-time-2.7.jar, + libs/jsr311-api-1.1.1.jar, + libs/logback-classic-1.1.7.jar, + libs/logback-core-1.1.7.jar, + libs/neethi-3.0.3.jar, + libs/reflections-0.9.11.jar, + libs/slf4j-api-1.7.20.jar, + libs/snakeyaml-1.17.jar, + libs/stax2-api-3.1.4.jar, + libs/swagger-annotations-1.5.15.jar, + libs/swagger-core-1.5.15.jar, + libs/swagger-jaxrs-1.5.15.jar, + libs/swagger-models-1.5.15.jar, + libs/validation-api-1.1.0.Final.jar, + libs/woodstox-core-asl-4.4.1.jar, + libs/wsdl4j-1.6.3.jar, + libs/xmlschema-core-2.2.1.jar, + libs/jackson-databind-2.8.7.jar, + libs/jackson-core-2.9.5.jar, + libs/jackson-annotations-2.9.0.jar, + libs/optimus-client-2.0.0.jar, + libs/app-controller-0.0.16-SNAPSHOT.jar +Export-Package: com.fasterxml.jackson.databind.node diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/build.properties b/OPTIMUS/eu.DECIDEh2020.optimus/build.properties index 2ce0bdac34ff270eaa34ac3b7eb21ebe8a78d778..b18c4c5379adc1552acf981672a62d1277ba4079 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/build.properties +++ b/OPTIMUS/eu.DECIDEh2020.optimus/build.properties @@ -2,4 +2,15 @@ output.. = bin/ bin.includes = plugin.xml,\ META-INF/,\ icons/,\ - bin/ + optimus.plugin.properties,\ + .,\ + libs/,\ + libs/optimus-client-2.0.0.jar,\ + libs/app-controller-0.0.16-SNAPSHOT.jar +jars.compile.order = lib/,\ + bin/ +src.includes = src/,\ + eu.decideh2020.optimus.client-2.0.0.jar +source.. = src/ + + diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/app-controller-0.0.16-SNAPSHOT.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/app-controller-0.0.16-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..00835210029f7819f4ed652e8f8f48205f7e7e00 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/app-controller-0.0.16-SNAPSHOT.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/asm-5.0.4.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/asm-5.0.4.jar new file mode 100644 index 0000000000000000000000000000000000000000..cdb283dd7f6d7d420ba0fca8ec23e1f38fc3b7c1 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/asm-5.0.4.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/commons-lang3-3.2.1.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/commons-lang3-3.2.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..6bf4f93c09887f265433d8c14b780e90b7effa5a Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/commons-lang3-3.2.1.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-core-3.1.11.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-core-3.1.11.jar new file mode 100644 index 0000000000000000000000000000000000000000..21e215b1ff929d4adbabb072351413c9d2089890 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-core-3.1.11.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-frontend-jaxrs-3.1.11.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-frontend-jaxrs-3.1.11.jar new file mode 100644 index 0000000000000000000000000000000000000000..6273cf90df0e3824976e03dee62272b664dfe4b2 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-frontend-jaxrs-3.1.11.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-rs-client-3.1.11.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-rs-client-3.1.11.jar new file mode 100644 index 0000000000000000000000000000000000000000..0be758589d00d15d3e7564ad344306b93de5b987 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-rs-client-3.1.11.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-rs-service-description-3.1.11.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-rs-service-description-3.1.11.jar new file mode 100644 index 0000000000000000000000000000000000000000..eef2749110cdc67c8379d4522bdada80012568ea Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-rs-service-description-3.1.11.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-transports-http-3.1.11.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-transports-http-3.1.11.jar new file mode 100644 index 0000000000000000000000000000000000000000..7d06159380c74a29616f64758a5bedeb00f48d47 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-transports-http-3.1.11.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-ws-policy-3.1.11.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-ws-policy-3.1.11.jar new file mode 100644 index 0000000000000000000000000000000000000000..078d089f023f439b6b3764c4e6b9d727e975042f Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-ws-policy-3.1.11.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-wsdl-3.1.11.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-wsdl-3.1.11.jar new file mode 100644 index 0000000000000000000000000000000000000000..26b0905900548a5e5ad2bf434bf25e69fb57c049 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/cxf-rt-wsdl-3.1.11.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/guava-20.0.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/guava-20.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..632772f3a4d2197c0247cf32031fb489f1531446 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/guava-20.0.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-annotations-2.9.0.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-annotations-2.9.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..c602d75d4d0ac28db5631e48bc39fb34940916dd Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-annotations-2.9.0.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-core-2.9.5.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-core-2.9.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..b70d1ef1ac8c2bb4a40647fd57560c048e2e6f45 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-core-2.9.5.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-databind-2.8.7.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-databind-2.8.7.jar new file mode 100644 index 0000000000000000000000000000000000000000..1d155d36ed9542d779e8029845ccf1f7022124b5 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-databind-2.8.7.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-dataformat-yaml-2.8.7.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-dataformat-yaml-2.8.7.jar new file mode 100644 index 0000000000000000000000000000000000000000..0289c0c874e8fb36d6f533e6a4ca6639a7aa405e Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-dataformat-yaml-2.8.7.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-datatype-joda-2.9.5.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-datatype-joda-2.9.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..d1c07e7f714c47e670143fb76bfc13bf6a8f05f3 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-datatype-joda-2.9.5.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-jaxrs-base-2.9.5.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-jaxrs-base-2.9.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..98f1174ead5415ea9b48508805127a1212f87be4 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-jaxrs-base-2.9.5.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-jaxrs-json-provider-2.9.5.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-jaxrs-json-provider-2.9.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..7fa588766657a91be3d3eb719fb06a90f43286e4 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-jaxrs-json-provider-2.9.5.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-module-jaxb-annotations-2.9.5.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-module-jaxb-annotations-2.9.5.jar new file mode 100644 index 0000000000000000000000000000000000000000..1384cc1ea885e2e52b5c042e4b15ca2ccb9b30f4 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jackson-module-jaxb-annotations-2.9.5.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/javassist-3.21.0-GA.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/javassist-3.21.0-GA.jar new file mode 100644 index 0000000000000000000000000000000000000000..64549c4adae36e5697244db14c887fb1e5f03aa6 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/javassist-3.21.0-GA.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/javax.annotation-api-1.2.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/javax.annotation-api-1.2.jar new file mode 100644 index 0000000000000000000000000000000000000000..9ab39ffa4b57f9d20bd37acfbf6011902596a078 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/javax.annotation-api-1.2.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/javax.ws.rs-api-2.0.1.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/javax.ws.rs-api-2.0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..7eb68b4a0abb804e1d30b68ae4ba74a1eb14d38b Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/javax.ws.rs-api-2.0.1.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/joda-time-2.7.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/joda-time-2.7.jar new file mode 100644 index 0000000000000000000000000000000000000000..5a945232e252e38d328cc325b30fcfcd03982fca Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/joda-time-2.7.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/jsr311-api-1.1.1.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jsr311-api-1.1.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..ec8bc81854bf863947ba5e3ced73c3fcc9e83e18 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/jsr311-api-1.1.1.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/logback-classic-1.1.7.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/logback-classic-1.1.7.jar new file mode 100644 index 0000000000000000000000000000000000000000..e05c037f6ab6a96b0d0876e90e90e9faa7717777 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/logback-classic-1.1.7.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/logback-core-1.1.7.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/logback-core-1.1.7.jar new file mode 100644 index 0000000000000000000000000000000000000000..f14819b4a58c2221638edd7a04e8d025f3fc5f03 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/logback-core-1.1.7.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/neethi-3.0.3.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/neethi-3.0.3.jar new file mode 100644 index 0000000000000000000000000000000000000000..38b77ff3499a2e01f225d2bcef5265f33525ed3a Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/neethi-3.0.3.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/optimus-client-2.0.0.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/optimus-client-2.0.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..1951b7bf72ceb0016a773053faf67fa55c138b6a Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/optimus-client-2.0.0.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/reflections-0.9.11.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/reflections-0.9.11.jar new file mode 100644 index 0000000000000000000000000000000000000000..0f852c752009c83fcbd3d3169494ebeb5ca4d89d Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/reflections-0.9.11.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/slf4j-api-1.7.20.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/slf4j-api-1.7.20.jar new file mode 100644 index 0000000000000000000000000000000000000000..67090295598ef369c218af22848b61864ae45ff3 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/slf4j-api-1.7.20.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/snakeyaml-1.17.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/snakeyaml-1.17.jar new file mode 100644 index 0000000000000000000000000000000000000000..b0372a3cddd2d09e343629153ec113b2762cd301 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/snakeyaml-1.17.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/stax2-api-3.1.4.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/stax2-api-3.1.4.jar new file mode 100644 index 0000000000000000000000000000000000000000..dded036928902c5832956c9733a1dd03295a3187 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/stax2-api-3.1.4.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/swagger-annotations-1.5.15.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/swagger-annotations-1.5.15.jar new file mode 100644 index 0000000000000000000000000000000000000000..c660b4756409889a017f3adb4553246f3ad8fa0e Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/swagger-annotations-1.5.15.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/swagger-core-1.5.15.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/swagger-core-1.5.15.jar new file mode 100644 index 0000000000000000000000000000000000000000..f2f2ebe0f2afac57c53afbde02fa1929425da67c Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/swagger-core-1.5.15.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/swagger-jaxrs-1.5.15.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/swagger-jaxrs-1.5.15.jar new file mode 100644 index 0000000000000000000000000000000000000000..5f81ef3d30d4877f1f10fda9cd7e3e2e44073e13 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/swagger-jaxrs-1.5.15.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/swagger-models-1.5.15.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/swagger-models-1.5.15.jar new file mode 100644 index 0000000000000000000000000000000000000000..5b6c9a715d109f4813472b7c828198bf8006b005 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/swagger-models-1.5.15.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/validation-api-1.1.0.Final.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/validation-api-1.1.0.Final.jar new file mode 100644 index 0000000000000000000000000000000000000000..de85403868d90e62cd40c6e7fb64662ed4908594 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/validation-api-1.1.0.Final.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/woodstox-core-asl-4.4.1.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/woodstox-core-asl-4.4.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..d8b4e8cf87d48bc7b31ba954f226d9ba30a69dea Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/woodstox-core-asl-4.4.1.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/wsdl4j-1.6.3.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/wsdl4j-1.6.3.jar new file mode 100644 index 0000000000000000000000000000000000000000..b9c10b97cc37e229b610c91bbe9d596a6eeb338b Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/wsdl4j-1.6.3.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/libs/xmlschema-core-2.2.1.jar b/OPTIMUS/eu.DECIDEh2020.optimus/libs/xmlschema-core-2.2.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..cab69fd4164584cbf6c7ecb5e8ac4b7b9be4b798 Binary files /dev/null and b/OPTIMUS/eu.DECIDEh2020.optimus/libs/xmlschema-core-2.2.1.jar differ diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/optimus.plugin.properties b/OPTIMUS/eu.DECIDEh2020.optimus/optimus.plugin.properties new file mode 100644 index 0000000000000000000000000000000000000000..de34fbdc135056ee4885a058c82c1033bf464dd3 --- /dev/null +++ b/OPTIMUS/eu.DECIDEh2020.optimus/optimus.plugin.properties @@ -0,0 +1 @@ +localAppDesc="D:\\W\2017-Decide\\workspace\\AppsDescFolder\\" diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/plugin.xml b/OPTIMUS/eu.DECIDEh2020.optimus/plugin.xml index d179a29b1a20374a25285dc39827c60351717006..5b70a37d630be445f68435d52b014f8cd4c84bf0 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/plugin.xml +++ b/OPTIMUS/eu.DECIDEh2020.optimus/plugin.xml @@ -28,5 +28,17 @@ id="eu.DECIDEh2020.optimus.wizards.OptimusWizard"> </wizard> </extension> + <extension + point="eu.DECIDEh2020.architect.extension"> + <pagebuilder + PageName="Classification" + class="eu.DECIDEh2020.optimus.editors.ClassificationPageBuilder"> + </pagebuilder> + <pagebuilder + PageName="Simulation" + class="eu.DECIDEh2020.optimus.editors.SimulationPageBuilder"> + </pagebuilder> + </extension> + </plugin> diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/Classification.java b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/Classification.java index d0521ce54a2e1c0240113204be7032d3d3fd472f..e439e1615df5151f9afb962b6349bfabd2fb6b5a 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/Classification.java +++ b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/Classification.java @@ -1,6 +1,6 @@ /********************************************************************* -* Copyright (c) 2017 Tecnalia. +* Copyright (c) 2018 Tecnalia. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -8,6 +8,7 @@ * * SPDX-License-Identifier: EPL-2.0 * Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia * Gorka Benguria Tecnalia * I�aki Etxaniz Tecnalia * Juncal Alonso Tecnalia @@ -18,31 +19,43 @@ **********************************************************************/ package eu.DECIDEh2020.optimus.editors; + import org.eclipse.swt.SWT; import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.events.ControlAdapter; -import org.eclipse.swt.events.ControlEvent; import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.FocusListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Text; +import org.eclipse.wb.swt.SWTResourceManager; +//import org.eclipse.wb.swt.SWTResourceManager; import org.json.simple.JSONArray; //import org.json.simple.JSONException; import org.json.simple.JSONObject; - -import java.awt.Rectangle; //import org.json.parser.JSONParser; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; -public class Classification extends Composite { +import eu.DECIDEh2020.appManager.models.AppDescription; +import eu.DECIDEh2020.appManager.models.Microservice; +import eu.DECIDEh2020.architect.plugin.editor.Page; +import org.eclipse.swt.graphics.Point; + +public class Classification extends Page { /** * Create the composite. @@ -60,134 +73,94 @@ public class Classification extends Composite { public int y = 5; public String newcontent; + private AppDescription appdescription; + private Color background; - public Classification(Composite parent, int style) { - super(parent, style); - - - Label lblAppName = new Label(this, SWT.NONE); - lblAppName.setBounds(10, 10, 55, 15); - lblAppName.setText("App name"); - - text_1 = new Text(this, SWT.BORDER); - text_1.setBounds(74, 10, 76, 21); - - text_1.addFocusListener(new FocusListener() { - - @Override - public void focusGained(FocusEvent arg0) { - // TODO Auto-generated method stub - - } + public Classification(Composite parent, int style, AppDescription appdescription) { + super(parent, SWT.NO_FOCUS, appdescription); + this.appdescription = appdescription; + background= SWTResourceManager.getColor(SWT.COLOR_WHITE); - @Override - public void focusLost(FocusEvent arg0) { - newcontent = text_1.getText(); - optimus.appjson.put("id", (int) (Math.random()*1000)); - optimus.appjson.put("name", newcontent); - - }}); - - - - + setBackground(background); + createClassificationGUI(appdescription); + } - Button btnAddMicroservice = new Button(this, SWT.NONE); - btnAddMicroservice.setBounds(181, 10, 130, 25); - btnAddMicroservice.setText("Add microservice"); + private void createClassificationGUI(AppDescription appdescription) { + //to redraw the page/tab + microservicesNumber = 0; + y = 5; + Control[] children = this.getChildren(); + for (int i = 0 ; i < children.length; i++) { + children[i].dispose(); + } + + + Label lblAppName = new Label(this, SWT.RIGHT); + lblAppName.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); + lblAppName.setBounds(10, 10, 55, 20); + lblAppName.setText("Multi-cloud Application name:"); - ScrolledComposite scrolledComposite = new ScrolledComposite(this, SWT.BORDER | SWT.V_SCROLL); - scrolledComposite.setExpandHorizontal(true); - scrolledComposite.setTouchEnabled(true); - scrolledComposite.setShowFocusedControl(true); - scrolledComposite.setAlwaysShowScrollBars(true); - scrolledComposite.setBounds(10, 48, 753, 596); - scrolledComposite.setMinHeight(y); - - final StyledText styledText = new StyledText(scrolledComposite, SWT.BORDER | SWT.WRAP); - scrolledComposite.setContent(styledText); - scrolledComposite.setMinSize(styledText.computeSize(SWT.DEFAULT, SWT.DEFAULT)); - - Button btnSave = new Button(this, SWT.NONE); - btnSave.setBounds(688, 660, 75, 25); - btnSave.setText("Save"); - - btnSave.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - - optimus.appjson.put("microservices", optimus.appmicros); - final String FILENAME = optimus.workingDir; - - BufferedWriter bw = null; - FileWriter fw = null; - try { - String content = optimus.appjson.toString(); - fw = new FileWriter(FILENAME); - bw = new BufferedWriter(fw); - bw.write(content); - } catch (IOException e) { - e.printStackTrace(); - } finally { - try { - if (bw != null) - bw.close(); - if (fw != null) - fw.close(); - - } catch (IOException ex) { - ex.printStackTrace(); - } - } - } - }); + text_1 = new Text(this,SWT.BORDER); + GridData gd_text_1 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); + gd_text_1.widthHint = 112; + text_1.setLayoutData(gd_text_1); + text_1.setBounds(10, 10, 100, 21); + text_1.setText(appdescription.getName()); + setLayout(new GridLayout(2, true)); + Composite container = new Composite(this, SWT.NONE); + container.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, true, 2, 1)); + container.setBackground(background); + GridLayout gl_container = new GridLayout(1,true); + gl_container.horizontalSpacing = 10; + container.setLayout(gl_container); - - - - btnAddMicroservice.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - microservicesNumber = microservicesNumber + 1; - //scrolledComposite.setMinHeight(y); - text_2 = new Microservice(scrolledComposite, SWT.BORDER, y); - text_2.setBounds(10, y, 500, 100); - y = (120* microservicesNumber); - - } - }); - - } - public void Create_microservices_from_file() { - if (!(optimus.appjson.isEmpty())) - { - text_1.setText(optimus.appjson.get("name").toString()); - ScrolledComposite scrolledComposite = new ScrolledComposite(this, SWT.BORDER | SWT.V_SCROLL); - scrolledComposite.setTouchEnabled(true); - scrolledComposite.setShowFocusedControl(true); - scrolledComposite.setAlwaysShowScrollBars(true); - scrolledComposite.setExpandVertical(true); - scrolledComposite.setBounds(10, 48, 753, 427); - - optimus.appjson.get("name").toString(); - optimus.appmicros.remove("microservices"); - optimus.appmicros.add(optimus.appjson.get("microservices")); - int numbermicr=optimus.appmicros.size(); - for (int i = 0; i <numbermicr; i++) + ScrolledComposite scrolledComposite = new ScrolledComposite(container, SWT.V_SCROLL); + + Composite mcontainer = new Composite(scrolledComposite, SWT.NONE); + mcontainer.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE)); + mcontainer.setLayout(new GridLayout(1, false)); + + + for (int i = 0; i <appdescription.getMicroservices().size(); i++) { microservicesNumber = microservicesNumber + 1; - text_2 = new Microservice(scrolledComposite, SWT.BORDER, y); - text_2.setBounds(10, y, 500, 100); + text_2 = new MicroserviceClassification(mcontainer, SWT.BORDER, y, appdescription, i); + + text_2.setBounds(10, y, 600, 100); y = (120* microservicesNumber); - // } - } + } + mcontainer.requestLayout(); + + scrolledComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, true, 1, 1)); + scrolledComposite.setContent(mcontainer); + scrolledComposite.setExpandVertical( true ); + scrolledComposite.setExpandHorizontal( true ); + int width = scrolledComposite.getClientArea().width/2; + scrolledComposite.setMinSize( mcontainer.computeSize( width, SWT.DEFAULT ) ); + new Label(this, SWT.NONE); + new Label(this, SWT.NONE); + + scrolledComposite.addListener( SWT.Resize, event -> { + final int w = scrolledComposite.getClientArea().width/2; + scrolledComposite.setMinSize( mcontainer.computeSize( w, SWT.DEFAULT ) ); + } ); + + } @Override protected void checkSubclass() { // Disable the check that prevents subclassing of SWT components } + @Override + public void open(AppDescription appd) { + this.appdescription = appd; + createClassificationGUI(appd); + + } } diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/ClassificationPageBuilder.java b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/ClassificationPageBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..4ac3156a2730287e9fbc3ef6a8d87ddc4f2fcc43 --- /dev/null +++ b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/ClassificationPageBuilder.java @@ -0,0 +1,43 @@ +/********************************************************************* +* Copyright (c) 2018 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia +* Gorka Benguria Tecnalia +* I�aki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ + +package eu.DECIDEh2020.optimus.editors; + + +//import java.awt.Composite; +import org.eclipse.swt.widgets.*; + +import eu.DECIDEh2020.appManager.models.AppDescription; +import eu.DECIDEh2020.architect.plugin.editor.IPageBuilder; +import eu.DECIDEh2020.architect.plugin.editor.Page; + +public class ClassificationPageBuilder implements IPageBuilder { + /** + * + */ + public ClassificationPageBuilder() { + super(); + // TODO Auto-generated constructor stub + } + @Override + public Page getPage(Composite parent, int style,AppDescription appdescription) { + return new Classification(parent, style, appdescription); + } + +} diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/Microservice.java b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/Microservice.java index 987233e50de7a2f90249c9509fc9203194e83333..4e7ada5e680bd1e929d02ab4e0ca1a6bd7682f8b 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/Microservice.java +++ b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/Microservice.java @@ -1,223 +1,223 @@ - -/********************************************************************* -* Copyright (c) 2017 Tecnalia. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* Contributors (in alphabetical order): -* Gorka Benguria Tecnalia -* I�aki Etxaniz Tecnalia -* Juncal Alonso Tecnalia -* Leire Orue-Echevarria Tecnalia -* Maria Jose Lopez Tecnalia -* Marisa Escalante Tecnalia -* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu -**********************************************************************/ -package eu.DECIDEh2020.optimus.editors; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.events.FocusEvent; -import org.eclipse.swt.events.FocusListener; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.FontDialog; -import org.eclipse.swt.custom.ScrolledComposite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.json.simple.JSONArray; - -import org.json.simple.JSONObject; -import org.eclipse.swt.widgets.Combo; - - -public class Microservice extends Composite { - - /** - * Create the composite. - * @param parent - * @param style - */ - /** The text widget used in page 2. */ - private StyledText text; - /** The font chosen in page 1. */ - private Font font; - private Text text_1; - private Text text_2; - private static JSONObject micros; - private JSONArray DetachR; - private Text Detach_text; - private JSONObject DRes; - - - - public Microservice(Composite parent, int style, int y) { - super(parent, style); - - Composite compositeMicro = new Composite(this, SWT.NONE); - compositeMicro.setBounds(1, 0, 437, 83); - DetachR = new JSONArray(); - - Label lblMicroserviceName = new Label(compositeMicro, SWT.NONE); - lblMicroserviceName.setBounds(10, 13, 50, 30); - lblMicroserviceName.setText("Name"); - text_2 = new Text(compositeMicro, SWT.BORDER); - text_2.setBounds(69, 13, 200, 21); - - Label microserviceID = new Label(compositeMicro, SWT.NONE); - microserviceID.setText("id"); - microserviceID.setBounds(275, 13, 50, 15); - microserviceID.setVisible(false); - - - - Combo ms_type = new Combo(compositeMicro, SWT.NONE); - ms_type.setItems(new String[] {"Computing", "Computing Public IP"}); - ms_type.setBounds(331, 10, 91, 23); - ms_type.setText("Computing"); - - Combo Detach_type = new Combo(compositeMicro, SWT.NONE); - Detach_type.setItems(new String[] {"Storage. DB", "Storage", "Queue System"}); - Detach_type.setBounds(322, 50, 91, 23); - Detach_type.setText("Storage"); - - Button Det_DB = new Button(compositeMicro, SWT.RADIO); - Det_DB.setSelection(false); - Det_DB.setBounds(277, 53, 90, 16); - Det_DB.setText("DB"); - Det_DB.addFocusListener(new FocusListener(){ - - - @Override - public void focusGained(FocusEvent arg0) { - // TODO Auto-generated method stub - - } - @Override - public void focusLost(FocusEvent arg0) { - if (Det_DB.getSelection()) { - Detach_type.setText("Storage. DB"); - } - if (!Det_DB.getSelection()) {Detach_type.setText("Storage");} - - if (DRes.get(Detach_type)!=Detach_type.getText()) - { - - DetachR.remove(DRes); - micros.remove(DetachR); - optimus.appmicros.remove(micros); - DRes.put("Det_type",Detach_type.getText()); - DetachR.add(DRes); - optimus.appmicros.add(micros); - } - - - - - } - } - ); - - Label lblDetachableResource = new Label(compositeMicro, SWT.NONE); - lblDetachableResource.setBounds(11, 53, 122, 15); - lblDetachableResource.setText("Detachable Resource"); - Detach_text = new Text(compositeMicro, SWT.BORDER); - Detach_text.setBounds(143, 47, 117, 21); - - Detach_text.addFocusListener(new FocusListener(){ - - - @Override - public void focusGained(FocusEvent arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void focusLost(FocusEvent arg0) { - DRes = new JSONObject(); - for (int i=0; i < optimus.appmicros.size(); i++) - { - JSONObject itemArr = (JSONObject)optimus.appmicros.get(i); - if (itemArr.get("id").equals(microserviceID.getText())) - { - break; - } - } - - DRes.put("DetachableResource",Detach_text.getText()); - DRes.put("Det_type",Detach_type.getText()); - - DetachR.add(DRes); - micros.put("Detachable_resources",DetachR); - } - }); - - text_2.addFocusListener(new FocusListener() { - - - @Override - public void focusGained(FocusEvent arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void focusLost(FocusEvent arg0) { - int id = (int) (Math.random()*1000); - String idS = String.valueOf(id); - micros = new JSONObject(); - - for (int i=0; i < optimus.appmicros.size(); i++) - { - JSONObject itemArr = (JSONObject)optimus.appmicros.get(i); - if (itemArr.get("id").equals(microserviceID.getText())) - { - optimus.appmicros.remove(itemArr); - idS = microserviceID.getText(); - break; - - } - } - - - micros.put("id",idS); - micros.put("microname", text_2.getText()); - micros.put("ms_type", ms_type.getText()); - optimus.appmicros.add(micros); - microserviceID.setText(idS); - microserviceID.setVisible(true); - } - - private boolean existmicroservice(String text) { - JSONObject microstemp = new JSONObject(); - microstemp.put("id",text); - microstemp.put("microname", text_2.getText()); - if (optimus.appmicros.contains(microstemp)) { - return true; - - } else { - return false; - } - }}); - } - //}); - - //} - - @Override - protected void checkSubclass() { - // Disable the check that prevents subclassing of SWT components - } -} + +/********************************************************************* +* Copyright (c) 2017 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Gorka Benguria Tecnalia +* I�aki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.DECIDEh2020.optimus.editors; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.FontDialog; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; +import org.json.simple.JSONArray; + +import org.json.simple.JSONObject; +import org.eclipse.swt.widgets.Combo; + + +public class Microservice extends Composite { + + /** + * Create the composite. + * @param parent + * @param style + */ + /** The text widget used in page 2. */ + private StyledText text; + /** The font chosen in page 1. */ + private Font font; + private Text text_1; + private Text text_2; + private static JSONObject micros; + private JSONArray DetachR; + private Text Detach_text; + private JSONObject DRes; + + + + public Microservice(Composite parent, int style, int y) { + super(parent, style); + + Composite compositeMicro = new Composite(this, SWT.NONE); + compositeMicro.setBounds(1, 0, 437, 83); + DetachR = new JSONArray(); + + Label lblMicroserviceName = new Label(compositeMicro, SWT.NONE); + lblMicroserviceName.setBounds(10, 13, 50, 30); + lblMicroserviceName.setText("Name"); + text_2 = new Text(compositeMicro, SWT.BORDER); + text_2.setBounds(69, 13, 200, 21); + + Label microserviceID = new Label(compositeMicro, SWT.NONE); + microserviceID.setText("id"); + microserviceID.setBounds(275, 13, 50, 15); + microserviceID.setVisible(false); + + + + Combo ms_type = new Combo(compositeMicro, SWT.NONE); + ms_type.setItems(new String[] {"Computing", "Computing Public IP"}); + ms_type.setBounds(331, 10, 91, 23); + ms_type.setText("Computing"); + + Combo Detach_type = new Combo(compositeMicro, SWT.NONE); + Detach_type.setItems(new String[] {"Storage. DB", "Storage", "Queue System"}); + Detach_type.setBounds(322, 50, 91, 23); + Detach_type.setText("Storage"); + + Button Det_DB = new Button(compositeMicro, SWT.RADIO); + Det_DB.setSelection(false); + Det_DB.setBounds(277, 53, 90, 16); + Det_DB.setText("DB"); + Det_DB.addFocusListener(new FocusListener(){ + + + @Override + public void focusGained(FocusEvent arg0) { + // TODO Auto-generated method stub + + } + @Override + public void focusLost(FocusEvent arg0) { + if (Det_DB.getSelection()) { + Detach_type.setText("Storage. DB"); + } + if (!Det_DB.getSelection()) {Detach_type.setText("Storage");} + + if (DRes.get(Detach_type)!=Detach_type.getText()) + { + + DetachR.remove(DRes); + micros.remove(DetachR); + optimus.appmicros.remove(micros); + DRes.put("Det_type",Detach_type.getText()); + DetachR.add(DRes); + optimus.appmicros.add(micros); + } + + + + + } + } + ); + + Label lblDetachableResource = new Label(compositeMicro, SWT.NONE); + lblDetachableResource.setBounds(11, 53, 122, 15); + lblDetachableResource.setText("Detachable Resource"); + Detach_text = new Text(compositeMicro, SWT.BORDER); + Detach_text.setBounds(143, 47, 117, 21); + + Detach_text.addFocusListener(new FocusListener(){ + + + @Override + public void focusGained(FocusEvent arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void focusLost(FocusEvent arg0) { + DRes = new JSONObject(); + for (int i=0; i < optimus.appmicros.size(); i++) + { + JSONObject itemArr = (JSONObject)optimus.appmicros.get(i); + if (itemArr.get("id").equals(microserviceID.getText())) + { + break; + } + } + + DRes.put("DetachableResource",Detach_text.getText()); + DRes.put("Det_type",Detach_type.getText()); + + DetachR.add(DRes); + micros.put("Detachable_resources",DetachR); + } + }); + + text_2.addFocusListener(new FocusListener() { + + + @Override + public void focusGained(FocusEvent arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void focusLost(FocusEvent arg0) { + int id = (int) (Math.random()*1000); + String idS = String.valueOf(id); + micros = new JSONObject(); + + for (int i=0; i < optimus.appmicros.size(); i++) + { + JSONObject itemArr = (JSONObject)optimus.appmicros.get(i); + if (itemArr.get("id").equals(microserviceID.getText())) + { + optimus.appmicros.remove(itemArr); + idS = microserviceID.getText(); + break; + + } + } + + + micros.put("id",idS); + micros.put("microname", text_2.getText()); + micros.put("ms_type", ms_type.getText()); + optimus.appmicros.add(micros); + microserviceID.setText(idS); + microserviceID.setVisible(true); + } + + private boolean existmicroservice(String text) { + JSONObject microstemp = new JSONObject(); + microstemp.put("id",text); + microstemp.put("microname", text_2.getText()); + if (optimus.appmicros.contains(microstemp)) { + return true; + + } else { + return false; + } + }}); + } + //}); + + //} + + @Override + protected void checkSubclass() { + // Disable the check that prevents subclassing of SWT components + } +} diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/MicroserviceClassification.java b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/MicroserviceClassification.java new file mode 100644 index 0000000000000000000000000000000000000000..26353ab6ab8bc1185599b4c7584e64b5ec84dbd5 --- /dev/null +++ b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/MicroserviceClassification.java @@ -0,0 +1,280 @@ + +/********************************************************************* +* Copyright (c) 2018 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia +* Gorka Benguria Tecnalia +* I�aki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.DECIDEh2020.optimus.editors; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.events.FocusEvent; +import org.eclipse.swt.events.FocusListener; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; + +import eu.DECIDEh2020.appManager.models.Microservice; +import eu.DECIDEh2020.appManager.AppDescriptionHelper; +import eu.DECIDEh2020.appManager.models.AppDescription; +import eu.DECIDEh2020.appManager.models.DetachableResource; +import org.eclipse.swt.custom.ScrolledComposite; + + +public class MicroserviceClassification extends Composite { + + /** + * Create the composite. + * @param parent + * @param style + */ + /** The text widget used in page 2. */ + private StyledText text; + /** The font chosen in page 1. */ + private Font font; + private Text text_1; + private Text text_2; + private static JSONObject micros; + private Text Detach_text; + private AppDescription appdescription; + private String DRes_type; + + + public MicroserviceClassification(Composite parent, int style, int y, AppDescription appdescription, int i) { + super(parent, style); + setEnabled(true); + this.appdescription = appdescription; + + if (appdescription.getMicroservices().get(i).getDetachableResources().isEmpty()) + + { DetachableResource DR = new DetachableResource(); + DR.setName("none"); + DR.setId(UUID.randomUUID().toString()); + appdescription.getMicroservices().get(i).getDetachableResources().add(0, DR); + } + Label lblMicroserviceName = new Label(this, SWT.NONE); + lblMicroserviceName.setBounds(10, 13, 50, 30); + lblMicroserviceName.setText("Name"); + Text text_2 = new Text(this, SWT.BORDER); + text_2.setTouchEnabled(true); + text_2.setEnabled(true); + text_2.setBounds(69, 13, 228, 30); + text_2.setText(appdescription.getMicroservices().get(i).getName()); + + Label microserviceID = new Label(this, SWT.NONE); + microserviceID.setBounds(275, 13, 50, 15); + microserviceID.setVisible(false); + microserviceID.setText(appdescription.getMicroservices().get(i).getId()); + + + + Combo ms_type = new Combo(this, SWT.NONE); + ms_type.setTouchEnabled(true); + ms_type.setEnabled(true); + ms_type.setItems(new String[] {"Computing", "Computing Public IP"}); + ms_type.setBounds(505, 13, 190, 28); + + //take from appdescription the ms_type + String mstype = appdescription.getMicroservices().get(i).getClassification(); + if (mstype != null) + { + ms_type.setText(mstype); + if (mstype.contentEquals("Computing Public IP")) + { + appdescription.getMicroservices().get(i).setPublicIP(true); + } + } + else + { + appdescription.getMicroservices().get(i).setClassification("Computing"); + ms_type.setText("Computing"); + } + + ms_type.addFocusListener(new FocusListener() { + + + @Override + public void focusGained(FocusEvent arg0) { + + } + + @Override + public void focusLost(FocusEvent arg0) { + appdescription.getMicroservices().get(i).setClassification(ms_type.getText()); + } + + + }); + + + Label lblDetachableResource = new Label(this, SWT.NONE); + lblDetachableResource.setBounds(11, 53, 163, 27); + lblDetachableResource.setText("Detachable Resource"); + Detach_text = new Text(this, SWT.BORDER); + Detach_text.setText("none"); + Detach_text.setTouchEnabled(true); + Detach_text.setEnabled(true); + Detach_text.setBounds(180, 50, 117, 30); + String DRname = appdescription.getMicroservices().get(i).getDetachableResources().get(0).getName(); + //if (DRname != "none") + if (!DRname.contains("none")) + + { + Detach_text.setText(DRname); + } + + Detach_text.addFocusListener(new FocusListener(){ + + + @Override + public void focusGained(FocusEvent arg0) { + + } + + @Override + public void focusLost(FocusEvent arg0) { + String name = Detach_text.getText(); + appdescription.getMicroservices().get(i).getDetachableResources().get(0).setName(name); + appdescription.getMicroservices().get(i).getDetachableResources().get(0).setId(UUID.randomUUID().toString()); + } + }); + + Combo Detach_type = new Combo(this, SWT.NONE); + Detach_type.setTouchEnabled(true); + Detach_type.setEnabled(true); + Detach_type.setItems(new String[] {"db", "storage", "queue system"}); + Detach_type.setBounds(505, 53, 190, 28); + + String DRtype = appdescription.getMicroservices().get(i).getDetachableResources().get(0).getClassification(); + + if (DRname.contains("none")) + { + Detach_type.setText("storage"); + appdescription.getMicroservices().get(i).getDetachableResources().get(0).setClassification("storage"); + } + + else + { + Detach_type.setText(appdescription.getMicroservices().get(i).getDetachableResources().get(0).getClassification()); + } + + Detach_type.addFocusListener(new FocusListener(){ + + + @Override + public void focusGained(FocusEvent arg0) { + + } + + @Override + public void focusLost(FocusEvent arg0) { + String type = Detach_type.getText(); + appdescription.getMicroservices().get(i).getDetachableResources().get(0).setClassification(type); + } + }); + Button Det_DB = new Button(this, SWT.RADIO); + Det_DB.setSelection(false); + Det_DB.setBounds(303, 55, 43, 21); + Det_DB.setText("DB"); + DetachableResource detdet = new DetachableResource(); + detdet = appdescription.getMicroservices().get(i).getDetachableResources().get(0); + String name = detdet.getName(); + + //detdet.setDb(true); + Boolean isdb = detdet.isDb(); + Det_DB.setSelection(isdb); + + Label lblMsclassification = new Label(this, SWT.NONE); + lblMsclassification.setBounds(363, 13, 136, 30); + lblMsclassification.setText("MSClassification:"); + + Label lblDrclassification = new Label(this, SWT.NONE); + lblDrclassification.setBounds(363, 53, 136, 28); + lblDrclassification.setText("DRClassification:"); + + Det_DB.addFocusListener(new FocusListener(){ + + + public void focusGained(FocusEvent arg0) { + + + + } + public void focusLost(FocusEvent arg0) { + //appdescription.getMicroservices().get(i).getDetachableResources().get(0).setDb(false); + + if (Det_DB.getSelection()) { + if (appdescription.getMicroservices().get(i).getDetachableResources().get(0).isDb()) { + appdescription.getMicroservices().get(i).getDetachableResources().get(0).setDb(false); + appdescription.getMicroservices().get(i).getDetachableResources().get(0).setSql(false); + Detach_type.setText("storage"); + Det_DB.setSelection(false); + } + else { + Det_DB.setSelection(true); + appdescription.getMicroservices().get(i).getDetachableResources().get(0).setDb(true); + Detach_type.setText("db"); + if (appdescription.getMicroservices().get(i).getDetachableResources().get(0).getName().equals("MySQL")) { + appdescription.getMicroservices().get(i).getDetachableResources().get(0).setSql(true); + } + } + DRes_type="db"; +// if (appdescription.getMicroservices().get(i).getDetachableResources().get(0).getName().equals("MySQL")) { +// appdescription.getMicroservices().get(i).getDetachableResources().get(0).setSql(true); +// } + //appdescription.getMicroservices().get(i).getDetachableResources().get(0).setDb(true); + //Detach_type.setText("db"); + //Det_DB.setSelection(true); + + } +// else { +// appdescription.getMicroservices().get(i).getDetachableResources().get(0).setSql(false); +// Det_DB.setSelection(true); +// DRes_type="db"; +// if (appdescription.getMicroservices().get(i).getDetachableResources().get(0).getName().equals("MySQL")) { +// appdescription.getMicroservices().get(i).getDetachableResources().get(0).setSql(true); +// } +// } + if (!Det_DB.getSelection() && !appdescription.getMicroservices().get(i).getDetachableResources().get(0).getClassification().contains("System Queue") ) { + Detach_type.setText("storage"); + DRes_type="storage"; + Det_DB.setSelection(false); + + } + + appdescription.getMicroservices().get(i).getDetachableResources().get(0).setClassification(DRes_type); + } + } + ); + + } + + @Override + protected void checkSubclass() { + // Disable the check that prevents subclassing of SWT components + } +} diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/OptimusContributor.java b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/OptimusContributor.java index 2aec51256be0f4a72ded64168865ecf10f340627..4638ee53d3411f43e3ccbda48b8db2f41280d968 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/OptimusContributor.java +++ b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/OptimusContributor.java @@ -1,121 +1,121 @@ - -/********************************************************************* -* Copyright (c) 2017 Tecnalia. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* Contributors (in alphabetical order): -* Gorka Benguria Tecnalia -* I�aki Etxaniz Tecnalia -* Juncal Alonso Tecnalia -* Leire Orue-Echevarria Tecnalia -* Maria Jose Lopez Tecnalia -* Marisa Escalante Tecnalia -* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu -**********************************************************************/ -package eu.DECIDEh2020.optimus.editors; - -import org.eclipse.jface.action.*; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.ActionFactory; -import org.eclipse.ui.ide.IDE; -import org.eclipse.ui.ide.IDEActionFactory; -import org.eclipse.ui.part.MultiPageEditorActionBarContributor; -import org.eclipse.ui.texteditor.ITextEditor; -import org.eclipse.ui.texteditor.ITextEditorActionConstants; - -/** - * Manages the installation/deinstallation of global actions for multi-page editors. - * Responsible for the redirection of global actions to the active editor. - * Multi-page contributor replaces the contributors for the individual editors in the multi-page editor. - */ -public class OptimusContributor extends MultiPageEditorActionBarContributor { - private IEditorPart activeEditorPart; - private Action sampleAction; - /** - * Creates a multi-page contributor. - */ - public OptimusContributor() { - super(); - createActions(); - } - /** - * Returns the action registed with the given text editor. - * @return IAction or null if editor is null. - */ - protected IAction getAction(ITextEditor editor, String actionID) { - return (editor == null ? null : editor.getAction(actionID)); - } - /* (non-JavaDoc) - * Method declared in AbstractMultiPageEditorActionBarContributor. - */ - - public void setActivePage(IEditorPart part) { - if (activeEditorPart == part) - return; - - activeEditorPart = part; - - IActionBars actionBars = getActionBars(); - if (actionBars != null) { - - ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null; - - actionBars.setGlobalActionHandler( - ActionFactory.DELETE.getId(), - getAction(editor, ITextEditorActionConstants.DELETE)); - actionBars.setGlobalActionHandler( - ActionFactory.UNDO.getId(), - getAction(editor, ITextEditorActionConstants.UNDO)); - actionBars.setGlobalActionHandler( - ActionFactory.REDO.getId(), - getAction(editor, ITextEditorActionConstants.REDO)); - actionBars.setGlobalActionHandler( - ActionFactory.CUT.getId(), - getAction(editor, ITextEditorActionConstants.CUT)); - actionBars.setGlobalActionHandler( - ActionFactory.COPY.getId(), - getAction(editor, ITextEditorActionConstants.COPY)); - actionBars.setGlobalActionHandler( - ActionFactory.PASTE.getId(), - getAction(editor, ITextEditorActionConstants.PASTE)); - actionBars.setGlobalActionHandler( - ActionFactory.SELECT_ALL.getId(), - getAction(editor, ITextEditorActionConstants.SELECT_ALL)); - actionBars.setGlobalActionHandler( - ActionFactory.FIND.getId(), - getAction(editor, ITextEditorActionConstants.FIND)); - actionBars.setGlobalActionHandler( - IDEActionFactory.BOOKMARK.getId(), - getAction(editor, IDEActionFactory.BOOKMARK.getId())); - actionBars.updateActionBars(); - } - } - private void createActions() { - sampleAction = new Action() { - public void run() { - MessageDialog.openInformation(null, "Optimus", "Sample Action Executed"); - } - }; - sampleAction.setText("Sample Action"); - sampleAction.setToolTipText("Sample Action tool tip"); - sampleAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages(). - getImageDescriptor(IDE.SharedImages.IMG_OBJS_TASK_TSK)); - } - public void contributeToMenu(IMenuManager manager) { - IMenuManager menu = new MenuManager("Editor &Menu"); - manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, menu); - menu.add(sampleAction); - } - public void contributeToToolBar(IToolBarManager manager) { - manager.add(new Separator()); - manager.add(sampleAction); - } -} + +/********************************************************************* +* Copyright (c) 2017 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Gorka Benguria Tecnalia +* I�aki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.DECIDEh2020.optimus.editors; + +import org.eclipse.jface.action.*; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchActionConstants; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.actions.ActionFactory; +import org.eclipse.ui.ide.IDE; +import org.eclipse.ui.ide.IDEActionFactory; +import org.eclipse.ui.part.MultiPageEditorActionBarContributor; +import org.eclipse.ui.texteditor.ITextEditor; +import org.eclipse.ui.texteditor.ITextEditorActionConstants; + +/** + * Manages the installation/deinstallation of global actions for multi-page editors. + * Responsible for the redirection of global actions to the active editor. + * Multi-page contributor replaces the contributors for the individual editors in the multi-page editor. + */ +public class OptimusContributor extends MultiPageEditorActionBarContributor { + private IEditorPart activeEditorPart; + private Action sampleAction; + /** + * Creates a multi-page contributor. + */ + public OptimusContributor() { + super(); + createActions(); + } + /** + * Returns the action registed with the given text editor. + * @return IAction or null if editor is null. + */ + protected IAction getAction(ITextEditor editor, String actionID) { + return (editor == null ? null : editor.getAction(actionID)); + } + /* (non-JavaDoc) + * Method declared in AbstractMultiPageEditorActionBarContributor. + */ + + public void setActivePage(IEditorPart part) { + if (activeEditorPart == part) + return; + + activeEditorPart = part; + + IActionBars actionBars = getActionBars(); + if (actionBars != null) { + + ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null; + + actionBars.setGlobalActionHandler( + ActionFactory.DELETE.getId(), + getAction(editor, ITextEditorActionConstants.DELETE)); + actionBars.setGlobalActionHandler( + ActionFactory.UNDO.getId(), + getAction(editor, ITextEditorActionConstants.UNDO)); + actionBars.setGlobalActionHandler( + ActionFactory.REDO.getId(), + getAction(editor, ITextEditorActionConstants.REDO)); + actionBars.setGlobalActionHandler( + ActionFactory.CUT.getId(), + getAction(editor, ITextEditorActionConstants.CUT)); + actionBars.setGlobalActionHandler( + ActionFactory.COPY.getId(), + getAction(editor, ITextEditorActionConstants.COPY)); + actionBars.setGlobalActionHandler( + ActionFactory.PASTE.getId(), + getAction(editor, ITextEditorActionConstants.PASTE)); + actionBars.setGlobalActionHandler( + ActionFactory.SELECT_ALL.getId(), + getAction(editor, ITextEditorActionConstants.SELECT_ALL)); + actionBars.setGlobalActionHandler( + ActionFactory.FIND.getId(), + getAction(editor, ITextEditorActionConstants.FIND)); + actionBars.setGlobalActionHandler( + IDEActionFactory.BOOKMARK.getId(), + getAction(editor, IDEActionFactory.BOOKMARK.getId())); + actionBars.updateActionBars(); + } + } + private void createActions() { + sampleAction = new Action() { + public void run() { + MessageDialog.openInformation(null, "Optimus", "Sample Action Executed"); + } + }; + sampleAction.setText("Sample Action"); + sampleAction.setToolTipText("Sample Action tool tip"); + sampleAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages(). + getImageDescriptor(IDE.SharedImages.IMG_OBJS_TASK_TSK)); + } + public void contributeToMenu(IMenuManager manager) { + IMenuManager menu = new MenuManager("Editor &Menu"); + manager.prependToGroup(IWorkbenchActionConstants.MB_ADDITIONS, menu); + menu.add(sampleAction); + } + public void contributeToToolBar(IToolBarManager manager) { + manager.add(new Separator()); + manager.add(sampleAction); + } +} diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/SimulateSchema.java b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/SimulateSchema.java new file mode 100644 index 0000000000000000000000000000000000000000..46e9f42c97f5a22e7e3a119d6471cb509f70ace3 --- /dev/null +++ b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/SimulateSchema.java @@ -0,0 +1,294 @@ + +/********************************************************************* +* Copyright (c) 2018 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia +* Gorka Benguria Tecnalia +* I�aki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.DECIDEh2020.optimus.editors; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.file.Paths; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.TimeUnit; + +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.Platform; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +//import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.wb.swt.SWTResourceManager; +//import org.eclipse.swt.widgets.Table; +import org.json.simple.JSONArray; + +import eu.DECIDEh2020.appManager.AppManager; +import eu.DECIDEh2020.appManager.HistoryManager; +import eu.DECIDEh2020.appManager.exceptions.AppManagerException; +import eu.DECIDEh2020.appManager.exceptions.DECIDEValidationException; + + + +//import com.fasterxml.jackson.databind.JsonNode; + +import eu.DECIDEh2020.appManager.models.AppDescription; +import eu.DECIDEh2020.appManager.models.HistoricalDeployment; +import eu.DECIDEh2020.appManager.models.HistoryEntry; +import eu.DECIDEh2020.appManager.models.SchemaElement; +import eu.DECIDEh2020.architect.plugin.editor.Page; +//import eu.decideh2020.ACSmI.client.model.Service; +import eu.decideh2020.optimus.client.api.DefaultApi; +import eu.decideh2020.optimus.client.model.ReturnedSimulation; +import eu.decideh2020.optimus.client.model.ReturnedSc; +import eu.decideh2020.optimus.client.model.ReturnedSchema; +import eu.decideh2020.optimus.client.model.Simulation; +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + +//import javax.ws.rs.core.Response; +import org.apache.cxf.jaxrs.client.JAXRSClientFactory; +import org.apache.cxf.helpers.IOUtils; +import org.apache.cxf.jaxrs.client.ClientConfiguration; +import org.apache.cxf.jaxrs.client.WebClient; +import org.eclipse.swt.widgets.Text; + + + +public class SimulateSchema extends Page { + + + + /** + * Create the composite. + * @param parent + * @param style + */ + private DefaultApi apiInstance; + private JSONArray NFRs; + private AppDescription appdescription; + private Text simText; + + public SimulateSchema(Composite parent, int style, AppDescription appdescription) { + super(parent, SWT.NONE, appdescription); + this.appdescription = appdescription; + createSimulationGUI(appdescription); + + + } + + + private void createSimulationGUI(AppDescription appd) { + // TODO Auto-generated method stub + Control[] children = this.getChildren(); + for (int i = 0 ; i < children.length; i++) { + children[i].dispose(); + } + + ScrolledComposite scrolledComposite = new ScrolledComposite(this, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); + scrolledComposite.setAlwaysShowScrollBars(true); + scrolledComposite.setBounds(10, 43, 982, 680); + scrolledComposite.setExpandHorizontal(true); + scrolledComposite.setExpandVertical(true); + + Group group = new Group(scrolledComposite, SWT.NONE); + NFRs = new JSONArray(); + + + Button btnSimulate = new Button(group, SWT.NONE); + btnSimulate.setBounds(10, 10, 75, 25); + btnSimulate.setText("Simulate"); + + Composite composite_1 = new Composite(group, SWT.NONE); + composite_1.setBounds(0, 51, 901, 596); + + Label lblNewLabel = new Label(composite_1, SWT.NONE); + lblNewLabel.setFont(SWTResourceManager.getFont("Calibri", 14, SWT.BOLD)); + lblNewLabel.setBounds(10, 10, 484, 28); + lblNewLabel.setText("Best Deployment Schema obtained by Simulation:"); + + simText = new Text(composite_1, SWT.BORDER | SWT.WRAP | SWT.MULTI); + simText.setBounds(10, 62, 1070, 507); + + + this.apiInstance = apiInstance; + simText.setText("No simulation launched"); + btnSimulate.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent event) { + + + Simulation simL = new Simulation(); + simL.setAppurl("Appurl"); + + + JacksonJsonProvider provider = new JacksonJsonProvider(); + + List providers = new ArrayList(); + providers.add(provider); + + + apiInstance = JAXRSClientFactory.create("URLoptimusserver", DefaultApi.class, providers); + + + org.apache.cxf.jaxrs.client.Client client = WebClient.client(apiInstance); + + ClientConfiguration config = WebClient.getConfig(client); + //try { + + List<ReturnedSimulation> response = new ArrayList<ReturnedSimulation>(); + response = apiInstance.createsSimulationUsingPOST(simL); + //ReturnedSimulation simToShow = new ReturnedSimulation(); + Integer id = response.get(0).getSimid(); + + //simulationText.setText("This Simulation has been launched: \n"+id); + simText.setText("This Simulation has been launched: \n"+id); + + + + String status = response.get(0).getStatus(); + while (status.equals("started")) { + //response = apiInstance.getSimulationUsingGET(id); + List<ReturnedSimulation> response2 = new ArrayList<ReturnedSimulation>(); + + response2 = apiInstance.getSimulationUsingGET(id); + status = response2.get(0).getStatus(); + } + List<ReturnedSc> response2 = new ArrayList<ReturnedSc>(); + response2 = apiInstance.getSchemaUsingGET(id); + List<SchemaElement> schemas = new ArrayList<>(); + //at the moment i consider the best of all of them, the first one. + //when integration--> increase index from 0 to 5. + for (ReturnedSc rs : response2) { + SchemaElement sc = new SchemaElement(); + sc.setCsId(rs.getCsId()); + sc.setIndex(rs.getIndex()); + sc.setMicroservices(rs.getMicros()); + schemas.add(sc); + } + + //store the schema (5 schemas later) into the history repo + try { + storeHistorySchemas(schemas,id); + } catch (AppManagerException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } catch (IOException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + + appdescription.setSchema(schemas); + //List<SchemaElement> schemas2 = new ArrayList<>(); + //schemas2 = appdescription.getSchema(); + String scText = ""; + if (!schemas.isEmpty()) + { + scText = "The best Schema found for the simulation is:\n\n"; + for (SchemaElement se : schemas) { + scText = scText+" The following microservices: \n"+se.getMicroservices().toString()+"\n\n will be deployed in the following Cloud Service: "+se.getCsId()+"\n\n"; + } + //simulationText.setText(scText); + simText.setText(scText); + } + + + //simulationText.setText("Simulation launched from btnSimulate....."); + addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + } + }); + + } + + private void storeHistorySchemas(List<SchemaElement> schemas, Integer id) throws AppManagerException, IOException { + AppManager manager = null; + String localAppDesc = System.getProperty("java.io.tmpdir"); + localAppDesc = localAppDesc+"\\"+id; + //localAppDesc = localAppDesc+"\\"+System.currentTimeMillis(); + //this is the way to manage the variables (paths only) by java, obtaining tmp system folder - end + + //System.out.println("my applocalfolder is: "+Paths.get(localAppDesc)); + try { + manager = AppManager.open(Paths.get(localAppDesc)); + + } catch (AppManagerException e) { + e.printStackTrace(); + } + HistoryManager historyManager = manager.getHistoryManager(); + List<HistoryEntry> history = new ArrayList(); + history = historyManager.getHistory(); + + HistoryEntry he = new HistoryEntry(); + List<SchemaElement> deployments = new ArrayList(); + he.setDate(LocalDateTime.now().toString()); + for (SchemaElement se : schemas) { + deployments.add(se); + } + + //he.setSchema(deployments); + //history.add(he); + //for now i write it but first i should ask the developer + //historyManager.write(history); + + } + }); + scrolledComposite.setContent(group); + scrolledComposite.setMinSize(group.computeSize(SWT.DEFAULT, SWT.DEFAULT)); + + } + @Override + public void open(AppDescription appd) { + // TODO Auto-generated method stub + this.appdescription = appd; + createSimulationGUI(appd); + + } + + private Properties loadProperties() { + Properties props = new Properties(); + + InputStream fis = null; + try { + fis = this.getClass().getClassLoader().getResourceAsStream("/optimus.server.properties"); + props.load(fis); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + return props; + } +} diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/Simulation.java b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/Simulation.java index 8ec1d5706136126306042c536ed162c9b306ccd7..0cdb9388419de9803888cef935e19b9382e74d09 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/Simulation.java +++ b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/Simulation.java @@ -1,139 +1,139 @@ - -/********************************************************************* -* Copyright (c) 2017 Tecnalia. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* Contributors (in alphabetical order): -* Gorka Benguria Tecnalia -* I�aki Etxaniz Tecnalia -* Juncal Alonso Tecnalia -* Leire Orue-Echevarria Tecnalia -* Maria Jose Lopez Tecnalia -* Marisa Escalante Tecnalia -* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu -**********************************************************************/ -package eu.DECIDEh2020.optimus.editors; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.DisposeEvent; -import org.eclipse.swt.events.DisposeListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.widgets.Composite; -//import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Button; -//import org.eclipse.swt.widgets.Table; -import org.json.simple.JSONArray; -//import org.json.simple.JSONObject; -import org.eclipse.swt.widgets.ProgressBar; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.custom.ScrolledComposite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.wb.swt.SWTResourceManager; - -public class Simulation extends Composite { - - - - /** - * Create the composite. - * @param parent - * @param style - */ - - private JSONArray NFRs; - public Simulation(Composite parent, int style) { - super(parent, SWT.NONE); - - ScrolledComposite scrolledComposite = new ScrolledComposite(this, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); - scrolledComposite.setAlwaysShowScrollBars(true); - scrolledComposite.setBounds(10, 43, 813, 453); - scrolledComposite.setExpandHorizontal(true); - scrolledComposite.setExpandVertical(true); - - Group group = new Group(scrolledComposite, SWT.NONE); - - Composite composite = new Composite(group, SWT.NONE); - composite.setBounds(10, 10, 135, 121); - - Label lblNfrEditor = new Label(composite, SWT.NONE); - lblNfrEditor.setBounds(10, 10, 55, 15); - lblNfrEditor.setText("NFR Editor"); - NFRs = new JSONArray(); - - - Button btnCost_1 = new Button(composite, SWT.CHECK); - btnCost_1.setBounds(30, 31, 93, 16); - btnCost_1.setText("Cost"); - - - Button btnAvailability_1 = new Button(composite, SWT.CHECK); - btnAvailability_1.setBounds(30, 53, 93, 16); - btnAvailability_1.setText("Availability"); - - - Button btnLocation_1 = new Button(composite, SWT.CHECK); - btnLocation_1.setBounds(30, 75, 93, 16); - btnLocation_1.setText("Location"); - - - Button btnSimulate = new Button(group, SWT.NONE); - btnSimulate.setBounds(185, 62, 75, 25); - btnSimulate.setText("Simulate"); - - Composite composite_1 = new Composite(group, SWT.NONE); - composite_1.setBounds(10, 137, 723, 259); - - Label lblNewLabel = new Label(composite_1, SWT.NONE); - lblNewLabel.setFont(SWTResourceManager.getFont("Calibri", 14, SWT.BOLD)); - lblNewLabel.setBounds(10, 10, 339, 21); - lblNewLabel.setText("ApplicationDescription JSON file:"); - StyledText simulationText = new StyledText(composite_1, SWT.BORDER); - simulationText.setBounds(10, 62, 671, 100); - simulationText.setAlwaysShowScrollBars(true); - simulationText.setJustify(true); - simulationText.setLineSpacing(3); - simulationText.setText(""); - - btnSimulate.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent event) { - NFRs.removeAll(NFRs); - if (btnCost_1.getSelection()) { - NFRs.add(btnCost_1.getText()); - } - if (btnAvailability_1.getSelection()) { - NFRs.add(btnAvailability_1.getText()); - } - if (btnLocation_1.getSelection()) { - NFRs.add(btnLocation_1.getText()); - } - - optimus.appjson.put("NFRs", NFRs); - //} - - - - ProgressBar progressBar = new ProgressBar(parent, SWT.NONE); - progressBar.setBounds(103, 18, 170, 17); - - - - progressBar.setVisible(true); - simulationText.setText(optimus.appjson.toString()); - addDisposeListener(new DisposeListener() { - public void widgetDisposed(DisposeEvent e) { - } - }); - - } - }); - scrolledComposite.setContent(group); - scrolledComposite.setMinSize(group.computeSize(SWT.DEFAULT, SWT.DEFAULT)); - - } -} + +/********************************************************************* +* Copyright (c) 2017 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Gorka Benguria Tecnalia +* I�aki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.DECIDEh2020.optimus.editors; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.DisposeEvent; +import org.eclipse.swt.events.DisposeListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.widgets.Composite; +//import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Button; +//import org.eclipse.swt.widgets.Table; +import org.json.simple.JSONArray; +//import org.json.simple.JSONObject; +import org.eclipse.swt.widgets.ProgressBar; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.wb.swt.SWTResourceManager; + +public class Simulation extends Composite { + + + + /** + * Create the composite. + * @param parent + * @param style + */ + + private JSONArray NFRs; + public Simulation(Composite parent, int style) { + super(parent, SWT.NONE); + + ScrolledComposite scrolledComposite = new ScrolledComposite(this, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); + scrolledComposite.setAlwaysShowScrollBars(true); + scrolledComposite.setBounds(10, 43, 813, 453); + scrolledComposite.setExpandHorizontal(true); + scrolledComposite.setExpandVertical(true); + + Group group = new Group(scrolledComposite, SWT.NONE); + + Composite composite = new Composite(group, SWT.NONE); + composite.setBounds(10, 10, 135, 121); + + Label lblNfrEditor = new Label(composite, SWT.NONE); + lblNfrEditor.setBounds(10, 10, 55, 15); + lblNfrEditor.setText("NFR Editor"); + NFRs = new JSONArray(); + + + Button btnCost_1 = new Button(composite, SWT.CHECK); + btnCost_1.setBounds(30, 31, 93, 16); + btnCost_1.setText("Cost"); + + + Button btnAvailability_1 = new Button(composite, SWT.CHECK); + btnAvailability_1.setBounds(30, 53, 93, 16); + btnAvailability_1.setText("Availability"); + + + Button btnLocation_1 = new Button(composite, SWT.CHECK); + btnLocation_1.setBounds(30, 75, 93, 16); + btnLocation_1.setText("Location"); + + + Button btnSimulate = new Button(group, SWT.NONE); + btnSimulate.setBounds(185, 62, 75, 25); + btnSimulate.setText("Simulate"); + + Composite composite_1 = new Composite(group, SWT.NONE); + composite_1.setBounds(10, 137, 723, 259); + + Label lblNewLabel = new Label(composite_1, SWT.NONE); + lblNewLabel.setFont(SWTResourceManager.getFont("Calibri", 14, SWT.BOLD)); + lblNewLabel.setBounds(10, 10, 339, 21); + lblNewLabel.setText("ApplicationDescription JSON file:"); + StyledText simulationText = new StyledText(composite_1, SWT.BORDER); + simulationText.setBounds(10, 62, 671, 100); + simulationText.setAlwaysShowScrollBars(true); + simulationText.setJustify(true); + simulationText.setLineSpacing(3); + simulationText.setText(""); + + btnSimulate.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent event) { + NFRs.removeAll(NFRs); + if (btnCost_1.getSelection()) { + NFRs.add(btnCost_1.getText()); + } + if (btnAvailability_1.getSelection()) { + NFRs.add(btnAvailability_1.getText()); + } + if (btnLocation_1.getSelection()) { + NFRs.add(btnLocation_1.getText()); + } + + optimus.appjson.put("NFRs", NFRs); + //} + + + + ProgressBar progressBar = new ProgressBar(parent, SWT.NONE); + progressBar.setBounds(103, 18, 170, 17); + + + + progressBar.setVisible(true); + simulationText.setText(optimus.appjson.toString()); + addDisposeListener(new DisposeListener() { + public void widgetDisposed(DisposeEvent e) { + } + }); + + } + }); + scrolledComposite.setContent(group); + scrolledComposite.setMinSize(group.computeSize(SWT.DEFAULT, SWT.DEFAULT)); + + } +} diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/SimulationPageBuilder.java b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/SimulationPageBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..370bb8ee06d7915e6f579999a5fabd684e076154 --- /dev/null +++ b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/SimulationPageBuilder.java @@ -0,0 +1,43 @@ +/********************************************************************* +* Copyright (c) 2018 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia +* Gorka Benguria Tecnalia +* I�aki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ + +package eu.DECIDEh2020.optimus.editors; + + +//import java.awt.Composite; +import org.eclipse.swt.widgets.*; + +import eu.DECIDEh2020.appManager.models.AppDescription; +import eu.DECIDEh2020.architect.plugin.editor.IPageBuilder; +import eu.DECIDEh2020.architect.plugin.editor.Page; + +public class SimulationPageBuilder implements IPageBuilder { + /** + * + */ + public SimulationPageBuilder() { + super(); + // TODO Auto-generated constructor stub + } + @Override + public Page getPage(Composite parent, int style,AppDescription appdescription) { + return new SimulateSchema(parent, style, appdescription); + } + +} diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/optimus.java b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/optimus.java index 8f7856cd03473f03570b3b4154dfec95e9f7053b..1739f14097673fd45bd06e5c671e2f2353f8e214 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/optimus.java +++ b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/editors/optimus.java @@ -1,259 +1,259 @@ - -/********************************************************************* -* Copyright (c) 2017 Tecnalia. -* -* This program and the accompanying materials are made -* available under the terms of the Eclipse Public License 2.0 -* which is available at https://www.eclipse.org/legal/epl-2.0/ -* -* SPDX-License-Identifier: EPL-2.0 -* Contributors (in alphabetical order): -* Gorka Benguria Tecnalia -* I�aki Etxaniz Tecnalia -* Juncal Alonso Tecnalia -* Leire Orue-Echevarria Tecnalia -* Maria Jose Lopez Tecnalia -* Marisa Escalante Tecnalia -* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu -**********************************************************************/ -package eu.DECIDEh2020.optimus.editors; - - -import java.io.BufferedReader; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.io.StringWriter; -import java.text.Collator; -import java.util.List; -import java.util.ArrayList; -import java.util.Collections; -import java.util.StringTokenizer; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.FontDialog; -import org.eclipse.ui.*; -import org.eclipse.ui.editors.text.TextEditor; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.MultiPageEditorPart; -import org.json.simple.JSONObject; -import org.json.simple.parser.JSONParser; -import org.json.simple.parser.ParseException; -import org.json.simple.JSONArray; -import org.json.*; -import org.eclipse.ui.ide.IDE; - -/** - * How to create a multi-page editor. - * This example has 3 pages: - * <ul> - * <li>page 0 contains a nested text editor. - * <li>page 1 shows the Classification tab - * <li>page 2 shows the Simulation tab - * </ul> - */ -public class optimus extends MultiPageEditorPart implements IResourceChangeListener{ - - /** The text editor used in page 0. */ - // Tecnalia20171024: I should find out how to assign a json editor - public static TextEditor editor; - private StyledText text; - // create a json object - public static JSONObject appjson; - public static JSONArray appmicros; - public static String newjson = ""; - public static String workingDir; - /** - * Creates a multi-page editor example. - */ - public optimus() { - super(); - - ResourcesPlugin.getWorkspace().addResourceChangeListener(this); - - appjson = new JSONObject(); - appmicros = new JSONArray(); - - } - /** - * Creates page 0 of the multi-page editor, - * which contains a text editor. - */ - void createPage0() { - try { - - editor = new TextEditor(); - int index = addPage(editor, getEditorInput()); - - setPageText(index, editor.getTitle()); - - } catch (PartInitException e) { - ErrorDialog.openError( - getSite().getShell(), - "Error creating nested text editor", - null, - e.getStatus()); - } - - } - // these lines of comments are a try of reading the JSON file and drawing the corresponding elements in classification tab - // I leave it to try again for the second version - Mar�a Jos� L�pe< - TECNALIA November 2017 - -// private JSONObject initialfile() throws IOException, ParseException { -// -// String line; -// FileReader f = new FileReader(workingDir); -// BufferedReader b = new BufferedReader(f); -// line = b.readLine(); -// JSONParser parser = new JSONParser(); -// JSONObject jsonfilecontent = (JSONObject) parser.parse(line); -// //JSONObject jsonfilecontent = new JSONObject(line); -// b.close(); -// return jsonfilecontent; -// } - /** - * Creates page 1 of the multi-page editor, - * which allows you to change the font used in page 2. - */ - // Tecnalia: The UI for the classification tool - void createPage1() { - - Composite composite = new Classification(getContainer(), SWT.NONE); - - int index = addPage(composite); - setPageText(index, "Classification"); - } - /** - * Creates page 2 of the multi-page editor, - * which shows the sorted text. - */ - void createPage2() { -// Classification tab - Composite composite = new Simulation (getContainer(), SWT.NONE); - - int index = addPage(composite); - setPageText(index, "Simulation"); - } - - - - - /** - * Creates the pages of the multi-page editor. - */ - protected void createPages() { - createPage0(); - createPage1(); - createPage2(); - } - /** - * The <code>MultiPageEditorPart</code> implementation of this - * <code>IWorkbenchPart</code> method disposes all nested editors. - * Subclasses may extend. - */ - public void dispose() { - ResourcesPlugin.getWorkspace().removeResourceChangeListener(this); - super.dispose(); - } - /** - * Saves the multi-page editor's document. - */ - public void doSave(IProgressMonitor monitor) { - getEditor(0).doSave(monitor); - - - } - /** - * Saves the multi-page editor's document as another file. - * Also updates the text for page 0's tab, and updates this multi-page editor's input - * to correspond to the nested editor's. - */ - public void doSaveAs() { - IEditorPart editor = getEditor(0); - editor.doSaveAs(); - setPageText(0, editor.getTitle()); - setInput(editor.getEditorInput()); - } - /* (non-Javadoc) - * Method declared on IEditorPart - */ - public void gotoMarker(IMarker marker) { - setActivePage(0); - IDE.gotoMarker(getEditor(0), marker); - } - /** - * The <code>MultiPageEditorExample</code> implementation of this method - * checks that the input is an instance of <code>IFileEditorInput</code>. - */ - public void init(IEditorSite site, IEditorInput editorInput) - throws PartInitException { - - if (!(editorInput instanceof IFileEditorInput)) - throw new PartInitException("Invalid Input: Must be IFileEditorInput"); - workingDir = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString(); - Integer position = editorInput.toString().indexOf("/"); - Integer length = editorInput.toString().length(); - workingDir = workingDir+editorInput.toString().substring(position,length-1); - - super.init(site, editorInput); - } - /* (non-Javadoc) - * Method declared on IEditorPart. - */ - public boolean isSaveAsAllowed() { - return true; - } - /** - * Calculates the contents of page 0. - */ - protected void pageChange(int newPageIndex) { - super.pageChange(newPageIndex); - if (newPageIndex == 1) { - } - if (newPageIndex == 2) { - } - if (newPageIndex == 0) { - // I do not know why but I do not see the new content until the button save is selected. - // to be analyzed for next version - //IEditorPart editor = getEditor(0); - //setPageText(0, editor.getTitle()); - //setInput(editor.getEditorInput()); - } - } - - /** - * Closes all project files on project close. - */ - public void resourceChanged(final IResourceChangeEvent event){ - if(event.getType() == IResourceChangeEvent.PRE_CLOSE){ - Display.getDefault().asyncExec(new Runnable(){ - public void run(){ - IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages(); - for (int i = 0; i<pages.length; i++){ - if(((FileEditorInput)editor.getEditorInput()).getFile().getProject().equals(event.getResource())){ - IEditorPart editorPart = pages[i].findEditor(editor.getEditorInput()); - pages[i].closeEditor(editorPart,true); - } - } - } - }); - } - } -} + +/********************************************************************* +* Copyright (c) 2017 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Gorka Benguria Tecnalia +* I�aki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.DECIDEh2020.optimus.editors; + + +import java.io.BufferedReader; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.StringWriter; +import java.text.Collator; +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; +import java.util.StringTokenizer; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResourceChangeEvent; +import org.eclipse.core.resources.IResourceChangeListener; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.dialogs.ErrorDialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.StyledText; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.FontDialog; +import org.eclipse.ui.*; +import org.eclipse.ui.editors.text.TextEditor; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.MultiPageEditorPart; +import org.json.simple.JSONObject; +import org.json.simple.parser.JSONParser; +import org.json.simple.parser.ParseException; +import org.json.simple.JSONArray; +import org.json.*; +import org.eclipse.ui.ide.IDE; + +/** + * How to create a multi-page editor. + * This example has 3 pages: + * <ul> + * <li>page 0 contains a nested text editor. + * <li>page 1 shows the Classification tab + * <li>page 2 shows the Simulation tab + * </ul> + */ +public class optimus extends MultiPageEditorPart implements IResourceChangeListener{ + + /** The text editor used in page 0. */ + // Tecnalia20171024: I should find out how to assign a json editor + public static TextEditor editor; + private StyledText text; + // create a json object + public static JSONObject appjson; + public static JSONArray appmicros; + public static String newjson = ""; + public static String workingDir; + /** + * Creates a multi-page editor example. + */ + public optimus() { + super(); + + ResourcesPlugin.getWorkspace().addResourceChangeListener(this); + + appjson = new JSONObject(); + appmicros = new JSONArray(); + + } + /** + * Creates page 0 of the multi-page editor, + * which contains a text editor. + */ + void createPage0() { + try { + + editor = new TextEditor(); + int index = addPage(editor, getEditorInput()); + + setPageText(index, editor.getTitle()); + + } catch (PartInitException e) { + ErrorDialog.openError( + getSite().getShell(), + "Error creating nested text editor", + null, + e.getStatus()); + } + + } + // these lines of comments are a try of reading the JSON file and drawing the corresponding elements in classification tab + // I leave it to try again for the second version - Mar�a Jos� L�pe< - TECNALIA November 2017 + +// private JSONObject initialfile() throws IOException, ParseException { +// +// String line; +// FileReader f = new FileReader(workingDir); +// BufferedReader b = new BufferedReader(f); +// line = b.readLine(); +// JSONParser parser = new JSONParser(); +// JSONObject jsonfilecontent = (JSONObject) parser.parse(line); +// //JSONObject jsonfilecontent = new JSONObject(line); +// b.close(); +// return jsonfilecontent; +// } + /** + * Creates page 1 of the multi-page editor, + * which allows you to change the font used in page 2. + */ + // Tecnalia: The UI for the classification tool + void createPage1() { + + Composite composite = new Classification(getContainer(), SWT.NONE); + + int index = addPage(composite); + setPageText(index, "Classification"); + } + /** + * Creates page 2 of the multi-page editor, + * which shows the sorted text. + */ + void createPage2() { +// Classification tab + Composite composite = new Simulation (getContainer(), SWT.NONE); + + int index = addPage(composite); + setPageText(index, "Simulation"); + } + + + + + /** + * Creates the pages of the multi-page editor. + */ + protected void createPages() { + createPage0(); + createPage1(); + createPage2(); + } + /** + * The <code>MultiPageEditorPart</code> implementation of this + * <code>IWorkbenchPart</code> method disposes all nested editors. + * Subclasses may extend. + */ + public void dispose() { + ResourcesPlugin.getWorkspace().removeResourceChangeListener(this); + super.dispose(); + } + /** + * Saves the multi-page editor's document. + */ + public void doSave(IProgressMonitor monitor) { + getEditor(0).doSave(monitor); + + + } + /** + * Saves the multi-page editor's document as another file. + * Also updates the text for page 0's tab, and updates this multi-page editor's input + * to correspond to the nested editor's. + */ + public void doSaveAs() { + IEditorPart editor = getEditor(0); + editor.doSaveAs(); + setPageText(0, editor.getTitle()); + setInput(editor.getEditorInput()); + } + /* (non-Javadoc) + * Method declared on IEditorPart + */ + public void gotoMarker(IMarker marker) { + setActivePage(0); + IDE.gotoMarker(getEditor(0), marker); + } + /** + * The <code>MultiPageEditorExample</code> implementation of this method + * checks that the input is an instance of <code>IFileEditorInput</code>. + */ + public void init(IEditorSite site, IEditorInput editorInput) + throws PartInitException { + + if (!(editorInput instanceof IFileEditorInput)) + throw new PartInitException("Invalid Input: Must be IFileEditorInput"); + workingDir = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString(); + Integer position = editorInput.toString().indexOf("/"); + Integer length = editorInput.toString().length(); + workingDir = workingDir+editorInput.toString().substring(position,length-1); + + super.init(site, editorInput); + } + /* (non-Javadoc) + * Method declared on IEditorPart. + */ + public boolean isSaveAsAllowed() { + return true; + } + /** + * Calculates the contents of page 0. + */ + protected void pageChange(int newPageIndex) { + super.pageChange(newPageIndex); + if (newPageIndex == 1) { + } + if (newPageIndex == 2) { + } + if (newPageIndex == 0) { + // I do not know why but I do not see the new content until the button save is selected. + // to be analyzed for next version + //IEditorPart editor = getEditor(0); + //setPageText(0, editor.getTitle()); + //setInput(editor.getEditorInput()); + } + } + + /** + * Closes all project files on project close. + */ + public void resourceChanged(final IResourceChangeEvent event){ + if(event.getType() == IResourceChangeEvent.PRE_CLOSE){ + Display.getDefault().asyncExec(new Runnable(){ + public void run(){ + IWorkbenchPage[] pages = getSite().getWorkbenchWindow().getPages(); + for (int i = 0; i<pages.length; i++){ + if(((FileEditorInput)editor.getEditorInput()).getFile().getProject().equals(event.getResource())){ + IEditorPart editorPart = pages[i].findEditor(editor.getEditorInput()); + pages[i].closeEditor(editorPart,true); + } + } + } + }); + } + } +} diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/wizards/OptimusWizard.java b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/wizards/OptimusWizard.java index 93e662bd4e3e49a39498cc232595a3c2deb641f0..6f1a9446404e5352a51c1753aa48916bcdd20024 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/wizards/OptimusWizard.java +++ b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/wizards/OptimusWizard.java @@ -1,152 +1,152 @@ -package eu.DECIDEh2020.optimus.wizards; - -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; -import org.eclipse.core.runtime.*; -import org.eclipse.jface.operation.*; -import java.lang.reflect.InvocationTargetException; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.CoreException; -import java.io.*; -import org.eclipse.ui.*; -import org.eclipse.ui.ide.IDE; - -/** - * This is a sample new wizard. Its role is to create a new file - * resource in the provided container. If the container resource - * (a folder or a project) is selected in the workspace - * when the wizard is opened, it will accept it as the target - * container. The wizard creates one file with the extension - * "json". If a sample multi-page editor (also available - * as a template) is registered for the same extension, it will - * be able to open it. - */ - -public class OptimusWizard extends Wizard implements INewWizard { - private OptimusWizardPage page; - private ISelection selection; - - /** - * Constructor for OptimusWizard. - */ - public OptimusWizard() { - super(); - setNeedsProgressMonitor(true); - } - - /** - * Adding the page to the wizard. - */ - @Override - public void addPages() { - page = new OptimusWizardPage(selection); - addPage(page); - } - - /** - * This method is called when 'Finish' button is pressed in - * the wizard. We will create an operation and run it - * using wizard as execution context. - */ - @Override - public boolean performFinish() { - final String containerName = page.getContainerName(); - final String fileName = page.getFileName(); - IRunnableWithProgress op = new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) throws InvocationTargetException { - try { - doFinish(containerName, fileName, monitor); - } catch (CoreException e) { - throw new InvocationTargetException(e); - } finally { - monitor.done(); - } - } - }; - try { - getContainer().run(true, false, op); - } catch (InterruptedException e) { - return false; - } catch (InvocationTargetException e) { - Throwable realException = e.getTargetException(); - MessageDialog.openError(getShell(), "Error", realException.getMessage()); - return false; - } - return true; - } - - /** - * The worker method. It will find the container, create the - * file if missing or just replace its contents, and open - * the editor on the newly created file. - */ - - private void doFinish( - String containerName, - String fileName, - IProgressMonitor monitor) - throws CoreException { - // create a sample file - monitor.beginTask("Creating " + fileName, 2); - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IResource resource = root.findMember(new Path(containerName)); - if (!resource.exists() || !(resource instanceof IContainer)) { - throwCoreException("Container \"" + containerName + "\" does not exist."); - } - IContainer container = (IContainer) resource; - final IFile file = container.getFile(new Path(fileName)); - try { - InputStream stream = openContentStream(); - if (file.exists()) { - file.setContents(stream, true, true, monitor); - } else { - file.create(stream, true, monitor); - } - stream.close(); - } catch (IOException e) { - } - monitor.worked(1); - monitor.setTaskName("Opening file for editing..."); - getShell().getDisplay().asyncExec(new Runnable() { - public void run() { - IWorkbenchPage page = - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - try { - IDE.openEditor(page, file, true); - } catch (PartInitException e) { - } - } - }); - monitor.worked(1); - } - - /** - * We will initialize file contents with a sample text. - */ - - private InputStream openContentStream() { - String contents = - "This is the initial file contents for *.json file that should be word-sorted in the Preview page of the multi-page editor"; - return new ByteArrayInputStream(contents.getBytes()); - } - - private void throwCoreException(String message) throws CoreException { - IStatus status = - new Status(IStatus.ERROR, "eu.DECIDEh2020.optimus", IStatus.OK, message, null); - throw new CoreException(status); - } - - /** - * We will accept the selection in the workbench to see if - * we can initialize from it. - * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection) - */ - @Override - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.selection = selection; - } +package eu.DECIDEh2020.optimus.wizards; + +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.ui.INewWizard; +import org.eclipse.ui.IWorkbench; +import org.eclipse.core.runtime.*; +import org.eclipse.jface.operation.*; +import java.lang.reflect.InvocationTargetException; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.core.resources.*; +import org.eclipse.core.runtime.CoreException; +import java.io.*; +import org.eclipse.ui.*; +import org.eclipse.ui.ide.IDE; + +/** + * This is a sample new wizard. Its role is to create a new file + * resource in the provided container. If the container resource + * (a folder or a project) is selected in the workspace + * when the wizard is opened, it will accept it as the target + * container. The wizard creates one file with the extension + * "json". If a sample multi-page editor (also available + * as a template) is registered for the same extension, it will + * be able to open it. + */ + +public class OptimusWizard extends Wizard implements INewWizard { + private OptimusWizardPage page; + private ISelection selection; + + /** + * Constructor for OptimusWizard. + */ + public OptimusWizard() { + super(); + setNeedsProgressMonitor(true); + } + + /** + * Adding the page to the wizard. + */ + @Override + public void addPages() { + page = new OptimusWizardPage(selection); + addPage(page); + } + + /** + * This method is called when 'Finish' button is pressed in + * the wizard. We will create an operation and run it + * using wizard as execution context. + */ + @Override + public boolean performFinish() { + final String containerName = page.getContainerName(); + final String fileName = page.getFileName(); + IRunnableWithProgress op = new IRunnableWithProgress() { + public void run(IProgressMonitor monitor) throws InvocationTargetException { + try { + doFinish(containerName, fileName, monitor); + } catch (CoreException e) { + throw new InvocationTargetException(e); + } finally { + monitor.done(); + } + } + }; + try { + getContainer().run(true, false, op); + } catch (InterruptedException e) { + return false; + } catch (InvocationTargetException e) { + Throwable realException = e.getTargetException(); + MessageDialog.openError(getShell(), "Error", realException.getMessage()); + return false; + } + return true; + } + + /** + * The worker method. It will find the container, create the + * file if missing or just replace its contents, and open + * the editor on the newly created file. + */ + + private void doFinish( + String containerName, + String fileName, + IProgressMonitor monitor) + throws CoreException { + // create a sample file + monitor.beginTask("Creating " + fileName, 2); + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + IResource resource = root.findMember(new Path(containerName)); + if (!resource.exists() || !(resource instanceof IContainer)) { + throwCoreException("Container \"" + containerName + "\" does not exist."); + } + IContainer container = (IContainer) resource; + final IFile file = container.getFile(new Path(fileName)); + try { + InputStream stream = openContentStream(); + if (file.exists()) { + file.setContents(stream, true, true, monitor); + } else { + file.create(stream, true, monitor); + } + stream.close(); + } catch (IOException e) { + } + monitor.worked(1); + monitor.setTaskName("Opening file for editing..."); + getShell().getDisplay().asyncExec(new Runnable() { + public void run() { + IWorkbenchPage page = + PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + try { + IDE.openEditor(page, file, true); + } catch (PartInitException e) { + } + } + }); + monitor.worked(1); + } + + /** + * We will initialize file contents with a sample text. + */ + + private InputStream openContentStream() { + String contents = + "This is the initial file contents for *.json file that should be word-sorted in the Preview page of the multi-page editor"; + return new ByteArrayInputStream(contents.getBytes()); + } + + private void throwCoreException(String message) throws CoreException { + IStatus status = + new Status(IStatus.ERROR, "eu.DECIDEh2020.optimus", IStatus.OK, message, null); + throw new CoreException(status); + } + + /** + * We will accept the selection in the workbench to see if + * we can initialize from it. + * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection) + */ + @Override + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.selection = selection; + } } \ No newline at end of file diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/wizards/OptimusWizardPage.java b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/wizards/OptimusWizardPage.java index c969e5a62d231b89b69e465211f3852d01a1324d..0c0c8eeeb15f685f8f976c3342ddf0a55e5f26f5 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/wizards/OptimusWizardPage.java +++ b/OPTIMUS/eu.DECIDEh2020.optimus/src/eu/DECIDEh2020/optimus/wizards/OptimusWizardPage.java @@ -1,184 +1,184 @@ -package eu.DECIDEh2020.optimus.wizards; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.ContainerSelectionDialog; - -/** - * The "New" wizard page allows setting the container for the new file as well - * as the file name. The page will only accept file name without the extension - * OR with the extension that matches the expected one (json). - */ - -public class OptimusWizardPage extends WizardPage { - private Text containerText; - - private Text fileText; - - private ISelection selection; - - /** - * Constructor for SampleNewWizardPage. - * - * @param pageName - */ - public OptimusWizardPage(ISelection selection) { - super("wizardPage"); - setTitle("Multi-page Editor File"); - setDescription("This wizard creates a new file with *.json extension that can be opened by a multi-page editor."); - this.selection = selection; - } - - @Override - public void createControl(Composite parent) { - Composite container = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - container.setLayout(layout); - layout.numColumns = 3; - layout.verticalSpacing = 9; - Label label = new Label(container, SWT.NULL); - label.setText("&Container:"); - - containerText = new Text(container, SWT.BORDER | SWT.SINGLE); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - containerText.setLayoutData(gd); - containerText.addModifyListener(new ModifyListener() { - @Override - public void modifyText(ModifyEvent e) { - dialogChanged(); - } - }); - - Button button = new Button(container, SWT.PUSH); - button.setText("Browse..."); - button.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handleBrowse(); - } - }); - label = new Label(container, SWT.NULL); - label.setText("&File name:"); - - fileText = new Text(container, SWT.BORDER | SWT.SINGLE); - gd = new GridData(GridData.FILL_HORIZONTAL); - fileText.setLayoutData(gd); - fileText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - dialogChanged(); - } - }); - initialize(); - dialogChanged(); - setControl(container); - } - - /** - * Tests if the current workbench selection is a suitable container to use. - */ - - private void initialize() { - if (selection != null && selection.isEmpty() == false - && selection instanceof IStructuredSelection) { - IStructuredSelection ssel = (IStructuredSelection) selection; - if (ssel.size() > 1) - return; - Object obj = ssel.getFirstElement(); - if (obj instanceof IResource) { - IContainer container; - if (obj instanceof IContainer) - container = (IContainer) obj; - else - container = ((IResource) obj).getParent(); - containerText.setText(container.getFullPath().toString()); - } - } - fileText.setText("new_file.json"); - } - - /** - * Uses the standard container selection dialog to choose the new value for - * the container field. - */ - - private void handleBrowse() { - ContainerSelectionDialog dialog = new ContainerSelectionDialog( - getShell(), ResourcesPlugin.getWorkspace().getRoot(), false, - "Select new file container"); - if (dialog.open() == ContainerSelectionDialog.OK) { - Object[] result = dialog.getResult(); - if (result.length == 1) { - containerText.setText(((Path) result[0]).toString()); - } - } - } - - /** - * Ensures that both text fields are set. - */ - - private void dialogChanged() { - IResource container = ResourcesPlugin.getWorkspace().getRoot() - .findMember(new Path(getContainerName())); - String fileName = getFileName(); - - if (getContainerName().length() == 0) { - updateStatus("File container must be specified"); - return; - } - if (container == null - || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) { - updateStatus("File container must exist"); - return; - } - if (!container.isAccessible()) { - updateStatus("Project must be writable"); - return; - } - if (fileName.length() == 0) { - updateStatus("File name must be specified"); - return; - } - if (fileName.replace('\\', '/').indexOf('/', 1) > 0) { - updateStatus("File name must be valid"); - return; - } - int dotLoc = fileName.lastIndexOf('.'); - if (dotLoc != -1) { - String ext = fileName.substring(dotLoc + 1); - if (ext.equalsIgnoreCase("json") == false) { - updateStatus("File extension must be \"json\""); - return; - } - } - updateStatus(null); - } - - private void updateStatus(String message) { - setErrorMessage(message); - setPageComplete(message == null); - } - - public String getContainerName() { - return containerText.getText(); - } - - public String getFileName() { - return fileText.getText(); - } +package eu.DECIDEh2020.optimus.wizards; + +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.Path; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.dialogs.ContainerSelectionDialog; + +/** + * The "New" wizard page allows setting the container for the new file as well + * as the file name. The page will only accept file name without the extension + * OR with the extension that matches the expected one (json). + */ + +public class OptimusWizardPage extends WizardPage { + private Text containerText; + + private Text fileText; + + private ISelection selection; + + /** + * Constructor for SampleNewWizardPage. + * + * @param pageName + */ + public OptimusWizardPage(ISelection selection) { + super("wizardPage"); + setTitle("Multi-page Editor File"); + setDescription("This wizard creates a new file with *.json extension that can be opened by a multi-page editor."); + this.selection = selection; + } + + @Override + public void createControl(Composite parent) { + Composite container = new Composite(parent, SWT.NULL); + GridLayout layout = new GridLayout(); + container.setLayout(layout); + layout.numColumns = 3; + layout.verticalSpacing = 9; + Label label = new Label(container, SWT.NULL); + label.setText("&Container:"); + + containerText = new Text(container, SWT.BORDER | SWT.SINGLE); + GridData gd = new GridData(GridData.FILL_HORIZONTAL); + containerText.setLayoutData(gd); + containerText.addModifyListener(new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + dialogChanged(); + } + }); + + Button button = new Button(container, SWT.PUSH); + button.setText("Browse..."); + button.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + handleBrowse(); + } + }); + label = new Label(container, SWT.NULL); + label.setText("&File name:"); + + fileText = new Text(container, SWT.BORDER | SWT.SINGLE); + gd = new GridData(GridData.FILL_HORIZONTAL); + fileText.setLayoutData(gd); + fileText.addModifyListener(new ModifyListener() { + public void modifyText(ModifyEvent e) { + dialogChanged(); + } + }); + initialize(); + dialogChanged(); + setControl(container); + } + + /** + * Tests if the current workbench selection is a suitable container to use. + */ + + private void initialize() { + if (selection != null && selection.isEmpty() == false + && selection instanceof IStructuredSelection) { + IStructuredSelection ssel = (IStructuredSelection) selection; + if (ssel.size() > 1) + return; + Object obj = ssel.getFirstElement(); + if (obj instanceof IResource) { + IContainer container; + if (obj instanceof IContainer) + container = (IContainer) obj; + else + container = ((IResource) obj).getParent(); + containerText.setText(container.getFullPath().toString()); + } + } + fileText.setText("new_file.json"); + } + + /** + * Uses the standard container selection dialog to choose the new value for + * the container field. + */ + + private void handleBrowse() { + ContainerSelectionDialog dialog = new ContainerSelectionDialog( + getShell(), ResourcesPlugin.getWorkspace().getRoot(), false, + "Select new file container"); + if (dialog.open() == ContainerSelectionDialog.OK) { + Object[] result = dialog.getResult(); + if (result.length == 1) { + containerText.setText(((Path) result[0]).toString()); + } + } + } + + /** + * Ensures that both text fields are set. + */ + + private void dialogChanged() { + IResource container = ResourcesPlugin.getWorkspace().getRoot() + .findMember(new Path(getContainerName())); + String fileName = getFileName(); + + if (getContainerName().length() == 0) { + updateStatus("File container must be specified"); + return; + } + if (container == null + || (container.getType() & (IResource.PROJECT | IResource.FOLDER)) == 0) { + updateStatus("File container must exist"); + return; + } + if (!container.isAccessible()) { + updateStatus("Project must be writable"); + return; + } + if (fileName.length() == 0) { + updateStatus("File name must be specified"); + return; + } + if (fileName.replace('\\', '/').indexOf('/', 1) > 0) { + updateStatus("File name must be valid"); + return; + } + int dotLoc = fileName.lastIndexOf('.'); + if (dotLoc != -1) { + String ext = fileName.substring(dotLoc + 1); + if (ext.equalsIgnoreCase("json") == false) { + updateStatus("File extension must be \"json\""); + return; + } + } + updateStatus(null); + } + + private void updateStatus(String message) { + setErrorMessage(message); + setPageComplete(message == null); + } + + public String getContainerName() { + return containerText.getText(); + } + + public String getFileName() { + return fileText.getText(); + } } \ No newline at end of file diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/src/org/eclipse/wb/swt/SWTResourceManager.java b/OPTIMUS/eu.DECIDEh2020.optimus/src/org/eclipse/wb/swt/SWTResourceManager.java index fdec674d4a83c0084462caf7f2799b8c976e95d9..d8a285807adcefed53ca8b9d3af0f7d9881e1a13 100644 --- a/OPTIMUS/eu.DECIDEh2020.optimus/src/org/eclipse/wb/swt/SWTResourceManager.java +++ b/OPTIMUS/eu.DECIDEh2020.optimus/src/org/eclipse/wb/swt/SWTResourceManager.java @@ -1,447 +1,447 @@ -/******************************************************************************* - * Copyright (c) 2011 Google, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Google, Inc. - initial API and implementation - *******************************************************************************/ -package org.eclipse.wb.swt; - -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Cursor; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.graphics.ImageData; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Display; - -/** - * Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc. - * <p> - * !!! IMPORTANT !!! Application code must explicitly invoke the <code>dispose()</code> method to release the - * operating system resources managed by cached objects when those objects and OS resources are no longer - * needed (e.g. on application shutdown) - * <p> - * This class may be freely distributed as part of any application or plugin. - * <p> - * @author scheglov_ke - * @author Dan Rubel - */ -public class SWTResourceManager { - //////////////////////////////////////////////////////////////////////////// - // - // Color - // - //////////////////////////////////////////////////////////////////////////// - private static Map<RGB, Color> m_colorMap = new HashMap<RGB, Color>(); - /** - * Returns the system {@link Color} matching the specific ID. - * - * @param systemColorID - * the ID value for the color - * @return the system {@link Color} matching the specific ID - */ - public static Color getColor(int systemColorID) { - Display display = Display.getCurrent(); - return display.getSystemColor(systemColorID); - } - /** - * Returns a {@link Color} given its red, green and blue component values. - * - * @param r - * the red component of the color - * @param g - * the green component of the color - * @param b - * the blue component of the color - * @return the {@link Color} matching the given red, green and blue component values - */ - public static Color getColor(int r, int g, int b) { - return getColor(new RGB(r, g, b)); - } - /** - * Returns a {@link Color} given its RGB value. - * - * @param rgb - * the {@link RGB} value of the color - * @return the {@link Color} matching the RGB value - */ - public static Color getColor(RGB rgb) { - Color color = m_colorMap.get(rgb); - if (color == null) { - Display display = Display.getCurrent(); - color = new Color(display, rgb); - m_colorMap.put(rgb, color); - } - return color; - } - /** - * Dispose of all the cached {@link Color}'s. - */ - public static void disposeColors() { - for (Color color : m_colorMap.values()) { - color.dispose(); - } - m_colorMap.clear(); - } - //////////////////////////////////////////////////////////////////////////// - // - // Image - // - //////////////////////////////////////////////////////////////////////////// - /** - * Maps image paths to images. - */ - private static Map<String, Image> m_imageMap = new HashMap<String, Image>(); - /** - * Returns an {@link Image} encoded by the specified {@link InputStream}. - * - * @param stream - * the {@link InputStream} encoding the image data - * @return the {@link Image} encoded by the specified input stream - */ - protected static Image getImage(InputStream stream) throws IOException { - try { - Display display = Display.getCurrent(); - ImageData data = new ImageData(stream); - if (data.transparentPixel > 0) { - return new Image(display, data, data.getTransparencyMask()); - } - return new Image(display, data); - } finally { - stream.close(); - } - } - /** - * Returns an {@link Image} stored in the file at the specified path. - * - * @param path - * the path to the image file - * @return the {@link Image} stored in the file at the specified path - */ - public static Image getImage(String path) { - Image image = m_imageMap.get(path); - if (image == null) { - try { - image = getImage(new FileInputStream(path)); - m_imageMap.put(path, image); - } catch (Exception e) { - image = getMissingImage(); - m_imageMap.put(path, image); - } - } - return image; - } - /** - * Returns an {@link Image} stored in the file at the specified path relative to the specified class. - * - * @param clazz - * the {@link Class} relative to which to find the image - * @param path - * the path to the image file, if starts with <code>'/'</code> - * @return the {@link Image} stored in the file at the specified path - */ - public static Image getImage(Class<?> clazz, String path) { - String key = clazz.getName() + '|' + path; - Image image = m_imageMap.get(key); - if (image == null) { - try { - image = getImage(clazz.getResourceAsStream(path)); - m_imageMap.put(key, image); - } catch (Exception e) { - image = getMissingImage(); - m_imageMap.put(key, image); - } - } - return image; - } - private static final int MISSING_IMAGE_SIZE = 10; - /** - * @return the small {@link Image} that can be used as placeholder for missing image. - */ - private static Image getMissingImage() { - Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); - // - GC gc = new GC(image); - gc.setBackground(getColor(SWT.COLOR_RED)); - gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); - gc.dispose(); - // - return image; - } - /** - * Style constant for placing decorator image in top left corner of base image. - */ - public static final int TOP_LEFT = 1; - /** - * Style constant for placing decorator image in top right corner of base image. - */ - public static final int TOP_RIGHT = 2; - /** - * Style constant for placing decorator image in bottom left corner of base image. - */ - public static final int BOTTOM_LEFT = 3; - /** - * Style constant for placing decorator image in bottom right corner of base image. - */ - public static final int BOTTOM_RIGHT = 4; - /** - * Internal value. - */ - protected static final int LAST_CORNER_KEY = 5; - /** - * Maps images to decorated images. - */ - @SuppressWarnings("unchecked") - private static Map<Image, Map<Image, Image>>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY]; - /** - * Returns an {@link Image} composed of a base image decorated by another image. - * - * @param baseImage - * the base {@link Image} that should be decorated - * @param decorator - * the {@link Image} to decorate the base image - * @return {@link Image} The resulting decorated image - */ - public static Image decorateImage(Image baseImage, Image decorator) { - return decorateImage(baseImage, decorator, BOTTOM_RIGHT); - } - /** - * Returns an {@link Image} composed of a base image decorated by another image. - * - * @param baseImage - * the base {@link Image} that should be decorated - * @param decorator - * the {@link Image} to decorate the base image - * @param corner - * the corner to place decorator image - * @return the resulting decorated {@link Image} - */ - public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) { - if (corner <= 0 || corner >= LAST_CORNER_KEY) { - throw new IllegalArgumentException("Wrong decorate corner"); - } - Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[corner]; - if (cornerDecoratedImageMap == null) { - cornerDecoratedImageMap = new HashMap<Image, Map<Image, Image>>(); - m_decoratedImageMap[corner] = cornerDecoratedImageMap; - } - Map<Image, Image> decoratedMap = cornerDecoratedImageMap.get(baseImage); - if (decoratedMap == null) { - decoratedMap = new HashMap<Image, Image>(); - cornerDecoratedImageMap.put(baseImage, decoratedMap); - } - // - Image result = decoratedMap.get(decorator); - if (result == null) { - Rectangle bib = baseImage.getBounds(); - Rectangle dib = decorator.getBounds(); - // - result = new Image(Display.getCurrent(), bib.width, bib.height); - // - GC gc = new GC(result); - gc.drawImage(baseImage, 0, 0); - if (corner == TOP_LEFT) { - gc.drawImage(decorator, 0, 0); - } else if (corner == TOP_RIGHT) { - gc.drawImage(decorator, bib.width - dib.width, 0); - } else if (corner == BOTTOM_LEFT) { - gc.drawImage(decorator, 0, bib.height - dib.height); - } else if (corner == BOTTOM_RIGHT) { - gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height); - } - gc.dispose(); - // - decoratedMap.put(decorator, result); - } - return result; - } - /** - * Dispose all of the cached {@link Image}'s. - */ - public static void disposeImages() { - // dispose loaded images - { - for (Image image : m_imageMap.values()) { - image.dispose(); - } - m_imageMap.clear(); - } - // dispose decorated images - for (int i = 0; i < m_decoratedImageMap.length; i++) { - Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i]; - if (cornerDecoratedImageMap != null) { - for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) { - for (Image image : decoratedMap.values()) { - image.dispose(); - } - decoratedMap.clear(); - } - cornerDecoratedImageMap.clear(); - } - } - } - //////////////////////////////////////////////////////////////////////////// - // - // Font - // - //////////////////////////////////////////////////////////////////////////// - /** - * Maps font names to fonts. - */ - private static Map<String, Font> m_fontMap = new HashMap<String, Font>(); - /** - * Maps fonts to their bold versions. - */ - private static Map<Font, Font> m_fontToBoldFontMap = new HashMap<Font, Font>(); - /** - * Returns a {@link Font} based on its name, height and style. - * - * @param name - * the name of the font - * @param height - * the height of the font - * @param style - * the style of the font - * @return {@link Font} The font matching the name, height and style - */ - public static Font getFont(String name, int height, int style) { - return getFont(name, height, style, false, false); - } - /** - * Returns a {@link Font} based on its name, height and style. Windows-specific strikeout and underline - * flags are also supported. - * - * @param name - * the name of the font - * @param size - * the size of the font - * @param style - * the style of the font - * @param strikeout - * the strikeout flag (warning: Windows only) - * @param underline - * the underline flag (warning: Windows only) - * @return {@link Font} The font matching the name, height, style, strikeout and underline - */ - public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) { - String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline; - Font font = m_fontMap.get(fontName); - if (font == null) { - FontData fontData = new FontData(name, size, style); - if (strikeout || underline) { - try { - Class<?> logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$ - Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$ - if (logFont != null && logFontClass != null) { - if (strikeout) { - logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ - } - if (underline) { - logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ - } - } - } catch (Throwable e) { - System.err.println("Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - font = new Font(Display.getCurrent(), fontData); - m_fontMap.put(fontName, font); - } - return font; - } - /** - * Returns a bold version of the given {@link Font}. - * - * @param baseFont - * the {@link Font} for which a bold version is desired - * @return the bold version of the given {@link Font} - */ - public static Font getBoldFont(Font baseFont) { - Font font = m_fontToBoldFontMap.get(baseFont); - if (font == null) { - FontData fontDatas[] = baseFont.getFontData(); - FontData data = fontDatas[0]; - font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD); - m_fontToBoldFontMap.put(baseFont, font); - } - return font; - } - /** - * Dispose all of the cached {@link Font}'s. - */ - public static void disposeFonts() { - // clear fonts - for (Font font : m_fontMap.values()) { - font.dispose(); - } - m_fontMap.clear(); - // clear bold fonts - for (Font font : m_fontToBoldFontMap.values()) { - font.dispose(); - } - m_fontToBoldFontMap.clear(); - } - //////////////////////////////////////////////////////////////////////////// - // - // Cursor - // - //////////////////////////////////////////////////////////////////////////// - /** - * Maps IDs to cursors. - */ - private static Map<Integer, Cursor> m_idToCursorMap = new HashMap<Integer, Cursor>(); - /** - * Returns the system cursor matching the specific ID. - * - * @param id - * int The ID value for the cursor - * @return Cursor The system cursor matching the specific ID - */ - public static Cursor getCursor(int id) { - Integer key = Integer.valueOf(id); - Cursor cursor = m_idToCursorMap.get(key); - if (cursor == null) { - cursor = new Cursor(Display.getDefault(), id); - m_idToCursorMap.put(key, cursor); - } - return cursor; - } - /** - * Dispose all of the cached cursors. - */ - public static void disposeCursors() { - for (Cursor cursor : m_idToCursorMap.values()) { - cursor.dispose(); - } - m_idToCursorMap.clear(); - } - //////////////////////////////////////////////////////////////////////////// - // - // General - // - //////////////////////////////////////////////////////////////////////////// - /** - * Dispose of cached objects and their underlying OS resources. This should only be called when the cached - * objects are no longer needed (e.g. on application shutdown). - */ - public static void dispose() { - disposeColors(); - disposeImages(); - disposeFonts(); - disposeCursors(); - } +/******************************************************************************* + * Copyright (c) 2011 Google, Inc. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Google, Inc. - initial API and implementation + *******************************************************************************/ +package org.eclipse.wb.swt; + +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Cursor; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.FontData; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.widgets.Display; + +/** + * Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc. + * <p> + * !!! IMPORTANT !!! Application code must explicitly invoke the <code>dispose()</code> method to release the + * operating system resources managed by cached objects when those objects and OS resources are no longer + * needed (e.g. on application shutdown) + * <p> + * This class may be freely distributed as part of any application or plugin. + * <p> + * @author scheglov_ke + * @author Dan Rubel + */ +public class SWTResourceManager { + //////////////////////////////////////////////////////////////////////////// + // + // Color + // + //////////////////////////////////////////////////////////////////////////// + private static Map<RGB, Color> m_colorMap = new HashMap<RGB, Color>(); + /** + * Returns the system {@link Color} matching the specific ID. + * + * @param systemColorID + * the ID value for the color + * @return the system {@link Color} matching the specific ID + */ + public static Color getColor(int systemColorID) { + Display display = Display.getCurrent(); + return display.getSystemColor(systemColorID); + } + /** + * Returns a {@link Color} given its red, green and blue component values. + * + * @param r + * the red component of the color + * @param g + * the green component of the color + * @param b + * the blue component of the color + * @return the {@link Color} matching the given red, green and blue component values + */ + public static Color getColor(int r, int g, int b) { + return getColor(new RGB(r, g, b)); + } + /** + * Returns a {@link Color} given its RGB value. + * + * @param rgb + * the {@link RGB} value of the color + * @return the {@link Color} matching the RGB value + */ + public static Color getColor(RGB rgb) { + Color color = m_colorMap.get(rgb); + if (color == null) { + Display display = Display.getCurrent(); + color = new Color(display, rgb); + m_colorMap.put(rgb, color); + } + return color; + } + /** + * Dispose of all the cached {@link Color}'s. + */ + public static void disposeColors() { + for (Color color : m_colorMap.values()) { + color.dispose(); + } + m_colorMap.clear(); + } + //////////////////////////////////////////////////////////////////////////// + // + // Image + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps image paths to images. + */ + private static Map<String, Image> m_imageMap = new HashMap<String, Image>(); + /** + * Returns an {@link Image} encoded by the specified {@link InputStream}. + * + * @param stream + * the {@link InputStream} encoding the image data + * @return the {@link Image} encoded by the specified input stream + */ + protected static Image getImage(InputStream stream) throws IOException { + try { + Display display = Display.getCurrent(); + ImageData data = new ImageData(stream); + if (data.transparentPixel > 0) { + return new Image(display, data, data.getTransparencyMask()); + } + return new Image(display, data); + } finally { + stream.close(); + } + } + /** + * Returns an {@link Image} stored in the file at the specified path. + * + * @param path + * the path to the image file + * @return the {@link Image} stored in the file at the specified path + */ + public static Image getImage(String path) { + Image image = m_imageMap.get(path); + if (image == null) { + try { + image = getImage(new FileInputStream(path)); + m_imageMap.put(path, image); + } catch (Exception e) { + image = getMissingImage(); + m_imageMap.put(path, image); + } + } + return image; + } + /** + * Returns an {@link Image} stored in the file at the specified path relative to the specified class. + * + * @param clazz + * the {@link Class} relative to which to find the image + * @param path + * the path to the image file, if starts with <code>'/'</code> + * @return the {@link Image} stored in the file at the specified path + */ + public static Image getImage(Class<?> clazz, String path) { + String key = clazz.getName() + '|' + path; + Image image = m_imageMap.get(key); + if (image == null) { + try { + image = getImage(clazz.getResourceAsStream(path)); + m_imageMap.put(key, image); + } catch (Exception e) { + image = getMissingImage(); + m_imageMap.put(key, image); + } + } + return image; + } + private static final int MISSING_IMAGE_SIZE = 10; + /** + * @return the small {@link Image} that can be used as placeholder for missing image. + */ + private static Image getMissingImage() { + Image image = new Image(Display.getCurrent(), MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); + // + GC gc = new GC(image); + gc.setBackground(getColor(SWT.COLOR_RED)); + gc.fillRectangle(0, 0, MISSING_IMAGE_SIZE, MISSING_IMAGE_SIZE); + gc.dispose(); + // + return image; + } + /** + * Style constant for placing decorator image in top left corner of base image. + */ + public static final int TOP_LEFT = 1; + /** + * Style constant for placing decorator image in top right corner of base image. + */ + public static final int TOP_RIGHT = 2; + /** + * Style constant for placing decorator image in bottom left corner of base image. + */ + public static final int BOTTOM_LEFT = 3; + /** + * Style constant for placing decorator image in bottom right corner of base image. + */ + public static final int BOTTOM_RIGHT = 4; + /** + * Internal value. + */ + protected static final int LAST_CORNER_KEY = 5; + /** + * Maps images to decorated images. + */ + @SuppressWarnings("unchecked") + private static Map<Image, Map<Image, Image>>[] m_decoratedImageMap = new Map[LAST_CORNER_KEY]; + /** + * Returns an {@link Image} composed of a base image decorated by another image. + * + * @param baseImage + * the base {@link Image} that should be decorated + * @param decorator + * the {@link Image} to decorate the base image + * @return {@link Image} The resulting decorated image + */ + public static Image decorateImage(Image baseImage, Image decorator) { + return decorateImage(baseImage, decorator, BOTTOM_RIGHT); + } + /** + * Returns an {@link Image} composed of a base image decorated by another image. + * + * @param baseImage + * the base {@link Image} that should be decorated + * @param decorator + * the {@link Image} to decorate the base image + * @param corner + * the corner to place decorator image + * @return the resulting decorated {@link Image} + */ + public static Image decorateImage(final Image baseImage, final Image decorator, final int corner) { + if (corner <= 0 || corner >= LAST_CORNER_KEY) { + throw new IllegalArgumentException("Wrong decorate corner"); + } + Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[corner]; + if (cornerDecoratedImageMap == null) { + cornerDecoratedImageMap = new HashMap<Image, Map<Image, Image>>(); + m_decoratedImageMap[corner] = cornerDecoratedImageMap; + } + Map<Image, Image> decoratedMap = cornerDecoratedImageMap.get(baseImage); + if (decoratedMap == null) { + decoratedMap = new HashMap<Image, Image>(); + cornerDecoratedImageMap.put(baseImage, decoratedMap); + } + // + Image result = decoratedMap.get(decorator); + if (result == null) { + Rectangle bib = baseImage.getBounds(); + Rectangle dib = decorator.getBounds(); + // + result = new Image(Display.getCurrent(), bib.width, bib.height); + // + GC gc = new GC(result); + gc.drawImage(baseImage, 0, 0); + if (corner == TOP_LEFT) { + gc.drawImage(decorator, 0, 0); + } else if (corner == TOP_RIGHT) { + gc.drawImage(decorator, bib.width - dib.width, 0); + } else if (corner == BOTTOM_LEFT) { + gc.drawImage(decorator, 0, bib.height - dib.height); + } else if (corner == BOTTOM_RIGHT) { + gc.drawImage(decorator, bib.width - dib.width, bib.height - dib.height); + } + gc.dispose(); + // + decoratedMap.put(decorator, result); + } + return result; + } + /** + * Dispose all of the cached {@link Image}'s. + */ + public static void disposeImages() { + // dispose loaded images + { + for (Image image : m_imageMap.values()) { + image.dispose(); + } + m_imageMap.clear(); + } + // dispose decorated images + for (int i = 0; i < m_decoratedImageMap.length; i++) { + Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedImageMap[i]; + if (cornerDecoratedImageMap != null) { + for (Map<Image, Image> decoratedMap : cornerDecoratedImageMap.values()) { + for (Image image : decoratedMap.values()) { + image.dispose(); + } + decoratedMap.clear(); + } + cornerDecoratedImageMap.clear(); + } + } + } + //////////////////////////////////////////////////////////////////////////// + // + // Font + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps font names to fonts. + */ + private static Map<String, Font> m_fontMap = new HashMap<String, Font>(); + /** + * Maps fonts to their bold versions. + */ + private static Map<Font, Font> m_fontToBoldFontMap = new HashMap<Font, Font>(); + /** + * Returns a {@link Font} based on its name, height and style. + * + * @param name + * the name of the font + * @param height + * the height of the font + * @param style + * the style of the font + * @return {@link Font} The font matching the name, height and style + */ + public static Font getFont(String name, int height, int style) { + return getFont(name, height, style, false, false); + } + /** + * Returns a {@link Font} based on its name, height and style. Windows-specific strikeout and underline + * flags are also supported. + * + * @param name + * the name of the font + * @param size + * the size of the font + * @param style + * the style of the font + * @param strikeout + * the strikeout flag (warning: Windows only) + * @param underline + * the underline flag (warning: Windows only) + * @return {@link Font} The font matching the name, height, style, strikeout and underline + */ + public static Font getFont(String name, int size, int style, boolean strikeout, boolean underline) { + String fontName = name + '|' + size + '|' + style + '|' + strikeout + '|' + underline; + Font font = m_fontMap.get(fontName); + if (font == null) { + FontData fontData = new FontData(name, size, style); + if (strikeout || underline) { + try { + Class<?> logFontClass = Class.forName("org.eclipse.swt.internal.win32.LOGFONT"); //$NON-NLS-1$ + Object logFont = FontData.class.getField("data").get(fontData); //$NON-NLS-1$ + if (logFont != null && logFontClass != null) { + if (strikeout) { + logFontClass.getField("lfStrikeOut").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ + } + if (underline) { + logFontClass.getField("lfUnderline").set(logFont, Byte.valueOf((byte) 1)); //$NON-NLS-1$ + } + } + } catch (Throwable e) { + System.err.println("Unable to set underline or strikeout" + " (probably on a non-Windows platform). " + e); //$NON-NLS-1$ //$NON-NLS-2$ + } + } + font = new Font(Display.getCurrent(), fontData); + m_fontMap.put(fontName, font); + } + return font; + } + /** + * Returns a bold version of the given {@link Font}. + * + * @param baseFont + * the {@link Font} for which a bold version is desired + * @return the bold version of the given {@link Font} + */ + public static Font getBoldFont(Font baseFont) { + Font font = m_fontToBoldFontMap.get(baseFont); + if (font == null) { + FontData fontDatas[] = baseFont.getFontData(); + FontData data = fontDatas[0]; + font = new Font(Display.getCurrent(), data.getName(), data.getHeight(), SWT.BOLD); + m_fontToBoldFontMap.put(baseFont, font); + } + return font; + } + /** + * Dispose all of the cached {@link Font}'s. + */ + public static void disposeFonts() { + // clear fonts + for (Font font : m_fontMap.values()) { + font.dispose(); + } + m_fontMap.clear(); + // clear bold fonts + for (Font font : m_fontToBoldFontMap.values()) { + font.dispose(); + } + m_fontToBoldFontMap.clear(); + } + //////////////////////////////////////////////////////////////////////////// + // + // Cursor + // + //////////////////////////////////////////////////////////////////////////// + /** + * Maps IDs to cursors. + */ + private static Map<Integer, Cursor> m_idToCursorMap = new HashMap<Integer, Cursor>(); + /** + * Returns the system cursor matching the specific ID. + * + * @param id + * int The ID value for the cursor + * @return Cursor The system cursor matching the specific ID + */ + public static Cursor getCursor(int id) { + Integer key = Integer.valueOf(id); + Cursor cursor = m_idToCursorMap.get(key); + if (cursor == null) { + cursor = new Cursor(Display.getDefault(), id); + m_idToCursorMap.put(key, cursor); + } + return cursor; + } + /** + * Dispose all of the cached cursors. + */ + public static void disposeCursors() { + for (Cursor cursor : m_idToCursorMap.values()) { + cursor.dispose(); + } + m_idToCursorMap.clear(); + } + //////////////////////////////////////////////////////////////////////////// + // + // General + // + //////////////////////////////////////////////////////////////////////////// + /** + * Dispose of cached objects and their underlying OS resources. This should only be called when the cached + * objects are no longer needed (e.g. on application shutdown). + */ + public static void dispose() { + disposeColors(); + disposeImages(); + disposeFonts(); + disposeCursors(); + } } \ No newline at end of file diff --git a/OPTIMUS/eu.DECIDEh2020.optimus/target/.gitignore b/OPTIMUS/eu.DECIDEh2020.optimus/target/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..840e7d3120ee3206168d49bf62df2c269c38e17e --- /dev/null +++ b/OPTIMUS/eu.DECIDEh2020.optimus/target/.gitignore @@ -0,0 +1 @@ +/classes/ diff --git a/OPTIMUS/eu.decideh2020.int.optimus.server.src.dvp/src/main/docker/Dockerfile b/OPTIMUS/eu.decideh2020.int.optimus.server.src.dvp/src/main/docker/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..6d96947ad7ab58813e0dbacf65de30fa3dbdd7c7 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.int.optimus.server.src.dvp/src/main/docker/Dockerfile @@ -0,0 +1,20 @@ +FROM maven:3.5.3-jdk-8 as builder + +#COPY sources /sources +#COPY sources-appmanager /sources-appmanager +#COPY .m2 /root/.m2 +# +ARG GIT_CREDENTIALS +ARG APPMANAGER_VERSION +ARG ACSMI_VERSION + +COPY downloadsources.sh /downloadsources.sh +COPY maveninstall.sh /maveninstall.sh +RUN chmod +x /downloadsources.sh && \ + sh ./downloadsources.sh && \ + chmod +x /maveninstall.sh && \ + sh ./maveninstall.sh + +WORKDIR /WP3/Optimus/eu.decideh2020.optimus.server +CMD ["mvn","jetty:run","-Dmaven.test.skip=true"] +#cd target/*.war /ROOT.war \ No newline at end of file diff --git a/OPTIMUS/eu.decideh2020.int.optimus.server.src.dvp/src/main/docker/downloadsources.sh b/OPTIMUS/eu.decideh2020.int.optimus.server.src.dvp/src/main/docker/downloadsources.sh new file mode 100644 index 0000000000000000000000000000000000000000..f0ea56abfdc613805207a27c660c6c58c5865eb0 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.int.optimus.server.src.dvp/src/main/docker/downloadsources.sh @@ -0,0 +1,10 @@ +cd / +git clone https://$GIT_CREDENTIALS@git.code.tecnalia.com/decide/AppController.git +cd /AppController +git checkout $APPMANAGER_VERSION +cd / +git clone https://$GIT_CREDENTIALS@git.code.tecnalia.com/decide/WP5.git +cd /WP5 +git checkout $ACSMI_VERSION +cd / +git clone https://$GIT_CREDENTIALS@git.code.tecnalia.com/decide/WP3.git diff --git a/OPTIMUS/eu.decideh2020.int.optimus.server.src.dvp/src/main/docker/maveninstall.sh b/OPTIMUS/eu.decideh2020.int.optimus.server.src.dvp/src/main/docker/maveninstall.sh new file mode 100644 index 0000000000000000000000000000000000000000..b72cd51d351294f4cb43c0e931f0aa2842c29f07 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.int.optimus.server.src.dvp/src/main/docker/maveninstall.sh @@ -0,0 +1,6 @@ +cd /AppController +mvn install -Dmaven.test.skip=true +cd /WP5/ACSmI_discovery/eu.decideh2020.acsmi.backend.services.client +mvn install -Dmaven.test.skip=true +cd /WP3/Optimus/eu.decideh2020.optimus.server +mvn install -Dmaven.test.skip=true diff --git a/OPTIMUS/eu.decideh2020.optimus.client/.classpath b/OPTIMUS/eu.decideh2020.optimus.client/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..4b1e0b42b1c0b7e3dc507d83210e27533f780ed4 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/.classpath @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src/gen/java"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/OPTIMUS/eu.decideh2020.optimus.client/.gitkeep b/OPTIMUS/eu.decideh2020.optimus.client/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/OPTIMUS/eu.decideh2020.optimus.client/.project b/OPTIMUS/eu.decideh2020.optimus.client/.project new file mode 100644 index 0000000000000000000000000000000000000000..29fb4a4635e08bf3c45bc4b21995d59eb5de5a2d --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>eu.decideh2020.optimus.client</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + </natures> +</projectDescription> diff --git a/OPTIMUS/eu.decideh2020.optimus.client/.settings/org.eclipse.core.resources.prefs b/OPTIMUS/eu.decideh2020.optimus.client/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000000000000000000000000000000000..4824b8026319a8fb303971008a7d59a816d58bd6 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/<project>=UTF-8 diff --git a/OPTIMUS/eu.decideh2020.optimus.client/.settings/org.eclipse.jdt.core.prefs b/OPTIMUS/eu.decideh2020.optimus.client/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..bbcbc93486d53c73668b275ea5daf41b66ba9c41 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/OPTIMUS/eu.decideh2020.optimus.client/.settings/org.eclipse.m2e.core.prefs b/OPTIMUS/eu.decideh2020.optimus.client/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..14b697b7bbb0d85e8d8ee19141a2a92d9ce211be --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/OPTIMUS/eu.decideh2020.optimus.client/.swagger-codegen-ignore b/OPTIMUS/eu.decideh2020.optimus.client/.swagger-codegen-ignore new file mode 100644 index 0000000000000000000000000000000000000000..c5fa491b4c557bf997d5dd21797de782545dc9e5 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/OPTIMUS/eu.decideh2020.optimus.client/.swagger-codegen/VERSION b/OPTIMUS/eu.decideh2020.optimus.client/.swagger-codegen/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..a6254504e40175d135cea7feb34ad31fa0d0bca3 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.3.1 \ No newline at end of file diff --git a/OPTIMUS/eu.decideh2020.optimus.client/pom.xml b/OPTIMUS/eu.decideh2020.optimus.client/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..d99e9f65815ab77433393db93d2e14cd52168374 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/pom.xml @@ -0,0 +1,183 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> +<!-- <groupId>io.swagger</groupId> --> +<!-- <artifactId>swagger-jaxrs-client</artifactId> --> +<!-- <packaging>jar</packaging> --> +<!-- <name>swagger-jaxrs-client</name> --> +<!-- <description>optimus simulation API documentation</description> --> +<!-- <version>1.0.0</version> --> + <groupId>eu.decideh2020</groupId> + <artifactId>optimus-client</artifactId> + <packaging>jar</packaging> + <version>2.0.0</version> + + <build> + <sourceDirectory>src/main/java</sourceDirectory> + <plugins> + <plugin> + <artifactId>maven-failsafe-plugin</artifactId> + <version>2.6</version> + <executions> + <execution> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + </execution> + </executions> + </plugin> + + <!--plugin> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>${jetty-version}</version> + <configuration> + <webApp> + <contextPath>/</contextPath> + </webApp> + <webAppSourceDirectory>target/${project.artifactId}-${project.version}</webAppSourceDirectory> + <stopPort>8079</stopPort> + <stopKey>stopit</stopKey> + <httpConnector> + <port></port> + <idleTimeout>60000</idleTimeout> + </httpConnector> + </configuration> + <executions> + <execution> + <id>start-jetty</id> + <phase>pre-integration-test</phase> + <goals> + <goal>start</goal> + </goals> + <configuration> + <scanIntervalSeconds>0</scanIntervalSeconds> + <daemon>true</daemon> + </configuration> + </execution> + <execution> + <id>stop-jetty</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</goal> + </goals> + </execution> + </executions> + </plugin--> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>1.9.1</version> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>src/gen/java</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + <dependencies> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-jaxrs</artifactId> + <scope>compile</scope> + <version>${swagger-core-version}</version> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <version>${logback-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-core</artifactId> + <version>${logback-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junit-version}</version> + <scope>test</scope> + </dependency> + <!-- CXF Client --> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-client</artifactId> + <version>${cxf-version}</version> + <scope>test</scope> + </dependency> + + <!-- CXF server --> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-frontend-jaxrs</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-service-description</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-ws-policy</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-wsdl</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.jaxrs</groupId> + <artifactId>jackson-jaxrs-json-provider</artifactId> + <version>${jackson-jaxrs-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.datatype</groupId> + <artifactId>jackson-datatype-joda</artifactId> + <version>${jackson-jaxrs-version}</version> + <scope>compile</scope> + </dependency> + + </dependencies> + <repositories> + <repository> + <id>sonatype-snapshots</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <properties> + <java.version>1.7</java.version> + <maven.compiler.source>${java.version}</maven.compiler.source> + <maven.compiler.target>${java.version}</maven.compiler.target> + <swagger-core-version>1.5.15</swagger-core-version> + <jetty-version>9.2.9.v20150224</jetty-version> + <junit-version>4.12</junit-version> + <logback-version>1.1.7</logback-version> + <servlet-api-version>2.5</servlet-api-version> + <cxf-version>3.1.11</cxf-version> + <jackson-jaxrs-version>2.9.5</jackson-jaxrs-version> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> +</project> diff --git a/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/api/DefaultApi.java b/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/api/DefaultApi.java new file mode 100644 index 0000000000000000000000000000000000000000..adcc1a1e3eb2cbb4bb10355691726e6d7fe8e016 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/api/DefaultApi.java @@ -0,0 +1,118 @@ +package eu.decideh2020.optimus.client.api; + +import eu.decideh2020.optimus.client.model.ReturnedSc; +import eu.decideh2020.optimus.client.model.ReturnedSimulation; +import eu.decideh2020.optimus.client.model.Simulation; + +import java.io.InputStream; +import java.io.OutputStream; +import java.util.List; +import java.util.Map; +import javax.ws.rs.*; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.MediaType; +import org.apache.cxf.jaxrs.ext.multipart.*; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.ApiResponse; +import io.swagger.jaxrs.PATCH; + +/** + * optimus simulation API + * + * <p>optimus simulation API documentation + * + */ +@Path("/") +@Api(value = "/", description = "") +public interface DefaultApi { + + /** + * createsSimulation + * + * Creates a trigeredSimulation + * + */ + @POST + @Path("/applications") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "createsSimulation", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "simulation created", response = ReturnedSimulation.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = String.class), + @ApiResponse(code = 403, message = "Forbidden", response = Void.class), + @ApiResponse(code = 404, message = "Not Found", response = Void.class) }) + public List<ReturnedSimulation> createsSimulationUsingPOST(Simulation simulation); + + /** + * deleteSimulation + * + */ + @DELETE + @Path("/applications/delete/{simid}") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "deleteSimulation", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = Void.class), + @ApiResponse(code = 204, message = "No Content", response = Void.class), + @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + @ApiResponse(code = 403, message = "Forbidden", response = Void.class) }) + public void deleteASimulationUsingDELETE(@PathParam("simid") Integer simid); + + /** + * getAllSimulations + * + * Gets the list of the triggered simulations registered , including the id and the status of the simulation. The simid would be an readble identification, build with the information about the application + * + */ + @GET + @Path("/applications") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "getAllSimulations", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "the simulation being returned", response = ReturnedSimulation.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + @ApiResponse(code = 403, message = "Forbidden", response = Void.class), + @ApiResponse(code = 404, message = "Not Found", response = Void.class) }) + public List<ReturnedSimulation> getAllSimulationsUsingGET(); + + /** + * getSchema + * + * Gets the schema + * + */ + @GET + @Path("/applications/schema/{simid}") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "getSchema", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "the schema being returned", response = ReturnedSc.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + @ApiResponse(code = 403, message = "Forbidden", response = Void.class), + @ApiResponse(code = 404, message = "Not Found", response = Void.class) }) + public List<ReturnedSc> getSchemaUsingGET(@PathParam("simid") Integer simid); + + /** + * getSimulation + * + */ + @GET + @Path("/applications/{simid}") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "getSimulation", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "the specific simulation being returned", response = ReturnedSimulation.class, responseContainer = "array"), + @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + @ApiResponse(code = 403, message = "Forbidden", response = Void.class), + @ApiResponse(code = 404, message = "Not Found", response = Void.class) }) + public List<ReturnedSimulation> getSimulationUsingGET(@PathParam("simid") Integer simid); +} + diff --git a/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/model/ReturnedSc.java b/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/model/ReturnedSc.java new file mode 100644 index 0000000000000000000000000000000000000000..4e5cebe306d05964feee366eba95d38e265b45d2 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/model/ReturnedSc.java @@ -0,0 +1,109 @@ +package eu.decideh2020.optimus.client.model; + +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ReturnedSc { + + @ApiModelProperty(value = "") + private Integer index = null; + + @ApiModelProperty(value = "") + private String csId = null; + + @ApiModelProperty(value = "") + private List<String> micros = null; + /** + * Get index + * @return index + **/ + @JsonProperty("index") + public Integer getIndex() { + return index; + } + + public void setIndex(Integer index) { + this.index = index; + } + + public ReturnedSc index(Integer index) { + this.index = index; + return this; + } + + /** + * Get csId + * @return csId + **/ + @JsonProperty("csId") + public String getCsId() { + return csId; + } + + public void setCsId(String csId) { + this.csId = csId; + } + + public ReturnedSc csId(String csId) { + this.csId = csId; + return this; + } + + /** + * Get micros + * @return micros + **/ + @JsonProperty("micros") + public List<String> getMicros() { + return micros; + } + + public void setMicros(List<String> micros) { + this.micros = micros; + } + + public ReturnedSc micros(List<String> micros) { + this.micros = micros; + return this; + } + + public ReturnedSc addMicrosItem(String microsItem) { + this.micros.add(microsItem); + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReturnedSc {\n"); + + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" csId: ").append(toIndentedString(csId)).append("\n"); + sb.append(" micros: ").append(toIndentedString(micros)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/model/ReturnedSchema.java b/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/model/ReturnedSchema.java new file mode 100644 index 0000000000000000000000000000000000000000..67ac8b1e20f97630b4acd8e78a0d87d9975f3be5 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/model/ReturnedSchema.java @@ -0,0 +1,110 @@ +package eu.decideh2020.optimus.client.model; + +import eu.decideh2020.optimus.client.model.ReturnedSc; +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ReturnedSchema { + + @ApiModelProperty(value = "") + private Integer simid = null; + + @ApiModelProperty(value = "") + private String status = null; + + @ApiModelProperty(value = "") + private List<ReturnedSc> sc = null; + /** + * Get simid + * @return simid + **/ + @JsonProperty("simid") + public Integer getSimid() { + return simid; + } + + public void setSimid(Integer simid) { + this.simid = simid; + } + + public ReturnedSchema simid(Integer simid) { + this.simid = simid; + return this; + } + + /** + * Get status + * @return status + **/ + @JsonProperty("status") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public ReturnedSchema status(String status) { + this.status = status; + return this; + } + + /** + * Get sc + * @return sc + **/ + @JsonProperty("sc") + public List<ReturnedSc> getSc() { + return sc; + } + + public void setSc(List<ReturnedSc> sc) { + this.sc = sc; + } + + public ReturnedSchema sc(List<ReturnedSc> sc) { + this.sc = sc; + return this; + } + + public ReturnedSchema addScItem(ReturnedSc scItem) { + this.sc.add(scItem); + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReturnedSchema {\n"); + + sb.append(" simid: ").append(toIndentedString(simid)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" sc: ").append(toIndentedString(sc)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/model/ReturnedSimulation.java b/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/model/ReturnedSimulation.java new file mode 100644 index 0000000000000000000000000000000000000000..12af479887999e68e0cd8a3428cbe21c2b111aee --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/model/ReturnedSimulation.java @@ -0,0 +1,80 @@ +package eu.decideh2020.optimus.client.model; + + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ReturnedSimulation { + + @ApiModelProperty(value = "") + private Integer simid = null; + + @ApiModelProperty(value = "") + private String status = null; + /** + * Get simid + * @return simid + **/ + @JsonProperty("simid") + public Integer getSimid() { + return simid; + } + + public void setSimid(Integer simid) { + this.simid = simid; + } + + public ReturnedSimulation simid(Integer simid) { + this.simid = simid; + return this; + } + + /** + * Get status + * @return status + **/ + @JsonProperty("status") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public ReturnedSimulation status(String status) { + this.status = status; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReturnedSimulation {\n"); + + sb.append(" simid: ").append(toIndentedString(simid)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/model/Simulation.java b/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/model/Simulation.java new file mode 100644 index 0000000000000000000000000000000000000000..9902f3a8e61c10b02f19317a44f0f5e912057ab3 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/src/gen/java/eu/decideh2020/optimus/client/model/Simulation.java @@ -0,0 +1,154 @@ +package eu.decideh2020.optimus.client.model; + +import eu.decideh2020.optimus.client.model.ReturnedSc; +import java.util.ArrayList; +import java.util.List; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class Simulation { + + @ApiModelProperty(value = "") + private Integer simid = null; + + @ApiModelProperty(value = "") + private String appurl = null; + + @ApiModelProperty(value = "") + private String caller = null; + + @ApiModelProperty(value = "") + private String status = null; + + @ApiModelProperty(value = "") + private List<ReturnedSc> sc = null; + /** + * Get simid + * @return simid + **/ + @JsonProperty("simid") + public Integer getSimid() { + return simid; + } + + public void setSimid(Integer simid) { + this.simid = simid; + } + + public Simulation simid(Integer simid) { + this.simid = simid; + return this; + } + + /** + * Get appurl + * @return appurl + **/ + @JsonProperty("appurl") + public String getAppurl() { + return appurl; + } + + public void setAppurl(String appurl) { + this.appurl = appurl; + } + + public Simulation appurl(String appurl) { + this.appurl = appurl; + return this; + } + + /** + * Get caller + * @return caller + **/ + @JsonProperty("caller") + public String getCaller() { + return caller; + } + + public void setCaller(String caller) { + this.caller = caller; + } + + public Simulation caller(String caller) { + this.caller = caller; + return this; + } + + /** + * Get status + * @return status + **/ + @JsonProperty("status") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Simulation status(String status) { + this.status = status; + return this; + } + + /** + * Get sc + * @return sc + **/ + @JsonProperty("sc") + public List<ReturnedSc> getSc() { + return sc; + } + + public void setSc(List<ReturnedSc> sc) { + this.sc = sc; + } + + public Simulation sc(List<ReturnedSc> sc) { + this.sc = sc; + return this; + } + + public Simulation addScItem(ReturnedSc scItem) { + this.sc.add(scItem); + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Simulation {\n"); + + sb.append(" simid: ").append(toIndentedString(simid)).append("\n"); + sb.append(" appurl: ").append(toIndentedString(appurl)).append("\n"); + sb.append(" caller: ").append(toIndentedString(caller)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" sc: ").append(toIndentedString(sc)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/eu.decideh2020.optimus.client/src/main/resources/swagger/swagger.json b/OPTIMUS/eu.decideh2020.optimus.client/src/main/resources/swagger/swagger.json new file mode 100644 index 0000000000000000000000000000000000000000..fa8a040f8d99a3f0df213728a4241c23af49b03b --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/src/main/resources/swagger/swagger.json @@ -0,0 +1,263 @@ +{ + "swagger": "2.0", + "info": { + "description": "optimus simulation API documentation", + "version": "0.0.1", + "title": "optimus simulation API" + }, + "host": "85.91.40.245:8090", + "basePath": "/optimussimulation", + "schemes": [ + "http" + ], + "paths": { + "/applications": { + "get": { + "description": "Gets the list of the triggered simulations registered , including the id and the status of the simulation. The simid would be an readble identification, build with the information about the application", + "summary": "getAllSimulations", + "operationId": "getAllSimulationsUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "the simulation being returned", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/returnedSimulation" + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "description": "Creates a trigeredSimulation", + "summary": "createsSimulation", + "operationId": "createsSimulationUsingPOST", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "in": "body", + "name": "simulation", + "required": true, + "schema": { + "$ref": "#/definitions/Simulation" + } + } + ], + "responses": { + "200": { + "description": "simulation created", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/returnedSimulation" + } + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/applications/{simid}": { + "get": { + "summary": "getSimulation", + "operationId": "getSimulationUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "simid", + "in": "path", + "description": "readable format of the id of one specific simulation", + "required": true, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "the specific simulation being returned", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/returnedSimulation" + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/applications/schema/{simid}": { + "get": { + "description": "Gets the schema", + "summary": "getSchema", + "operationId": "getSchemaUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "simid", + "in": "path", + "description": "readable format of the id of one specific simulation", + "required": true, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "the schema being returned", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/returnedSc" + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/applications/delete/{simid}": { + "delete": { + "summary": "deleteSimulation", + "operationId": "deleteASimulationUsingDELETE", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "name": "simid", + "in": "path", + "description": "readable format of the id of one specific simulation", + "required": true, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + } + } + } + }, + "definitions": { + "Simulation": { + "type": "object", + "properties": { + "simid": { + "type": "integer" + }, + "appurl": { + "type": "string" + }, + "caller": { + "type": "string" + }, + "status": { + "type": "string" + }, + "sc": { + "type": "array", + "items": { + "$ref": "#/definitions/returnedSc" + } + } + } + }, + "returnedSimulation": { + "type": "object", + "properties": { + "simid": { + "type": "integer" + }, + "status": { + "type": "string" + } + } + }, + "returnedSc": { + "type": "object", + "properties": { + "index": { + "type": "integer" + }, + "csId": { + "type": "string" + }, + "micros": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/OPTIMUS/eu.decideh2020.optimus.client/target/.gitignore b/OPTIMUS/eu.decideh2020.optimus.client/target/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..840e7d3120ee3206168d49bf62df2c269c38e17e --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/target/.gitignore @@ -0,0 +1 @@ +/classes/ diff --git a/OPTIMUS/eu.decideh2020.optimus.client/target/maven-archiver/pom.properties b/OPTIMUS/eu.decideh2020.optimus.client/target/maven-archiver/pom.properties new file mode 100644 index 0000000000000000000000000000000000000000..edaa31b1b782936bc399080b945cc9b2458e28af --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Fri Nov 16 10:14:52 CET 2018 +version=2.0.0 +groupId=eu.decideh2020 +artifactId=optimus-client diff --git a/OPTIMUS/eu.decideh2020.optimus.client/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/OPTIMUS/eu.decideh2020.optimus.client/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000000000000000000000000000000000000..90fb9b7c831ca2f05f557cc0dbfbe1c9d4290a98 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,5 @@ +eu\decideh2020\optimus\client\model\ReturnedSc.class +eu\decideh2020\optimus\client\model\ReturnedSimulation.class +eu\decideh2020\optimus\client\model\ReturnedSchema.class +eu\decideh2020\optimus\client\api\DefaultApi.class +eu\decideh2020\optimus\client\model\Simulation.class diff --git a/OPTIMUS/eu.decideh2020.optimus.client/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/OPTIMUS/eu.decideh2020.optimus.client/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000000000000000000000000000000000000..412439239cbfb574b737e21fee5a9e0530bd0398 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.client/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,5 @@ +D:\W\2017-Decide\git\WP3\Optimus\eu.decideh2020.optimus.client\src\gen\java\eu\decideh2020\optimus\client\model\ReturnedSc.java +D:\W\2017-Decide\git\WP3\Optimus\eu.decideh2020.optimus.client\src\gen\java\eu\decideh2020\optimus\client\model\ReturnedSimulation.java +D:\W\2017-Decide\git\WP3\Optimus\eu.decideh2020.optimus.client\src\gen\java\eu\decideh2020\optimus\client\model\ReturnedSchema.java +D:\W\2017-Decide\git\WP3\Optimus\eu.decideh2020.optimus.client\src\gen\java\eu\decideh2020\optimus\client\model\Simulation.java +D:\W\2017-Decide\git\WP3\Optimus\eu.decideh2020.optimus.client\src\gen\java\eu\decideh2020\optimus\client\api\DefaultApi.java diff --git a/OPTIMUS/eu.decideh2020.optimus.client/target/optimus-client-2.0.0.jar b/OPTIMUS/eu.decideh2020.optimus.client/target/optimus-client-2.0.0.jar new file mode 100644 index 0000000000000000000000000000000000000000..1951b7bf72ceb0016a773053faf67fa55c138b6a Binary files /dev/null and b/OPTIMUS/eu.decideh2020.optimus.client/target/optimus-client-2.0.0.jar differ diff --git a/OPTIMUS/eu.decideh2020.optimus.server/.classpath b/OPTIMUS/eu.decideh2020.optimus.server/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..14442bd0a49444219f5202b8f1c32b1a91079e3a --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/.classpath @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"> + <attributes> + <attribute name="optional" value="true"/> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="src" path="src/gen/java"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/OPTIMUS/eu.decideh2020.optimus.server/.gitignore b/OPTIMUS/eu.decideh2020.optimus.server/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b83d22266ac8aa2f8df2edef68082c789727841d --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/.gitignore @@ -0,0 +1 @@ +/target/ diff --git a/OPTIMUS/eu.decideh2020.optimus.server/.project b/OPTIMUS/eu.decideh2020.optimus.server/.project new file mode 100644 index 0000000000000000000000000000000000000000..2637eab967a0d134e73015d6760cd18db36dfd19 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/.project @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>eu.decideh2020.optimus.server</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + </natures> +</projectDescription> diff --git a/OPTIMUS/eu.decideh2020.optimus.server/.settings/org.eclipse.core.resources.prefs b/OPTIMUS/eu.decideh2020.optimus.server/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000000000000000000000000000000000000..654c1750cd616af1513cfe582c11d97cad5788d5 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding/<project>=UTF-8 diff --git a/OPTIMUS/eu.decideh2020.optimus.server/.settings/org.eclipse.jdt.core.prefs b/OPTIMUS/eu.decideh2020.optimus.server/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..c788ee346de7ebd4de46ac216ed5ca2de548b7d9 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/OPTIMUS/eu.decideh2020.optimus.server/.settings/org.eclipse.m2e.core.prefs b/OPTIMUS/eu.decideh2020.optimus.server/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..41475ee9501798f5bffd86c30826ad2dc361e2b9 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=false +version=1 diff --git a/OPTIMUS/eu.decideh2020.optimus.server/.swagger-codegen-ignore b/OPTIMUS/eu.decideh2020.optimus.server/.swagger-codegen-ignore new file mode 100644 index 0000000000000000000000000000000000000000..f21535fd6e9e3a0323c9fb0d9dc6fa393d2e638f --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/OPTIMUS/eu.decideh2020.optimus.server/.swagger-codegen/VERSION b/OPTIMUS/eu.decideh2020.optimus.server/.swagger-codegen/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..6b4d157738258616900a960745945297f0cb7569 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.2.3 \ No newline at end of file diff --git a/OPTIMUS/eu.decideh2020.optimus.server/README.md b/OPTIMUS/eu.decideh2020.optimus.server/README.md new file mode 100644 index 0000000000000000000000000000000000000000..95f7653e69d2c6f7f6c4b463220f4c06828e5ed9 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/README.md @@ -0,0 +1,23 @@ +# Swagger Jersey generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled JAX-RS server. + +This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. + +To run the server, please execute the following: + +``` +mvn clean package jetty:run +``` + +You can then view the swagger listing here: + +``` +http://localhost:8080/optimussimulation/swagger.json +``` + +Note that if you have configured the `host` to be something other than localhost, the calls through +swagger-ui will be directed to that host and not localhost! \ No newline at end of file diff --git a/OPTIMUS/eu.decideh2020.optimus.server/pom.xml b/OPTIMUS/eu.decideh2020.optimus.server/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..57d9f106f0d20324a862570655c07241a82ceb0c --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/pom.xml @@ -0,0 +1,244 @@ +<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/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>eu.decideh2020</groupId> + <artifactId>eu.decideh2020.optimus.server</artifactId> + <packaging>jar</packaging> + <name>eu.decideh2020.optimus.server</name> + <version>1.0.0</version> + + <licenses> + <license> + <name>Unlicense</name> + <url>http://unlicense.org</url> + <distribution>repo</distribution> + </license> + </licenses> + + <build> + <sourceDirectory>src/main/java</sourceDirectory> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>3.1.0</version> + </plugin> + <plugin> + <artifactId>maven-failsafe-plugin</artifactId> + <version>2.6</version> + <executions> + <execution> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-maven-plugin</artifactId> + <version>${jetty-version}</version> + <configuration> + <webApp> + <contextPath>/</contextPath> + </webApp> + <webAppSourceDirectory>target/${project.artifactId}-${project.version}</webAppSourceDirectory> + <stopPort>8079</stopPort> + <stopKey>stopit</stopKey> + <stopWait>10</stopWait> + <httpConnector> + <port>8080</port> + <idleTimeout>60000</idleTimeout> + </httpConnector> + </configuration> + <executions> + <execution> + <id>start-jetty</id> + <phase>pre-integration-test</phase> + <goals> + <goal>start</goal> + </goals> + <configuration> + <scanIntervalSeconds>0</scanIntervalSeconds> + <daemon>true</daemon> + </configuration> + </execution> + <execution> + <id>stop-jetty</id> + <phase>post-integration-test</phase> + <goals> + <goal>stop</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>1.9.1</version> + <executions> + <execution> + <id>add-source</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>src/gen/java</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + <resources> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + </build> + <dependencies> + <dependency> + <groupId>io.swagger</groupId> + <artifactId>swagger-jersey2-jaxrs</artifactId> + <scope>compile</scope> + <version>${swagger-core-version}</version> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-classic</artifactId> + <version>${logback-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>ch.qos.logback</groupId> + <artifactId>logback-core</artifactId> + <version>${logback-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junit-version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>javax.servlet</groupId> + <artifactId>servlet-api</artifactId> + <version>${servlet-api-version}</version> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.containers</groupId> + <artifactId>jersey-container-servlet-core</artifactId> + <version>${jersey2-version}</version> + </dependency> + <dependency> + <groupId>org.glassfish.jersey.media</groupId> + <artifactId>jersey-media-multipart</artifactId> + <version>${jersey2-version}</version> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.datatype</groupId> + <artifactId>jackson-datatype-joda</artifactId> + <version>${jackson-jaxrs-version}</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>com.fasterxml.jackson.jaxrs</groupId> + <artifactId>jackson-jaxrs-json-provider</artifactId> + <version>${jackson-jaxrs-version}</version> + <scope>compile</scope> + </dependency> + <!-- Base64 encoding that works in both JVM and Android --> + <dependency> + <groupId>com.brsanthu</groupId> + <artifactId>migbase64</artifactId> + <version>2.2</version> + </dependency> + + + <!-- Bean Validation API support --> + <dependency> + <groupId>javax.validation</groupId> + <artifactId>validation-api</artifactId> + <version>1.1.0.Final</version> + + </dependency> +<!-- https://mvnrepository.com/artifact/org.apache.cxf/cxf-bundle-jaxrs --> + +<!-- CXF Client --> + <dependency> + <groupId>org.apache.cxf</groupId> + <artifactId>cxf-rt-rs-client</artifactId> + <version>${cxf-version}</version> + <scope>compile</scope> + </dependency> + +<!-- CXF server --> +<!-- <dependency> --> +<!-- <groupId>org.apache.cxf</groupId> --> +<!-- <artifactId>cxf-rt-frontend-jaxrs</artifactId> --> +<!-- <version>${cxf-version}</version> --> +<!-- <scope>compile</scope> --> +<!-- </dependency> --> +<!-- <dependency> --> +<!-- <groupId>org.apache.cxf</groupId> --> +<!-- <artifactId>cxf-rt-rs-service-description</artifactId> --> +<!-- <version>${cxf-version}</version> --> +<!-- <scope>compile</scope> --> +<!-- </dependency> --> +<!-- <dependency> --> +<!-- <groupId>org.apache.cxf</groupId> --> +<!-- <artifactId>cxf-rt-ws-policy</artifactId> --> +<!-- <version>${cxf-version}</version> --> +<!-- <scope>compile</scope> --> +<!-- </dependency> --> +<!-- <dependency> --> +<!-- <groupId>org.apache.cxf</groupId> --> +<!-- <artifactId>cxf-rt-wsdl</artifactId> --> +<!-- <version>${cxf-version}</version> --> +<!-- <scope>compile</scope> --> +<!-- </dependency> --> + + + <dependency> + <groupId>eu.decideh2020</groupId> + <artifactId>ACSmI-client</artifactId> + <version>2.0.0</version> +</dependency> + <dependency> + <groupId>com.googlecode.json-simple</groupId> + <artifactId>json-simple</artifactId> + <version>1.1.1</version> +</dependency> + <dependency> + <groupId>eu.DECIDEh2020</groupId> + <artifactId>app-Controller</artifactId> + <version>0.0.16-SNAPSHOT</version> + </dependency> + </dependencies> + <repositories> + <repository> + <id>sonatype-snapshots</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + <snapshots> + <enabled>true</enabled> + </snapshots> + </repository> + </repositories> + <properties> + <java.version>1.7</java.version> + <maven.compiler.source>${java.version}</maven.compiler.source> + <maven.compiler.target>${java.version}</maven.compiler.target> + <swagger-core-version>1.5.15</swagger-core-version> + <jetty-version>9.2.9.v20150224</jetty-version> + <jersey2-version>2.22.2</jersey2-version> + <cxf-version>3.1.11</cxf-version> + <jackson-jaxrs-version>2.8.9</jackson-jaxrs-version> + <junit-version>4.12</junit-version> + <logback-version>1.1.7</logback-version> + <servlet-api-version>2.5</servlet-api-version> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> +</project> diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApiException.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApiException.java new file mode 100644 index 0000000000000000000000000000000000000000..b8bb3ca2fd77fdf700f0de0b8e0115507f228513 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApiException.java @@ -0,0 +1,10 @@ +package eu.decideh2020.optimus.server.api; + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-16T06:47:28.986Z") +public class ApiException extends Exception{ + private int code; + public ApiException (int code, String msg) { + super(msg); + this.code = code; + } +} diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApiOriginFilter.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApiOriginFilter.java new file mode 100644 index 0000000000000000000000000000000000000000..a6cea778cb0f28bc876d646b64bef7225e9504ba --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApiOriginFilter.java @@ -0,0 +1,22 @@ +package eu.decideh2020.optimus.server.api; + +import java.io.IOException; + +import javax.servlet.*; +import javax.servlet.http.HttpServletResponse; + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-16T06:47:28.986Z") +public class ApiOriginFilter implements javax.servlet.Filter { + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException { + HttpServletResponse res = (HttpServletResponse) response; + res.addHeader("Access-Control-Allow-Origin", "*"); + res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); + res.addHeader("Access-Control-Allow-Headers", "Content-Type"); + chain.doFilter(request, response); + } + + public void destroy() {} + + public void init(FilterConfig filterConfig) throws ServletException {} +} \ No newline at end of file diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApiResponseMessage.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApiResponseMessage.java new file mode 100644 index 0000000000000000000000000000000000000000..7428c2cf6d3e006b7484e2d447d75a310012d89b --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApiResponseMessage.java @@ -0,0 +1,69 @@ +package eu.decideh2020.optimus.server.api; + +import javax.xml.bind.annotation.XmlTransient; + +@javax.xml.bind.annotation.XmlRootElement +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-16T06:47:28.986Z") +public class ApiResponseMessage { + public static final int ERROR = 1; + public static final int WARNING = 2; + public static final int INFO = 3; + public static final int OK = 4; + public static final int TOO_BUSY = 5; + + int code; + String type; + String message; + + public ApiResponseMessage(){} + + public ApiResponseMessage(int code, String message){ + this.code = code; + switch(code){ + case ERROR: + setType("error"); + break; + case WARNING: + setType("warning"); + break; + case INFO: + setType("info"); + break; + case OK: + setType("ok"); + break; + case TOO_BUSY: + setType("too busy"); + break; + default: + setType("unknown"); + break; + } + this.message = message; + } + + @XmlTransient + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApplicationsApi.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApplicationsApi.java new file mode 100644 index 0000000000000000000000000000000000000000..34a4167419404ce72b48ba8f52984a792d18ada0 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApplicationsApi.java @@ -0,0 +1,148 @@ +package eu.decideh2020.optimus.server.api; + +import eu.decideh2020.optimus.server.model.*; +import eu.decideh2020.optimus.server.api.ApplicationsApiService; +import eu.decideh2020.optimus.server.api.factories.ApplicationsApiServiceFactory; + +import io.swagger.annotations.ApiParam; +import io.swagger.jaxrs.*; + +import eu.decideh2020.optimus.server.model.ReturnedSc; +import eu.decideh2020.optimus.server.model.ReturnedSimulation; +import eu.decideh2020.optimus.server.model.Simulation; + +import java.util.Map; +import java.util.List; +import eu.decideh2020.optimus.server.api.NotFoundException; + +import java.io.InputStream; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.FormDataParam; + +import javax.servlet.ServletConfig; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.ws.rs.*; +import javax.validation.constraints.*; + +@Path("/applications") + + +@io.swagger.annotations.Api(description = "the applications API") +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-16T06:47:28.986Z") +public class ApplicationsApi { + private final ApplicationsApiService delegate; + + public ApplicationsApi(@Context ServletConfig servletContext) { + ApplicationsApiService delegate = null; + + if (servletContext != null) { + String implClass = servletContext.getInitParameter("ApplicationsApi.implementation"); + if (implClass != null && !"".equals(implClass.trim())) { + try { + delegate = (ApplicationsApiService) Class.forName(implClass).newInstance(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + } + + if (delegate == null) { + delegate = ApplicationsApiServiceFactory.getApplicationsApi(); + } + + this.delegate = delegate; + } + + @POST + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "createsSimulation", notes = "Creates a trigeredSimulation", response = ReturnedSimulation.class, responseContainer = "List", tags={ }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "simulation created", response = ReturnedSimulation.class, responseContainer = "List"), + + @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized", response = String.class), + + @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found", response = Void.class) }) + public Response createsSimulationUsingPOST(@ApiParam(value = "" ,required=true) Simulation simulation +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.createsSimulationUsingPOST(simulation,securityContext); + } + @DELETE + @Path("/delete/{simid}") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "deleteSimulation", notes = "", response = Void.class, tags={ }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "OK", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 204, message = "No Content", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden", response = Void.class) }) + public Response deleteASimulationUsingDELETE(@ApiParam(value = "readable format of the id of one specific simulation",required=true) @PathParam("simid") Integer simid +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.deleteASimulationUsingDELETE(simid,securityContext); + } + @GET + + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "getAllSimulations", notes = "Gets the list of the triggered simulations registered , including the id and the status of the simulation. The simid would be an readble identification, build with the information about the application", response = ReturnedSimulation.class, responseContainer = "List", tags={ }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "the simulation being returned", response = ReturnedSimulation.class, responseContainer = "List"), + + @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found", response = Void.class) }) + public Response getAllSimulationsUsingGET(@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.getAllSimulationsUsingGET(securityContext); + } + @GET + @Path("/schema/{simid}") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "getSchema", notes = "Gets the schema", response = ReturnedSc.class, responseContainer = "List", tags={ }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "the schema being returned", response = ReturnedSc.class, responseContainer = "List"), + + @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found", response = Void.class) }) + public Response getSchemaUsingGET(@ApiParam(value = "readable format of the id of one specific simulation",required=true) @PathParam("simid") Integer simid +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.getSchemaUsingGET(simid,securityContext); + } + @GET + @Path("/{simid}") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @io.swagger.annotations.ApiOperation(value = "getSimulation", notes = "", response = ReturnedSimulation.class, responseContainer = "List", tags={ }) + @io.swagger.annotations.ApiResponses(value = { + @io.swagger.annotations.ApiResponse(code = 200, message = "the specific simulation being returned", response = ReturnedSimulation.class, responseContainer = "List"), + + @io.swagger.annotations.ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 403, message = "Forbidden", response = Void.class), + + @io.swagger.annotations.ApiResponse(code = 404, message = "Not Found", response = Void.class) }) + public Response getSimulationUsingGET(@ApiParam(value = "readable format of the id of one specific simulation",required=true) @PathParam("simid") Integer simid +,@Context SecurityContext securityContext) + throws NotFoundException { + return delegate.getSimulationUsingGET(simid,securityContext); + } +} diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApplicationsApiService.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApplicationsApiService.java new file mode 100644 index 0000000000000000000000000000000000000000..06d52a77eb49a43aeee9a88be036c4bd8c61030f --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/ApplicationsApiService.java @@ -0,0 +1,27 @@ +package eu.decideh2020.optimus.server.api; + +import eu.decideh2020.optimus.server.api.*; +import io.swagger.model.*; + +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; + +import eu.decideh2020.optimus.server.model.ReturnedSc; +import eu.decideh2020.optimus.server.model.ReturnedSimulation; +import eu.decideh2020.optimus.server.model.Simulation; + +import java.util.List; +import eu.decideh2020.optimus.server.api.NotFoundException; + +import java.io.InputStream; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +import javax.validation.constraints.*; +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-16T06:47:28.986Z") +public abstract class ApplicationsApiService { + public abstract Response createsSimulationUsingPOST(Simulation simulation,SecurityContext securityContext) throws NotFoundException; + public abstract Response deleteASimulationUsingDELETE(Integer simid,SecurityContext securityContext) throws NotFoundException; + public abstract Response getAllSimulationsUsingGET(SecurityContext securityContext) throws NotFoundException; + public abstract Response getSchemaUsingGET(Integer simid,SecurityContext securityContext) throws NotFoundException; + public abstract Response getSimulationUsingGET(Integer simid,SecurityContext securityContext) throws NotFoundException; +} diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/JacksonJsonProvider.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/JacksonJsonProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..fba49a310ed15cb1fdfe9a4a583f3a158a656c2a --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/JacksonJsonProvider.java @@ -0,0 +1,29 @@ +package eu.decideh2020.optimus.server.api; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; + +import com.fasterxml.jackson.datatype.joda.*; + +import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; + +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.ext.Provider; + +@Provider +@Produces({MediaType.APPLICATION_JSON}) +public class JacksonJsonProvider extends JacksonJaxbJsonProvider { + + public JacksonJsonProvider() { + + ObjectMapper objectMapper = new ObjectMapper() + .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .registerModule(new JodaModule()) + .setDateFormat(new RFC3339DateFormat()); + + setMapper(objectMapper); + } +} \ No newline at end of file diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/NotFoundException.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/NotFoundException.java new file mode 100644 index 0000000000000000000000000000000000000000..5751fb264cc3d248868b77e781058e1ace3ae3df --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/NotFoundException.java @@ -0,0 +1,10 @@ +package eu.decideh2020.optimus.server.api; + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-16T06:47:28.986Z") +public class NotFoundException extends ApiException { + private int code; + public NotFoundException (int code, String msg) { + super(code, msg); + this.code = code; + } +} diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/RFC3339DateFormat.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/RFC3339DateFormat.java new file mode 100644 index 0000000000000000000000000000000000000000..1c176d4ccc46198c59b2b82d93fffce27fc27a69 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/RFC3339DateFormat.java @@ -0,0 +1,19 @@ +package eu.decideh2020.optimus.server.api; + +import com.fasterxml.jackson.databind.util.ISO8601DateFormat; +import com.fasterxml.jackson.databind.util.ISO8601Utils; + +import java.text.FieldPosition; +import java.util.Date; + +public class RFC3339DateFormat extends ISO8601DateFormat { + + // Same as ISO8601DateFormat but serializing milliseconds. + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + String value = ISO8601Utils.format(date, true); + toAppendTo.append(value); + return toAppendTo; + } + +} \ No newline at end of file diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/StringUtil.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/StringUtil.java new file mode 100644 index 0000000000000000000000000000000000000000..1fbda36fa499481e7144109c4fd08068f5d12b38 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/api/StringUtil.java @@ -0,0 +1,42 @@ +package eu.decideh2020.optimus.server.api; + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-16T06:47:28.986Z") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) return true; + if (value != null && value.equalsIgnoreCase(str)) return true; + } + return false; + } + + /** + * Join an array of strings with the given separator. + * <p> + * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + * </p> + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) return ""; + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } +} diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/ReturnedSc.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/ReturnedSc.java new file mode 100644 index 0000000000000000000000000000000000000000..3d78fe228cce46b581ddcf9740c7b1edadce444a --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/ReturnedSc.java @@ -0,0 +1,148 @@ +/* + * optimus simulation API + * optimus simulation API documentation + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package eu.decideh2020.optimus.server.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; + +/** + * ReturnedSc + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-16T06:47:28.986Z") +public class ReturnedSc { + @JsonProperty("index") + private Integer index = null; + + @JsonProperty("csId") + private String csId = null; + + @JsonProperty("micros") + private List<String> micros = null; + + public ReturnedSc index(Integer index) { + this.index = index; + return this; + } + + /** + * Get index + * @return index + **/ + @JsonProperty("index") + @ApiModelProperty(value = "") + public Integer getIndex() { + return index; + } + + public void setIndex(Integer index) { + this.index = index; + } + + public ReturnedSc csId(String csId) { + this.csId = csId; + return this; + } + + /** + * Get csId + * @return csId + **/ + @JsonProperty("csId") + @ApiModelProperty(value = "") + public String getCsId() { + return csId; + } + + public void setCsId(String csId) { + this.csId = csId; + } + + public ReturnedSc micros(List<String> micros) { + this.micros = micros; + return this; + } + + public ReturnedSc addMicrosItem(String microsItem) { + if (this.micros == null) { + this.micros = new ArrayList<String>(); + } + this.micros.add(microsItem); + return this; + } + + /** + * Get micros + * @return micros + **/ + @JsonProperty("micros") + @ApiModelProperty(value = "") + public List<String> getMicros() { + return micros; + } + + public void setMicros(List<String> micros) { + this.micros = micros; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReturnedSc returnedSc = (ReturnedSc) o; + return Objects.equals(this.index, returnedSc.index) && + Objects.equals(this.csId, returnedSc.csId) && + Objects.equals(this.micros, returnedSc.micros); + } + + @Override + public int hashCode() { + return Objects.hash(index, csId, micros); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReturnedSc {\n"); + + sb.append(" index: ").append(toIndentedString(index)).append("\n"); + sb.append(" csId: ").append(toIndentedString(csId)).append("\n"); + sb.append(" micros: ").append(toIndentedString(micros)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/ReturnedSchema.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/ReturnedSchema.java new file mode 100644 index 0000000000000000000000000000000000000000..5c43dd10af0e898dd80510b1726c7167f83c8c05 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/ReturnedSchema.java @@ -0,0 +1,149 @@ +/* + * optimus simulation API + * optimus simulation API documentation + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package eu.decideh2020.optimus.server.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import eu.decideh2020.optimus.server.model.ReturnedSc; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; + +/** + * ReturnedSchema + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-08T15:21:21.359Z") +public class ReturnedSchema { + @JsonProperty("simid") + private Integer simid = null; + + @JsonProperty("status") + private String status = null; + + @JsonProperty("sc") + private List<ReturnedSc> sc = null; + + public ReturnedSchema simid(Integer simid) { + this.simid = simid; + return this; + } + + /** + * Get simid + * @return simid + **/ + @JsonProperty("simid") + @ApiModelProperty(value = "") + public Integer getSimid() { + return simid; + } + + public void setSimid(Integer simid) { + this.simid = simid; + } + + public ReturnedSchema status(String status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @JsonProperty("status") + @ApiModelProperty(value = "") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public ReturnedSchema sc(List<ReturnedSc> sc) { + this.sc = sc; + return this; + } + + public ReturnedSchema addScItem(ReturnedSc scItem) { + if (this.sc == null) { + this.sc = new ArrayList<ReturnedSc>(); + } + this.sc.add(scItem); + return this; + } + + /** + * Get sc + * @return sc + **/ + @JsonProperty("sc") + @ApiModelProperty(value = "") + public List<ReturnedSc> getSc() { + return sc; + } + + public void setSc(List<ReturnedSc> sc) { + this.sc = sc; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReturnedSchema returnedSchema = (ReturnedSchema) o; + return Objects.equals(this.simid, returnedSchema.simid) && + Objects.equals(this.status, returnedSchema.status) && + Objects.equals(this.sc, returnedSchema.sc); + } + + @Override + public int hashCode() { + return Objects.hash(simid, status, sc); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReturnedSchema {\n"); + + sb.append(" simid: ").append(toIndentedString(simid)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" sc: ").append(toIndentedString(sc)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/ReturnedSimulation.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/ReturnedSimulation.java new file mode 100644 index 0000000000000000000000000000000000000000..38aa358063878e2fdfe98c1a5980def1f788afb2 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/ReturnedSimulation.java @@ -0,0 +1,114 @@ +/* + * optimus simulation API + * optimus simulation API documentation + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package eu.decideh2020.optimus.server.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; + +/** + * ReturnedSimulation + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-16T06:47:28.986Z") +public class ReturnedSimulation { + @JsonProperty("simid") + private Integer simid = null; + + @JsonProperty("status") + private String status = null; + + public ReturnedSimulation simid(Integer simid) { + this.simid = simid; + return this; + } + + /** + * Get simid + * @return simid + **/ + @JsonProperty("simid") + @ApiModelProperty(value = "") + public Integer getSimid() { + return simid; + } + + public void setSimid(Integer simid) { + this.simid = simid; + } + + public ReturnedSimulation status(String status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @JsonProperty("status") + @ApiModelProperty(value = "") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReturnedSimulation returnedSimulation = (ReturnedSimulation) o; + return Objects.equals(this.simid, returnedSimulation.simid) && + Objects.equals(this.status, returnedSimulation.status); + } + + @Override + public int hashCode() { + return Objects.hash(simid, status); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReturnedSimulation {\n"); + + sb.append(" simid: ").append(toIndentedString(simid)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/Simulation.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/Simulation.java new file mode 100644 index 0000000000000000000000000000000000000000..a1e36bd066a11cbe91ec158c4696669659ddaaad --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/Simulation.java @@ -0,0 +1,197 @@ +/* + * optimus simulation API + * optimus simulation API documentation + * + * OpenAPI spec version: 0.0.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package eu.decideh2020.optimus.server.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import eu.decideh2020.optimus.server.model.ReturnedSc; +import java.util.ArrayList; +import java.util.List; +import javax.validation.constraints.*; + +/** + * Simulation + */ +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-11-16T06:47:28.986Z") +public class Simulation { + @JsonProperty("simid") + private Integer simid = null; + + @JsonProperty("appurl") + private String appurl = null; + + @JsonProperty("caller") + private String caller = null; + + @JsonProperty("status") + private String status = null; + + @JsonProperty("sc") + private List<ReturnedSc> sc = null; + + public Simulation simid(Integer simid) { + this.simid = simid; + return this; + } + + /** + * Get simid + * @return simid + **/ + @JsonProperty("simid") + @ApiModelProperty(value = "") + public Integer getSimid() { + return simid; + } + + public void setSimid(Integer simid) { + this.simid = simid; + } + + public Simulation appurl(String appurl) { + this.appurl = appurl; + return this; + } + + /** + * Get appurl + * @return appurl + **/ + @JsonProperty("appurl") + @ApiModelProperty(value = "") + public String getAppurl() { + return appurl; + } + + public void setAppurl(String appurl) { + this.appurl = appurl; + } + + public Simulation caller(String caller) { + this.caller = caller; + return this; + } + + /** + * Get caller + * @return caller + **/ + @JsonProperty("caller") + @ApiModelProperty(value = "") + public String getCaller() { + return caller; + } + + public void setCaller(String caller) { + this.caller = caller; + } + + public Simulation status(String status) { + this.status = status; + return this; + } + + /** + * Get status + * @return status + **/ + @JsonProperty("status") + @ApiModelProperty(value = "") + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public Simulation sc(List<ReturnedSc> sc) { + this.sc = sc; + return this; + } + + public Simulation addScItem(ReturnedSc scItem) { + if (this.sc == null) { + this.sc = new ArrayList<ReturnedSc>(); + } + this.sc.add(scItem); + return this; + } + + /** + * Get sc + * @return sc + **/ + @JsonProperty("sc") + @ApiModelProperty(value = "") + public List<ReturnedSc> getSc() { + return sc; + } + + public void setSc(List<ReturnedSc> sc) { + this.sc = sc; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Simulation simulation = (Simulation) o; + return Objects.equals(this.simid, simulation.simid) && + Objects.equals(this.appurl, simulation.appurl) && + Objects.equals(this.caller, simulation.caller) && + Objects.equals(this.status, simulation.status) && + Objects.equals(this.sc, simulation.sc); + } + + @Override + public int hashCode() { + return Objects.hash(simid, appurl, caller, status, sc); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Simulation {\n"); + + sb.append(" simid: ").append(toIndentedString(simid)).append("\n"); + sb.append(" appurl: ").append(toIndentedString(appurl)).append("\n"); + sb.append(" caller: ").append(toIndentedString(caller)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" sc: ").append(toIndentedString(sc)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/msANDcs.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/msANDcs.java new file mode 100644 index 0000000000000000000000000000000000000000..9655b2b3cd9fd52a5dfc85bb049745f939371476 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/msANDcs.java @@ -0,0 +1,90 @@ +/********************************************************************* +* Copyright (c) 2018 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia +* Gorka Benguria Tecnalia +* Iñaki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ + +package eu.decideh2020.optimus.server.model; + +import java.util.ArrayList; +import java.util.List; + +import eu.DECIDEh2020.appManager.models.Expression; +import eu.DECIDEh2020.appManager.models.Parameter; +import eu.decideh2020.acsmi.client.model.Service; + +public class msANDcs { + private String msid; + private List<String> drid = new ArrayList<>(); + private String csid; + private double weight; + + private List<String> matchingAttributes = new ArrayList<>(); + + public String getMsid() { + return msid; + } + + public void setMsid(String msid) { + this.msid = msid; + } + + public String getCsid() { + return csid; + } + + public void setCsid(String csid) { + this.csid = csid; + } + + public double getWeight() { + return weight; + } + + public void setWeight(double weight) { + this.weight = weight; + } + + + public void setMatchingList(List<String> matchingAttributes) { + //List<String> match = new ArrayList<>(); + if (matchingAttributes!=null){ + for (String mat : matchingAttributes) { + this.matchingAttributes.add(mat); + } + } + + } + + public List<String> getMatchingList(){ + return matchingAttributes; + + } + public void setdrid(List<String> drid) { + //List<String> match = new ArrayList<>(); + for (String dr : drid) { + this.drid.add(dr); + } + + } + + public List<String> getdrid(){ + return drid; + + } + + +} diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/sortingPossibilities.java b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/sortingPossibilities.java new file mode 100644 index 0000000000000000000000000000000000000000..4aea4917978e3de191e0a2b9b06ea94798ac4659 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/gen/java/eu/decideh2020/optimus/server/model/sortingPossibilities.java @@ -0,0 +1,153 @@ +/********************************************************************* +* Copyright (c) 2018 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia +* Gorka Benguria Tecnalia +* Iñaki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.decideh2020.optimus.server.model; + +import java.util.ArrayList; +import java.util.List; + +import eu.DECIDEh2020.appManager.models.Microservice; +import eu.DECIDEh2020.appManager.models.SchemaElement; + +public class sortingPossibilities { + + + + private List<msANDcs> array; + private int length; + + public void sort(List<msANDcs> inputArr) { + + if (inputArr == null || inputArr.size() == 0) { + return; + } + this.array = inputArr; + length = inputArr.size(); + quickSort(0, length - 1); + } + + private void quickSort(int lowerIndex, int higherIndex) { + + int i = lowerIndex; + int j = higherIndex; + // calculate pivot number, I am taking pivot as middle index number + double pivot = array.get(lowerIndex+(higherIndex-lowerIndex)/2).getWeight(); + //int pivot = array[lowerIndex+(higherIndex-lowerIndex)/2]; + // Divide into two arrays + while (i <= j) { + /** + * In each iteration, we will identify a number from left side which + * is greater then the pivot value, and also we will identify a number + * from right side which is less then the pivot value. Once the search + * is done, then we exchange both numbers. + */ + //System.out.println(array.get(i).getWeight()); + //System.out.println(pivot); + + while (array.get(i).getWeight() > pivot) { + i++; + } + while (array.get(j).getWeight() < pivot) { + j--; + } + if (i <= j) { + exchangeNumbers(i, j); + //move index to next position on both sides + i++; + j--; + } + } + // call quickSort() method recursively + if (lowerIndex < j) + quickSort(lowerIndex, j); + if (i < higherIndex) + quickSort(i, higherIndex); + } + + private void exchangeNumbers(int i, int j) { + msANDcs temp = array.get(i); + array.set(i, array.get(j)); + array.set(j, temp); + } + + public List<SchemaElement> combine(List<msANDcs> inputArr) { + List<SchemaElement> sc = new ArrayList<>(); + if (inputArr == null || inputArr.size() == 0) { + return sc; + } + this.array = inputArr; + length = inputArr.size(); + List<String> micros = new ArrayList<>(); + int i=0; + + for (msANDcs mscs : array) { + //mscs is a sorted list, the first row you find for a microservice id is the best one + + SchemaElement newsc = new SchemaElement(); + List<String> microservices = new ArrayList<>(); + + if (!micros.contains(mscs.getMsid())){ + newsc.setIndex(i); + newsc.setCsId(mscs.getCsid()); + microservices.add(mscs.getMsid()); + //for now just one detachable resource associated to one microservice + microservices.add(mscs.getdrid().get(0)); + newsc.setMicroservices(microservices); + sc.add(newsc); + micros.addAll(microservices); + } + + } + i=0; + List<SchemaElement> scfinal = new ArrayList<>(); + int index; + for (SchemaElement scaux : sc) { + SchemaElement scfinalelement = new SchemaElement(); + index = included(scaux.getCsId(),scfinal); + if (index != 9999) { + //scfinalelement.getMicroservices().add(scaux.getMicroservices().get(0)); + scfinal.get(index).getMicroservices().addAll(scaux.getMicroservices()); + + } + else { + scfinalelement.setCsId(scaux.getCsId()); + scfinalelement.setIndex(i); + scfinalelement.setMicroservices(scaux.getMicroservices()); + scfinal.add(scfinalelement); + i++; + } + + } + + return scfinal; + } + + private int included(String csId, List<SchemaElement> scfinal) { + int indexincluded=9999; + for (SchemaElement sc : scfinal) { + if (sc.getCsId().equals(csId)){ + indexincluded = sc.getIndex(); + } + + } + return indexincluded; +} + +} + + diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/Bootstrap.java b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/Bootstrap.java new file mode 100644 index 0000000000000000000000000000000000000000..a751068d0369eb2e27ab9fe1984cbba61a61d56b --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/Bootstrap.java @@ -0,0 +1,55 @@ +/********************************************************************* +* Copyright (c) 2018 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia +* Gorka Benguria Tecnalia +* Iñaki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.decideh2020.optimus.server.api; + +import io.swagger.jaxrs.config.SwaggerContextService; +import io.swagger.models.*; + +import io.swagger.models.auth.*; + +import javax.servlet.http.HttpServlet; + +import eu.decideh2020.optimus.server.api.impl.SimQueue; +import eu.decideh2020.optimus.server.model.Simulation; + +import javax.servlet.ServletContext; +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; + +public class Bootstrap extends HttpServlet { + @Override + public void init(ServletConfig config) throws ServletException { + Info info = new Info() + .title("Swagger Server") + .description("optimus simulation API documentation") + .termsOfService("") + .contact(new Contact() + .email("")) + .license(new License() + .name("") + .url("http://unlicense.org")); + + ServletContext context = config.getServletContext(); + Swagger swagger = new Swagger().info(info); + + new SwaggerContextService().withServletConfig(config).updateSwagger(swagger); + SimulatorThread simulator = new SimulatorThread(); + simulator.start(); + } +} diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/SimulatorThread.java b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/SimulatorThread.java new file mode 100644 index 0000000000000000000000000000000000000000..8d4708f348cc294c94be1228b7752315751d35bd --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/SimulatorThread.java @@ -0,0 +1,330 @@ +/********************************************************************* +* Copyright (c) 2018 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia +* Gorka Benguria Tecnalia +* Iñaki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.decideh2020.optimus.server.api; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.UUID; + +import org.apache.cxf.jaxrs.client.ClientConfiguration; +import org.apache.cxf.jaxrs.client.JAXRSClientFactory; +import org.apache.cxf.jaxrs.client.WebClient; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.ObjectWriter; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; + + +import eu.DECIDEh2020.appManager.AppManager; +import eu.DECIDEh2020.appManager.exceptions.AppManagerException; +import eu.DECIDEh2020.appManager.exceptions.DECIDEValidationException; +import eu.DECIDEh2020.appManager.models.AppDescription; +import eu.DECIDEh2020.appManager.models.AvailabilityNfr; +import eu.DECIDEh2020.appManager.models.DetachableResource; +import eu.DECIDEh2020.appManager.models.Microservice; +import eu.DECIDEh2020.appManager.models.Nfr; +import eu.DECIDEh2020.appManager.models.PerformanceNfr; +import eu.DECIDEh2020.appManager.models.SchemaElement; +import eu.decideh2020.optimus.server.api.impl.Attribute; +import eu.decideh2020.optimus.server.api.impl.Filter; +import eu.decideh2020.optimus.server.api.impl.SimQueue; +import eu.decideh2020.optimus.server.model.sortingPossibilities; +import io.swagger.util.Json; +import eu.decideh2020.optimus.server.model.ReturnedSc; +import eu.decideh2020.optimus.server.model.ReturnedSchema; +import eu.decideh2020.optimus.server.model.Simulation; +import eu.decideh2020.optimus.server.model.msANDcs; +import eu.decideh2020.optimus.server.model.sortingPossibilities; +import eu.decideh2020.acsmi.client.api.ServiceResourceApi; +import eu.decideh2020.acsmi.client.model.Service; + +//import eu.decideh2020.optimus.server.api.JacksonJsonProvider; +import org.json.simple.JSONArray; +//import org.json.simple.JSONException; +import org.json.simple.JSONObject; + + + + +public class SimulatorThread extends Thread { + + private Simulation headofq; + private HashMap<Integer, String> classid = new HashMap<Integer, String>(); + private ServiceResourceApi api; + private List<msANDcs> schemasPossibilities = new ArrayList<>(); + + + List<SchemaElement> sc = new ArrayList<>(); + String localAppDesc = ""; + + // Constructor, getter & setter + + @Override + public void run() { + InitializeHashmap (); + SimQueue SimQ = SimQueue.getInstance( ); + while (true) { + headofq = SimQ.poll(); + if (headofq!=null && headofq.getStatus().contentEquals("started")) { + this.simprocess(headofq); + } + this.wait(2); + } + } + + + + private void InitializeHashmap() { + classid.put(1, "db"); + classid.put(2, "storage"); + classid.put(3, "Computing"); + classid.put(3, "Computing public IP"); + + + + } + + + + private void simprocess(Simulation hq) { + //the simulation process for invoking the discovery and obtaining the schema + //System.out.println("simulation launched for: "+hq.getSimid()); + List<Microservice> microservices = new ArrayList<>(); + List<Nfr> nfrs = new ArrayList<>(); + AppManager manager = null; + if (hq.getAppurl().contains("https://")) + { + localAppDesc = System.getProperty("java.io.tmpdir"); + localAppDesc = localAppDesc+"\\"+hq.getSimid(); + //this is the way to manage the variables (paths only) by java, obtaining tmp system folder - end + try { + manager = AppManager.open(hq.getAppurl(), "user", "password", Paths.get(localAppDesc)); + + } catch (AppManagerException e) { + e.printStackTrace(); + } + } + else { + localAppDesc = hq.getAppurl(); + try { + manager = AppManager.open(Paths.get(localAppDesc)); + } catch (AppManagerException e) { + e.printStackTrace(); + } + } + + + AppDescription description = new AppDescription(); + sc.clear(); + try { + + description = manager.getAppDescription(); + nfrs = description.getNfrs(); + microservices = description.getMicroservices(); + description.getSchema().clear(); + for (Microservice ms : microservices) { + + BuildRequest(ms,nfrs, description); + } + + } catch (IOException | DECIDEValidationException e) { + e.printStackTrace(); + } + description.getSchema().clear(); + BestSchema(hq, description, manager); + + } + + + + private void BestSchema(Simulation sim, AppDescription appd, AppManager manager) { + //obtain the best possible schema taking into account the information sent by ACSmI + // set the status to the simulation to finished + //sorting the individual schemas possibilities + sortingPossibilities sorter = new sortingPossibilities(); + sorter.sort(schemasPossibilities); + //combine the individual schemas possibilities + sc = sorter.combine(schemasPossibilities); + sim.setStatus("finished"); + if (!localAppDesc.contains("https://")) + { + String scText = ""; + List<ReturnedSc> schemas = new ArrayList<>(); + if (!sc.isEmpty()) + { + + for (SchemaElement se : sc) { + ReturnedSc rs = new ReturnedSc(); + rs.setIndex(se.getIndex()); + rs.setCsId(se.getCsId()); + for (String micro : se.getMicroservices()) { + rs.addMicrosItem(micro);} + schemas.add(rs); + + } + + sim.setSc(schemas); + SimQueue SimQ = SimQueue.getInstance( ); + SimQ.add(sim); + if (sim.getCaller()=="VH") { + //record the appdescription into de git + } + } + } + } + //} + private void BuildRequest(Microservice ms, List<Nfr> nfrs, AppDescription appdesc) { + Filter filterexample = new Filter(); + List<Attribute> attributes = new ArrayList<>(); + // all the CS are VM + filterexample.setClassid(3); + for (Nfr nf : nfrs) { + + if (nf instanceof PerformanceNfr) { + PerformanceNfr performanceNfr = (PerformanceNfr) nf; + Attribute att = new Attribute(); + att.setTypeid(21); + att.setName("Response Time: Virtual Machine Performance"); + if (performanceNfr.getUnit().contains("percentage")) { + att.setUnit("%"); + } + if (performanceNfr.getUnit().contains("milliseconds")) { + att.setUnit("ms"); + } + att.setValue(Double.toString(performanceNfr.getValue())); + attributes.add(att); + } + if (nf instanceof AvailabilityNfr) { + AvailabilityNfr availabilityNfr = (AvailabilityNfr) nf; + + Attribute att = new Attribute(); + att.setTypeid(20); + att.setName("Availability"); + att.setValue(Double.toString(availabilityNfr.getValue())); + if (availabilityNfr.getUnit().contains("percentage")) { + att.setUnit("%"); + } + if (availabilityNfr.getUnit().contains("milliseconds")) { + att.setUnit("ms"); + } + attributes.add(att); + } + } + if (ms.getClassification().contentEquals("Computing Public IP")) { + Attribute att = new Attribute(); + att.setTypeid(9); + att.setName("Public IP"); + att.setValue("IP"); + att.setUnit(null); + attributes.add(att); + } + //pending eliminate nameVM + //String nameVM = "nononono"; + filterexample.setAttributes(attributes); + + //ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter(); + String filter= ""; + //filter = String.valueOf(filterexample); + + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(SerializationFeature.INDENT_OUTPUT, true); + try { + filter = mapper.writeValueAsString(filterexample); + } catch (JsonProcessingException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + +// try { +// filter = ow.writeValueAsString(filterexample); +// +// } catch (JsonProcessingException e) { +// e.printStackTrace(); +// } + List<Service> response = RequestToACSmI(filter); + if (!response.isEmpty()) { + for (Service cs : response) { + msANDcs mscs = new msANDcs(); + mscs.setMsid(ms.getId()); + mscs.setCsid(cs.getId().toString()); + mscs.setWeight(cs.getMatch()); + mscs.setMatchingList(cs.getMatchingattributelist()); + // detachable_resources are always associated to the microservice and they will be deployed in the same cs + List<String> detach = new ArrayList<>(); + for (DetachableResource dr : ms.getDetachableResources()) { + detach.add(dr.getId()); + } + mscs.setdrid(detach); + schemasPossibilities.add(mscs); + } + + } + + } + + private List<Service> RequestToACSmI(String filter) { + //System.out.println("request built is: "+filter); + JacksonJsonProvider provider = new JacksonJsonProvider(); + List providers = new ArrayList(); + providers.add(provider); + + //the integration enviroment + api = JAXRSClientFactory.create("acsmiServicesURL", ServiceResourceApi.class, providers); + + org.apache.cxf.jaxrs.client.Client client = WebClient.client(api); + + ClientConfiguration config = WebClient.getConfig(client); + List<Service> response = api.findServicesUsingGET(filter); + return response; + } + private void wait (int segundos) { + try { + Thread.sleep(segundos * 1000); + } catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + } + } + private Properties loadProperties() { + Properties props; + props = new Properties(); + + InputStream fis = null; + try { + fis = this.getClass().getClassLoader().getResourceAsStream("/optimus.server.properties"); + props.load(fis); + } catch (IOException e) { + e.printStackTrace(); + } + return props; + } +} + diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/factories/ApplicationsApiServiceFactory.java b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/factories/ApplicationsApiServiceFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..bb71615272a97a0de2e5ebb28bc2e426596feb54 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/factories/ApplicationsApiServiceFactory.java @@ -0,0 +1,13 @@ +package eu.decideh2020.optimus.server.api.factories; + +import eu.decideh2020.optimus.server.api.ApplicationsApiService; +import eu.decideh2020.optimus.server.api.impl.ApplicationsApiServiceImpl; + +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-03-06T15:32:29.649Z") +public class ApplicationsApiServiceFactory { + private final static ApplicationsApiService service = new ApplicationsApiServiceImpl(); + + public static ApplicationsApiService getApplicationsApi() { + return service; + } +} diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/impl/ApplicationsApiServiceImpl.java b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/impl/ApplicationsApiServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..d437ef3afb9541f5dac816b87f077fcd5cba8a27 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/impl/ApplicationsApiServiceImpl.java @@ -0,0 +1,177 @@ +/********************************************************************* +* Copyright (c) 2018 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia +* Gorka Benguria Tecnalia +* Iñaki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.decideh2020.optimus.server.api.impl; + +import java.util.ArrayList; +import java.util.Random; +import eu.decideh2020.optimus.server.api.*; +import eu.decideh2020.optimus.server.model.*; + +import javax.ws.rs.core.Response; +import javax.ws.rs.core.SecurityContext; +@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen", date = "2018-03-06T15:32:29.649Z") +public class ApplicationsApiServiceImpl extends ApplicationsApiService { + + ArrayList<Simulation> SimsLaunched = new ArrayList<Simulation>(); + SimQueue SimQ = SimQueue.getInstance( ); + + @Override + public Response createsSimulationUsingPOST(Simulation simulation, SecurityContext securityContext) throws NotFoundException { + + SimQueue SimQ = SimQueue.getInstance( ); + //Simulation currentsim = simulation; + Simulation simlaunch = new Simulation(); + int simid = Math.abs((new Random()).nextInt()); + simlaunch.setSimid(simid); + //currentsim.isCorrect(currentsim); + //some method to validate the data and returning ok or not Ok. + // where has to be placed this method? in Simulation class for now. + simlaunch.setStatus("started"); + simlaunch.setAppurl(simulation.getAppurl()); + SimsLaunched.add(simlaunch); + SimQ.add(simlaunch); + //System.out.println(simlaunch.getAppurl()); + ReturnedSimulation returnedsimulation = new ReturnedSimulation(); + returnedsimulation.setSimid(simlaunch.getSimid()); + returnedsimulation.setStatus(simlaunch.getStatus()); + + ArrayList<ReturnedSimulation> simsreturned = new ArrayList<ReturnedSimulation>(); + simsreturned.add(returnedsimulation); + +// ObjectMapper mapper = new ObjectMapper(); +// //Object to JSON in file +// //Object to JSON in String +// String jsonInString = ""; +// try { +// jsonInString = mapper.writeValueAsString(simsreturned); +// } catch (JsonProcessingException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } + //System.out.println("jsonstring"+jsonInString); + //return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, jsonInString)).build(); + //Change the way swagger generates the response, because a simpler build works + return Response.ok().entity(simsreturned).build(); + } + @Override + public Response getAllSimulationsUsingGET(SecurityContext securityContext) throws NotFoundException { + // do some magic! + SimQueue SimQ = SimQueue.getInstance( ); + ArrayList<ReturnedSimulation> SimsReturned = new ArrayList<ReturnedSimulation>(); + +// I do not build the response with ReturnedSimulation objects because of the format that they are shown in swagger, but I should be aware + // of the kind of object that is going to need every tool who asks for these REST services. + for (int i=0;i<SimQ.size();i++) + { + + Simulation simselected = new Simulation(); + ReturnedSimulation simret = new ReturnedSimulation(); + ArrayList<ReturnedSimulation> simsreturned = new ArrayList<ReturnedSimulation>(); + + simselected = SimQ.element(); + if (simselected!=null ) { + simret.setSimid(simselected.getSimid()); + simret.setStatus(simselected.getStatus()); + //simret.setSc(simselected.getSc()); + + + + } + simsreturned.add(simret); +} +// { //ReturnedSimulation simselected = new ReturnedSimulation(); +// //simselected.setSimid(SimsLaunched.get(i).getSimid()); +// //simselected.setStatus(SimsLaunched.get(i).getStatus()); +// simselected.setStatus(SimsLaunched.get(i).getStatus()); +// simselected.setSimid(SimsLaunched.get(i).getSimid()); +// SimsReturned.add(simselected); +// } + //GenericEntity<List<ReturnedSimulation>> aux = new GenericEntity<List<ReturnedSimulation>>(Lists.newArrayList(SimsReturned)) {}; + + return Response.ok().entity(SimsReturned).build(); + } + + + @Override + public Response getSchemaUsingGET(Integer simid, SecurityContext securityContext) throws NotFoundException { + // do some magic! + + ReturnedSc simret = new ReturnedSc(); + ArrayList<ReturnedSc> schreturned = new ArrayList<ReturnedSc>(); + for (Simulation simselected : SimsLaunched) { + + //while (true) { + + if (simselected!=null && simselected.getSimid().equals(simid)) { + //simret.setSimid(simid); + //simret.setStatus(simselected.getStatus()); + //for + for (ReturnedSc scret : simselected.getSc()) { + + schreturned.add(scret); + } + break; + } + + } + + return Response.ok().entity(schreturned).build(); + } + @Override + public Response deleteASimulationUsingDELETE(Integer simid, SecurityContext securityContext) + throws NotFoundException { + // do some magic! + SimsLaunched.remove(SimsLaunched.get(simid)); + return Response.ok().entity("Removed Simulation "+simid).build(); + } + @Override + public Response getSimulationUsingGET(Integer simid, SecurityContext securityContext) throws NotFoundException { + //SimQueue SimQ = SimQueue.getInstance( ); + ReturnedSimulation simret = new ReturnedSimulation(); + ArrayList<ReturnedSimulation> simsreturned = new ArrayList<ReturnedSimulation>(); + for (Simulation simselected : SimsLaunched) { + + //while (true) { + + if (simselected!=null && simselected.getSimid().equals(simid)) { + simret.setSimid(simid); + simret.setStatus(simselected.getStatus()); + //simret.setSc(simselected.getSc()); + break; + } + + } + simsreturned.add(simret); + +// for (int i=0;i<SimsLaunched.size();i++) +// { +// +// if (SimsLaunched.get(i).getSimid() == simid) +// { +// simselected.setStatus(SimsLaunched.get(i).getStatus()); +// simselected.setSimid(simid); +// simsreturned.add(simselected); +// break; +// } +// } + return Response.ok().entity(simsreturned).build(); + } + + +} diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/impl/Attribute.java b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/impl/Attribute.java new file mode 100644 index 0000000000000000000000000000000000000000..4408f325fd5a69a71b73259f7a59de3cf97d9949 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/impl/Attribute.java @@ -0,0 +1,67 @@ +/********************************************************************* +* Copyright (c) 2018 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia +* Gorka Benguria Tecnalia +* Iñaki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.decideh2020.optimus.server.api.impl; + +import java.util.ArrayList; +import java.util.List; + +public class Attribute { + private int typeid; + private int childid; + private String name; + private String value; + private String unit; + + public int getTypeid() { + return typeid; + } + + public void setTypeid(int id) { + this.typeid = id; + } + public int getChildid() { + return childid; + } + + public void setChildid(int id) { + this.childid = id; + } + public String getName() { + return name; + } + + public void setName(String id) { + this.name = id; + } + public String getValue() { + return value; + } + + public void setValue(String val) { + this.value = val; + } + public String getUnit() { + return unit; + } + + public void setUnit(String un) { + this.unit = un; + } + +} diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/impl/Filter.java b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/impl/Filter.java new file mode 100644 index 0000000000000000000000000000000000000000..007a4d2d120eee3cea7975a300b796f754255d93 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/impl/Filter.java @@ -0,0 +1,47 @@ +/********************************************************************* +* Copyright (c) 2018 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia +* Gorka Benguria Tecnalia +* Iñaki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.decideh2020.optimus.server.api.impl; + +import java.util.ArrayList; +import java.util.List; + +import eu.DECIDEh2020.appManager.models.DetachableResource; + +public class Filter { + private int classid; + private List<Attribute> attributes = new ArrayList<>(); + + + + public int getClassid() { + return classid; + } + + public void setClassid(int id) { + this.classid = id; + } + public List<Attribute> getAttributes() { + return this.attributes; + } + + public void setAttributes(List<Attribute> att) { + this.attributes = att; + } + + } diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/impl/SimQueue.java b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/impl/SimQueue.java new file mode 100644 index 0000000000000000000000000000000000000000..a65444f282993b2023386843023827486f3b4d6d --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/main/java/eu/decideh2020/optimus/server/api/impl/SimQueue.java @@ -0,0 +1,48 @@ +/********************************************************************* +* Copyright (c) 2018 Tecnalia. +* +* This program and the accompanying materials are made +* available under the terms of the Eclipse Public License 2.0 +* which is available at https://www.eclipse.org/legal/epl-2.0/ +* +* SPDX-License-Identifier: EPL-2.0 +* Contributors (in alphabetical order): +* Alberto Molinuevo Tecnalia +* Gorka Benguria Tecnalia +* Iñaki Etxaniz Tecnalia +* Juncal Alonso Tecnalia +* Leire Orue-Echevarria Tecnalia +* Maria Jose Lopez Tecnalia +* Marisa Escalante Tecnalia +* Initially developed in the context of DECIDE EU project www.DECIDE-h2020.eu +**********************************************************************/ +package eu.decideh2020.optimus.server.api.impl; + +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Queue; + +import eu.decideh2020.optimus.server.model.Simulation; + +/** + * @author 106819 + * + */ +public class SimQueue extends LinkedList<Simulation> { + + private static SimQueue instance = null; + private SimQueue() { + // Exists only to defeat instantiation. + } + + public static SimQueue getInstance() { + if(instance == null) { + instance = new SimQueue(); + } + return instance; + } + + + +} diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/main/resources/optimus.server.properties b/OPTIMUS/eu.decideh2020.optimus.server/src/main/resources/optimus.server.properties new file mode 100644 index 0000000000000000000000000000000000000000..de34fbdc135056ee4885a058c82c1033bf464dd3 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/main/resources/optimus.server.properties @@ -0,0 +1 @@ +localAppDesc="D:\\W\2017-Decide\\workspace\\AppsDescFolder\\" diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/main/resources/swagger/swagger.json b/OPTIMUS/eu.decideh2020.optimus.server/src/main/resources/swagger/swagger.json new file mode 100644 index 0000000000000000000000000000000000000000..9ce7cbe75942429592c7d51b2d59d74e3a0942d3 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/main/resources/swagger/swagger.json @@ -0,0 +1,254 @@ +{ + "swagger": "2.0", + "info": { + "description": "optimus simulation API documentation", + "version": "0.0.1", + "title": "optimus simulation API" + }, + "host": "localhost:8080", + "basePath": "/optimussimulation", + "schemes": [ + "http" + ], + "paths": { + "/applications": { + "get": { + "description": "Gets the list of the triggered simulations registered , including the id and the status of the simulation. The simid would be an readble identification, build with the information about the application", + "summary": "getAllSimulations", + "operationId": "getAllSimulationsUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "the simulation being returned", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/returnedSimulation" + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + }, + "post": { + "description": "Creates a trigeredSimulation", + "summary": "createsSimulation", + "operationId": "createsSimulationUsingPOST", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "in": "body", + "name": "simulation", + "required": true, + "schema": { + "$ref": "#/definitions/Simulation" + } + } + ], + "responses": { + "200": { + "description": "simulation created", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/returnedSimulation" + } + } + }, + "401": { + "description": "Unauthorized", + "schema": { + "type": "string" + } + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/applications/{simid}": { + "get": { + "summary": "getSimulation", + "operationId": "getSimulationUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "simid", + "in": "path", + "description": "readable format of the id of one specific simulation", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "the specific simulation being returned", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/returnedSimulation" + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/applications/schema/{simid}": { + "get": { + "description": "Gets the schema", + "summary": "getSchema", + "operationId": "getSchemaUsingGET", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "simid", + "in": "path", + "description": "readable format of the id of one specific simulation", + "required": true, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "the schema being returned", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/returnedSchema" + } + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + } + } + }, + "/applications/delete/{simid}": { + "delete": { + "summary": "deleteSimulation", + "operationId": "deleteASimulationUsingDELETE", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "simid", + "in": "path", + "description": "readable format of the id of one specific simulation", + "required": true, + "type": "integer" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + } + } + } + }, + "definitions": { + "Simulation": { + "type": "object", + "properties": { + "simid": { + "type": "integer" + }, + "appurl": { + "type": "string" + }, + "status": { + "type": "string" + }, + "sc": { + "type": "string" + } + } + }, + "returnedSimulation": { + "type": "object", + "properties": { + "simid": { + "type": "integer" + }, + "status": { + "type": "string" + } + } + }, + "returnedSchema": { + "type": "object", + "properties": { + "simid": { + "type": "integer" + }, + "status": { + "type": "string" + }, + "sc": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/OPTIMUS/eu.decideh2020.optimus.server/src/main/webapp/WEB-INF/web.xml b/OPTIMUS/eu.decideh2020.optimus.server/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000000000000000000000000000000000000..9c946d1ec1f65fbccd034cfb1548e061d74f5232 --- /dev/null +++ b/OPTIMUS/eu.decideh2020.optimus.server/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> + + <servlet> + <servlet-name>jersey</servlet-name> + <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> + <init-param> + <param-name>jersey.config.server.provider.packages</param-name> + <param-value> + io.swagger.jaxrs.listing, + io.swagger.sample.resource, + eu.decideh2020.optimus.server.api + </param-value> + </init-param> + <init-param> + <param-name>jersey.config.server.provider.classnames</param-name> + <param-value>org.glassfish.jersey.media.multipart.MultiPartFeature</param-value> + </init-param> + <init-param> + <param-name>jersey.config.server.wadl.disableWadl</param-name> + <param-value>true</param-value> + </init-param> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet> + <servlet-name>Jersey2Config</servlet-name> + <servlet-class>io.swagger.jersey.config.JerseyJaxrsConfig</servlet-class> + <init-param> + <param-name>api.version</param-name> + <param-value>1.0.0</param-value> + </init-param> + <init-param> + <param-name>swagger.api.title</param-name> + <param-value>Swagger Server</param-value> + </init-param> + <init-param> + <param-name>swagger.api.basepath</param-name> + <param-value>http://localhost:8080/optimussimulation</param-value> + </init-param> + + <load-on-startup>2</load-on-startup> + </servlet> + <servlet> + <servlet-name>Bootstrap</servlet-name> + <servlet-class>eu.decideh2020.optimus.server.api.Bootstrap</servlet-class> + <load-on-startup>2</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>jersey</servlet-name> + <url-pattern>/optimussimulation/*</url-pattern> + </servlet-mapping> + <filter> + <filter-name>ApiOriginFilter</filter-name> + <filter-class>eu.decideh2020.optimus.server.api.ApiOriginFilter</filter-class> + </filter> + <filter-mapping> + <filter-name>ApiOriginFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> +</web-app>