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/12/09 04:13:27 UTC

[06/28] juddi git commit: JUDDI-241 working change journal NOJIRA removing a number of unnecessary TODO statements

JUDDI-241 working change journal
NOJIRA removing a number of unnecessary TODO statements


Project: http://git-wip-us.apache.org/repos/asf/juddi/repo
Commit: http://git-wip-us.apache.org/repos/asf/juddi/commit/8b95902b
Tree: http://git-wip-us.apache.org/repos/asf/juddi/tree/8b95902b
Diff: http://git-wip-us.apache.org/repos/asf/juddi/diff/8b95902b

Branch: refs/heads/master
Commit: 8b95902bbf54751cc0d8891cebfae12d2b211660
Parents: fd1ac2c
Author: alexoree <al...@apache.org>
Authored: Thu Nov 13 21:36:18 2014 -0500
Committer: alexoree <al...@apache.org>
Committed: Thu Nov 13 21:36:20 2014 -0500

----------------------------------------------------------------------
 .../juddi/v3/client/config/ClientConfig.java    |    4 +-
 .../juddi/v3/client/config/UDDIClerk.java       |    1 -
 .../apache/juddi/v3/client/config/UDDINode.java |    2 +-
 .../juddi/v3/client/mapping/ServiceLocator.java |    2 +-
 .../apache/juddi/v3/client/UDDIClientTest.java  |    4 -
 .../juddi/api/impl/AuthenticatedService.java    |   14 +-
 .../org/apache/juddi/api/impl/JUDDIApiImpl.java |  186 +-
 .../juddi/api/impl/UDDICustodyTransferImpl.java |  469 ++--
 .../juddi/api/impl/UDDIPublicationImpl.java     | 2047 +++++++++++-------
 .../juddi/api/impl/UDDIReplicationImpl.java     |  501 ++++-
 .../java/org/apache/juddi/config/Install.java   |   12 +-
 .../apache/juddi/mapping/MappingApiToModel.java |  468 ++--
 .../apache/juddi/mapping/MappingModelToApi.java |   54 +-
 .../org/apache/juddi/model/ChangeRecord.java    |   65 +-
 .../main/java/org/apache/juddi/model/Clerk.java |    2 +-
 .../apache/juddi/model/CommunicationGraph.java  |   10 +
 .../java/org/apache/juddi/model/Contact.java    |    2 +-
 .../org/apache/juddi/model/ControlMessage.java  |    4 +
 .../main/java/org/apache/juddi/model/Edge.java  |   24 +-
 .../apache/juddi/model/PublisherAssertion.java  |   20 +-
 .../juddi/model/ReplicationConfiguration.java   |   18 +-
 .../apache/juddi/model/ReplicationMessage.java  |   51 -
 .../apache/juddi/replication/ChangeList.java    |   26 -
 .../juddi/replication/ReplicationNotifier.java  |  149 +-
 .../subscription/SubscriptionNotifier.java      |   18 +-
 .../juddi/validation/ValidateReplication.java   |   95 +-
 .../src/main/resources/messages.properties      |   11 +
 .../java/org/apache/juddi/util/JPAUtil.java     |    3 +-
 .../org/apache/juddi/samples/EntryPoint.java    |  160 +-
 .../apache/juddi/samples/JuddiAdminService.java |  182 +-
 .../apache/juddi/samples/UddiFindEndpoints.java |    1 -
 .../apache/juddi/samples/UddiReplication.java   |  126 ++
 juddi-gui/src/main/webapp/ajax/assertions.jsp   |    1 -
 juddi-gui/src/main/webapp/ajax/copyitem.jsp     |    2 +-
 juddi-tomcat/juddiv3Node2.xml                   |   15 +-
 .../src/main/webapp/WEB-INF/classes/juddiv3.xml |    5 +-
 ..._RMISubscriptionListenerIntegrationTest.java |    1 -
 ...090_SubscriptionListenerIntegrationBase.java |    6 +-
 .../org/uddi/repl_v3/ChangeRecordDelete.java    |    5 +
 .../repl_v3/ChangeRecordDeleteAssertion.java    |   28 +
 .../java/org/uddi/repl_v3/ChangeRecordHide.java |    3 +
 .../org/uddi/repl_v3/ChangeRecordIDType.java    |   13 +
 .../org/uddi/repl_v3/ChangeRecordNewData.java   |    6 +
 .../v3_service/UDDIReplicationPortType.java     |   19 +
 44 files changed, 3281 insertions(+), 1554 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java
