Skip to content

Commit

Permalink
Created HTTP+MQTT package: FROST-Server.MQTTP and removed MQTT from F…
Browse files Browse the repository at this point in the history
…ROST-Server.HTTP
  • Loading branch information
hylkevds committed Apr 11, 2018
1 parent 1fdefdf commit 44d14df
Show file tree
Hide file tree
Showing 26 changed files with 2,300 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -16,6 +16,7 @@ release.properties
/FROST-Server.HTTP/target/
/FROST-Server.SQL.PGUuid/target/
/FROST-Server.MQTT/target/
/FROST-Server.MQTTP/target/

FROST-Server.HTTP/keycloak.json
FROST-Server.MQTT/FrostMqtt.properties
Expand Down
12 changes: 4 additions & 8 deletions .travis.yml
Expand Up @@ -9,14 +9,10 @@ branches:

after_success:
- test "${TRAVIS_PULL_REQUEST}" == "false" && test "${TRAVIS_TAG}" != "" && mvn deploy --settings travis-settings.xml
- mvn dockerfile:build -pl FROST-Server.HTTP
- mvn dockerfile:tag@tag-version -pl FROST-Server.HTTP
- mvn dockerfile:push@push-latest -Ddockerfile.useMavenSettingsForAuth=true -pl FROST-Server.HTTP --settings travis-settings.xml
- mvn dockerfile:push@push-version -Ddockerfile.useMavenSettingsForAuth=true -pl FROST-Server.HTTP --settings travis-settings.xml
- mvn dockerfile:build -pl FROST-Server.MQTT
- mvn dockerfile:tag@tag-version -pl FROST-Server.MQTT
- mvn dockerfile:push@push-latest -Ddockerfile.useMavenSettingsForAuth=true -pl FROST-Server.MQTT --settings travis-settings.xml
- mvn dockerfile:push@push-version -Ddockerfile.useMavenSettingsForAuth=true -pl FROST-Server.MQTT --settings travis-settings.xml
- mvn dockerfile:build -pl FROST-Server.HTTP,FROST-Server.MQTT,FROST-Server.MQTTP
- mvn dockerfile:tag@tag-version -pl FROST-Server.HTTP,FROST-Server.MQTT,FROST-Server.MQTTP
- mvn dockerfile:push@push-latest -Ddockerfile.useMavenSettingsForAuth=true -pl FROST-Server.HTTP,FROST-Server.MQTT,FROST-Server.MQTTP --settings travis-settings.xml
- mvn dockerfile:push@push-version -Ddockerfile.useMavenSettingsForAuth=true -pl FROST-Server.HTTP,FROST-Server.MQTT,FROST-Server.MQTTP --settings travis-settings.xml
sudo: required

services:
Expand Down
2 changes: 1 addition & 1 deletion FROST-Server.Core/src/test/resources/logback-test.xml
Expand Up @@ -11,7 +11,7 @@
<logger name="de.fraunhofer.iosb.ilt.sta.persistence.postgres.PostgresPersistenceManager" level="INFO"/>
<logger name="com.querydsl" level="INFO"/>

<root level="DEBUG">
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>
7 changes: 1 addition & 6 deletions FROST-Server.HTTP/pom.xml
Expand Up @@ -16,7 +16,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<docker-image-name>fraunhoferiosb/frost-server</docker-image-name>
<docker-image-name>fraunhoferiosb/frost-server-http</docker-image-name>
</properties>

<dependencies>
Expand Down Expand Up @@ -45,11 +45,6 @@
<artifactId>FROST-Server.SQL.PGUuid</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>FROST-Server.MQTT.Moquette</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
Expand Down
Expand Up @@ -62,8 +62,6 @@ public void contextInitialized(ServletContextEvent sce) {

PersistenceManagerFactory.init(coreSettings);
MessageBusFactory.init(coreSettings);
MqttManager.init(coreSettings);
MessageBusFactory.getMessageBus().addMessageListener(MqttManager.getInstance());
}
}

Expand Down
16 changes: 1 addition & 15 deletions FROST-Server.HTTP/src/main/webapp/META-INF/context.xml
Expand Up @@ -13,23 +13,9 @@
<Parameter override="false" name="maxTop" value="1000" description="The maximum allowed value for the $top query option."/>
<Parameter override="false" name="maxDataSize" value="25000000" description="The maximum allowed estimated data size (in bytes) for responses."/>
<Parameter override="false" name="useAbsoluteNavigationLinks" value="true" description="If true, navigationLinks are absolute, otherwise relative."/>
<!-- MQTT setting -->
<Parameter override="false" name="mqtt.mqttServerImplementationClass" value="de.fraunhofer.iosb.ilt.sensorthingsserver.mqtt.moquette.MoquetteMqttServer" description="The java class used for running the MQTT server (must implement MqttServer interface)"/>
<Parameter override="false" name="mqtt.Enabled" value="true" description="Specifies wether MQTT support will be enabled or not."/>
<Parameter override="false" name="mqtt.Port" value="1883" description="The port the MQTT server runs on."/>
<Parameter override="false" name="mqtt.QoS" value="0" description="Quality of Service Level for MQTT messages."/>
<Parameter override="false" name="mqtt.SubscribeMessageQueueSize" value="100" description="Queue size for messages to be pubslihed via MQTT."/>
<Parameter override="false" name="mqtt.SubscribeThreadPoolSize" value="20" description="Number of threads use to dispatch MQTT notifications."/>
<Parameter override="false" name="mqtt.CreateMessageQueueSize" value="100" description="Queue size for create observation requests via MQTT ."/>
<Parameter override="false" name="mqtt.CreateThreadPoolSize" value="10" description="Number of threads use to dispatch observation creation requests."/>
<Parameter override="false" name="mqtt.Host" value="0.0.0.0" description="The external IP address or host name the MQTT server should listen on. Set to 0.0.0.0 to listen on all interfaces."/>
<Parameter override="false" name="mqtt.internalHost" value="localhost" description="The internal host name of the MQTT server."/>
<Parameter override="false" name="mqtt.WebsocketPort" value="9876" description="The port the MQTT server is reachable via WebSocket."/>
<!-- bus setting -->
<!--
<Parameter override="false" name="bus.busImplementationClass" value="de.fraunhofer.iosb.ilt.sta.messagebus.MqttMessageBus" description="The java class used for connecting to the message bus."/>
<Parameter override="false" name="bus.mqttBroker" value="tcp://127.0.0.1:1884" description="The MQTT broker to use as message bus"/>
-->
<Parameter override="false" name="bus.mqttBroker" value="tcp://mosquito:1883" description="The MQTT broker to use as message bus"/>
<!-- persistence setting -->
<Parameter override="false" name="persistence.persistenceManagerImplementationClass" value="de.fraunhofer.iosb.ilt.sta.persistence.postgres.longid.PostgresPersistenceManagerLong" description="The java class used for persistence (must implement PersistenceManaher interface)"/>
<!-- All options:
Expand Down
8 changes: 8 additions & 0 deletions FROST-Server.MQTTP/Dockerfile
@@ -0,0 +1,8 @@
From tomcat:8-jre8

