Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into opensource
Browse files Browse the repository at this point in the history
  • Loading branch information
coenvl committed Jul 20, 2020
2 parents b659146 + e8882f1 commit abb5615
Show file tree
Hide file tree
Showing 21 changed files with 67 additions and 36 deletions.
3 changes: 1 addition & 2 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<parent>
<groupId>org.flexiblepower.defpi</groupId>
<artifactId>master</artifactId>
<version>20.04</version>
<relativePath>../master/pom.xml</relativePath>
<version>20.04.1</version>
</parent>

<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions codegen-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.flexiblepower.defpi</groupId>
<artifactId>master</artifactId>
<version>20.04</version>
<version>20.04.1</version>
<relativePath>../master/pom.xml</relativePath>
</parent>

Expand All @@ -33,7 +33,7 @@
<dependency>
<groupId>org.raml</groupId>
<artifactId>raml-parser-2</artifactId>
<version>1.0.39</version>
<version>1.0.51</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static String getOsName() {
* @return The name of the current system architecture (e.g x86_64, x64_32).
*/
static String getArchitecture() {
return System.getProperty("os.arch").equals("amd64") ? "x86_64" : "x86_32";
return System.getProperty("os.arch").contains("64") ? "x86_64" : "x86_32";
}

/**
Expand Down
2 changes: 1 addition & 1 deletion commons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.flexiblepower.defpi</groupId>
<artifactId>master</artifactId>
<version>20.04</version>
<version>20.04.1</version>
<relativePath>../master/pom.xml</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions dashboard-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.flexiblepower.defpi</groupId>
<artifactId>defpi-service</artifactId>
<version>20.04</version>
<version>20.04.1</version>
<relativePath>../master/service-parent/defpi-service/pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -39,7 +39,7 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.4.26.v20200117</version>
<version>9.4.30.v20200611</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down
6 changes: 3 additions & 3 deletions dashboard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.flexiblepower.defpi</groupId>
<artifactId>defpi-service</artifactId>
<version>20.04</version>
<version>20.04.1</version>
<relativePath>../master/service-parent/defpi-service/pom.xml</relativePath>
</parent>

Expand Down Expand Up @@ -51,13 +51,13 @@
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-client</artifactId>
<version>3.3.5</version>
<version>3.3.7</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider -->
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.10.2</version>
<version>2.11.1</version>
</dependency>
</dependencies>

Expand Down
22 changes: 11 additions & 11 deletions master/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>org.flexiblepower.defpi</groupId>
<artifactId>master</artifactId>
<version>20.04</version>
<version>20.04.1</version>
<packaging>pom</packaging>

<name>dEF-Pi master POM</name>
Expand Down Expand Up @@ -64,13 +64,13 @@

<!-- The plugin needs the protobuf version to obtain the compiler from
maven central explicitly -->
<protobuf.version>3.11.3</protobuf.version>
<jackson.databind.version>2.10.2</jackson.databind.version>
<json.version>20190722</json.version>
<mongodb.version>3.12.1</mongodb.version>
<log4j.version>2.13.0</log4j.version>
<swagger.version>1.6.0</swagger.version>
<junit.version>5.6.0</junit.version>
<protobuf.version>3.12.2</protobuf.version>
<jackson.databind.version>2.11.1</jackson.databind.version>
<json.version>20200518</json.version>
<mongodb.version>3.12.6</mongodb.version>
<log4j.version>2.13.3</log4j.version>
<swagger.version>1.6.2</swagger.version>
<junit.version>5.6.2</junit.version>
</properties>

<prerequisites>
Expand Down Expand Up @@ -116,7 +116,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.10</version>
<version>1.18.12</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -147,7 +147,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20190722</version>
<version>${json.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -219,7 +219,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M2</version>
<version>3.0.0-M5</version>
<configuration>
<systemProperties>
<property>
Expand Down
6 changes: 3 additions & 3 deletions master/service-parent/defpi-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.flexiblepower.defpi</groupId>
<artifactId>service-parent</artifactId>
<version>20.04</version>
<version>20.04.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand All @@ -27,12 +27,12 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20190722</version>
<version>20200518</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
<version>2.7</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
6 changes: 3 additions & 3 deletions master/service-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.flexiblepower.defpi</groupId>
<artifactId>service-parent</artifactId>
<version>20.04</version>
<version>20.04.1</version>
<packaging>pom</packaging>

<name>dEF-Pi service parent POM</name>
Expand Down Expand Up @@ -65,15 +65,15 @@
<java.target>1.8</java.target>
<license.licenseName>apache_v2</license.licenseName>

<defpi.version>20.04</defpi.version>
<defpi.version>20.04.1</defpi.version>

<defpi.sources.generated>${project.build.directory}/generated-sources/java</defpi.sources.generated>
<defpi.resources.generated>${project.build.directory}/generated-resources/defpi</defpi.resources.generated>
<defpi.service.resources>defpi-resources</defpi.service.resources>
<defpi.dockerfolder.x86>docker</defpi.dockerfolder.x86>
<defpi.dockerfolder.arm>docker-arm</defpi.dockerfolder.arm>

<protobuf.version>3.11.1</protobuf.version>
<protobuf.version>3.12.2</protobuf.version>

<!-- Main class for any service should be the main from the library -->
<mainClass>org.flexiblepower.service.ServiceMain</mainClass>
Expand Down
2 changes: 1 addition & 1 deletion maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<parent>
<groupId>org.flexiblepower.defpi</groupId>
<artifactId>master</artifactId>
<version>20.04</version>
<version>20.04.1</version>
<relativePath>../master/pom.xml</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions orchestrator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<parent>
<groupId>org.flexiblepower.defpi</groupId>
<artifactId>master</artifactId>
<version>20.04</version>
<version>20.04.1</version>
<relativePath>../master/pom.xml</relativePath>
</parent>

<properties>
<jersey.version>2.30</jersey.version>
<jersey.version>2.31</jersey.version>

<project.resourcedir>${project.basedir}/src/main/resources</project.resourcedir>
<mainClass>org.flexiblepower.orchestrator.Main</mainClass>
Expand Down
2 changes: 1 addition & 1 deletion python-codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.flexiblepower.defpi</groupId>
<artifactId>master</artifactId>
<version>20.04</version>
<version>20.04.1</version>
<relativePath>../master/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion raml-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<parent>
<groupId>org.flexiblepower.defpi</groupId>
<artifactId>master</artifactId>
<version>20.04</version>
<version>20.04.1</version>
<relativePath>../master/pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ public String remoteProcessId() {
return null;
}

@Override
public String remoteProcessName() {
return null;
}

@Override
public String remoteServiceId() {
return null;
Expand Down
2 changes: 1 addition & 1 deletion service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.flexiblepower.defpi</groupId>
<artifactId>master</artifactId>
<version>20.04</version>
<version>20.04.1</version>
<relativePath>../master/pom.xml</relativePath>
</parent>

Expand Down
11 changes: 9 additions & 2 deletions service/src/main/java/org/flexiblepower/service/Connection.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -66,6 +66,13 @@ public interface Connection {
*/
public String remoteProcessId();

/**
* Returns the remote process name of the current process.
*
* @return the remote process name.
*/
public String remoteProcessName();

/**
* Returns the remote service identifier of the service corresponding to the current process.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ private Message createConnection(final ConnectionMessage message) throws Connect
message.getTargetAddress(),
info,
message.getRemoteProcessId(),
message.getRemoteProcessName(),
message.getRemoteServiceId(),
message.getRemoteInterfaceId());
this.connections.put(message.getConnectionId(), conn);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ final class TCPConnection implements Connection, Closeable {

private volatile ConnectionState state;
private final String remoteProcessId;
private final String remoteProcessName;
private final String remoteServiceId;
private final String remoteInterfaceId;

Expand All @@ -132,6 +133,7 @@ final class TCPConnection implements Connection, Closeable {
* client, or an empty string when it should act as a server.
* @param info the InterfaceInfo the appropriate ConnectionHandler is annotated with.
* @param remoteProcessId The process ID of the remote endpoint as specified by the orchestrator
* @param remoteProcessName The process name of the remote endpoint as specified by the orchestrator
* @param remoteServiceId The service ID of the remote process as specified by the orchestrator
* @param remoteInterfaceId The interface ID of the remote service
*/
Expand All @@ -141,6 +143,7 @@ final class TCPConnection implements Connection, Closeable {
final String targetAddress,
final InterfaceInfo info,
final String remoteProcessId,
final String remoteProcessName,
final String remoteServiceId,
final String remoteInterfaceId) {
this.state = ConnectionState.STARTING;
Expand All @@ -149,6 +152,7 @@ final class TCPConnection implements Connection, Closeable {
this.targetAddress = targetAddress;
this.info = info;
this.remoteProcessId = remoteProcessId;
this.remoteProcessName = remoteProcessName;
this.remoteServiceId = remoteServiceId;
this.remoteInterfaceId = remoteInterfaceId;

Expand Down Expand Up @@ -231,6 +235,11 @@ public String remoteProcessId() {
return this.remoteProcessId;
}

@Override
public String remoteProcessName() {
return this.remoteProcessName;
}

@Override
public String remoteServiceId() {
return this.remoteServiceId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,15 @@ public void testNormalConnection() throws Exception {
info,
"",
"",
"",
"");
final TCPConnection mc2 = new TCPConnection("CIT",
ConnectionIntegrationTest.TEST_PORT,
"localhost",
info,
"",
"",
"",
"")) {
Assertions.assertEquals("connected", TestHandler.stateQueue.take());
Assertions.assertEquals("connected", TestHandler.stateQueue.take());
Expand All @@ -91,13 +93,15 @@ public void testSuspendAndResume() throws Exception {
info,
"",
"",
"",
"");
final TCPConnection mc2 = new TCPConnection("CIT",
ConnectionIntegrationTest.TEST_PORT,
"localhost",
info,
"",
"",
"",
"")) {

Assertions.assertEquals("connected", TestHandler.stateQueue.take());
Expand Down Expand Up @@ -136,6 +140,7 @@ public void testInterruptDetectionAndResume() throws Exception {
info,
"",
"",
"",
"")) {
try (
final TCPConnection mc1 = new TCPConnection("CIT",
Expand All @@ -144,6 +149,7 @@ public void testInterruptDetectionAndResume() throws Exception {
info,
"",
"",
"",
"")) {
Assertions.assertEquals("connected", TestHandler.stateQueue.take());
Assertions.assertEquals("connected", TestHandler.stateQueue.take());
Expand All @@ -167,6 +173,7 @@ public void testInterruptDetectionAndResume() throws Exception {
info,
"",
"",
"",
"")) {
final String recv1 = TestHandler.messageQueue.take();
final String recv2 = TestHandler.messageQueue.take();
Expand Down
Loading

0 comments on commit abb5615

Please sign in to comment.