Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package refactoring #172

Merged
merged 11 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/resources/linux/CorreoMQTT.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Name=CorreoMQTT
Comment=CorreoMQTT
Exec=/opt/correomqtt/bin/CorreoMQTT
Icon=/opt/correomqtt/lib/CorreoMQTT.png
StartupWMClass=org.correomqtt.CorreoMqtt
StartupWMClass=org.correomqtt.JavaFXApplication
Terminal=false
Type=Application
Categories=Unknown
Expand Down
16 changes: 16 additions & 0 deletions bundled.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"versions": {
"0.15.0": {
"install": [
"advanced-validator-plugin",
"base64-plugin",
"json-format-plugin",
"xml-format-plugin",
"save-manipulator-plugin",
"contains-string-validator-plugin",
"systopic-plugin"
],
"uninstall": []
}
}
}
265 changes: 265 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
<?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>

<artifactId>core</artifactId>

<name>CorreoMQTT Core</name>
<description>A modern graphical MQTT client using the HiveMQ client library.</description>
<url>https://github.com/EXXETA/correomqtt</url>

<parent>
<groupId>org.correomqtt</groupId>
<artifactId>correomqtt</artifactId>
<version>0.15.0</version>
</parent>

<licenses>
<license>
<name>GPL-3.0</name>
<url>https://github.com/EXXETA/correomqtt/blob/master/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>

<scm>
<connection>scm:git:https://github.com/EXXETA/correomqtt.git</connection>
<url>https://github.com/EXXETA/correomqtt</url>
</scm>

<packaging>jar</packaging>

<developers>
<developer>
<name>Frieder Reinhold</name>
<email>frieder.reinhold@exxeta.com</email>
<organizationUrl>http://www.exxeta.com</organizationUrl>
</developer>
</developers>

<properties>
<graalvm.version>23.1.1</graalvm.version>
</properties>

<repositories>
<repository>
<id>scijava</id>
<url>https://maven.scijava.org/content/repositories/releases/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.hivemq</groupId>
<artifactId>hivemq-mqtt-client</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
</dependency>
<dependency>
<groupId>com.hierynomus</groupId>
<artifactId>sshj</artifactId>
<version>0.38.0</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>

<dependency>
<groupId>com.github.javakeyring</groupId>
<artifactId>java-keyring</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>de.swiesend</groupId>
<artifactId>secret-service</artifactId>
<version>1.8.1-jdk17</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.peter-gergely-horvath</groupId>
<artifactId>windpapi4j</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>polyglot</artifactId>
<version>${graalvm.version}</version>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>js</artifactId>
<version>${graalvm.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>tools</artifactId>
<version>${graalvm.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.graalvm.truffle</groupId>
<artifactId>truffle-api</artifactId>
<version>${graalvm.version}</version>
</dependency>
<dependency>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.pf4j</groupId>
<artifactId>pf4j</artifactId>
</dependency>
<dependency>
<groupId>org.pf4j</groupId>
<artifactId>pf4j-update</artifactId>
</dependency>

<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>1.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.correomqtt</groupId>
<artifactId>di</artifactId>
</dependency>

<!-- Test Scope -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
</dependencies>


<build>
<resources>
<resource>
<filtering>false</filtering>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.12.1</version>
<configuration>
<release>${maven.compiler.release}</release>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>org.correomqtt</groupId>
<artifactId>di</artifactId>
<version>0.15.0</version>
</annotationProcessorPath>
<annotationProcessorPath>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</annotationProcessorPath>
<annotationProcessorPath>
<groupId>org.pf4j</groupId>
<artifactId>pf4j</artifactId>
<version>3.9.0</version>
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
<manifestEntries>
<Plugin-Class></Plugin-Class>
<Plugin-Id>core</Plugin-Id>
<Plugin-Version>${project.version}</Plugin-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<dependencies>

</dependencies>
<configuration>
<forkCount>1</forkCount>
<reuseForks>false</reuseForks>
<threadCount>1</threadCount>
<systemPropertyVariables>

</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</project>
31 changes: 31 additions & 0 deletions core/src/main/java/org/correomqtt/core/CoreManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.correomqtt.core;

import lombok.Getter;
import org.correomqtt.core.fileprovider.HistoryManager;
import org.correomqtt.core.plugin.PluginManager;
import org.correomqtt.core.settings.SettingsManager;
import org.correomqtt.core.utils.ConnectionManager;

import org.correomqtt.di.Inject;
import org.correomqtt.di.SingletonBean;

@Getter
@SingletonBean
public class CoreManager {

private final ConnectionManager connectionManager;
private final SettingsManager settingsManager;
private final HistoryManager historyManager;
private final PluginManager pluginManager;

@Inject
public CoreManager(ConnectionManager connectionManager,
SettingsManager settingsManager,
HistoryManager historyManager,
PluginManager pluginManager) {
this.connectionManager = connectionManager;
this.settingsManager = settingsManager;
this.historyManager = historyManager;
this.pluginManager = pluginManager;
}
}
25 changes: 25 additions & 0 deletions core/src/main/java/org/correomqtt/core/CorreoCore.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package org.correomqtt.core;

import org.correomqtt.di.DefaultBean;
import org.correomqtt.core.eventbus.EventBus;
import org.correomqtt.core.settings.SettingsManager;

import org.correomqtt.di.Inject;

@DefaultBean
public class CorreoCore {

private final SettingsManager settingsManager;
private final EventBus eventBus;

@Inject
public CorreoCore(SettingsManager settingsManager,
EventBus eventBus) {
this.settingsManager = settingsManager;
this.eventBus = eventBus;
}

public void init() {
System.setProperty("correo.configDirectory", settingsManager.getTargetDirectoryPath());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.correomqtt.core.applifecycle;

import org.correomqtt.core.eventbus.Event;

public class ShutdownEvent implements Event {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.correomqtt.core.applifecycle;

import org.correomqtt.core.eventbus.Event;

public class ShutdownRequestEvent implements Event {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.correomqtt.business.concurrent;
package org.correomqtt.core.concurrent;

@FunctionalInterface
public interface FinallyListener {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
package org.correomqtt.business.concurrent;
package org.correomqtt.core.concurrent;

import org.correomqtt.core.eventbus.EventBus;

public abstract class FullTask<T, P, E> extends TaskImpl<T, P, E, TaskErrorResult<E>> {

protected FullTask(EventBus eventBus) {
super(eventBus);
}

public FullTask<T, P, E> onStarted(StartListener listener) {
onStartedImpl(listener);
return this;
Expand Down
Loading
Loading