ADD http://repo.maven.apache.org/maven2/org/postgresql/postgresql/9.4.1212/postgresql-9.4.1212.jar /usr/local/tomcat/lib/
ADD http://repo.maven.apache.org/maven2/net/postgis/postgis-jdbc/2.2.1/postgis-jdbc-2.2.1.jar /usr/local/tomcat/lib/

# Copy to images tomcat path
ARG WAR_FILE
ADD target/${WAR_FILE} /usr/local/tomcat/webapps/FROST-Server.war
34 changes: 34 additions & 0 deletions FROST-Server.MQTTP/nb-configuration.xml
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.7-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
<org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder>js/libs</org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder>
<org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>Tomcat</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-line-wrap>none</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-line-wrap>
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width>4</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.indent-shift-width>
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab>4</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.spaces-per-tab>
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size>4</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.tab-size>
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-limit-width>80</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.text-limit-width>
<org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs>true</org-netbeans-modules-editor-indent.text.x-java.CodeStyle.project.expand-tabs>
<org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap>none</org-netbeans-modules-editor-indent.CodeStyle.project.text-line-wrap>
<org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>4</org-netbeans-modules-editor-indent.CodeStyle.project.indent-shift-width>
<org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab>4</org-netbeans-modules-editor-indent.CodeStyle.project.spaces-per-tab>
<org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>8</org-netbeans-modules-editor-indent.CodeStyle.project.tab-size>
<org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>80</org-netbeans-modules-editor-indent.CodeStyle.project.text-limit-width>
<org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>true</org-netbeans-modules-editor-indent.CodeStyle.project.expand-tabs>
<org-netbeans-modules-editor-indent.CodeStyle.usedProfile>project</org-netbeans-modules-editor-indent.CodeStyle.usedProfile>
<org-netbeans-modules-whitelist.whitelist-oracle>false</org-netbeans-modules-whitelist.whitelist-oracle>
</properties>
</project-shared-configuration>
180 changes: 180 additions & 0 deletions FROST-Server.MQTTP/pom.xml
@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>de.fraunhofer.iosb.ilt.FROST-Server</groupId>
<artifactId>FROST-ServerParent</artifactId>
<version>1.6-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>FROST-Server.MQTTP</artifactId>
<packaging>war</packaging>

<name>FROST-Server.MQTTP</name>
<description>The web-application making the FROST-Server available over HTTP and MQTT.</description>
<url>https://github.com/FraunhoferIOSB/FROST-Server</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<docker-image-name>fraunhoferiosb/frost-server</docker-image-name>
</properties>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>FROST-Server.Core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>FROST-Server.SQL</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>FROST-Server.SQL.PGLong</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>FROST-Server.SQL.PGString</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>FROST-Server.SQL.PGUuid</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>FROST-Server.MQTT.Moquette</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
<compilerArguments>
<endorseddirs>${endorsed.dir}</endorseddirs>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archiveClasses>true</archiveClasses>
<attachClasses>true</attachClasses>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<outputDirectory>${endorsed.dir}</outputDirectory>
<silent>true</silent>
<artifactItems>
<artifactItem>
<groupId>javax</groupId>
<artifactId>javaee-endorsed-api</artifactId>
<version>7.0</version>
<type>jar</type>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile-maven-plugin.version}</version>
<executions>
<execution>
<id>build-and-tag-latest</id>
<phase>none</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>tag-version</id>
<phase>none</phase>
<goals>
<goal>tag</goal>
</goals>
<configuration>
<tag>${project.version}</tag>
</configuration>
</execution>
<execution>
<id>push-latest</id>
<phase>none</phase>
<goals>
<goal>push</goal>
</goals>
<configuration>
<tag>latest</tag>
</configuration>
</execution>
<execution>
<id>push-version</id>
<phase>none</phase>
<goals>
<goal>push</goal>
</goals>
<configuration>
<tag>${project.version}</tag>
</configuration>
</execution>
</executions>
<configuration>
<repository>${docker-image-name}</repository>
<buildArgs>
<WAR_FILE>${project.build.finalName}.war</WAR_FILE>
</buildArgs>
</configuration>
<dependencies>
<!-- Java 9 support -->
<dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>${javax-activation.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

</project>

0 comments on commit 44d14df

Please sign in to comment.