Fix Sonar findings (#2600)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -31,6 +31,7 @@ import org.eclipse.hawkbit.repository.TargetManagement;
|
|||||||
import org.eclipse.hawkbit.repository.TenantConfigurationManagement;
|
import org.eclipse.hawkbit.repository.TenantConfigurationManagement;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||||
|
import org.eclipse.hawkbit.repository.model.Target;
|
||||||
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
||||||
import org.springframework.amqp.core.Binding;
|
import org.springframework.amqp.core.Binding;
|
||||||
import org.springframework.amqp.core.BindingBuilder;
|
import org.springframework.amqp.core.BindingBuilder;
|
||||||
@@ -268,7 +269,7 @@ public class DmfApiConfiguration {
|
|||||||
final RabbitTemplate rabbitTemplate,
|
final RabbitTemplate rabbitTemplate,
|
||||||
final AmqpMessageSenderService amqpSenderService, final ArtifactUrlHandler artifactUrlHandler,
|
final AmqpMessageSenderService amqpSenderService, final ArtifactUrlHandler artifactUrlHandler,
|
||||||
final SystemSecurityContext systemSecurityContext, final SystemManagement systemManagement,
|
final SystemSecurityContext systemSecurityContext, final SystemManagement systemManagement,
|
||||||
final TargetManagement targetManagement, final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
final TargetManagement<? extends Target> targetManagement, final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
||||||
final SoftwareModuleManagement<? extends SoftwareModule> softwareModuleManagement, final DeploymentManagement deploymentManagement,
|
final SoftwareModuleManagement<? extends SoftwareModule> softwareModuleManagement, final DeploymentManagement deploymentManagement,
|
||||||
final TenantConfigurationManagement tenantConfigurationManagement) {
|
final TenantConfigurationManagement tenantConfigurationManagement) {
|
||||||
return new AmqpMessageDispatcherService(rabbitTemplate, amqpSenderService, artifactUrlHandler,
|
return new AmqpMessageDispatcherService(rabbitTemplate, amqpSenderService, artifactUrlHandler,
|
||||||
|
|||||||
@@ -33,11 +33,11 @@ import static org.eclipse.hawkbit.mgmt.rest.resource.util.PagingUtility.sanitize
|
|||||||
@RestController
|
@RestController
|
||||||
public class MgmtTargetGroupResource implements MgmtTargetGroupRestApi {
|
public class MgmtTargetGroupResource implements MgmtTargetGroupRestApi {
|
||||||
|
|
||||||
private final TargetManagement targetManagement;
|
private final TargetManagement<? extends Target> targetManagement;
|
||||||
private final TenantConfigHelper tenantConfigHelper;
|
private final TenantConfigHelper tenantConfigHelper;
|
||||||
|
|
||||||
public MgmtTargetGroupResource(
|
public MgmtTargetGroupResource(
|
||||||
final TargetManagement targetManagement,
|
final TargetManagement <? extends Target>targetManagement,
|
||||||
final TenantConfigurationManagement tenantConfigurationManagement, final SystemSecurityContext systemSecurityContext) {
|
final TenantConfigurationManagement tenantConfigurationManagement, final SystemSecurityContext systemSecurityContext) {
|
||||||
this.targetManagement = targetManagement;
|
this.targetManagement = targetManagement;
|
||||||
this.tenantConfigHelper = TenantConfigHelper.usingContext(systemSecurityContext, tenantConfigurationManagement);
|
this.tenantConfigHelper = TenantConfigHelper.usingContext(systemSecurityContext, tenantConfigurationManagement);
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class JpaRolloutExecutor implements RolloutExecutor {
|
|||||||
private final RolloutGroupRepository rolloutGroupRepository;
|
private final RolloutGroupRepository rolloutGroupRepository;
|
||||||
private final RolloutTargetGroupRepository rolloutTargetGroupRepository;
|
private final RolloutTargetGroupRepository rolloutTargetGroupRepository;
|
||||||
private final RolloutRepository rolloutRepository;
|
private final RolloutRepository rolloutRepository;
|
||||||
private final TargetManagement targetManagement;
|
private final TargetManagement<? extends Target> targetManagement;
|
||||||
private final DeploymentManagement deploymentManagement;
|
private final DeploymentManagement deploymentManagement;
|
||||||
private final RolloutGroupManagement rolloutGroupManagement;
|
private final RolloutGroupManagement rolloutGroupManagement;
|
||||||
private final RolloutManagement rolloutManagement;
|
private final RolloutManagement rolloutManagement;
|
||||||
@@ -121,7 +121,7 @@ public class JpaRolloutExecutor implements RolloutExecutor {
|
|||||||
public JpaRolloutExecutor(
|
public JpaRolloutExecutor(
|
||||||
final ActionRepository actionRepository, final RolloutGroupRepository rolloutGroupRepository,
|
final ActionRepository actionRepository, final RolloutGroupRepository rolloutGroupRepository,
|
||||||
final RolloutTargetGroupRepository rolloutTargetGroupRepository,
|
final RolloutTargetGroupRepository rolloutTargetGroupRepository,
|
||||||
final RolloutRepository rolloutRepository, final TargetManagement targetManagement,
|
final RolloutRepository rolloutRepository, final TargetManagement<? extends Target> targetManagement,
|
||||||
final DeploymentManagement deploymentManagement, final RolloutGroupManagement rolloutGroupManagement,
|
final DeploymentManagement deploymentManagement, final RolloutGroupManagement rolloutGroupManagement,
|
||||||
final RolloutManagement rolloutManagement, final QuotaManagement quotaManagement,
|
final RolloutManagement rolloutManagement, final QuotaManagement quotaManagement,
|
||||||
final RolloutGroupEvaluationManager evaluationManager, final RolloutApprovalStrategy rolloutApprovalStrategy,
|
final RolloutGroupEvaluationManager evaluationManager, final RolloutApprovalStrategy rolloutApprovalStrategy,
|
||||||
|
|||||||
@@ -151,7 +151,6 @@ public class JpaControllerManagement extends JpaActionManagement implements Cont
|
|||||||
private final Duration minPollingTime;
|
private final Duration minPollingTime;
|
||||||
private final Duration maxPollingTime;
|
private final Duration maxPollingTime;
|
||||||
private final PlatformTransactionManager txManager;
|
private final PlatformTransactionManager txManager;
|
||||||
private final EntityFactory entityFactory;
|
|
||||||
private final EntityManager entityManager;
|
private final EntityManager entityManager;
|
||||||
private final AfterTransactionCommitExecutor afterCommit;
|
private final AfterTransactionCommitExecutor afterCommit;
|
||||||
private final SystemSecurityContext systemSecurityContext;
|
private final SystemSecurityContext systemSecurityContext;
|
||||||
@@ -167,7 +166,7 @@ public class JpaControllerManagement extends JpaActionManagement implements Cont
|
|||||||
final SoftwareModuleManagement<? extends SoftwareModule> softwareModuleManagement,
|
final SoftwareModuleManagement<? extends SoftwareModule> softwareModuleManagement,
|
||||||
final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
||||||
final TenantConfigurationManagement tenantConfigurationManagement, final ControllerPollProperties controllerPollProperties,
|
final TenantConfigurationManagement tenantConfigurationManagement, final ControllerPollProperties controllerPollProperties,
|
||||||
final PlatformTransactionManager txManager, final EntityFactory entityFactory, final EntityManager entityManager,
|
final PlatformTransactionManager txManager, final EntityManager entityManager,
|
||||||
final AfterTransactionCommitExecutor afterCommit,
|
final AfterTransactionCommitExecutor afterCommit,
|
||||||
final SystemSecurityContext systemSecurityContext, final TenantAware tenantAware,
|
final SystemSecurityContext systemSecurityContext, final TenantAware tenantAware,
|
||||||
final ScheduledExecutorService executorService) {
|
final ScheduledExecutorService executorService) {
|
||||||
@@ -189,7 +188,6 @@ public class JpaControllerManagement extends JpaActionManagement implements Cont
|
|||||||
? Duration.of(100, ChronoUnit.YEARS)
|
? Duration.of(100, ChronoUnit.YEARS)
|
||||||
: DurationHelper.fromString(controllerPollProperties.getMaxPollingTime());
|
: DurationHelper.fromString(controllerPollProperties.getMaxPollingTime());
|
||||||
this.txManager = txManager;
|
this.txManager = txManager;
|
||||||
this.entityFactory = entityFactory;
|
|
||||||
this.entityManager = entityManager;
|
this.entityManager = entityManager;
|
||||||
this.afterCommit = afterCommit;
|
this.afterCommit = afterCommit;
|
||||||
this.systemSecurityContext = systemSecurityContext;
|
this.systemSecurityContext = systemSecurityContext;
|
||||||
@@ -847,8 +845,7 @@ public class JpaControllerManagement extends JpaActionManagement implements Cont
|
|||||||
|
|
||||||
EventPublisherHolder.getInstance().getEventPublisher()
|
EventPublisherHolder.getInstance().getEventPublisher()
|
||||||
.publishEvent(new TargetAttributesRequestedEvent(tenantAware.getCurrentTenant(), target.getId(),
|
.publishEvent(new TargetAttributesRequestedEvent(tenantAware.getCurrentTenant(), target.getId(),
|
||||||
JpaTarget.class, target.getControllerId(), target.getAddress() != null ? target.getAddress().toString() : null
|
JpaTarget.class, target.getControllerId(), target.getAddress() != null ? target.getAddress() : null));
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleErrorOnAction(final JpaAction mergedAction, final JpaTarget mergedTarget) {
|
private void handleErrorOnAction(final JpaAction mergedAction, final JpaTarget mergedTarget) {
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class JpaRolloutManagement implements RolloutManagement {
|
|||||||
private final StartNextGroupRolloutGroupSuccessAction startNextRolloutGroupAction;
|
private final StartNextGroupRolloutGroupSuccessAction startNextRolloutGroupAction;
|
||||||
private final RolloutStatusCache rolloutStatusCache;
|
private final RolloutStatusCache rolloutStatusCache;
|
||||||
private final ActionRepository actionRepository;
|
private final ActionRepository actionRepository;
|
||||||
private final TargetManagement targetManagement;
|
private final TargetManagement<? extends Target> targetManagement;
|
||||||
private final DistributionSetManagement<? extends DistributionSet> distributionSetManagement;
|
private final DistributionSetManagement<? extends DistributionSet> distributionSetManagement;
|
||||||
private final TenantConfigurationManagement tenantConfigurationManagement;
|
private final TenantConfigurationManagement tenantConfigurationManagement;
|
||||||
private final QuotaManagement quotaManagement;
|
private final QuotaManagement quotaManagement;
|
||||||
@@ -134,7 +134,7 @@ public class JpaRolloutManagement implements RolloutManagement {
|
|||||||
final StartNextGroupRolloutGroupSuccessAction startNextRolloutGroupAction,
|
final StartNextGroupRolloutGroupSuccessAction startNextRolloutGroupAction,
|
||||||
final RolloutStatusCache rolloutStatusCache,
|
final RolloutStatusCache rolloutStatusCache,
|
||||||
final ActionRepository actionRepository,
|
final ActionRepository actionRepository,
|
||||||
final TargetManagement targetManagement,
|
final TargetManagement<? extends Target> targetManagement,
|
||||||
final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
||||||
final TenantConfigurationManagement tenantConfigurationManagement,
|
final TenantConfigurationManagement tenantConfigurationManagement,
|
||||||
final QuotaManagement quotaManagement,
|
final QuotaManagement quotaManagement,
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class JpaTargetFilterQueryManagement
|
|||||||
extends AbstractJpaRepositoryManagement<JpaTargetFilterQuery, TargetFilterQueryManagement.Create, TargetFilterQueryManagement.Update, TargetFilterQueryRepository, TargetFilterQueryFields>
|
extends AbstractJpaRepositoryManagement<JpaTargetFilterQuery, TargetFilterQueryManagement.Create, TargetFilterQueryManagement.Update, TargetFilterQueryRepository, TargetFilterQueryFields>
|
||||||
implements TargetFilterQueryManagement<JpaTargetFilterQuery>{
|
implements TargetFilterQueryManagement<JpaTargetFilterQuery>{
|
||||||
|
|
||||||
private final TargetManagement targetManagement;
|
private final TargetManagement<? extends Target> targetManagement;
|
||||||
private final DistributionSetManagement<? extends DistributionSet> distributionSetManagement;
|
private final DistributionSetManagement<? extends DistributionSet> distributionSetManagement;
|
||||||
private final QuotaManagement quotaManagement;
|
private final QuotaManagement quotaManagement;
|
||||||
private final TenantConfigurationManagement tenantConfigurationManagement;
|
private final TenantConfigurationManagement tenantConfigurationManagement;
|
||||||
@@ -80,7 +80,7 @@ class JpaTargetFilterQueryManagement
|
|||||||
|
|
||||||
protected JpaTargetFilterQueryManagement(
|
protected JpaTargetFilterQueryManagement(
|
||||||
final TargetFilterQueryRepository targetFilterQueryRepository, final EntityManager entityManager,
|
final TargetFilterQueryRepository targetFilterQueryRepository, final EntityManager entityManager,
|
||||||
final TargetManagement targetManagement, final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
final TargetManagement<? extends Target> targetManagement, final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
||||||
final QuotaManagement quotaManagement, final TenantConfigurationManagement tenantConfigurationManagement,
|
final QuotaManagement quotaManagement, final TenantConfigurationManagement tenantConfigurationManagement,
|
||||||
final RepositoryProperties repositoryProperties,
|
final RepositoryProperties repositoryProperties,
|
||||||
final SystemSecurityContext systemSecurityContext, final ContextAware contextAware, final AuditorAware<String> auditorAware) {
|
final SystemSecurityContext systemSecurityContext, final ContextAware contextAware, final AuditorAware<String> auditorAware) {
|
||||||
|
|||||||
Reference in New Issue
Block a user