public void validateDiscardTransferToken(EntityManager em, DiscardTransferToken body) throws DispositionReportFaultMessage {
// No null input
if (body == null)
throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
KeyBag keyBag = body.getKeyBag();
// The call must contain at least a transfer token or keyBag
if (body.getTransferToken() == null && keyBag == null)
throw new FatalErrorException(new ErrorMessage("errors.discardtransfertoken.NoInput"));
if (keyBag != null) {
List<String> keyList = keyBag.getKey();
if (keyList == null || keyList.size() == 0)
throw new ValueNotAllowedException(new ErrorMessage("errors.keybag.NoInput"));
// Test that publisher owns keys using operational info.
for (String key : keyList) {