Skip to content
Permalink
Browse files
JUDDI-706 resolving an issue with juddi api, delete subscription fail…
…ing due to using the wrong service counter metric. admin save subscription also reported a failure, when it was in fact a success (admin console issue), resolved.
  • Loading branch information
spyhunter99 committed Dec 22, 2014
1 parent c674214 commit 43efbe4d12def6bc1420435d46739f3f23afa2ca
Showing 4 changed files with 16 additions and 12 deletions.
@@ -26,8 +26,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.jws.WebService;
import javax.persistence.EntityManager;
@@ -37,15 +35,13 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
import javax.xml.ws.Holder;
import org.apache.commons.configuration.ConfigurationException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.juddi.ClassUtil;
import static org.apache.juddi.api.impl.JUDDIApiImpl.sub;
import org.apache.juddi.api.util.JUDDIQuery;
import org.apache.juddi.api.util.QueryStatus;
import org.apache.juddi.api.util.SubscriptionQuery;
import org.apache.juddi.api_v3.AdminSaveBusinessWrapper;
import org.apache.juddi.api_v3.AdminSaveTModelWrapper;
import org.apache.juddi.api_v3.Clerk;
@@ -100,11 +96,9 @@
import org.uddi.api_v3.BusinessInfos;
import org.uddi.api_v3.Contact;
import org.uddi.api_v3.DeleteTModel;
import org.uddi.api_v3.DiscardAuthToken;
import org.uddi.api_v3.DispositionReport;
import org.uddi.api_v3.GetRegisteredInfo;
import org.uddi.api_v3.InfoSelection;
import org.uddi.api_v3.KeyType;
import org.uddi.api_v3.PersonName;
import org.uddi.api_v3.RegisteredInfo;
import org.uddi.api_v3.Result;
@@ -1168,11 +1162,11 @@ public void adminDeleteSubscription(String authInfo, List<String> subscriptionKe

tx.commit();
long procTime = System.currentTimeMillis() - startTime;
serviceCounter.update(SubscriptionQuery.DELETE_SUBSCRIPTION,
serviceCounter.update(JUDDIQuery.ADMIN_SAVE_SUB,
QueryStatus.SUCCESS, procTime);
} catch (DispositionReportFaultMessage drfm) {
long procTime = System.currentTimeMillis() - startTime;
serviceCounter.update(SubscriptionQuery.DELETE_SUBSCRIPTION,
serviceCounter.update(JUDDIQuery.ADMIN_SAVE_SUB,
QueryStatus.FAILED, procTime);
throw drfm;
} finally {
@@ -1481,7 +1475,7 @@ public org.uddi.repl_v3.ReplicationConfiguration getReplicationNodes(String auth
r.getRegistryContact().getContact().getPersonName().add(new PersonName("Unknown", null));
}
serviceCounter.update(JUDDIQuery.GET_REPLICATION_NODES,
QueryStatus.FAILED, procTime);
QueryStatus.SUCCESS, procTime);

} finally {
if (tx.isActive()) {
@@ -43,7 +43,7 @@ public enum JUDDIQuery implements UDDIQuery {
ADMIN_DELETE_SUB("admin_deleteSubcriptionInfo"),
ADMIN_SAVE_TMODEL("admin_saveTmodel"),
ADMIN_SAVE_BUSINESS("admin_saveBusiness"),
SET_REPLICATION_NODES("set_replioationNodes"),
SET_REPLICATION_NODES("set_replicationNodes"),
GET_REPLICATION_NODES("get_replicationNodes"),
ADMIN_SAVE_SUB("admin_saveClientSubscription"),
INVOKE_SYNCSUB("invoke_synchSubscription");
@@ -82,7 +82,7 @@ public synchronized static void initInquiryQueries() {
_inquiryQueries.put("admin_deleteSubcriptionInfo", JUDDIQuery.ADMIN_DELETE_SUB);
_inquiryQueries.put("admin_saveTmodel", JUDDIQuery.ADMIN_SAVE_TMODEL);
_inquiryQueries.put("admin_saveBusiness", JUDDIQuery.ADMIN_SAVE_BUSINESS);
_inquiryQueries.put("set_replioationNodes", JUDDIQuery.SET_REPLICATION_NODES);
_inquiryQueries.put("set_replicationNodes", JUDDIQuery.SET_REPLICATION_NODES);
_inquiryQueries.put("get_replicationNodes", JUDDIQuery.GET_REPLICATION_NODES);
_inquiryQueries.put("admin_saveClientSubscription", JUDDIQuery.ADMIN_SAVE_SUB);

@@ -40,9 +40,11 @@
import org.apache.juddi.api_v3.SyncSubscription;
import org.apache.juddi.config.AppConfig;
import org.apache.juddi.config.Property;
import org.apache.juddi.v3.client.UDDIConstants;
import org.uddi.api_v3.BusinessEntity;
import org.uddi.api_v3.Contact;
import org.uddi.api_v3.FindBusiness;
import org.uddi.api_v3.FindQualifiers;
import org.uddi.api_v3.Name;
import org.uddi.api_v3.PersonName;
import org.uddi.api_v3.TModel;
@@ -134,6 +136,10 @@ public static String getSampleXML(String method) {
obj.getSubscriptions().get(0).setSubscriptionFilter(new SubscriptionFilter());
obj.getSubscriptions().get(0).setBrief(Boolean.TRUE);
obj.getSubscriptions().get(0).getSubscriptionFilter().setFindBusiness(new FindBusiness());
obj.getSubscriptions().get(0).getSubscriptionFilter().getFindBusiness().getName().add(new Name(UDDIConstants.WILDCARD, null));
obj.getSubscriptions().get(0).getSubscriptionFilter().getFindBusiness().setFindQualifiers(new FindQualifiers());
obj.getSubscriptions().get(0).getSubscriptionFilter().getFindBusiness().getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
obj.getSubscriptions().get(0).getSubscriptionFilter().getFindBusiness().getFindQualifiers().getFindQualifier().add(UDDIConstants.CASE_INSENSITIVE_MATCH);
//obj.getSubscriptions().get(0).getSubscriptionFilter().getFindBusiness()
JAXB.marshal(obj, sw);
}
@@ -66,6 +66,7 @@
import org.apache.juddi.adminconsole.resources.ResourceLoader;
import org.apache.juddi.api_v3.AdminSaveBusiness;
import org.apache.juddi.api_v3.AdminSaveSubscriptionRequest;
import org.apache.juddi.api_v3.AdminSaveSubscriptionResponse;
import org.apache.juddi.api_v3.AdminSaveTModel;
import org.apache.juddi.api_v3.ClerkList;
import org.apache.juddi.api_v3.ClientSubscriptionInfo;
@@ -768,8 +769,11 @@ private String adminSaveSubscription(HttpServletRequest parameters) {
return HandleException(ex);
}
}
AdminSaveSubscriptionResponse res = new AdminSaveSubscriptionResponse()
;
res.getSubscriptions().addAll(holder.value);
StringWriter sw = new StringWriter();
JAXB.marshal(holder, sw);
JAXB.marshal(res, sw);
return StringEscapeUtils.escapeHtml(sw.toString());
}

0 comments on commit 43efbe4

Please sign in to comment.