juddi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexo...@apache.org
Subject [1/2] juddi git commit: JUDDI-973 code cleanup on the cli client. This includes some minor refactoring of method names. Projects depending on this will require updates
Date Sat, 23 Sep 2017 13:06:47 GMT
Repository: juddi
Updated Branches:
  refs/heads/master 95a3d5808 -> 716e5fe19


http://git-wip-us.apache.org/repos/asf/juddi/blob/716e5fe1/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscribeAssertionStatus.java
----------------------------------------------------------------------
diff --git a/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscribeAssertionStatus.java
b/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscribeAssertionStatus.java
index 7440876..d22704e 100644
--- a/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscribeAssertionStatus.java
+++ b/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscribeAssertionStatus.java
@@ -18,21 +18,15 @@ package org.apache.juddi.v3.client.cli;
 
 import javax.xml.datatype.DatatypeFactory;
 import org.apache.juddi.jaxb.PrintUDDI;
-import org.apache.juddi.v3.client.UDDIConstants;
 import org.apache.juddi.v3.client.config.UDDIClerk;
 import org.apache.juddi.v3.client.config.UDDIClient;
 import org.apache.juddi.v3.client.subscription.ISubscriptionCallback;
 import org.apache.juddi.v3.client.subscription.SubscriptionCallbackListener;
 import org.apache.juddi.v3.client.transport.Transport;
-import org.apache.juddi.v3_service.JUDDIApiPortType;
 import org.uddi.api_v3.*;
 import org.uddi.sub_v3.Subscription;
 import org.uddi.sub_v3.SubscriptionFilter;
 import org.uddi.sub_v3.SubscriptionResultsList;
-import org.uddi.v3_service.UDDIInquiryPortType;
-import org.uddi.v3_service.UDDIPublicationPortType;
-import org.uddi.v3_service.UDDISecurityPortType;
-import org.uddi.v3_service.UDDISubscriptionPortType;
 
 /**
  * Thie class shows you how to create a business and a subscription using UDDI
@@ -40,13 +34,9 @@ import org.uddi.v3_service.UDDISubscriptionPortType;
  *
  * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
  */
-public class UddiSubscribeAssertionStatus implements ISubscriptionCallback, Runnable {
+public class UddiSubscribeAssertionStatus implements ISubscriptionCallback {
 
-        private static UDDISecurityPortType security = null;
-        private static JUDDIApiPortType juddiApi = null;
-        private static UDDIPublicationPortType publish = null;
-        private static UDDIInquiryPortType uddiInquiryService = null;
-        private static UDDISubscriptionPortType uddiSubscriptionService = null;
+     
         boolean callbackRecieved = false;
         private UDDIClerk clerk = null;
         private UDDIClient client = null;
@@ -59,11 +49,6 @@ public class UddiSubscribeAssertionStatus implements ISubscriptionCallback,
Runn
                         clerk = client.getClerk("default");
                         Transport transport = client.getTransport();
                         // Now you create a reference to the UDDI API
-                        security = transport.getUDDISecurityService();
-                        juddiApi = transport.getJUDDIApiService();
-                        publish = transport.getUDDIPublishService();
-                        uddiInquiryService = transport.getUDDIInquiryService();
-                        uddiSubscriptionService = transport.getUDDISubscriptionService();
                 } catch (Exception e) {
                         e.printStackTrace();
                 }
@@ -72,11 +57,7 @@ public class UddiSubscribeAssertionStatus implements ISubscriptionCallback,
Runn
          public UddiSubscribeAssertionStatus(Transport transport) {
                 try {
                         // Now you create a reference to the UDDI API
-                        security = transport.getUDDISecurityService();
-                        juddiApi = transport.getJUDDIApiService();
-                        publish = transport.getUDDIPublishService();
-                        uddiInquiryService = transport.getUDDIInquiryService();
-                        uddiSubscriptionService = transport.getUDDISubscriptionService();
+
                 } catch (Exception e) {
                         e.printStackTrace();
                 }
@@ -142,7 +123,6 @@ public class UddiSubscribeAssertionStatus implements ISubscriptionCallback,
Runn
                 //Runtime.getRuntime().removeShutdownHook(hook);
         }
 
-        private boolean running = true;
         PrintUDDI<SubscriptionResultsList> p = new PrintUDDI<SubscriptionResultsList>();
 
         @Override
@@ -156,8 +136,5 @@ public class UddiSubscribeAssertionStatus implements ISubscriptionCallback,
Runn
                 System.out.println("The endpoint was stopped!");
         }
 
-        @Override
-        public void run() {
-                running = false;
-        }
+       
 }

