private TModelInstanceInfo createTmodelInstnaceInfo(String key, String value, String description) { TModelInstanceInfo r = new TModelInstanceInfo(); r.setTModelKey(key); r.getDescription().add(new Description(description, PublicationConstants.lang)); r.setInstanceDetails(new InstanceDetails()); r.getInstanceDetails().setInstanceParms(value); return r; }
public static void checkTModelInstanceDetails(TModelInstanceDetails tmds1, TModelInstanceDetails tmds2) { if (tmds1 == null || tmds2 == null) { assertEquals(tmds1, tmds2); return; } assertEquals(tmds1.getTModelInstanceInfo().size(),tmds2.getTModelInstanceInfo().size()); Iterator<TModelInstanceInfo> tmIter1 = tmds1.getTModelInstanceInfo().iterator(); Iterator<TModelInstanceInfo> tmIter2 = tmds2.getTModelInstanceInfo().iterator(); while (tmIter1.hasNext()) { TModelInstanceInfo tmI1 = tmIter1.next(); TModelInstanceInfo tmI2 = tmIter2.next(); checkDescriptions(tmI1.getDescription(), tmI2.getDescription()); checkInstanceDetails(tmI1.getInstanceDetails(), tmI2.getInstanceDetails()); assertEquals(tmI1.getTModelKey().toLowerCase(),tmI2.getTModelKey()); } }
public static InstanceDetails contains(TModelInstanceDetails input, String key) { if (input == null) { return null; } if (key==null)return null; if (input.getTModelInstanceInfo() == null || input.getTModelInstanceInfo().isEmpty()) { return null; } for (int i=0; i < input.getTModelInstanceInfo().size(); i++){ if (input.getTModelInstanceInfo().get(i).getTModelKey()!=null && input.getTModelInstanceInfo().get(i).getTModelKey().equalsIgnoreCase(key)) return input.getTModelInstanceInfo().get(i).getInstanceDetails(); } return null; } }
public void validateTModelInstanceInfo(org.uddi.api_v3.TModelInstanceInfo tmodelInstInfo, Configuration config, boolean isRoot) throws DispositionReportFaultMessage { // tModel Instance Info can't be null if (tmodelInstInfo == null) { throw new ValueNotAllowedException(new ErrorMessage("errors.tmodelinstinfo.NullInput")); } // TModel key is required if (tmodelInstInfo.getTModelKey() == null || tmodelInstInfo.getTModelKey().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.tmodelinstinfo.NoTModelKey")); } // Per section 4.4: keys must be case-folded tmodelInstInfo.setTModelKey((tmodelInstInfo.getTModelKey().toLowerCase())); boolean checkRef = false; try { checkRef = config.getBoolean(Property.JUDDI_ENFORCE_REFERENTIAL_INTEGRITY, false); } catch (Exception ex) { log.warn("Error caught reading " + Property.JUDDI_ENFORCE_REFERENTIAL_INTEGRITY + " from config file", ex); } if (checkRef && !isRoot) { this.verifyTModelKeyExists(tmodelInstInfo.getTModelKey()); } validateInstanceDetails(tmodelInstInfo.getInstanceDetails()); if (log.isDebugEnabled()) { log.debug("validateTModelInstanceInfo"); } validateKeyLength(tmodelInstInfo.getTModelKey()); validateDescriptions(tmodelInstInfo.getDescription()); }
TModelInstanceInfo tModelInstanceInfo = new TModelInstanceInfo(); tModelInstanceInfo.getDescription().add(desc); tModelInstanceInfo.setTModelKey(tModelKey); tModelInstantDetails.getTModelInstanceInfo().add(tModelInstanceInfo);
private static boolean exists(List<TModelInstanceInfo> items, String key) { for (int i = 0; i < items.size(); i++) { if (items.get(i).getTModelKey() != null && items.get(i).getTModelKey().equalsIgnoreCase(key)) { return true; } } return false; } }
emptyTInfo.setTModelKey(specificationObject.getKey().getId()); if (specificationObject.getDescription() != null) { for (Object o : specificationObject.getDescription().getLocalizedStrings()) { LocalizedString locDesc = (LocalizedString) o; Description description = objectFactory.createDescription(); emptyTInfo.getDescription().add(description); description.setValue(locDesc.getValue()); description.setLang(locDesc.getLocale().getLanguage()); for (ExternalLink link : externalLinks) { InstanceDetails ids = objectFactory.createInstanceDetails(); emptyTInfo.setInstanceDetails(ids); if (link.getDescription() != null) { Description description = objectFactory.createDescription();
tModelInstanceInfo = new TModelInstanceInfo(); tModelInstanceInfo.setTModelKey(UDDIConstants.PROTOCOL_REST); bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo); tModelInstanceInfo = new TModelInstanceInfo(); tModelInstanceInfo.setTModelKey(UDDIConstants.TRANSPORT_HTTP); bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo); tModelInstanceInfo = new TModelInstanceInfo(); tModelInstanceInfo.setTModelKey(UDDIConstants.PROTOCOL_SSLv3); bt.getTModelInstanceDetails().getTModelInstanceInfo().add(tModelInstanceInfo);
public static void mapInstanceDetails(org.apache.juddi.model.TmodelInstanceInfo modelTModelInstInfo, org.uddi.api_v3.InstanceDetails apiInstanceDetails, org.uddi.api_v3.TModelInstanceInfo apiTModelInstInfo) throws DispositionReportFaultMessage { if (modelTModelInstInfo == null || (modelTModelInstInfo.getInstanceParms() == null && modelTModelInstInfo.getOverviewDocs().size() == 0)) { return; } if (apiInstanceDetails == null) { apiInstanceDetails = new org.uddi.api_v3.InstanceDetails(); } //InstanceParms apiInstanceDetails.setInstanceParms(modelTModelInstInfo.getInstanceParms()); //Descriptions List<org.apache.juddi.model.InstanceDetailsDescr> modelInstDetailsDescrList = modelTModelInstInfo.getInstanceDetailsDescrs(); for (org.apache.juddi.model.InstanceDetailsDescr modelInstDetailDescr : modelInstDetailsDescrList) { org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description(); apiDesc.setLang(modelInstDetailDescr.getLangCode()); apiDesc.setValue(modelInstDetailDescr.getDescr()); apiInstanceDetails.getDescription().add(apiDesc); } //OverviewDoc mapOverviewDocs(modelTModelInstInfo.getOverviewDocs(), apiInstanceDetails, null); apiTModelInstInfo.setInstanceDetails(apiInstanceDetails); }
/** * Create an instance of {@link TModelInstanceInfo } * */ public TModelInstanceInfo createTModelInstanceInfo() { return new TModelInstanceInfo(); }
public void validateTModelInstanceInfo(org.uddi.api_v3.TModelInstanceInfo tmodelInstInfo, Configuration config, boolean isRoot) throws DispositionReportFaultMessage { // tModel Instance Info can't be null if (tmodelInstInfo == null) { throw new ValueNotAllowedException(new ErrorMessage("errors.tmodelinstinfo.NullInput")); } // TModel key is required if (tmodelInstInfo.getTModelKey() == null || tmodelInstInfo.getTModelKey().length() == 0) { throw new ValueNotAllowedException(new ErrorMessage("errors.tmodelinstinfo.NoTModelKey")); } // Per section 4.4: keys must be case-folded tmodelInstInfo.setTModelKey((tmodelInstInfo.getTModelKey().toLowerCase())); boolean checkRef = false; try { checkRef = config.getBoolean(Property.JUDDI_ENFORCE_REFERENTIAL_INTEGRITY, false); } catch (Exception ex) { log.warn("Error caught reading " + Property.JUDDI_ENFORCE_REFERENTIAL_INTEGRITY + " from config file", ex); } if (checkRef && !isRoot) { this.verifyTModelKeyExists(tmodelInstInfo.getTModelKey()); } validateInstanceDetails(tmodelInstInfo.getInstanceDetails()); if (log.isDebugEnabled()) { log.debug("validateTModelInstanceInfo"); } validateKeyLength(tmodelInstInfo.getTModelKey()); validateDescriptions(tmodelInstInfo.getDescription()); }
if (bindingTemplate.get(i).getTModelInstanceDetails() != null) { for (int k = 0; k < bindingTemplate.get(i).getTModelInstanceDetails().getTModelInstanceInfo().size(); k++) { if (bindingTemplate.get(i).getTModelInstanceDetails().getTModelInstanceInfo().get(k).getTModelKey().equalsIgnoreCase(UDDIConstants.VERSION_TMODEL)) { if (bindingTemplate.get(i).getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails() != null) { if (bindingTemplate.get(i).getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getInstanceParms() != null) { if (bindingTemplate.get(i).getTModelInstanceDetails().getTModelInstanceInfo().get(k).getInstanceDetails().getInstanceParms().trim().equalsIgnoreCase(version.trim())) { ret.add(bindingTemplate.get(i)); break;
String endpoint = endpointDetail.substring(characterLengthForFirstColon); TModelInstanceInfo tModelInstanceInfo = new TModelInstanceInfo(); tModelInstanceInfo.getDescription().add(desc); tModelInstanceInfo.setTModelKey(tModelDetail.getTModel().iterator().next().getTModelKey()); tModelInstanceDetails.getTModelInstanceInfo().add(tModelInstanceInfo);
@Override public void validateTmodelInstanceDetails(List<TModelInstanceInfo> tModelInstanceInfo, String xpath) throws DispositionReportFaultMessage { if (tModelInstanceInfo == null) { return; } for (int k = 0; k < tModelInstanceInfo.size(); k++) { if (getMyKey().equalsIgnoreCase(tModelInstanceInfo.get(k).getTModelKey())) { throw new InvalidValueException(new ErrorMessage("errors.valuesetvalidation.invalidcontent", "not allowed on tModel instance info")); } } }
emptyTInfo.setTModelKey(specificationObject.getKey().getId()); if (specificationObject.getDescription()!=null) { for (Object o : specificationObject.getDescription().getLocalizedStrings()) { LocalizedString locDesc = (LocalizedString) o; Description description = objectFactory.createDescription(); emptyTInfo.getDescription().add(description); description.setValue(locDesc.getValue()); description.setLang(locDesc.getLocale().getLanguage()); for (ExternalLink link : externalLinks) { InstanceDetails ids = objectFactory.createInstanceDetails(); emptyTInfo.setInstanceDetails(ids); if (link.getDescription()!=null) { Description description = objectFactory.createDescription();
bt.getAccessPoint().setValue(callback); bt.getAccessPoint().setUseType("endPoint"); TModelInstanceInfo instanceInfo = new TModelInstanceInfo(); instanceInfo.setTModelKey("uddi:uddi.org:transport:http"); bt.setTModelInstanceDetails(new TModelInstanceDetails()); bt.getTModelInstanceDetails().getTModelInstanceInfo().add(instanceInfo);
public static void mapInstanceDetails(org.apache.juddi.model.TmodelInstanceInfo modelTModelInstInfo, org.uddi.api_v3.InstanceDetails apiInstanceDetails, org.uddi.api_v3.TModelInstanceInfo apiTModelInstInfo) throws DispositionReportFaultMessage { if (modelTModelInstInfo == null || (modelTModelInstInfo.getInstanceParms() == null && modelTModelInstInfo.getOverviewDocs().size() == 0)) { return; } if (apiInstanceDetails == null) { apiInstanceDetails = new org.uddi.api_v3.InstanceDetails(); } //InstanceParms apiInstanceDetails.setInstanceParms(modelTModelInstInfo.getInstanceParms()); //Descriptions List<org.apache.juddi.model.InstanceDetailsDescr> modelInstDetailsDescrList = modelTModelInstInfo.getInstanceDetailsDescrs(); for (org.apache.juddi.model.InstanceDetailsDescr modelInstDetailDescr : modelInstDetailsDescrList) { org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description(); apiDesc.setLang(modelInstDetailDescr.getLangCode()); apiDesc.setValue(modelInstDetailDescr.getDescr()); apiInstanceDetails.getDescription().add(apiDesc); } //OverviewDoc mapOverviewDocs(modelTModelInstInfo.getOverviewDocs(), apiInstanceDetails, null); apiTModelInstInfo.setInstanceDetails(apiInstanceDetails); }
private static List<TModelInstanceInfo> MapTModelInstanceInfo(List<org.uddi.api_v2.TModelInstanceInfo> tModelInstanceInfo) { List<TModelInstanceInfo> r = new ArrayList<TModelInstanceInfo>(); if (tModelInstanceInfo == null) { return r; } for (int i = 0; i < tModelInstanceInfo.size(); i++) { TModelInstanceInfo t = new TModelInstanceInfo(); t.setTModelKey(tModelInstanceInfo.get(i).getTModelKey()); t.getDescription().addAll(MapDescription(tModelInstanceInfo.get(i).getDescription())); if (tModelInstanceInfo.get(i).getInstanceDetails() != null) { t.setInstanceDetails(new InstanceDetails()); t.getInstanceDetails().getDescription().addAll(MapDescription(tModelInstanceInfo.get(i).getInstanceDetails().getDescription())); t.getInstanceDetails().setInstanceParms(tModelInstanceInfo.get(i).getInstanceDetails().getInstanceParms()); t.getInstanceDetails().getOverviewDoc().add(MapOverviewDoc(tModelInstanceInfo.get(i).getInstanceDetails().getOverviewDoc())); } r.add(t); } return r; }
/** * * @param apiTModelInstDetails * @param modelTModelInstInfoList * @param modelBindingTemplate * @throws DispositionReportFaultMessage */ public static void mapTModelInstanceDetails(org.uddi.api_v3.TModelInstanceDetails apiTModelInstDetails, List<org.apache.juddi.model.TmodelInstanceInfo> modelTModelInstInfoList, org.apache.juddi.model.BindingTemplate modelBindingTemplate) throws DispositionReportFaultMessage { modelTModelInstInfoList.clear(); if (apiTModelInstDetails != null) { List<org.uddi.api_v3.TModelInstanceInfo> apiTModelInstInfoList = apiTModelInstDetails.getTModelInstanceInfo(); for (org.uddi.api_v3.TModelInstanceInfo apiTModelInstInfo : apiTModelInstInfoList) { org.apache.juddi.model.TmodelInstanceInfo modelTModelInstInfo = new org.apache.juddi.model.TmodelInstanceInfo(modelBindingTemplate, apiTModelInstInfo.getTModelKey()); mapTModelInstanceInfoDescriptions(apiTModelInstInfo.getDescription(), modelTModelInstInfo.getTmodelInstanceInfoDescrs(), modelTModelInstInfo); mapInstanceDetails(apiTModelInstInfo.getInstanceDetails(), modelTModelInstInfo); modelTModelInstInfoList.add(modelTModelInstInfo); } } }
InstanceDetails rhsc = null; for (int i = 0; i < lhs.getTModelInstanceInfo().size(); i++) { if (lhs.getTModelInstanceInfo().get(i).getTModelKey().equalsIgnoreCase(compareField)) { lhsc = lhs.getTModelInstanceInfo().get(i).getInstanceDetails(); if (rhs.getTModelInstanceInfo().get(i).getTModelKey().equalsIgnoreCase(compareField)) { rhsc = rhs.getTModelInstanceInfo().get(i).getInstanceDetails();