This commit is contained in:
parent
e8268be5aa
commit
fe87213cf8
2 changed files with 4 additions and 3 deletions
|
|
@ -15,7 +15,7 @@ public class DeletePackageStatusComparator {
|
|||
try {
|
||||
Status status = Status.valueOf(str);
|
||||
return switch (status) {
|
||||
case ON_MONITORING -> 1;
|
||||
case ON_MONITORING, PROCESSING_REPEATED -> 1;
|
||||
case DELETED -> 0;
|
||||
default -> -1;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import java.nio.file.Files;
|
|||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
|
|
@ -232,7 +233,7 @@ public class SignalFacadeV3 {
|
|||
-> clientExcp(SignalError.ERROR_016, XmlErrorFormat.MonitoringPackageDeleteError, packageName));
|
||||
|
||||
Status status = EnumUtil.getEnum(Status.class, packageToDelete.getStatus());
|
||||
if (!Status.ON_MONITORING.equals(status)) {
|
||||
if (!Arrays.asList(Status.ON_MONITORING, Status.PROCESSING_REPEATED).contains(status)) {
|
||||
throw clientExcp(deleteStatusError(status), XmlErrorFormat.MonitoringPackageDeleteError, packageName);
|
||||
}
|
||||
|
||||
|
|
@ -256,7 +257,7 @@ public class SignalFacadeV3 {
|
|||
private SignalError deleteStatusError(Status status) {
|
||||
if (status == null) return SignalError.ERROR_017;
|
||||
return switch (status) {
|
||||
case PROCESSING, ACCEPTED -> SignalError.ERROR_016;
|
||||
case PROCESSING, ACCEPTED -> SignalError.ERROR_023;
|
||||
case REJECTED, ERROR -> SignalError.ERROR_024;
|
||||
case DELETED -> SignalError.ERROR_025;
|
||||
case PROCESSING_REPEATED -> SignalError.ERROR_026;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue