diff --git a/CONTRUBUTING.md b/CONTRUBUTING.md
index 68251d848..bc04d2abd 100644
--- a/CONTRUBUTING.md
+++ b/CONTRUBUTING.md
@@ -9,6 +9,7 @@ Please read this if you intend to contribute to the project.
* Java files:
* we follow the standard eclipse IDE (built in) code formatter with the following changes:
* Tab policy: spaces only: 4
+ * We recommend using at least Eclipse [Mars](https://www.eclipse.org/mars/) IDE release. It seems that the Java code formatter line break handling has been changed between [Luna](https://www.eclipse.org/luna/) and Mars.
* XML files:
* we follow the standard eclipse IDE XML formatter with the following changes:
* Indent using spaces only: 3
@@ -36,7 +37,7 @@ If you don’t, you need to [register](https://dev.eclipse.org/site_login/create
* Add your github username in your Eclipse Foundation account settings. Log in it to Eclipse and go to account settings.
-* "Sign-off" your commits (NOTE! This is only necessary if contributing to the vertx-core project)
+* "Sign-off" your commits
Every commit you make in your patch or pull request MUST be "signed off".
diff --git a/README.md b/README.md
index b28aff339..95cacbc9f 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,20 @@ Want to chat with the team behind hawkBit? [ for a runtime ready Spring Boot based update server that is empowered by hawkBit.
+
+# Releases and Roadmap
+
+* We are currently working on the first formal release under the Eclipse banner: 0.1 (see [Release 0.1 branch](https://github.com/eclipse/hawkbit/tree/release-train-0.1)).
+* The master branch contains future development towards 0.2. We are currently focusing on:
+ * Rollout Management for large scale rollouts.
+ * Clustering capabilities for the update server.
+ * Upgrade of Spring Boot and Vaadin depedencies.
+ * And of course tons of usability improvements and bug fixes.
+
+
## Try out examples
#### Standalone Test Application Server
[Example Application](examples/hawkbit-example-app)
@@ -28,7 +42,7 @@ mvn install
`hawkbit-http-security` : implementation for security filters for HTTP.
`hawkbit-rest-api` : API classes for the REST Management API.
`hawkbit-rest-resource` : HTTP REST endpoints for the Management and the Direct Device API.
-`hawkbit-rest-resource` : Vaadin UI.
+`hawkbit-ui` : Vaadin UI.
`hawkbit-cache-redis` : spring cache manager configuration and implementation with redis, distributed cache and distributed events.
diff --git a/examples/README.md b/examples/README.md
index 320ee25cc..3ad5ecf66 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -1,2 +1,7 @@
# Examples
-TODO
\ No newline at end of file
+
+Example projects that show how hawkBit can be used to create, run or access an hawkBit empowered update server.
+
+`hawkbit-device-simulator` : Simulates device software updates, leveraging the hawkBit device integration options.
+`hawkbit-example-app` : Allows you to run a Spring Boot and hawkBit based update server.
+`hawkbit-mgmt-api-client` : Example client for the hawkBit management API.
diff --git a/examples/pom.xml b/examples/pom.xml
index d23eb0098..5f1377123 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -15,7 +15,7 @@
org.eclipse.hawkbithawkbit-parent
- 0.1.0-SNAPSHOT
+ 0.2.0-SNAPSHOThawkbit-examples-parent
diff --git a/hawkbit-artifact-repository-mongo/pom.xml b/hawkbit-artifact-repository-mongo/pom.xml
index b8d73e256..fb1d7df41 100644
--- a/hawkbit-artifact-repository-mongo/pom.xml
+++ b/hawkbit-artifact-repository-mongo/pom.xml
@@ -13,7 +13,7 @@
4.0.0org.eclipse.hawkbit
- 0.1.0-SNAPSHOT
+ 0.2.0-SNAPSHOThawkbit-parenthawkbit-artifact-repository-mongo
diff --git a/hawkbit-artifact-repository-mongo/src/main/java/org/eclipse/hawkbit/artifact/repository/MongoConfiguration.java b/hawkbit-artifact-repository-mongo/src/main/java/org/eclipse/hawkbit/artifact/repository/MongoConfiguration.java
index 602af6f54..3f203f94f 100644
--- a/hawkbit-artifact-repository-mongo/src/main/java/org/eclipse/hawkbit/artifact/repository/MongoConfiguration.java
+++ b/hawkbit-artifact-repository-mongo/src/main/java/org/eclipse/hawkbit/artifact/repository/MongoConfiguration.java
@@ -92,7 +92,7 @@ public class MongoConfiguration extends AbstractMongoConfiguration {
*
* Based on MongoProperties#builder method.
*/
- private Builder createBuilderOutOfOptions(final MongoClientOptions options) {
+ private static Builder createBuilderOutOfOptions(final MongoClientOptions options) {
final Builder builder = MongoClientOptions.builder();
if (options != null) {
builder.alwaysUseMBeans(options.isAlwaysUseMBeans());
@@ -108,8 +108,8 @@ public class MongoConfiguration extends AbstractMongoConfiguration {
builder.socketFactory(options.getSocketFactory());
builder.socketKeepAlive(options.isSocketKeepAlive());
builder.socketTimeout(options.getSocketTimeout());
- builder.threadsAllowedToBlockForConnectionMultiplier(options
- .getThreadsAllowedToBlockForConnectionMultiplier());
+ builder.threadsAllowedToBlockForConnectionMultiplier(
+ options.getThreadsAllowedToBlockForConnectionMultiplier());
builder.writeConcern(options.getWriteConcern());
}
return builder;
diff --git a/hawkbit-autoconfigure/pom.xml b/hawkbit-autoconfigure/pom.xml
index 1f8e08b7d..11a106a4b 100644
--- a/hawkbit-autoconfigure/pom.xml
+++ b/hawkbit-autoconfigure/pom.xml
@@ -14,7 +14,7 @@
org.eclipse.hawkbithawkbit-parent
- 0.1.0-SNAPSHOT
+ 0.2.0-SNAPSHOThawkbit-autoconfigurehawkBit :: Spring Boot Autoconfigure
diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/scheduling/ExecutorAutoConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/scheduling/ExecutorAutoConfiguration.java
index f626e94b5..f8a86d1bc 100644
--- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/scheduling/ExecutorAutoConfiguration.java
+++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/scheduling/ExecutorAutoConfiguration.java
@@ -11,7 +11,6 @@ package org.eclipse.hawkbit.autoconfigure.scheduling;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Executor;
-import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@@ -46,19 +45,15 @@ public class ExecutorAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public Executor asyncExecutor() {
- final BlockingQueue blockingQueue = new ArrayBlockingQueue(
+ final BlockingQueue blockingQueue = new ArrayBlockingQueue<>(
asyncConfigurerProperties.getQueuesize());
- final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
- asyncConfigurerProperties.getCorethreads(), asyncConfigurerProperties.getMaxthreads(),
- asyncConfigurerProperties.getIdletimeout(), TimeUnit.MILLISECONDS, blockingQueue,
+ final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(asyncConfigurerProperties.getCorethreads(),
+ asyncConfigurerProperties.getMaxthreads(), asyncConfigurerProperties.getIdletimeout(),
+ TimeUnit.MILLISECONDS, blockingQueue,
new ThreadFactoryBuilder().setNameFormat("central-executor-pool-%d").build());
- threadPoolExecutor.setRejectedExecutionHandler(new RejectedExecutionHandler() {
- @Override
- public void rejectedExecution(final Runnable r, final java.util.concurrent.ThreadPoolExecutor executor) {
- LOGGER.warn("Reject runnable for centralExecutorService, reached limit of queue size {}", executor
- .getQueue().size());
- }
- });
+ threadPoolExecutor.setRejectedExecutionHandler((r, executor) -> LOGGER.warn(
+ "Reject runnable for centralExecutorService, reached limit of queue size {}",
+ executor.getQueue().size()));
return new DelegatingSecurityContextExecutor(threadPoolExecutor);
}
diff --git a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java
index 63e1e8ad1..ca55f1711 100644
--- a/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java
+++ b/hawkbit-autoconfigure/src/main/java/org/eclipse/hawkbit/autoconfigure/security/SecurityManagedConfiguration.java
@@ -159,35 +159,27 @@ public class SecurityManagedConfiguration implements EnvironmentAware {
}
if (securityConfiguration.getAnonymousEnabled()) {
- LOG.info("******************\n** Anonymous controller security enabled, should only use for developing purposes **\n******************");
+ LOG.info(
+ "******************\n** Anonymous controller security enabled, should only use for developing purposes **\n******************");
final AnonymousAuthenticationFilter anoymousFilter = new AnonymousAuthenticationFilter(
- "controllerAnonymousFilter", "anonymous", Collections.singletonList(new SimpleGrantedAuthority(
- SpringEvalExpressions.CONTROLLER_ROLE_ANONYMOUS)));
+ "controllerAnonymousFilter", "anonymous", Collections.singletonList(
+ new SimpleGrantedAuthority(SpringEvalExpressions.CONTROLLER_ROLE_ANONYMOUS)));
anoymousFilter.setAuthenticationDetailsSource(authenticationDetailsSource);
httpSec.requestMatchers().antMatchers("/*/controller/v1/**", "/*/controller/artifacts/v1/**").and()
.securityContext().disable().anonymous().authenticationFilter(anoymousFilter);
} else {
- httpSec.addFilter(securityHeaderFilter)
- .addFilter(securityTokenFilter)
- .addFilter(gatewaySecurityTokenFilter)
- .antMatcher("/*/controller/**")
- .anonymous()
- .disable()
- .authorizeRequests()
- .anyRequest()
- .authenticated()
- .and()
- .exceptionHandling()
- .authenticationEntryPoint(
- (request, response, authException) -> response.setStatus(HttpStatus.UNAUTHORIZED
- .value())).and().sessionManagement()
- .sessionCreationPolicy(SessionCreationPolicy.STATELESS);
+ httpSec.addFilter(securityHeaderFilter).addFilter(securityTokenFilter)
+ .addFilter(gatewaySecurityTokenFilter).antMatcher("/*/controller/**").anonymous().disable()
+ .authorizeRequests().anyRequest().authenticated().and().exceptionHandling()
+ .authenticationEntryPoint((request, response, authException) -> response
+ .setStatus(HttpStatus.UNAUTHORIZED.value()))
+ .and().sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
}
}
/*
* (non-Javadoc)
- *
+ *
* @see
* org.springframework.security.config.annotation.web.configuration.
* WebSecurityConfigurerAdapter
@@ -196,8 +188,8 @@ public class SecurityManagedConfiguration implements EnvironmentAware {
*/
@Override
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
- auth.authenticationProvider(new PreAuthTokenSourceTrustAuthenticationProvider(securityConfiguration
- .getRpTrustedIPs()));
+ auth.authenticationProvider(
+ new PreAuthTokenSourceTrustAuthenticationProvider(securityConfiguration.getRpTrustedIPs()));
}
}
@@ -212,10 +204,12 @@ public class SecurityManagedConfiguration implements EnvironmentAware {
public FilterRegistrationBean dosFilter() {
final FilterRegistrationBean filterRegBean = new FilterRegistrationBean();
- filterRegBean.setFilter(new DosFilter(environment
- .getProperty("security.dos.filter.maxRead", Integer.class, 200), environment.getProperty(
- "security.dos.filter.maxWrite", Integer.class, 50), environment
- .getProperty("security.dos.filter.whitelist"), environment.getProperty("security.clients.blacklist"),
+ filterRegBean
+ .setFilter(
+ new DosFilter(environment.getProperty("security.dos.filter.maxRead", Integer.class, 200),
+ environment.getProperty("security.dos.filter.maxWrite", Integer.class, 50),
+ environment.getProperty("security.dos.filter.whitelist"), environment
+ .getProperty("security.clients.blacklist"),
environment.getProperty("security.rp.remote_ip_header", String.class, "X-Forwarded-For")));
filterRegBean.addUrlPatterns("/{tenant}/controller/v1/*", "/rest/*");
return filterRegBean;
@@ -301,7 +295,8 @@ public class SecurityManagedConfiguration implements EnvironmentAware {
}, RequestHeaderAuthenticationFilter.class)
.addFilterAfter(
new AuthenticationSuccessTenantMetadataCreationFilter(tenantAware, systemManagement),
- RequestHeaderAuthenticationFilter.class).authorizeRequests().anyRequest().authenticated()
+ RequestHeaderAuthenticationFilter.class)
+ .authorizeRequests().anyRequest().authenticated()
.antMatchers(RestConstants.BASE_SYSTEM_MAPPING + "/admin/**")
.hasAnyAuthority(SpPermission.SYSTEM_ADMIN).antMatchers(RestConstants.BASE_SYSTEM_MAPPING + "/**")
.hasAnyAuthority(SpPermission.SYSTEM_DIAG);
@@ -310,12 +305,13 @@ public class SecurityManagedConfiguration implements EnvironmentAware {
/**
* {@link WebSecurityConfigurer} for external (management) access.
- *
+ *
*/
@Configuration
@Order(400)
@EnableVaadinSecurity
- public static class UISecurityConfigurationAdapter extends WebSecurityConfigurerAdapter implements EnvironmentAware {
+ public static class UISecurityConfigurationAdapter extends WebSecurityConfigurerAdapter
+ implements EnvironmentAware {
private static final String XFRAME_OPTION_DENY = "DENY";
private static final String XFRAME_OPTION_SAMEORIGIN = "SAMEORIGIN";
@@ -371,7 +367,7 @@ public class SecurityManagedConfiguration implements EnvironmentAware {
* Listener to redirect to login page after session timeout. Close the
* vaadin session, because it's is not possible to redirect in
* atmospehere.
- *
+ *
* @return the servlet listener.
*/
@Bean
@@ -388,10 +384,9 @@ public class SecurityManagedConfiguration implements EnvironmentAware {
if (confXframeOption.equals(XFAME_OPTION_ALLOW_FROM) && confAllowFromUri == null) {
// if allow-from option is specified but no allowFromUri throw
// exception
- throw new IllegalStateException(
- "hawkbit.server.security.xframe.option has been specified as ALLOW-FROM"
- + " but no hawkbit.server.security.xframe.option.allowfrom has been set, "
- + "please ensure to set allow from URIs");
+ throw new IllegalStateException("hawkbit.server.security.xframe.option has been specified as ALLOW-FROM"
+ + " but no hawkbit.server.security.xframe.option.allowfrom has been set, "
+ + "please ensure to set allow from URIs");
}
// workaround regex: we need to exclude the URL /UI/HEARTBEAT here
@@ -400,23 +395,22 @@ public class SecurityManagedConfiguration implements EnvironmentAware {
// vaadin-forum:
// https://vaadin.com/forum#!/thread/3200565.
HttpSecurity httpSec = http.regexMatcher("(?!.*HEARTBEAT)^.*\\/UI.*$")
- // disable as CSRF is handled by Vaadin
+ // disable as CSRF is handled by Vaadin
.csrf().disable();
if (springSecurityProperties.isRequireSsl()) {
httpSec = httpSec.requiresChannel().anyRequest().requiresSecure().and();
} else {
- LOG.info("\"******************\\n** Requires HTTPS Security has been disabled for UI, should only use for developing purposes **\\n******************\"");
+ LOG.info(
+ "\"******************\\n** Requires HTTPS Security has been disabled for UI, should only use for developing purposes **\\n******************\"");
}
// for UI integrator we allow frame integration on same origin
httpSec.headers()
- .addHeaderWriter(
- confXframeOption.equals(XFAME_OPTION_ALLOW_FROM) ? new XFrameOptionsHeaderWriter(
- new StaticAllowFromStrategy(new URI(confAllowFromUri)))
- : new XFrameOptionsHeaderWriter(xframeOptionFromStr(confXframeOption)))
- .contentTypeOptions().xssProtection().httpStrictTransportSecurity()
- .and()
+ .addHeaderWriter(confXframeOption.equals(XFAME_OPTION_ALLOW_FROM)
+ ? new XFrameOptionsHeaderWriter(new StaticAllowFromStrategy(new URI(confAllowFromUri)))
+ : new XFrameOptionsHeaderWriter(xframeOptionFromStr(confXframeOption)))
+ .contentTypeOptions().xssProtection().httpStrictTransportSecurity().and()
// UI
.authorizeRequests().antMatchers("/UI/login/**").permitAll().antMatchers("/UI/UIDL/**").permitAll()
.anyRequest().authenticated().and()
@@ -437,7 +431,7 @@ public class SecurityManagedConfiguration implements EnvironmentAware {
* string does not match an option then
* {@link XFrameOptionsMode#SAMEORIGIN} is returned
*/
- private XFrameOptionsMode xframeOptionFromStr(@NotNull final String xframeOption) {
+ private static XFrameOptionsMode xframeOptionFromStr(@NotNull final String xframeOption) {
switch (xframeOption) {
case XFRAME_OPTION_DENY:
return XFrameOptionsMode.DENY;
@@ -450,8 +444,8 @@ public class SecurityManagedConfiguration implements EnvironmentAware {
@Override
public void configure(final WebSecurity webSecurity) throws Exception {
- webSecurity.ignoring()
- .antMatchers("/documentation/**", "/VAADIN/**", "/*.*", "/v2/api-docs/**", "/docs/**");
+ webSecurity.ignoring().antMatchers("/documentation/**", "/VAADIN/**", "/*.*", "/v2/api-docs/**",
+ "/docs/**");
}
}
@@ -482,15 +476,15 @@ public class SecurityManagedConfiguration implements EnvironmentAware {
http.csrf().disable();
http.anonymous().disable();
- http.regexMatcher(HttpDownloadAuthenticationFilter.REQUEST_ID_REGEX_PATTERN).addFilterBefore(
- downloadIdAuthenticationFilter, FilterSecurityInterceptor.class);
+ http.regexMatcher(HttpDownloadAuthenticationFilter.REQUEST_ID_REGEX_PATTERN)
+ .addFilterBefore(downloadIdAuthenticationFilter, FilterSecurityInterceptor.class);
http.authorizeRequests().anyRequest().authenticated();
}
@Override
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
- auth.authenticationProvider(new PreAuthTokenSourceTrustAuthenticationProvider(securityConfiguration
- .getRpTrustedIPs()));
+ auth.authenticationProvider(
+ new PreAuthTokenSourceTrustAuthenticationProvider(securityConfiguration.getRpTrustedIPs()));
}
}
@@ -510,7 +504,7 @@ class TenantMetadataSavedRequestAwareVaadinAuthenticationSuccessHandler extends
/*
* (non-Javadoc)
- *
+ *
* @see org.vaadin.spring.security.web.authentication.
* SavedRequestAwareVaadinAuthenticationSuccessHandler
* #onAuthenticationSuccess(org.springframework.security.core.
@@ -519,10 +513,10 @@ class TenantMetadataSavedRequestAwareVaadinAuthenticationSuccessHandler extends
@Override
public void onAuthenticationSuccess(final Authentication authentication) throws Exception {
if (authentication.getClass().equals(TenantUserPasswordAuthenticationToken.class)) {
- systemManagement.getTenantMetadata(((TenantUserPasswordAuthenticationToken) authentication).getTenant()
- .toString());
+ systemManagement
+ .getTenantMetadata(((TenantUserPasswordAuthenticationToken) authentication).getTenant().toString());
} else if (authentication.getClass().equals(UsernamePasswordAuthenticationToken.class)) {
- // TODO: MECS-1078 vaadin4spring-ext-security does not give us the
+ // TODO: vaadin4spring-ext-security does not give us the
// fullyAuthenticatedToken
// in the GenericVaadinSecurity class. Only the token which has been
// created in the
diff --git a/hawkbit-cache-redis/pom.xml b/hawkbit-cache-redis/pom.xml
index 3ed2d62f3..99c8328b5 100644
--- a/hawkbit-cache-redis/pom.xml
+++ b/hawkbit-cache-redis/pom.xml
@@ -14,7 +14,7 @@
org.eclipse.hawkbithawkbit-parent
- 0.1.0-SNAPSHOT
+ 0.2.0-SNAPSHOThawkbit-cache-redishawkBit :: Redis Cache Manager
diff --git a/hawkbit-core/pom.xml b/hawkbit-core/pom.xml
index 403f7aeb2..e5d0f65fd 100644
--- a/hawkbit-core/pom.xml
+++ b/hawkbit-core/pom.xml
@@ -14,7 +14,7 @@
org.eclipse.hawkbithawkbit-parent
- 0.1.0-SNAPSHOT
+ 0.2.0-SNAPSHOThawkbit-corehawkBit :: Core
diff --git a/hawkbit-core/src/main/java/org/eclipse/hawkbit/exception/SpServerRtException.java b/hawkbit-core/src/main/java/org/eclipse/hawkbit/exception/SpServerRtException.java
index 1e316f562..a605f7745 100644
--- a/hawkbit-core/src/main/java/org/eclipse/hawkbit/exception/SpServerRtException.java
+++ b/hawkbit-core/src/main/java/org/eclipse/hawkbit/exception/SpServerRtException.java
@@ -12,7 +12,7 @@ package org.eclipse.hawkbit.exception;
*
*
*
- * Generic Custom Exception to wrap the Runtime and checked exception
+ * Generic Custom Exception to wrap the Runtime and checked exception
*
*/
diff --git a/hawkbit-core/src/main/java/org/eclipse/hawkbit/repository/SoftwareModuleFields.java b/hawkbit-core/src/main/java/org/eclipse/hawkbit/repository/SoftwareModuleFields.java
index 33fa638a2..bff9b1f74 100644
--- a/hawkbit-core/src/main/java/org/eclipse/hawkbit/repository/SoftwareModuleFields.java
+++ b/hawkbit-core/src/main/java/org/eclipse/hawkbit/repository/SoftwareModuleFields.java
@@ -36,7 +36,7 @@ public enum SoftwareModuleFields implements FieldNameProvider {
/**
* The id field.
*/
- ID("id"),
+ ID("id"),
/**
* The metadata.
*/
diff --git a/hawkbit-dmf-amqp/pom.xml b/hawkbit-dmf-amqp/pom.xml
index 266412e8e..a7dfc5b42 100644
--- a/hawkbit-dmf-amqp/pom.xml
+++ b/hawkbit-dmf-amqp/pom.xml
@@ -14,7 +14,7 @@
org.eclipse.hawkbithawkbit-parent
- 0.1.0-SNAPSHOT
+ 0.2.0-SNAPSHOThawkbit-dmf-amqphawkBit :: DMF Amqp
diff --git a/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java b/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java
index 4be22c14f..988a68ada 100644
--- a/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java
+++ b/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpConfiguration.java
@@ -139,6 +139,7 @@ public class AmqpConfiguration {
final SimpleRabbitListenerContainerFactory containerFactory = new SimpleRabbitListenerContainerFactory();
containerFactory.setDefaultRequeueRejected(false);
containerFactory.setConnectionFactory(connectionFactory);
+ containerFactory.setMissingQueuesFatal(amqpProperties.isMissingQueuesFatal());
return containerFactory;
}
diff --git a/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpProperties.java b/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpProperties.java
index 338f514ad..ecd2dc3d7 100644
--- a/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpProperties.java
+++ b/hawkbit-dmf-amqp/src/main/java/org/eclipse/hawkbit/amqp/AmqpProperties.java
@@ -8,6 +8,7 @@
*/
package org.eclipse.hawkbit.amqp;
+import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
@@ -24,6 +25,26 @@ public class AmqpProperties {
private String deadLetterQueue = "dmf_connector_deadletter";
private String deadLetterExchange = "dmf.connector.deadletter";
private String receiverQueue = "dmf_receiver";
+ private boolean missingQueuesFatal = false;
+
+ /**
+ * Is missingQueuesFatal enabled
+ *
+ * @see SimpleMessageListenerContainer#setMissingQueuesFatal
+ * @return the missingQueuesFatal enabled disabled
+ */
+ public boolean isMissingQueuesFatal() {
+ return missingQueuesFatal;
+ }
+
+ /**
+ * @param missingQueuesFatal
+ * the missingQueuesFatal to set.
+ * @see SimpleMessageListenerContainer#setMissingQueuesFatal
+ */
+ public void setMissingQueuesFatal(final boolean missingQueuesFatal) {
+ this.missingQueuesFatal = missingQueuesFatal;
+ }
/**
* Returns the dead letter exchange.
diff --git a/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java b/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java
index 778f196e9..c423b76bf 100644
--- a/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java
+++ b/hawkbit-dmf-amqp/src/test/java/org/eclipse/hawkbit/amqp/AmqpMessageDispatcherServiceTest.java
@@ -155,8 +155,8 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTestWit
CONTROLLER_ID, 1l, IpUtil.createAmqpUri("mytest"));
amqpMessageDispatcherService
.targetCancelAssignmentToDistributionSet(cancelTargetAssignmentDistributionSetEvent);
- final Message sendMessage = createArgumentCapture(cancelTargetAssignmentDistributionSetEvent.getTargetAdress()
- .getHost());
+ final Message sendMessage = createArgumentCapture(
+ cancelTargetAssignmentDistributionSetEvent.getTargetAdress().getHost());
assertCancelMessage(sendMessage);
}
@@ -200,8 +200,8 @@ public class AmqpMessageDispatcherServiceTest extends AbstractIntegrationTestWit
@SuppressWarnings("unchecked")
private T convertMessage(final Message message, final Class clazz) {
- message.getMessageProperties().getHeaders()
- .put(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME, clazz.getTypeName());
+ message.getMessageProperties().getHeaders().put(AbstractJavaTypeMapper.DEFAULT_CLASSID_FIELD_NAME,
+ clazz.getTypeName());
return (T) rabbitTemplate.getMessageConverter().fromMessage(message);
}
diff --git a/hawkbit-dmf-api/pom.xml b/hawkbit-dmf-api/pom.xml
index 5660370e5..2ade4a6c7 100644
--- a/hawkbit-dmf-api/pom.xml
+++ b/hawkbit-dmf-api/pom.xml
@@ -15,7 +15,7 @@
org.eclipse.hawkbithawkbit-parent
- 0.1.0-SNAPSHOT
+ 0.2.0-SNAPSHOThawkbit-dmf-apihawkBit :: Device Management Federation API
diff --git a/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/ActionStatus.java b/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/ActionStatus.java
index 12e80139a..c31ab83f3 100644
--- a/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/ActionStatus.java
+++ b/hawkbit-dmf-api/src/main/java/org/eclipse/hawkbit/dmf/json/model/ActionStatus.java
@@ -22,6 +22,5 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
@JsonIgnoreProperties(ignoreUnknown = true)
public enum ActionStatus {
-
DOWNLOAD, RETRIEVED, RUNNING, FINISHED, ERROR, WARNING, CANCELED, CANCEL_REJECTED;
}
diff --git a/hawkbit-http-security/pom.xml b/hawkbit-http-security/pom.xml
index e5ee23de5..a9b8a4080 100644
--- a/hawkbit-http-security/pom.xml
+++ b/hawkbit-http-security/pom.xml
@@ -12,7 +12,7 @@
4.0.0hawkbit-parent
- 0.1.0-SNAPSHOT
+ 0.2.0-SNAPSHOTorg.eclipse.hawkbithawkbit-http-security
diff --git a/hawkbit-repository/pom.xml b/hawkbit-repository/pom.xml
index e5d7011ae..62d234ddb 100644
--- a/hawkbit-repository/pom.xml
+++ b/hawkbit-repository/pom.xml
@@ -13,7 +13,7 @@
4.0.0org.eclipse.hawkbit
- 0.1.0-SNAPSHOT
+ 0.2.0-SNAPSHOThawkbit-parenthawkbit-repository
diff --git a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/aspects/ExceptionMappingAspectHandler.java b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/aspects/ExceptionMappingAspectHandler.java
index bcb96f45d..75145778e 100644
--- a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/aspects/ExceptionMappingAspectHandler.java
+++ b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/aspects/ExceptionMappingAspectHandler.java
@@ -96,8 +96,8 @@ public class ExceptionMappingAspectHandler implements Ordered {
if (translatedAccessException == null && ex instanceof TransactionSystemException) {
final TransactionSystemException systemException = (TransactionSystemException) ex;
- translatedAccessException = translateEclipseLinkExceptionIfPossible((Exception) systemException
- .getOriginalException());
+ translatedAccessException = translateEclipseLinkExceptionIfPossible(
+ (Exception) systemException.getOriginalException());
}
if (translatedAccessException == null) {
diff --git a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/executor/AfterTransactionCommitDefaultServiceExecutor.java b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/executor/AfterTransactionCommitDefaultServiceExecutor.java
index 9b66178ba..38ad38345 100644
--- a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/executor/AfterTransactionCommitDefaultServiceExecutor.java
+++ b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/executor/AfterTransactionCommitDefaultServiceExecutor.java
@@ -23,8 +23,8 @@ import org.springframework.transaction.support.TransactionSynchronizationManager
* successful spring transaction commit.The class is thread safe.
*/
@Service
-public class AfterTransactionCommitDefaultServiceExecutor extends TransactionSynchronizationAdapter implements
- AfterTransactionCommitExecutor {
+public class AfterTransactionCommitDefaultServiceExecutor extends TransactionSynchronizationAdapter
+ implements AfterTransactionCommitExecutor {
private static final Logger LOGGER = LoggerFactory.getLogger(AfterTransactionCommitDefaultServiceExecutor.class);
private static final ThreadLocal> THREAD_LOCAL_RUNNABLES = new ThreadLocal<>();
diff --git a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DeploymentManagement.java b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DeploymentManagement.java
index 0288c83a5..b8b8610cd 100644
--- a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DeploymentManagement.java
+++ b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DeploymentManagement.java
@@ -198,10 +198,8 @@ public class DeploymentManagement {
@CacheEvict(value = { "distributionUsageAssigned" }, allEntries = true)
public DistributionSetAssignmentResult assignDistributionSet(@NotNull final Long dsID, final ActionType actionType,
final long forcedTimestamp, @NotEmpty final String... targetIDs) {
- return assignDistributionSet(
- dsID,
- Arrays.stream(targetIDs).map(t -> new TargetWithActionType(t, actionType, forcedTimestamp))
- .collect(Collectors.toList()));
+ return assignDistributionSet(dsID, Arrays.stream(targetIDs)
+ .map(t -> new TargetWithActionType(t, actionType, forcedTimestamp)).collect(Collectors.toList()));
}
/**
@@ -226,8 +224,8 @@ public class DeploymentManagement {
final List targets) {
final DistributionSet set = distributoinSetRepository.findOne(dsID);
if (set == null) {
- throw new EntityNotFoundException(String.format("no %s with id %d found",
- DistributionSet.class.getSimpleName(), dsID));
+ throw new EntityNotFoundException(
+ String.format("no %s with id %d found", DistributionSet.class.getSimpleName(), dsID));
}
return assignDistributionSetToTargets(set, targets);
@@ -251,8 +249,8 @@ public class DeploymentManagement {
final List targetsWithActionType) {
if (!set.isComplete()) {
- throw new IncompleteDistributionSetException("Distribution set of type " + set.getType().getKey()
- + " is incomplete: " + set.getId());
+ throw new IncompleteDistributionSetException(
+ "Distribution set of type " + set.getType().getKey() + " is incomplete: " + set.getId());
}
final List controllerIDs = targetsWithActionType.stream().map(TargetWithActionType::getTargetId)
@@ -260,8 +258,8 @@ public class DeploymentManagement {
LOG.debug("assignDistribution({}) to {} targets", set, controllerIDs.size());
- final Map targetsWithActionMap = targetsWithActionType.stream().collect(
- Collectors.toMap(TargetWithActionType::getTargetId, Function.identity()));
+ final Map targetsWithActionMap = targetsWithActionType.stream()
+ .collect(Collectors.toMap(TargetWithActionType::getTargetId, Function.identity()));
// split tIDs length into max entries in-statement because many database
// have constraint of
@@ -271,12 +269,10 @@ public class DeploymentManagement {
// we take the target only into account if the requested operation is no
// duplicate of a
// previous one
- final List targets = Lists
- .partition(controllerIDs, Constants.MAX_ENTRIES_IN_STATEMENT)
- .stream()
- .map(ids -> targetRepository.findAll(TargetSpecifications
- .hasControllerIdAndAssignedDistributionSetIdNot(ids, set.getId()))).flatMap(t -> t.stream())
- .collect(Collectors.toList());
+ final List targets = Lists.partition(controllerIDs, Constants.MAX_ENTRIES_IN_STATEMENT).stream()
+ .map(ids -> targetRepository
+ .findAll(TargetSpecifications.hasControllerIdAndAssignedDistributionSetIdNot(ids, set.getId())))
+ .flatMap(t -> t.stream()).collect(Collectors.toList());
if (targets.isEmpty()) {
// detaching as it is not necessary to persist the set itself
@@ -339,8 +335,8 @@ public class DeploymentManagement {
});
// select updated targets in order to return them
- final DistributionSetAssignmentResult result = new DistributionSetAssignmentResult(targets.stream()
- .map(target -> target.getControllerId()).collect(Collectors.toList()), targets.size(),
+ final DistributionSetAssignmentResult result = new DistributionSetAssignmentResult(
+ targets.stream().map(target -> target.getControllerId()).collect(Collectors.toList()), targets.size(),
controllerIDs.size() - targets.size(), Lists.newArrayList(targetIdsToActions.values()),
targetManagement);
@@ -353,11 +349,9 @@ public class DeploymentManagement {
// send distribution set assignment event
- targets.stream()
- .filter(t -> !!!targetIdsCancellList.contains(t.getId()))
- .forEach(
- t -> assignDistributionSetEvent(t, targetIdsToActions.get(t.getControllerId()).getId(),
- softwareModules));
+ targets.stream().filter(t -> !!!targetIdsCancellList.contains(t.getId()))
+ .forEach(t -> assignDistributionSetEvent(t, targetIdsToActions.get(t.getControllerId()).getId(),
+ softwareModules));
return result;
}
@@ -403,13 +397,13 @@ public class DeploymentManagement {
activeActions.forEach(action -> {
action.setStatus(Status.CANCELING);
// document that the status has been retrieved
- actionStatusRepository.save(new ActionStatus(action, Status.CANCELING, System.currentTimeMillis(),
- "manual cancelation requested"));
+ actionStatusRepository.save(new ActionStatus(action, Status.CANCELING, System.currentTimeMillis(),
+ "manual cancelation requested"));
- cancelAssignDistributionSetEvent(action.getTarget(), action.getId());
+ cancelAssignDistributionSetEvent(action.getTarget(), action.getId());
- cancelledTargetIds.add(action.getTarget().getId());
- });
+ cancelledTargetIds.add(action.getTarget().getId());
+ });
actionRepository.save(activeActions);
return cancelledTargetIds;
@@ -417,9 +411,8 @@ public class DeploymentManagement {
private DistributionSetAssignmentResult assignDistributionSetByTargetId(@NotNull final DistributionSet set,
@NotEmpty final List tIDs, final ActionType actionType, final long forcedTime) {
- return assignDistributionSetToTargets(set,
- tIDs.stream().map(t -> new TargetWithActionType(t, actionType, forcedTime))
- .collect(Collectors.toList()));
+ return assignDistributionSetToTargets(set, tIDs.stream()
+ .map(t -> new TargetWithActionType(t, actionType, forcedTime)).collect(Collectors.toList()));
}
/**
@@ -487,8 +480,8 @@ public class DeploymentManagement {
return saveAction;
} else {
- throw new CancelActionNotAllowedException("Action [id: " + action.getId()
- + "] is not active and cannot be canceled");
+ throw new CancelActionNotAllowedException(
+ "Action [id: " + action.getId() + "] is not active and cannot be canceled");
}
}
@@ -529,13 +522,13 @@ public class DeploymentManagement {
final Action mergedAction = entityManager.merge(action);
if (!mergedAction.isCancelingOrCanceled()) {
- throw new ForceQuitActionNotAllowedException("Action [id: " + action.getId()
- + "] is not canceled yet and cannot be force quit");
+ throw new ForceQuitActionNotAllowedException(
+ "Action [id: " + action.getId() + "] is not canceled yet and cannot be force quit");
}
if (!mergedAction.isActive()) {
- throw new ForceQuitActionNotAllowedException("Action [id: " + action.getId()
- + "] is not active and cannot be force quit");
+ throw new ForceQuitActionNotAllowedException(
+ "Action [id: " + action.getId() + "] is not active and cannot be force quit");
}
LOG.warn("action ({}) was still activ and has been force quite.", action);
@@ -650,7 +643,8 @@ public class DeploymentManagement {
return actionRepository.findAll(new Specification() {
@Override
- public Predicate toPredicate(final Root root, final CriteriaQuery> query, final CriteriaBuilder cb) {
+ public Predicate toPredicate(final Root root, final CriteriaQuery> query,
+ final CriteriaBuilder cb) {
return cb.and(specifiction.toPredicate(root, query, cb), cb.equal(root.get(Action_.target), target));
}
}, pageable);
@@ -752,7 +746,8 @@ public class DeploymentManagement {
public Long countActionsByTarget(@NotNull final Specification spec, @NotNull final Target target) {
return actionRepository.count(new Specification() {
@Override
- public Predicate toPredicate(final Root root, final CriteriaQuery> query, final CriteriaBuilder cb) {
+ public Predicate toPredicate(final Root root, final CriteriaQuery> query,
+ final CriteriaBuilder cb) {
return cb.and(spec.toPredicate(root, query, cb), cb.equal(root.get(Action_.target), target));
}
});
@@ -818,8 +813,8 @@ public class DeploymentManagement {
action.setStatus(Status.CANCELED);
final Target target = action.getTarget();
- final List nextActiveActions = actionRepository.findByTargetAndActiveOrderByIdAsc(target, true)
- .stream().filter(a -> !a.getId().equals(action.getId())).collect(Collectors.toList());
+ final List nextActiveActions = actionRepository.findByTargetAndActiveOrderByIdAsc(target, true).stream()
+ .filter(a -> !a.getId().equals(action.getId())).collect(Collectors.toList());
if (nextActiveActions.isEmpty()) {
target.setAssignedDistributionSet(target.getTargetInfo().getInstalledDistributionSet());
diff --git a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DistributionSetManagement.java b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DistributionSetManagement.java
index d4b7ac55e..0a3838354 100644
--- a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DistributionSetManagement.java
+++ b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DistributionSetManagement.java
@@ -219,7 +219,8 @@ public class DistributionSetManagement {
* @return the found {@link DistributionSet}s
*/
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
- public List findDistributionSetListWithDetails(@NotEmpty final Collection distributionIdSet) {
+ public List findDistributionSetListWithDetails(
+ @NotEmpty final Collection distributionIdSet) {
return distributionSetRepository.findAll(DistributionSetSpecification.byIds(distributionIdSet));
}
@@ -397,7 +398,8 @@ public class DistributionSetManagement {
@Modifying
@Transactional
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
- public DistributionSet unassignSoftwareModule(@NotNull final DistributionSet ds, final SoftwareModule softwareModule) {
+ public DistributionSet unassignSoftwareModule(@NotNull final DistributionSet ds,
+ final SoftwareModule softwareModule) {
final Set softwareModules = new HashSet();
softwareModules.add(softwareModule);
ds.removeModule(softwareModule);
@@ -429,9 +431,9 @@ public class DistributionSetManagement {
// throw exception if user tries to update a DS type that is already in
// use
if (!persisted.areModuleEntriesIdentical(dsType) && distributionSetRepository.countByType(persisted) > 0) {
- throw new EntityReadOnlyException(String.format(
- "distribution set type %s set is already assigned to targets and cannot be changed",
- dsType.getName()));
+ throw new EntityReadOnlyException(
+ String.format("distribution set type %s set is already assigned to targets and cannot be changed",
+ dsType.getName()));
}
return distributionSetTypeRepository.save(dsType);
@@ -597,14 +599,16 @@ public class DistributionSetManagement {
final DistributionSetFilter filterWithInstalledTargets = distributionSetFilterBuilder
.setInstalledTargetId(assignedOrInstalled).setAssignedTargetId(null).build();
- final DistributionSet installedDS = findDistributionSetsByFiltersAndInstalledOrAssignedTarget(filterWithInstalledTargets);
+ final DistributionSet installedDS = findDistributionSetsByFiltersAndInstalledOrAssignedTarget(
+ filterWithInstalledTargets);
final DistributionSetFilter filterWithAssignedTargets = distributionSetFilterBuilder.setInstalledTargetId(null)
.setAssignedTargetId(assignedOrInstalled).build();
- final DistributionSet assignedDS = findDistributionSetsByFiltersAndInstalledOrAssignedTarget(filterWithAssignedTargets);
+ final DistributionSet assignedDS = findDistributionSetsByFiltersAndInstalledOrAssignedTarget(
+ filterWithAssignedTargets);
- final DistributionSetFilter dsFilterWithNoTargetLinked = distributionSetFilterBuilder
- .setInstalledTargetId(null).setAssignedTargetId(null).build();
+ final DistributionSetFilter dsFilterWithNoTargetLinked = distributionSetFilterBuilder.setInstalledTargetId(null)
+ .setAssignedTargetId(null).build();
// first fine the distribution sets filtered by the given filter
// parameters
final Page findDistributionSetsByFilters = findDistributionSetsByFilters(pageable,
@@ -654,8 +658,8 @@ public class DistributionSetManagement {
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
public DistributionSet findDistributionSetByNameAndVersion(@NotEmpty final String distributionName,
@NotEmpty final String version) {
- final Specification spec = DistributionSetSpecification.equalsNameAndVersionIgnoreCase(
- distributionName, version);
+ final Specification spec = DistributionSetSpecification
+ .equalsNameAndVersionIgnoreCase(distributionName, version);
return distributionSetRepository.findOne(spec);
}
@@ -1009,17 +1013,17 @@ public class DistributionSetManagement {
final Set softwareModules) {
if (!new HashSet(distributionSet.getModules()).equals(softwareModules)
&& actionRepository.countByDistributionSet(distributionSet) > 0) {
- throw new EntityLockedException(String.format(
- "distribution set %s:%s is already assigned to targets and cannot be changed",
- distributionSet.getName(), distributionSet.getVersion()));
+ throw new EntityLockedException(
+ String.format("distribution set %s:%s is already assigned to targets and cannot be changed",
+ distributionSet.getName(), distributionSet.getVersion()));
}
}
private void checkDistributionSetSoftwareModulesIsAllowedToModify(final DistributionSet distributionSet) {
if (actionRepository.countByDistributionSet(distributionSet) > 0) {
- throw new EntityLockedException(String.format(
- "distribution set %s:%s is already assigned to targets and cannot be changed",
- distributionSet.getName(), distributionSet.getVersion()));
+ throw new EntityLockedException(
+ String.format("distribution set %s:%s is already assigned to targets and cannot be changed",
+ distributionSet.getName(), distributionSet.getVersion()));
}
}
@@ -1068,8 +1072,8 @@ public class DistributionSetManagement {
private void checkAndThrowAlreadyIfDistributionSetMetadataExists(final DsMetadataCompositeKey metadataId) {
if (distributionSetMetadataRepository.exists(metadataId)) {
- throw new EntityAlreadyExistsException("Metadata entry with key '" + metadataId.getKey()
- + "' already exists");
+ throw new EntityAlreadyExistsException(
+ "Metadata entry with key '" + metadataId.getKey() + "' already exists");
}
}
@@ -1091,7 +1095,8 @@ public class DistributionSetManagement {
@Transactional
@NotNull
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
- public List assignTag(@NotEmpty final Collection dsIds, @NotNull final DistributionSetTag tag) {
+ public List assignTag(@NotEmpty final Collection dsIds,
+ @NotNull final DistributionSetTag tag) {
final List allDs = findDistributionSetListWithDetails(dsIds);
allDs.forEach(ds -> ds.getTags().add(tag));
diff --git a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DistributionSetTagRepository.java b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DistributionSetTagRepository.java
index e09db5cb2..c00713fc4 100644
--- a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DistributionSetTagRepository.java
+++ b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/DistributionSetTagRepository.java
@@ -24,8 +24,8 @@ import org.springframework.transaction.annotation.Transactional;
*
*/
@Transactional(readOnly = true)
-public interface DistributionSetTagRepository extends BaseEntityRepository,
- JpaSpecificationExecutor {
+public interface DistributionSetTagRepository
+ extends BaseEntityRepository, JpaSpecificationExecutor {
/**
* deletes the {@link DistributionSet} with the given name.
*
diff --git a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/TagManagement.java b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/TagManagement.java
index d0cfea0a3..4d8b4ff5c 100644
--- a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/TagManagement.java
+++ b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/TagManagement.java
@@ -267,8 +267,8 @@ public class TagManagement {
final DistributionSetTag save = distributionSetTagRepository.save(distributionSetTag);
- afterCommit.afterCommit(() -> eventBus.post(new DistributionSetTagCreatedBulkEvent(tenantAware
- .getCurrentTenant(), save)));
+ afterCommit.afterCommit(
+ () -> eventBus.post(new DistributionSetTagCreatedBulkEvent(tenantAware.getCurrentTenant(), save)));
return save;
}
@@ -292,8 +292,8 @@ public class TagManagement {
}
}
final List save = distributionSetTagRepository.save(distributionSetTags);
- afterCommit.afterCommit(() -> eventBus.post(new DistributionSetTagCreatedBulkEvent(tenantAware
- .getCurrentTenant(), save)));
+ afterCommit.afterCommit(
+ () -> eventBus.post(new DistributionSetTagCreatedBulkEvent(tenantAware.getCurrentTenant(), save)));
return save;
}
diff --git a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/TargetFilterQueryRepository.java b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/TargetFilterQueryRepository.java
index e78b02286..b9bfcc8b6 100644
--- a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/TargetFilterQueryRepository.java
+++ b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/TargetFilterQueryRepository.java
@@ -19,27 +19,26 @@ import org.springframework.transaction.annotation.Transactional;
*
*/
@Transactional(readOnly = true)
-public interface TargetFilterQueryRepository extends
- BaseEntityRepository,
- JpaSpecificationExecutor {
+public interface TargetFilterQueryRepository
+ extends BaseEntityRepository, JpaSpecificationExecutor {
- /**
- * Find customer target filter by name
- *
- * @param name
- * @return custom target filter
- */
- TargetFilterQuery findByName(final String name);
+ /**
+ * Find customer target filter by name
+ *
+ * @param name
+ * @return custom target filter
+ */
+ TargetFilterQuery findByName(final String name);
- /**
- * Find list of all custom target filters.
- */
- @Override
- Page findAll();
+ /**
+ * Find list of all custom target filters.
+ */
+ @Override
+ Page findAll();
- @Override
- @Modifying
- @Transactional
- S save(S entity);
+ @Override
+ @Modifying
+ @Transactional
+ S save(S entity);
}
diff --git a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/TargetManagement.java b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/TargetManagement.java
index fcc644d18..e7483fdd5 100644
--- a/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/TargetManagement.java
+++ b/hawkbit-repository/src/main/java/org/eclipse/hawkbit/repository/TargetManagement.java
@@ -350,9 +350,9 @@ public class TargetManagement {
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_READ_TARGET)
public Page findTargetByAssignedDistributionSet(@NotNull final Long distributionSetID,
final Specification spec, @NotNull final Pageable pageReq) {
- return targetRepository.findAll((Specification) (root, query, cb) -> cb.and(TargetSpecifications
- .hasAssignedDistributionSet(distributionSetID).toPredicate(root, query, cb), spec.toPredicate(root,
- query, cb)), pageReq);
+ return targetRepository.findAll((Specification) (root, query, cb) -> cb.and(
+ TargetSpecifications.hasAssignedDistributionSet(distributionSetID).toPredicate(root, query, cb),
+ spec.toPredicate(root, query, cb)), pageReq);
}
/**
@@ -389,9 +389,9 @@ public class TargetManagement {
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY_AND_READ_TARGET)
public Page findTargetByInstalledDistributionSet(final Long distributionSetId,
final Specification spec, final Pageable pageable) {
- return targetRepository.findAll((Specification) (root, query, cb) -> cb.and(TargetSpecifications
- .hasInstalledDistributionSet(distributionSetId).toPredicate(root, query, cb), spec.toPredicate(root,
- query, cb)), pageable);
+ return targetRepository.findAll((Specification) (root, query, cb) -> cb.and(
+ TargetSpecifications.hasInstalledDistributionSet(distributionSetId).toPredicate(root, query, cb),
+ spec.toPredicate(root, query, cb)), pageable);
}
/**
@@ -486,8 +486,8 @@ public class TargetManagement {
specList.add(TargetSpecifications.hasTargetUpdateStatus(status, fetch));
}
if (installedOrAssignedDistributionSetId != null) {
- specList.add(TargetSpecifications
- .hasInstalledOrAssignedDistributionSet(installedOrAssignedDistributionSetId));
+ specList.add(
+ TargetSpecifications.hasInstalledOrAssignedDistributionSet(installedOrAssignedDistributionSetId));
}
if (!Strings.isNullOrEmpty(searchText)) {
specList.add(TargetSpecifications.likeNameOrDescriptionOrIp(searchText));
@@ -559,8 +559,8 @@ public class TargetManagement {
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
public TargetTagAssigmentResult toggleTagAssignment(@NotEmpty final List targets,
@NotNull final TargetTag tag) {
- return toggleTagAssignment(targets.stream().map(target -> target.getControllerId())
- .collect(Collectors.toList()), tag.getName());
+ return toggleTagAssignment(
+ targets.stream().map(target -> target.getControllerId()).collect(Collectors.toList()), tag.getName());
}
/**
@@ -583,8 +583,8 @@ public class TargetManagement {
@NotNull final String tagName) {
final TargetTag tag = targetTagRepository.findByNameEquals(tagName);
final List alreadyAssignedTargets = targetRepository.findByTagNameAndControllerIdIn(tagName, targetIds);
- final List allTargets = targetRepository.findAll(TargetSpecifications
- .byControllerIdWithStatusAndTagsInJoin(targetIds));
+ final List allTargets = targetRepository
+ .findAll(TargetSpecifications.byControllerIdWithStatusAndTagsInJoin(targetIds));
// all are already assigned -> unassign
if (alreadyAssignedTargets.size() == allTargets.size()) {
@@ -623,8 +623,8 @@ public class TargetManagement {
@NotNull
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
public List assignTag(@NotEmpty final Collection targetIds, @NotNull final TargetTag tag) {
- final List allTargets = targetRepository.findAll(TargetSpecifications
- .byControllerIdWithStatusAndTagsInJoin(targetIds));
+ final List allTargets = targetRepository
+ .findAll(TargetSpecifications.byControllerIdWithStatusAndTagsInJoin(targetIds));
allTargets.forEach(target -> target.getTags().add(tag));
final List save = targetRepository.save(allTargets);
@@ -678,8 +678,8 @@ public class TargetManagement {
@Transactional
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_TARGET)
public Target unAssignTag(@NotNull final String controllerID, @NotNull final TargetTag targetTag) {
- final List allTargets = targetRepository.findAll(TargetSpecifications
- .byControllerIdWithStatusAndTagsInJoin(Arrays.asList(controllerID)));
+ final List allTargets = targetRepository
+ .findAll(TargetSpecifications.byControllerIdWithStatusAndTagsInJoin(Arrays.asList(controllerID)));
final List unAssignTag = unAssignTag(allTargets, targetTag);
return unAssignTag.isEmpty() ? null : unAssignTag.get(0);
}
@@ -740,19 +740,20 @@ public class TargetManagement {
// select case expression to retrieve the case value as a column to be
// able to order based on
// this column, installed first,...
- final Expression