public static Name getName(List<Name> entityList, String lang) { if (lang==null) return entityList.get(0); for (Name entity : entityList) { if (lang.equalsIgnoreCase(entity.getLang())) { return entity; } } return entityList.get(0); }
public static void checkNames(List<Name> names1, List<Name> names2) { if (names1 == null || names2 == null) { assertEquals(names1, names2); return; } assertEquals(names1.size(), names2.size()); Iterator<Name> names1Itr = names1.iterator(); Iterator<Name> names2Itr = names2.iterator(); while (names1Itr.hasNext()) { Name name1 = names1Itr.next(); Name name2 = names2Itr.next(); assertEquals(name1.getLang(), name2.getLang()); assertEquals(name1.getValue(), name2.getValue()); } }
private static List<Name> MapName(List<org.uddi.api_v3.Name> name) { List<Name> items = new ArrayList<Name>(); for (int i = 0; i < name.size(); i++) { Name n = new Name(name.get(i).getValue(), name.get(i).getLang()); items.add(n); } return items; }
private static boolean ContainsWildCardSingle(Name name) { if (name != null) { if (name.getValue() != null && name.getValue().contains(UDDIConstants.WILDCARD)) { return true; } if (name.getValue() != null && name.getValue().contains(UDDIConstants.WILDCARD_CHAR)) { return true; } if (name.getLang() != null && name.getLang().contains(UDDIConstants.WILDCARD)) { return true; } if (name.getLang() != null && name.getLang().contains(UDDIConstants.WILDCARD_CHAR)) { return true; } } return false; }
/** * * @param apiNameList * @param modelNameList * @param modelBusinessService * @throws DispositionReportFaultMessage */ public static void mapServiceNames(List<org.uddi.api_v3.Name> apiNameList, List<org.apache.juddi.model.ServiceName> modelNameList, org.apache.juddi.model.BusinessService modelBusinessService) throws DispositionReportFaultMessage { modelNameList.clear(); for (org.uddi.api_v3.Name apiName : apiNameList) { modelNameList.add(new org.apache.juddi.model.ServiceName(modelBusinessService, apiName.getLang(), apiName.getValue())); } }
/** * * @param apiNameList * @param modelNameList * @param modelBusinessEntity * @throws DispositionReportFaultMessage */ public static void mapBusinessNames(List<org.uddi.api_v3.Name> apiNameList, List<org.apache.juddi.model.BusinessName> modelNameList, org.apache.juddi.model.BusinessEntity modelBusinessEntity) throws DispositionReportFaultMessage { modelNameList.clear(); for (org.uddi.api_v3.Name apiName : apiNameList) { modelNameList.add(new org.apache.juddi.model.BusinessName(modelBusinessEntity, apiName.getLang(), apiName.getValue())); } }
public static Name getName(List<Name> entityList, String lang) { if (entityList.size()==0) { Name name = new Name(); name.setValue(""); name.setLang(lang); entityList.add(name); } if (lang==null) return entityList.get(0); for (Name entity : entityList) { if (lang.equalsIgnoreCase(entity.getLang())) { return entity; } } return entityList.get(0); }
/** * * @param apiNameList * @param modelNameList * @param modelBusinessEntity * @throws DispositionReportFaultMessage */ public static void mapBusinessNames(List<org.uddi.api_v3.Name> apiNameList, List<org.apache.juddi.model.BusinessName> modelNameList, org.apache.juddi.model.BusinessEntity modelBusinessEntity) throws DispositionReportFaultMessage { modelNameList.clear(); for (org.uddi.api_v3.Name apiName : apiNameList) { modelNameList.add(new org.apache.juddi.model.BusinessName(modelBusinessEntity, apiName.getLang(), apiName.getValue())); } }
/** * * @param apiNameList * @param modelNameList * @param modelBusinessService * @throws DispositionReportFaultMessage */ public static void mapServiceNames(List<org.uddi.api_v3.Name> apiNameList, List<org.apache.juddi.model.ServiceName> modelNameList, org.apache.juddi.model.BusinessService modelBusinessService) throws DispositionReportFaultMessage { modelNameList.clear(); for (org.uddi.api_v3.Name apiName : apiNameList) { modelNameList.add(new org.apache.juddi.model.ServiceName(modelBusinessService, apiName.getLang(), apiName.getValue())); } }
private static List<TModelInfo> MapTModelInfo(List<org.uddi.api_v3.TModelInfo> tModelInfo) { List<TModelInfo> r = new ArrayList<TModelInfo>(); if (tModelInfo == null) { return r; } for (int i = 0; i < tModelInfo.size(); i++) { TModelInfo x = new TModelInfo(); x.setTModelKey(tModelInfo.get(i).getTModelKey()); x.setName(new Name(tModelInfo.get(i).getName().getValue(), tModelInfo.get(i).getName().getLang())); r.add(x); } return r; }
public void validateNames(List<org.uddi.api_v3.Name> names) throws DispositionReportFaultMessage { if (names != null) { for (Name n : names) { if (n.getValue() == null || n.getValue().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.names.NoValue")); } ValidatePublish.validateLang(n.getLang()); } } }
public void validateNames(List<org.uddi.api_v3.Name> names) throws DispositionReportFaultMessage { if (names != null) { for (Name n : names) { if (n.getValue() == null || n.getValue().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.names.NoValue")); } ValidatePublish.validateLang(n.getLang()); } } }
public void validateNames(List<org.uddi.api_v3.Name> names) throws DispositionReportFaultMessage { // At least one name is required if (names == null || names.size() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.names.NoInput")); } for (Name n : names) { if (n.getValue() == null || n.getValue().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.names.NoValue")); } validateNameLength(n.getValue()); validateLang(n.getLang()); } }
public void validateNames(List<org.uddi.api_v3.Name> names) throws DispositionReportFaultMessage { // At least one name is required if (names == null || names.size() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.names.NoInput")); } for (Name n : names) { if (n.getValue() == null || n.getValue().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.names.NoValue")); } validateNameLength(n.getValue()); validateLang(n.getLang()); } }
public static Service getService(ServiceInfo serviceInfo, LifeCycleManager lifeCycleManager) throws JAXRException { Service service = new ServiceImpl(lifeCycleManager); String keystr = serviceInfo.getServiceKey(); if (keystr != null) { service.setKey(lifeCycleManager.createKey(keystr)); } List<Name> namesList = serviceInfo.getName(); InternationalString is = null; for (Name n : namesList) { if (is == null) { is = lifeCycleManager.createInternationalString(getLocale(n.getLang()), n.getValue()); } else { is.setValue(getLocale(n.getLang()), n.getValue()); } } service.setName(is); return service; }
public static Concept getConcept(TModelInfo tModelInfo, LifeCycleManager lifeCycleManager) throws JAXRException { Concept concept = new ConceptImpl(lifeCycleManager); concept.setKey(lifeCycleManager.createKey(tModelInfo.getTModelKey())); concept.setName(lifeCycleManager.createInternationalString(getLocale(tModelInfo.getName().getLang()), tModelInfo.getName().getValue())); return concept; }
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; }
public static FindTModel MapFindTModel(org.uddi.api_v3.FindTModel body) { FindTModel r = new FindTModel(); r.setFindQualifiers(MapFindQualifiers(body.getFindQualifiers())); r.setMaxRows(body.getMaxRows()); r.setCategoryBag(MapCategoryBag(body.getCategoryBag())); r.setGeneric(VERSION); if (body.getName() != null) { r.setName(new Name(body.getName().getValue(), body.getName().getLang())); } return r; }
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; }