@Override public void validateValuesTModel(List<TModel> items) throws DispositionReportFaultMessage { if (items == null) { return; } for (int i = 0; i < items.size(); i++) { if (items.get(i).getCategoryBag() != null) { validatedValuesKeyRef(items.get(i).getCategoryBag().getKeyedReference(), "tModel(" + i + ").categoryBag."); validatedValuesKeyRefGrp(items.get(i).getCategoryBag().getKeyedReferenceGroup(), "tModel(" + i + ").categoryBag."); } if (items.get(i).getIdentifierBag() != null) { validatedValuesKeyRef(items.get(i).getIdentifierBag().getKeyedReference(), "tModel(" + i + ").identifierBag."); } } }
private List<String> validateValuesTModel(List<TModel> items) { List<String> ret = new ArrayList<String>(); if (items == null) { return ret; } for (int i = 0; i < items.size(); i++) { if (items.get(i).getCategoryBag() != null) { ret.addAll(validateValuesKeyRef(items.get(i).getCategoryBag().getKeyedReference())); ret.addAll(validateValuesKeyRefGrp(items.get(i).getCategoryBag().getKeyedReferenceGroup())); } if (items.get(i).getIdentifierBag() != null) { ret.addAll(validateValuesKeyRef(items.get(i).getIdentifierBag().getKeyedReference())); } } return ret; }
private List<String> validateValuesTModel(List<TModel> items) { List<String> ret = new ArrayList<String>(); if (items == null) { return ret; } for (int i = 0; i < items.size(); i++) { if (items.get(i).getCategoryBag() != null) { ret.addAll(validateValuesKeyRef(items.get(i).getCategoryBag().getKeyedReference())); ret.addAll(validateValuesKeyRefGrp(items.get(i).getCategoryBag().getKeyedReferenceGroup())); } if (items.get(i).getIdentifierBag() != null) { ret.addAll(validateValuesKeyRef(items.get(i).getIdentifierBag().getKeyedReference())); } } return ret; }
@Override public void validateValuesTModel(List<TModel> items) throws DispositionReportFaultMessage { if (items == null) { return; } for (int i = 0; i < items.size(); i++) { if (items.get(i).getCategoryBag() != null) { validatedValuesKeyRef(items.get(i).getCategoryBag().getKeyedReference(), "tModel(" + i + ").categoryBag."); validatedValuesKeyRefGrp(items.get(i).getCategoryBag().getKeyedReferenceGroup(), "tModel(" + i + ").categoryBag."); } if (items.get(i).getIdentifierBag() != null) { validatedValuesKeyRef(items.get(i).getIdentifierBag().getKeyedReference(), "tModel(" + i + ").identifierBag."); } } }
private List<String> GetBindingKeysCheckedTModelKeyedReferenceTM(Map<String, TModel> cache, List<TModel> obj) { List<String> ret = new ArrayList<String>(); if (obj == null) { return ret; } for (TModel bt : obj) { if (bt.getCategoryBag() != null) { for (int i = 0; i < bt.getCategoryBag().getKeyedReference().size(); i++) { ret.addAll(GetBindingKeysCheckedTModelKeyedReference(cache, bt.getCategoryBag().getKeyedReference().get(i))); } } if (bt.getIdentifierBag() != null) { for (int i = 0; i < bt.getIdentifierBag().getKeyedReference().size(); i++) { ret.addAll(GetBindingKeysCheckedTModelKeyedReference(cache, bt.getIdentifierBag().getKeyedReference().get(i))); } } } return ret; }
private List<String> GetBindingKeysCheckedTModelKeyedReferenceTM(Map<String, TModel> cache, List<TModel> obj) { List<String> ret = new ArrayList<String>(); if (obj == null) { return ret; } for (TModel bt : obj) { if (bt.getCategoryBag() != null) { for (int i = 0; i < bt.getCategoryBag().getKeyedReference().size(); i++) { ret.addAll(GetBindingKeysCheckedTModelKeyedReference(cache, bt.getCategoryBag().getKeyedReference().get(i))); } } if (bt.getIdentifierBag() != null) { for (int i = 0; i < bt.getIdentifierBag().getKeyedReference().size(); i++) { ret.addAll(GetBindingKeysCheckedTModelKeyedReference(cache, bt.getIdentifierBag().getKeyedReference().get(i))); } } } return ret; }
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 (getKey().equalsIgnoreCase(items.get(i).getCategoryBag().getKeyedReference().get(k).getTModelKey())) { org.apache.juddi.model.BindingTemplate find = em.find(org.apache.juddi.model.BindingTemplate.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"));
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())) { 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"));
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 (getKey().equalsIgnoreCase(items.get(i).getCategoryBag().getKeyedReference().get(k).getTModelKey())) { org.apache.juddi.model.BindingTemplate find = em.find(org.apache.juddi.model.BindingTemplate.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"));
List<String> ret = new ArrayList<String>(); if (ref.getCategoryBag() != null) { for (int i = 0; i < ref.getCategoryBag().getKeyedReference().size(); i++) { if (ref.getCategoryBag().getKeyedReference().get(i).getTModelKey().equalsIgnoreCase(key)) { log.debug("found reference for key=" + key + " from tModel " + ref.getTModelKey() + " validation endpoint " + ref.getCategoryBag().getKeyedReference().get(i).getKeyValue()); ret.add(ref.getCategoryBag().getKeyedReference().get(i).getKeyValue()); for (int i = 0; i < ref.getCategoryBag().getKeyedReferenceGroup().size(); i++) { for (int k = 0; k < ref.getCategoryBag().getKeyedReferenceGroup().get(i).getKeyedReference().size(); k++) { if (ref.getCategoryBag().getKeyedReferenceGroup().get(i).getKeyedReference().get(k).getTModelKey().equalsIgnoreCase(key)) { log.debug("found reference for key=" + key + " from tModel " + ref.getTModelKey() + " validation endpoint " + ref.getCategoryBag().getKeyedReferenceGroup().get(i).getKeyedReference().get(k).getKeyValue()); ret.add(ref.getCategoryBag().getKeyedReferenceGroup().get(i).getKeyedReference().get(k).getKeyValue());
public static void validateUDDIv3KeyGeneratorTModel(org.uddi.api_v3.TModel tModel) throws DispositionReportFaultMessage { if (tModel == null) throw new ValueNotAllowedException(new ErrorMessage("errors.tmodel.NullInput")); validateUDDIv3KeyGeneratorKey(tModel.getTModelKey()); // A key generator key should have exactly one category and it's key value should be 'keyGenerator' org.uddi.api_v3.CategoryBag categories = tModel.getCategoryBag(); if (categories != null) { List<org.uddi.api_v3.KeyedReference> elems = categories.getKeyedReference(); if (elems != null && elems.size() == 1) { org.uddi.api_v3.KeyedReference elem = elems.get(0); if (elem != null) { if (elem instanceof org.uddi.api_v3.KeyedReference) { String keyedValue = elem.getKeyValue(); if (keyedValue != null) { if (keyedValue.equalsIgnoreCase(KeyGenerator.KEYGENERATOR_SUFFIX)) return; } } } } } throw new ValueNotAllowedException(new ErrorMessage("errors.tmodel.keygenerator.BadCategory")); }
public static void validateUDDIv3KeyGeneratorTModel(org.uddi.api_v3.TModel tModel) throws DispositionReportFaultMessage { if (tModel == null) throw new ValueNotAllowedException(new ErrorMessage("errors.tmodel.NullInput")); validateUDDIv3KeyGeneratorKey(tModel.getTModelKey()); // A key generator key should have exactly one category and it's key value should be 'keyGenerator' org.uddi.api_v3.CategoryBag categories = tModel.getCategoryBag(); if (categories != null) { List<org.uddi.api_v3.KeyedReference> elems = categories.getKeyedReference(); if (elems != null && elems.size() == 1) { org.uddi.api_v3.KeyedReference elem = elems.get(0); if (elem != null) { if (elem instanceof org.uddi.api_v3.KeyedReference) { String keyedValue = elem.getKeyValue(); if (keyedValue != null) { if (keyedValue.equalsIgnoreCase(KeyGenerator.KEYGENERATOR_SUFFIX)) return; } } } } } throw new ValueNotAllowedException(new ErrorMessage("errors.tmodel.keygenerator.BadCategory")); }
assertEquals(tmIn.getName().getValue(), tmOut.getName().getValue()); TckValidator.checkDescriptions(tmIn.getDescription(), tmOut.getDescription()); TckValidator.checkCategories(tmIn.getCategoryBag(), tmOut.getCategoryBag()); for (OverviewDoc overviewDoc : tmIn.getOverviewDoc()) { TckValidator.checkOverviewDocs(overviewDoc, tmOut.getOverviewDoc());
public static org.uddi.api_v2.TModel MapTModel(org.uddi.api_v3.TModel be) { if (be == null) { return null; } TModel item = new org.uddi.api_v2.TModel(); item.setTModelKey(be.getTModelKey()); item.setName(new Name(be.getName().getValue(), be.getName().getLang())); item.setCategoryBag(MapCategoryBag(be.getCategoryBag())); item.getDescription().addAll(MapDescription(be.getDescription())); item.setIdentifierBag(MapIdentBag(be.getIdentifierBag())); item.setOverviewDoc(MapOverviewDoc(be.getOverviewDoc())); return item; }
/** * * @param apiTModel * @param modelTModel * @throws DispositionReportFaultMessage */ public static void mapTModel(org.uddi.api_v3.TModel apiTModel, org.apache.juddi.model.Tmodel modelTModel) throws DispositionReportFaultMessage { modelTModel.setEntityKey(apiTModel.getTModelKey()); modelTModel.setName(apiTModel.getName().getValue()); modelTModel.setLangCode(apiTModel.getName().getLang()); modelTModel.setDeleted(apiTModel.isDeleted()); mapTModelDescriptions(apiTModel.getDescription(), modelTModel.getTmodelDescrs(), modelTModel); mapTModelIdentifiers(apiTModel.getIdentifierBag(), modelTModel.getTmodelIdentifiers(), modelTModel); if (apiTModel.getCategoryBag() != null) { modelTModel.setCategoryBag(new org.apache.juddi.model.TmodelCategoryBag(modelTModel)); mapCategoryBag(apiTModel.getCategoryBag(), modelTModel.getCategoryBag()); } mapTModelOverviewDocs(apiTModel.getOverviewDoc(), modelTModel.getOverviewDocs(), modelTModel); mapTmodelSignatures(apiTModel.getSignature(), modelTModel); }
/** * * @param apiTModel * @param modelTModel * @throws DispositionReportFaultMessage */ public static void mapTModel(org.uddi.api_v3.TModel apiTModel, org.apache.juddi.model.Tmodel modelTModel) throws DispositionReportFaultMessage { modelTModel.setEntityKey(apiTModel.getTModelKey()); modelTModel.setName(apiTModel.getName().getValue()); modelTModel.setLangCode(apiTModel.getName().getLang()); modelTModel.setDeleted(apiTModel.isDeleted()); mapTModelDescriptions(apiTModel.getDescription(), modelTModel.getTmodelDescrs(), modelTModel); mapTModelIdentifiers(apiTModel.getIdentifierBag(), modelTModel.getTmodelIdentifiers(), modelTModel); if (apiTModel.getCategoryBag() != null) { modelTModel.setCategoryBag(new org.apache.juddi.model.TmodelCategoryBag(modelTModel)); mapCategoryBag(apiTModel.getCategoryBag(), modelTModel.getCategoryBag()); } mapTModelOverviewDocs(apiTModel.getOverviewDoc(), modelTModel.getOverviewDocs(), modelTModel); mapTmodelSignatures(apiTModel.getSignature(), modelTModel); }
public static void mapTModel(org.apache.juddi.model.Tmodel modelTModel, org.uddi.api_v3.TModel apiTModel) throws DispositionReportFaultMessage { apiTModel.setTModelKey(modelTModel.getEntityKey()); org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name(); apiName.setValue(modelTModel.getName()); apiName.setLang(modelTModel.getLangCode()); apiTModel.setName(apiName); apiTModel.setDeleted(modelTModel.getDeleted()); mapTModelDescriptions(modelTModel.getTmodelDescrs(), apiTModel.getDescription()); mapTModelIdentifiers(modelTModel.getTmodelIdentifiers(), apiTModel.getIdentifierBag(), apiTModel); apiTModel.setCategoryBag(mapCategoryBag(modelTModel.getCategoryBag(), apiTModel.getCategoryBag())); mapOverviewDocs(modelTModel.getOverviewDocs(), null, apiTModel); mapSignature(modelTModel.getSignatures(), apiTModel.getSignature()); }
public static void mapTModel(org.apache.juddi.model.Tmodel modelTModel, org.uddi.api_v3.TModel apiTModel) throws DispositionReportFaultMessage { apiTModel.setTModelKey(modelTModel.getEntityKey()); org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name(); apiName.setValue(modelTModel.getName()); apiName.setLang(modelTModel.getLangCode()); apiTModel.setName(apiName); apiTModel.setDeleted(modelTModel.getDeleted()); mapTModelDescriptions(modelTModel.getTmodelDescrs(), apiTModel.getDescription()); mapTModelIdentifiers(modelTModel.getTmodelIdentifiers(), apiTModel.getIdentifierBag(), apiTModel); apiTModel.setCategoryBag(mapCategoryBag(modelTModel.getCategoryBag(), apiTModel.getCategoryBag())); mapOverviewDocs(modelTModel.getOverviewDocs(), null, apiTModel); mapSignature(modelTModel.getSignatures(), apiTModel.getSignature()); }
public static Concept getConcept(TModel tmodel, LifeCycleManager lifeCycleManager) throws JAXRException { Concept concept = new ConceptImpl(lifeCycleManager); concept.setKey(lifeCycleManager.createKey(tmodel.getTModelKey())); concept.setName(lifeCycleManager.createInternationalString(getLocale(tmodel.getName().getLang()), tmodel.getName().getValue())); Description desc = getDescription(tmodel); if (desc != null) { concept.setDescription(lifeCycleManager.createInternationalString(getLocale(desc.getLang()), desc.getValue())); } concept.addExternalIdentifiers(getExternalIdentifiers(tmodel.getIdentifierBag(), lifeCycleManager)); concept.addClassifications(getClassifications(tmodel.getCategoryBag(), lifeCycleManager)); return concept; }
public static Concept getConcept(TModelDetail tModelDetail, LifeCycleManager lifeCycleManager) throws JAXRException { Concept concept = new ConceptImpl(lifeCycleManager); List<TModel> tmodelList = tModelDetail.getTModel(); for (TModel tmodel : tmodelList) { concept.setKey(lifeCycleManager.createKey(tmodel.getTModelKey())); concept.setName(lifeCycleManager.createInternationalString(getLocale(tmodel.getName().getLang()), tmodel.getName().getValue())); Description desc = getDescription(tmodel); if( desc != null ) { concept.setDescription(lifeCycleManager.createInternationalString(getLocale(desc.getLang()), desc.getValue())); } concept.addExternalIdentifiers(getExternalIdentifiers(tmodel.getIdentifierBag(), lifeCycleManager)); concept.addClassifications(getClassifications(tmodel.getCategoryBag(), lifeCycleManager)); } return concept; }