Skip to content

Commit

Permalink
fixes, refactoring
Browse files Browse the repository at this point in the history
Issue #185
  • Loading branch information
rsoika committed Jun 13, 2023
1 parent e066359 commit 62e80ae
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 36 deletions.
3 changes: 2 additions & 1 deletion imixs-archive-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM jboss/wildfly:20.0.1.Final
FROM quay.io/wildfly/wildfly:27.0.1.Final-jdk11
#FROM jboss/wildfly:20.0.1.Final

LABEL description="Imixs-Office-Workflow"
LABEL maintainer="[email protected]"
Expand Down
3 changes: 2 additions & 1 deletion imixs-archive-service/Dockerfile-wildfly-debug
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM jboss/wildfly:20.0.1.Final
FROM quay.io/wildfly/wildfly:27.0.1.Final-jdk11
#FROM jboss/wildfly:20.0.1.Final

LABEL description="Imixs-Office-Workflow"
LABEL maintainer="[email protected]"
Expand Down
4 changes: 2 additions & 2 deletions imixs-archive-service/docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ services:
- "9990:9990"
- "8787:8787"
volumes:
- ~/git/imixs-archive/imixs-archive-service/src/docker/deployments:/opt/wildfly/standalone/deployments/
- ./docker/deployments:/opt/jboss/wildfly/standalone/deployments/


cassandra:
image: cassandra:3.11
image: cassandra:4.0.6
environment:
TZ: "Europe/Berlin"

Expand Down
2 changes: 1 addition & 1 deletion imixs-archive-service/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ services:
- "8080:8080"

cassandra:
image: cassandra:3.11
image: cassandra:4.0.6
environment:
TZ: "Europe/Berlin"
62 changes: 61 additions & 1 deletion imixs-archive-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,73 @@
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>


<!-- Manik plugin -->
<plugin>
<groupId>org.imixs.maven</groupId>
<artifactId>manik-hotdeploy-maven-plugin</artifactId>
<version>2.0.0</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- List Source and Target folders for Autodeploy and Hotdeploy -->
<autodeployments>
<deployment>
<!-- wildcard deployment -->
<source>target/*.{war,ear,jar}</source>
<target>docker/deployments/</target>
<unpack>true</unpack>
</deployment>
</autodeployments>
<hotdeployments>
<deployment>
<source>src/main/webapp</source>
<target>docker/deployments/imixs-archive-service.war</target>
</deployment>
</hotdeployments>
</configuration>

</plugin>

</plugins>


<finalName>imixs-archive-service</finalName>
</build>

<dependencies>



<!-- Java EE dependencies -->
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>${jakarta.version}</version>
<scope>provided</scope>
</dependency>

<!-- Microprofile -->
<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>${microprofile.version}</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.microprofile.metrics</groupId>
<artifactId>microprofile-metrics-api</artifactId>
<version>${microprofile-metrics.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-workflow-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@
import java.io.InputStream;
import java.util.Properties;
import java.util.logging.Logger;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import org.eclipse.microprofile.health.Health;
import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.HealthCheckResponseBuilder;
import org.imixs.archive.service.cassandra.ClusterService;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

/**
* The Imixs HealthCheckService implements the Microservice HealthCheck
* interface.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,12 @@ public XMLDataCollection readSyncData(long syncPoint) throws ArchiveException {

/**
* This method read the current snapshot id for a given UnqiueID. This
* information can be used to verify the sync satus of a single process
* information can be used to verify the sync status of a single process
* instance.
*
* @return the current snapshotid
* The method throws a ArchiveException in case the snapshot did not exist
*
* @return the current snapshotId
* @throws ArchiveException
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import org.imixs.archive.service.ArchiveException;
import org.imixs.archive.service.cassandra.ClusterService;
import org.imixs.archive.service.cassandra.DataService;
import org.imixs.workflow.FileData;
import org.imixs.workflow.ItemCollection;
import org.imixs.workflow.xml.XMLDataCollectionAdapter;
import org.imixs.workflow.xml.XMLDocumentAdapter;

import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Session;

import jakarta.ejb.Stateless;
import jakarta.inject.Inject;
import jakarta.servlet.http.HttpServletRequest;
Expand All @@ -47,17 +58,6 @@
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.UriInfo;

import org.imixs.archive.service.ArchiveException;
import org.imixs.archive.service.cassandra.ClusterService;
import org.imixs.archive.service.cassandra.DataService;
import org.imixs.workflow.FileData;
import org.imixs.workflow.ItemCollection;
import org.imixs.workflow.xml.XMLDataCollectionAdapter;
import org.imixs.workflow.xml.XMLDocumentAdapter;

import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.Session;

/**
* The ArchiveRestService provides a Rest API to be used by external clients.
* <p>
Expand All @@ -78,7 +78,7 @@ public class ArchiveRestService {
@Inject
DataService dataService;

@javax.ws.rs.core.Context
@jakarta.ws.rs.core.Context
private HttpServletRequest servletRequest;

private static Logger logger = Logger.getLogger(ArchiveRestService.class.getName());
Expand Down Expand Up @@ -284,8 +284,6 @@ public Response getSnapshotFileByName(@PathParam("snapshotid") String id, @PathP

}



/**
* This method converts a single ItemCollection into a Jax-rs response object.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,6 @@
import java.util.List;
import java.util.logging.Logger;

import javax.annotation.Resource;
import jakarta.ejb.Stateless;
import jakarta.ejb.Timeout;
import jakarta.ejb.Timer;
import jakarta.ejb.TimerConfig;
import jakarta.inject.Inject;

import org.imixs.archive.service.ArchiveException;
import org.imixs.archive.service.RemoteAPIService;
import org.imixs.archive.service.cassandra.ClusterService;
Expand All @@ -45,6 +38,13 @@
import org.imixs.workflow.xml.XMLDocument;
import org.imixs.workflow.xml.XMLDocumentAdapter;

import jakarta.annotation.Resource;
import jakarta.ejb.Stateless;
import jakarta.ejb.Timeout;
import jakarta.ejb.Timer;
import jakarta.ejb.TimerConfig;
import jakarta.inject.Inject;

/**
* The SyncService synchronizes the data of a Imixs-Worklfow instance with the
* cassandra cluster. The synchonrization can be started by the method sync().
Expand Down Expand Up @@ -260,11 +260,12 @@ void onTimeout(jakarta.ejb.Timer timer) throws Exception {
syncupdate++;
totalCount++;
totalSize = totalSize + dataService.calculateSize(xmlDocument);
} catch ( RuntimeException e) {
logger.warning("Failed to resync snapshot id '"+snapshot.getUniqueID()+"' - error: "+e.getMessage());
} catch (RuntimeException e) {
logger.warning("Failed to resync snapshot id '" + snapshot.getUniqueID() + "' - error: "
+ e.getMessage());
// we continue....
}

} else {
// This is because in case of a restore, the same snapshot takes a new $modified
// item. And we do not want to re-import the snapshot in the next sync cycle.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ error_message=Please verify your input and correct input fields marked with a *
error_message_general_title=Sorry, an error has occurred!
error_message_general=We are sorry, unfortunately an unexpected error occurred. Please try again.
error_message_mce_image_size=This data is to large, to be inserted. Please use a link instead!
javax.faces.component.UIInput.REQUIRED=*
javax.faces.component.UIInput.REQUIRED_detail=please enter the required value
jakarta.faces.component.UIInput.REQUIRED=*
jakarta.faces.component.UIInput.REQUIRED_detail=please enter the required value
search_error_title=Invalid search term!

0 comments on commit 62e80ae

Please sign in to comment.