From 926428dba5970eef97b64a2b87abbc43ad97c8f5 Mon Sep 17 00:00:00 2001 From: Alex O'Ree Date: Tue, 28 Aug 2018 18:53:12 -0400 Subject: [PATCH 1/3] NOJIRA site update --- src/site/markdown/index.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md index 6ebb39673..f0fb2d379 100644 --- a/src/site/markdown/index.md +++ b/src/site/markdown/index.md @@ -2,6 +2,7 @@ jUDDI (pronounced "Judy") is an open source Java implementation of [OASIS](https://www.oasis-open.org) the [Universal Description, Discovery, and Integration (UDDI)](https://www.oasis-open.org/standards#uddiv3.0.2) specification for (Web) Services. The jUDDI project includes [Scout](http://projects.apache.org/projects/scout.html). Scout is an implementation of the [JSR 93 - JavaTM API for XML Registries 1.0 (JAXR)](https://jcp.org/en/jsr/detail?id=93). ## Features + - Open Source - Platform Independent - Use with any relational database that supports ANSI standard SQL (MySQL, Oracle, DB2, Sybase, Derby etc.) @@ -25,7 +26,7 @@ jUDDI (pronounced "Judy") is an open source Java implementation of [OASIS](https ## UDDIv3 API Client Libraries - - Java using JRE 1.6 + - Java using JRE 1.6 or newer - .NET using Microsoft.NET Framework v3.5 (since jUDDI 3.2) - Developer Documentation, Examples - Digital Signature support @@ -42,6 +43,8 @@ jUDDI (pronounced "Judy") is an open source Java implementation of [OASIS](https ## News +Nov 23, 2017, jUDDI Release 3.3.5 + Feb 11, 2017, jUDDI Release 3.3.4 Sept 12, 2016, jUDDI Release 3.3.3 From 2f5a2492e49a64da73e29bc5ba0a8bf151b49bdb Mon Sep 17 00:00:00 2001 From: Alex O'Ree Date: Sun, 18 Nov 2018 13:18:37 -0500 Subject: [PATCH 2/3] JUDDI-992 fix for several issues with find binding with and without the service key. Also had to do some light refactoring of List to List for many of the apis in juddi-core. Shouldn't effect too many users. --- .../apache/juddi/api/impl/InquiryHelper.java | 40 +++++--- .../juddi/api/impl/UDDIInquiryImpl.java | 32 +++---- .../org/apache/juddi/query/EntityQuery.java | 47 +++++----- .../FindBindingByCategoryGroupQuery.java | 2 +- .../query/FindBindingByCategoryQuery.java | 2 +- .../query/FindBindingByTModelKeyQuery.java | 8 +- .../FindBusinessByCategoryGroupQuery.java | 2 +- .../query/FindBusinessByCategoryQuery.java | 2 +- .../FindBusinessByCombinedCategoryQuery.java | 2 +- .../FindBusinessByDiscoveryURLQuery.java | 4 +- .../query/FindBusinessByIdentifierQuery.java | 2 +- .../juddi/query/FindBusinessByNameQuery.java | 2 +- .../query/FindBusinessByTModelKeyQuery.java | 2 +- .../query/FindEntityByCategoryGroupQuery.java | 18 ++-- .../query/FindEntityByCategoryQuery.java | 2 +- .../FindEntityByCombinedCategoryQuery.java | 8 +- .../query/FindEntityByIdentifierQuery.java | 2 +- .../juddi/query/FindEntityByNamesQuery.java | 2 +- .../FindServiceByCategoryGroupQuery.java | 2 +- .../query/FindServiceByCategoryQuery.java | 2 +- .../FindServiceByCombinedCategoryQuery.java | 2 +- .../juddi/query/FindServiceByNameQuery.java | 2 +- .../query/FindServiceByTModelKeyQuery.java | 2 +- .../query/FindTModelByCategoryGroupQuery.java | 2 +- .../query/FindTModelByCategoryQuery.java | 2 +- .../query/FindTModelByIdentifierQuery.java | 2 +- .../juddi/query/FindTModelByNameQuery.java | 2 +- .../juddi/validation/ValidateInquiry.java | 43 ++++++++- .../api/impl/API_070_FindEntityTest.java | 91 ++++++++++++++++++- .../apache/juddi/v2/tck/TckFindEntity.java | 6 +- .../joepublisher/bindingTemplate.xml | 4 +- 31 files changed, 239 insertions(+), 102 deletions(-) diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java index 1b3b9b9b3..b4b88ed55 100644 --- a/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java +++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/InquiryHelper.java @@ -18,9 +18,8 @@ import java.util.ArrayList; import java.util.Date; +import java.util.LinkedList; import java.util.List; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.persistence.EntityManager; import javax.xml.ws.Holder; @@ -31,6 +30,7 @@ import org.apache.juddi.config.AppConfig; import org.apache.juddi.config.Property; import org.apache.juddi.mapping.MappingModelToApi; +import org.apache.juddi.model.BindingTemplate; import org.apache.juddi.query.FetchBindingTemplatesQuery; import org.apache.juddi.query.FetchBusinessEntitiesQuery; import org.apache.juddi.query.FetchBusinessServicesQuery; @@ -82,15 +82,17 @@ public class InquiryHelper { private static Log logger = LogFactory.getLog(InquiryHelper.class); - public static List findBinding(FindBinding body, FindQualifiers findQualifiers, EntityManager em) throws DispositionReportFaultMessage { + public static List findBinding(FindBinding body, FindQualifiers findQualifiers, EntityManager em) throws DispositionReportFaultMessage { - List keysFound = null; - - // First perform the embedded FindTModel search which will augment the tModel bag with any resulting tModel keys. + List keysFound = new LinkedList(); + if (body.getServiceKey()!=null && body.getServiceKey().length() > 0) { + keysFound = findBindingsByServiceKey(em, body.getServiceKey(), keysFound); + } + if (body.getTModelBag() == null) body.setTModelBag(new TModelBag()); + // First perform the embedded FindTModel search which will augment the tModel bag with any resulting tModel keys. doFindTModelEmbeddedSearch(em, body.getFindQualifiers(), body.getFindTModel(), body.getTModelBag()); - keysFound = FindBindingByTModelKeyQuery.select(em, findQualifiers, body.getTModelBag(), body.getServiceKey(), keysFound); keysFound = FindBindingByCategoryQuery.select(em, findQualifiers, body.getCategoryBag(), body.getServiceKey(), keysFound); keysFound = FindBindingByCategoryGroupQuery.select(em, findQualifiers, body.getCategoryBag(), body.getServiceKey(), keysFound); @@ -168,9 +170,9 @@ public static BindingDetail getBindingDetailFromKeys(FindBinding body, FindQuali return result; } - public static List findBusiness(FindBusiness body, FindQualifiers findQualifiers, EntityManager em) throws DispositionReportFaultMessage { + public static List findBusiness(FindBusiness body, FindQualifiers findQualifiers, EntityManager em) throws DispositionReportFaultMessage { - List keysFound = null; + List keysFound = null; // First perform the embedded FindTModel search which will augment the tModel bag with any resulting tModel keys. if (body.getTModelBag() == null) @@ -192,7 +194,7 @@ else if (body.getFindRelatedBusinesses().getFromKey() != null) else if (body.getFindRelatedBusinesses().getToKey() != null) getRelatedBusinesses(em, Direction.TO_KEY, frb.getToKey(), frb.getKeyedReference(), relatedBusinessInfos); - List relatedBusinessKeys = new ArrayList(0); + List relatedBusinessKeys = new ArrayList(0); for (org.uddi.api_v3.RelatedBusinessInfo rbi : relatedBusinessInfos.getRelatedBusinessInfo()) relatedBusinessKeys.add(rbi.getBusinessKey()); @@ -322,7 +324,7 @@ public static BusinessList getBusinessListFromKeys(FindBusiness body, FindQualif public static List findService(FindService body, FindQualifiers findQualifiers, EntityManager em) throws DispositionReportFaultMessage { - List keysFound = null; + List keysFound = null; // First perform the embedded FindTModel search which will augment the tModel bag with any resulting tModel keys. if (body.getTModelBag() == null) @@ -419,8 +421,8 @@ public static ServiceList getServiceListFromKeys(FindService body, FindQualifier return result; } - public static List findTModel(FindTModel body, FindQualifiers findQualifiers, EntityManager em) throws DispositionReportFaultMessage { - List keysFound = null; + public static List findTModel(FindTModel body, FindQualifiers findQualifiers, EntityManager em) throws DispositionReportFaultMessage { + List keysFound = null; keysFound = FindTModelByIdentifierQuery.select(em, findQualifiers, body.getIdentifierBag(), keysFound); keysFound = FindTModelByCategoryQuery.select(em, findQualifiers, body.getCategoryBag(), keysFound); @@ -608,7 +610,7 @@ else if (body.getFromKey() != null) { return result; } - /* + /** * Performs the necessary queries for the find_tModel search and adds resulting tModel keys to the tModelBag provided. */ private static void doFindTModelEmbeddedSearch(EntityManager em, @@ -623,7 +625,7 @@ private static void doFindTModelEmbeddedSearch(EntityManager em, findQualifiers.mapApiFindQualifiers(findTmodel.getFindQualifiers()); - List tmodelKeysFound = null; + List tmodelKeysFound = null; tmodelKeysFound = FindTModelByIdentifierQuery.select(em, findQualifiers, findTmodel.getIdentifierBag(), tmodelKeysFound); tmodelKeysFound = FindTModelByCategoryQuery.select(em, findQualifiers, findTmodel.getCategoryBag(), tmodelKeysFound); tmodelKeysFound = FindTModelByCategoryGroupQuery.select(em, findQualifiers, findTmodel.getCategoryBag(), tmodelKeysFound); @@ -635,6 +637,14 @@ private static void doFindTModelEmbeddedSearch(EntityManager em, } } } + + private static List findBindingsByServiceKey(EntityManager em, String serviceKey, List keysFound) { + org.apache.juddi.model.BusinessService modelBusinessService=em.find(org.apache.juddi.model.BusinessService.class, serviceKey); + for (BindingTemplate bt : modelBusinessService.getBindingTemplates()){ + keysFound.add(bt.getEntityKey()); + } + return keysFound; + } } diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java index 8067a76c1..701f5f834 100644 --- a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java +++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java @@ -134,7 +134,7 @@ public BindingDetail findBinding(FindBinding body) serviceCounter.update(InquiryQuery.FIND_BINDING, QueryStatus.FAILED, procTime); throw drfm; } - + EntityManager em = PersistenceManager.getEntityManager(); EntityTransaction tx = em.getTransaction(); try { @@ -144,27 +144,25 @@ public BindingDetail findBinding(FindBinding body) this.getEntityPublisher(em, body.getAuthInfo()); LogFindBindingRequest(body); + if (body.getServiceKey() != null && body.getServiceKey().length() > 0) { + // Check that we were passed a valid serviceKey per + // 5.1.12.4 of the UDDI v3 spec + String serviceKey = body.getServiceKey(); + org.apache.juddi.model.BusinessService modelBusinessService = null; + try { + modelBusinessService=em.find(org.apache.juddi.model.BusinessService.class, serviceKey); + } catch (Exception e) { + log.debug(e.getMessage(), e); + } + if (modelBusinessService == null) + throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ServiceNotFound", serviceKey)); + } + org.apache.juddi.query.util.FindQualifiers findQualifiers = new org.apache.juddi.query.util.FindQualifiers(); findQualifiers.mapApiFindQualifiers(body.getFindQualifiers()); List keysFound = InquiryHelper.findBinding(body, findQualifiers, em); - if (keysFound!=null && keysFound.size() == 0) { - if (body.getServiceKey() != null) { - // Check that we were passed a valid serviceKey per - // 5.1.12.4 of the UDDI v3 spec - String serviceKey = body.getServiceKey(); - org.apache.juddi.model.BusinessService modelBusinessService = null; - try { - modelBusinessService=em.find(org.apache.juddi.model.BusinessService.class, serviceKey); - } catch (Exception e) { - log.debug(e.getMessage(), e); - } - if (modelBusinessService == null) - throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ServiceNotFound", serviceKey)); - - } - } BindingDetail result = InquiryHelper.getBindingDetailFromKeys(body, findQualifiers, em, keysFound); tx.rollback(); long procTime = System.currentTimeMillis() - startTime; diff --git a/juddi-core/src/main/java/org/apache/juddi/query/EntityQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/EntityQuery.java index 5d375a0b8..b8558aa86 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/EntityQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/EntityQuery.java @@ -124,7 +124,7 @@ public static List getPagedResult(EntityManager em, DynamicQuery dynamicQry, * Used for all the find operation sub-queries. Restricts size of the IN clause based on global parameter */ @SuppressWarnings("unchecked") - public static List getQueryResult(EntityManager em, DynamicQuery dynamicQry, List keysIn, String inListTerm) { + public static List getQueryResult(EntityManager em, DynamicQuery dynamicQry, List keysIn, String inListTerm) { List result = new ArrayList(0); // If keysIn is null, then no IN list is applied to the query - we simply need to run the query. Otherwise, the IN list is chunked based on @@ -142,26 +142,31 @@ public static List getQueryResult(EntityManager em, DynamicQuery dynamicQry, catch(ConfigurationException ce) { log.error("Configuration exception occurred retrieving: " + Property.JUDDI_MAX_IN_CLAUSE); } - - int inParamsLeft = keysIn.size(); - int startIndex = 0; - while(inParamsLeft > 0) { - int endIndex = startIndex + Math.min(inParamsLeft, maxInClause); - - List subKeysIn = new ArrayList(endIndex); - for (int i=startIndex; i< endIndex; i++) { - subKeysIn.add(keysIn.get(i)); - } - dynamicQry.appendInListWithAnd(inListTerm, subKeysIn); - log.debug(dynamicQry); - - Query qry = dynamicQry.buildJPAQuery(em); - List resultChunk = qry.getResultList(); - result.addAll(resultChunk); - - inParamsLeft = inParamsLeft - (endIndex - startIndex); - startIndex = endIndex; - } + if (keysIn.isEmpty()) { + Query qry = dynamicQry.buildJPAQuery(em); + List resultChunk = qry.getResultList(); + result.addAll(resultChunk); + } else { + int inParamsLeft = keysIn.size(); + int startIndex = 0; + while(inParamsLeft > 0) { + int endIndex = startIndex + Math.min(inParamsLeft, maxInClause); + + List subKeysIn = new ArrayList(endIndex); + for (int i=startIndex; i< endIndex; i++) { + subKeysIn.add(keysIn.get(i)); + } + dynamicQry.appendInListWithAnd(inListTerm, subKeysIn); + log.debug(dynamicQry); + + Query qry = dynamicQry.buildJPAQuery(em); + List resultChunk = qry.getResultList(); + result.addAll(resultChunk); + + inParamsLeft = inParamsLeft - (endIndex - startIndex); + startIndex = endIndex; + } + } } return result; diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindBindingByCategoryGroupQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindBindingByCategoryGroupQuery.java index 14fd5945d..e65cbfce0 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindBindingByCategoryGroupQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindBindingByCategoryGroupQuery.java @@ -58,7 +58,7 @@ public class FindBindingByCategoryGroupQuery { BindingTemplateQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, String parentKey, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, String parentKey, List keysIn) { if (parentKey != null && parentKey.length() > 0) { DynamicQuery.Parameter param = new DynamicQuery.Parameter(BindingTemplateQuery.ENTITY_ALIAS + "." + BindingTemplateQuery.KEY_NAME_PARENT, parentKey, DynamicQuery.PREDICATE_EQUALS); return findQuery.select(em, fq, categoryBag, keysIn, param); diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindBindingByCategoryQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindBindingByCategoryQuery.java index 6489785d5..2e34d9722 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindBindingByCategoryQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindBindingByCategoryQuery.java @@ -52,7 +52,7 @@ public class FindBindingByCategoryQuery { BindingTemplateQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, String parentKey, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, String parentKey, List keysIn) { if (parentKey != null && parentKey.length() > 0) { DynamicQuery.Parameter param = new DynamicQuery.Parameter(BindingTemplateQuery.ENTITY_ALIAS + "." + BindingTemplateQuery.KEY_NAME_PARENT, parentKey, DynamicQuery.PREDICATE_EQUALS); return findQuery.select(em, fq, categoryBag, keysIn, param); diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindBindingByTModelKeyQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindBindingByTModelKeyQuery.java index 7f7dfc5bc..80d2df35b 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindBindingByTModelKeyQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindBindingByTModelKeyQuery.java @@ -60,11 +60,11 @@ public class FindBindingByTModelKeyQuery extends BindingTemplateQuery { entityAliasChild = buildAlias(ENTITY_NAME_CHILD); } - public static List select(EntityManager em, FindQualifiers fq, TModelBag tModels, String parentKey, - List keysIn, DynamicQuery.Parameter... restrictions) { + public static List select(EntityManager em, FindQualifiers fq, TModelBag tModels, String parentKey, + List keysIn, DynamicQuery.Parameter... restrictions) { // If keysIn is not null and empty, then search is over. - if ((keysIn != null) && (keysIn.size() == 0)) - return keysIn; + //if ((keysIn != null) && (keysIn.size() == 0)) + // return keysIn; if (tModels == null) return keysIn; diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByCategoryGroupQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByCategoryGroupQuery.java index 790c12733..dfc628b95 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByCategoryGroupQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByCategoryGroupQuery.java @@ -57,7 +57,7 @@ public class FindBusinessByCategoryGroupQuery { BusinessEntityQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn) { return findQuery.select(em, fq, categoryBag, keysIn); } } diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByCategoryQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByCategoryQuery.java index 8c86a9d9b..cecb33983 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByCategoryQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByCategoryQuery.java @@ -51,7 +51,7 @@ public class FindBusinessByCategoryQuery { BusinessEntityQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn) { return findQuery.select(em, fq, categoryBag, keysIn); } } diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByCombinedCategoryQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByCombinedCategoryQuery.java index 28427f389..3949963aa 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByCombinedCategoryQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByCombinedCategoryQuery.java @@ -71,7 +71,7 @@ public class FindBusinessByCombinedCategoryQuery { BusinessEntityQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn) { return findQuery.select(em, fq, categoryBag, keysIn); } } diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByDiscoveryURLQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByDiscoveryURLQuery.java index 0fbf493a3..b606ad4a1 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByDiscoveryURLQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByDiscoveryURLQuery.java @@ -54,8 +54,8 @@ public class FindBusinessByDiscoveryURLQuery extends BusinessEntityQuery { entityAliasChild = buildAlias(ENTITY_NAME_CHILD); } - public static List select(EntityManager em, FindQualifiers fq, DiscoveryURLs discURLs, - List keysIn, DynamicQuery.Parameter... restrictions) { + public static List select(EntityManager em, FindQualifiers fq, DiscoveryURLs discURLs, + List keysIn, DynamicQuery.Parameter... restrictions) { // If keysIn is not null and empty, then search is over. if ((keysIn != null) && (keysIn.size() == 0)) return keysIn; diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByIdentifierQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByIdentifierQuery.java index ae0bdf8ea..0c117f4d9 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByIdentifierQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByIdentifierQuery.java @@ -50,7 +50,7 @@ public class FindBusinessByIdentifierQuery { BusinessEntityQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, IdentifierBag identifiers, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, IdentifierBag identifiers, List keysIn) { return findQuery.select(em, fq, identifiers, keysIn); } diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByNameQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByNameQuery.java index 06568fcee..b2a185a88 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByNameQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByNameQuery.java @@ -58,7 +58,7 @@ public class FindBusinessByNameQuery { BusinessEntityQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, List names, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, List names, List keysIn) { return findQuery.select(em, fq, names, keysIn); } diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByTModelKeyQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByTModelKeyQuery.java index 88da9c140..bde5d2b77 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByTModelKeyQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindBusinessByTModelKeyQuery.java @@ -60,7 +60,7 @@ public class FindBusinessByTModelKeyQuery extends BusinessEntityQuery { entityAliasChild = buildAlias(ENTITY_NAME_CHILD); } - public static List select(EntityManager em, FindQualifiers fq, TModelBag tModels, List keysIn, DynamicQuery.Parameter... restrictions) { + public static List select(EntityManager em, FindQualifiers fq, TModelBag tModels, List keysIn, DynamicQuery.Parameter... restrictions) { // If keysIn is not null and empty, then search is over. if ((keysIn != null) && (keysIn.isEmpty())) return keysIn; diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByCategoryGroupQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByCategoryGroupQuery.java index fe55a460c..178e5f3d2 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByCategoryGroupQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByCategoryGroupQuery.java @@ -128,7 +128,7 @@ public void setSignaturePresent(String signaturePresent) { } @SuppressWarnings("unchecked") - public List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn, DynamicQuery.Parameter... restrictions) { + public List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn, DynamicQuery.Parameter... restrictions) { // If keysIn is not null and empty, then search is over. if ((keysIn != null) && (keysIn.size() == 0)) return keysIn; @@ -152,9 +152,9 @@ public List select(EntityManager em, FindQualifiers fq, CategoryBag categoryB Collections.sort(keyedRefGroups, new KeyedRefGroupTModelComparator()); int count = 0; String prevTModelKey = null; - Set orResults = new HashSet(0); - List restrictionList = keysIn; - List curResult = null; + Set orResults = new HashSet(0); + List restrictionList = keysIn; + List curResult = null; for (KeyedReferenceGroup keyedRefGroup : keyedRefGroups) { String curTModelKey = keyedRefGroup.getTModelKey(); @@ -167,7 +167,7 @@ public List select(EntityManager em, FindQualifiers fq, CategoryBag categoryB if (fq.isOrLikeKeys()) { if (!curTModelKey.equals(prevTModelKey)) { if (count != 0) { - restrictionList = new ArrayList(orResults); + restrictionList = new ArrayList(orResults); orResults.clear(); } } @@ -183,20 +183,20 @@ else if (!fq.isOrAllKeys()) { curResult = getQueryResult(em, dynamicQry, restrictionList, entityAlias + "." + keyName); if (fq.isOrAllKeys() || fq.isOrLikeKeys()) { - orResults.addAll((List)curResult); + orResults.addAll((List)curResult); } prevTModelKey = curTModelKey; count++; } - List result = null; + List result = null; if (fq.isOrAllKeys() || fq.isOrLikeKeys()) { - result = new ArrayList(0); + result = new ArrayList(0); result.addAll(orResults); } else - result = (List)curResult; + result = (List)curResult; return result; diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByCategoryQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByCategoryQuery.java index 99d831a5e..0f7910eac 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByCategoryQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByCategoryQuery.java @@ -117,7 +117,7 @@ public void setSignaturePresent(String signaturePresent) { this.signaturePresent = signaturePresent; } - public List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn, DynamicQuery.Parameter... restrictions) { + public List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn, DynamicQuery.Parameter... restrictions) { // If keysIn is not null and empty, then search is over. if ((keysIn != null) && (keysIn.size() == 0)) return keysIn; diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByCombinedCategoryQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByCombinedCategoryQuery.java index a19f73738..acb62dc51 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByCombinedCategoryQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByCombinedCategoryQuery.java @@ -126,8 +126,8 @@ public String getEntityAliasChild3() { return entityAliasChild3; } - public List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, - List keysIn, DynamicQuery.Parameter... restrictions) { + public List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, + List keysIn, DynamicQuery.Parameter... restrictions) { // If keysIn is not null and empty, then search is over. if ((keysIn != null) && (keysIn.size() == 0)) @@ -195,7 +195,7 @@ public List select(EntityManager em, FindQualifiers fq, CategoryBag categoryB } } } - return new ArrayList(resultingEntityKeys); + return new ArrayList(resultingEntityKeys); } /** * Finding the entities (businesses or services) that have a matching keyedReference in their @@ -212,7 +212,7 @@ public List select(EntityManager em, FindQualifiers fq, CategoryBag categoryB */ private void findEntityByCategoryQuery(Map> map, EntityManager em, FindQualifiers fq, CategoryBag categoryBag, String entityField, String entityNameChild, - List keysIn, DynamicQuery.Parameter... restrictions) + List keysIn, DynamicQuery.Parameter... restrictions) { FindEntityByCategoryQuery findEntityByCategoryQuery = new FindEntityByCategoryQuery( entityName, entityAlias, keyName, entityField, entityNameChild, signaturePresent); diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByIdentifierQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByIdentifierQuery.java index 31251e281..d520b3378 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByIdentifierQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByIdentifierQuery.java @@ -113,7 +113,7 @@ public void setSignaturePresent(String signaturePresent) { } - public List select(EntityManager em, FindQualifiers fq, IdentifierBag identifiers, List keysIn, DynamicQuery.Parameter... restrictions) { + public List select(EntityManager em, FindQualifiers fq, IdentifierBag identifiers, List keysIn, DynamicQuery.Parameter... restrictions) { // If keysIn is not null and empty, then search is over. if ((keysIn != null) && (keysIn.size() == 0)) return keysIn; diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByNamesQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByNamesQuery.java index 5915783d3..ba1c3bff4 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByNamesQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindEntityByNamesQuery.java @@ -99,7 +99,7 @@ public void setSignaturePresent(String signaturePresent) { this.signaturePresent = signaturePresent; } - public List select(EntityManager em, FindQualifiers fq, List names, List keysIn, DynamicQuery.Parameter... restrictions) { + public List select(EntityManager em, FindQualifiers fq, List names, List keysIn, DynamicQuery.Parameter... restrictions) { // If keysIn is not null and empty, then search is over. if ((keysIn != null) && (keysIn.size() == 0)) return keysIn; diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByCategoryGroupQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByCategoryGroupQuery.java index acbc2b408..688f70a2d 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByCategoryGroupQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByCategoryGroupQuery.java @@ -57,7 +57,7 @@ public class FindServiceByCategoryGroupQuery { BusinessServiceQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, String parentKey, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, String parentKey, List keysIn) { if (parentKey != null && parentKey.length() > 0) { DynamicQuery.Parameter param = new DynamicQuery.Parameter(BusinessServiceQuery.ENTITY_ALIAS + "." + BusinessServiceQuery.KEY_NAME_PARENT, parentKey, DynamicQuery.PREDICATE_EQUALS); return findQuery.select(em, fq, categoryBag, keysIn, param); diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByCategoryQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByCategoryQuery.java index bbdb1d3d0..978e5c72c 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByCategoryQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByCategoryQuery.java @@ -51,7 +51,7 @@ public class FindServiceByCategoryQuery { BusinessServiceQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, String parentKey, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, String parentKey, List keysIn) { if (parentKey != null && parentKey.length() > 0) { DynamicQuery.Parameter param = new DynamicQuery.Parameter(BusinessServiceQuery.ENTITY_ALIAS + "." + BusinessServiceQuery.KEY_NAME_PARENT, parentKey, DynamicQuery.PREDICATE_EQUALS); diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByCombinedCategoryQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByCombinedCategoryQuery.java index ab87a9d66..3716bf40c 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByCombinedCategoryQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByCombinedCategoryQuery.java @@ -76,7 +76,7 @@ public class FindServiceByCombinedCategoryQuery { BusinessServiceQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, String parentKey, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, String parentKey, List keysIn) { if (parentKey != null && parentKey.length() > 0) { DynamicQuery.Parameter param = new DynamicQuery.Parameter(BusinessServiceQuery.ENTITY_ALIAS + "." + BusinessServiceQuery.KEY_NAME_PARENT, parentKey, DynamicQuery.PREDICATE_EQUALS); return findQuery.select(em, fq, categoryBag, keysIn, param); diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByNameQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByNameQuery.java index bb52bec77..e6f1e94ca 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByNameQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByNameQuery.java @@ -58,7 +58,7 @@ public class FindServiceByNameQuery { BusinessServiceQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, List names, String parentKey, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, List names, String parentKey, List keysIn) { if (parentKey != null && parentKey.length() > 0) { DynamicQuery.Parameter param = new DynamicQuery.Parameter(BusinessServiceQuery.ENTITY_ALIAS + "." + BusinessServiceQuery.KEY_NAME_PARENT, parentKey, DynamicQuery.PREDICATE_EQUALS); return findQuery.select(em, fq, names, keysIn, param); diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByTModelKeyQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByTModelKeyQuery.java index 5c855f90e..991230eae 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByTModelKeyQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindServiceByTModelKeyQuery.java @@ -62,7 +62,7 @@ public class FindServiceByTModelKeyQuery extends BusinessServiceQuery { entityAliasChild = buildAlias(ENTITY_NAME_CHILD); } - public static List select(EntityManager em, FindQualifiers fq, TModelBag tModels, String parentKey, List keysIn, DynamicQuery.Parameter... restrictions) { + public static List select(EntityManager em, FindQualifiers fq, TModelBag tModels, String parentKey, List keysIn, DynamicQuery.Parameter... restrictions) { // If keysIn is not null and empty, then search is over. if ((keysIn != null) && (keysIn.isEmpty())) return keysIn; diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByCategoryGroupQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByCategoryGroupQuery.java index 487a90e8b..29750dff6 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByCategoryGroupQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByCategoryGroupQuery.java @@ -58,7 +58,7 @@ public class FindTModelByCategoryGroupQuery { TModelQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn) { return findQuery.select(em, fq, categoryBag, keysIn, new DynamicQuery.Parameter(TModelQuery.ENTITY_ALIAS + ".deleted", Boolean.FALSE, DynamicQuery.PREDICATE_EQUALS)); } diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByCategoryQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByCategoryQuery.java index 6e5237c9b..edf0bd65e 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByCategoryQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByCategoryQuery.java @@ -52,7 +52,7 @@ public class FindTModelByCategoryQuery { TModelQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, CategoryBag categoryBag, List keysIn) { return findQuery.select(em, fq, categoryBag, keysIn, new DynamicQuery.Parameter(TModelQuery.ENTITY_ALIAS + ".deleted", Boolean.FALSE, DynamicQuery.PREDICATE_EQUALS)); } diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByIdentifierQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByIdentifierQuery.java index fe7d53afd..3c13cfc1a 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByIdentifierQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByIdentifierQuery.java @@ -51,7 +51,7 @@ public class FindTModelByIdentifierQuery { TModelQuery.SIGNATURE_PRESENT); } - public static List select(EntityManager em, FindQualifiers fq, IdentifierBag identifiers, List keysIn) { + public static List select(EntityManager em, FindQualifiers fq, IdentifierBag identifiers, List keysIn) { return findQuery.select(em, fq, identifiers, keysIn, new DynamicQuery.Parameter(TModelQuery.ENTITY_ALIAS + ".deleted", Boolean.FALSE, DynamicQuery.PREDICATE_EQUALS)); } diff --git a/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByNameQuery.java b/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByNameQuery.java index bb64b81bd..40bfb2d70 100644 --- a/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByNameQuery.java +++ b/juddi-core/src/main/java/org/apache/juddi/query/FindTModelByNameQuery.java @@ -51,7 +51,7 @@ public class FindTModelByNameQuery extends TModelQuery { @SuppressWarnings("unused") private static Log log = LogFactory.getLog(FindTModelByNameQuery.class); - public static List select(EntityManager em, FindQualifiers fq, Name name, List keysIn, DynamicQuery.Parameter... restrictions) { + public static List select(EntityManager em, FindQualifiers fq, Name name, List keysIn, DynamicQuery.Parameter... restrictions) { // If keysIn is not null and empty, then search is over. if ((keysIn != null) && (keysIn.isEmpty())) return keysIn; diff --git a/juddi-core/src/main/java/org/apache/juddi/validation/ValidateInquiry.java b/juddi-core/src/main/java/org/apache/juddi/validation/ValidateInquiry.java index e5c276d2b..37d6ae0cf 100644 --- a/juddi-core/src/main/java/org/apache/juddi/validation/ValidateInquiry.java +++ b/juddi-core/src/main/java/org/apache/juddi/validation/ValidateInquiry.java @@ -21,6 +21,13 @@ import java.util.List; import java.util.Hashtable; import java.util.Map; +import javax.persistence.EntityManager; +import javax.persistence.EntityTransaction; +import org.apache.juddi.api.impl.InquiryHelper; +import org.apache.juddi.api.util.InquiryQuery; +import org.apache.juddi.api.util.QueryStatus; +import org.apache.juddi.config.PersistenceManager; +import org.apache.juddi.mapping.MappingModelToApi; import org.uddi.api_v3.GetBusinessDetail; import org.uddi.api_v3.GetOperationalInfo; @@ -40,6 +47,8 @@ import org.uddi.v3_service.DispositionReportFaultMessage; import org.apache.juddi.model.UddiEntityPublisher; +import org.apache.juddi.query.BusinessServiceQuery; +import org.apache.juddi.query.util.DynamicQuery; import org.apache.juddi.query.util.FindQualifiers; import org.apache.juddi.v3.error.ErrorMessage; import org.apache.juddi.v3.error.FatalErrorException; @@ -47,6 +56,8 @@ import org.apache.juddi.v3.error.InvalidKeyPassedException; import org.apache.juddi.v3.error.UnsupportedException; import org.apache.juddi.v3.error.ValueNotAllowedException; +import org.uddi.api_v3.BindingDetail; +import org.uddi.api_v3.ServiceDetail; /** * @author Jeff Faath @@ -256,8 +267,10 @@ public void validateFindBinding(FindBinding body) throws DispositionReportFaultM if (body == null) { throw new FatalErrorException(new ErrorMessage("errors.NullInput")); } - - if (body.getCategoryBag() == null && body.getFindTModel() == null && body.getTModelBag() == null) { + if (body.getServiceKey()!=null && body.getServiceKey().length() > 0) { + validateServiceExists(body.getServiceKey()); + } + if ((body.getServiceKey()==null || body.getServiceKey().length()==0) && body.getCategoryBag() == null && body.getFindTModel() == null && body.getTModelBag() == null) { throw new FatalErrorException(new ErrorMessage("errors.findbinding.NoInput")); } @@ -760,4 +773,30 @@ private void InitFindQualifierMap() { supportedFindqualifiers.put(FindQualifiers.UTS_10_TMODEL.toLowerCase(), true); } + + private void validateServiceExists(String serviceKey) throws InvalidKeyPassedException { + + EntityManager em = PersistenceManager.getEntityManager(); + EntityTransaction tx = em.getTransaction(); + try { + tx.begin(); + + org.apache.juddi.model.BusinessService modelBusinessService = null; + try { + modelBusinessService = em.find(org.apache.juddi.model.BusinessService.class, serviceKey); + } catch (ClassCastException e) { + } + if (modelBusinessService == null) { + throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ServiceNotFound", serviceKey)); + } + + tx.commit(); + + } finally { + if (tx.isActive()) { + tx.rollback(); + } + em.close(); + } + } } diff --git a/juddi-core/src/test/java/org/apache/juddi/api/impl/API_070_FindEntityTest.java b/juddi-core/src/test/java/org/apache/juddi/api/impl/API_070_FindEntityTest.java index c4beb0cc9..ddf04183f 100644 --- a/juddi-core/src/test/java/org/apache/juddi/api/impl/API_070_FindEntityTest.java +++ b/juddi-core/src/test/java/org/apache/juddi/api/impl/API_070_FindEntityTest.java @@ -15,6 +15,7 @@ package org.apache.juddi.api.impl; import java.rmi.RemoteException; +import java.util.List; import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.logging.Log; @@ -24,6 +25,8 @@ import org.apache.juddi.v3.tck.TckBindingTemplate; import org.apache.juddi.v3.tck.TckBusiness; import org.apache.juddi.v3.tck.TckBusinessService; +import static org.apache.juddi.v3.tck.TckBusinessService.JOE_SERVICE_KEY_2; +import static org.apache.juddi.v3.tck.TckBusinessService.JOE_SERVICE_XML_2; import org.apache.juddi.v3.tck.TckFindEntity; import org.apache.juddi.v3.tck.TckPublisher; import org.apache.juddi.v3.tck.TckSecurity; @@ -31,15 +34,18 @@ import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; +import org.uddi.api_v3.BindingDetail; +import org.uddi.api_v3.BindingTemplate; import org.uddi.api_v3.CategoryBag; +import org.uddi.api_v3.FindBinding; import org.uddi.api_v3.FindQualifiers; import org.uddi.api_v3.FindTModel; import org.uddi.api_v3.KeyedReference; import org.uddi.api_v3.Name; import org.uddi.api_v3.SaveTModel; import org.uddi.api_v3.TModel; +import org.uddi.api_v3.TModelBag; import org.uddi.api_v3.TModelList; /** @@ -64,7 +70,8 @@ public static void setup() throws ConfigurationException { Registry.start(); logger.debug("Getting auth token.."); try { - tckTModel.saveUDDIPublisherTmodel(TckSecurity.getAuthToken(new UDDISecurityImpl(), TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword())); + tckTModel.saveUDDIPublisherTmodel(TckSecurity.getAuthToken(new UDDISecurityImpl(), TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword())); + tckTModel.saveTmodels(TckSecurity.getAuthToken(new UDDISecurityImpl(), TckPublisher.getUDDIPublisherId(), TckPublisher.getUDDIPassword())); api010.saveJoePublisher(); authInfoJoe = TckSecurity.getAuthToken(new UDDISecurityImpl(), TckPublisher.getJoePublisherId(), TckPublisher.getJoePassword()); } catch (RemoteException e) { @@ -210,7 +217,6 @@ public void JUDDI_899_1() throws Exception { public void JUDDI_899_2() throws Exception { UDDIInquiryImpl inquiry = new UDDIInquiryImpl(); - UDDIPublicationImpl pub = new UDDIPublicationImpl(); FindTModel ftm = new FindTModel(); ftm.setAuthInfo(authInfoJoe); @@ -226,4 +232,83 @@ public void JUDDI_899_2() throws Exception { Assert.assertNotNull(findTModel.getTModelInfos().getTModelInfo()); } + + @Test + public void JUDDI_992() throws Exception { + try{ + + tckTModel.saveJoePublisherTmodel(authInfoJoe); + //save a business, service and bindings + tckBusiness.saveJoePublisherBusiness(authInfoJoe); + tckBusinessService. saveService(authInfoJoe, JOE_SERVICE_XML_2, JOE_SERVICE_KEY_2); + + UDDIInquiryImpl inquiry = new UDDIInquiryImpl(); + FindBinding body = new FindBinding(); + body.setServiceKey(TckBusinessService.JOE_SERVICE_KEY_2); + body.setFindQualifiers(new FindQualifiers()); + body.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH); + body.getFindQualifiers().getFindQualifier().add(UDDIConstants.SORT_BY_DATE_ASC); + BindingDetail result = inquiry.findBinding(body); + if (result == null) + Assert.fail("Null result from find binding operation"); + List btList = result.getBindingTemplate(); + if (btList == null || btList.size() == 0) + Assert.fail("No result from find binding operation"); + Assert.assertTrue(btList.size()==1); + + } + finally { + tckBusiness.deleteJoePublisherBusiness(authInfoJoe); + } + } + + /** + * find by binding by service key and category bag + *
+         * 
+         * <find_binding xmlns="urn:uddi-org:api_v2" xmlns:xml="http://www.w3.org/XML/1998/namespace" serviceKey="">
+            <findQualifiers>
+              <findQualifier>orAllKeys</findQualifier>
+            </findQualifiers>
+            <tModelBag>
+              <tModelKey>uddi:uddi.org:protocol:serverauthenticatedssl3</tModelKey>
+            </tModelBag>
+            <categoryBag>
+              <keyedReference tModelKey="uuid:f85a1fb1-2be1-4197-9a3f-fc310222cd34" keyName="category" keyValue="secure" />
+            </categoryBag>
+          </find_binding>
+         * 
+ * @throws Exception + */ + @Test + public void JUDDI_992_2() throws Exception { + try{ + + tckTModel.saveJoePublisherTmodel(authInfoJoe); + //save a business, service and bindings + tckBusiness.saveJoePublisherBusiness(authInfoJoe); + tckBusinessService. saveService(authInfoJoe, JOE_SERVICE_XML_2, JOE_SERVICE_KEY_2); + + UDDIInquiryImpl inquiry = new UDDIInquiryImpl(); + FindBinding body = new FindBinding(); + // body.setServiceKey(TckBusinessService.JOE_SERVICE_KEY_2); + body.setFindQualifiers(new FindQualifiers()); + body.getFindQualifiers().getFindQualifier().add(UDDIConstants.OR_ALL_KEYS); + body.setTModelBag(new TModelBag()); + body.getTModelBag().getTModelKey().add("uddi:uddi.org:transport:telephone"); + body.setCategoryBag(new CategoryBag()); + body.getCategoryBag().getKeyedReference().add(new KeyedReference("uddi:tmodelkey:categories:bindings", "category", "accesspoint")); + BindingDetail result = inquiry.findBinding(body); + if (result == null) + Assert.fail("Null result from find binding operation"); + List btList = result.getBindingTemplate(); + if (btList == null || btList.size() == 0) + Assert.fail("No result from find binding operation"); + Assert.assertTrue(btList.size()==1); + + } + finally { + tckBusiness.deleteJoePublisherBusiness(authInfoJoe); + } + } } diff --git a/uddi-tck-base/src/main/java/org/apache/juddi/v2/tck/TckFindEntity.java b/uddi-tck-base/src/main/java/org/apache/juddi/v2/tck/TckFindEntity.java index 316a5d004..291c06f03 100644 --- a/uddi-tck-base/src/main/java/org/apache/juddi/v2/tck/TckFindEntity.java +++ b/uddi-tck-base/src/main/java/org/apache/juddi/v2/tck/TckFindEntity.java @@ -229,7 +229,7 @@ public String findService(String findQualifier) { String serviceKey = null; try { FindService body = (FindService)EntityCreator.buildFromDoc(FIND_SERVICE_XML, "org.uddi.api_v2"); - body.setGeneric("2.0"); + body.setGeneric("2.0"); if (findQualifier!=null) body.getFindQualifiers().getFindQualifier().add(findQualifier); ServiceList result = inquiry.findService(body); if (result == null) @@ -284,7 +284,7 @@ public String findService_CombinedCatBag() { public void findServiceDetail(String serviceKey) { try { GetServiceDetail getServiceDetail = new GetServiceDetail(); - getServiceDetail.setGeneric("2.0"); + getServiceDetail.setGeneric("2.0"); getServiceDetail.getServiceKey().add(serviceKey); @@ -321,7 +321,7 @@ public void findBinding(String findQualifier) { try { FindBinding body = (FindBinding)EntityCreator.buildFromDoc(FIND_BINDING_XML, "org.uddi.api_v2"); if (findQualifier!=null) body.getFindQualifiers().getFindQualifier().add(findQualifier); - body.setGeneric("2.0"); + body.setGeneric("2.0"); BindingDetail result = inquiry.findBinding(body); if (result == null) Assert.fail("Null result from find binding operation"); diff --git a/uddi-tck-base/src/main/resources/uddi_data_v2/joepublisher/bindingTemplate.xml b/uddi-tck-base/src/main/resources/uddi_data_v2/joepublisher/bindingTemplate.xml index e207cc036..b3501fbfa 100644 --- a/uddi-tck-base/src/main/resources/uddi_data_v2/joepublisher/bindingTemplate.xml +++ b/uddi-tck-base/src/main/resources/uddi_data_v2/joepublisher/bindingTemplate.xml @@ -23,7 +23,7 @@ - + From bc3d6b9d5921f11d15838dc04590578b49f934b4 Mon Sep 17 00:00:00 2001 From: Alex O'Ree Date: Fri, 23 Nov 2018 08:14:59 -0500 Subject: [PATCH 3/3] new signing key --- KEYS | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/KEYS b/KEYS index e34403e7a..5e8abae5a 100644 --- a/KEYS +++ b/KEYS @@ -1732,3 +1732,36 @@ wmcS4vGJ6xCH3CjErHYntz8PK6Pz0ITDTi7RWjaaFFS2VI+72Jb0x9O3qJ6LQuIa zqXNuW+b9q0QrxX3GNTRP+gtES6qXuZvUIHDa6fBmtE6qi7w/CM= =BRII -----END PGP PUBLIC KEY BLOCK----- + +pub rsa4096 2018-11-23 [SC] [expires: 2023-11-22] + 3A1AAFA9B89A1D1DDD5F3A4B98AD2E19BFF4106D +uid [ultimate] Alex O'Ree +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFv3+7oBEADXMQXwYMxs45ePjno3XcOouM5NMCYsKk6qmrCBr2ffLLTPER6M +9KtyYAqCqe1DQmB0BRau1GuBRN6mydzILjVaJ6B1S+SsDGHOTDpTVyKUKSkQ292X +KzGq3w5xqvQ1ZP1Iob38XvGQDR2vKnqDeZhVcCsDrbMPBpO3bxCCwrztwHogGZiA +wejypOGlYz3stRY7SKvFkuuH75An6KGx/C9VDh8EH0tUT3hQ09On1/m6+I/8X3YR +WUhCj5WuUg9oaI0MCd9CjgKRH7PEnemFhb1iXBxcOn8vC8hRmYqsl54gIhfF9T8P +HdyTfqji7AKNu3zz3yiiaqlteZewxFyjhwnjvmJMQ+D5Mt9ZfexuDIMY7319psiY +w8x8CuDb1NPq3vR/P0oo5baldIk2r3K0uOdXBGOls1bbqUTv2V+fFdAzk7qC+kxU +PrEpkFKMKd2jtkcO/0Qfgn5r5r7aU1AyGRbXT7fySMT2/6GFu4XSrVWBtjFP9u7F +5ELb19dFaQk6eUCr+ZMTwz5TP6pajDp3NSBX+lXZipYHQEIcwk0P8kSwHwqVUhgr +uAlyy5E/bvmBxX0nFZVbGwlUedT2OkwhU2FeQKfMG9Ohimpx0qK0XQbRRAaJ8AI9 +ws3rC/RkPdfOZvgIdGScf+aNJNb9/5pnSUx+bpBppg7MhbWTnRkkCR1qsQARAQAB +tCBBbGV4IE8nUmVlIDxhbGV4b3JlZUBhcGFjaGUub3JnPokCVAQTAQgAPhYhBDoa +r6m4mh0d3V86S5itLhm/9BBtBQJb9/u6AhsDBQkJZgGABQsJCAcCBhUKCQgLAgQW +AgMBAh4BAheAAAoJEJitLhm/9BBt8jEQAKU8DFRyiVFVK+k+TwVIFgS7ZF3uV48p +6I6VSCZUQsWYJWu0LnT8k/vi1lSz3i4080J5vB/8pkuYtJW3Bfv15BcZ6xDg9Asm +XcAvt/sS315x+TyjBeqvfi3yJEVlCySduc3PeoMVLOZmtPcmbeajAmHh9P1TkZ7g +f9sXtdzXrnViwMYMs+CN91qlWCfZJopfomEf1aazhJixYfjjh12wwSfLRsa7cHWd +XeuTdXg7xAOnegLLdfzgzpQdRC67QM6K6GmucqY0dCKIWIgN1UuV5n33336fI0WB +RR+LKGTZK39l2ddh0iizurJO9QYM4m8FmhVmym2e/2ClY3N1QniXU1a8ZGIPlSIS +/tbyMYXt+3CiP9P+nyrQKoilCX54L1RdwOrDb7Z1B4DnQqls6MrdEphHtZMdDkeX +INBX9q3P7J4SrwA5xAbvevaVHJ5mk7rgmG2V1FVGmDeX8ACF4ONfOs4T4C1bTMhw +SOM+ulVAtr1nsrDZWO7/Kv9LlVXr1/pbOZuRp6ioveQlZZNzzfjLm4WxpeTqeQ4w +PJzYFhDkrJXyb4GOhnsyVyHclxnMWP3xB0iV4BFyY92SMIPfnaoLoI4sBui+Ua7i +PUwMIH473BaLm7fvqothns0DAmXYd+VKpAx0zta0ucya0wtBXY0xaz7h4vVHB6zJ +Ui44RuYe758D +=LGw7 +-----END PGP PUBLIC KEY BLOCK-----