You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juddi.apache.org by al...@apache.org on 2014/01/12 14:58:05 UTC
svn commit: r1557536 - in /juddi/trunk:
juddi-client/src/main/java/org/apache/juddi/v3/client/config/
juddi-client/src/main/java/org/apache/juddi/v3/client/subscription/
juddi-client/src/test/java/org/apache/juddi/v3/client/subscription/
juddi-core/src...
Author: alexoree
Date: Sun Jan 12 13:58:05 2014
New Revision: 1557536
URL: http://svn.apache.org/r1557536
Log:
JUDDI-673 added tck based tests
JUDDI-637 add source and asf banners to dotnet code
Modified:
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java
juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/subscription/SubscriptionCallbackListener.java
juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/subscription/SubscriptionCallbackTest.java
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDICustodyTransferImpl.java
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionListenerImpl.java
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetCachingImpl.java
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetValidationImpl.java
juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java
juddi/trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_090_SubscriptionListenerIntegrationTest.java
juddi/trunk/juddi-core/src/test/resources/META-INF/uddi.xml
juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckPublisher.java
juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckTModel.java
juddi/trunk/uddi-tck-base/src/main/resources/tck.properties
juddi/trunk/uddi-tck/src/main/resources/META-INF/uddi.xml
juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/jaxb/PrintUDDI.java
Modified: juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java (original)
+++ juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java Sun Jan 12 13:58:05 2014
@@ -1438,7 +1438,7 @@ public class UDDIClerk implements Serial
*
* @return
*/
- public boolean setIsPasswordEncrypted() {
+ public boolean getIsPasswordEncrypted() {
return this.isencrypted;
}
Modified: juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/subscription/SubscriptionCallbackListener.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/subscription/SubscriptionCallbackListener.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/subscription/SubscriptionCallbackListener.java (original)
+++ juddi/trunk/juddi-client/src/main/java/org/apache/juddi/v3/client/subscription/SubscriptionCallbackListener.java Sun Jan 12 13:58:05 2014
@@ -81,509 +81,505 @@ import org.uddi.v3_service.UDDIPublicati
* @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
* @since 3.2
*/
-@WebService(name = "UDDI_SubscriptionListener_PortType", targetNamespace = "urn:uddi-org:v3_service")
-@XmlSeeAlso({
- org.uddi.custody_v3.ObjectFactory.class,
- org.uddi.repl_v3.ObjectFactory.class,
- org.uddi.subr_v3.ObjectFactory.class,
- org.uddi.api_v3.ObjectFactory.class,
- org.uddi.vscache_v3.ObjectFactory.class,
- org.uddi.vs_v3.ObjectFactory.class,
- org.uddi.sub_v3.ObjectFactory.class,
- org.w3._2000._09.xmldsig_.ObjectFactory.class,
- org.uddi.policy_v3.ObjectFactory.class,
- org.uddi.policy_v3_instanceparms.ObjectFactory.class
-})
+
+@WebService(serviceName="UDDISubscriptionListenerService",
+ endpointInterface="org.uddi.v3_service.UDDISubscriptionListenerPortType",
+ targetNamespace = "urn:uddi-org:v3_service")
public class SubscriptionCallbackListener implements org.uddi.v3_service.UDDISubscriptionListenerPortType, Runnable {
- /**
- * adds a shutdown hook to trap and warn about leaving the server running on
- * exit
- */
- public SubscriptionCallbackListener() {
- Runtime runtime = Runtime.getRuntime();
- runtime.addShutdownHook(new Thread(this));
- }
-
- /**
- * used for unit tests, may return null if the endpoint isn't started yet
- *
- * @return
- */
- protected static SubscriptionCallbackListener getInstance() {
- return instance;
- }
- private static final Log log = LogFactory.getLog(SubscriptionCallbackListener.class);
- private static List<ISubscriptionCallback> callbacks = new ArrayList<ISubscriptionCallback>();
- private static SubscriptionCallbackListener instance = null;
- private static Endpoint ep = null;
-
- /**
- * Starts a embedded Jetty web server (comes with the JDK) using the
- * Endpoint API.
- *
- * @param endpoint this is the url that a UDDI server would use to connect
- * to the client's subscription listener service Recommend specifying a port
- * that is firewall friendly
- * @param callbackBusinessService - optional. if specified, a binding
- * template is appended to the business service and returned. The new
- * binding template is annotated for subscription callbacks.
- * @return null, if and only if callbackBusinessService was null, otherwise
- * the modified callbackBusinessService is returned. Clients can then use it
- * to continue the registration process.
- * @throws ServiceAlreadyStartedException
- * @throws SecurityException
- * @see Endpoint
- */
- public static synchronized BindingTemplate start(UDDIClient client, String cfg_node_name, String endpoint,
- String keydomain, boolean autoregister, String serviceKey,
- SignatureBehavior behavior) throws ServiceAlreadyStartedException, SecurityException, ConfigurationException, TransportException, DispositionReportFaultMessage, RemoteException, UnexpectedException, RegistrationAbortedException, UnableToSignException, MalformedURLException {
-
-
- if (instance == null) {
- instance = new SubscriptionCallbackListener();
- }
-
- if (ep != null && ep.isPublished()) {
- throw new ServiceAlreadyStartedException();
+ /**
+ * adds a shutdown hook to trap and warn about leaving the server
+ * running on exit
+ */
+ public SubscriptionCallbackListener() {
+ Runtime runtime = Runtime.getRuntime();
+ runtime.addShutdownHook(new Thread(this));
}
-
- URL url = null;
- try {
- url = new URL(endpoint);
- } catch (Exception ex) {
- log.warn("Callback endpoint couldn't be parsed, generating a random one: " + ex.getMessage());
- url = new URL("http://" + GetHostname() + ":" + GetRandomPort(4000) + "/" + UUID.randomUUID().toString());
+ /**
+ * used for unit tests, may return null if the endpoint isn't started
+ * yet
+ *
+ * @return
+ */
+ protected static SubscriptionCallbackListener getInstance() {
+ return instance;
}
- endpoint = url.toString();
+ private static final Log log = LogFactory.getLog(SubscriptionCallbackListener.class);
+ private static List<ISubscriptionCallback> callbacks = new ArrayList<ISubscriptionCallback>();
+ private static SubscriptionCallbackListener instance = null;
+ private static Endpoint ep = null;
+
+ /**
+ * Starts a embedded Jetty web server (comes with the JDK) using the
+ * Endpoint API.
+ *
+ * @param client
+ * @param cfg_node_name
+ * @param endpoint this is the url that a UDDI server would use to
+ * connect to the client's subscription listener service Recommend
+ * specifying a port that is firewall friendly
+ * @param keydomain
+ * @param callbackBusinessService - optional. if specified, a binding
+ * template is appended to the business service and returned. The new
+ * binding template is annotated for subscription callbacks.
+ * @param autoregister
+ * @param behavior
+ * @param serviceKey
+ * @return null, if and only if callbackBusinessService was null,
+ * otherwise the modified callbackBusinessService is returned. Clients
+ * can then use it to continue the registration process.
+ * @throws ServiceAlreadyStartedException
+ * @throws SecurityException
+ * @see Endpoint
+ */
+ public static synchronized BindingTemplate start(UDDIClient client, String cfg_node_name, String endpoint,
+ String keydomain, boolean autoregister, String serviceKey,
+ SignatureBehavior behavior) throws ServiceAlreadyStartedException, SecurityException, ConfigurationException, TransportException, DispositionReportFaultMessage, RemoteException, UnexpectedException, RegistrationAbortedException, UnableToSignException, MalformedURLException {
+
+ if (instance == null) {
+ instance = new SubscriptionCallbackListener();
+ }
+
+ if (ep != null && ep.isPublished()) {
+ throw new ServiceAlreadyStartedException();
+ }
+
+ URL url = null;
+ try {
+ url = new URL(endpoint);
+ } catch (Exception ex) {
+ log.warn("Callback endpoint couldn't be parsed, generating a random one: " + ex.getMessage());
+ url = new URL("http://" + GetHostname() + ":" + GetRandomPort(4000) + "/" + UUID.randomUUID().toString());
+ }
+ endpoint = url.toString();
//if (endpoint == null || endpoint.equals("")) {
- // endpoint = "http://" + GetHostname() + ":" + GetRandomPort(url.getPort()) + "/" + UUID.randomUUID().toString();
+ // endpoint = "http://" + GetHostname() + ":" + GetRandomPort(url.getPort()) + "/" + UUID.randomUUID().toString();
+
+ int attempts = 5;
+ if (ep == null) {
+ while ((ep == null || !ep.isPublished()) && attempts > 0) {
+ try {
+ ep = Endpoint.publish(endpoint, instance);
+ callback = endpoint;
+ } catch (Exception be) {
+ log.info("trouble starting callback at " + endpoint + ", trying again with a random port: " + be.getMessage());
+ log.debug(be);
+ attempts--;
+ //if (be instanceof java.net.BindException) {
+ url = new URL("http://" + url.getHost() + ":" + GetRandomPort(url.getPort()) + "/" + url.getPath());
+ endpoint = url.toString();
+
+ }
+ }
+ }
+ if (ep == null || !ep.isPublished()) {
+ log.warn("Unable to start callback endpoint, aborting");
+ throw new SecurityException("unable to start endpoint, view previous errors for reason");
+ }
+
+ log.info("Endpoint started at " + callback);
+
+ BindingTemplate bt = new BindingTemplate();
+ bt.setAccessPoint(new AccessPoint());
+ 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);
+ bt.setServiceKey(serviceKey);
+ if (keydomain.endsWith(":")) {
+ bt.setBindingKey(keydomain + GetHostname() + "_subscription_callback");
+ } else {
+ bt.setBindingKey(keydomain + ":" + GetHostname() + "_subscription_callback");
+ }
+
+ if (autoregister) {
+ bt = registerBinding(client, cfg_node_name, bt, behavior);
+ }
+
+ return bt;
+
+ }
+
+ /**
+ * Starts a subscription callback service using the juddi client config
+ * file's settings
+ *
+ * @param client
+ * @param cfg_node_name - this is the uddi/client@name
+ * @return a bindingtemplate populated with the relevant information for
+ * most UDDI servers for asynchronous callbacks.
+ * @throws ServiceAlreadyStartedException
+ * @throws SecurityException
+ * @throws ConfigurationException
+ * @throws TransportException
+ * @throws DispositionReportFaultMessage
+ * @throws UnexpectedException
+ * @throws RemoteException
+ */
+ public static synchronized BindingTemplate start(UDDIClient client, String cfg_node_name) throws ServiceAlreadyStartedException, SecurityException, ConfigurationException, TransportException, DispositionReportFaultMessage, UnexpectedException, RemoteException, RegistrationAbortedException, UnableToSignException, MalformedURLException {
+
+ boolean reg = (client.getClientConfig().getConfiguration().getBoolean(PROPERTY_AUTOREG_BT, false));
+ String endpoint = client.getClientConfig().getConfiguration().getString(PROPERTY_LISTENURL);
+ String kd = client.getClientConfig().getConfiguration().getString(PROPERTY_KEYDOMAIN);
+ String key = client.getClientConfig().getConfiguration().getString(PROPERTY_AUTOREG_SERVICE_KEY);
+ String sbs = client.getClientConfig().getConfiguration().getString(PROPERTY_SIGNATURE_BEHAVIOR);
+ SignatureBehavior sb = SignatureBehavior.DoNothing;
+ try {
+ sb = SignatureBehavior.valueOf(sbs);
+ } catch (Exception ex) {
+ log.warn("Unable to parse config setting for SignatureBehavior, defaulting to DoNothing", ex);
+ }
+
+ return start(client, cfg_node_name, endpoint, kd, reg, key, sb);
+ }
+ private static String callback = null;
+
+ /**
+ * gets the current callback url, may be null if the endpoint isn't
+ * started yet
+ *
+ * @return
+ */
+ public static String getCallbackURL() {
+ return callback;
+
+ }
+
+ /**
+ * Registers an implementation of ISubscriptionCallback for subscription
+ * callbacks from a UDDI server.
+ *
+ *
+ * @param callback if null, no action is taken
+ */
+ public static synchronized void registerCallback(ISubscriptionCallback callback) {
+ if (callback != null) {
+ if (!callbacks.contains(callback)) {
+ callbacks.add(callback);
+ }
+ }
+ }
+
+ /**
+ * unregisters a ISubscriptionCallback for callbacks
+ *
+ * @param callback if null, no action is taken
+ */
+ public static synchronized void unRegisterCallback(ISubscriptionCallback callback) {
+ if (callback != null) {
+ if (callbacks.contains(callback)) {
+ callbacks.remove(callback);
+ }
+ }
+ }
+ /**
+ * config parameter
+ */
+ public static final String PROPERTY_LISTENURL = "client.subscriptionCallbacks.listenUrl";
+ /**
+ * config parameter
+ */
+ public static final String PROPERTY_KEYDOMAIN = "client.subscriptionCallbacks.keyDomain";
+ /**
+ * config parameter true/false
+ */
+ public static final String PROPERTY_AUTOREG_BT = "client.subscriptionCallbacks.autoRegisterBindingTemplate";
+ /**
+ * config parameter business key
+ */
+ public static final String PROPERTY_AUTOREG_SERVICE_KEY = "client.subscriptionCallbacks.autoRegisterBusinessServiceKey";
+ /**
+ * config parameter
+ *
+ * @see SignatureBehavior
+ */
+ public static final String PROPERTY_SIGNATURE_BEHAVIOR = "client.subscriptionCallbacks.signatureBehavior";
- int attempts = 5;
- if (ep == null) {
- while ((ep == null || !ep.isPublished()) && attempts > 0) {
+ /**
+ * return true if and only if the binding exists and is signed
+ *
+ * @param bindingKey
+ * @param uddiInquiryService
+ * @param token
+ * @param behavior
+ * @return
+ */
+ private static boolean CheckExistingBindingForSignature(String bindingKey, UDDIInquiryPortType uddiInquiryService, String token, SignatureBehavior behavior) {
+ GetBindingDetail gbd = new GetBindingDetail();
+ gbd.setAuthInfo(token);
+ gbd.getBindingKey().add(bindingKey);
try {
- ep = Endpoint.publish(endpoint, instance);
- callback = endpoint;
- } catch (Exception be) {
- log.info("trouble starting callback at " + endpoint + ", trying again with a random port: " + be.getMessage());
- log.debug(be);
- attempts--;
- //if (be instanceof java.net.BindException) {
- url = new URL("http://" + url.getHost() + ":" + GetRandomPort(url.getPort()) + "/" + url.getPath());
- endpoint = url.toString();
-
- }
- }
- }
- if (ep == null || !ep.isPublished()) {
- log.warn("Unable to start callback endpoint, aborting");
- throw new SecurityException("unable to start endpoint, view previous errors for reason");
- }
-
- log.info("Endpoint started at " + callback);
-
- BindingTemplate bt = new BindingTemplate();
- bt.setAccessPoint(new AccessPoint());
- 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);
- bt.setServiceKey(serviceKey);
- if (keydomain.endsWith(":")) {
- bt.setBindingKey(keydomain + GetHostname() + "_Subscription_Callback");
- } else {
- bt.setBindingKey(keydomain + ":" + GetHostname() + "_Subscription_Callback");
- }
-
- if (autoregister) {
- bt = registerBinding(client, cfg_node_name, bt, behavior);
- }
-
- return bt;
-
- }
-
- /**
- * Starts a subscription callback service using the juddi client config
- * file's settings
- *
- * @param client
- * @param cfg_node_name - this is the uddi/client@name
- * @return a bindingtemplate populated with the relevant information for
- * most UDDI servers for asynchronous callbacks.
- * @throws ServiceAlreadyStartedException
- * @throws SecurityException
- * @throws ConfigurationException
- * @throws TransportException
- * @throws DispositionReportFaultMessage
- * @throws UnexpectedException
- * @throws RemoteException
- */
- public static synchronized BindingTemplate start(UDDIClient client, String cfg_node_name) throws ServiceAlreadyStartedException, SecurityException, ConfigurationException, TransportException, DispositionReportFaultMessage, UnexpectedException, RemoteException, RegistrationAbortedException, UnableToSignException, MalformedURLException {
-
- boolean reg = (client.getClientConfig().getConfiguration().getBoolean(PROPERTY_AUTOREG_BT, false));
- String endpoint = client.getClientConfig().getConfiguration().getString(PROPERTY_LISTENURL);
- String kd = client.getClientConfig().getConfiguration().getString(PROPERTY_KEYDOMAIN);
- String key = client.getClientConfig().getConfiguration().getString(PROPERTY_AUTOREG_SERVICE_KEY);
- String sbs = client.getClientConfig().getConfiguration().getString(PROPERTY_SIGNATURE_BEHAVIOR);
- SignatureBehavior sb = SignatureBehavior.DoNothing;
- try {
- sb = SignatureBehavior.valueOf(sbs);
- } catch (Exception ex) {
- log.warn("Unable to parse config setting for SignatureBehavior, defaulting to DoNothing", ex);
- }
-
- return start(client, cfg_node_name, endpoint, kd, reg, key, sb);
- }
- private static String callback = null;
-
- /**
- * gets the current callback url, may be null if the endpoint isn't started
- * yet
- *
- * @return
- */
- public static String getCallbackURL() {
- return callback;
-
- }
-
- /**
- * Registers an implementation of ISubscriptionCallback for subscription
- * callbacks from a UDDI server.
- *
- *
- * @param callback if null, no action is taken
- */
- public static synchronized void registerCallback(ISubscriptionCallback callback) {
- if (callback != null) {
- if (!callbacks.contains(callback)) {
- callbacks.add(callback);
- }
- }
- }
-
- /**
- * unregisters a ISubscriptionCallback for callbacks
- *
- * @param callback if null, no action is taken
- */
- public static synchronized void unRegisterCallback(ISubscriptionCallback callback) {
- if (callback != null) {
- if (callbacks.contains(callback)) {
- callbacks.remove(callback);
- }
- }
- }
- /**
- * config parameter
- */
- public static final String PROPERTY_LISTENURL = "client.subscriptionCallbacks.listenUrl";
- /**
- * config parameter
- */
- public static final String PROPERTY_KEYDOMAIN = "client.subscriptionCallbacks.keyDomain";
- /**
- * config parameter true/false
- */
- public static final String PROPERTY_AUTOREG_BT = "client.subscriptionCallbacks.autoRegisterBindingTemplate";
- /**
- * config parameter business key
- */
- public static final String PROPERTY_AUTOREG_SERVICE_KEY = "client.subscriptionCallbacks.autoRegisterBusinessServiceKey";
- /**
- * config parameter
- *
- * @see SignatureBehavior
- */
- public static final String PROPERTY_SIGNATURE_BEHAVIOR = "client.subscriptionCallbacks.signatureBehavior";
-
- /**
- * return true if and only if the binding exists and is signed
- *
- * @param bindingKey
- * @param uddiInquiryService
- * @param token
- * @param behavior
- * @return
- */
- private static boolean CheckExistingBindingForSignature(String bindingKey, UDDIInquiryPortType uddiInquiryService, String token, SignatureBehavior behavior) {
- GetBindingDetail gbd = new GetBindingDetail();
- gbd.setAuthInfo(token);
- gbd.getBindingKey().add(bindingKey);
- try {
- BindingDetail bindingDetail = uddiInquiryService.getBindingDetail(gbd);
- if (bindingDetail != null
- && !bindingDetail.getBindingTemplate().isEmpty()
- && !bindingDetail.getBindingTemplate().get(0).getSignature().isEmpty()) {
- log.info("the binding template with key=" + bindingKey + " exists and is digitally signed");
- }
- return true;
- } catch (Exception ex) {
- log.debug("Error caught checking for the existence of and if a signature is present for binding key " + bindingKey + " this may be ignorable", ex);
- }
- return false;
- }
-
- private static boolean CheckServiceAndParentForSignature(String serviceKey, UDDIInquiryPortType uddiInquiryService, String token) throws UnexpectedResponseException {
- GetServiceDetail gsd = new GetServiceDetail();
- gsd.setAuthInfo(token);
- gsd.getServiceKey().add(serviceKey);
- String bizkey = null;
- try {
- ServiceDetail serviceDetail = uddiInquiryService.getServiceDetail(gsd);
- if (serviceDetail != null) {
- if (!serviceDetail.getBusinessService().isEmpty()) {
- bizkey = serviceDetail.getBusinessService().get(0).getBusinessKey();
- if (!serviceDetail.getBusinessService().get(0).getSignature().isEmpty()) {
- log.info("the service with key=" + serviceKey + " exists and is digitally signed");
+ BindingDetail bindingDetail = uddiInquiryService.getBindingDetail(gbd);
+ if (bindingDetail != null
+ && !bindingDetail.getBindingTemplate().isEmpty()
+ && !bindingDetail.getBindingTemplate().get(0).getSignature().isEmpty()) {
+ log.info("the binding template with key=" + bindingKey + " exists and is digitally signed");
+ }
return true;
- }
+ } catch (Exception ex) {
+ log.debug("Error caught checking for the existence of and if a signature is present for binding key " + bindingKey + " this may be ignorable", ex);
}
- }
- } catch (Exception ex) {
- log.info("Error caught checking for the existence of and if a signature is present for service key " + serviceKey, ex);
- throw new UnexpectedResponseException("Error caught checking for the existence of and if a signature is present for service key " + serviceKey, ex);
- }
- if (bizkey == null) {
- throw new UnexpectedResponseException("The service with key " + serviceKey + " parent's business key could not be determined. This is unexpected");
- }
- GetBusinessDetail gbd = new GetBusinessDetail();
- gbd.setAuthInfo(token);
- gbd.getBusinessKey().add(bizkey);
- try {
- BusinessDetail businessDetail = uddiInquiryService.getBusinessDetail(gbd);
- if (businessDetail != null && !businessDetail.getBusinessEntity().isEmpty()) {
- if (!businessDetail.getBusinessEntity().get(0).getSignature().isEmpty()) {
- log.info("the business with key=" + bizkey + " exists and is digitally signed");
- return true;
- }
- }
- } catch (Exception ex) {
- log.info("Error caught checking for the existence of and if a signature is present for business key " + bizkey, ex);
- throw new UnexpectedResponseException("Error caught checking for the existence of and if a signature is present for business key " + bizkey, ex);
- }
- return false;
- }
-
- private static int GetRandomPort(int oldport) {
- if (oldport <= 0) {
- oldport = 4000;
- }
- return oldport + new Random().nextInt(99);
-
- }
-
- @Override
- protected void finalize() throws Throwable {
- run();
- super.finalize();
-
- }
-
- /**
- * shutdown hook
- */
- @Override
- public void run() {
- shutdown();
- }
-
- private synchronized void shutdown() {
- if (ep != null && !ep.isPublished()) {
- log.fatal("Hey, someone should tell the developer to call SubscriptionCallbackListern.stop(...) before ending the program. Stopping endpoint at " + callback);
- unregisterAllCallbacks();
- ep.stop();
- ep = null;
- callback = null;
- }
-
- }
-
- /**
- * This defines how the automatic subscription binding template is suppose
- * to behave
- */
- public enum SignatureBehavior {
-
- /**
- * Aborts the save request if either the entity exists and is already
- * signed, or if any parent uddi element is signed
- */
- AbortIfSigned,
- /**
- * Signs this element. Warning: It may cause signatures of parent
- * elements to become invalid. If unable to sign, an exception will be
- * thrown
- */
- SignAlways,
- /**
- * Signs this element, but only if parents are not signed. If unable to
- * sign, an exception will be thrown
- */
- SignOnlyIfParentIsntSigned,
- /**
- * Do nothing, don't sign it and don't check if a parent item is signed
- * or not.
- */
- DoNothing
- }
-
- /**
- * Registers a UDDI binding template that represents the subscription
- * callback endpoint
- *
- * @param client
- * @param cfg_node_name
- * @param bt - Binding Template
- * @param behavior
- * @return
- * @throws ServiceAlreadyStartedException
- * @throws SecurityException
- * @throws ConfigurationException
- * @throws TransportException
- * @throws DispositionReportFaultMessage
- * @throws RemoteException
- * @throws UnexpectedException
- * @throws RegistrationAbortedException
- * @throws UnableToSignException
- */
- public static BindingTemplate registerBinding(UDDIClient client, String cfg_node_name, BindingTemplate bt, SignatureBehavior behavior) throws ServiceAlreadyStartedException, SecurityException, ConfigurationException, TransportException, DispositionReportFaultMessage, RemoteException, UnexpectedException, RegistrationAbortedException, UnableToSignException {
-
- UDDIClerk clerk = client.getClerk(cfg_node_name);
- Transport tp = client.getTransport(cfg_node_name);
- UDDIInquiryPortType uddiInquiryService = tp.getUDDIInquiryService();
- UDDIPublicationPortType uddiPublishService = tp.getUDDIPublishService();
-
-
- String token = clerk.getAuthToken(clerk.getUDDINode().getSecurityUrl());
-
- switch (behavior) {
- case AbortIfSigned:
- if (CheckExistingBindingForSignature(bt.getBindingKey(), uddiInquiryService, token, behavior)) {
- throw new RegistrationAbortedException("Aborting, Either the item exists and is signed");
- }
- if (CheckServiceAndParentForSignature(bt.getServiceKey(), uddiInquiryService, token)) {
- throw new RegistrationAbortedException("Aborting, Either the service or busness is signed");
- }
- break;
- case DoNothing:
- break;
- case SignAlways:
+ return false;
+ }
+
+ private static boolean CheckServiceAndParentForSignature(String serviceKey, UDDIInquiryPortType uddiInquiryService, String token) throws UnexpectedResponseException {
+ GetServiceDetail gsd = new GetServiceDetail();
+ gsd.setAuthInfo(token);
+ gsd.getServiceKey().add(serviceKey);
+ String bizkey = null;
try {
- DigSigUtil ds = new DigSigUtil(client.getClientConfig().getDigitalSignatureConfiguration());
- bt = ds.signUddiEntity(bt);
+ ServiceDetail serviceDetail = uddiInquiryService.getServiceDetail(gsd);
+ if (serviceDetail != null) {
+ if (!serviceDetail.getBusinessService().isEmpty()) {
+ bizkey = serviceDetail.getBusinessService().get(0).getBusinessKey();
+ if (!serviceDetail.getBusinessService().get(0).getSignature().isEmpty()) {
+ log.info("the service with key=" + serviceKey + " exists and is digitally signed");
+ return true;
+ }
+ }
+ }
} catch (Exception ex) {
- log.error("Unable to sign", ex);
- throw new UnableToSignException(ex);
+ log.info("Error caught checking for the existence of and if a signature is present for service key " + serviceKey, ex);
+ throw new UnexpectedResponseException("Error caught checking for the existence of and if a signature is present for service key " + serviceKey, ex);
+ }
+ if (bizkey == null) {
+ throw new UnexpectedResponseException("The service with key " + serviceKey + " parent's business key could not be determined. This is unexpected");
+ }
+ GetBusinessDetail gbd = new GetBusinessDetail();
+ gbd.setAuthInfo(token);
+ gbd.getBusinessKey().add(bizkey);
+ try {
+ BusinessDetail businessDetail = uddiInquiryService.getBusinessDetail(gbd);
+ if (businessDetail != null && !businessDetail.getBusinessEntity().isEmpty()) {
+ if (!businessDetail.getBusinessEntity().get(0).getSignature().isEmpty()) {
+ log.info("the business with key=" + bizkey + " exists and is digitally signed");
+ return true;
+ }
+ }
+ } catch (Exception ex) {
+ log.info("Error caught checking for the existence of and if a signature is present for business key " + bizkey, ex);
+ throw new UnexpectedResponseException("Error caught checking for the existence of and if a signature is present for business key " + bizkey, ex);
+ }
+ return false;
+ }
+
+ private static int GetRandomPort(int oldport) {
+ if (oldport <= 0) {
+ oldport = 4000;
}
+ return oldport + new Random().nextInt(99);
+
+ }
+
+ @Override
+ protected void finalize() throws Throwable {
+ run();
+ super.finalize();
+
+ }
+
+ /**
+ * shutdown hook
+ */
+ @Override
+ public void run() {
+ shutdown();
+ }
+
+ private synchronized void shutdown() {
+ if (ep != null && !ep.isPublished()) {
+ log.fatal("Hey, someone should tell the developer to call SubscriptionCallbackListern.stop(...) before ending the program. Stopping endpoint at " + callback);
+ unregisterAllCallbacks();
+ ep.stop();
+ ep = null;
+ callback = null;
+ }
+
+ }
+
+ /**
+ * This defines how the automatic subscription binding template is
+ * suppose to behave
+ */
+ public enum SignatureBehavior {
+
+ /**
+ * Aborts the save request if either the entity exists and is
+ * already signed, or if any parent uddi element is signed
+ */
+ AbortIfSigned,
+ /**
+ * Signs this element. Warning: It may cause signatures of
+ * parent elements to become invalid. If unable to sign, an
+ * exception will be thrown
+ */
+ SignAlways,
+ /**
+ * Signs this element, but only if parents are not signed. If
+ * unable to sign, an exception will be thrown
+ */
+ SignOnlyIfParentIsntSigned,
+ /**
+ * Do nothing, don't sign it and don't check if a parent item is
+ * signed or not.
+ */
+ DoNothing
+ }
+
+ /**
+ * Registers a UDDI binding template that represents the subscription
+ * callback endpoint
+ *
+ * @param client
+ * @param cfg_node_name
+ * @param bt - Binding Template
+ * @param behavior
+ * @return
+ * @throws ServiceAlreadyStartedException
+ * @throws SecurityException
+ * @throws ConfigurationException
+ * @throws TransportException
+ * @throws DispositionReportFaultMessage
+ * @throws RemoteException
+ * @throws UnexpectedException
+ * @throws RegistrationAbortedException
+ * @throws UnableToSignException
+ */
+ public static BindingTemplate registerBinding(UDDIClient client, String cfg_node_name, BindingTemplate bt, SignatureBehavior behavior) throws ServiceAlreadyStartedException, SecurityException, ConfigurationException, TransportException, DispositionReportFaultMessage, RemoteException, UnexpectedException, RegistrationAbortedException, UnableToSignException {
- break;
- case SignOnlyIfParentIsntSigned:
- if (!CheckServiceAndParentForSignature(bt.getServiceKey(), uddiInquiryService, token)) {
- try {
- DigSigUtil ds = new DigSigUtil(client.getClientConfig().getDigitalSignatureConfiguration());
- bt = ds.signUddiEntity(bt);
- } catch (Exception ex) {
- log.error("Unable to sign", ex);
- throw new UnableToSignException(ex);
- }
- }
- break;
- }
- SaveBinding sb = new SaveBinding();
- sb.setAuthInfo(token);
- sb.getBindingTemplate().add(bt);
-
- BindingDetail saveBinding = uddiPublishService.saveBinding(sb);
- if (saveBinding.getBindingTemplate().isEmpty() || saveBinding.getBindingTemplate().size() > 1) {
- throw new UnexpectedResponseException("The number of binding templates returned was unexpected, count=" + saveBinding.getBindingTemplate().size());
- }
- return saveBinding.getBindingTemplate().get(0);
- }
-
- protected static synchronized void unregisterAllCallbacks() {
- if (callbacks != null) {
- log.info("Notifying all subscribing classes, count=" + callbacks.size());
- for (int i = 0; i < callbacks.size(); i++) {
- if (callbacks.get(i) != null) {
- try {
- callbacks.get(i).NotifyEndpointStopped();
- } catch (Exception ex) {
- log.warn("Your implementation on ISubscriptionCallback is faulty and threw an error, contact the developer", ex);
- }
- }
- }
- callbacks.clear();
- }
-
- }
-
- /**
- * This effectively stops the endpoint address and notifies all
- * ISubscriptionCallback clients that the endpoint as been stopped. After it
- * has been stopped, call ISubscriptionCallback are removed from the
- * callback list. If unable to remove an auto registered binding template,
- * no exception will be thrown
- */
- public static synchronized void stop(UDDIClient client, String cfg_node_name, String bindingKey) throws ConfigurationException {
- //stop the service
- if (ep != null && ep.isPublished()) {
- log.warn("Stopping jUDDI Subscription callback endpoint at " + callback);
- ep.stop();
- if (ep.isPublished()) {
- log.fatal("Unable to stop the endpoint. the port may be locked until this java process terminates");
- }
- ep = null;
- callback = null;
- }
- unregisterAllCallbacks();
- if (client.getClientConfig().getConfiguration().getBoolean(PROPERTY_AUTOREG_BT, false) && bindingKey != null) {
- log.info("Attempting to unregister the binding");
- try {
UDDIClerk clerk = client.getClerk(cfg_node_name);
Transport tp = client.getTransport(cfg_node_name);
- String token = clerk.getAuthToken(clerk.getUDDINode().getSecurityUrl());
+ UDDIInquiryPortType uddiInquiryService = tp.getUDDIInquiryService();
UDDIPublicationPortType uddiPublishService = tp.getUDDIPublishService();
- DeleteBinding db = new DeleteBinding();
- db.setAuthInfo(token);
- db.getBindingKey().add(bindingKey);
- uddiPublishService.deleteBinding(db);
- } catch (Exception ex) {
- log.error("Unable to unregister binding " + bindingKey, ex);
- }
+
+ String token = clerk.getAuthToken(clerk.getUDDINode().getSecurityUrl());
+
+ switch (behavior) {
+ case AbortIfSigned:
+ if (CheckExistingBindingForSignature(bt.getBindingKey(), uddiInquiryService, token, behavior)) {
+ throw new RegistrationAbortedException("Aborting, Either the item exists and is signed");
+ }
+ if (CheckServiceAndParentForSignature(bt.getServiceKey(), uddiInquiryService, token)) {
+ throw new RegistrationAbortedException("Aborting, Either the service or busness is signed");
+ }
+ break;
+ case DoNothing:
+ break;
+ case SignAlways:
+ try {
+ DigSigUtil ds = new DigSigUtil(client.getClientConfig().getDigitalSignatureConfiguration());
+ bt = ds.signUddiEntity(bt);
+ } catch (Exception ex) {
+ log.error("Unable to sign", ex);
+ throw new UnableToSignException(ex);
+ }
+
+ break;
+ case SignOnlyIfParentIsntSigned:
+ if (!CheckServiceAndParentForSignature(bt.getServiceKey(), uddiInquiryService, token)) {
+ try {
+ DigSigUtil ds = new DigSigUtil(client.getClientConfig().getDigitalSignatureConfiguration());
+ bt = ds.signUddiEntity(bt);
+ } catch (Exception ex) {
+ log.error("Unable to sign", ex);
+ throw new UnableToSignException(ex);
+ }
+ }
+ break;
+ }
+ SaveBinding sb = new SaveBinding();
+ sb.setAuthInfo(token);
+ sb.getBindingTemplate().add(bt);
+
+ BindingDetail saveBinding = uddiPublishService.saveBinding(sb);
+ if (saveBinding.getBindingTemplate().isEmpty() || saveBinding.getBindingTemplate().size() > 1) {
+ throw new UnexpectedResponseException("The number of binding templates returned was unexpected, count=" + saveBinding.getBindingTemplate().size());
+ }
+ return saveBinding.getBindingTemplate().get(0);
}
+ protected static synchronized void unregisterAllCallbacks() {
+ if (callbacks != null) {
+ log.info("Notifying all subscribing classes, count=" + callbacks.size());
+ for (int i = 0; i < callbacks.size(); i++) {
+ if (callbacks.get(i) != null) {
+ try {
+ callbacks.get(i).NotifyEndpointStopped();
+ } catch (Exception ex) {
+ log.warn("Your implementation on ISubscriptionCallback is faulty and threw an error, contact the developer", ex);
+ }
+ }
+ }
+ callbacks.clear();
+ }
+
+ }
+
+ /**
+ * This effectively stops the endpoint address and notifies all
+ * ISubscriptionCallback clients that the endpoint as been stopped.
+ * After it has been stopped, all ISubscriptionCallback are removed
+ * from the callback list. If the configuration file is set to automatically
+ * register binding templates, the binding template will be unregistered from
+ * the UDDI server
+ */
+ public static synchronized void stop(UDDIClient client, String cfg_node_name, String bindingKey) throws ConfigurationException {
+ //stop the service
+ if (ep != null && ep.isPublished()) {
+ log.warn("Stopping jUDDI Subscription callback endpoint at " + callback);
+ ep.stop();
+ if (ep.isPublished()) {
+ log.fatal("Unable to stop the endpoint. the port may be locked until this java process terminates");
+ }
+ ep = null;
+ callback = null;
+ }
+ unregisterAllCallbacks();
+ if (client.getClientConfig().getConfiguration().getBoolean(PROPERTY_AUTOREG_BT, false) && bindingKey != null) {
+
+ try {
+ UDDIClerk clerk = client.getClerk(cfg_node_name);
+ Transport tp = client.getTransport(cfg_node_name);
+ String token = clerk.getAuthToken(clerk.getUDDINode().getSecurityUrl());
+ UDDIPublicationPortType uddiPublishService = tp.getUDDIPublishService();
+ DeleteBinding db = new DeleteBinding();
+ db.setAuthInfo(token);
+ db.getBindingKey().add(bindingKey);
+ uddiPublishService.deleteBinding(db);
+ log.info("Subscription callback binding unregistered.");
+ } catch (Exception ex) {
+ log.error("Unable to unregister binding " + bindingKey, ex);
+ }
+ }
//TODO optionally kill the subscription?
- //get all subscriptions from the uddi node,
- //loop through and deduce which ones are pointed at this endpoint
- //then remove them
- }
-
- private static String GetHostname() {
- try {
- return java.net.InetAddress.getLocalHost().getHostName();
- } catch (UnknownHostException ex) {
- return "HOST_UNKNOWN";
- }
- }
-
- @Override
- public DispositionReport notifySubscriptionListener(NotifySubscriptionListener body) throws DispositionReportFaultMessage, RemoteException {
- for (int i = 0; i < callbacks.size(); i++) {
- try {
- callbacks.get(i).HandleCallback(body.getSubscriptionResultsList());
- } catch (Exception ex) {
- log.warn("Your implementation on ISubscriptionCallback is faulty and threw an error, contact the developer", ex);
- }
- }
- DispositionReport r = new DispositionReport();
- r.getResult().add(new Result());
- return r;
- }
+ //get all subscriptions from the uddi node,
+ //loop through and deduce which ones are pointed at this endpoint
+ //then remove them
+ }
+
+ private static String GetHostname() {
+ try {
+ return java.net.InetAddress.getLocalHost().getHostName();
+ } catch (UnknownHostException ex) {
+ return "HOST_UNKNOWN";
+ }
+ }
+
+ @Override
+ public DispositionReport notifySubscriptionListener(NotifySubscriptionListener body) throws DispositionReportFaultMessage, RemoteException {
+ for (int i = 0; i < callbacks.size(); i++) {
+ try {
+ callbacks.get(i).HandleCallback(body.getSubscriptionResultsList());
+ } catch (Exception ex) {
+ log.warn("Your implementation on ISubscriptionCallback is faulty and threw an error, contact the developer", ex);
+ }
+ }
+ DispositionReport r = new DispositionReport();
+ r.getResult().add(new Result());
+ return r;
+ }
}
Modified: juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/subscription/SubscriptionCallbackTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/subscription/SubscriptionCallbackTest.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/subscription/SubscriptionCallbackTest.java (original)
+++ juddi/trunk/juddi-client/src/test/java/org/apache/juddi/v3/client/subscription/SubscriptionCallbackTest.java Sun Jan 12 13:58:05 2014
@@ -20,11 +20,9 @@ import java.util.logging.Logger;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.juddi.v3.client.config.UDDIClerk;
import org.apache.juddi.v3.client.config.UDDIClient;
-import org.apache.juddi.v3.client.transport.TransportException;
import org.junit.Assert;
import org.junit.Test;
import org.uddi.api_v3.BindingTemplate;
-import org.uddi.api_v3.TModel;
import org.uddi.sub_v3.SubscriptionResultsList;
import org.uddi.subr_v3.NotifySubscriptionListener;
Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java Sun Jan 12 13:58:05 2014
@@ -74,10 +74,10 @@ import org.uddi.v3_service.UDDISubscript
/**
* Implements the jUDDI API service
-
+ *
* @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
* @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
-* @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
*/
@WebService(serviceName="JUDDIApiService",
endpointInterface="org.apache.juddi.v3_service.JUDDIApiPortType",
Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDICustodyTransferImpl.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDICustodyTransferImpl.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDICustodyTransferImpl.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDICustodyTransferImpl.java Sun Jan 12 13:58:05 2014
@@ -55,7 +55,10 @@ import org.uddi.custody_v3.KeyBag;
import org.uddi.custody_v3.TransferEntities;
import org.uddi.v3_service.DispositionReportFaultMessage;
import org.uddi.v3_service.UDDICustodyTransferPortType;
-
+/**
+ * This implements the UDDI v3 Custody Transfer API web service
+ *
+ */
@WebService(serviceName="UDDICustodyTransferService",
endpointInterface="org.uddi.v3_service.UDDICustodyTransferPortType",
targetNamespace = "urn:uddi-org:v3_service")
Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIInquiryImpl.java Sun Jan 12 13:58:05 2014
@@ -63,6 +63,7 @@ import org.uddi.v3_service.UDDIInquiryPo
/**
+ * This implements the UDDI v3 Inquiry API web service
* @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
*/
@WebService(serviceName="UDDIInquiryService",
Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java Sun Jan 12 13:58:05 2014
@@ -70,8 +70,6 @@ import org.apache.juddi.api.util.QuerySt
import org.apache.juddi.config.AppConfig;
import org.apache.juddi.config.PersistenceManager;
import org.apache.juddi.config.Property;
-import org.apache.juddi.model.Tmodel;
-import org.apache.juddi.model.UddiEntity;
import org.apache.juddi.query.util.DynamicQuery;
import org.apache.juddi.query.util.FindQualifiers;
Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java Sun Jan 12 13:58:05 2014
@@ -39,6 +39,10 @@ import org.uddi.v3_service.UDDIReplicati
//@WebService(serviceName="UDDIReplicationService",
// endpointInterface="org.uddi.v3_service.UDDIReplicationPortType",
// targetNamespace = "urn:uddi-org:v3_service")
+/**
+ * This implements the UDDI v3 Replication API web service. It is not complete
+ *
+ */
public class UDDIReplicationImpl extends AuthenticatedService implements UDDIReplicationPortType {
private static Log log = LogFactory.getLog(UDDIReplicationImpl.class);
private UDDIServiceCounter serviceCounter;
Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java Sun Jan 12 13:58:05 2014
@@ -78,7 +78,6 @@ import org.uddi.v3_service.DispositionRe
import org.uddi.v3_service.UDDISubscriptionPortType;
/**
- *
* This is jUDDI's implementation of the UDDIv3 Subscription API
*/
@WebService(serviceName="UDDISubscriptionService",
Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionListenerImpl.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionListenerImpl.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionListenerImpl.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionListenerImpl.java Sun Jan 12 13:58:05 2014
@@ -41,6 +41,11 @@ import org.uddi.subr_v3.NotifySubscripti
import org.uddi.v3_service.DispositionReportFaultMessage;
import org.uddi.v3_service.UDDISubscriptionListenerPortType;
+/**
+ * This class implements the UDDI v3 Subscription Listener API (server side)
+ * for jUDDI. It is primarily used for server to server subscriptions.
+ *
+ */
@WebService(serviceName="UDDISubscriptionListenerService",
endpointInterface="org.uddi.v3_service.UDDISubscriptionListenerPortType",
targetNamespace = "urn:uddi-org:v3_service")
Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetCachingImpl.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetCachingImpl.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetCachingImpl.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetCachingImpl.java Sun Jan 12 13:58:05 2014
@@ -35,6 +35,11 @@ import org.uddi.vscache_v3.ValidValue;
//@WebService(serviceName="UDDIValueSetCachingService",
// endpointInterface="org.uddi.v3_service.UDDIValueSetCachingPortType",
// targetNamespace = "urn:uddi-org:v3_service")
+
+/**
+ * This implements the UDDIv3 Value Set Caching API. It is not complete
+ *
+ */
public class UDDIValueSetCachingImpl extends AuthenticatedService implements UDDIValueSetCachingPortType {
private static Log logger = LogFactory.getLog(UDDIValueSetCachingImpl.class);
Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetValidationImpl.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetValidationImpl.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetValidationImpl.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIValueSetValidationImpl.java Sun Jan 12 13:58:05 2014
@@ -33,6 +33,10 @@ import org.uddi.vs_v3.ValidateValues;
//@WebService(serviceName="UDDIValueSetValidationService",
// endpointInterface="org.uddi.v3_service.UDDIValueSetValidationPortType",
// targetNamespace = "urn:uddi-org:v3_service")
+/**
+ * This implements the UDDIv3 Value Set Validation API. It is not complete
+ *
+ */
public class UDDIValueSetValidationImpl extends AuthenticatedService implements
UDDIValueSetValidationPortType {
private static Log logger = LogFactory.getLog(UDDIValueSetValidationImpl.class);
Modified: juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java (original)
+++ juddi/trunk/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java Sun Jan 12 13:58:05 2014
@@ -401,7 +401,7 @@ public class SubscriptionNotifier extend
//} else {
//log.warn("Unexpected WebServiceException " + e.getMessage() + e.getCause());
}
- log.warn("Unexpected notification exception:" + e.getMessage() + e.getCause());
+ log.warn("Unexpected notification exception:" + e.getMessage() + e.getCause(),e);
}
} else {
log.info("Binding " + bindingTemplate.getEntityKey() + " has an unsupported binding type of "
Modified: juddi/trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_090_SubscriptionListenerIntegrationTest.java
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_090_SubscriptionListenerIntegrationTest.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_090_SubscriptionListenerIntegrationTest.java (original)
+++ juddi/trunk/juddi-core/src/test/java/org/apache/juddi/api/impl/API_090_SubscriptionListenerIntegrationTest.java Sun Jan 12 13:58:05 2014
@@ -45,7 +45,7 @@ import com.dumbster.smtp.SmtpMessage;
*/
public class API_090_SubscriptionListenerIntegrationTest
{
- private static Log logger = LogFactory.getLog(API_090_SubscriptionListenerIntegrationTest.class);
+ private static final Log logger = LogFactory.getLog(API_090_SubscriptionListenerIntegrationTest.class);
private static API_010_PublisherTest api010 = new API_010_PublisherTest();
private static TckTModel tckTModel = new TckTModel(new UDDIPublicationImpl(), new UDDIInquiryImpl());
private static TckBusiness tckBusiness = new TckBusiness(new UDDIPublicationImpl(), new UDDIInquiryImpl());
Modified: juddi/trunk/juddi-core/src/test/resources/META-INF/uddi.xml
URL: http://svn.apache.org/viewvc/juddi/trunk/juddi-core/src/test/resources/META-INF/uddi.xml?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/juddi-core/src/test/resources/META-INF/uddi.xml (original)
+++ juddi/trunk/juddi-core/src/test/resources/META-INF/uddi.xml Sun Jan 12 13:58:05 2014
@@ -1,74 +1,74 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<uddi xmlns="urn:juddi-apache-org:v3_client" xsi:schemaLocation="classpath:/xsd/uddi-client.xsd">
- <reloadDelay>5000</reloadDelay>
- <client name="juddi-core-unittest-client">
- <nodes>
- <node isHomeJUDDI="true">
- <!-- required 'default' node -->
- <name>default</name>
- <description>InVM jUDDI node</description>
- <properties>
- <property name="serverName" value="localhost" />
- <property name="serverPort" value="8080" />
- <!-- for UDDI nodes that use HTTP u/p, using the following
- <property name="basicAuthUsername" value="root" />
- <property name="basicAuthPassword" value="password" />
- <property name="basicAuthPasswordIsEncrypted" value="false" />
- <property name="basicAuthPasswordCryptoProvider" value="org.apache.juddi.v3.client.crypto.AES128Cryptor (an example)" />-->
- </properties>
- <!-- In VM Transport Settings -->
- <proxyTransport>org.apache.juddi.v3.client.transport.InVMTransport</proxyTransport>
- <custodyTransferUrl>org.apache.juddi.api.impl.UDDICustodyTransferImpl</custodyTransferUrl>
- <inquiryUrl>org.apache.juddi.api.impl.UDDIInquiryImpl</inquiryUrl>
- <inquiryRESTUrl>http://${serverName}:${serverPort}/juddiv3/services/inquiryRest</inquiryRESTUrl>
- <publishUrl>org.apache.juddi.api.impl.UDDIPublicationImpl</publishUrl>
- <securityUrl>org.apache.juddi.api.impl.UDDISecurityImpl</securityUrl>
- <subscriptionUrl>org.apache.juddi.api.impl.UDDISubscriptionImpl</subscriptionUrl>
- <subscriptionListenerUrl>org.apache.juddi.api.impl.UDDISubscriptionListenerImpl</subscriptionListenerUrl>
- <juddiApiUrl>org.apache.juddi.api.impl.JUDDIApiImpl</juddiApiUrl>
- </node>
- </nodes>
- <clerks registerOnStartup="false">
- <clerk name="joe" node="default" publisher="joepublisher" password="joepublisher" isPasswordEncrypted="false" cryptoProvider="">
- <wsdl businessKey="uddi:uddi.joepublisher.com:businessone">wsdl/sample.wsdl</wsdl>
- </clerk>
+ <reloadDelay>5000</reloadDelay>
+ <client name="juddi-core-unittest-client">
+ <nodes>
+ <node isHomeJUDDI="true">
+ <!-- required 'default' node -->
+ <name>default</name>
+ <description>InVM jUDDI node</description>
+ <properties>
+ <property name="serverName" value="localhost" />
+ <property name="serverPort" value="8080" />
+ <!-- for UDDI nodes that use HTTP u/p, using the following
+ <property name="basicAuthUsername" value="root" />
+ <property name="basicAuthPassword" value="password" />
+ <property name="basicAuthPasswordIsEncrypted" value="false" />
+ <property name="basicAuthPasswordCryptoProvider" value="org.apache.juddi.v3.client.crypto.AES128Cryptor (an example)" />-->
+ </properties>
+ <!-- In VM Transport Settings -->
+ <proxyTransport>org.apache.juddi.v3.client.transport.InVMTransport</proxyTransport>
+ <custodyTransferUrl>org.apache.juddi.api.impl.UDDICustodyTransferImpl</custodyTransferUrl>
+ <inquiryUrl>org.apache.juddi.api.impl.UDDIInquiryImpl</inquiryUrl>
+ <inquiryRESTUrl>http://${serverName}:${serverPort}/juddiv3/services/inquiryRest</inquiryRESTUrl>
+ <publishUrl>org.apache.juddi.api.impl.UDDIPublicationImpl</publishUrl>
+ <securityUrl>org.apache.juddi.api.impl.UDDISecurityImpl</securityUrl>
+ <subscriptionUrl>org.apache.juddi.api.impl.UDDISubscriptionImpl</subscriptionUrl>
+ <subscriptionListenerUrl>org.apache.juddi.api.impl.UDDISubscriptionListenerImpl</subscriptionListenerUrl>
+ <juddiApiUrl>org.apache.juddi.api.impl.JUDDIApiImpl</juddiApiUrl>
+ </node>
+ </nodes>
+ <clerks registerOnStartup="false">
+ <clerk name="joe" node="default" publisher="joepublisher" password="joepublisher" isPasswordEncrypted="false" cryptoProvider="">
+ <wsdl businessKey="uddi:uddi.joepublisher.com:businessone">wsdl/sample.wsdl</wsdl>
+ </clerk>
- </clerks>
- <signature>
- <!-- signing stuff -->
- <signingKeyStorePath>keystore.jks</signingKeyStorePath>
- <signingKeyStoreType>JKS</signingKeyStoreType>
- <signingKeyStoreFilePassword
- isPasswordEncrypted="false"
- cryptoProvider="org.apache.juddi.v3.client.crypto.AES128Cryptor">password</signingKeyStoreFilePassword>
- <signingKeyPassword
- isPasswordEncrypted="false"
- cryptoProvider="org.apache.juddi.v3.client.crypto.AES128Cryptor">password</signingKeyPassword>
- <signingKeyAlias>my special key</signingKeyAlias>
- <canonicalizationMethod>http://www.w3.org/2001/10/xml-exc-c14n#</canonicalizationMethod>
- <signatureMethod>RSA_SHA1</signatureMethod>
- <XML_DIGSIG_NS>http://www.w3.org/2000/09/xmldsig#</XML_DIGSIG_NS>
- <!-- validation stuff -->
- <trustStorePath>truststore.jks</trustStorePath>
- <trustStoreType>JKS</trustStoreType>
- <trustStorePassword
- isPasswordEncrypted="false"
- cryptoProvider="org.apache.juddi.v3.client.crypto.AES128Cryptor">password</trustStorePassword>
+ </clerks>
+ <signature>
+ <!-- signing stuff -->
+ <signingKeyStorePath>keystore.jks</signingKeyStorePath>
+ <signingKeyStoreType>JKS</signingKeyStoreType>
+ <signingKeyStoreFilePassword
+ isPasswordEncrypted="false"
+ cryptoProvider="org.apache.juddi.v3.client.crypto.AES128Cryptor">password</signingKeyStoreFilePassword>
+ <signingKeyPassword
+ isPasswordEncrypted="false"
+ cryptoProvider="org.apache.juddi.v3.client.crypto.AES128Cryptor">password</signingKeyPassword>
+ <signingKeyAlias>my special key</signingKeyAlias>
+ <canonicalizationMethod>http://www.w3.org/2001/10/xml-exc-c14n#</canonicalizationMethod>
+ <signatureMethod>RSA_SHA1</signatureMethod>
+ <XML_DIGSIG_NS>http://www.w3.org/2000/09/xmldsig#</XML_DIGSIG_NS>
+ <!-- validation stuff -->
+ <trustStorePath>truststore.jks</trustStorePath>
+ <trustStoreType>JKS</trustStoreType>
+ <trustStorePassword
+ isPasswordEncrypted="false"
+ cryptoProvider="org.apache.juddi.v3.client.crypto.AES128Cryptor">password</trustStorePassword>
- <checkTimestamps>true</checkTimestamps>
- <checkTrust>true</checkTrust>
- <checkRevocationCRL>true</checkRevocationCRL>
- </signature>
- <subscriptionCallbacks>
- <keyDomain>uddi:somebusiness</keyDomain>
- <listenUrl>http://MyHostname:4444/callback</listenUrl>
- <autoRegisterBindingTemplate>false</autoRegisterBindingTemplate>
- <autoRegisterBusinessServiceKey>uddi:somebusiness:someservicekey</autoRegisterBusinessServiceKey>
- <signatureBehavior>DoNothing</signatureBehavior>
- <!--valid values are AbortIfSigned,Sign,DoNothing,SignOnlyIfParentIsntSigned, default is DoNothing-->
- </subscriptionCallbacks>
- <XtoWsdl>
- <IgnoreSSLErrors>false</IgnoreSSLErrors>
- </XtoWsdl>
- </client>
+ <checkTimestamps>true</checkTimestamps>
+ <checkTrust>true</checkTrust>
+ <checkRevocationCRL>true</checkRevocationCRL>
+ </signature>
+ <subscriptionCallbacks>
+ <keyDomain>uddi:somebusiness</keyDomain>
+ <listenUrl>http://MyHostname:4444/callback</listenUrl>
+ <autoRegisterBindingTemplate>false</autoRegisterBindingTemplate>
+ <autoRegisterBusinessServiceKey>uddi:somebusiness:someservicekey</autoRegisterBusinessServiceKey>
+ <signatureBehavior>DoNothing</signatureBehavior>
+ <!--valid values are AbortIfSigned,Sign,DoNothing,SignOnlyIfParentIsntSigned, default is DoNothing-->
+ </subscriptionCallbacks>
+ <XtoWsdl>
+ <IgnoreSSLErrors>false</IgnoreSSLErrors>
+ </XtoWsdl>
+ </client>
</uddi>
\ No newline at end of file
Modified: juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckPublisher.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckPublisher.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckPublisher.java (original)
+++ juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckPublisher.java Sun Jan 12 13:58:05 2014
@@ -36,13 +36,20 @@ public class TckPublisher {
public final static String MARY_PUBLISHER_XML = "uddi_data/marypublisher/publisher.xml";
private static Log logger = LogFactory.getLog(TckPublisher.class);
+
static {
+ String s = System.getProperty("tck.properties");
InputStream inputSteam = null;
try {
- File f = new File("tck.properties");
-
+ File f = null;
+ if (s != null && s.length() != 0) {
+ f = new File(s);
+ }
+ if (f == null || !f.exists()) {
+ f = new File("tck.properties");
+ }
if (f.exists()) {
-
+
inputSteam = new FileInputStream(f);
logger.info("Loading tck.properties from " + f.getAbsolutePath());
} else {
@@ -232,4 +239,4 @@ public class TckPublisher {
return 60;
}
-}
\ No newline at end of file
+}
Modified: juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckTModel.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckTModel.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckTModel.java (original)
+++ juddi/trunk/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckTModel.java Sun Jan 12 13:58:05 2014
@@ -111,7 +111,13 @@ public class TckTModel {
try {
TModelDetail td1 = inquiry.getTModelDetail(gt1);
if (td1 != null && !td1.getTModel().isEmpty()) {
- exists = true;
+ if (!td1.getTModel().get(0).isDeleted()) {
+ exists = true;
+ }
+ else
+ {
+ logger.info("The tModel with key " + tmIn.getTModelKey() + " exists already, but is flagged as deleted. Overwritting");
+ }
}
} catch (Exception ex) {
}
@@ -176,7 +182,7 @@ public class TckTModel {
}
public synchronized void deleteTModel(String authInfo, String tModelXml, String tModelKey, boolean force) {
- if (keyscreated.contains(tModelKey) || force) {
+ if (keyscreated.contains(tModelKey) || force) {
try {
keyscreated.remove(tModelKey);
//Now deleting the TModel
@@ -196,9 +202,10 @@ public class TckTModel {
logger.info("skipping the deletion of tmodel " + tModelKey + " since it wasn't created by the tck");
}
}
+
public synchronized void deleteTModel(String authInfo, String tModelXml, String tModelKey) {
- deleteTModel(authInfo, tModelXml, tModelKey,false);
+ deleteTModel(authInfo, tModelXml, tModelKey, false);
}
public TModelDetail getTModelDetail(String authInfo, String tModelXml, String tModelKey) {
@@ -320,4 +327,4 @@ public class TckTModel {
}
}
-}
\ No newline at end of file
+}
Modified: juddi/trunk/uddi-tck-base/src/main/resources/tck.properties
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck-base/src/main/resources/tck.properties?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/uddi-tck-base/src/main/resources/tck.properties (original)
+++ juddi/trunk/uddi-tck-base/src/main/resources/tck.properties Sun Jan 12 13:58:05 2014
@@ -63,7 +63,7 @@ bindaddress=localhost
bpel.enabled=true
#load tests
-loadtest.enable=true
+loadtest.enable=false
loadtest.maxbusinesses=1100
Modified: juddi/trunk/uddi-tck/src/main/resources/META-INF/uddi.xml
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-tck/src/main/resources/META-INF/uddi.xml?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/uddi-tck/src/main/resources/META-INF/uddi.xml (original)
+++ juddi/trunk/uddi-tck/src/main/resources/META-INF/uddi.xml Sun Jan 12 13:58:05 2014
@@ -133,14 +133,14 @@
<keyInfoInclusionBase64PublicKey>true</keyInfoInclusionBase64PublicKey>
<digestMethod>http://www.w3.org/2000/09/xmldsig#sha1</digestMethod>
</signature>
- <subscriptionCallbacks>
- <keyDomain>uddi:somebusiness</keyDomain>
- <listenUrl>http://MyHostname:4444/callback</listenUrl>
- <autoRegisterBindingTemplate>false</autoRegisterBindingTemplate>
- <autoRegisterBusinessServiceKey>uddi:somebusiness:someservicekey</autoRegisterBusinessServiceKey>
- <signatureBehavior>DoNothing</signatureBehavior>
- <!--valid values are AbortIfSigned,Sign,DoNothing,SignOnlyIfParentIsntSigned, default is DoNothing-->
- </subscriptionCallbacks>
+ <subscriptionCallbacks>
+ <keyDomain>uddi:somebusiness</keyDomain>
+ <listenUrl></listenUrl> <!-- leave this blank, it will be generated automatically -->
+ <autoRegisterBindingTemplate>true</autoRegisterBindingTemplate>
+ <autoRegisterBusinessServiceKey>uddi:somebusiness:someservicekey</autoRegisterBusinessServiceKey>
+ <signatureBehavior>DoNothing</signatureBehavior>
+ <!--valid values are AbortIfSigned,Sign,DoNothing,SignOnlyIfParentIsntSigned, default is DoNothing-->
+ </subscriptionCallbacks>
<XtoWsdl>
<IgnoreSSLErrors>false</IgnoreSSLErrors>
</XtoWsdl>
Modified: juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/jaxb/PrintUDDI.java
URL: http://svn.apache.org/viewvc/juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/jaxb/PrintUDDI.java?rev=1557536&r1=1557535&r2=1557536&view=diff
==============================================================================
--- juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/jaxb/PrintUDDI.java (original)
+++ juddi/trunk/uddi-ws/src/main/java/org/apache/juddi/jaxb/PrintUDDI.java Sun Jan 12 13:58:05 2014
@@ -15,6 +15,7 @@
package org.apache.juddi.jaxb;
import java.io.StringWriter;
+import javax.xml.bind.JAXB;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
@@ -24,15 +25,14 @@ import javax.xml.namespace.QName;
/**
* This is for printing UDDI v3 objects from the spec.<br><br>
- * Note: This class should be used for troubleshooting purposes only.
- * To marshall and unmarshall entites, use JAXB.marshal
* @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
* @see javax.xml.bind.JAXB
* @param <T>
*/
public class PrintUDDI<T> {
- static JAXBContext jaxbContext = null;
+/* static JAXBContext jaxbContext = null;
private Marshaller getUDDIMarshaller() throws JAXBException {
if (jaxbContext==null) {
@@ -45,11 +45,9 @@ public class PrintUDDI<T> {
return marshaller;
}
-
+*/
/**
- * Prints a UDDI entity. WARNING only use for debugging purposes. Resultant text
- * may not be unmarshalable. Use JAXB.marshall(entity) if need to be able to unmarshall
- * the content again.
+ * Prints a UDDI entity.
* @param UDDIEntity
* @return Marshalled XML as a string
* @throws IllegalArgumentException
@@ -57,7 +55,10 @@ public class PrintUDDI<T> {
public String print(T UDDIEntity) {
if (UDDIEntity==null)
throw new IllegalArgumentException();
- String xml = "";
+ StringWriter sw = new StringWriter();
+ JAXB.marshal(UDDIEntity, sw);
+ return sw.toString();
+ /*String xml = "";
@SuppressWarnings("unchecked")
Class<T> type = (Class<T>) UDDIEntity.getClass();
try {
@@ -68,7 +69,7 @@ public class PrintUDDI<T> {
} catch (JAXBException je) {
}
- return xml;
+ return xml;*/
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org