Skip to content

Commit 98ccca4

Browse files
authored
Merge pull request #24 from arrowhead-f/development
v4.4.0.0 release
2 parents a3a66cd + c2619d9 commit 98ccca4

File tree

82 files changed

+307
-341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+307
-341
lines changed

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
### VS Code ###
2424
.vscode/
2525
wrapper
26-
/client-skeleton-provider/target
27-
/client-skeleton-consumer/target
28-
/client-skeleton-publisher/target
29-
/client-skeleton-subscriber/target
26+
/application-skeleton-provider/target
27+
/application-skeleton-consumer/target
28+
/application-skeleton-publisher/target
29+
/application-skeleton-subscriber/target
3030
/mvnw
3131
/mvnw.cmd
3232
/.settings

.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>client</name>
3+
<name>application-skeleton</name>
44
<comment></comment>
55
<projects>
66
</projects>

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Arrowhead Client Skeletons (Java Spring-Boot)
2-
##### The project provides client skeletons for the Arrowhead Framework 4.1.3
1+
# Arrowhead Application Skeletons (Java Spring-Boot)
2+
##### The project provides application skeletons for the Arrowhead Framework
33

4-
### How to use client skeletons?
4+
### How to use application skeletons?
55

66
Fork this repo and extend the skeletons with your own application code. ([check the best practice recommendations](https://github.com/arrowhead-f/client-skeleton-java-spring/blob/master/README.md#best-practices-to-start-with-the-skeletons))
77

@@ -10,34 +10,33 @@ Fork this repo and extend the skeletons with your own application code. ([check
1010
The project has the following dependencies:
1111
* JRE/JDK 11 [Download from here](https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html)
1212
* Maven 3.5+ [Download from here](http://maven.apache.org/download.cgi) | [Install guide](https://www.baeldung.com/install-maven-on-windows-linux-mac)
13-
* GitHub Packages [Configuring Maven for GitHub Packages](https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-apache-maven-for-use-with-github-packages) | [Example](https://github.com/arrowhead-f/client-library-java-spring/blob/master/docs/example_mvn_settings.xml)
1413

1514
### Project structure
1615

1716
This is a multi-module maven project relying on the [parent `pom.xml`](https://github.com/arrowhead-f/client-skeleton-java-spring/blob/master/pom.xml) which lists all the modules and common dependencies.
1817

1918
##### Modules:
2019

21-
* **client-skeleton-consumer**: client skeleton module with the purpose of initiating an orchestration request and consume the service from the chosen provider. This consumer project also contains a simple example of how to orchestrate and consume the service afterward.
20+
* **application-skeleton-consumer**: application skeleton module with the purpose of initiating an orchestration request and consume the service from the chosen provider. This consumer project also contains a simple example of how to orchestrate and consume the service afterward.
2221

23-
* **client-skeleton-provider**: client skeleton module with the purpose of registering a specific service into the Service Registry and running a web server where the service is available.
22+
* **application-skeleton-provider**: application skeleton module with the purpose of registering a specific service into the Service Registry and running a web server where the service is available.
2423

25-
* **client-skeleton-subscriber**: client skeleton module with the purpose of registering subscriptions into the Event Handler and running a web server where it waits for notifications.
24+
* **application-skeleton-subscriber**: application skeleton module with the purpose of registering subscriptions into the Event Handler and running a web server where it waits for notifications.
2625

27-
* **client-skeleton-publisher**: client publisher module with the purpose of publishing events into the Event Handler.
26+
* **application-skeleton-publisher**: application publisher module with the purpose of publishing events into the Event Handler.
2827

29-
Skeletons are built on the [`Arrowhead Client Library`](https://github.com/arrowhead-f/client-library-java-spring) which is also imported to this project as a Maven dependency. The client library provides the `ArrowheadService.class` which is a singleton spring managed bean and designed with the purpose of interacting with Arrowhead Framework. Use its methods by [autowiring](https://www.baeldung.com/spring-autowire) into your spring managed custom classes or use `ArrowheadBeans.getArrowheadService()` if your custom class is not spring managed. *(**Look for the java docs** attached for each method within this class.)*
28+
Skeletons are built on the [`Arrowhead Application Library`](https://github.com/arrowhead-f/application-library-java-spring) which is also imported to this project as a Maven dependency. The application library provides the `ArrowheadService.class` which is a singleton spring managed bean and designed with the purpose of interacting with Arrowhead Framework. Use its methods by [autowiring](https://www.baeldung.com/spring-autowire) into your spring managed custom classes or use `ArrowheadBeans.getArrowheadService()` if your custom class is not spring managed. *(**Look for the java docs** attached for each method within this class.)*
3029

31-
Each client skeleton has a default 'ApplicationInitListener' and a default 'SecurityConfig' what you can change or extend. The essential configuration has to be managed by customizing the `application.properties` file, located in `src/main/resources` folder.
30+
Each application skeleton has a default 'ApplicationInitListener' and a default 'SecurityConfig' what you can change or extend. The essential configuration has to be managed by customizing the `application.properties` file, located in `src/main/resources` folder.
3231

3332
### Best practices to start with the skeletons
3433

3534
##### (1st) application.properties
3635
Location: `src/main/resources`
37-
* * Decide the required security level and set the `server.ssl.enabled` and `token.security.filter.enabled` properties accordingly.
38-
* * If `token.security.filter.enabled` is true, `server.ssl.enabled` also has to be true !!!
36+
* Decide the required security level and set the `server.ssl.enabled` and `token.security.filter.enabled` properties accordingly.
37+
* If `token.security.filter.enabled` is true, `server.ssl.enabled` also has to be true !!!
3938
* [Create](https://github.com/arrowhead-f/core-java-spring#certificates) your own client certificate (or for demo purpose use the provided one) and update the further `server.ssl...` properties accordingly. *(**Note** that `server.ssl.key-store-password` and `server.ssl.key-password` must be the same.)*
40-
* Change the `client_system_name` property to your system name. *(**Note** that it should be in line with your certificate common name e.g.: when your certificate common name is `my_awesome_client.my_cloud.my_company.arrowhed.eu`, then your system name is  `my_awesome_client`)*
39+
* Change the `application_system_name` property to your system name. *(**Note** that it should be in line with your certificate common name e.g.: when your certificate common name is `my-awesome-client.my-cloud.my-company.arrowhed.eu`, then your system name is  `my-awesome-client`)*
4140
* Adjust the Service Registry Core System location by the `sr_address` and `sr_port` properties.
4241
* In case of a provider you have to set its web-server parameters by the `server.address` and `server.port` properties.
4342
* In case of a consumer decide whether it should act as a web-server or not. If yes, then set the `spring.main.web-application-type` to 'servlet' and set further server parameters like in the provider case. If not, just leave these properties unchanged.
@@ -52,9 +51,9 @@ All the provided skeleton classes are located in the child packages of the `eu.a
5251
* You can create your own packages like `com.my_company.my_awesome_project` to organize the skeleton and the application code separated. In the latter case if you wish to use Spring Beans at your custom packages, then you have to let the Spring Framework to known about your base package(s). This can be managed by adding the base package name(s) as a string value(s) in the `@ComponentScan` annotation of the application's `Main.class` *(**Look for the 'TODO' mark** within the main class)*.
5352

5453
##### (3rd) security configuration
55-
The skeletons provide a built-in arrowhed framework compatible security configuration located in `eu.arrowhead.client.skeleton.consumer|provider.security` package.
56-
* The `ConsumerSecurityConfig.class`, the `ProviderSecurityConfig.class`, the `SubscriberSecurityConfig.class` and the `PublisherSecurityConfig.class` extends the `DefaultSecurityConfig.class` which is imported by the client-library dependency and responsible for setting the `server.ssl.enabled` property declared in the `application.properties`. *(**Note:** The `ConsumerSecurityConfig.class` is became effective only when your consumer is a web-server.)*
57-
* The `ConsumerAccessControlFilter.class` the `ProviderSecurityConfig.class`, the `SubscriberSecurityConfig.class` and the `PublisherSecurityConfig.class` extends the `AccessControlFilter.class` which is imported by the client-library dependency and responsible for setting the security level based on the `application.properties`.
54+
The skeletons provide a built-in arrowhed framework compatible security configuration located in `eu.arrowhead.application.skeleton.consumer|provider.security` package.
55+
* The `ConsumerSecurityConfig.class`, the `ProviderSecurityConfig.class`, the `SubscriberSecurityConfig.class` and the `PublisherSecurityConfig.class` extends the `DefaultSecurityConfig.class` which is imported by the application-library dependency and responsible for setting the `server.ssl.enabled` property declared in the `application.properties`. *(**Note:** The `ConsumerSecurityConfig.class` is became effective only when your consumer is a web-server.)*
56+
* The `ConsumerAccessControlFilter.class` the `ProviderSecurityConfig.class`, the `SubscriberSecurityConfig.class` and the `PublisherSecurityConfig.class` extends the `AccessControlFilter.class` which is imported by the application-library dependency and responsible for setting the security level based on the `application.properties`.
5857
  -  `ConsumerAccessControlFilter.class` is effective only when your consumer is a web-server and `server.ssl.enabled` property is set to true. This filter is responsible for validating whether the received HTTPS request is coming from one of the local cloud's clients based on its certificate. *(**Look for the 'TODO' mark** within this class if you want to implement additional access rules.)*
5958
  -  `ProviderAccessControlFilter.class` is doing the same as described in the consumer case, but is effective only when `server.ssl.enabled` property is set to true and `token.security.filter.enabled` property is set to false. When `token.security.filter.enabled` property is set to true, then `ProviderTokenSecurityFilter.class` is effective which is validating whether a token is received within the HTTPS request and whether it is a valid one ore not. *(**Note** that the token is created by the Authorization Core System during the orchestration process and the consumer have to put it into its HTTPS request as a query parameter.)*
6059
  -  `PublisherAccessControlFilter.class` is doing the same as described in the provider case, but when `token.security.filter.enabled` property is set to true, then `PublisherTokenSecurityFilter.class` is effective and is doing the same as described in the provider case.
@@ -63,7 +62,7 @@ The skeletons provide a built-in arrowhed framework compatible security configur
6362
* The `SubscriberNotificationAccessControlFilter.class` is checking the requested target URI and if it is registered in the application.properties as notification URI then validating whether the requester is an allowed Core System. If the requester is not allowed, it throws an AuthExeption with `" is unauthorized to access "` text in the message body. *(**Note:** By default only the `EVENT HANDLER CORE SYSTEM` is allowed.)*
6463

6564
##### (4th) start-up & shutdown configuration
66-
The skeletons provide a built-in application start-up and shutdown configuration located in `eu.arrowhead.client.skeleton.consumer|provider` package.
65+
The skeletons provide a built-in application start-up and shutdown configuration located in `eu.arrowhead.application.skeleton.consumer|provider` package.
6766
The `ConsumerApplicationInitListener.class`, the `ProviderApplicationInitListener.class`, `PublisherApplicationInitListener.class` and the `SubscriberApplicationInitListener.class` contains the `customInit()` method which is executed automatically right after the application start-up and also the `customDestroy()` method which is executed automatically right after triggering the application shutdown, but still before the final stop. *(**Look for the 'TODO' marks** within these classes if you want to implement additional logic.)*
6867

6968
###### Already implemented Consumer start-up logic:
@@ -109,4 +108,4 @@ The `ConsumerApplicationInitListener.class`, the `ProviderApplicationInitListene
109108
###### Already implemented Subscriber shutdown logics:
110109
* Unsubscribing from the event types defined in apllication.properties.
111110

112-
##### Check [`sos-examples-spring`](https://github.com/arrowhead-f/sos-examples-spring) repository for full demo client implementations.
111+
##### Check [`sos-examples-spring`](https://github.com/arrowhead-f/sos-examples-spring) repository for full demo application implementations.

client-skeleton-consumer/.classpath renamed to application-skeleton-consumer/.classpath

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,6 @@
2121
<attribute name="maven.pomderived" value="true"/>
2222
</attributes>
2323
</classpathentry>
24-
<classpathentry kind="src" path=".apt_generated">
25-
<attributes>
26-
<attribute name="optional" value="true"/>
27-
</attributes>
28-
</classpathentry>
29-
<classpathentry kind="src" output="target/test-classes" path=".apt_generated_tests">
30-
<attributes>
31-
<attribute name="optional" value="true"/>
32-
<attribute name="test" value="true"/>
33-
</attributes>
34-
</classpathentry>
3524
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
3625
<attributes>
3726
<attribute name="optional" value="true"/>

client-skeleton-consumer/.project renamed to application-skeleton-consumer/.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>client-skeleton-consumer</name>
3+
<name>arrowhead-application-skeleton-consumer</name>
44
<comment></comment>
55
<projects>
66
</projects>

client-skeleton-consumer/pom.xml renamed to application-skeleton-consumer/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<modelVersion>4.0.0</modelVersion>
33

44
<parent>
5-
<groupId>eu.arrowhead</groupId>
6-
<artifactId>client-skeleton</artifactId>
7-
<version>4.1.3.3</version>
5+
<groupId>eu.arrowhead</groupId>
6+
<artifactId>application-skeleton-java-spring</artifactId>
7+
<version>4.4.0.0</version>
88
</parent>
99

10-
<artifactId>arrowhead-client-skeleton-consumer</artifactId>
10+
<artifactId>arrowhead-application-skeleton-consumer</artifactId>
1111
<name>Arrowhead Consumer Skeleton</name>
1212

1313
<build>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
package eu.arrowhead.client.skeleton.consumer;
1+
package eu.arrowhead.application.skeleton.consumer;
22

33
import org.apache.logging.log4j.LogManager;
44
import org.apache.logging.log4j.Logger;
55
import org.springframework.beans.factory.annotation.Autowired;
66
import org.springframework.context.event.ContextRefreshedEvent;
77
import org.springframework.stereotype.Component;
88

9-
import eu.arrowhead.client.library.ArrowheadService;
10-
import eu.arrowhead.client.library.config.ApplicationInitListener;
9+
import ai.aitia.arrowhead.application.library.ArrowheadService;
10+
import ai.aitia.arrowhead.application.library.config.ApplicationInitListener;
1111
import eu.arrowhead.common.core.CoreSystem;
1212

1313
@Component
@@ -29,7 +29,7 @@ public class ConsumerApplicationInitListener extends ApplicationInitListener {
2929
protected void customInit(final ContextRefreshedEvent event) {
3030

3131
//Checking the availability of necessary core systems
32-
checkCoreSystemReachability(CoreSystem.SERVICE_REGISTRY);
32+
checkCoreSystemReachability(CoreSystem.SERVICEREGISTRY);
3333
checkCoreSystemReachability(CoreSystem.ORCHESTRATOR);
3434

3535

client-skeleton-consumer/src/main/java/eu/arrowhead/client/skeleton/consumer/ConsumerMain.java renamed to application-skeleton-consumer/src/main/java/eu/arrowhead/application/skeleton/consumer/ConsumerMain.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package eu.arrowhead.client.skeleton.consumer;
1+
package eu.arrowhead.application.skeleton.consumer;
22

33
import org.apache.logging.log4j.LogManager;
44
import org.apache.logging.log4j.Logger;
@@ -10,7 +10,7 @@
1010
import org.springframework.context.annotation.ComponentScan;
1111
import org.springframework.http.HttpMethod;
1212

13-
import eu.arrowhead.client.library.ArrowheadService;
13+
import ai.aitia.arrowhead.application.library.ArrowheadService;
1414
import eu.arrowhead.common.CommonConstants;
1515
import eu.arrowhead.common.dto.shared.OrchestrationFlags.Flag;
1616
import eu.arrowhead.common.dto.shared.OrchestrationFormRequestDTO;
@@ -21,7 +21,7 @@
2121
import eu.arrowhead.common.exception.ArrowheadException;
2222

2323
@SpringBootApplication
24-
@ComponentScan(basePackages = {CommonConstants.BASE_PACKAGE}) //TODO: add custom packages if any
24+
@ComponentScan(basePackages = {CommonConstants.BASE_PACKAGE, "ai.aitia"}) //TODO: add custom packages if any
2525
public class ConsumerMain implements ApplicationRunner {
2626

2727
//=================================================================================================
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package eu.arrowhead.client.skeleton.consumer.security;
1+
package eu.arrowhead.application.skeleton.consumer.security;
22

33
import java.util.Map;
44

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package eu.arrowhead.client.skeleton.consumer.security;
1+
package eu.arrowhead.application.skeleton.consumer.security;
22

33
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
44
import org.springframework.context.annotation.Configuration;
55
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
66

7-
import eu.arrowhead.client.library.config.DefaultSecurityConfig;
7+
import ai.aitia.arrowhead.application.library.config.DefaultSecurityConfig;
88

99
@Configuration
1010
@ConditionalOnWebApplication

0 commit comments

Comments
 (0)