----------------------------------------------------------------------
diff --git a/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java
index 2bb4a3d..10a63be 100644
--- a/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java
+++ b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/ClientConfig.java
@@ -107,6 +107,8 @@ public class ClientConfig {
 
                 saveConfiguration.setRootElementName("uddi");
 
+                                
+                cc.addProperty("client(0).selection.policy", config.getProperty("client.selection.policy"));
                 cc.addProperty("reloadDelay", config.getProperty("reloadDelay"));
                 addCurrentNodeConfig(cc);
                 addCurrentClerks(cc);
@@ -605,8 +607,6 @@ public class ClientConfig {
                 if (this.uddiNodes.containsKey(name)) {
                         this.uddiNodes.remove(name);
                 }
-
-                //TODO to configuration xml structure
         }
 
         /**

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java
----------------------------------------------------------------------
diff --git a/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java
index ce6fc97..3c8b26b 100644
--- a/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java
+++ b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDIClerk.java
@@ -150,7 +150,6 @@ public class UDDIClerk implements Serializable {
          */
         public UDDIClerk() {
                 super();
-                // TODO Auto-generated constructor stub
         }
 
         public UDDIClerk(Clerk clerk) {

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDINode.java
----------------------------------------------------------------------
diff --git a/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDINode.java b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDINode.java
index 490ebb2..ade25c5 100644
--- a/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDINode.java
+++ b/juddi-client/src/main/java/org/apache/juddi/v3/client/config/UDDINode.java
@@ -66,7 +66,7 @@ public class UDDINode implements Serializable {
 		description = node.getDescription();
 		custodyTransferUrl = node.getCustodyTransferUrl();
 		inquiryUrl = node.getInquiryUrl();
-                //TODO inquiryRESTUrl = node.getInquiryRESTUrl();
+                //TODO need juddi schema updat inquiryRESTUrl = node.getInquiryRESTUrl()
 		publishUrl = node.getPublishUrl();
 		securityUrl = node.getSecurityUrl();
 		subscriptionUrl = node.getSubscriptionUrl();

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/ServiceLocator.java
----------------------------------------------------------------------
diff --git a/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/ServiceLocator.java b/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/ServiceLocator.java
index 72645c3..b8a6ac1 100644
--- a/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/ServiceLocator.java
+++ b/juddi-client/src/main/java/org/apache/juddi/v3/client/mapping/ServiceLocator.java
@@ -140,7 +140,7 @@ public class ServiceLocator {
 		try {
 			if (selectionPolicy==null) {
 				if (policy==null) {
-                                        //TODO move this constant to Property.class
+                                        //TODO update .NET schema file to support this
 					policy = properties.getProperty("juddi.client.selection.policy", "org.apache.juddi.v3.client.mapping.PolicyLocalFirst");
 				}
 				@SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-client/src/test/java/org/apache/juddi/v3/client/UDDIClientTest.java
----------------------------------------------------------------------
diff --git a/juddi-client/src/test/java/org/apache/juddi/v3/client/UDDIClientTest.java b/juddi-client/src/test/java/org/apache/juddi/v3/client/UDDIClientTest.java
index f287d07..fd9a140 100644
--- a/juddi-client/src/test/java/org/apache/juddi/v3/client/UDDIClientTest.java
+++ b/juddi-client/src/test/java/org/apache/juddi/v3/client/UDDIClientTest.java
@@ -63,7 +63,6 @@ public class UDDIClientTest {
                         client2.stop();
 
                 } catch (Exception e) {
-                        // TODO Auto-generated catch block
                         e.printStackTrace();
                         Assert.fail("No exceptions are expected");
                 }
@@ -81,7 +80,6 @@ public class UDDIClientTest {
                         client.stop();
 
                 } catch (Exception e) {
-                        // TODO Auto-generated catch block
                         e.printStackTrace();
                         Assert.fail("No exceptions are expected");
                 }
@@ -102,7 +100,6 @@ public class UDDIClientTest {
                         client.stop();
 
                 } catch (Exception e) {
-                        // TODO Auto-generated catch block
                         e.printStackTrace();
                         Assert.fail("No exceptions are expected");
                 }
@@ -162,7 +159,6 @@ public class UDDIClientTest {
                         client.stop();
 
                 } catch (Exception e) {
-                        // TODO Auto-generated catch block
                         e.printStackTrace();
                         Assert.fail("No exceptions are expected");
                 }

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/api/impl/AuthenticatedService.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/AuthenticatedService.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/AuthenticatedService.java
index 38665b6..d69afbf 100644
--- a/juddi-core/src/main/java/org/apache/juddi/api/impl/AuthenticatedService.java
+++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/AuthenticatedService.java
@@ -18,6 +18,8 @@
 package org.apache.juddi.api.impl;
 
 import java.util.Date;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.annotation.Resource;
 
 import javax.persistence.EntityManager;
@@ -47,7 +49,17 @@ public abstract class AuthenticatedService {
 	public static final int AUTHTOKEN_ACTIVE = 1;
 	public static final int AUTHTOKEN_RETIRED = 0;
 	static final Log logger = LogFactory.getLog(AuthenticatedService.class);
-	
+	protected String node = "UNDEFINED_NODE_NAME";
+        
+        public AuthenticatedService(){
+                try {
+                        node = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID, "UNDEFINED_NODE_NAME");
+                } catch (ConfigurationException ex) {
+                        logger.fatal(null, ex);
+                }
+        }
+        
+        
         @Resource
         protected WebServiceContext ctx;
 	public UddiEntityPublisher getEntityPublisher(EntityManager em, String authInfo) throws DispositionReportFaultMessage {

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java
index a52a66e..de98fa0 100644
--- a/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java
+++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/JUDDIApiImpl.java
@@ -70,6 +70,7 @@ import org.apache.juddi.mapping.MappingApiToModel;
 import org.apache.juddi.mapping.MappingModelToApi;
 import org.apache.juddi.model.ClientSubscriptionInfo;
 import org.apache.juddi.model.Publisher;
+import org.apache.juddi.model.ReplicationConfiguration;
 import org.apache.juddi.model.SubscriptionMatch;
 import org.apache.juddi.model.Tmodel;
 import org.apache.juddi.model.UddiEntityPublisher;
@@ -114,8 +115,8 @@ import org.uddi.v3_service.UDDISubscriptionPortType;
  * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
  */
 @WebService(serviceName = "JUDDIApiService",
-        endpointInterface = "org.apache.juddi.v3_service.JUDDIApiPortType",
-        targetNamespace = "urn:juddi-apache-org:v3_service")
+     endpointInterface = "org.apache.juddi.v3_service.JUDDIApiPortType",
+     targetNamespace = "urn:juddi-apache-org:v3_service")
 public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortType {
 
         private Log log = LogFactory.getLog(this.getClass());
@@ -130,7 +131,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          * @throws DispositionReportFaultMessage
          */
         public PublisherDetail savePublisher(SavePublisher body)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
                 EntityManager em = PersistenceManager.getEntityManager();
                 EntityTransaction tx = em.getTransaction();
@@ -163,12 +164,12 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.SAVE_PUBLISHER,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                         return result;
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.SAVE_PUBLISHER,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
                 } finally {
                         if (tx.isActive()) {
@@ -186,7 +187,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          * @throws DispositionReportFaultMessage
          */
         public void deletePublisher(DeletePublisher body)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
                 EntityManager em = PersistenceManager.getEntityManager();
                 EntityTransaction tx = em.getTransaction();
@@ -245,11 +246,11 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.DELETE_PUBLISHER,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.DELETE_PUBLISHER,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
                 } finally {
                         if (tx.isActive()) {
@@ -268,7 +269,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          * @throws DispositionReportFaultMessage
          */
         public PublisherDetail getPublisherDetail(GetPublisherDetail body)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
                 new ValidatePublisher(null).validateGetPublisherDetail(body);
 
@@ -302,12 +303,12 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_PUBLISHER_DETAIL,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                         return result;
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_PUBLISHER_DETAIL,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
                 } finally {
                         if (tx.isActive()) {
@@ -331,7 +332,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          */
         @SuppressWarnings("unchecked")
         public PublisherDetail getAllPublisherDetail(GetAllPublisherDetail body)
-                throws DispositionReportFaultMessage, RemoteException {
+             throws DispositionReportFaultMessage, RemoteException {
                 long startTime = System.currentTimeMillis();
                 new ValidatePublisher(null).validateGetAllPublisherDetail(body);
 
@@ -359,12 +360,12 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_ALL_PUBLISHER_DETAIL,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                         return result;
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_ALL_PUBLISHER_DETAIL,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
                 } finally {
                         if (tx.isActive()) {
@@ -386,7 +387,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          * @throws DispositionReportFaultMessage
          */
         public void adminDeleteTModel(DeleteTModel body)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
                 EntityManager em = PersistenceManager.getEntityManager();
                 EntityTransaction tx = em.getTransaction();
@@ -406,11 +407,11 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.ADMIN_DELETE_TMODEL,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.ADMIN_DELETE_TMODEL,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
                 } finally {
                         if (tx.isActive()) {
@@ -429,7 +430,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          * @throws RemoteException
          */
         public void deleteClientSubscriptionInfo(DeleteClientSubscriptionInfo body)
-                throws DispositionReportFaultMessage, RemoteException {
+             throws DispositionReportFaultMessage, RemoteException {
                 long startTime = System.currentTimeMillis();
                 EntityManager em = PersistenceManager.getEntityManager();
                 EntityTransaction tx = em.getTransaction();
@@ -449,11 +450,11 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.DELETE_CLIENT_SUB,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.DELETE_CLIENT_SUB,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
 
                 } finally {
@@ -475,7 +476,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          * @throws RemoteException
          */
         public ClientSubscriptionInfoDetail saveClientSubscriptionInfo(SaveClientSubscriptionInfo body)
-                throws DispositionReportFaultMessage, RemoteException {
+             throws DispositionReportFaultMessage, RemoteException {
                 long startTime = System.currentTimeMillis();
                 EntityManager em = PersistenceManager.getEntityManager();
                 EntityTransaction tx = em.getTransaction();
@@ -509,12 +510,12 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
 
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.SAVE_CLIENT_SUB,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                         return result;
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.SAVE_CLIENT_SUB,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
 
                 } finally {
@@ -535,7 +536,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          */
         @SuppressWarnings("unchecked")
         public ClientSubscriptionInfoDetail getAllClientSubscriptionInfoDetail(GetAllClientSubscriptionInfoDetail body)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
                 new ValidateClientSubscriptionInfo(null).validateGetAllClientSubscriptionDetail(body);
 
@@ -563,12 +564,12 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_ALL_CLIENT_SUB,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                         return result;
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_ALL_CLIENT_SUB,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
 
                 } finally {
@@ -590,7 +591,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          * @throws DispositionReportFaultMessage
          */
         public ClientSubscriptionInfoDetail getClientSubscriptionInfoDetail(GetClientSubscriptionInfoDetail body)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
                 new ValidateClientSubscriptionInfo(null).validateGetClientSubscriptionInfoDetail(body);
 
@@ -627,12 +628,12 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
 
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_CLIENT_SUB,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                         return result;
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_CLIENT_SUB,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
                 } finally {
                         if (tx.isActive()) {
@@ -653,7 +654,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          * @throws DispositionReportFaultMessage
          */
         public ClerkDetail saveClerk(SaveClerk body)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
                 EntityManager em = PersistenceManager.getEntityManager();
                 EntityTransaction tx = em.getTransaction();
@@ -672,9 +673,14 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                                 org.apache.juddi.model.Clerk modelClerk = new org.apache.juddi.model.Clerk();
 
                                 MappingApiToModel.mapClerk(apiClerk, modelClerk);
+                                org.apache.juddi.model.Node node = em.find(org.apache.juddi.model.Node.class, apiClerk.getNode().getName());
+                                if (node==null)
+                                        MappingApiToModel.mapNode(apiClerk.getNode(), node);
 
+                                modelClerk.setNode(node);
                                 Object existingUddiEntity = em.find(modelClerk.getClass(), modelClerk.getClerkName());
                                 if (existingUddiEntity != null) {
+                                        
                                         em.merge(modelClerk);
                                 } else {
                                         em.persist(modelClerk);
@@ -686,12 +692,12 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.SAVE_CLERK,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                         return result;
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.SAVE_CLERK,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
 
                 } finally {
@@ -713,7 +719,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          * @throws DispositionReportFaultMessage
          */
         public NodeDetail saveNode(SaveNode body)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
                 EntityManager em = PersistenceManager.getEntityManager();
                 EntityTransaction tx = em.getTransaction();
@@ -746,12 +752,12 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.SAVE_NODE,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                         return result;
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.SAVE_NODE,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
 
                 } finally {
@@ -773,14 +779,14 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          */
         @SuppressWarnings("unchecked")
         public SyncSubscriptionDetail invokeSyncSubscription(
-                SyncSubscription body) throws DispositionReportFaultMessage,
-                RemoteException {
+             SyncSubscription body) throws DispositionReportFaultMessage,
+             RemoteException {
                 long startTime = System.currentTimeMillis();
                 //validate
                 SyncSubscriptionDetail syncSubscriptionDetail = new SyncSubscriptionDetail();
 
                 Map<String, org.apache.juddi.api_v3.ClientSubscriptionInfo> clientSubscriptionInfoMap
-                        = new HashMap<String, org.apache.juddi.api_v3.ClientSubscriptionInfo>();
+                     = new HashMap<String, org.apache.juddi.api_v3.ClientSubscriptionInfo>();
                 //find the clerks to go with these subscriptions
                 EntityManager em = PersistenceManager.getEntityManager();
                 EntityTransaction tx = em.getTransaction();
@@ -808,7 +814,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.INVOKE_SYNCSUB,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
 
                 } finally {
@@ -837,23 +843,23 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                                 marshaller.marshal(list, sw);
 
                                 log.info(
-                                        "Notification received by UDDISubscriptionListenerService : " + sw.toString());
+                                     "Notification received by UDDISubscriptionListenerService : " + sw.toString());
 
                                 NotificationList<String> nl = NotificationList.getInstance();
 
                                 nl.getNotifications()
-                                        .add(sw.toString());
+                                     .add(sw.toString());
 
                                 //update the registry with the notification list.
                                 XRegisterHelper.handle(fromClerk, toClerk, list);
 
                                 syncSubscriptionDetail.getSubscriptionResultsList()
-                                        .add(list);
+                                     .add(list);
                         } catch (Exception ce) {
                                 log.error(ce.getMessage(), ce);
                                 long procTime = System.currentTimeMillis() - startTime;
                                 serviceCounter.update(JUDDIQuery.SAVE_NODE,
-                                        QueryStatus.FAILED, procTime);
+                                     QueryStatus.FAILED, procTime);
                                 if (ce instanceof DispositionReportFaultMessage) {
                                         throw (DispositionReportFaultMessage) ce;
                                 }
@@ -867,7 +873,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
 
                 long procTime = System.currentTimeMillis() - startTime;
                 serviceCounter.update(JUDDIQuery.INVOKE_SYNCSUB,
-                        QueryStatus.SUCCESS, procTime);
+                     QueryStatus.SUCCESS, procTime);
                 return syncSubscriptionDetail;
         }
 
@@ -900,11 +906,11 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_ALL_NODES,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_ALL_NODES,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
                 } finally {
                         if (tx.isActive()) {
@@ -943,11 +949,11 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_ALL_CLERKS,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_ALL_CLERKS,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
 
                 } finally {
@@ -975,7 +981,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
 
                         org.apache.juddi.model.Node existingUddiEntity = em.find(org.apache.juddi.model.Node.class, req.getNodeID());
                         if (existingUddiEntity
-                                != null) {
+                             != null) {
 
                                 //TODO cascade delete all clerks tied to this node
                                 em.remove(existingUddiEntity);
@@ -985,11 +991,11 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.DELETE_NODE,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.DELETE_NODE,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
 
                 } finally {
@@ -1020,7 +1026,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
 
                         org.apache.juddi.model.Clerk existingUddiEntity = em.find(org.apache.juddi.model.Clerk.class, req.getClerkID());
                         if (existingUddiEntity
-                                != null) {
+                             != null) {
                                 em.remove(existingUddiEntity);
                                 found = true;
                         }
@@ -1028,11 +1034,11 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.DELETE_CLERK,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.DELETE_CLERK,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
 
                 } finally {
@@ -1050,7 +1056,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
 
         /*
          * enables tmodel owners to setup valid values for tmodel instance infos
-         * to use, TODO
+         * to use?
          *
          * @param authInfo
          * @param values
@@ -1068,7 +1074,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
          EntityTransaction tx = em.getTransaction();
          try {
 
-         //TODO is this tModel used anywhere?, if so, validate all instances against the new rule?
+         // is this tModel used anywhere?, if so, validate all instances against the new rule?
          tx.begin();
 
          //each tmodel/value set
@@ -1126,11 +1132,11 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(SubscriptionQuery.DELETE_SUBSCRIPTION,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(SubscriptionQuery.DELETE_SUBSCRIPTION,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
                 } finally {
                         if (tx.isActive()) {
@@ -1146,7 +1152,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                 long startTime = System.currentTimeMillis();
                 long procTime = System.currentTimeMillis() - startTime;
                 serviceCounter.update(JUDDIQuery.ADMIN_SAVE_BUSINESS,
-                        QueryStatus.SUCCESS, procTime);
+                     QueryStatus.SUCCESS, procTime);
                 ValidatePublish.unsupportedAPICall();
                 return null;
         }
@@ -1174,11 +1180,11 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.ADMIN_SAVE_TMODEL,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.ADMIN_SAVE_TMODEL,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
 
                 } finally {
@@ -1221,16 +1227,15 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                                 x.setPublisherIdOrUsername(resultList.get(i).getAuthorizedName());
                                 r.add(x);
                         }
-                        
-                        
+
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_ALL_CLIENT_SUB,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_ALL_CLIENT_SUB,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
                 } finally {
                         if (tx.isActive()) {
@@ -1245,11 +1250,39 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
         @Override
         public DispositionReport setReplicationNodes(String authInfo, org.uddi.repl_v3.ReplicationConfiguration replicationConfiguration) throws DispositionReportFaultMessage, RemoteException {
                 long startTime = System.currentTimeMillis();
-                long procTime = System.currentTimeMillis() - startTime;
-                serviceCounter.update(JUDDIQuery.SET_REPLICATION_NODES,
-                        QueryStatus.SUCCESS, procTime);
-                ValidatePublish.unsupportedAPICall();
-                return null;
+
+                EntityManager em = PersistenceManager.getEntityManager();
+                EntityTransaction tx = em.getTransaction();
+                try {
+                        tx.begin();
+
+                        UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
+                        if (!((Publisher) publisher).isAdmin()) {
+                                throw new UserMismatchException(new ErrorMessage("errors.AdminReqd"));
+                        }
+
+                        //TODO validate inbound request
+                        org.apache.juddi.model.ReplicationConfiguration model = new ReplicationConfiguration();
+                        MappingApiToModel.mapReplicationConfiguration(replicationConfiguration, model, em);
+                        em.persist(model);
+
+                        tx.commit();
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(JUDDIQuery.SET_REPLICATION_NODES,
+                             QueryStatus.SUCCESS, procTime);
+                } catch (DispositionReportFaultMessage drfm) {
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(JUDDIQuery.SET_REPLICATION_NODES,
+                             QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+
+                return new DispositionReport();
         }
 
         @Override
@@ -1268,22 +1301,21 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         }
 
                         StringBuilder sql = new StringBuilder();
-                        sql.append("select distinct c from ReplicationConfiguration c ");
+                        sql.append("select c from ReplicationConfiguration c order by c.SerialNumber desc");
                         sql.toString();
                         Query qry = em.createQuery(sql.toString());
+                        qry.setMaxResults(1);
                         org.apache.juddi.model.ReplicationConfiguration resultList = (org.apache.juddi.model.ReplicationConfiguration) qry.getSingleResult();
-                        //for (int i = 0; i < resultList.size(); i++) {
                         MappingModelToApi.mapReplicationConfiguration(resultList, r);
-                        //}
 
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_ALL_NODES,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.GET_ALL_NODES,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
                 } finally {
                         if (tx.isActive()) {
@@ -1316,11 +1348,11 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.ADMIN_SAVE_SUB,
-                                QueryStatus.SUCCESS, procTime);
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
                         long procTime = System.currentTimeMillis() - startTime;
                         serviceCounter.update(JUDDIQuery.ADMIN_SAVE_SUB,
-                                QueryStatus.FAILED, procTime);
+                             QueryStatus.FAILED, procTime);
                         throw drfm;
 
                 } finally {

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDICustodyTransferImpl.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDICustodyTransferImpl.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDICustodyTransferImpl.java
index 02d62dd..2bb21f2 100644
--- a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDICustodyTransferImpl.java
+++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDICustodyTransferImpl.java
@@ -14,13 +14,15 @@
  * limitations under the License.
  *
  */
-
 package org.apache.juddi.api.impl;
 
+import java.util.ArrayList;
 import java.util.GregorianCalendar;
 import java.util.List;
 import java.util.UUID;
 import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 import javax.jws.WebService;
 import javax.persistence.EntityManager;
@@ -47,211 +49,290 @@ import org.apache.juddi.model.TransferTokenKey;
 import org.apache.juddi.model.UddiEntity;
 import org.apache.juddi.model.UddiEntityPublisher;
 import org.apache.juddi.query.util.DynamicQuery;
+import org.apache.juddi.replication.ReplicationNotifier;
 import org.apache.juddi.v3.error.ErrorMessage;
 import org.apache.juddi.v3.error.FatalErrorException;
 import org.apache.juddi.validation.ValidateCustodyTransfer;
+import org.uddi.api_v3.OperationalInfo;
 import org.uddi.custody_v3.DiscardTransferToken;
 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")
+@WebService(serviceName = "UDDICustodyTransferService",
+     endpointInterface = "org.uddi.v3_service.UDDICustodyTransferPortType",
+     targetNamespace = "urn:uddi-org:v3_service")
 public class UDDICustodyTransferImpl extends AuthenticatedService implements UDDICustodyTransferPortType {
 
-	public static final String TRANSFER_TOKEN_PREFIX = "transfertoken:";
-	public static final int DEFAULT_TRANSFEREXPIRATION_DAYS = 3;
-	
+        public static final String TRANSFER_TOKEN_PREFIX = "transfertoken:";
+        public static final int DEFAULT_TRANSFEREXPIRATION_DAYS = 3;
+
         private static Log logger = LogFactory.getLog(UDDICustodyTransferImpl.class);
-    
-	private UDDIServiceCounter serviceCounter;
-
-	public UDDICustodyTransferImpl() {
-	    super();
-	    serviceCounter = ServiceCounterLifecycleResource.getServiceCounter(this.getClass());
-	}
-
-	@SuppressWarnings("unchecked")
-	public void discardTransferToken(DiscardTransferToken body)
-			throws DispositionReportFaultMessage {
-	        long startTime = System.currentTimeMillis();
-
-		EntityManager em = PersistenceManager.getEntityManager();
-		EntityTransaction tx = em.getTransaction();
-		try {
-			tx.begin();
-	
-			UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
-			
-			new ValidateCustodyTransfer(publisher).validateDiscardTransferToken(em, body);
-	
-			org.uddi.custody_v3.TransferToken apiTransferToken = body.getTransferToken();
-			if (apiTransferToken != null) {
-				String transferTokenId = new String(apiTransferToken.getOpaqueToken());
-				org.apache.juddi.model.TransferToken modelTransferToken = em.find(org.apache.juddi.model.TransferToken.class, transferTokenId);
-				if (modelTransferToken != null)
-					em.remove(modelTransferToken);
-			}
-			
-			KeyBag keyBag = body.getKeyBag();
-			if (keyBag != null) {
-				List<String> keyList = keyBag.getKey();
-				Vector<DynamicQuery.Parameter> params = new Vector<DynamicQuery.Parameter>(0);
-				for (String key : keyList) {
-					// Creating parameters for key-checking query
-					DynamicQuery.Parameter param = new DynamicQuery.Parameter("UPPER(ttk.entityKey)", 
-																			  key.toUpperCase(), 
-																			  DynamicQuery.PREDICATE_EQUALS);
-					
-					params.add(param);
-				}
-	
-				// Find the associated transfer tokens and remove them.
-				DynamicQuery getTokensQry = new DynamicQuery();
-				getTokensQry.append("select distinct ttk.transferToken from TransferTokenKey ttk").pad();
-				getTokensQry.WHERE().pad().appendGroupedOr(params.toArray(new DynamicQuery.Parameter[0]));
-	
-				Query qry = getTokensQry.buildJPAQuery(em);
-				List<org.apache.juddi.model.TransferToken> tokensToDelete = qry.getResultList();
-				if (tokensToDelete != null && tokensToDelete.size() > 0) {
-					for (org.apache.juddi.model.TransferToken tt : tokensToDelete)
-						em.remove(tt);
-				}
-			}
-	
-			tx.commit();
-	                long procTime = System.currentTimeMillis() - startTime;
-	                serviceCounter.update(CustodyTransferQuery.DISCARD_TRANSFERTOKEN, 
-	                        QueryStatus.SUCCESS, procTime);
-
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-	public void getTransferToken(String authInfo, KeyBag keyBag,
-			Holder<String> nodeID, Holder<XMLGregorianCalendar> expirationTime,
-			Holder<byte[]> opaqueToken) throws DispositionReportFaultMessage {
-	        long startTime = System.currentTimeMillis();
-
-		EntityManager em = PersistenceManager.getEntityManager();
-		EntityTransaction tx = em.getTransaction();
-		try {
-			tx.begin();
-			
-			UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
-			
-			new ValidateCustodyTransfer(publisher).validateGetTransferToken(em, keyBag);
-	
-			int transferExpirationDays = DEFAULT_TRANSFEREXPIRATION_DAYS;
-			try { 
-				transferExpirationDays = AppConfig.getConfiguration().getInt(Property.JUDDI_TRANSFER_EXPIRATION_DAYS);
-				// For output
-				nodeID.value = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID);
-			}
-			catch(ConfigurationException ce) 
-			{ throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval"));}
-	
-			String transferKey = TRANSFER_TOKEN_PREFIX + UUID.randomUUID();
-			org.apache.juddi.model.TransferToken transferToken = new org.apache.juddi.model.TransferToken();
-			transferToken.setTransferToken(transferKey);
-			// For output
-			opaqueToken.value = transferKey.getBytes();
-			
-			GregorianCalendar gc = new GregorianCalendar();
-			gc.add(GregorianCalendar.DAY_OF_MONTH, transferExpirationDays);
-			
-			transferToken.setExpirationDate(gc.getTime());
-	
-			try { 
-				DatatypeFactory df = DatatypeFactory.newInstance();
-				// For output
-				expirationTime.value = df.newXMLGregorianCalendar(gc);
-			}
-			catch(DatatypeConfigurationException ce) 
-			{ throw new FatalErrorException(new ErrorMessage("errors.Unspecified"));}
-	
-			List<String> keyList = keyBag.getKey();
-			for (String key : keyList) {
-				TransferTokenKey tokenKey = new TransferTokenKey(transferToken, key);
-				transferToken.getTransferKeys().add(tokenKey);
-			}
-			
-			em.persist(transferToken);
-			
-			tx.commit();
-			
-	                long procTime = System.currentTimeMillis() - startTime;
-	                serviceCounter.update(CustodyTransferQuery.GET_TRANSFERTOKEN, 
-	                        QueryStatus.SUCCESS, procTime);
-
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-	public void transferEntities(TransferEntities body)
-			throws DispositionReportFaultMessage {
-	        long startTime = System.currentTimeMillis();
-
-		EntityManager em = PersistenceManager.getEntityManager();
-		EntityTransaction tx = em.getTransaction();
-		try {
-			tx.begin();
-			
-			UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
-			
-			new ValidateCustodyTransfer(publisher).validateTransferEntities(em, body);
-	
-			// Once validated, the ownership transfer is as simple as switching the publisher
-			KeyBag keyBag = body.getKeyBag();
-			List<String> keyList = keyBag.getKey();
-			for (String key : keyList) {
-				UddiEntity uddiEntity = em.find(UddiEntity.class, key);
-				uddiEntity.setAuthorizedName(publisher.getAuthorizedName());
-				
-				if (uddiEntity instanceof BusinessEntity) {
-					BusinessEntity be = (BusinessEntity)uddiEntity;
-					
-					List<BusinessService> bsList = be.getBusinessServices();
-					for (BusinessService bs : bsList) {
-						bs.setAuthorizedName(publisher.getAuthorizedName());
-						
-						List<BindingTemplate> btList = bs.getBindingTemplates();
-						for (BindingTemplate bt : btList)
-							bt.setAuthorizedName(publisher.getAuthorizedName());
-					}
-				}
-			}
-	
-			// After transfer is finished, the token can be removed
-			org.uddi.custody_v3.TransferToken apiTransferToken = body.getTransferToken();
-			String transferTokenId = new String(apiTransferToken.getOpaqueToken());
-			org.apache.juddi.model.TransferToken modelTransferToken = em.find(org.apache.juddi.model.TransferToken.class, transferTokenId);
-			em.remove(modelTransferToken);
-			
-			tx.commit();
-			long procTime = System.currentTimeMillis() - startTime;
-	                serviceCounter.update(CustodyTransferQuery.TRANSFER_ENTITIES, 
-	                        QueryStatus.SUCCESS, procTime);
-
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-
-	}
+
+        private static DatatypeFactory df = null;
+        private UDDIServiceCounter serviceCounter;
+
+        public UDDICustodyTransferImpl()  {
+                super();
+                serviceCounter = ServiceCounterLifecycleResource.getServiceCounter(this.getClass());
+                if (df == null) {
+                        try {
+                                df = DatatypeFactory.newInstance();
+                        } catch (DatatypeConfigurationException ex) {
+                                Logger.getLogger(UDDICustodyTransferImpl.class.getName()).log(Level.SEVERE, null, ex);
+                        }
+                }
+        }
+
+        @SuppressWarnings("unchecked")
+        public void discardTransferToken(DiscardTransferToken body)
+             throws DispositionReportFaultMessage {
+                long startTime = System.currentTimeMillis();
+
+                EntityManager em = PersistenceManager.getEntityManager();
+                EntityTransaction tx = em.getTransaction();
+                try {
+                        tx.begin();
+
+                        UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
+
+                        new ValidateCustodyTransfer(publisher).validateDiscardTransferToken(em, body);
+
+                        org.uddi.custody_v3.TransferToken apiTransferToken = body.getTransferToken();
+                        if (apiTransferToken != null) {
+                                String transferTokenId = new String(apiTransferToken.getOpaqueToken());
+                                org.apache.juddi.model.TransferToken modelTransferToken = em.find(org.apache.juddi.model.TransferToken.class, transferTokenId);
+                                if (modelTransferToken != null) {
+                                        em.remove(modelTransferToken);
+                                }
+                        }
+
+                        KeyBag keyBag = body.getKeyBag();
+                        if (keyBag != null) {
+                                List<String> keyList = keyBag.getKey();
+                                Vector<DynamicQuery.Parameter> params = new Vector<DynamicQuery.Parameter>(0);
+                                for (String key : keyList) {
+                                        // Creating parameters for key-checking query
+                                        DynamicQuery.Parameter param = new DynamicQuery.Parameter("UPPER(ttk.entityKey)",
+                                             key.toUpperCase(),
+                                             DynamicQuery.PREDICATE_EQUALS);
+
+                                        params.add(param);
+                                }
+
+                                // Find the associated transfer tokens and remove them.
+                                DynamicQuery getTokensQry = new DynamicQuery();
+                                getTokensQry.append("select distinct ttk.transferToken from TransferTokenKey ttk").pad();
+                                getTokensQry.WHERE().pad().appendGroupedOr(params.toArray(new DynamicQuery.Parameter[0]));
+
+                                Query qry = getTokensQry.buildJPAQuery(em);
+                                List<org.apache.juddi.model.TransferToken> tokensToDelete = qry.getResultList();
+                                if (tokensToDelete != null && tokensToDelete.size() > 0) {
+                                        for (org.apache.juddi.model.TransferToken tt : tokensToDelete) {
+                                                em.remove(tt);
+                                        }
+                                }
+                        }
+
+                        tx.commit();
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(CustodyTransferQuery.DISCARD_TRANSFERTOKEN,
+                             QueryStatus.SUCCESS, procTime);
+
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        public void getTransferToken(String authInfo, KeyBag keyBag,
+             Holder<String> nodeID, Holder<XMLGregorianCalendar> expirationTime,
+             Holder<byte[]> opaqueToken) throws DispositionReportFaultMessage {
+                long startTime = System.currentTimeMillis();
+
+                EntityManager em = PersistenceManager.getEntityManager();
+                EntityTransaction tx = em.getTransaction();
+                try {
+                        tx.begin();
+
+                        UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
+
+                        new ValidateCustodyTransfer(publisher).validateGetTransferToken(em, keyBag);
+
+                        int transferExpirationDays = DEFAULT_TRANSFEREXPIRATION_DAYS;
+                        try {
+                                transferExpirationDays = AppConfig.getConfiguration().getInt(Property.JUDDI_TRANSFER_EXPIRATION_DAYS);
+                                // For output
+                                nodeID.value = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID);
+                        } catch (ConfigurationException ce) {
+                                throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval"));
+                        }
+
+                        String transferKey = TRANSFER_TOKEN_PREFIX + UUID.randomUUID();
+                        org.apache.juddi.model.TransferToken transferToken = new org.apache.juddi.model.TransferToken();
+                        transferToken.setTransferToken(transferKey);
+                        // For output
+                        opaqueToken.value = transferKey.getBytes();
+
+                        GregorianCalendar gc = new GregorianCalendar();
+                        gc.add(GregorianCalendar.DAY_OF_MONTH, transferExpirationDays);
+
+                        transferToken.setExpirationDate(gc.getTime());
+
+                        try {
+                                DatatypeFactory df = DatatypeFactory.newInstance();
+                                // For output
+                                expirationTime.value = df.newXMLGregorianCalendar(gc);
+                        } catch (DatatypeConfigurationException ce) {
+                                throw new FatalErrorException(new ErrorMessage("errors.Unspecified"));
+                        }
+
+                        List<String> keyList = keyBag.getKey();
+                        for (String key : keyList) {
+                                TransferTokenKey tokenKey = new TransferTokenKey(transferToken, key);
+                                transferToken.getTransferKeys().add(tokenKey);
+                        }
+
+                        em.persist(transferToken);
+
+                        tx.commit();
+
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(CustodyTransferQuery.GET_TRANSFERTOKEN,
+                             QueryStatus.SUCCESS, procTime);
+
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        public void transferEntities(TransferEntities body)
+             throws DispositionReportFaultMessage {
+                long startTime = System.currentTimeMillis();
+
+                EntityManager em = PersistenceManager.getEntityManager();
+                EntityTransaction tx = em.getTransaction();
+                try {
+                        tx.begin();
+
+                        UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
+
+                        new ValidateCustodyTransfer(publisher).validateTransferEntities(em, body);
+
+                        // Once validated, the ownership transfer is as simple as switching the publisher
+                        KeyBag keyBag = body.getKeyBag();
+                        List<String> keyList = keyBag.getKey();
+                        //used for the change journal
+                        List<OperationalInfo> op_info = new ArrayList<OperationalInfo>();
+                        for (String key : keyList) {
+                                UddiEntity uddiEntity = em.find(UddiEntity.class, key);
+                                uddiEntity.setAuthorizedName(publisher.getAuthorizedName());
+                                OperationalInfo o = new OperationalInfo();
+                                o.setAuthorizedName(publisher.getAuthorizedName());
+
+                                GregorianCalendar gcal = new GregorianCalendar();
+                                gcal.setTime(uddiEntity.getCreated());
+                                o.setCreated(df.newXMLGregorianCalendar(gcal));
+
+                                o.setEntityKey(uddiEntity.getEntityKey());
+
+                                gcal = new GregorianCalendar();
+                                gcal.setTime(uddiEntity.getModified());
+                                o.setModified(df.newXMLGregorianCalendar(gcal));
+
+                                gcal = new GregorianCalendar();
+                                gcal.setTime(uddiEntity.getModifiedIncludingChildren());
+                                o.setModifiedIncludingChildren(df.newXMLGregorianCalendar(gcal));
+                                o.setNodeID(uddiEntity.getNodeId());
+                                op_info.add(o);
+
+                                if (uddiEntity instanceof BusinessEntity) {
+                                        BusinessEntity be = (BusinessEntity) uddiEntity;
+
+                                        List<BusinessService> bsList = be.getBusinessServices();
+                                        for (BusinessService bs : bsList) {
+                                                bs.setAuthorizedName(publisher.getAuthorizedName());
+                                                OperationalInfo o2 = new OperationalInfo();
+                                                o2.setAuthorizedName(bs.getAuthorizedName());
+
+                                                gcal = new GregorianCalendar();
+                                                gcal.setTime(bs.getCreated());
+                                                o2.setCreated(df.newXMLGregorianCalendar(gcal));
+
+                                                o2.setEntityKey(bs.getEntityKey());
+
+                                                gcal = new GregorianCalendar();
+                                                gcal.setTime(bs.getModified());
+                                                o2.setModified(df.newXMLGregorianCalendar(gcal));
+
+                                                gcal = new GregorianCalendar();
+                                                gcal.setTime(bs.getModifiedIncludingChildren());
+                                                o2.setModifiedIncludingChildren(df.newXMLGregorianCalendar(gcal));
+                                                o2.setNodeID(bs.getNodeId());
+                                                op_info.add(o2);
+
+                                                List<BindingTemplate> btList = bs.getBindingTemplates();
+                                                for (BindingTemplate bt : btList) {
+                                                        bt.setAuthorizedName(publisher.getAuthorizedName());
+                                                        OperationalInfo o3 = new OperationalInfo();
+                                                        o3.setAuthorizedName(bt.getAuthorizedName());
+
+                                                        gcal = new GregorianCalendar();
+                                                        gcal.setTime(bt.getCreated());
+                                                        o3.setCreated(df.newXMLGregorianCalendar(gcal));
+
+                                                        o3.setEntityKey(bt.getEntityKey());
+
+                                                        gcal = new GregorianCalendar();
+                                                        gcal.setTime(bt.getModified());
+                                                        o3.setModified(df.newXMLGregorianCalendar(gcal));
+
+                                                        gcal = new GregorianCalendar();
+                                                        gcal.setTime(bt.getModifiedIncludingChildren());
+                                                        o3.setModifiedIncludingChildren(df.newXMLGregorianCalendar(gcal));
+                                                        o3.setNodeID(bt.getNodeId());
+                                                        op_info.add(o3);
+                                                }
+                                        }
+                                }
+                        }
+
+                        // After transfer is finished, the token can be removed
+                        org.uddi.custody_v3.TransferToken apiTransferToken = body.getTransferToken();
+                        String transferTokenId = new String(apiTransferToken.getOpaqueToken());
+                        org.apache.juddi.model.TransferToken modelTransferToken = em.find(org.apache.juddi.model.TransferToken.class, transferTokenId);
+                        em.remove(modelTransferToken);
+
+                        tx.commit();
+                        //TODO do we need to do something for replication purposes here?
+                        //OperationalInfoWrapper t = new OperationalInfoWrapper();
+                        //t.data = op_info;
+                        //ReplicationNotifier.Enqueue(UDDIPublicationImpl.);
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(CustodyTransferQuery.TRANSFER_ENTITIES,
+                             QueryStatus.SUCCESS, procTime);
+
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+
+        }
+
+        public class OperationalInfoWrapper {
+
+                public List<OperationalInfo> data;
+        }
 }


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