private String nameListToString(List<Name> name) { StringBuilder ret = new StringBuilder(); if (name == null || name.isEmpty()) { return ""; } for (int i = 0; i < name.size(); i++) { ret.append(StringEscapeUtils.escapeHtml4(name.get(i).getValue())).append(" "); } return ret.toString().trim(); }
public static String ListToString(List<Name> name) { StringBuilder sb = new StringBuilder(); for (int i = 0; i < name.size(); i++) { sb.append(name.get(i).getValue()).append(" "); } return sb.toString(); }
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; }
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()); } }
/** * * @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())); } }
/** * * @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())); } }
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()); } }
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; }
Service createService(ServiceInfo serviceInfo) throws JAXRException { String key = serviceInfo.getServiceKey(); List<Name> names = serviceInfo.getName(); ServiceImpl service = new ServiceImpl(this); service.setKey(createKey(key)); if (names != null && names.size() > 0) { service.setName(createInternationalString(names.get(0).getValue())); } return service; }
/** * Copies the Service from one UDDI to another UDDI along with all the bindingTemplates. */ public void xRegisterServiceAndBindings() { BusinessService businessService; try { businessService = fromClerk.getServiceDetail(entityKey,fromClerk.getUDDINode().getApiNode()); log.info("xregister service " + businessService.getName().get(0).getValue() + " + from " + fromClerk.getName() + " to " + toClerk.getName()); toClerk.register(businessService,toClerk.getUDDINode().getApiNode()); } catch (Exception e) { log.error("Could not " + toString() + ". " + e.getMessage() + " " + e.getCause(),e); } } /**
/** * Copies the BusinessInformation from one UDDI to another UDDI. */ public void xRegisterBusinessAndServices() { BusinessEntity businessEntity; try { businessEntity = fromClerk.getBusinessDetail(entityKey,fromClerk.getUDDINode().getApiNode()); log.info("xregister business " + businessEntity.getName().get(0).getValue() + " + from " + fromClerk.getName() + " to " + toClerk.getName() + " including all services owned by this business."); toClerk.register(businessEntity,toClerk.getUDDINode().getApiNode()); } catch (Exception e) { log.error("Could not " + toString() + ". " + e.getMessage() + " " + e.getCause(),e); } } /**
/** * Copies the Service from one UDDI to another UDDI. */ public void xRegisterService() { BusinessService businessService; try { businessService = fromClerk.getServiceDetail(entityKey,fromClerk.getUDDINode().getApiNode()); log.info("xregister service " + businessService.getName().get(0).getValue() + " + from " + fromClerk.getName() + " to " + toClerk.getName()); businessService.setBindingTemplates(null); toClerk.register(businessService,toClerk.getUDDINode().getApiNode()); } catch (Exception e) { log.error("Could not " + toString() + ". " + e.getMessage() + " " + e.getCause(),e); } } /**
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; }