http://git-wip-us.apache.org/repos/asf/juddi/blob/716e5fe1/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscribeValidate.java
----------------------------------------------------------------------
diff --git a/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscribeValidate.java
b/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscribeValidate.java
index 5afb0e5..2c26b07 100644
--- a/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscribeValidate.java
+++ b/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscribeValidate.java
@@ -22,15 +22,11 @@ import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.XMLGregorianCalendar;
 import org.apache.juddi.v3.client.config.UDDIClient;
 import org.apache.juddi.v3.client.transport.Transport;
-import org.apache.juddi.v3_service.JUDDIApiPortType;
 import org.uddi.api_v3.*;
 import org.uddi.sub_v3.CoveragePeriod;
 import org.uddi.sub_v3.GetSubscriptionResults;
 import org.uddi.sub_v3.SubscriptionResultsList;
-import org.uddi.v3_service.UDDIInquiryPortType;
-import org.uddi.v3_service.UDDIPublicationPortType;
 import org.uddi.v3_service.UDDISecurityPortType;
-import org.uddi.v3_service.UDDISubscriptionListenerPortType;
 import org.uddi.v3_service.UDDISubscriptionPortType;
 
 /**
@@ -42,11 +38,7 @@ import org.uddi.v3_service.UDDISubscriptionPortType;
 public class UddiSubscribeValidate {
 
         private static UDDISecurityPortType security = null;
-        private static JUDDIApiPortType juddiApi = null;
-        private static UDDIPublicationPortType publish = null;
-        private static UDDIInquiryPortType uddiInquiryService = null;
         private static UDDISubscriptionPortType uddiSubscriptionService = null;
-        private static UDDISubscriptionListenerPortType uddiSubscriptionListenerService =
null;
 
         public UddiSubscribeValidate() {
                 try {
@@ -56,11 +48,7 @@ public class UddiSubscribeValidate {
                         Transport transport = clerkManager.getTransport();
                         // Now you create a reference to the UDDI API
                         security = transport.getUDDISecurityService();
-                        juddiApi = transport.getJUDDIApiService();
-                        publish = transport.getUDDIPublishService();
-                        uddiInquiryService = transport.getUDDIInquiryService();
                         uddiSubscriptionService = transport.getUDDISubscriptionService();
-                        uddiSubscriptionListenerService = transport.getUDDISubscriptionListenerService();
                 } catch (Exception e) {
                         e.printStackTrace();
                 }
@@ -70,11 +58,8 @@ public class UddiSubscribeValidate {
                 try {
                         // Now you create a reference to the UDDI API
                         security = transport.getUDDISecurityService();
-                        juddiApi = transport.getJUDDIApiService();
-                        publish = transport.getUDDIPublishService();
-                        uddiInquiryService = transport.getUDDIInquiryService();
                         uddiSubscriptionService = transport.getUDDISubscriptionService();
-                        uddiSubscriptionListenerService = transport.getUDDISubscriptionListenerService();
+
                 } catch (Exception e) {
                         e.printStackTrace();
                 }
@@ -113,7 +98,7 @@ public class UddiSubscribeValidate {
                         //
                         GetSubscriptionResults req = new GetSubscriptionResults();
                         req.setAuthInfo(authtoken);
-                        //TODO insert your subscription key values here
+                        //insert your subscription key values here
                         req.setSubscriptionKey(key);
                         req.setCoveragePeriod(new CoveragePeriod());
                         req.getCoveragePeriod().setEndPoint(xcal);

http://git-wip-us.apache.org/repos/asf/juddi/blob/716e5fe1/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscriptionManagement.java
----------------------------------------------------------------------
diff --git a/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscriptionManagement.java
b/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscriptionManagement.java
index 6068c14..757ea4d 100644
--- a/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscriptionManagement.java
+++ b/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/UddiSubscriptionManagement.java
@@ -16,31 +16,12 @@
 package org.apache.juddi.v3.client.cli;
 
 import java.util.List;
-import javax.xml.datatype.DatatypeFactory;
 import org.apache.juddi.jaxb.PrintUDDI;
-import org.apache.juddi.v3.client.UDDIConstants;
 import org.apache.juddi.v3.client.config.UDDIClerk;
 import org.apache.juddi.v3.client.config.UDDIClient;
-import org.apache.juddi.v3.client.subscription.SubscriptionCallbackListener;
 import org.apache.juddi.v3.client.transport.Transport;
-import org.apache.juddi.v3_service.JUDDIApiPortType;
-import org.uddi.api_v3.BindingTemplate;
-import org.uddi.api_v3.BusinessEntity;
-import org.uddi.api_v3.BusinessService;
-import org.uddi.api_v3.BusinessServices;
-import org.uddi.api_v3.FindBusiness;
-import org.uddi.api_v3.FindQualifiers;
-import org.uddi.api_v3.FindService;
-import org.uddi.api_v3.FindTModel;
-import org.uddi.api_v3.Name;
-import org.uddi.api_v3.TModel;
 import org.uddi.sub_v3.DeleteSubscription;
 import org.uddi.sub_v3.Subscription;
-import org.uddi.sub_v3.SubscriptionFilter;
-import org.uddi.sub_v3.SubscriptionResultsList;
-import org.uddi.v3_service.UDDIInquiryPortType;
-import org.uddi.v3_service.UDDIPublicationPortType;
-import org.uddi.v3_service.UDDISecurityPortType;
 import org.uddi.v3_service.UDDISubscriptionPortType;
 
 /**
@@ -49,10 +30,6 @@ import org.uddi.v3_service.UDDISubscriptionPortType;
  */
 public class UddiSubscriptionManagement {
 
-        private static UDDISecurityPortType security = null;
-
-        private static UDDIPublicationPortType publish = null;
-        private static UDDIInquiryPortType uddiInquiryService = null;
         private static UDDISubscriptionPortType uddiSubscriptionService = null;
 
         private UDDIClerk clerk = null;
@@ -66,9 +43,7 @@ public class UddiSubscriptionManagement {
                         clerk = client.getClerk("default");
                         Transport transport = client.getTransport();
                         // Now you create a reference to the UDDI API
-                        security = transport.getUDDISecurityService();
-                        publish = transport.getUDDIPublishService();
-                        uddiInquiryService = transport.getUDDIInquiryService();
+                      
                         uddiSubscriptionService = transport.getUDDISubscriptionService();
                 } catch (Exception e) {
                         e.printStackTrace();
@@ -79,9 +54,7 @@ public class UddiSubscriptionManagement {
                 try {
                        
                         // Now you create a reference to the UDDI API
-                        security = transport.getUDDISecurityService();
-                        publish = transport.getUDDIPublishService();
-                        uddiInquiryService = transport.getUDDIInquiryService();
+                      
                         uddiSubscriptionService = transport.getUDDISubscriptionService();
                 } catch (Exception e) {
                         e.printStackTrace();
@@ -90,10 +63,10 @@ public class UddiSubscriptionManagement {
 
         public static void main(String args[]) throws Exception {
                 UddiSubscriptionManagement sp = new UddiSubscriptionManagement();
-                sp.PrintSubscriptions(null);
+                sp.printSubscriptions(null);
         }
 
-        public void PrintSubscriptions(String authtoken) throws Exception {
+        public void printSubscriptions(String authtoken) throws Exception {
 
                 if (authtoken == null) {
                         authtoken = clerk.getAuthToken();
@@ -107,7 +80,7 @@ public class UddiSubscriptionManagement {
                 }
         }
 
-        public void DeleteSubscription(String authtoken, String key) throws Exception {
+        public void deleteSubscription(String authtoken, String key) throws Exception {
 
                 if (authtoken == null) {
                         authtoken = clerk.getAuthToken();
@@ -124,7 +97,7 @@ public class UddiSubscriptionManagement {
 
         }
 
-        public void DeleteAllSubscriptions(String authtoken) throws Exception {
+        public void deleteAllSubscriptions(String authtoken) throws Exception {
 
                 if (authtoken == null) {
                         authtoken = clerk.getAuthToken();
@@ -143,7 +116,6 @@ public class UddiSubscriptionManagement {
 
         }
 
-        private boolean running = true;
         PrintUDDI<Subscription> p = new PrintUDDI<Subscription>();
 
 }

http://git-wip-us.apache.org/repos/asf/juddi/blob/716e5fe1/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/WadlImport.java
----------------------------------------------------------------------
diff --git a/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/WadlImport.java
b/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/WadlImport.java
index 8ce7e32..bf42c62 100644
--- a/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/WadlImport.java
+++ b/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/WadlImport.java
@@ -27,7 +27,6 @@ import javax.xml.namespace.QName;
 import org.apache.juddi.jaxb.PrintUDDI;
 import org.apache.juddi.v3.client.config.UDDIClerk;
 import org.apache.juddi.v3.client.config.UDDIClient;
-import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.mapping.URLLocalizerDefaultImpl;
 import org.apache.juddi.v3.client.mapping.wadl.Application;
 import org.apache.juddi.v3.client.mapping.wadl.WADL2UDDI;
@@ -62,7 +61,7 @@ public class WadlImport {
         private static JUDDIApiPortType juddiApi = null;
         private static UDDIPublicationPortType publish = null;
 
-        public void Fire(String pathOrURL, String businessKey, String token, Transport transport)
throws Exception {
+        public void fire(String pathOrURL, String businessKey, String token, Transport transport)
throws Exception {
 
                 if (transport == null) {
                 // create a manager and read the config in the archive; 
@@ -191,7 +190,7 @@ public class WadlImport {
 
         public static void main(String[] args) throws Exception {
 
-                new WadlImport().Fire("http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/resources/wadl/bookstoreImportResource.wadl",
null, null, null);
+                new WadlImport().fire("http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/resources/wadl/bookstoreImportResource.wadl",
null, null, null);
 
         }
 }

http://git-wip-us.apache.org/repos/asf/juddi/blob/716e5fe1/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/WsdlImport.java
----------------------------------------------------------------------
diff --git a/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/WsdlImport.java
b/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/WsdlImport.java
index 6688983..a4a6cf1 100644
--- a/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/WsdlImport.java
+++ b/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/WsdlImport.java
@@ -28,7 +28,6 @@ import javax.xml.namespace.QName;
 import org.apache.juddi.jaxb.PrintUDDI;
 import org.apache.juddi.v3.client.config.UDDIClerk;
 import org.apache.juddi.v3.client.config.UDDIClient;
-import org.apache.juddi.v3.client.config.UDDIClientContainer;
 import org.apache.juddi.v3.client.mapping.URLLocalizerDefaultImpl;
 import org.apache.juddi.v3.client.mapping.wsdl.ReadWSDL;
 import org.apache.juddi.v3.client.mapping.wsdl.WSDL2UDDI;
@@ -37,7 +36,6 @@ import org.apache.juddi.v3_service.JUDDIApiPortType;
 import org.uddi.api_v3.AuthToken;
 import org.uddi.api_v3.BusinessDetail;
 import org.uddi.api_v3.BusinessEntity;
-import org.uddi.api_v3.BusinessService;
 import org.uddi.api_v3.BusinessServices;
 import org.uddi.api_v3.GetAuthToken;
 import org.uddi.api_v3.Name;
@@ -64,10 +62,10 @@ public class WsdlImport {
         private static UDDIPublicationPortType publish = null;
 
         public static void main(String[] args) throws Exception {
-                new WsdlImport().Fire("http://svn.apache.org/repos/asf/juddi/trunk/uddi-ws/src/main/resources/juddi_api_v1.wsdl",
null, null, null);
+                new WsdlImport().fire("http://svn.apache.org/repos/asf/juddi/trunk/uddi-ws/src/main/resources/juddi_api_v1.wsdl",
null, null, null);
         }
 
-        public void Fire(String pathOrURL, String businessKey, String token, Transport transport)
throws Exception {
+        public void fire(String pathOrURL, String businessKey, String token, Transport transport)
throws Exception {
 
                 if (transport == null) {
                 // create a manager and read the config in the archive; 

http://git-wip-us.apache.org/repos/asf/juddi/blob/716e5fe1/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/testStrings.java
----------------------------------------------------------------------
diff --git a/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/testStrings.java
b/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/testStrings.java
deleted file mode 100644
index d79f240..0000000
--- a/juddi-client-cli/src/main/java/org/apache/juddi/v3/client/cli/testStrings.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2001-2013 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-package org.apache.juddi.v3.client.cli;
-
-import java.util.concurrent.atomic.AtomicReference;
-import javax.xml.ws.Holder;
-
-/**
- * A simple program to illistrate how to pass by "reference" vs by "value" in
- * Java. Or more accurately, how to persist changes on method parameters to the
- * caller. Written mostly because I forget it frequently and use this as
- * reference material.
- *
- * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
- */
-public class testStrings {
-
-    public static void main(String[] args) {
-        String str = "hi";
-        System.out.println(str);                                                //hi
-        System.out.println(Test1(str));                                         //hir
-        System.out.println(Test2(str));                                         //hix
-        Test3(str);
-        System.out.println(str);                                                //hi no change
-        Holder<String> holder = new Holder<String>();
-        holder.value = str;
-        Test4(holder);
-        System.out.println(str);                                                //hi no change
-        System.out.println(holder.value);                                       //hiw changed
persists
-
-        AtomicReference<String> astr = new AtomicReference<String>();
-        astr.set(str);
-        Test5(astr);
-        System.out.println(str);                                                //hi no change
-        System.out.println(astr.get());                                         //hit change
persists
-
-    }
-
-    static String Test1(String s) {
-        return s + "r";
-    }
-
-    static String Test2(String s) {
-        s += "x";
-        return s;
-    }
-
-    static void Test3(String s) {
-        s += "z";
-    }
-
-    static void Test4(Holder<String> s) {
-        s.value += "w";
-    }
-
-    static void Test5(AtomicReference<String> s) {
-        s.set(s.get() + "t");
-    }
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org


Mime
View raw message