UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
new ValidatePublish(publisher).validateSavePublisher(em, body);
PublisherDetail result = new PublisherDetail();
List<org.apache.juddi.api_v3.Publisher> apiPublisherList = body.getPublisher();
for (org.apache.juddi.api_v3.Publisher apiPublisher : apiPublisherList) {
org.apache.juddi.model.Publisher modelPublisher = new org.apache.juddi.model.Publisher();
MappingApiToModel.mapPublisher(apiPublisher, modelPublisher);
Object existingUddiEntity = em.find(modelPublisher.getClass(), modelPublisher.getAuthorizedName());
if (existingUddiEntity != null) {
em.remove(existingUddiEntity);
}
em.persist(modelPublisher);
result.getPublisher().add(apiPublisher);
}
tx.commit();
return result;
} finally {