Skip to content

Commit

Permalink
136 rest fileupload poc
Browse files Browse the repository at this point in the history
  • Loading branch information
attila-kiss-it committed Dec 2, 2024
1 parent 2cd68f9 commit 5f49eb5
Show file tree
Hide file tree
Showing 36 changed files with 1,470 additions and 14 deletions.
35 changes: 27 additions & 8 deletions bom/bom-sampler/pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>hu.icellmobilsoft.sampler.bom</groupId>
Expand Down Expand Up @@ -26,7 +28,7 @@
<artifactId>api-jee-batch</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>hu.icellmobilsoft.sampler.api</groupId>
<artifactId>api-schema</artifactId>
Expand All @@ -42,12 +44,12 @@
<artifactId>api-grpc-service</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>hu.icellmobilsoft.sampler.api</groupId>
<artifactId>api-grpc-stub-gen</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>hu.icellmobilsoft.sampler.api</groupId>
<artifactId>api-grpc-stub-gen</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>hu.icellmobilsoft.sampler.model</groupId>
<artifactId>model</artifactId>
Expand Down Expand Up @@ -88,6 +90,23 @@
<artifactId>common-etcd</artifactId>
<version>${project.version}</version>
</dependency>

<!-- sample fileupload -->
<dependency>
<groupId>hu.icellmobilsoft.sampler.sample.fileupload.api</groupId>
<artifactId>sample-fileupload-api-schema</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>hu.icellmobilsoft.sampler.sample.fileupload.api</groupId>
<artifactId>sample-fileupload-api-dto</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>hu.icellmobilsoft.sampler.sample.fileupload.api</groupId>
<artifactId>sample-fileupload-api-rest-jee</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
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 All @@ -22,16 +22,16 @@
import jakarta.annotation.Priority;
import jakarta.ws.rs.ext.Provider;

import hu.icellmobilsoft.coffee.rest.log.BaseRestLogger;
import hu.icellmobilsoft.coffee.rest.log.optimized.BaseRestLogger;
import hu.icellmobilsoft.sampler.common.rest.filter.CustomPriorities;
import hu.icellmobilsoft.sampler.dto.constant.IHttpHeaderConstants;

/**
* REST request-response logger
*
*
* @author ischeffer
* @since 0.1.0
*
*
*/
@Provider
@Priority(CustomPriorities.PRE_AUTHENTICATION)
Expand Down
4 changes: 3 additions & 1 deletion etc/config/META-INF/microprofile-config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ coffee.etcd.default.url = http://bs-sample-etcd:2379
# In order to enable any of the tracing aspects,
# the configuration otel.sdk.disabled=false must be specified
# in any of the configuration sources available via MicroProfile Config.
otel.sdk.disabled=false
otel.sdk.disabled=false

coffee.config.xml.catalog.path = xsd/hu/icellmobilsoft/vdrapi/super.catalog.xml
4 changes: 4 additions & 0 deletions etc/config/testsuite/META-INF/roaster-defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ testsuite:
sample:
baseUriKey: sampler.service.sample.base.uri
path: /rest/sample
sample:
fileupload:
client:
service/mp-rest/url: http://localhost:8081
2 changes: 2 additions & 0 deletions etc/docker-compose/docker-compose.local.wildfly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ services:
MP_CONFIG_PROFILE: kafka
HIBERNATE_DIALECT: org.hibernate.dialect.H2Dialect
DEBUG: "true"
# 1GB
UNDERTOW_HTTP_MAX_POST_SIZE: 1073741824
deploy:
resources:
limits:
Expand Down
1 change: 1 addition & 0 deletions sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<module>sample-kafka-service</module>
<module>sample-etcd-service</module>
<module>sample-jpa-batch-service</module>
<module>sample-fileupload</module>
</modules>

<dependencyManagement>
Expand Down
35 changes: 35 additions & 0 deletions sample/sample-fileupload/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<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>hu.icellmobilsoft.sampler.sample</groupId>
<artifactId>sample</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<groupId>hu.icellmobilsoft.sampler.sample.fileupload</groupId>
<artifactId>sample-fileupload</artifactId>

<packaging>pom</packaging>

<modules>
<module>sample-fileupload-api</module>
<module>sample-fileupload-service</module>
</modules>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>hu.icellmobilsoft.sampler.bom</groupId>
<artifactId>bom-all</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

</project>
36 changes: 36 additions & 0 deletions sample/sample-fileupload/sample-fileupload-api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<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>hu.icellmobilsoft.sampler.sample.fileupload</groupId>
<artifactId>sample-fileupload</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<groupId>hu.icellmobilsoft.sampler.sample.fileupload.api</groupId>
<artifactId>sample-fileupload-api</artifactId>

<packaging>pom</packaging>

