Fix Sonar Findings (#2596)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -86,7 +86,7 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi {
|
|||||||
private final DistributionSetTypeManagement<? extends DistributionSetType> distributionSetTypeManagement;
|
private final DistributionSetTypeManagement<? extends DistributionSetType> distributionSetTypeManagement;
|
||||||
private final DistributionSetInvalidationManagement distributionSetInvalidationManagement;
|
private final DistributionSetInvalidationManagement distributionSetInvalidationManagement;
|
||||||
private final TargetManagement targetManagement;
|
private final TargetManagement targetManagement;
|
||||||
private final TargetFilterQueryManagement targetFilterQueryManagement;
|
private final TargetFilterQueryManagement<? extends TargetFilterQuery> targetFilterQueryManagement;
|
||||||
private final DeploymentManagement deployManagement;
|
private final DeploymentManagement deployManagement;
|
||||||
private final SystemManagement systemManagement;
|
private final SystemManagement systemManagement;
|
||||||
private final MgmtDistributionSetMapper mgmtDistributionSetMapper;
|
private final MgmtDistributionSetMapper mgmtDistributionSetMapper;
|
||||||
@@ -99,7 +99,7 @@ public class MgmtDistributionSetResource implements MgmtDistributionSetRestApi {
|
|||||||
final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
||||||
final DistributionSetTypeManagement<? extends DistributionSetType> distributionSetTypeManagement,
|
final DistributionSetTypeManagement<? extends DistributionSetType> distributionSetTypeManagement,
|
||||||
final DistributionSetInvalidationManagement distributionSetInvalidationManagement,
|
final DistributionSetInvalidationManagement distributionSetInvalidationManagement,
|
||||||
final TargetManagement targetManagement, final TargetFilterQueryManagement targetFilterQueryManagement,
|
final TargetManagement targetManagement, final TargetFilterQueryManagement<? extends TargetFilterQuery> targetFilterQueryManagement,
|
||||||
final DeploymentManagement deployManagement, final TenantConfigurationManagement tenantConfigurationManagement,
|
final DeploymentManagement deployManagement, final TenantConfigurationManagement tenantConfigurationManagement,
|
||||||
final MgmtDistributionSetMapper mgmtDistributionSetMapper,
|
final MgmtDistributionSetMapper mgmtDistributionSetMapper,
|
||||||
final SystemManagement systemManagement, final SystemSecurityContext systemSecurityContext) {
|
final SystemManagement systemManagement, final SystemSecurityContext systemSecurityContext) {
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
|||||||
import org.eclipse.hawkbit.repository.model.RolloutGroupConditionBuilder;
|
import org.eclipse.hawkbit.repository.model.RolloutGroupConditionBuilder;
|
||||||
import org.eclipse.hawkbit.repository.model.RolloutGroupConditions;
|
import org.eclipse.hawkbit.repository.model.RolloutGroupConditions;
|
||||||
import org.eclipse.hawkbit.repository.model.Target;
|
import org.eclipse.hawkbit.repository.model.Target;
|
||||||
|
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
||||||
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
||||||
import org.eclipse.hawkbit.utils.TenantConfigHelper;
|
import org.eclipse.hawkbit.utils.TenantConfigHelper;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
@@ -65,14 +66,14 @@ public class MgmtRolloutResource implements MgmtRolloutRestApi {
|
|||||||
private final RolloutManagement rolloutManagement;
|
private final RolloutManagement rolloutManagement;
|
||||||
private final RolloutGroupManagement rolloutGroupManagement;
|
private final RolloutGroupManagement rolloutGroupManagement;
|
||||||
private final DistributionSetManagement<? extends DistributionSet> distributionSetManagement;
|
private final DistributionSetManagement<? extends DistributionSet> distributionSetManagement;
|
||||||
private final TargetFilterQueryManagement targetFilterQueryManagement;
|
private final TargetFilterQueryManagement<? extends TargetFilterQuery> targetFilterQueryManagement;
|
||||||
private final EntityFactory entityFactory;
|
private final EntityFactory entityFactory;
|
||||||
private final TenantConfigHelper tenantConfigHelper;
|
private final TenantConfigHelper tenantConfigHelper;
|
||||||
|
|
||||||
MgmtRolloutResource(
|
MgmtRolloutResource(
|
||||||
final RolloutManagement rolloutManagement, final RolloutGroupManagement rolloutGroupManagement,
|
final RolloutManagement rolloutManagement, final RolloutGroupManagement rolloutGroupManagement,
|
||||||
final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
||||||
final TargetFilterQueryManagement targetFilterQueryManagement, final EntityFactory entityFactory,
|
final TargetFilterQueryManagement<? extends TargetFilterQuery> targetFilterQueryManagement, final EntityFactory entityFactory,
|
||||||
final SystemSecurityContext systemSecurityContext,
|
final SystemSecurityContext systemSecurityContext,
|
||||||
final TenantConfigurationManagement tenantConfigurationManagement) {
|
final TenantConfigurationManagement tenantConfigurationManagement) {
|
||||||
this.rolloutManagement = rolloutManagement;
|
this.rolloutManagement = rolloutManagement;
|
||||||
|
|||||||
@@ -49,15 +49,13 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
public class MgmtTargetFilterQueryResource implements MgmtTargetFilterQueryRestApi {
|
public class MgmtTargetFilterQueryResource implements MgmtTargetFilterQueryRestApi {
|
||||||
|
|
||||||
private final TargetFilterQueryManagement<? extends TargetFilterQuery> filterManagement;
|
private final TargetFilterQueryManagement<? extends TargetFilterQuery> filterManagement;
|
||||||
private final EntityFactory entityFactory;
|
|
||||||
private final TenantConfigHelper tenantConfigHelper;
|
private final TenantConfigHelper tenantConfigHelper;
|
||||||
|
|
||||||
MgmtTargetFilterQueryResource(
|
MgmtTargetFilterQueryResource(
|
||||||
final TargetFilterQueryManagement<? extends TargetFilterQuery> filterManagement, final EntityFactory entityFactory,
|
final TargetFilterQueryManagement<? extends TargetFilterQuery> filterManagement,
|
||||||
final SystemSecurityContext systemSecurityContext,
|
final SystemSecurityContext systemSecurityContext,
|
||||||
final TenantConfigurationManagement tenantConfigurationManagement) {
|
final TenantConfigurationManagement tenantConfigurationManagement) {
|
||||||
this.filterManagement = filterManagement;
|
this.filterManagement = filterManagement;
|
||||||
this.entityFactory = entityFactory;
|
|
||||||
this.tenantConfigHelper = TenantConfigHelper.usingContext(systemSecurityContext, tenantConfigurationManagement);
|
this.tenantConfigHelper = TenantConfigHelper.usingContext(systemSecurityContext, tenantConfigurationManagement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -463,11 +463,11 @@ public class JpaRepositoryConfiguration {
|
|||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean
|
@ConditionalOnMissingBean
|
||||||
AutoAssignExecutor autoAssignExecutor(final TargetFilterQueryManagement targetFilterQueryManagement,
|
AutoAssignExecutor autoAssignExecutor(
|
||||||
final TargetManagement targetManagement, final DeploymentManagement deploymentManagement,
|
final TargetFilterQueryManagement<? extends TargetFilterQuery> targetFilterQueryManagement, final TargetManagement targetManagement,
|
||||||
|
final DeploymentManagement deploymentManagement,
|
||||||
final PlatformTransactionManager transactionManager, final ContextAware contextAware) {
|
final PlatformTransactionManager transactionManager, final ContextAware contextAware) {
|
||||||
return new AutoAssignChecker(targetFilterQueryManagement, targetManagement, deploymentManagement,
|
return new AutoAssignChecker(targetFilterQueryManagement, targetManagement, deploymentManagement, transactionManager, contextAware);
|
||||||
transactionManager, contextAware);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public abstract class AbstractAutoAssignExecutor implements AutoAssignExecutor {
|
|||||||
*/
|
*/
|
||||||
private static final int PAGE_SIZE = 1000;
|
private static final int PAGE_SIZE = 1000;
|
||||||
|
|
||||||
private final TargetFilterQueryManagement targetFilterQueryManagement;
|
private final TargetFilterQueryManagement<? extends TargetFilterQuery> targetFilterQueryManagement;
|
||||||
private final DeploymentManagement deploymentManagement;
|
private final DeploymentManagement deploymentManagement;
|
||||||
private final PlatformTransactionManager transactionManager;
|
private final PlatformTransactionManager transactionManager;
|
||||||
private final ContextAware contextAware;
|
private final ContextAware contextAware;
|
||||||
@@ -59,9 +59,10 @@ public abstract class AbstractAutoAssignExecutor implements AutoAssignExecutor {
|
|||||||
* @param transactionManager to run transactions
|
* @param transactionManager to run transactions
|
||||||
* @param contextAware to handle the context
|
* @param contextAware to handle the context
|
||||||
*/
|
*/
|
||||||
protected AbstractAutoAssignExecutor(final TargetFilterQueryManagement targetFilterQueryManagement,
|
protected AbstractAutoAssignExecutor(
|
||||||
final DeploymentManagement deploymentManagement, final PlatformTransactionManager transactionManager,
|
final TargetFilterQueryManagement<? extends TargetFilterQuery> targetFilterQueryManagement,
|
||||||
final ContextAware contextAware) {
|
final DeploymentManagement deploymentManagement,
|
||||||
|
final PlatformTransactionManager transactionManager, final ContextAware contextAware) {
|
||||||
this.targetFilterQueryManagement = targetFilterQueryManagement;
|
this.targetFilterQueryManagement = targetFilterQueryManagement;
|
||||||
this.deploymentManagement = deploymentManagement;
|
this.deploymentManagement = deploymentManagement;
|
||||||
this.transactionManager = transactionManager;
|
this.transactionManager = transactionManager;
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ public class AutoAssignChecker extends AbstractAutoAssignExecutor {
|
|||||||
* @param transactionManager to run transactions
|
* @param transactionManager to run transactions
|
||||||
* @param contextAware to handle the context
|
* @param contextAware to handle the context
|
||||||
*/
|
*/
|
||||||
public AutoAssignChecker(final TargetFilterQueryManagement targetFilterQueryManagement,
|
public AutoAssignChecker(
|
||||||
|
final TargetFilterQueryManagement<? extends TargetFilterQuery> targetFilterQueryManagement,
|
||||||
final TargetManagement targetManagement, final DeploymentManagement deploymentManagement,
|
final TargetManagement targetManagement, final DeploymentManagement deploymentManagement,
|
||||||
final PlatformTransactionManager transactionManager, final ContextAware contextAware) {
|
final PlatformTransactionManager transactionManager, final ContextAware contextAware) {
|
||||||
super(targetFilterQueryManagement, deploymentManagement, transactionManager, contextAware);
|
super(targetFilterQueryManagement, deploymentManagement, transactionManager, contextAware);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSet;
|
|||||||
import org.eclipse.hawkbit.repository.model.DistributionSetInvalidation;
|
import org.eclipse.hawkbit.repository.model.DistributionSetInvalidation;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSetInvalidation.CancelationType;
|
import org.eclipse.hawkbit.repository.model.DistributionSetInvalidation.CancelationType;
|
||||||
import org.eclipse.hawkbit.repository.model.DistributionSetInvalidationCount;
|
import org.eclipse.hawkbit.repository.model.DistributionSetInvalidationCount;
|
||||||
|
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
||||||
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
import org.eclipse.hawkbit.security.SystemSecurityContext;
|
||||||
import org.eclipse.hawkbit.tenancy.TenantAware;
|
import org.eclipse.hawkbit.tenancy.TenantAware;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBooleanProperty;
|
||||||
@@ -47,7 +48,7 @@ public class JpaDistributionSetInvalidationManagement implements DistributionSet
|
|||||||
private final DistributionSetManagement<? extends DistributionSet> distributionSetManagement;
|
private final DistributionSetManagement<? extends DistributionSet> distributionSetManagement;
|
||||||
private final RolloutManagement rolloutManagement;
|
private final RolloutManagement rolloutManagement;
|
||||||
private final DeploymentManagement deploymentManagement;
|
private final DeploymentManagement deploymentManagement;
|
||||||
private final TargetFilterQueryManagement targetFilterQueryManagement;
|
private final TargetFilterQueryManagement<? extends TargetFilterQuery> targetFilterQueryManagement;
|
||||||
private final ActionRepository actionRepository;
|
private final ActionRepository actionRepository;
|
||||||
private final PlatformTransactionManager txManager;
|
private final PlatformTransactionManager txManager;
|
||||||
private final RepositoryProperties repositoryProperties;
|
private final RepositoryProperties repositoryProperties;
|
||||||
@@ -56,9 +57,10 @@ public class JpaDistributionSetInvalidationManagement implements DistributionSet
|
|||||||
private final SystemSecurityContext systemSecurityContext;
|
private final SystemSecurityContext systemSecurityContext;
|
||||||
|
|
||||||
@SuppressWarnings("java:S107")
|
@SuppressWarnings("java:S107")
|
||||||
protected JpaDistributionSetInvalidationManagement(final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
protected JpaDistributionSetInvalidationManagement(
|
||||||
|
final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
||||||
final RolloutManagement rolloutManagement, final DeploymentManagement deploymentManagement,
|
final RolloutManagement rolloutManagement, final DeploymentManagement deploymentManagement,
|
||||||
final TargetFilterQueryManagement targetFilterQueryManagement, final ActionRepository actionRepository,
|
final TargetFilterQueryManagement<? extends TargetFilterQuery> targetFilterQueryManagement, final ActionRepository actionRepository,
|
||||||
final PlatformTransactionManager txManager, final RepositoryProperties repositoryProperties,
|
final PlatformTransactionManager txManager, final RepositoryProperties repositoryProperties,
|
||||||
final TenantAware tenantAware, final LockRegistry lockRegistry,
|
final TenantAware tenantAware, final LockRegistry lockRegistry,
|
||||||
final SystemSecurityContext systemSecurityContext) {
|
final SystemSecurityContext systemSecurityContext) {
|
||||||
|
|||||||
Reference in New Issue
Block a user