Sonar issue fixed
Signed-off-by: Dominic Schabel <dominic.schabel@bosch-si.com>
This commit is contained in:
@@ -631,7 +631,7 @@ public class JpaRolloutManagement extends AbstractRolloutManagement {
|
|||||||
ConcurrencyFailureException.class }, maxAttempts = Constants.TX_RT_MAX, backoff = @Backoff(delay = Constants.TX_RT_DELAY))
|
ConcurrencyFailureException.class }, maxAttempts = Constants.TX_RT_MAX, backoff = @Backoff(delay = Constants.TX_RT_DELAY))
|
||||||
public void pauseRollout(final long rolloutId) {
|
public void pauseRollout(final long rolloutId) {
|
||||||
final JpaRollout rollout = getRolloutAndThrowExceptionIfNotFound(rolloutId);
|
final JpaRollout rollout = getRolloutAndThrowExceptionIfNotFound(rolloutId);
|
||||||
if (!RolloutStatus.RUNNING.equals(rollout.getStatus())) {
|
if (RolloutStatus.RUNNING != rollout.getStatus()) {
|
||||||
throw new RolloutIllegalStateException("Rollout can only be paused in state running but current state is "
|
throw new RolloutIllegalStateException("Rollout can only be paused in state running but current state is "
|
||||||
+ rollout.getStatus().name().toLowerCase());
|
+ rollout.getStatus().name().toLowerCase());
|
||||||
}
|
}
|
||||||
@@ -650,7 +650,7 @@ public class JpaRolloutManagement extends AbstractRolloutManagement {
|
|||||||
ConcurrencyFailureException.class }, maxAttempts = Constants.TX_RT_MAX, backoff = @Backoff(delay = Constants.TX_RT_DELAY))
|
ConcurrencyFailureException.class }, maxAttempts = Constants.TX_RT_MAX, backoff = @Backoff(delay = Constants.TX_RT_DELAY))
|
||||||
public void resumeRollout(final long rolloutId) {
|
public void resumeRollout(final long rolloutId) {
|
||||||
final JpaRollout rollout = getRolloutAndThrowExceptionIfNotFound(rolloutId);
|
final JpaRollout rollout = getRolloutAndThrowExceptionIfNotFound(rolloutId);
|
||||||
if (!(RolloutStatus.PAUSED.equals(rollout.getStatus()))) {
|
if (RolloutStatus.PAUSED != rollout.getStatus()) {
|
||||||
throw new RolloutIllegalStateException("Rollout can only be resumed in state paused but current state is "
|
throw new RolloutIllegalStateException("Rollout can only be resumed in state paused but current state is "
|
||||||
+ rollout.getStatus().name().toLowerCase());
|
+ rollout.getStatus().name().toLowerCase());
|
||||||
}
|
}
|
||||||
@@ -751,7 +751,7 @@ public class JpaRolloutManagement extends AbstractRolloutManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isRolloutGroupComplete(final JpaRollout rollout, final JpaRolloutGroup rolloutGroup) {
|
private boolean isRolloutGroupComplete(final JpaRollout rollout, final JpaRolloutGroup rolloutGroup) {
|
||||||
final Long actionsLeftForRollout = ActionType.DOWNLOAD_ONLY.equals(rollout.getActionType())
|
final Long actionsLeftForRollout = ActionType.DOWNLOAD_ONLY == rollout.getActionType()
|
||||||
? actionRepository.countByRolloutAndRolloutGroupAndStatusNotIn(rollout, rolloutGroup,
|
? actionRepository.countByRolloutAndRolloutGroupAndStatusNotIn(rollout, rolloutGroup,
|
||||||
DOWNLOAD_ONLY_ACTION_TERMINATION_STATUSES)
|
DOWNLOAD_ONLY_ACTION_TERMINATION_STATUSES)
|
||||||
: actionRepository.countByRolloutAndRolloutGroupAndStatusNotIn(rollout, rolloutGroup,
|
: actionRepository.countByRolloutAndRolloutGroupAndStatusNotIn(rollout, rolloutGroup,
|
||||||
@@ -887,7 +887,7 @@ public class JpaRolloutManagement extends AbstractRolloutManagement {
|
|||||||
throw new EntityNotFoundException(Rollout.class, rolloutId);
|
throw new EntityNotFoundException(Rollout.class, rolloutId);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RolloutStatus.DELETING.equals(jpaRollout.getStatus())) {
|
if (RolloutStatus.DELETING == jpaRollout.getStatus()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1028,7 +1028,7 @@ public class JpaRolloutManagement extends AbstractRolloutManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void checkIfDeleted(final Long rolloutId, final RolloutStatus status) {
|
private static void checkIfDeleted(final Long rolloutId, final RolloutStatus status) {
|
||||||
if (RolloutStatus.DELETING.equals(status) || RolloutStatus.DELETED.equals(status)) {
|
if (RolloutStatus.DELETING == status || RolloutStatus.DELETED == status) {
|
||||||
throw new EntityReadOnlyException("Rollout " + rolloutId + " is soft deleted and cannot be changed");
|
throw new EntityReadOnlyException("Rollout " + rolloutId + " is soft deleted and cannot be changed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -348,10 +348,9 @@ public class AddUpdateRolloutWindowLayout extends GridLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private long getForcedTimeStamp() {
|
private long getForcedTimeStamp() {
|
||||||
return ActionTypeOption.AUTO_FORCED
|
return ActionTypeOption.AUTO_FORCED == actionTypeOptionGroupLayout.getActionTypeOptionGroup().getValue()
|
||||||
.equals(actionTypeOptionGroupLayout.getActionTypeOptionGroup().getValue())
|
? actionTypeOptionGroupLayout.getForcedTimeDateField().getValue().getTime()
|
||||||
? actionTypeOptionGroupLayout.getForcedTimeDateField().getValue().getTime()
|
: RepositoryModelConstants.NO_FORCE_TIME;
|
||||||
: RepositoryModelConstants.NO_FORCE_TIME;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Long getScheduledStartTime() {
|
private Long getScheduledStartTime() {
|
||||||
|
|||||||
Reference in New Issue
Block a user