UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
new ValidateClientSubscriptionInfo(publisher).validateSaveClientSubscriptionInfo(em, body);
ClientSubscriptionInfoDetail result = new ClientSubscriptionInfoDetail();
List<org.apache.juddi.api_v3.ClientSubscriptionInfo> apiClientSubscriptionInfoList = body.getClientSubscriptionInfo();
for (org.apache.juddi.api_v3.ClientSubscriptionInfo apiClientSubscriptionInfo : apiClientSubscriptionInfoList) {
org.apache.juddi.model.ClientSubscriptionInfo modelClientSubscriptionInfo = new org.apache.juddi.model.ClientSubscriptionInfo();
MappingApiToModel.mapClientSubscriptionInfo(apiClientSubscriptionInfo, modelClientSubscriptionInfo);
Object existingUddiEntity = em.find(modelClientSubscriptionInfo.getClass(), modelClientSubscriptionInfo.getSubscriptionKey());
if (existingUddiEntity != null) {
em.remove(existingUddiEntity);
}
em.persist(modelClientSubscriptionInfo);
result.getClientSubscriptionInfo().add(apiClientSubscriptionInfo);
}
tx.commit();
return result;
} finally {