[CST-12108] improve code to use withdrawn and reinstate functionalities

This commit is contained in:
Mykhaylo
2023-10-25 21:43:11 +02:00
parent 56e2f10202
commit 2feff4f522
10 changed files with 47 additions and 11 deletions

View File

@@ -13,6 +13,7 @@ import java.security.NoSuchAlgorithmException;
import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.dspace.qaevent.service.dto.EmptyMessageDTO;
import org.dspace.qaevent.service.dto.OpenaireMessageDTO;
import org.dspace.qaevent.service.dto.QAMessageDTO;
import org.dspace.util.RawJsonDeserializer;
@@ -30,6 +31,7 @@ public class QAEvent {
public static final String DISCARDED = "discarded";
public static final String OPENAIRE_SOURCE = "openaire";
public static final String INTERNAL_ITEM_SOURCE = "internal-item";
private String source;
@@ -195,6 +197,8 @@ public class QAEvent {
switch (getSource()) {
case OPENAIRE_SOURCE:
return OpenaireMessageDTO.class;
case INTERNAL_ITEM_SOURCE:
return EmptyMessageDTO.class;
default:
throw new IllegalArgumentException("Unknown event's source: " + getSource());
}