<modules>
<module>sample-fileupload-api-schema</module>
<module>sample-fileupload-api-dto</module>
<module>sample-fileupload-api-rest-jee</module>
</modules>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>hu.icellmobilsoft.sampler.bom</groupId>
<artifactId>bom-all</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<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>hu.icellmobilsoft.sampler.sample.fileupload.api</groupId>
<artifactId>sample-fileupload-api</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>sample-fileupload-api-dto</artifactId>

<dependencies>
<dependency>
<groupId>hu.icellmobilsoft.sampler.sample.fileupload.api</groupId>
<artifactId>sample-fileupload-api-schema</artifactId>
</dependency>

<dependency>
<groupId>hu.icellmobilsoft.coffee</groupId>
<artifactId>coffee-dto-impl</artifactId>
</dependency>
<dependency>
<groupId>hu.icellmobilsoft.coffee</groupId>
<artifactId>coffee-module-configdoc</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>provided</scope>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<failOnWarnings>false</failOnWarnings>
<failOnError>false</failOnError>
</configuration>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb</groupId>
<artifactId>jaxb-maven-plugin</artifactId>
<version>4.0.3</version>
<executions>
<execution>
<id>icell-super</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<strict>false</strict>
<catalog>
src/main/resources/xsd/hu/icellmobilsoft/sampler/sample/fileupload/super.catalog.xml</catalog>
<schemaIncludes>
<include>
xsd/hu/icellmobilsoft/sampler/sample/fileupload/super.xsd</include>
</schemaIncludes>
<bindingIncludes>
<include>
xsd/hu/icellmobilsoft/sampler/sample/fileupload/bindings.xjb</include>
</bindingIncludes>
<generateDirectory>
${project.build.directory}/generated-sources/src/main/java</generateDirectory>
</configuration>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<enableIntrospection>true</enableIntrospection>
<schemaDirectory>src/main/resources</schemaDirectory>
<args>
<arguments>-openapify</arguments>
<arguments>-Xfluent-api</arguments>
<arguments>-Xannotate</arguments>
</args>
<plugins>
<plugin>
<groupId>hu.icellmobilsoft.jaxb</groupId>
<artifactId>openapi-jaxb-plugin</artifactId>
<version>2.0.0</version>
</plugin>
<plugin>
<groupId>net.java.dev.jaxb2-commons</groupId>
<artifactId>jaxb-fluent-api</artifactId>
<version>2.1.8</version>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-annotate</artifactId>
<version>1.1.0</version>
</plugin>
<plugin>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.14.1</version>
</plugin>
</plugins>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>
-Acoffee.configDoc.outputDir=${project.basedir}/target</arg>
<arg>-Acoffee.configDoc.outputToClassPath=false</arg>
</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*-
* #%L
* Sampler
* %%
* Copyright (C) 2022 - 2024 i-Cell Mobilsoft Zrt.
* %%
* 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.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/

package hu.icellmobilsoft.sampler.sample.fileupload.schema;

/**
* XSD constatnts.
*
* @author attila-kiss-it
* @since 2.0.0
*/
public interface FileUploadXsdConstants {

/**
* Path of the super XSD.
*/
String SUPER_XSD = "xsd/hu/icellmobilsoft/sampler/sample/fileupload/super.xsd";

/**
* Path of the super catalog.
*/
String SUPER_CATALOG = "xsd/hu/icellmobilsoft/sampler/sample/fileupload/super.catalog.xml";

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" ?>
<jaxb:bindings version="3.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc annox">

<jaxb:globalBindings generateIsSetMethod="true">
<xjc:serializable uid="1" />

<xjc:javaType xmlType="xsd:date" name="java.time.LocalDate" adapter="hu.icellmobilsoft.coffee.dto.adapter.LocalDateXmlAdapter" />
<xjc:javaType xmlType="xsd:time" name="java.time.OffsetTime" adapter="hu.icellmobilsoft.coffee.dto.adapter.OffsetTimeXmlAdapter" />
<xjc:javaType xmlType="xsd:dateTime" name="java.time.OffsetDateTime"
adapter="hu.icellmobilsoft.coffee.dto.adapter.OffsetDateTimeXmlAdapter" />
</jaxb:globalBindings>

</jaxb:bindings>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">

<public publicId="http://sample.sampler.icellmobilsoft.hu/fileupload"
uri="maven:hu.icellmobilsoft.sampler.sample.fileupload.api:sample-fileupload-api-schema:jar::!/xsd/hu/icellmobilsoft/sampler/sample/fileupload/schema/fileupload.xsd" />

</catalog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns="http://http://sample.sampler.icellmobilsoft.hu/fileupload/super"
targetNamespace="http://sample.sampler.icellmobilsoft.hu/fileupload/super" elementFormDefault="qualified" attributeFormDefault="unqualified"
jaxb:version="3.0" jaxb:extensionBindingPrefixes="xjc">

<xsd:import namespace="http://sample.sampler.icellmobilsoft.hu/fileupload" />

</xsd:schema>
Loading

0 comments on commit 5f49eb5

Please sign in to comment.