}
// No null or empty list
List<org.uddi.api_v3.PublisherAssertion> entityList = body.getPublisherAssertion();
if (entityList == null || entityList.size() == 0) {
throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.NoPubAssertions"));
}
for (org.uddi.api_v3.PublisherAssertion entity : entityList) {
validateKeyLength(entity.getFromKey());
validateKeyLength(entity.getToKey());
validatePublisherAssertion(em, entity);
org.apache.juddi.model.PublisherAssertionId pubAssertionId = new org.apache.juddi.model.PublisherAssertionId(entity.getFromKey(), entity.getToKey());
Object obj = em.find(org.apache.juddi.model.PublisherAssertion.class, pubAssertionId);
if (obj == null) {
throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.AssertionNotFound", entity.getFromKey() + ", " + entity.getToKey()));
} else {
org.apache.juddi.model.PublisherAssertion pubAssertion = (org.apache.juddi.model.PublisherAssertion) obj;
org.uddi.api_v3.KeyedReference keyedRef = entity.getKeyedReference();
if (keyedRef == null) {
throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.AssertionNotFound", entity.getFromKey() + ", " + entity.getToKey()));
}
if (!pubAssertion.getTmodelKey().equalsIgnoreCase(keyedRef.getTModelKey())
|| !pubAssertion.getKeyName().equalsIgnoreCase(keyedRef.getKeyName())
|| !pubAssertion.getKeyValue().equalsIgnoreCase(keyedRef.getKeyValue())) {
throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.AssertionNotFound", entity.getFromKey() + ", " + entity.getToKey()));
}
}
}