@Override public void validateValuesBusinessService(List<BusinessService> items, String xpath) throws DispositionReportFaultMessage { if (items == null) { return; } for (int i = 0; i < items.size(); i++) { if (items.get(i).getCategoryBag() != null) { AbstractSimpleValidator.validateKeyNotPresentKeyRef( items.get(i).getCategoryBag().getKeyedReference(), getMyKey(), "service"); AbstractSimpleValidator.validateKeyNotPresentKeyRefGrp( items.get(i).getCategoryBag().getKeyedReferenceGroup(), getMyKey(), "service"); } if (items.get(i).getBindingTemplates() != null) { validateValuesBindingTemplate( items.get(i).getBindingTemplates().getBindingTemplate(), xpath + xpath + "businessService(" + i + ").identifierBag."); } } }
@Override public void validateValuesPublisherAssertion(List<PublisherAssertion> items) throws DispositionReportFaultMessage { if (items == null) { return; } for (int i = 0; i < items.size(); i++) { AbstractSimpleValidator.validateKeyNotPresentKeyRef( items.get(i).getKeyedReference(), getMyKey(), "publisherAssertion"); } }
@Override public void validateValuesBusinessEntity(List<BusinessEntity> items) throws DispositionReportFaultMessage { if (items == null) { return; } for (int i = 0; i < items.size(); i++) { if (items.get(i).getCategoryBag() != null) { AbstractSimpleValidator.validateKeyNotPresentKeyRef( items.get(i).getCategoryBag().getKeyedReference(), getMyKey(), "business"); AbstractSimpleValidator.validateKeyNotPresentKeyRefGrp( items.get(i).getCategoryBag().getKeyedReferenceGroup(), getMyKey(), "business"); } if (items.get(i).getIdentifierBag() != null) { AbstractSimpleValidator.validateKeyNotPresentKeyRef( items.get(i).getCategoryBag().getKeyedReference(), getMyKey(), "business"); } if (items.get(i).getBusinessServices() != null) { validateValuesBusinessService( items.get(i).getBusinessServices().getBusinessService(), "businessEntity(" + i + ")."); } } }
@Override public void validateValuesBindingTemplate(List<BindingTemplate> items, String xpath) throws DispositionReportFaultMessage { if (items == null) { return; } for (int i = 0; i < items.size(); i++) { if (items.get(i).getCategoryBag() != null) { AbstractSimpleValidator.validateKeyNotPresentKeyRef( items.get(i).getCategoryBag().getKeyedReference(), getMyKey(), "binding"); AbstractSimpleValidator.validateKeyNotPresentKeyRefGrp( items.get(i).getCategoryBag().getKeyedReferenceGroup(), getMyKey(), "binding"); } if (items.get(i).getTModelInstanceDetails() != null) { for (int k = 0; k < items.get(i).getTModelInstanceDetails().getTModelInstanceInfo().size(); k++) { if (items.get(i).getTModelInstanceDetails().getTModelInstanceInfo().get(k) != null) { if (getMyKey() .equalsIgnoreCase( items .get(i) .getTModelInstanceDetails() .getTModelInstanceInfo() .get(k) .getTModelKey())) { throw new InvalidValueException( new ErrorMessage( "errors.valuesetvalidation.invalidcontent", "not allowed on binding templates")); } } } } } }
@Override public void validateValuesTModel(List<TModel> items) throws DispositionReportFaultMessage { if (items == null) { return; } EntityManager em = PersistenceManager.getEntityManager(); EntityTransaction tx = em.getTransaction(); try { for (int i = 0; i < items.size(); i++) { if (items.get(i).getCategoryBag() != null) { for (int k = 0; k < items.get(i).getCategoryBag().getKeyedReference().size(); k++) { if (getMyKey() .equalsIgnoreCase( items.get(i).getCategoryBag().getKeyedReference().get(k).getTModelKey())) { // TODO look up value Tmodel find = em.find( org.apache.juddi.model.Tmodel.class, items.get(i).getCategoryBag().getKeyedReference().get(k).getKeyValue()); if (find == null) { throw new InvalidValueException( new ErrorMessage( "errors.valuesetvalidation.invalidcontent", "Referenced key " + items.get(i).getCategoryBag().getKeyedReference().get(k).getKeyValue() + " does not exist")); } } } } if (items.get(i).getIdentifierBag() != null) { AbstractSimpleValidator.validateKeyNotPresentKeyRef( items.get(i).getIdentifierBag().getKeyedReference(), getMyKey(), "tmodel identbag"); } } } catch (DispositionReportFaultMessage d) { throw d; } finally { if (tx.isActive()) { tx.rollback(); } em.close(); } }