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/11/15 00:12:55 UTC

[1/9] juddi git commit: NOJIRA adding jUDDI logos by Kim Wood

Repository: juddi
Updated Branches:
  refs/heads/JUDDI-241 [created] 455149a9e


NOJIRA adding jUDDI logos by Kim Wood


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

Branch: refs/heads/JUDDI-241
Commit: fd1ac2c002e28fb94119c43634df30c3e4c303dc
Parents: 197e1d1
Author: alexoree <al...@apache.org>
Authored: Thu Nov 13 20:39:07 2014 -0500
Committer: alexoree <al...@apache.org>
Committed: Thu Nov 13 20:39:07 2014 -0500

----------------------------------------------------------------------
 misc/jUDDI by Kim Wood 300x300ish.png      | Bin 0 -> 63647 bytes
 misc/jUDDI by Kim Wood.png                 | Bin 0 -> 264196 bytes
 misc/jUDDI_for black bkgd  by Kim Wood.png | Bin 0 -> 248617 bytes
 3 files changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/juddi/blob/fd1ac2c0/misc/jUDDI by Kim Wood 300x300ish.png
----------------------------------------------------------------------
diff --git a/misc/jUDDI by Kim Wood 300x300ish.png b/misc/jUDDI by Kim Wood 300x300ish.png
new file mode 100644
index 0000000..1439a76
Binary files /dev/null and b/misc/jUDDI by Kim Wood 300x300ish.png differ

http://git-wip-us.apache.org/repos/asf/juddi/blob/fd1ac2c0/misc/jUDDI by Kim Wood.png
----------------------------------------------------------------------
diff --git a/misc/jUDDI by Kim Wood.png b/misc/jUDDI by Kim Wood.png
new file mode 100644
index 0000000..ee097e2
Binary files /dev/null and b/misc/jUDDI by Kim Wood.png differ

http://git-wip-us.apache.org/repos/asf/juddi/blob/fd1ac2c0/misc/jUDDI_for black bkgd  by Kim Wood.png
----------------------------------------------------------------------
diff --git a/misc/jUDDI_for black bkgd  by Kim Wood.png b/misc/jUDDI_for black bkgd  by Kim Wood.png
new file mode 100644
index 0000000..6e34ba6
Binary files /dev/null and b/misc/jUDDI_for black bkgd  by Kim Wood.png differ


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


[9/9] juddi git commit: JUDDI-241 Adding additional changes required by replication api. Not all tests pass on juddi api

Posted by al...@apache.org.
JUDDI-241 Adding additional changes required by replication api. Not all tests pass on juddi api


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

Branch: refs/heads/JUDDI-241
Commit: 455149a9edbfa54679c5d789001c784e9bb464ea
Parents: 8b95902
Author: alexoree <al...@apache.org>
Authored: Fri Nov 14 18:12:31 2014 -0500
Committer: alexoree <al...@apache.org>
Committed: Fri Nov 14 18:12:31 2014 -0500

----------------------------------------------------------------------
 .../org/apache/juddi/api/impl/JUDDIApiImpl.java |   13 +-
 .../juddi/api/impl/UDDIReplicationImpl.java     |   48 +-
 .../juddi/api/impl/UDDIServiceCounter.java      |   14 +-
 .../juddi/api/impl/UDDISubscriptionImpl.java    |    2 +-
 .../apache/juddi/mapping/MappingApiToModel.java |   17 +-
 .../apache/juddi/mapping/MappingModelToApi.java | 2159 +++++++++---------
 .../apache/juddi/validation/ValidateClerk.java  |    5 +-
 .../juddi/validation/ValidatePublish.java       |    1 -
 .../juddi/validation/ValidateReplication.java   |    4 +
 .../src/main/resources/messages.properties      |    1 +
 ..._RMISubscriptionListenerIntegrationTest.java |    1 -
 .../juddi/api/impl/API_160_ReplicationTest.java |  266 +++
 .../replication/ReplicationNotifierTest.java    |   75 +
 juddi-tomcat/build.xml                          |   52 +
 .../root_BusinessEntity.xml                     |  668 ++++++
 .../juddi_install_data_node2/root_Publisher.xml |   21 +
 .../root_tModelKeyGen.xml                       |   40 +
 juddi-tomcat/pom.xml                            |    1 +
 18 files changed, 2286 insertions(+), 1102 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/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 de98fa0..a4ef416 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
@@ -69,6 +69,7 @@ import org.apache.juddi.config.Property;
 import org.apache.juddi.mapping.MappingApiToModel;
 import org.apache.juddi.mapping.MappingModelToApi;
 import org.apache.juddi.model.ClientSubscriptionInfo;
+import org.apache.juddi.model.Node;
 import org.apache.juddi.model.Publisher;
 import org.apache.juddi.model.ReplicationConfiguration;
 import org.apache.juddi.model.SubscriptionMatch;
@@ -86,6 +87,7 @@ import org.apache.juddi.validation.ValidateClientSubscriptionInfo;
 import org.apache.juddi.validation.ValidateNode;
 import org.apache.juddi.validation.ValidatePublish;
 import org.apache.juddi.validation.ValidatePublisher;
+import org.apache.juddi.validation.ValidateReplication;
 import org.apache.juddi.validation.ValidateSubscription;
 import org.uddi.api_v3.AuthToken;
 import org.uddi.api_v3.BusinessInfo;
@@ -675,8 +677,11 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                                 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);
-
+                                {
+                                        //it doesn't exist yet
+                                        node = new Node();
+                                }
+                                MappingApiToModel.mapNode(apiClerk.getNode(), node);
                                 modelClerk.setNode(node);
                                 Object existingUddiEntity = em.find(modelClerk.getClass(), modelClerk.getClerkName());
                                 if (existingUddiEntity != null) {
@@ -983,7 +988,7 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         if (existingUddiEntity
                              != null) {
 
-                                //TODO cascade delete all clerks tied to this node
+                                //TODO cascade delete all clerks tied to this node, confirm that it works
                                 em.remove(existingUddiEntity);
                                 found = true;
                         }
@@ -1260,8 +1265,8 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
                         if (!((Publisher) publisher).isAdmin()) {
                                 throw new UserMismatchException(new ErrorMessage("errors.AdminReqd"));
                         }
+                        new ValidateReplication(publisher).validateSetReplicationNodes(replicationConfiguration);
 
-                        //TODO validate inbound request
                         org.apache.juddi.model.ReplicationConfiguration model = new ReplicationConfiguration();
                         MappingApiToModel.mapReplicationConfiguration(replicationConfiguration, model, em);
                         em.persist(model);

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java
index 5f97703..e2fe3fd 100644
--- a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java
+++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java
@@ -463,9 +463,8 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
                                 if (!Excluded(changesAlreadySeen, r)) {
                                         ret.add(r);
                                 }
-                                
+
                         }
-                        
 
                         tx.rollback();
                         long procTime = System.currentTimeMillis() - startTime;
@@ -582,6 +581,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
          * @param body
          * @throws DispositionReportFaultMessage
          */
+        @Override
         public void transferCustody(TransferCustody body)
              throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
@@ -593,13 +593,43 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
                 EntityManager em = PersistenceManager.getEntityManager();
                 //EntityTransaction tx = em.getTransaction();
 
-                //The custodial node must verify that it has granted permission to transfer the entities identified and that this permission is still valid.  This operation is comprised of two steps:
-                //1.       Verification that the transferToken was issued by it, that it has not expired, that it represents the authority to transfer no more and no less than those entities identified by the businessKey and tModelKey elements and that all these entities are still valid and not yet transferred. The transferToken is invalidated if any of these conditions are not met.
-                //2.       If the conditions above are met, the custodial node will prevent any further changes to the entities identified by the businessKey and tModelKey elements identified. The entity will remain in this state until the replication stream indicates it has been successfully processed via the replication stream. 
-                //Upon successful verification of the custody transfer request by the custodial node, an empty message is returned by it indicating the success of the request and acknowledging the custody transfer. 
-                //Following the issue of the empty message, the custodial node will submit into the replication stream a changeRecordNewData providing in the operationalInfo, the nodeID accepting custody of the datum and the authorizedName of the publisher accepting ownership. The acknowledgmentRequested attribute of this change record MUST be set to "true".
-                //TODO enqueue Replication message
-                //Finally, the custodial node invalidates the transferToken in order to prevent additional calls of the transfer_entities API.
+                /**
+                 * The custodial node must verify that it has granted permission
+                 * to transfer the entities identified and that this permission
+                 * is still valid. This operation is comprised of two steps: 
+                 * 
+                 * 1.
+                 * Verification that the transferToken was issued by it, that it
+                 * has not expired, that it represents the authority to transfer
+                 * no more and no less than those entities identified by the
+                 * businessKey and tModelKey elements and that all these
+                 * entities are still valid and not yet transferred. The
+                 * transferToken is invalidated if any of these conditions are
+                 * not met. 
+                 * 
+                 * 2. If the conditions above are met, the custodial
+                 * node will prevent any further changes to the entities
+                 * identified by the businessKey and tModelKey elements
+                 * identified. The entity will remain in this state until the
+                 * replication stream indicates it has been successfully
+                 * processed via the replication stream. Upon successful
+                 * verification of the custody transfer request by the custodial
+                 * node, an empty message is returned by it indicating the
+                 * success of the request and acknowledging the custody
+                 * transfer. Following the issue of the empty message, the
+                 * custodial node will submit into the replication stream a
+                 * changeRecordNewData providing in the operationalInfo, the
+                 * nodeID accepting custody of the datum and the authorizedName
+                 * of the publisher accepting ownership. The
+                 * acknowledgmentRequested attribute of this change record MUST
+                 * be set to "true".
+                 *
+                 * TODO enqueue Replication message 
+                 * 
+                 * Finally, the custodial node
+                 * invalidates the transferToken in order to prevent additional
+                 * calls of the transfer_entities API.
+                 */
                 DiscardTransferToken dtt = new DiscardTransferToken();
                 dtt.setKeyBag(body.getKeyBag());
                 dtt.setTransferToken(body.getTransferToken());

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIServiceCounter.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIServiceCounter.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIServiceCounter.java
index b8c387b..42813a9 100644
--- a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIServiceCounter.java
+++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIServiceCounter.java
@@ -206,7 +206,7 @@ public class UDDIServiceCounter implements DynamicMBean, Serializable {
         }        
     }
     
-    //@Override, this is jdk1.6 style, please uncomment when we go 1.6
+    @Override
     public Object getAttribute(String attribute)
             throws AttributeNotFoundException, MBeanException,
             ReflectionException {
@@ -228,15 +228,14 @@ public class UDDIServiceCounter implements DynamicMBean, Serializable {
         return null;
     }
 
-    //@Override, this is jdk1.6 style, please uncomment when we go 1.6
+    @Override
     public void setAttribute(Attribute attribute)
             throws AttributeNotFoundException, InvalidAttributeValueException,
             MBeanException, ReflectionException {
-        // TODO Auto-generated method stub
         
     }
 
-    //@Override, this is jdk1.6 style, please uncomment when we go 1.6
+    @Override
     public AttributeList getAttributes(String[] attributes) {
         AttributeList attributeList = new AttributeList();
 
@@ -267,13 +266,12 @@ public class UDDIServiceCounter implements DynamicMBean, Serializable {
         return attributeList;
     }
 
-    //@Override, this is jdk1.6 style, please uncomment when we go 1.6
+    @Override
     public AttributeList setAttributes(AttributeList attributes) {
-        // TODO Auto-generated method stub
         return null;
     }
 
-    //@Override, this is jdk1.6 style, please uncomment when we go 1.6
+    @Override
     public Object invoke(String actionName, Object[] params, String[] signature)
             throws MBeanException, ReflectionException {
         if (actionName.equalsIgnoreCase(RESET_COUNTER)) {
@@ -284,7 +282,7 @@ public class UDDIServiceCounter implements DynamicMBean, Serializable {
         }
     }
 
-    //@Override, this is jdk1.6 style, please uncomment when we go 1.6
+    @Override
     public MBeanInfo getMBeanInfo() {
         // the extra 3 added are for totalApiQueries, faultApiQueries, and
         // successfulApiQueries

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
index 3c24102..ac5d19e 100644
--- a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
+++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
@@ -723,7 +723,7 @@ public class UDDISubscriptionImpl extends AuthenticatedService implements UDDISu
 			}
 			if (subscriptionFilter.getGetAssertionStatusReport() != null) {
 				// The coverage period doesn't apply here (basically because publisher assertions don't keep operational info).
-				
+				// TODO, JUDDI-873 edit they do now, rewrite this query
 				GetAssertionStatusReport getAssertionStatusReport = subscriptionFilter.getGetAssertionStatusReport();
 				
 				List<AssertionStatusItem> assertionList = PublicationHelper.getAssertionStatusItemList(publisher, getAssertionStatusReport.getCompletionStatus(), em);

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java b/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
index a271d7e..7297311 100644
--- a/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
+++ b/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
@@ -1411,7 +1411,9 @@ public class MappingApiToModel {
         }
 
         public static void mapReplicationConfiguration(ReplicationConfiguration replicationConfiguration, org.apache.juddi.model.ReplicationConfiguration model, EntityManager em) throws DispositionReportFaultMessage {
-
+                if (replicationConfiguration == null) {
+                        throw new ValueNotAllowedException(new ErrorMessage("errors.replication.configNull"));
+                }
                 model.setMaximumTimeToGetChanges(replicationConfiguration.getMaximumTimeToGetChanges());
                 model.setMaximumTimeToSyncRegistry(replicationConfiguration.getMaximumTimeToSyncRegistry());
                 model.setSerialNumber(null);
@@ -1420,7 +1422,9 @@ public class MappingApiToModel {
                 //2002 03 04 1859Z
                 SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddkkmmZ");
                 model.setTimeOfConfigurationUpdate(sdf.format(new Date()));
-                model.setContact(mapContact(replicationConfiguration.getRegistryContact().getContact()));
+                if (replicationConfiguration.getRegistryContact() != null) {
+                        model.setContact(mapContact(replicationConfiguration.getRegistryContact().getContact()));
+                }
                 model.setCommunicationGraph(mapCommunicationGraph(replicationConfiguration.getCommunicationGraph(), em));
                 model.setOperator(mapOperators(replicationConfiguration.getOperator()));
                 if (replicationConfiguration.getSignature() != null) {
@@ -1470,16 +1474,22 @@ public class MappingApiToModel {
                         }
                         model.getNode().add(find);
                 }
-                if (communicationGraph.getEdge() != null) {
+                if (communicationGraph.getEdge() != null && !communicationGraph.getEdge().isEmpty()) {
                         List<Edge> ret = new ArrayList<Edge>();
                         for (int i = 0; i < communicationGraph.getEdge().size(); i++) {
                                 Edge e = new Edge();
                                 e.setCommunicationGraph(model);
+                                if (communicationGraph.getEdge().get(i).getMessageReceiver() == null) {
+                                        throw new ValueNotAllowedException(new ErrorMessage("errors.replication.configNodeNotFound", communicationGraph.getEdge().get(i).getMessageReceiver()));
+                                }
                                 Node find = em.find(org.apache.juddi.model.Node.class, communicationGraph.getEdge().get(i).getMessageReceiver());
                                 if (find == null) {
                                         throw new ValueNotAllowedException(new ErrorMessage("errors.replication.configNodeNotFound", communicationGraph.getEdge().get(i).getMessageReceiver()));
                                 }
                                 e.setMessageReceiver(find);
+                                if (communicationGraph.getEdge().get(i).getMessageSender() == null) {
+                                        throw new ValueNotAllowedException(new ErrorMessage("errors.replication.configNodeNotFound", communicationGraph.getEdge().get(i).getMessageReceiver()));
+                                }
                                 find = em.find(org.apache.juddi.model.Node.class, communicationGraph.getEdge().get(i).getMessageSender());
                                 if (find == null) {
                                         throw new ValueNotAllowedException(new ErrorMessage("errors.replication.configNodeNotFound", communicationGraph.getEdge().get(i).getMessageSender()));
@@ -1540,7 +1550,6 @@ public class MappingApiToModel {
                         if (!api.get(i).getKeyInfo().isEmpty()) {
                                 op.setKeyInfo(new ArrayList<KeyInfo>());
                                 for (int k = 0; k < api.get(i).getKeyInfo().size(); k++) {
-                                        //TODO api.get(i).getKeyInfo().get(k)
                                         org.apache.juddi.model.KeyInfo modelKeyInfo = new KeyInfo();
                                         modelKeyInfo.setXmlID(api.get(i).getKeyInfo().get(i).getId());
                                         modelKeyInfo.setKeyDataValue(new ArrayList<KeyDataValue>());


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


[8/9] juddi git commit: JUDDI-241 Adding additional changes required by replication api. Not all tests pass on juddi api

Posted by al...@apache.org.
http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java b/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
index e9bf41a..8a4f1c1 100644
--- a/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
+++ b/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
@@ -14,7 +14,6 @@
  * limitations under the License.
  *
  */
-
 package org.apache.juddi.mapping;
 
 import java.math.BigInteger;
@@ -98,1088 +97,1106 @@ import org.w3c.dom.Element;
  * @author <a href="mailto:kstam@apache.org">Kurt T Stam</a>
  */
 public class MappingModelToApi {
-	private static Log logger = LogFactory.getLog(MappingModelToApi.class);
-
-	
-	public static void mapPublisher(org.apache.juddi.model.Publisher modelPublisher, 
-									org.apache.juddi.api_v3.Publisher apiPublisher) 
-				   throws DispositionReportFaultMessage {
-
-		apiPublisher.setAuthorizedName(modelPublisher.getAuthorizedName());
-		apiPublisher.setPublisherName(modelPublisher.getPublisherName());
-		apiPublisher.setEmailAddress(modelPublisher.getEmailAddress());
-		apiPublisher.setIsAdmin(modelPublisher.getIsAdmin());
-		apiPublisher.setIsEnabled(modelPublisher.getIsEnabled());
-		apiPublisher.setMaxBindingsPerService(modelPublisher.getMaxBindingsPerService());
-		apiPublisher.setMaxBusinesses(modelPublisher.getMaxBusinesses());
-		apiPublisher.setMaxServicePerBusiness(modelPublisher.getMaxServicesPerBusiness());
-		apiPublisher.setMaxTModels(modelPublisher.getMaxTmodels());
+
+        private static Log logger = LogFactory.getLog(MappingModelToApi.class);
+
+        public static void mapPublisher(org.apache.juddi.model.Publisher modelPublisher,
+             org.apache.juddi.api_v3.Publisher apiPublisher)
+             throws DispositionReportFaultMessage {
+
+                apiPublisher.setAuthorizedName(modelPublisher.getAuthorizedName());
+                apiPublisher.setPublisherName(modelPublisher.getPublisherName());
+                apiPublisher.setEmailAddress(modelPublisher.getEmailAddress());
+                apiPublisher.setIsAdmin(modelPublisher.getIsAdmin());
+                apiPublisher.setIsEnabled(modelPublisher.getIsEnabled());
+                apiPublisher.setMaxBindingsPerService(modelPublisher.getMaxBindingsPerService());
+                apiPublisher.setMaxBusinesses(modelPublisher.getMaxBusinesses());
+                apiPublisher.setMaxServicePerBusiness(modelPublisher.getMaxServicesPerBusiness());
+                apiPublisher.setMaxTModels(modelPublisher.getMaxTmodels());
                 mapSignature(modelPublisher.getSignatures(), apiPublisher.getSignature());
-	}
-	
-	public static void mapBusinessEntity(org.apache.juddi.model.BusinessEntity modelBusinessEntity, 
-										 org.uddi.api_v3.BusinessEntity apiBusinessEntity) 
-				   throws DispositionReportFaultMessage {
-
-		apiBusinessEntity.setBusinessKey(modelBusinessEntity.getEntityKey());
-		
-		mapBusinessNames(modelBusinessEntity.getBusinessNames(), apiBusinessEntity.getName());
-		mapBusinessDescriptions(modelBusinessEntity.getBusinessDescrs(), apiBusinessEntity.getDescription());
-
-		mapDiscoveryUrls(modelBusinessEntity.getDiscoveryUrls(), apiBusinessEntity.getDiscoveryURLs(), apiBusinessEntity);
-		mapContacts(modelBusinessEntity.getContacts(), apiBusinessEntity.getContacts(), apiBusinessEntity);
-		mapBusinessIdentifiers(modelBusinessEntity.getBusinessIdentifiers(), apiBusinessEntity.getIdentifierBag(), apiBusinessEntity);
-		apiBusinessEntity.setCategoryBag(mapCategoryBag(modelBusinessEntity.getCategoryBag(), apiBusinessEntity.getCategoryBag()));
-		
-		mapBusinessServices(modelBusinessEntity.getBusinessServices(), modelBusinessEntity.getServiceProjections(), apiBusinessEntity.getBusinessServices(), apiBusinessEntity);
-	
+        }
+
+        public static void mapBusinessEntity(org.apache.juddi.model.BusinessEntity modelBusinessEntity,
+             org.uddi.api_v3.BusinessEntity apiBusinessEntity)
+             throws DispositionReportFaultMessage {
+
+                apiBusinessEntity.setBusinessKey(modelBusinessEntity.getEntityKey());
+
+                mapBusinessNames(modelBusinessEntity.getBusinessNames(), apiBusinessEntity.getName());
+                mapBusinessDescriptions(modelBusinessEntity.getBusinessDescrs(), apiBusinessEntity.getDescription());
+
+                mapDiscoveryUrls(modelBusinessEntity.getDiscoveryUrls(), apiBusinessEntity.getDiscoveryURLs(), apiBusinessEntity);
+                mapContacts(modelBusinessEntity.getContacts(), apiBusinessEntity.getContacts(), apiBusinessEntity);
+                mapBusinessIdentifiers(modelBusinessEntity.getBusinessIdentifiers(), apiBusinessEntity.getIdentifierBag(), apiBusinessEntity);
+                apiBusinessEntity.setCategoryBag(mapCategoryBag(modelBusinessEntity.getCategoryBag(), apiBusinessEntity.getCategoryBag()));
+
+                mapBusinessServices(modelBusinessEntity.getBusinessServices(), modelBusinessEntity.getServiceProjections(), apiBusinessEntity.getBusinessServices(), apiBusinessEntity);
+
                 mapSignature(modelBusinessEntity.getSignatures(), apiBusinessEntity.getSignature());
-	}
+        }
 
         public static void mapSignature(List<org.apache.juddi.model.Signature> signatureList,
-										List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatureList) 
-				   throws DispositionReportFaultMessage {
-            apiSignatureList.clear();
-            for (org.apache.juddi.model.Signature modelSig : signatureList) {
-                SignatureType apiSignature = new SignatureType();
-                apiSignature.setId(modelSig.getXmlID());
-                
-                SignedInfo modelSignedInfo = modelSig.getSignedInfo();
-                SignedInfoType apiSignedInfoType = new SignedInfoType();
-                apiSignature.setSignedInfo(apiSignedInfoType);
-                // Canonicalization method
-                CanonicalizationMethod modelCanonMethod = modelSignedInfo.getCanonicalizationMethod();
-                CanonicalizationMethodType apiCanonMethod = new CanonicalizationMethodType();
-                apiCanonMethod.setAlgorithm(modelCanonMethod.getAlgorithm());
-                apiSignedInfoType.setCanonicalizationMethod(apiCanonMethod);
-                
-                // Signature Method
-                String sigAlg = modelSignedInfo.getSignatureMethod().getAlgorithm();
-                SignatureMethodType apiSigMethod = new SignatureMethodType();
-                apiSigMethod.setAlgorithm(sigAlg);
-                apiSignedInfoType.setSignatureMethod(apiSigMethod);
-                
-                // References
-                List<Reference> modelReferenceList = modelSignedInfo.getReference();
-                List<ReferenceType> apiReferenceList = apiSignedInfoType.getReference();
-                for (Reference modelRef : modelReferenceList) {
-                    ReferenceType apiRef = new ReferenceType();
-                    String refUri = modelRef.getUri();
-                    if (refUri == null) {
-                        refUri = "";
-                    }
-                    apiRef.setURI(refUri);
-                    
-                    List<SignatureTransform> modelSigTransformList = modelRef.getTransforms();
-                    TransformsType apiTransformsType = apiRef.getTransforms();
-                    if (apiTransformsType == null) {
-                        apiTransformsType = new TransformsType();
-                        apiRef.setTransforms(apiTransformsType);
-                    }
-                    List<TransformType> apiTransformList = apiTransformsType.getTransform();
-                    for (SignatureTransform modelSigTransform : modelSigTransformList) {
-                        String modelTransformAlgStr = modelSigTransform.getTransform();
-                        TransformType apiTransform = new TransformType();
-                        apiTransform.setAlgorithm(modelTransformAlgStr);
-                        
-                        List<SignatureTransformDataValue> sigTransformSDVList = modelSigTransform.getSignatureTransformDataValue();
-                        for (SignatureTransformDataValue sigTransformSDV : sigTransformSDVList) {
-                            String type = sigTransformSDV.getContentType();
-                            byte[] xformBytes = sigTransformSDV.getContentBytes();
-                            Object transformObject = convertDataToTransformContent(type, xformBytes);
-                            apiTransform.getContent().add(transformObject);
+             List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatureList)
+             throws DispositionReportFaultMessage {
+                apiSignatureList.clear();
+                for (org.apache.juddi.model.Signature modelSig : signatureList) {
+                        SignatureType apiSignature = new SignatureType();
+                        apiSignature.setId(modelSig.getXmlID());
+
+                        SignedInfo modelSignedInfo = modelSig.getSignedInfo();
+                        SignedInfoType apiSignedInfoType = new SignedInfoType();
+                        apiSignature.setSignedInfo(apiSignedInfoType);
+                        // Canonicalization method
+                        CanonicalizationMethod modelCanonMethod = modelSignedInfo.getCanonicalizationMethod();
+                        CanonicalizationMethodType apiCanonMethod = new CanonicalizationMethodType();
+                        apiCanonMethod.setAlgorithm(modelCanonMethod.getAlgorithm());
+                        apiSignedInfoType.setCanonicalizationMethod(apiCanonMethod);
+
+                        // Signature Method
+                        String sigAlg = modelSignedInfo.getSignatureMethod().getAlgorithm();
+                        SignatureMethodType apiSigMethod = new SignatureMethodType();
+                        apiSigMethod.setAlgorithm(sigAlg);
+                        apiSignedInfoType.setSignatureMethod(apiSigMethod);
+
+                        // References
+                        List<Reference> modelReferenceList = modelSignedInfo.getReference();
+                        List<ReferenceType> apiReferenceList = apiSignedInfoType.getReference();
+                        for (Reference modelRef : modelReferenceList) {
+                                ReferenceType apiRef = new ReferenceType();
+                                String refUri = modelRef.getUri();
+                                if (refUri == null) {
+                                        refUri = "";
+                                }
+                                apiRef.setURI(refUri);
+
+                                List<SignatureTransform> modelSigTransformList = modelRef.getTransforms();
+                                TransformsType apiTransformsType = apiRef.getTransforms();
+                                if (apiTransformsType == null) {
+                                        apiTransformsType = new TransformsType();
+                                        apiRef.setTransforms(apiTransformsType);
+                                }
+                                List<TransformType> apiTransformList = apiTransformsType.getTransform();
+                                for (SignatureTransform modelSigTransform : modelSigTransformList) {
+                                        String modelTransformAlgStr = modelSigTransform.getTransform();
+                                        TransformType apiTransform = new TransformType();
+                                        apiTransform.setAlgorithm(modelTransformAlgStr);
+
+                                        List<SignatureTransformDataValue> sigTransformSDVList = modelSigTransform.getSignatureTransformDataValue();
+                                        for (SignatureTransformDataValue sigTransformSDV : sigTransformSDVList) {
+                                                String type = sigTransformSDV.getContentType();
+                                                byte[] xformBytes = sigTransformSDV.getContentBytes();
+                                                Object transformObject = convertDataToTransformContent(type, xformBytes);
+                                                apiTransform.getContent().add(transformObject);
+                                        }
+
+                                        apiTransformList.add(apiTransform);
+                                }
+
+                                String digestMethodStr = modelRef.getDigestMethod();
+                                byte[] digestValBytes = modelRef.getDigestValue();
+
+                                DigestMethodType apiDigestMethod = new DigestMethodType();
+                                apiDigestMethod.setAlgorithm(digestMethodStr);
+                                apiRef.setDigestMethod(apiDigestMethod);
+                                apiRef.setDigestValue(digestValBytes);
+
+                                apiReferenceList.add(apiRef);
                         }
-                        
-                        apiTransformList.add(apiTransform);
-                    }
-                    
-                    String digestMethodStr = modelRef.getDigestMethod();
-                    byte[] digestValBytes = modelRef.getDigestValue();
-                    
-                    DigestMethodType apiDigestMethod = new DigestMethodType();
-                    apiDigestMethod.setAlgorithm(digestMethodStr);
-                    apiRef.setDigestMethod(apiDigestMethod);
-                    apiRef.setDigestValue(digestValBytes);
-                    
-                    apiReferenceList.add(apiRef);
-                }
-                
-                // Signature Value
-                SignatureValueType apiSignatureValue = new SignatureValueType();
-                SignatureValue modelSigValue = modelSig.getSignatureValue();
-                apiSignatureValue.setId(modelSigValue.getXmlID());
-                apiSignatureValue.setValue(modelSigValue.getValue());
-                
-                apiSignature.setSignatureValue(apiSignatureValue);
-                
-                KeyInfoType apiKeyInfo = new KeyInfoType();
-                KeyInfo modelKeyInfo = modelSig.getKeyInfo();
-                apiKeyInfo.setId(modelKeyInfo.getXmlID());
-                
-                List<KeyDataValue> modelKeyDataValueList = modelKeyInfo.getKeyDataValue();
-                List<Object> apiX509KeyInfoList = apiKeyInfo.getContent();
-                mapModelKeyDataValue(modelKeyDataValueList, apiX509KeyInfoList);
-                apiSignature.setKeyInfo(apiKeyInfo);
-                apiSignatureList.add(apiSignature);
-            }
+
+                        // Signature Value
+                        SignatureValueType apiSignatureValue = new SignatureValueType();
+                        SignatureValue modelSigValue = modelSig.getSignatureValue();
+                        apiSignatureValue.setId(modelSigValue.getXmlID());
+                        apiSignatureValue.setValue(modelSigValue.getValue());
+
+                        apiSignature.setSignatureValue(apiSignatureValue);
+
+                        KeyInfoType apiKeyInfo = new KeyInfoType();
+                        KeyInfo modelKeyInfo = modelSig.getKeyInfo();
+                        apiKeyInfo.setId(modelKeyInfo.getXmlID());
+
+                        List<KeyDataValue> modelKeyDataValueList = modelKeyInfo.getKeyDataValue();
+                        List<Object> apiX509KeyInfoList = apiKeyInfo.getContent();
+                        mapModelKeyDataValue(modelKeyDataValueList, apiX509KeyInfoList);
+                        apiSignature.setKeyInfo(apiKeyInfo);
+                        apiSignatureList.add(apiSignature);
+                }
         }
-        
+
         private static void mapModelKeyDataValue(List<KeyDataValue> modelKeyDataValueList, List<Object> parentKeyDataList) {
-            for (KeyDataValue modelKeyDataValue : modelKeyDataValueList) {
-                String tagName = modelKeyDataValue.getKeyDataName();
-                String dataType = modelKeyDataValue.getKeyDataType();
-                byte[] contentBytes = modelKeyDataValue.getKeyDataValueBytes();
-                String contentStr = modelKeyDataValue.getKeyDataValueString();
-                Object contents = contentBytes != null ? contentBytes : contentStr;
-                
-                if (contents == null) {
-                    List<Object> childKeyDataList = new ArrayList<Object>();
-                    if (dataType.equals(X509DataType.class.getSimpleName())) {
-                        X509DataType x509DataType = new X509DataType();
-                        mapModelKeyDataValue(modelKeyDataValue.getKeyDataValueList(), childKeyDataList);
-                        x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().addAll(childKeyDataList);
-                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), X509DataType.class, x509DataType);
-                        parentKeyDataList.add(dataJAXB);
-                    } else if (dataType.equals(RetrievalMethodType.class.getSimpleName())) {
-                        RetrievalMethodType retrievalMethodType = new RetrievalMethodType();
-                        TransformsType transformsType = new TransformsType();
-                        for (KeyDataValue retrievalMethodKDV : modelKeyDataValue.getKeyDataValueList()) {
-                            if (retrievalMethodKDV.getKeyDataName().equals("Transform")) {
-                                TransformType tType = new TransformType();
-                                tType.setAlgorithm(retrievalMethodKDV.getKeyDataValueString());
-                                
-                                for (KeyDataValue transformContentKDV: retrievalMethodKDV.getKeyDataValueList()) {
-                                    String type = transformContentKDV.getKeyDataType();
-                                    byte[] xformBytes = transformContentKDV.getKeyDataValueBytes();
-                                    Object transformObject = convertDataToTransformContent(type, xformBytes);
-                                    tType.getContent().add(transformObject);
+                for (KeyDataValue modelKeyDataValue : modelKeyDataValueList) {
+                        String tagName = modelKeyDataValue.getKeyDataName();
+                        String dataType = modelKeyDataValue.getKeyDataType();
+                        byte[] contentBytes = modelKeyDataValue.getKeyDataValueBytes();
+                        String contentStr = modelKeyDataValue.getKeyDataValueString();
+                        Object contents = contentBytes != null ? contentBytes : contentStr;
+
+                        if (contents == null) {
+                                List<Object> childKeyDataList = new ArrayList<Object>();
+                                if (dataType.equals(X509DataType.class.getSimpleName())) {
+                                        X509DataType x509DataType = new X509DataType();
+                                        mapModelKeyDataValue(modelKeyDataValue.getKeyDataValueList(), childKeyDataList);
+                                        x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName().addAll(childKeyDataList);
+                                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), X509DataType.class, x509DataType);
+                                        parentKeyDataList.add(dataJAXB);
+                                } else if (dataType.equals(RetrievalMethodType.class.getSimpleName())) {
+                                        RetrievalMethodType retrievalMethodType = new RetrievalMethodType();
+                                        TransformsType transformsType = new TransformsType();
+                                        for (KeyDataValue retrievalMethodKDV : modelKeyDataValue.getKeyDataValueList()) {
+                                                if (retrievalMethodKDV.getKeyDataName().equals("Transform")) {
+                                                        TransformType tType = new TransformType();
+                                                        tType.setAlgorithm(retrievalMethodKDV.getKeyDataValueString());
+
+                                                        for (KeyDataValue transformContentKDV : retrievalMethodKDV.getKeyDataValueList()) {
+                                                                String type = transformContentKDV.getKeyDataType();
+                                                                byte[] xformBytes = transformContentKDV.getKeyDataValueBytes();
+                                                                Object transformObject = convertDataToTransformContent(type, xformBytes);
+                                                                tType.getContent().add(transformObject);
+                                                        }
+
+                                                        transformsType.getTransform().add(tType);
+                                                } else if (retrievalMethodKDV.getKeyDataName().equals("Type")) {
+                                                        retrievalMethodType.setType(retrievalMethodKDV.getKeyDataValueString());
+                                                } else if (retrievalMethodKDV.getKeyDataName().equals("URI")) {
+                                                        retrievalMethodType.setURI(retrievalMethodKDV.getKeyDataValueString());
+                                                } else {
+                                                        throw new RuntimeException("Unrecognized key data type: " + retrievalMethodKDV.getKeyDataType());
+                                                }
+                                        }
+                                        if (transformsType.getTransform() != null && !transformsType.getTransform().isEmpty()) {
+                                                retrievalMethodType.setTransforms(transformsType);
+                                        }
+                                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), RetrievalMethodType.class, retrievalMethodType);
+                                        parentKeyDataList.add(dataJAXB);
+                                } else if (dataType.equals(PGPDataType.class.getSimpleName())) {
+                                        PGPDataType pgpDataType = new PGPDataType();
+
+                                        for (KeyDataValue pgpDataKDV : modelKeyDataValue.getKeyDataValueList()) {
+                                                String pgpDataTagName = pgpDataKDV.getKeyDataName();
+                                                Object pgpDataContents = pgpDataKDV.getKeyDataValueBytes() != null ? pgpDataKDV.getKeyDataValueBytes() : pgpDataKDV.getKeyDataValueString();
+                                                Class pgpDataClazz = pgpDataContents.getClass();
+                                                JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", pgpDataTagName), pgpDataClazz, pgpDataContents);
+                                                pgpDataType.getContent().add(jaxb);
+                                        }
+
+                                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), PGPDataType.class, pgpDataType);
+                                        parentKeyDataList.add(dataJAXB);
+                                } else if (dataType.equals(SPKIDataType.class.getSimpleName())) {
+                                        SPKIDataType spkiDataType = new SPKIDataType();
+
+                                        for (KeyDataValue spkiDataKDV : modelKeyDataValue.getKeyDataValueList()) {
+                                                String spkiDataTagName = spkiDataKDV.getKeyDataName();
+                                                Object spkiDataContents = spkiDataKDV.getKeyDataValueBytes() != null ? spkiDataKDV.getKeyDataValueBytes() : spkiDataKDV.getKeyDataValueString();
+                                                Class spkiDataClazz = spkiDataContents.getClass();
+                                                JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", spkiDataTagName), spkiDataClazz, spkiDataContents);
+                                                spkiDataType.getSPKISexpAndAny().add(jaxb);
+                                        }
+
+                                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), SPKIDataType.class, spkiDataType);
+                                        parentKeyDataList.add(dataJAXB);
+                                } else if (dataType.equals(KeyValueType.class.getSimpleName())) {
+                                        KeyValueType keyValueType = new KeyValueType();
+                                        for (KeyDataValue keyValueDataKDV : modelKeyDataValue.getKeyDataValueList()) {
+                                                for (KeyDataValue keyValueDataChildKDV : keyValueDataKDV.getKeyDataValueList()) {
+                                                        String keyDataDataType = keyValueDataChildKDV.getKeyDataType();
+                                                        if (keyDataDataType.equals("DSAKeyValueType")) {
+                                                                DSAKeyValueType dsaKeyValueType = new DSAKeyValueType();
+                                                                for (KeyDataValue dsaKDV : keyValueDataChildKDV.getKeyDataValueList()) {
+                                                                        if ("G".equals(dsaKDV.getKeyDataName())) {
+                                                                                dsaKeyValueType.setG(dsaKDV.getKeyDataValueBytes());
+                                                                        } else if ("P".equals(dsaKDV.getKeyDataName())) {
+                                                                                dsaKeyValueType.setP(dsaKDV.getKeyDataValueBytes());
+                                                                        } else if ("Q".equals(dsaKDV.getKeyDataName())) {
+                                                                                dsaKeyValueType.setQ(dsaKDV.getKeyDataValueBytes());
+                                                                        } else if ("Y".equals(dsaKDV.getKeyDataName())) {
+                                                                                dsaKeyValueType.setY(dsaKDV.getKeyDataValueBytes());
+                                                                        } else if ("J".equals(dsaKDV.getKeyDataName())) {
+                                                                                dsaKeyValueType.setJ(dsaKDV.getKeyDataValueBytes());
+                                                                        } else if ("Seed".equals(dsaKDV.getKeyDataName())) {
+                                                                                dsaKeyValueType.setSeed(dsaKDV.getKeyDataValueBytes());
+                                                                        } else if ("PgenCounter".equals(dsaKDV.getKeyDataName())) {
+                                                                                dsaKeyValueType.setPgenCounter(dsaKDV.getKeyDataValueBytes());
+                                                                        } else {
+                                                                                throw new RuntimeException("Unrecognized dsa type: " + dsaKDV.getKeyDataName());
+                                                                        }
+                                                                }
+                                                                JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", keyValueDataChildKDV.getKeyDataName()), DSAKeyValueType.class, dsaKeyValueType);
+                                                                keyValueType.getContent().add(jaxb);
+                                                        } else if (keyDataDataType.equals("RSAKeyValueType")) {
+                                                                RSAKeyValueType rsaKeyValueType = new RSAKeyValueType();
+                                                                for (KeyDataValue rsaKDV : keyValueDataChildKDV.getKeyDataValueList()) {
+                                                                        if ("Exponent".equals(rsaKDV.getKeyDataName())) {
+                                                                                rsaKeyValueType.setExponent(rsaKDV.getKeyDataValueBytes());
+                                                                        } else if ("Modulus".equals(rsaKDV.getKeyDataName())) {
+                                                                                rsaKeyValueType.setModulus(rsaKDV.getKeyDataValueBytes());
+                                                                        } else {
+                                                                                throw new RuntimeException("Unrecognized dsa type: " + rsaKDV.getKeyDataName());
+                                                                        }
+                                                                }
+                                                                JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", keyValueDataChildKDV.getKeyDataName()), RSAKeyValueType.class, rsaKeyValueType);
+                                                                keyValueType.getContent().add(jaxb);
+                                                        } else {
+                                                                throw new RuntimeException("Unrecognized element: " + keyDataDataType);
+                                                        }
+                                                }
+                                        }
+                                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), KeyValueType.class, keyValueType);
+                                        parentKeyDataList.add(dataJAXB);
+                                } else {
+                                        throw new RuntimeException("Unrecognized type: " + dataType);
+                                }
+                        } else {
+                                if (dataType != null && dataType.equals(X509IssuerSerialType.class.getSimpleName())) {
+                                        X509IssuerSerialType x509IssuerSerialType = new X509IssuerSerialType();
+                                        x509IssuerSerialType.setX509IssuerName(contentStr);
+                                        x509IssuerSerialType.setX509SerialNumber(new BigInteger(contentBytes));
+                                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), X509IssuerSerialType.class, x509IssuerSerialType);
+                                        parentKeyDataList.add(dataJAXB);
+                                } else {
+                                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), contents.getClass(), contents);
+                                        parentKeyDataList.add(dataJAXB);
                                 }
-                                
-                                transformsType.getTransform().add(tType);
-                            } else if (retrievalMethodKDV.getKeyDataName().equals("Type")) {
-                                retrievalMethodType.setType(retrievalMethodKDV.getKeyDataValueString());
-                            } else if (retrievalMethodKDV.getKeyDataName().equals("URI")) {
-                                retrievalMethodType.setURI(retrievalMethodKDV.getKeyDataValueString());
-                            } else {
-                                throw new RuntimeException("Unrecognized key data type: " + retrievalMethodKDV.getKeyDataType());
-                            }
-                        }
-                        if (transformsType.getTransform() != null && !transformsType.getTransform().isEmpty()) {
-                            retrievalMethodType.setTransforms(transformsType);
                         }
-                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), RetrievalMethodType.class, retrievalMethodType);
-                        parentKeyDataList.add(dataJAXB);   
-                    } else if (dataType.equals(PGPDataType.class.getSimpleName())) {
-                        PGPDataType pgpDataType = new PGPDataType();
-                        
-                        for (KeyDataValue pgpDataKDV : modelKeyDataValue.getKeyDataValueList()) {
-                            String pgpDataTagName = pgpDataKDV.getKeyDataName();
-                            Object pgpDataContents = pgpDataKDV.getKeyDataValueBytes() != null ? pgpDataKDV.getKeyDataValueBytes() : pgpDataKDV.getKeyDataValueString();
-                            Class pgpDataClazz = pgpDataContents.getClass();
-                            JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", pgpDataTagName), pgpDataClazz, pgpDataContents);
-                            pgpDataType.getContent().add(jaxb);
+                }
+        }
+
+        public static void mapBusinessNames(List<org.apache.juddi.model.BusinessName> modelNameList,
+             List<org.uddi.api_v3.Name> apiNameList)
+             throws DispositionReportFaultMessage {
+                apiNameList.clear();
+
+                for (org.apache.juddi.model.BusinessName modelName : modelNameList) {
+                        org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name();
+                        apiName.setLang(modelName.getLangCode());
+                        apiName.setValue(modelName.getName());
+                        apiNameList.add(apiName);
+                }
+        }
+
+        public static void mapBusinessDescriptions(List<org.apache.juddi.model.BusinessDescr> modelDescList,
+             List<org.uddi.api_v3.Description> apiDescList)
+             throws DispositionReportFaultMessage {
+                apiDescList.clear();
+
+                for (org.apache.juddi.model.BusinessDescr modelDesc : modelDescList) {
+                        org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description();
+                        apiDesc.setLang(modelDesc.getLangCode());
+                        apiDesc.setValue(modelDesc.getDescr());
+                        apiDescList.add(apiDesc);
+                }
+        }
+
+        public static void mapDiscoveryUrls(List<org.apache.juddi.model.DiscoveryUrl> modelDiscUrlList,
+             org.uddi.api_v3.DiscoveryURLs apiDiscUrls,
+             org.uddi.api_v3.BusinessEntity apiBusinessEntity)
+             throws DispositionReportFaultMessage {
+                if (modelDiscUrlList == null || modelDiscUrlList.size() == 0) {
+                        return;
+                }
+
+                if (apiDiscUrls == null) {
+                        apiDiscUrls = new org.uddi.api_v3.DiscoveryURLs();
+                }
+
+                List<org.uddi.api_v3.DiscoveryURL> apiDiscUrlList = apiDiscUrls.getDiscoveryURL();
+                apiDiscUrlList.clear();
+
+                for (org.apache.juddi.model.DiscoveryUrl modelDiscUrl : modelDiscUrlList) {
+                        org.uddi.api_v3.DiscoveryURL apiDiscUrl = new org.uddi.api_v3.DiscoveryURL();
+                        apiDiscUrl.setUseType(modelDiscUrl.getUseType());
+                        String discoveryURL = modelDiscUrl.getUrl();
+                        try {
+                                String baseUrl = AppConfig.getConfiguration().getString(Property.JUDDI_BASE_URL);
+                                if (baseUrl == null) {
+                                        logger.warn("Token '" + Property.JUDDI_BASE_URL + "' not found in the juddiv3.xml, defaulting to '"
+                                             + Property.DEFAULT_BASE_URL + "'");
+                                        baseUrl = Property.DEFAULT_BASE_URL;
+                                }
+                                discoveryURL = discoveryURL.replaceAll("\\$\\{" + Property.JUDDI_BASE_URL + "\\}", baseUrl);
+
+                                baseUrl = AppConfig.getConfiguration().getString(Property.JUDDI_BASE_URL_SECURE);
+                                if (baseUrl == null) {
+                                        logger.warn("Token '" + Property.JUDDI_BASE_URL_SECURE + "' not found in the juddiv3.xml, defaulting to '"
+                                             + Property.JUDDI_BASE_URL_SECURE + "'");
+                                        baseUrl = Property.DEFAULT_BASE_URL_SECURE;
+                                }
+                                discoveryURL = discoveryURL.replaceAll("\\$\\{" + Property.JUDDI_BASE_URL_SECURE + "\\}", baseUrl);
+
+                        } catch (ConfigurationException e) {
+                                logger.error(e.getMessage(), e);
                         }
-                        
-                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), PGPDataType.class, pgpDataType);
-                        parentKeyDataList.add(dataJAXB);   
-                    } else if (dataType.equals(SPKIDataType.class.getSimpleName())) {
-                        SPKIDataType spkiDataType = new SPKIDataType();
-                        
-                        for (KeyDataValue spkiDataKDV : modelKeyDataValue.getKeyDataValueList()) {
-                            String spkiDataTagName = spkiDataKDV.getKeyDataName();
-                            Object spkiDataContents = spkiDataKDV.getKeyDataValueBytes() != null ? spkiDataKDV.getKeyDataValueBytes() : spkiDataKDV.getKeyDataValueString();
-                            Class spkiDataClazz = spkiDataContents.getClass();
-                            JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", spkiDataTagName), spkiDataClazz, spkiDataContents);
-                            spkiDataType.getSPKISexpAndAny().add(jaxb);
+                        apiDiscUrl.setValue(discoveryURL);
+                        apiDiscUrlList.add(apiDiscUrl);
+                }
+                apiBusinessEntity.setDiscoveryURLs(apiDiscUrls);
+        }
+
+        public static void mapContacts(List<org.apache.juddi.model.Contact> modelContactList,
+             org.uddi.api_v3.Contacts apiContacts,
+             org.uddi.api_v3.BusinessEntity apiBusinessEntity)
+             throws DispositionReportFaultMessage {
+                if (modelContactList == null || modelContactList.size() == 0) {
+                        return;
+                }
+
+                if (apiContacts == null) {
+                        apiContacts = new org.uddi.api_v3.Contacts();
+                }
+
+                List<org.uddi.api_v3.Contact> apiContactList = apiContacts.getContact();
+                apiContactList.clear();
+
+                for (org.apache.juddi.model.Contact modelContact : modelContactList) {
+                        org.uddi.api_v3.Contact apiContact = new org.uddi.api_v3.Contact();
+                        apiContact.setUseType(modelContact.getUseType());
+
+                        mapPersonNames(modelContact.getPersonNames(), apiContact.getPersonName());
+                        mapContactDescriptions(modelContact.getContactDescrs(), apiContact.getDescription());
+                        mapContactEmails(modelContact.getEmails(), apiContact.getEmail());
+                        mapContactPhones(modelContact.getPhones(), apiContact.getPhone());
+                        mapContactAddresses(modelContact.getAddresses(), apiContact.getAddress());
+
+                        apiContactList.add(apiContact);
+                }
+                apiBusinessEntity.setContacts(apiContacts);
+        }
+
+        public static void mapContactDescriptions(List<org.apache.juddi.model.ContactDescr> modelDescList,
+             List<org.uddi.api_v3.Description> apiDescList)
+             throws DispositionReportFaultMessage {
+                apiDescList.clear();
+
+                for (org.apache.juddi.model.ContactDescr modelDesc : modelDescList) {
+                        org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description();
+                        apiDesc.setLang(modelDesc.getLangCode());
+                        apiDesc.setValue(modelDesc.getDescr());
+                        apiDescList.add(apiDesc);
+                }
+        }
+
+        public static void mapPersonNames(List<org.apache.juddi.model.PersonName> modelPersonNameList,
+             List<org.uddi.api_v3.PersonName> apiPersonNameList)
+             throws DispositionReportFaultMessage {
+                apiPersonNameList.clear();
+
+                for (org.apache.juddi.model.PersonName personName : modelPersonNameList) {
+                        org.uddi.api_v3.PersonName apiPersonName = new org.uddi.api_v3.PersonName();
+                        apiPersonName.setLang(personName.getLangCode());
+                        apiPersonName.setValue(personName.getName());
+                        apiPersonNameList.add(apiPersonName);
+                }
+        }
+
+        public static void mapContactEmails(List<org.apache.juddi.model.Email> modelEmailList,
+             List<org.uddi.api_v3.Email> apiEmailList)
+             throws DispositionReportFaultMessage {
+                apiEmailList.clear();
+
+                for (org.apache.juddi.model.Email modelEmail : modelEmailList) {
+                        org.uddi.api_v3.Email apiEmail = new org.uddi.api_v3.Email();
+                        apiEmail.setUseType(modelEmail.getUseType());
+                        apiEmail.setValue(modelEmail.getEmailAddress());
+                        apiEmailList.add(apiEmail);
+                }
+        }
+
+        public static void mapContactPhones(List<org.apache.juddi.model.Phone> modelPhoneList,
+             List<org.uddi.api_v3.Phone> apiPhoneList)
+             throws DispositionReportFaultMessage {
+                apiPhoneList.clear();
+
+                for (org.apache.juddi.model.Phone modelPhone : modelPhoneList) {
+                        org.uddi.api_v3.Phone apiPhone = new org.uddi.api_v3.Phone();
+                        apiPhone.setUseType(modelPhone.getUseType());
+                        apiPhone.setValue(modelPhone.getPhoneNumber());
+                        apiPhoneList.add(apiPhone);
+                }
+        }
+
+        public static void mapContactAddresses(List<org.apache.juddi.model.Address> modelAddressList,
+             List<org.uddi.api_v3.Address> apiAddressList)
+             throws DispositionReportFaultMessage {
+                apiAddressList.clear();
+
+                for (org.apache.juddi.model.Address modelAddress : modelAddressList) {
+                        org.uddi.api_v3.Address apiAddress = new org.uddi.api_v3.Address();
+                        apiAddress.setUseType(modelAddress.getUseType());
+                        apiAddress.setLang("");
+                        apiAddress.setSortCode(modelAddress.getSortCode());
+                        apiAddress.setTModelKey(modelAddress.getTmodelKey());
+
+                        mapAddressLines(modelAddress.getAddressLines(), apiAddress.getAddressLine());
+
+                        apiAddressList.add(apiAddress);
+                }
+        }
+
+        public static void mapAddressLines(List<org.apache.juddi.model.AddressLine> modelAddressLineList,
+             List<org.uddi.api_v3.AddressLine> apiAddressLineList)
+             throws DispositionReportFaultMessage {
+                apiAddressLineList.clear();
+
+                for (org.apache.juddi.model.AddressLine modelAddressLine : modelAddressLineList) {
+                        org.uddi.api_v3.AddressLine apiAddressLine = new org.uddi.api_v3.AddressLine();
+                        apiAddressLine.setKeyName(modelAddressLine.getKeyName());
+                        apiAddressLine.setKeyValue(modelAddressLine.getKeyValue());
+                        apiAddressLine.setValue(modelAddressLine.getLine());
+                        apiAddressLineList.add(apiAddressLine);
+                }
+        }
+
+        public static void mapBusinessIdentifiers(List<org.apache.juddi.model.BusinessIdentifier> modelIdentifierList,
+             org.uddi.api_v3.IdentifierBag apiIdentifierBag,
+             org.uddi.api_v3.BusinessEntity apiBusinessEntity)
+             throws DispositionReportFaultMessage {
+                if (modelIdentifierList == null || modelIdentifierList.size() == 0) {
+                        return;
+                }
+
+                if (apiIdentifierBag == null) {
+                        apiIdentifierBag = new org.uddi.api_v3.IdentifierBag();
+                }
+
+                List<org.uddi.api_v3.KeyedReference> apiKeyedRefList = apiIdentifierBag.getKeyedReference();
+                apiKeyedRefList.clear();
+
+                for (org.apache.juddi.model.BusinessIdentifier modelIdentifier : modelIdentifierList) {
+                        org.uddi.api_v3.KeyedReference apiKeyedRef = new org.uddi.api_v3.KeyedReference();
+                        apiKeyedRef.setTModelKey(modelIdentifier.getTmodelKeyRef());
+                        apiKeyedRef.setKeyName(modelIdentifier.getKeyName());
+                        apiKeyedRef.setKeyValue(modelIdentifier.getKeyValue());
+                        apiKeyedRefList.add(apiKeyedRef);
+                }
+                apiBusinessEntity.setIdentifierBag(apiIdentifierBag);
+        }
+
+        public static void mapBusinessServices(List<org.apache.juddi.model.BusinessService> modelBusinessServiceList,
+             List<org.apache.juddi.model.ServiceProjection> modelServiceProjectionList,
+             org.uddi.api_v3.BusinessServices apiBusinessServices,
+             org.uddi.api_v3.BusinessEntity apiBusinessEntity)
+             throws DispositionReportFaultMessage {
+
+                if (apiBusinessServices == null) {
+                        apiBusinessServices = new org.uddi.api_v3.BusinessServices();
+                }
+
+                List<org.uddi.api_v3.BusinessService> apiBusinessServiceList = apiBusinessServices.getBusinessService();
+                apiBusinessServiceList.clear();
+
+                if (modelBusinessServiceList != null && modelBusinessServiceList.size() > 0) {
+                        for (org.apache.juddi.model.BusinessService modelBusinessService : modelBusinessServiceList) {
+                                org.uddi.api_v3.BusinessService apiBusinessService = new org.uddi.api_v3.BusinessService();
+                                mapBusinessService(modelBusinessService, apiBusinessService);
+                                apiBusinessServiceList.add(apiBusinessService);
                         }
-                        
-                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), SPKIDataType.class, spkiDataType);
-                        parentKeyDataList.add(dataJAXB);
-                    } else if (dataType.equals(KeyValueType.class.getSimpleName())) {
-                        KeyValueType keyValueType = new KeyValueType();
-                        for (KeyDataValue keyValueDataKDV : modelKeyDataValue.getKeyDataValueList()) {
-                            for (KeyDataValue keyValueDataChildKDV : keyValueDataKDV.getKeyDataValueList()) {
-                                String keyDataDataType = keyValueDataChildKDV.getKeyDataType();
-                                if (keyDataDataType.equals("DSAKeyValueType")) {
-                                    DSAKeyValueType dsaKeyValueType = new DSAKeyValueType();
-                                    for (KeyDataValue dsaKDV : keyValueDataChildKDV.getKeyDataValueList()) {
-                                        if ("G".equals(dsaKDV.getKeyDataName())) {
-                                            dsaKeyValueType.setG(dsaKDV.getKeyDataValueBytes());
-                                        } else if ("P".equals(dsaKDV.getKeyDataName())) {
-                                            dsaKeyValueType.setP(dsaKDV.getKeyDataValueBytes());
-                                        } else if ("Q".equals(dsaKDV.getKeyDataName())) {
-                                            dsaKeyValueType.setQ(dsaKDV.getKeyDataValueBytes());
-                                        } else if ("Y".equals(dsaKDV.getKeyDataName())) {
-                                            dsaKeyValueType.setY(dsaKDV.getKeyDataValueBytes());
-                                        } else if ("J".equals(dsaKDV.getKeyDataName())) {
-                                            dsaKeyValueType.setJ(dsaKDV.getKeyDataValueBytes());
-                                        } else if ("Seed".equals(dsaKDV.getKeyDataName())) {
-                                            dsaKeyValueType.setSeed(dsaKDV.getKeyDataValueBytes());
-                                        } else if ("PgenCounter".equals(dsaKDV.getKeyDataName())) {
-                                            dsaKeyValueType.setPgenCounter(dsaKDV.getKeyDataValueBytes());
-                                        } else {
-                                            throw new RuntimeException("Unrecognized dsa type: " + dsaKDV.getKeyDataName());
-                                        } 
-                                    }
-                                    JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", keyValueDataChildKDV.getKeyDataName()), DSAKeyValueType.class, dsaKeyValueType);
-                                    keyValueType.getContent().add(jaxb);
-                                } else if (keyDataDataType.equals("RSAKeyValueType")) {
-                                    RSAKeyValueType rsaKeyValueType = new RSAKeyValueType();
-                                    for (KeyDataValue rsaKDV : keyValueDataChildKDV.getKeyDataValueList()) {
-                                        if ("Exponent".equals(rsaKDV.getKeyDataName())) {
-                                            rsaKeyValueType.setExponent(rsaKDV.getKeyDataValueBytes());
-                                        } else if ("Modulus".equals(rsaKDV.getKeyDataName())) {
-                                            rsaKeyValueType.setModulus(rsaKDV.getKeyDataValueBytes());
-                                        } else {
-                                            throw new RuntimeException("Unrecognized dsa type: " + rsaKDV.getKeyDataName());
-                                        } 
-                                    }
-                                    JAXBElement jaxb = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", keyValueDataChildKDV.getKeyDataName()), RSAKeyValueType.class, rsaKeyValueType);
-                                    keyValueType.getContent().add(jaxb);
-                                } else {
-                                    throw new RuntimeException("Unrecognized element: " + keyDataDataType);
-                                }
-                            }
+                }
+
+                if (modelServiceProjectionList != null && modelServiceProjectionList.size() > 0) {
+                        for (org.apache.juddi.model.ServiceProjection modelServiceProjection : modelServiceProjectionList) {
+                                org.uddi.api_v3.BusinessService apiBusinessService = new org.uddi.api_v3.BusinessService();
+                                mapBusinessService(modelServiceProjection.getBusinessService(), apiBusinessService);
+                                apiBusinessServiceList.add(apiBusinessService);
                         }
-                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), KeyValueType.class, keyValueType);
-                        parentKeyDataList.add(dataJAXB);
-                    } else {
-                        throw new RuntimeException("Unrecognized type: " + dataType);
-                    }
-                } else {
-                	 if (dataType!=null && dataType.equals(X509IssuerSerialType.class.getSimpleName())) {
-                     	X509IssuerSerialType x509IssuerSerialType = new X509IssuerSerialType();
-                     	x509IssuerSerialType.setX509IssuerName(contentStr);
-                     	x509IssuerSerialType.setX509SerialNumber(new BigInteger(contentBytes));
-                        JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), X509IssuerSerialType.class, x509IssuerSerialType);
-                        parentKeyDataList.add(dataJAXB);
-                	 } else {
-                		JAXBElement dataJAXB = new JAXBElement(new QName("http://www.w3.org/2000/09/xmldsig#", tagName), contents.getClass(), contents);
-                		parentKeyDataList.add(dataJAXB);
-                	 }
-                }
-            }
+                }
+
+                if (apiBusinessServiceList.size() > 0) {
+                        apiBusinessEntity.setBusinessServices(apiBusinessServices);
+                }
         }
-                
-	public static void mapBusinessNames(List<org.apache.juddi.model.BusinessName> modelNameList, 
-										List<org.uddi.api_v3.Name> apiNameList) 
-				   throws DispositionReportFaultMessage {
-		apiNameList.clear();
-
-		for (org.apache.juddi.model.BusinessName modelName : modelNameList) {
-			org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name();
-			apiName.setLang(modelName.getLangCode());
-			apiName.setValue(modelName.getName());
-			apiNameList.add(apiName);
-		}
-	}
-
-	public static void mapBusinessDescriptions(List<org.apache.juddi.model.BusinessDescr> modelDescList, 
-											   List<org.uddi.api_v3.Description> apiDescList) 
-				   throws DispositionReportFaultMessage {
-		apiDescList.clear();
-
-		for (org.apache.juddi.model.BusinessDescr modelDesc : modelDescList) {
-			org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description();
-			apiDesc.setLang(modelDesc.getLangCode());
-			apiDesc.setValue(modelDesc.getDescr());
-			apiDescList.add(apiDesc);
-		}
-	}
-
-	public static void mapDiscoveryUrls(List<org.apache.juddi.model.DiscoveryUrl> modelDiscUrlList, 
-										org.uddi.api_v3.DiscoveryURLs apiDiscUrls,
-										org.uddi.api_v3.BusinessEntity apiBusinessEntity) 
-				   throws DispositionReportFaultMessage {
-		if (modelDiscUrlList == null || modelDiscUrlList.size() == 0)
-			return;
-		
-		if (apiDiscUrls == null)
-			apiDiscUrls = new org.uddi.api_v3.DiscoveryURLs();
-
-		List<org.uddi.api_v3.DiscoveryURL> apiDiscUrlList = apiDiscUrls.getDiscoveryURL();
-		apiDiscUrlList.clear();
-		
-		for (org.apache.juddi.model.DiscoveryUrl modelDiscUrl : modelDiscUrlList) {
-			org.uddi.api_v3.DiscoveryURL apiDiscUrl = new org.uddi.api_v3.DiscoveryURL();
-			apiDiscUrl.setUseType(modelDiscUrl.getUseType());
-			String discoveryURL = modelDiscUrl.getUrl();
-			try {
-				String baseUrl = AppConfig.getConfiguration().getString(Property.JUDDI_BASE_URL);
-				if (baseUrl==null) {
-					logger.warn("Token '"+Property.JUDDI_BASE_URL+"' not found in the juddiv3.xml, defaulting to '" 
-							+ Property.DEFAULT_BASE_URL + "'");
-					baseUrl = Property.DEFAULT_BASE_URL;
-				}
-				discoveryURL = discoveryURL.replaceAll("\\$\\{"+Property.JUDDI_BASE_URL+"\\}", baseUrl);
-                                
-                                 baseUrl = AppConfig.getConfiguration().getString(Property.JUDDI_BASE_URL_SECURE);
-				if (baseUrl==null) {
-					logger.warn("Token '"+Property.JUDDI_BASE_URL_SECURE+"' not found in the juddiv3.xml, defaulting to '" 
-							+ Property.JUDDI_BASE_URL_SECURE + "'");
-					baseUrl = Property.DEFAULT_BASE_URL_SECURE;
-				}
-				discoveryURL = discoveryURL.replaceAll("\\$\\{"+Property.JUDDI_BASE_URL_SECURE+"\\}", baseUrl);
-                                
-			} catch (ConfigurationException e) {
-				logger.error(e.getMessage(),e);
-			}
-			apiDiscUrl.setValue(discoveryURL);
-			apiDiscUrlList.add(apiDiscUrl);
-		}
-		apiBusinessEntity.setDiscoveryURLs(apiDiscUrls);
-	}
-	
-	public static void mapContacts(List<org.apache.juddi.model.Contact> modelContactList, 
-								   org.uddi.api_v3.Contacts apiContacts,
-								   org.uddi.api_v3.BusinessEntity apiBusinessEntity) 
-				   throws DispositionReportFaultMessage {
-		if (modelContactList == null || modelContactList.size() == 0)
-			return;
-		
-		if (apiContacts == null)
-			apiContacts = new org.uddi.api_v3.Contacts();
-
-		List<org.uddi.api_v3.Contact> apiContactList = apiContacts.getContact();
-		apiContactList.clear();
-
-		for (org.apache.juddi.model.Contact modelContact : modelContactList) {
-			org.uddi.api_v3.Contact apiContact = new org.uddi.api_v3.Contact();
-			apiContact.setUseType(modelContact.getUseType());
-			
-			mapPersonNames(modelContact.getPersonNames(), apiContact.getPersonName());
-			mapContactDescriptions(modelContact.getContactDescrs(), apiContact.getDescription());
-			mapContactEmails(modelContact.getEmails(), apiContact.getEmail());
-			mapContactPhones(modelContact.getPhones(), apiContact.getPhone());
-			mapContactAddresses(modelContact.getAddresses(), apiContact.getAddress());
-			
-			apiContactList.add(apiContact);
-		}
-		apiBusinessEntity.setContacts(apiContacts);
-	}
-
-	public static void mapContactDescriptions(List<org.apache.juddi.model.ContactDescr> modelDescList, 
-											  List<org.uddi.api_v3.Description> apiDescList) 
-	throws DispositionReportFaultMessage {
-		apiDescList.clear();
-
-		for (org.apache.juddi.model.ContactDescr modelDesc : modelDescList) {
-			org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description();
-			apiDesc.setLang(modelDesc.getLangCode());
-			apiDesc.setValue(modelDesc.getDescr());
-			apiDescList.add(apiDesc);
-		}
-	}
-	
-	public static void mapPersonNames(List<org.apache.juddi.model.PersonName> modelPersonNameList, 
-			  List<org.uddi.api_v3.PersonName> apiPersonNameList) 
-	throws DispositionReportFaultMessage {
-		apiPersonNameList.clear();
-		
-		for (org.apache.juddi.model.PersonName personName : modelPersonNameList) {
-			org.uddi.api_v3.PersonName apiPersonName = new org.uddi.api_v3.PersonName();
-			apiPersonName.setLang(personName.getLangCode());
-			apiPersonName.setValue(personName.getName());
-			apiPersonNameList.add(apiPersonName);
-		}
-	}
-
-	public static void mapContactEmails(List<org.apache.juddi.model.Email> modelEmailList, 
-										List<org.uddi.api_v3.Email> apiEmailList) 
-				   throws DispositionReportFaultMessage {
-		apiEmailList.clear();
-
-		for (org.apache.juddi.model.Email modelEmail : modelEmailList) {
-			org.uddi.api_v3.Email apiEmail = new org.uddi.api_v3.Email();
-			apiEmail.setUseType(modelEmail.getUseType());
-			apiEmail.setValue(modelEmail.getEmailAddress());
-			apiEmailList.add(apiEmail);
-		}
-	}
-	
-	public static void mapContactPhones(List<org.apache.juddi.model.Phone> modelPhoneList, 
-										List<org.uddi.api_v3.Phone> apiPhoneList) 
-				   throws DispositionReportFaultMessage {
-		apiPhoneList.clear();
-
-		for (org.apache.juddi.model.Phone modelPhone : modelPhoneList) {
-			org.uddi.api_v3.Phone apiPhone = new org.uddi.api_v3.Phone();
-			apiPhone.setUseType(modelPhone.getUseType());
-			apiPhone.setValue(modelPhone.getPhoneNumber());
-			apiPhoneList.add(apiPhone);
-		}
-	}
-
-	public static void mapContactAddresses(List<org.apache.juddi.model.Address> modelAddressList, 
-										   List<org.uddi.api_v3.Address> apiAddressList) 
-				   throws DispositionReportFaultMessage {
-		apiAddressList.clear();
-
-		for (org.apache.juddi.model.Address modelAddress : modelAddressList) {
-			org.uddi.api_v3.Address apiAddress = new org.uddi.api_v3.Address();
-			apiAddress.setUseType(modelAddress.getUseType());
-			apiAddress.setLang("");
-			apiAddress.setSortCode(modelAddress.getSortCode());
-			apiAddress.setTModelKey(modelAddress.getTmodelKey());
-			
-			mapAddressLines(modelAddress.getAddressLines(), apiAddress.getAddressLine());
-			
-			apiAddressList.add(apiAddress);
-		}
-	}
-
-	public static void mapAddressLines(List<org.apache.juddi.model.AddressLine> modelAddressLineList, 
-									   List<org.uddi.api_v3.AddressLine> apiAddressLineList) 
-				   throws DispositionReportFaultMessage {
-		apiAddressLineList.clear();
-
-		for (org.apache.juddi.model.AddressLine modelAddressLine : modelAddressLineList) {
-			org.uddi.api_v3.AddressLine apiAddressLine = new org.uddi.api_v3.AddressLine();
-			apiAddressLine.setKeyName(modelAddressLine.getKeyName());
-			apiAddressLine.setKeyValue(modelAddressLine.getKeyValue());
-			apiAddressLine.setValue(modelAddressLine.getLine());
-			apiAddressLineList.add(apiAddressLine);
-		}
-	}
-
-	public static void mapBusinessIdentifiers(List<org.apache.juddi.model.BusinessIdentifier> modelIdentifierList, 
-											  org.uddi.api_v3.IdentifierBag apiIdentifierBag,
-											  org.uddi.api_v3.BusinessEntity apiBusinessEntity) 
-				   throws DispositionReportFaultMessage {
-		if (modelIdentifierList == null || modelIdentifierList.size() == 0)
-			return;
-		
-		if (apiIdentifierBag == null)
-			apiIdentifierBag = new org.uddi.api_v3.IdentifierBag();
-
-		List<org.uddi.api_v3.KeyedReference> apiKeyedRefList = apiIdentifierBag.getKeyedReference();
-		apiKeyedRefList.clear();
-
-		for (org.apache.juddi.model.BusinessIdentifier modelIdentifier : modelIdentifierList) {
-			org.uddi.api_v3.KeyedReference apiKeyedRef = new org.uddi.api_v3.KeyedReference();
-			apiKeyedRef.setTModelKey(modelIdentifier.getTmodelKeyRef());
-			apiKeyedRef.setKeyName(modelIdentifier.getKeyName());
-			apiKeyedRef.setKeyValue(modelIdentifier.getKeyValue());
-			apiKeyedRefList.add(apiKeyedRef);
-		}
-		apiBusinessEntity.setIdentifierBag(apiIdentifierBag);
-	}
-
-	public static void mapBusinessServices(List<org.apache.juddi.model.BusinessService> modelBusinessServiceList, 
-										   List<org.apache.juddi.model.ServiceProjection> modelServiceProjectionList,
-										   org.uddi.api_v3.BusinessServices apiBusinessServices,
-										   org.uddi.api_v3.BusinessEntity apiBusinessEntity) 
-				   throws DispositionReportFaultMessage {
-		
-		if (apiBusinessServices == null)
-			apiBusinessServices = new org.uddi.api_v3.BusinessServices();
-
-		List<org.uddi.api_v3.BusinessService> apiBusinessServiceList = apiBusinessServices.getBusinessService();
-		apiBusinessServiceList.clear();
-		
-		if (modelBusinessServiceList != null && modelBusinessServiceList.size() > 0) {
-			for (org.apache.juddi.model.BusinessService modelBusinessService : modelBusinessServiceList) {
-				org.uddi.api_v3.BusinessService apiBusinessService = new org.uddi.api_v3.BusinessService();
-				mapBusinessService(modelBusinessService, apiBusinessService);
-				apiBusinessServiceList.add(apiBusinessService);
-			}
-		}
-		
-		
-		if (modelServiceProjectionList != null && modelServiceProjectionList.size() > 0) {
-			for (org.apache.juddi.model.ServiceProjection modelServiceProjection : modelServiceProjectionList) {
-				org.uddi.api_v3.BusinessService apiBusinessService = new org.uddi.api_v3.BusinessService();
-				mapBusinessService(modelServiceProjection.getBusinessService(), apiBusinessService);
-				apiBusinessServiceList.add(apiBusinessService);
-			}
-		}
-		
-		if (apiBusinessServiceList.size() > 0)
-			apiBusinessEntity.setBusinessServices(apiBusinessServices);
-	}
-
-	public static void mapBusinessService(org.apache.juddi.model.BusinessService modelBusinessService, 
-										  org.uddi.api_v3.BusinessService apiBusinessService) 
-				   throws DispositionReportFaultMessage {
-
-		apiBusinessService.setBusinessKey(modelBusinessService.getBusinessEntity().getEntityKey());
-		apiBusinessService.setServiceKey(modelBusinessService.getEntityKey());
-
-		mapServiceNames(modelBusinessService.getServiceNames(), apiBusinessService.getName());
-		mapServiceDescriptions(modelBusinessService.getServiceDescrs(), apiBusinessService.getDescription());
-        mapBindingTemplates(modelBusinessService.getBindingTemplates(), apiBusinessService.getBindingTemplates(), apiBusinessService);
-		apiBusinessService.setCategoryBag(mapCategoryBag(modelBusinessService.getCategoryBag(), apiBusinessService.getCategoryBag()));
+
+        public static void mapBusinessService(org.apache.juddi.model.BusinessService modelBusinessService,
+             org.uddi.api_v3.BusinessService apiBusinessService)
+             throws DispositionReportFaultMessage {
+
+                apiBusinessService.setBusinessKey(modelBusinessService.getBusinessEntity().getEntityKey());
+                apiBusinessService.setServiceKey(modelBusinessService.getEntityKey());
+
+                mapServiceNames(modelBusinessService.getServiceNames(), apiBusinessService.getName());
+                mapServiceDescriptions(modelBusinessService.getServiceDescrs(), apiBusinessService.getDescription());
+                mapBindingTemplates(modelBusinessService.getBindingTemplates(), apiBusinessService.getBindingTemplates(), apiBusinessService);
+                apiBusinessService.setCategoryBag(mapCategoryBag(modelBusinessService.getCategoryBag(), apiBusinessService.getCategoryBag()));
 
                 mapSignature(modelBusinessService.getSignatures(), apiBusinessService.getSignature());
-	}
-
-	public static void mapServiceNames(List<org.apache.juddi.model.ServiceName> modelNameList, 
-									   List<org.uddi.api_v3.Name> apiNameList) 
-				   throws DispositionReportFaultMessage {
-		apiNameList.clear();
-
-		for (org.apache.juddi.model.ServiceName modelName : modelNameList) {
-			org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name();
-			apiName.setLang(modelName.getLangCode());
-			apiName.setValue(modelName.getName());
-			apiNameList.add(apiName);
-		}
-	}
-
-	public static void mapServiceDescriptions(List<org.apache.juddi.model.ServiceDescr> modelDescList, 
-											  List<org.uddi.api_v3.Description> apiDescList) 
-				   throws DispositionReportFaultMessage {
-		apiDescList.clear();
-
-		for (org.apache.juddi.model.ServiceDescr modelDesc : modelDescList) {
-			org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description();
-			apiDesc.setLang(modelDesc.getLangCode());
-			apiDesc.setValue(modelDesc.getDescr());
-			apiDescList.add(apiDesc);
-		}
-	}
-
-	public static void mapBindingTemplates(List<org.apache.juddi.model.BindingTemplate> modelBindingTemplateList, 
-										   org.uddi.api_v3.BindingTemplates apiBindingTemplates,
-										   org.uddi.api_v3.BusinessService apiBusinessService) 
-				   throws DispositionReportFaultMessage {
-		if (modelBindingTemplateList == null || modelBindingTemplateList.size() == 0)
-			return;
-		
-		if (apiBindingTemplates == null)
-			apiBindingTemplates = new org.uddi.api_v3.BindingTemplates();
-
-		List<org.uddi.api_v3.BindingTemplate> apiBindingTemplateList = apiBindingTemplates.getBindingTemplate();
-		apiBindingTemplateList.clear();
-
-		for (org.apache.juddi.model.BindingTemplate modelBindingTemplate : modelBindingTemplateList) {
-			org.uddi.api_v3.BindingTemplate apiBindingTemplate = new org.uddi.api_v3.BindingTemplate();
-			mapBindingTemplate(modelBindingTemplate, apiBindingTemplate);
-			apiBindingTemplateList.add(apiBindingTemplate);
-		}
-		apiBusinessService.setBindingTemplates(apiBindingTemplates);
-	}
-
-	public static void mapBindingTemplate(org.apache.juddi.model.BindingTemplate modelBindingTemplate, 
-										  org.uddi.api_v3.BindingTemplate apiBindingTemplate) 
-				   throws DispositionReportFaultMessage {
-
-		apiBindingTemplate.setServiceKey(modelBindingTemplate.getBusinessService().getEntityKey());
-		apiBindingTemplate.setBindingKey(modelBindingTemplate.getEntityKey());
-		org.uddi.api_v3.AccessPoint apiAccessPoint = new org.uddi.api_v3.AccessPoint();
-		apiAccessPoint.setUseType(modelBindingTemplate.getAccessPointType());
-		String accessPointValue = modelBindingTemplate.getAccessPointUrl();
-		if (accessPointValue!=null) {
-			try {
-				String baseUrl = AppConfig.getConfiguration().getString(Property.JUDDI_BASE_URL);
-				if (baseUrl==null) {
-					logger.warn("Token '"+Property.JUDDI_BASE_URL+"' not found in the juddiv3.xml, defaulting to '" 
-							+ Property.DEFAULT_BASE_URL + "'");
-					baseUrl = Property.DEFAULT_BASE_URL;
-				}
-				accessPointValue = accessPointValue.replaceAll("\\$\\{"+Property.JUDDI_BASE_URL+"\\}", baseUrl);
-                                
-                                 baseUrl = AppConfig.getConfiguration().getString(Property.JUDDI_BASE_URL_SECURE);
-				if (baseUrl==null) {
-					logger.warn("Token '"+Property.JUDDI_BASE_URL_SECURE+"' not found in the juddiv3.xml, defaulting to '" 
-							+ Property.JUDDI_BASE_URL_SECURE + "'");
-					baseUrl = Property.DEFAULT_BASE_URL_SECURE;
-				}
-				accessPointValue = accessPointValue.replaceAll("\\$\\{"+Property.JUDDI_BASE_URL_SECURE+"\\}", baseUrl);
-			} catch (ConfigurationException e) {
-				logger.error(e.getMessage(),e);
-			}
-		}
-		apiAccessPoint.setValue(accessPointValue);
-		apiBindingTemplate.setAccessPoint(apiAccessPoint);
-		if (modelBindingTemplate.getHostingRedirector()!=null) {
-			org.uddi.api_v3.HostingRedirector apiHost = new org.uddi.api_v3.HostingRedirector();
-			apiHost.setBindingKey(modelBindingTemplate.getHostingRedirector());
-			apiBindingTemplate.setHostingRedirector(apiHost);
-		}
-        mapTModelInstanceDetails(modelBindingTemplate.getTmodelInstanceInfos(), apiBindingTemplate.getTModelInstanceDetails(),apiBindingTemplate);
-		mapBindingDescriptions(modelBindingTemplate.getBindingDescrs(), apiBindingTemplate.getDescription());
-
-		apiBindingTemplate.setCategoryBag(mapCategoryBag(modelBindingTemplate.getCategoryBag(), apiBindingTemplate.getCategoryBag()));
+        }
+
+        public static void mapServiceNames(List<org.apache.juddi.model.ServiceName> modelNameList,
+             List<org.uddi.api_v3.Name> apiNameList)
+             throws DispositionReportFaultMessage {
+                apiNameList.clear();
+
+                for (org.apache.juddi.model.ServiceName modelName : modelNameList) {
+                        org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name();
+                        apiName.setLang(modelName.getLangCode());
+                        apiName.setValue(modelName.getName());
+                        apiNameList.add(apiName);
+                }
+        }
+
+        public static void mapServiceDescriptions(List<org.apache.juddi.model.ServiceDescr> modelDescList,
+             List<org.uddi.api_v3.Description> apiDescList)
+             throws DispositionReportFaultMessage {
+                apiDescList.clear();
+
+                for (org.apache.juddi.model.ServiceDescr modelDesc : modelDescList) {
+                        org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description();
+                        apiDesc.setLang(modelDesc.getLangCode());
+                        apiDesc.setValue(modelDesc.getDescr());
+                        apiDescList.add(apiDesc);
+                }
+        }
+
+        public static void mapBindingTemplates(List<org.apache.juddi.model.BindingTemplate> modelBindingTemplateList,
+             org.uddi.api_v3.BindingTemplates apiBindingTemplates,
+             org.uddi.api_v3.BusinessService apiBusinessService)
+             throws DispositionReportFaultMessage {
+                if (modelBindingTemplateList == null || modelBindingTemplateList.size() == 0) {
+                        return;
+                }
+
+                if (apiBindingTemplates == null) {
+                        apiBindingTemplates = new org.uddi.api_v3.BindingTemplates();
+                }
+
+                List<org.uddi.api_v3.BindingTemplate> apiBindingTemplateList = apiBindingTemplates.getBindingTemplate();
+                apiBindingTemplateList.clear();
+
+                for (org.apache.juddi.model.BindingTemplate modelBindingTemplate : modelBindingTemplateList) {
+                        org.uddi.api_v3.BindingTemplate apiBindingTemplate = new org.uddi.api_v3.BindingTemplate();
+                        mapBindingTemplate(modelBindingTemplate, apiBindingTemplate);
+                        apiBindingTemplateList.add(apiBindingTemplate);
+                }
+                apiBusinessService.setBindingTemplates(apiBindingTemplates);
+        }
+
+        public static void mapBindingTemplate(org.apache.juddi.model.BindingTemplate modelBindingTemplate,
+             org.uddi.api_v3.BindingTemplate apiBindingTemplate)
+             throws DispositionReportFaultMessage {
+
+                apiBindingTemplate.setServiceKey(modelBindingTemplate.getBusinessService().getEntityKey());
+                apiBindingTemplate.setBindingKey(modelBindingTemplate.getEntityKey());
+                org.uddi.api_v3.AccessPoint apiAccessPoint = new org.uddi.api_v3.AccessPoint();
+                apiAccessPoint.setUseType(modelBindingTemplate.getAccessPointType());
+                String accessPointValue = modelBindingTemplate.getAccessPointUrl();
+                if (accessPointValue != null) {
+                        try {
+                                String baseUrl = AppConfig.getConfiguration().getString(Property.JUDDI_BASE_URL);
+                                if (baseUrl == null) {
+                                        logger.warn("Token '" + Property.JUDDI_BASE_URL + "' not found in the juddiv3.xml, defaulting to '"
+                                             + Property.DEFAULT_BASE_URL + "'");
+                                        baseUrl = Property.DEFAULT_BASE_URL;
+                                }
+                                accessPointValue = accessPointValue.replaceAll("\\$\\{" + Property.JUDDI_BASE_URL + "\\}", baseUrl);
+
+                                baseUrl = AppConfig.getConfiguration().getString(Property.JUDDI_BASE_URL_SECURE);
+                                if (baseUrl == null) {
+                                        logger.warn("Token '" + Property.JUDDI_BASE_URL_SECURE + "' not found in the juddiv3.xml, defaulting to '"
+                                             + Property.JUDDI_BASE_URL_SECURE + "'");
+                                        baseUrl = Property.DEFAULT_BASE_URL_SECURE;
+                                }
+                                accessPointValue = accessPointValue.replaceAll("\\$\\{" + Property.JUDDI_BASE_URL_SECURE + "\\}", baseUrl);
+                        } catch (ConfigurationException e) {
+                                logger.error(e.getMessage(), e);
+                        }
+                }
+                apiAccessPoint.setValue(accessPointValue);
+                apiBindingTemplate.setAccessPoint(apiAccessPoint);
+                if (modelBindingTemplate.getHostingRedirector() != null) {
+                        org.uddi.api_v3.HostingRedirector apiHost = new org.uddi.api_v3.HostingRedirector();
+                        apiHost.setBindingKey(modelBindingTemplate.getHostingRedirector());
+                        apiBindingTemplate.setHostingRedirector(apiHost);
+                }
+                mapTModelInstanceDetails(modelBindingTemplate.getTmodelInstanceInfos(), apiBindingTemplate.getTModelInstanceDetails(), apiBindingTemplate);
+                mapBindingDescriptions(modelBindingTemplate.getBindingDescrs(), apiBindingTemplate.getDescription());
+
+                apiBindingTemplate.setCategoryBag(mapCategoryBag(modelBindingTemplate.getCategoryBag(), apiBindingTemplate.getCategoryBag()));
                 mapSignature(modelBindingTemplate.getSignatures(), apiBindingTemplate.getSignature());
-	}
-
-	public static void mapBindingDescriptions(List<org.apache.juddi.model.BindingDescr> modelDescList, 
-											  List<org.uddi.api_v3.Description> apiDescList) 
-			throws DispositionReportFaultMessage {
-		apiDescList.clear();
-
-		for (org.apache.juddi.model.BindingDescr modelDesc : modelDescList) {
-			org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description();
-			apiDesc.setLang(modelDesc.getLangCode());
-			apiDesc.setValue(modelDesc.getDescr());
-			apiDescList.add(apiDesc);
-		}
-	}
-
-	public static org.uddi.api_v3.CategoryBag mapCategoryBag(org.apache.juddi.model.CategoryBag modelCategoryBag, 
-															 org.uddi.api_v3.CategoryBag apiCategoryBag) 
-				   throws DispositionReportFaultMessage {
-
-		if (modelCategoryBag != null) {
-			if (apiCategoryBag == null)
-				apiCategoryBag = new org.uddi.api_v3.CategoryBag();
-			
-			for (org.apache.juddi.model.KeyedReference modelKeyedReference : modelCategoryBag.getKeyedReferences()) {
-				org.uddi.api_v3.KeyedReference apiKeyedReference = new org.uddi.api_v3.KeyedReference();
-				apiKeyedReference.setTModelKey(modelKeyedReference.getTmodelKeyRef());
-				apiKeyedReference.setKeyName(modelKeyedReference.getKeyName());
-				apiKeyedReference.setKeyValue(modelKeyedReference.getKeyValue());
-				apiCategoryBag.getKeyedReference().add(apiKeyedReference);
-			}
-			for (org.apache.juddi.model.KeyedReferenceGroup modelKeyedReferenceGroup : modelCategoryBag.getKeyedReferenceGroups()) {
-				org.uddi.api_v3.KeyedReferenceGroup apiKeyedReferenceGroup = new org.uddi.api_v3.KeyedReferenceGroup();
-	
-				mapKeyedReferenceGroup(modelKeyedReferenceGroup, apiKeyedReferenceGroup);
-				
-				apiCategoryBag.getKeyedReferenceGroup().add(apiKeyedReferenceGroup);
-			}
-		}
-		return apiCategoryBag;
-	}
-
-	public static void mapKeyedReferenceGroup(org.apache.juddi.model.KeyedReferenceGroup modelKeyedReferenceGroup, 
-											  org.uddi.api_v3.KeyedReferenceGroup apiKeyedReferenceGroup) 
-				   throws DispositionReportFaultMessage {
-
-		apiKeyedReferenceGroup.setTModelKey(modelKeyedReferenceGroup.getTmodelKey());
-
-		for (org.apache.juddi.model.KeyedReference modelKeyedReference : modelKeyedReferenceGroup.getKeyedReferences()) {
-			org.uddi.api_v3.KeyedReference apiKeyedReference = new org.uddi.api_v3.KeyedReference();
-			apiKeyedReference.setTModelKey(modelKeyedReference.getTmodelKeyRef());
-			apiKeyedReference.setKeyName(modelKeyedReference.getKeyName());
-			apiKeyedReference.setKeyValue(modelKeyedReference.getKeyValue());
-			apiKeyedReferenceGroup.getKeyedReference().add(apiKeyedReference);
-		}
-		
-	}
-	
-	public static void mapTModelInstanceDetails(List<org.apache.juddi.model.TmodelInstanceInfo> modelTModelInstInfoList, 
-												org.uddi.api_v3.TModelInstanceDetails apiTModelInstDetails,
-												org.uddi.api_v3.BindingTemplate apiBindingTemplate) 
-				   throws DispositionReportFaultMessage {
-		if (modelTModelInstInfoList == null || modelTModelInstInfoList.size() == 0)
-			return;
-		
-		if (apiTModelInstDetails == null)
-			apiTModelInstDetails = new org.uddi.api_v3.TModelInstanceDetails();
-
-		List<org.uddi.api_v3.TModelInstanceInfo> apiTModelInstInfoList = apiTModelInstDetails.getTModelInstanceInfo();
-		apiTModelInstInfoList.clear();
-
-		for (org.apache.juddi.model.TmodelInstanceInfo modelTModelInstInfo : modelTModelInstInfoList) {
-			org.uddi.api_v3.TModelInstanceInfo apiTModelInstInfo = new org.uddi.api_v3.TModelInstanceInfo();
-			apiTModelInstInfo.setTModelKey(modelTModelInstInfo.getTmodelKey());
-			mapTModelInstanceInfoDescriptions(modelTModelInstInfo.getTmodelInstanceInfoDescrs(), apiTModelInstInfo.getDescription());
-			mapInstanceDetails(modelTModelInstInfo, apiTModelInstInfo.getInstanceDetails(), apiTModelInstInfo);
-
-			apiTModelInstInfoList.add(apiTModelInstInfo);
-		}
-		apiBindingTemplate.setTModelInstanceDetails(apiTModelInstDetails);
-	}
-	
-	public static void mapTModelInstanceInfoDescriptions(List<org.apache.juddi.model.TmodelInstanceInfoDescr> modelDescList, 
-														 List<org.uddi.api_v3.Description> apiDescList) 
-				   throws DispositionReportFaultMessage {
-		apiDescList.clear();
-
-		for (org.apache.juddi.model.TmodelInstanceInfoDescr modelDesc : modelDescList) {
-			org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description();
-			apiDesc.setLang(modelDesc.getLangCode());
-			apiDesc.setValue(modelDesc.getDescr());
-			apiDescList.add(apiDesc);
-		}
-	}
-
-	public static void mapInstanceDetails(org.apache.juddi.model.TmodelInstanceInfo modelTModelInstInfo, 
-										  org.uddi.api_v3.InstanceDetails apiInstanceDetails,
-										  org.uddi.api_v3.TModelInstanceInfo apiTModelInstInfo) 
-				   throws DispositionReportFaultMessage {
-		if (modelTModelInstInfo == null || 
-				(modelTModelInstInfo.getInstanceParms() == null && modelTModelInstInfo.getOverviewDocs().size() == 0))
-			return;
-		
-		if (apiInstanceDetails == null)
-			apiInstanceDetails = new org.uddi.api_v3.InstanceDetails();
-
-		//InstanceParms
-		apiInstanceDetails.setInstanceParms(modelTModelInstInfo.getInstanceParms());
-		//Descriptions
-		List<org.apache.juddi.model.InstanceDetailsDescr> modelInstDetailsDescrList = modelTModelInstInfo.getInstanceDetailsDescrs();
-		for (org.apache.juddi.model.InstanceDetailsDescr modelInstDetailDescr : modelInstDetailsDescrList) {
-			org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description();
-			apiDesc.setLang(modelInstDetailDescr.getLangCode());
-			apiDesc.setValue(modelInstDetailDescr.getDescr());
-			apiInstanceDetails.getDescription().add(apiDesc);
-		}
-		//OverviewDoc
-		mapOverviewDocs(modelTModelInstInfo.getOverviewDocs(),apiInstanceDetails,null);
-	    
-		apiTModelInstInfo.setInstanceDetails(apiInstanceDetails);
-	}
-	
-	public static void mapOverviewDocs(List<org.apache.juddi.model.OverviewDoc> modelOverviewDocs,
-			                           org.uddi.api_v3.InstanceDetails apiInstanceDetails,
-			                           org.uddi.api_v3.TModel apiTModel)
-	{
-		for (OverviewDoc modelOverviewDoc : modelOverviewDocs) {
-			org.uddi.api_v3.OverviewDoc apiOverviewDoc = new org.uddi.api_v3.OverviewDoc();
-			
-			//Descriptions
-			List<org.apache.juddi.model.OverviewDocDescr> overviewDocDescrList = modelOverviewDoc.getOverviewDocDescrs();
-			for (org.apache.juddi.model.OverviewDocDescr overviewDocDescr : overviewDocDescrList) {
-				org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description();
-				apiDesc.setLang(overviewDocDescr.getLangCode());
-				apiDesc.setValue(overviewDocDescr.getDescr());
-				apiOverviewDoc.getDescription().add(apiDesc);
-			}
-			//OverviewURL
-			org.uddi.api_v3.OverviewURL apiOverviewURL = new org.uddi.api_v3.OverviewURL();
-			apiOverviewURL.setUseType(modelOverviewDoc.getOverviewUrlUseType());
-			apiOverviewURL.setValue(modelOverviewDoc.getOverviewUrl());
-			apiOverviewDoc.setOverviewURL(apiOverviewURL);
-			//Set the entity on the apiOverviewDoc
-			if (apiInstanceDetails!=null) {
-				apiInstanceDetails.getOverviewDoc().add(apiOverviewDoc);
-			} else {
-				apiTModel.getOverviewDoc().add(apiOverviewDoc);
-			}
-		}
-	}
-	
-	
-	public static void mapTModel(org.apache.juddi.model.Tmodel modelTModel, 
-								 org.uddi.api_v3.TModel apiTModel) 
-				   throws DispositionReportFaultMessage {
-
-		apiTModel.setTModelKey(modelTModel.getEntityKey());
-		org.uddi.api_v3.Name apiName = new org.uddi.api_v3.Name();
-		apiName.setValue(modelTModel.getName());
-		apiName.setLang(modelTModel.getLangCode());
-		apiTModel.setName(apiName);
-		apiTModel.setDeleted(modelTModel.getDeleted());
-		
-		mapTModelDescriptions(modelTModel.getTmodelDescrs(), apiTModel.getDescription());
-
-		mapTModelIdentifiers(modelTModel.getTmodelIdentifiers(), apiTModel.getIdentifierBag(), apiTModel);
-		apiTModel.setCategoryBag(mapCategoryBag(modelTModel.getCategoryBag(), apiTModel.getCategoryBag()));
-		
-		mapOverviewDocs(modelTModel.getOverviewDocs(), null, apiTModel);
+        }
+
+        public static void mapBindingDescriptions(List<org.apache.juddi.model.BindingDescr> modelDescList,
+             List<org.uddi.api_v3.Description> apiDescList)
+             throws DispositionReportFaultMessage {
+                apiDescList.clear();
+
+                for (org.apache.juddi.model.BindingDescr modelDesc : modelDescList) {
+                        org.uddi.api_v3.Description apiDesc = new org.uddi.api_v3.Description();
+                        apiDesc.setLang(modelDesc.getLangCode());
+                        apiDesc.setValue(modelDesc.getDescr());
+                        apiDescList.add(apiDesc);
+                }
+        }
+
+        public static org.uddi.api_v3.CategoryBag mapCategoryBag(org.apache.juddi.model.CategoryBag modelCategoryBag,
+             org.uddi.api_v3.CategoryBag apiCategoryBag)
+             throws DispositionReportFaultMessage {
+
+                if (modelCategoryBag != null) {
+                        if (apiCategoryBag == null) {
+                                apiCategoryBag = new org.uddi.api_v3.CategoryBag();
+                        }
+
+                        for (org.apache.juddi.model.KeyedReference modelKeyedReference : modelCategoryBag.getKeyedReferences()) {
+                                org.uddi.api_v3.KeyedReference apiKeyedReference = new org.uddi.api_v3.KeyedReference();
+                                apiKeyedReference.setTModelKey(modelKeyedReference.getTmodelKeyRef());
+                                apiKeyedReference.setKeyName(modelKeyedReference.getKeyName());
+                                apiKeyedReference.setKeyValue(modelKeyedReference.getKeyValue());
+                                apiCategoryBag.getKeyedReference().add(apiKeyedReference);
+                        }
+                        for (org.apache.juddi.model.KeyedReferenceGroup modelKeyedReferenceGroup : modelCategoryBag.getKeyedReferenceGroups()) {
+                                org.uddi.api_v3.KeyedReferenceGroup apiKeyedReferenceGroup = new org.uddi.api_v3.KeyedReferenceGroup();
+
+                                mapKeyedReferenceGroup(modelKeyedReferenceGroup, apiKeyedReferenceGroup);
+
+                                apiCategoryBag.getKeyedReferenceGroup().add(apiKeyedReferenceGroup);
+                        }
+                }
+                return apiCategoryBag;
+        }
+
+        public static void mapKeyedReferenceGroup(org.apache.juddi.model.KeyedReferenceGroup modelKeyedReferenceGroup,
+             org.uddi.api_v3.KeyedReferenceGroup apiKeyedReferenceGroup)
+             throws DispositionReportFaultMessage {
+
+                apiKeyedReferenceGroup.setTModelKey(modelKeyedReferenceGroup.getTmodelKey());
+
+                for (org.apache.juddi.model.KeyedReference modelKeyedReference : modelKeyedReferenceGroup.getKeyedReferences()) {
+                        org.uddi.api_v3.KeyedReference apiKeyedReference = new org.uddi.api_v3.KeyedReference();
+                        apiKeyedReference.setTModelKey(modelKeyedReference.getTmodelKeyRef

<TRUNCATED>

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


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

Posted by al...@apache.org.
http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java
index 32fe3f8..5f97703 100644
--- a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java
+++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIReplicationImpl.java
@@ -17,38 +17,48 @@
 package org.apache.juddi.api.impl;
 
 import java.math.BigInteger;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Queue;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.ConcurrentLinkedDeque;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityTransaction;
+import javax.persistence.Query;
+import javax.xml.datatype.DatatypeConfigurationException;
 import javax.xml.ws.BindingProvider;
 import org.apache.commons.configuration.ConfigurationException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.juddi.api.util.PublicationQuery;
+import static org.apache.juddi.api.impl.AuthenticatedService.logger;
 import org.apache.juddi.api.util.QueryStatus;
 import org.apache.juddi.api.util.ReplicationQuery;
 import org.apache.juddi.config.AppConfig;
 import org.apache.juddi.config.PersistenceManager;
 import org.apache.juddi.config.Property;
 import org.apache.juddi.mapping.MappingApiToModel;
+import org.apache.juddi.mapping.MappingModelToApi;
+import org.apache.juddi.model.BusinessEntity;
+import org.apache.juddi.model.BusinessService;
 import org.apache.juddi.model.Node;
-import org.apache.juddi.model.UddiEntityPublisher;
+import org.apache.juddi.model.Tmodel;
+import static org.apache.juddi.replication.ReplicationNotifier.FetchEdges;
 import org.apache.juddi.v3.client.UDDIService;
 import org.apache.juddi.v3.error.ErrorMessage;
 import org.apache.juddi.v3.error.FatalErrorException;
-import org.apache.juddi.validation.ValidatePublish;
 import org.apache.juddi.validation.ValidateReplication;
-import org.uddi.api_v3.DispositionReport;
-import org.uddi.api_v3.Result;
+import org.uddi.api_v3.OperationalInfo;
 import org.uddi.custody_v3.DiscardTransferToken;
 import org.uddi.repl_v3.ChangeRecord;
 import org.uddi.repl_v3.ChangeRecordIDType;
 import org.uddi.repl_v3.DoPing;
 import org.uddi.repl_v3.HighWaterMarkVectorType;
 import org.uddi.repl_v3.NotifyChangeRecordsAvailable;
+import org.uddi.repl_v3.ReplicationConfiguration;
 import org.uddi.repl_v3.TransferCustody;
 import org.uddi.v3_service.DispositionReportFaultMessage;
 import org.uddi.v3_service.UDDIReplicationPortType;
@@ -69,15 +79,271 @@ import org.uddi.v3_service.UDDIReplicationPortType;
  */
 public class UDDIReplicationImpl extends AuthenticatedService implements UDDIReplicationPortType {
 
-        private static Log log = LogFactory.getLog(UDDIReplicationImpl.class);
         private UDDIServiceCounter serviceCounter;
 
+        private static PullTimerTask timer = null;
+        private long startBuffer = 20000l;//AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_START_BUFFER, 20000l); // 20s startup delay default 
+        private long interval = 300000l;// AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_INTERVAL, 300000l); //5 min default
+
+        private static UDDIPublicationImpl pub = null;
+
         public UDDIReplicationImpl() {
                 super();
+                if (pub == null) {
+                        pub = new UDDIPublicationImpl();
+                }
                 serviceCounter = ServiceCounterLifecycleResource.getServiceCounter(UDDIReplicationImpl.class);
+                Init();
+                try {
+                        startBuffer = AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_START_BUFFER, 20000l); // 20s startup delay default 
+                        interval = AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_INTERVAL, 300000l); //5 min default
+                } catch (ConfigurationException ex) {
+                        logger.fatal(ex);
+                }
 
         }
 
+        private synchronized void Init() {
+                if (queue == null) {
+                        queue = new ConcurrentLinkedDeque<NotifyChangeRecordsAvailable>();
+                }
+                timer = new PullTimerTask();
+
+        }
+
+        private boolean Excluded(HighWaterMarkVectorType changesAlreadySeen, ChangeRecord r) {
+                if (changesAlreadySeen != null) {
+                        for (int i = 0; i < changesAlreadySeen.getHighWaterMark().size(); i++) {
+                                if (changesAlreadySeen.getHighWaterMark().get(i).getNodeID().equals(r.getChangeID().getNodeID())
+                                     && changesAlreadySeen.getHighWaterMark().get(i).getOriginatingUSN().equals(r.getChangeID().getOriginatingUSN())) {
+                                        return true;
+                                }
+                        }
+                }
+                return false;
+        }
+
+        private class PullTimerTask extends TimerTask {
+
+                private Timer timer = null;
+
+                public PullTimerTask() {
+                        super();
+                        timer = new Timer(true);
+                        timer.scheduleAtFixedRate(this, startBuffer, interval);
+                }
+
+                @Override
+                public void run() {
+
+                        //ok someone told me there's a change available
+                        while (!queue.isEmpty()) {
+                                NotifyChangeRecordsAvailable poll = queue.poll();
+                                if (poll != null) {
+                                        UDDIReplicationPortType replicationClient = getReplicationClient(poll.getNotifyingNode());
+                                        try {
+                                                //ok now get all the changes
+                                                List<ChangeRecord> records
+                                                     = replicationClient.getChangeRecords(node,
+                                                          null, null, poll.getChangesAvailable());
+                                                //ok now we need to persist the change records
+                                                for (int i = 0; i < records.size(); i++) {
+                                                        PersistChangeRecord(records.get(i));
+                                                }
+                                        } catch (Exception ex) {
+                                                logger.equals(ex);
+                                        }
+                                }
+                        }
+                }
+
+                @Override
+                public boolean cancel() {
+                        timer.cancel();
+                        return super.cancel();
+                }
+
+                /**
+                 * someone told me there's a change available, we retrieved it
+                 * and are processing the changes locally
+                 *
+                 * @param rec
+                 */
+                private void PersistChangeRecord(ChangeRecord rec) {
+                        if (rec == null) {
+                                return;
+                        }
+                        EntityManager em = PersistenceManager.getEntityManager();
+                        EntityTransaction tx = em.getTransaction();
+                        /**
+                         * In nodes that support pre-bundled replication
+                         * responses, the recipient of the get_changeRecords
+                         * message MAY return more change records than requested
+                         * by the caller. In this scenario, the caller MUST also
+                         * be prepared to deal with such redundant changes where
+                         * a USN is less than the USN specified in the
+                         * changesAlreadySeen highWaterMarkVector.
+                         */
+                        try {
+                                tx.begin();
+                                //the change record rec must also be persisted!!
+                                em.persist(MappingApiToModel.mapChangeRecord(rec));
+                                //<editor-fold defaultstate="collapsed" desc="delete a record">
+
+                                if (rec.getChangeRecordDelete() != null) {
+                                        if (rec.getChangeRecordDelete() != null && rec.getChangeRecordDelete().getBindingKey() != null && !"".equalsIgnoreCase(rec.getChangeRecordDelete().getBindingKey())) {
+                                                //delete a binding template
+                                                pub.deleteBinding(rec.getChangeRecordDelete().getBindingKey(), em);
+                                        }
+                                        if (rec.getChangeRecordDelete() != null && rec.getChangeRecordDelete().getBusinessKey() != null && !"".equalsIgnoreCase(rec.getChangeRecordDelete().getBusinessKey())) {
+                                                //delete a business 
+                                                pub.deleteBusiness(rec.getChangeRecordDelete().getBusinessKey(), em);
+                                        }
+                                        if (rec.getChangeRecordDelete() != null && rec.getChangeRecordDelete().getServiceKey() != null && !"".equalsIgnoreCase(rec.getChangeRecordDelete().getServiceKey())) {
+                                                //delete a service 
+                                                pub.deleteService(rec.getChangeRecordDelete().getServiceKey(), em);
+                                        }
+                                        if (rec.getChangeRecordDelete() != null && rec.getChangeRecordDelete().getTModelKey() != null && !"".equalsIgnoreCase(rec.getChangeRecordDelete().getTModelKey())) {
+                                                //delete a tmodel 
+                                                /**
+                                                 * The changeRecordDelete for a
+                                                 * tModel does not correspond to
+                                                 * any API described in this
+                                                 * specification and should only
+                                                 * appear in the replication
+                                                 * stream as the result of an
+                                                 * administrative function to
+                                                 * permanently remove a tModel.
+                                                 */
+                                                pub.deleteTModel(rec.getChangeRecordDelete().getTModelKey(), em);
+                                        }
+                                }
+                                if (rec.getChangeRecordDeleteAssertion() != null && rec.getChangeRecordDeleteAssertion().getPublisherAssertion() != null) {
+                                        //delete a pa template                            
+                                        pub.deletePublisherAssertion(rec.getChangeRecordDeleteAssertion().getPublisherAssertion(), em);
+                                }
+
+//</editor-fold>
+                                //<editor-fold defaultstate="collapsed" desc="New Data">
+                                if (rec.getChangeRecordNewData() != null) {
+
+                                        if (rec.getChangeRecordNewData().getOperationalInfo().getNodeID() == null) {
+                                                throw new Exception("Inbound replication data is missiong node id!");
+                                        }
+
+                                        //The operationalInfo element MUST contain the operational information associated with the indicated new data.
+                                        if (rec.getChangeRecordNewData().getOperationalInfo() == null) {
+                                                logger.warn("Inbound replication data does not have the required OperationalInfo element and is NOT spec compliant. Data will be ignored");
+                                        } else {
+                                                if (rec.getChangeRecordNewData().getBindingTemplate() != null) {
+                                                        //fetch the binding template if it exists already
+                                                        //if it exists, 
+                                                        //      confirm the owning node, it shouldn't be the local node id, if it is, throw
+                                                        //      the owning node should be the same as it was before
+
+                                                        BusinessService model = em.find(org.apache.juddi.model.BusinessService.class, rec.getChangeRecordNewData().getBindingTemplate().getServiceKey());
+                                                        if (model == null) {
+                                                                logger.error("Replication error, attempting to insert a binding where the service doesn't exist yet");
+                                                        } else {
+                                                                ValidateNodeIdMatches(model.getNodeId(), rec.getChangeRecordNewData().getOperationalInfo());
+
+                                                                org.apache.juddi.model.BindingTemplate modelT = new org.apache.juddi.model.BindingTemplate();
+                                                                MappingApiToModel.mapBindingTemplate(rec.getChangeRecordNewData().getBindingTemplate(), modelT, model);
+                                                                MappingApiToModel.mapOperationalInfo(model, rec.getChangeRecordNewData().getOperationalInfo());
+                                                                em.persist(model);
+                                                        }
+
+                                                } else if (rec.getChangeRecordNewData().getBusinessEntity() != null) {
+
+                                                        BusinessEntity model = em.find(org.apache.juddi.model.BusinessEntity.class, rec.getChangeRecordNewData().getBusinessEntity().getBusinessKey());
+                                                        if (model == null) {
+                                                                model = new BusinessEntity();
+                                                        } else {
+                                                                ValidateNodeIdMatches(model.getNodeId(), rec.getChangeRecordNewData().getOperationalInfo());
+                                                        }
+                                                        MappingApiToModel.mapBusinessEntity(rec.getChangeRecordNewData().getBusinessEntity(), model);
+                                                        MappingApiToModel.mapOperationalInfo(model, rec.getChangeRecordNewData().getOperationalInfo());
+
+                                                        em.persist(model);
+
+                                                }
+                                                if (rec.getChangeRecordNewData().getBusinessService() != null) {
+                                                        BusinessEntity find = em.find(org.apache.juddi.model.BusinessEntity.class, rec.getChangeRecordNewData().getBusinessService().getBusinessKey());
+                                                        if (find == null) {
+                                                                logger.error("Replication error, attempting to insert a service where the business doesn't exist yet");
+                                                        } else {
+                                                                org.apache.juddi.model.BusinessService model = new org.apache.juddi.model.BusinessService();
+                                                                MappingApiToModel.mapBusinessService(rec.getChangeRecordNewData().getBusinessService(), model, find);
+                                                                MappingApiToModel.mapOperationalInfo(model, rec.getChangeRecordNewData().getOperationalInfo());
+
+                                                                em.persist(model);
+                                                        }
+
+                                                } else if (rec.getChangeRecordNewData().getTModel() != null) {
+                                                        Tmodel model = new Tmodel();
+                                                        MappingApiToModel.mapTModel(rec.getChangeRecordNewData().getTModel(), model);
+
+                                                        MappingApiToModel.mapOperationalInfo(model, rec.getChangeRecordNewData().getOperationalInfo());
+
+                                                        em.persist(model);
+                                                }
+
+                                        }
+
+                                }
+//</editor-fold>
+
+                                // changeRecordNull no action needed
+                                // changeRecordHide tmodel only
+                                //<editor-fold defaultstate="collapsed" desc="hide tmodel">
+                                if (rec.getChangeRecordHide() != null) {
+                                        /*
+                                         A changeRecordHide element corresponds to the behavior of hiding a tModel described in the delete_tModel in the Publish API section of this Specification.  A tModel listed in a changeRecordHide should be marked as hidden, so that it is not returned in response to a find_tModel API call.
+                                        
+                                         The changeRecordHide MUST contain a modified timestamp to allow multi-node registries to calculate consistent modifiedIncludingChildren timestamps as described in Section 3.8 operationalInfo Structure.
+                                         */
+                                        String key = rec.getChangeRecordHide().getTModelKey();
+                                        org.apache.juddi.model.Tmodel existing = em.find(org.apache.juddi.model.Tmodel.class, key);
+                                        if (existing == null) {
+                                                logger.error("Unexpected delete/hide tmodel message received for non existing key " + key);
+                                        } else {
+                                                existing.setDeleted(true);
+                                                existing.setModified(rec.getChangeRecordHide().getModified().toGregorianCalendar().getTime());
+                                                existing.setModifiedIncludingChildren(rec.getChangeRecordHide().getModified().toGregorianCalendar().getTime());
+                                                em.persist(existing);
+                                        }
+                                }
+//</editor-fold>
+
+                                //<editor-fold defaultstate="collapsed" desc="changeRecordPublisherAssertion">
+                                if (rec.getChangeRecordPublisherAssertion() != null) {
+//TODO implement
+                                }
+//</editor-fold>
+
+                                tx.commit();
+
+                        } catch (Exception drfm) {
+                                logger.warn(drfm);
+                        } finally {
+                                if (tx.isActive()) {
+                                        tx.rollback();
+                                }
+                                em.close();
+                        }
+                }
+
+        }
+
+        private static void ValidateNodeIdMatches(String nodeId, OperationalInfo operationalInfo) throws Exception {
+                if (nodeId == null || operationalInfo == null) {
+                        throw new Exception("either the local node ID is null or the inbound replication data's node id is null");
+                }
+                if (!nodeId.equals(operationalInfo.getNodeID())) {
+                        throw new Exception("node id mismatch!");
+                }
+        }
+
         private synchronized UDDIReplicationPortType getReplicationClient(String node) {
                 if (cache.containsKey(node)) {
                         return cache.get(node);
@@ -92,7 +358,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
                         cache.put(node, replicationClient);
                         return replicationClient;
                 } catch (Exception ex) {
-                        log.fatal("Node not found!" + node, ex);
+                        logger.fatal("Node not found!" + node, ex);
                 } finally {
                         if (tx.isActive()) {
                                 tx.rollback();
@@ -115,82 +381,229 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
                 long startTime = System.currentTimeMillis();
                 long procTime = System.currentTimeMillis() - startTime;
                 serviceCounter.update(ReplicationQuery.DO_PING, QueryStatus.SUCCESS, procTime);
-                try {
-                        return AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ROOT_BUSINESS);
-                } catch (ConfigurationException ex) {
-                        log.fatal("Unable to load configuration!", ex);
-                }
-                throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval"));
+
+                return node;
+
         }
 
+        @Override
         public List<ChangeRecord> getChangeRecords(String requestingNode,
-                HighWaterMarkVectorType changesAlreadySeen,
-                BigInteger responseLimitCount,
-                HighWaterMarkVectorType responseLimitVector)
-                throws DispositionReportFaultMessage {
+             HighWaterMarkVectorType changesAlreadySeen,
+             BigInteger responseLimitCount,
+             HighWaterMarkVectorType responseLimitVector)
+             throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
-                long procTime = System.currentTimeMillis() - startTime;
-                serviceCounter.update(ReplicationQuery.GET_CHANGERECORDS,
-                        QueryStatus.SUCCESS, procTime);
 
-                //TODO fetch all records that have changed since changesAlreadySeen
-                ChangeRecord r = new ChangeRecord();
-                
-                ValidateReplication.unsupportedAPICall();
-                return null;
+                new ValidateReplication(null).validateGetChangeRecords(requestingNode, changesAlreadySeen, responseLimitCount, responseLimitVector, FetchEdges(), ctx);
+
+                //TODO should we validate that "requestingNode" is in the replication config?
+                List<ChangeRecord> ret = new ArrayList<ChangeRecord>();
+                EntityManager em = PersistenceManager.getEntityManager();
+                EntityTransaction tx = em.getTransaction();
+
+                /**
+                 * More specifically, the recipient determines the particular
+                 * change records that are returned by comparing the originating
+                 * USNs in the caller’s high water mark vector with the
+                 * originating USNs of each of the changes the recipient has
+                 * seen from others or generated by itself. The recipient SHOULD
+                 * only return change records that have originating USNs that
+                 * are greater than those listed in the changesAlreadySeen
+                 * highWaterMarkVector and less than the limit required by
+                 * either the responseLimitCount or the responseLimitVector.
+                 *
+                 *
+                 * Part of the message is a high water mark vector that contains
+                 * for each node of the registry the originating USN of the most
+                 * recent change record that has been successfully processed by
+                 * the invocating node
+                 */
+                int maxrecords = 100;
+                if (responseLimitCount != null) {
+                        maxrecords = responseLimitCount.intValue();
+                }
+                try {
+                        tx.begin();
+                        Long firstrecord = 1L;
+                        Long lastrecord = null;
+
+                        if (changesAlreadySeen != null) {
+                                //this is basically a lower limit (i.e. the newest record that was processed by the requestor
+                                //therefore we want the oldest record stored locally to return to the requestor for processing
+                                for (int i = 0; i < changesAlreadySeen.getHighWaterMark().size(); i++) {
+                                        if (responseLimitVector.getHighWaterMark().get(i).getNodeID().equals(node)) {
+                                                firstrecord = changesAlreadySeen.getHighWaterMark().get(i).getOriginatingUSN() + 1;
+                                        }
+                                }
+                        }
+                        if (responseLimitVector != null) {
+                                //using responseLimitVector, indicating for each node in the graph the first change originating there that he does not wish to be returned.
+                                //upper limit basically
+                                for (int i = 0; i < responseLimitVector.getHighWaterMark().size(); i++) {
+                                        if (responseLimitVector.getHighWaterMark().get(i).getNodeID().equals(node)) {
+                                                lastrecord = responseLimitVector.getHighWaterMark().get(i).getOriginatingUSN();
+                                        }
+                                }
+                        }
+
+                        Query createQuery = null;
+                        if (lastrecord != null) {
+                                createQuery = em.createQuery("select e from ChangeRecord e where (e.id > :inbound and e.nodeID = :node and e.id < :lastrecord) OR (e.originatingUSN > :inbound and e.nodeID != :node and e.originatingUSN < :lastrecord) order by e.id ASC");
+                                createQuery.setParameter("lastrecord", lastrecord);
+                        } else {
+                                createQuery = em.createQuery("select e from ChangeRecord e where (e.id > :inbound and e.nodeID = :node) OR (e.originatingUSN > :inbound and e.nodeID != :node) order by e.id ASC");
+                        }
+                        createQuery.setMaxResults(maxrecords);
+                        createQuery.setParameter("inbound", firstrecord);
+                        createQuery.setParameter("node", node);
+
+                        List<org.apache.juddi.model.ChangeRecord> records = (List<org.apache.juddi.model.ChangeRecord>) (org.apache.juddi.model.ChangeRecord) createQuery.getResultList();
+                        for (int i = 0; i < records.size(); i++) {
+                                ChangeRecord r = MappingModelToApi.mapChangeRecord(records.get(i));
+                                if (!Excluded(changesAlreadySeen, r)) {
+                                        ret.add(r);
+                                }
+                                
+                        }
+                        
+
+                        tx.rollback();
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(ReplicationQuery.GET_CHANGERECORDS,
+                             QueryStatus.SUCCESS, procTime);
+
+                } catch (Exception ex) {
+                        logger.fatal("Error, this node is: " + node, ex);
+                        throw new FatalErrorException(new ErrorMessage("E_fatalError", ex.getMessage()));
+
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+                return ret;
         }
 
+        /**
+         * This UDDI API message provides a means to obtain a list of
+         * highWaterMark element containing the highest known USN for all nodes
+         * in the replication graph. If there is no graph, we just return the
+         * local bits
+         *
+         * @return
+         * @throws DispositionReportFaultMessage
+         */
+        @Override
         public List<ChangeRecordIDType> getHighWaterMarks()
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
-                long procTime = System.currentTimeMillis() - startTime;
-                serviceCounter.update(ReplicationQuery.GET_HIGHWATERMARKS, QueryStatus.SUCCESS, procTime);
+
+                List<ChangeRecordIDType> ret = new ArrayList<ChangeRecordIDType>();
 
                 //fetch from database the highest known watermark
-                ValidateReplication.unsupportedAPICall();
-                return null;
+                ReplicationConfiguration FetchEdges = FetchEdges();
+
+                EntityManager em = PersistenceManager.getEntityManager();
+                EntityTransaction tx = em.getTransaction();
+                try {
+                        tx.begin();
+                        if (FetchEdges != null) {
+                                Iterator<String> it = FetchEdges.getCommunicationGraph().getNode().iterator();
+                                while (it.hasNext()) {
+                                        String nextNode = it.next();
+                                        if (!nextNode.equals(node)) {
+
+                                                Long id = (Long) em.createQuery("select e.originatingUSN from ChangeRecord e where e.nodeID = :node order by e.originatingUSN desc").setParameter("node", nextNode).setMaxResults(1).getSingleResult();
+                                                if (id == null) {
+                                                        id = 0L;
+                                                        //per the spec
+                                                }
+                                                ChangeRecordIDType x = new ChangeRecordIDType(nextNode, id);
+                                                ret.add(x);
+                                        }
+                                }
+                        }
+                        //dont forget this node
+                        Long id = (Long) em.createQuery("select (e.id) from ChangeRecord e where e.nodeID = :node  order by e.id desc").setParameter("node", node).setMaxResults(1).getSingleResult();
+                        if (id == null) {
+                                id = 0L;
+                        }
+                        ChangeRecordIDType x = new ChangeRecordIDType();
+                        x.setNodeID(node);
+                        x.setOriginatingUSN(id);
+                        ret.add(x);
+
+                        tx.rollback();
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(ReplicationQuery.GET_HIGHWATERMARKS, QueryStatus.SUCCESS, procTime);
+
+                } catch (Exception drfm) {
+                        throw new FatalErrorException(new ErrorMessage("E_fatalError", drfm.getMessage()));
+
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+
+                return ret;
         }
 
+        /**
+         * this means that another node has a change and we need to pick up the
+         * change and apply it to our local database.
+         *
+         * @param body
+         * @throws DispositionReportFaultMessage
+         */
+        @Override
         public void notifyChangeRecordsAvailable(NotifyChangeRecordsAvailable body)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
                 long procTime = System.currentTimeMillis() - startTime;
                 serviceCounter.update(ReplicationQuery.NOTIFY_CHANGERECORDSAVAILABLE,
-                        QueryStatus.SUCCESS, procTime);
+                     QueryStatus.SUCCESS, procTime);
                 //some other node just told us there's new records available, call
                 //getChangeRecords from the remote node asynch
 
-                ValidateReplication.unsupportedAPICall();
+                new ValidateReplication(null).validateNotifyChangeRecordsAvailable(body, ctx);
+
+                queue.add(body);
+
+                //ValidateReplication.unsupportedAPICall();
         }
+        private static Queue<NotifyChangeRecordsAvailable> queue = null;
 
+        /**
+         * transfers custody of an entity from node1/user1 to node2/user2
+         *
+         * @param body
+         * @throws DispositionReportFaultMessage
+         */
         public void transferCustody(TransferCustody body)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 long startTime = System.currentTimeMillis();
 
-
                 //*this node is transfering data to another node
                 //body.getTransferOperationalInfo().
-
-
                 ValidateReplication.unsupportedAPICall();
 
                 EntityManager em = PersistenceManager.getEntityManager();
                 //EntityTransaction tx = em.getTransaction();
 
-
                 //The custodial node must verify that it has granted permission to transfer the entities identified and that this permission is still valid.  This operation is comprised of two steps:
                 //1.       Verification that the transferToken was issued by it, that it has not expired, that it represents the authority to transfer no more and no less than those entities identified by the businessKey and tModelKey elements and that all these entities are still valid and not yet transferred. The transferToken is invalidated if any of these conditions are not met.
                 //2.       If the conditions above are met, the custodial node will prevent any further changes to the entities identified by the businessKey and tModelKey elements identified. The entity will remain in this state until the replication stream indicates it has been successfully processed via the replication stream. 
-
                 //Upon successful verification of the custody transfer request by the custodial node, an empty message is returned by it indicating the success of the request and acknowledging the custody transfer. 
-
                 //Following the issue of the empty message, the custodial node will submit into the replication stream a changeRecordNewData providing in the operationalInfo, the nodeID accepting custody of the datum and the authorizedName of the publisher accepting ownership. The acknowledgmentRequested attribute of this change record MUST be set to "true".
                 //TODO enqueue Replication message
-
                 //Finally, the custodial node invalidates the transferToken in order to prevent additional calls of the transfer_entities API.
                 DiscardTransferToken dtt = new DiscardTransferToken();
                 dtt.setKeyBag(body.getKeyBag());
                 dtt.setTransferToken(body.getTransferToken());
                 new UDDICustodyTransferImpl().discardTransferToken(dtt);
         }
+
 }

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/config/Install.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/config/Install.java b/juddi-core/src/main/java/org/apache/juddi/config/Install.java
index cd83040..63cbf97 100644
--- a/juddi-core/src/main/java/org/apache/juddi/config/Install.java
+++ b/juddi-core/src/main/java/org/apache/juddi/config/Install.java
@@ -46,9 +46,11 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.juddi.ClassUtil;
 import org.apache.juddi.api.impl.UDDIInquiryImpl;
+import org.apache.juddi.api.impl.UDDIPublicationImpl;
 import org.apache.juddi.keygen.KeyGenerator;
 import org.apache.juddi.mapping.MappingApiToModel;
 import org.apache.juddi.model.UddiEntityPublisher;
+import org.apache.juddi.replication.ReplicationNotifier;
 import org.apache.juddi.v3.error.ErrorMessage;
 import org.apache.juddi.v3.error.FatalErrorException;
 import org.apache.juddi.v3.error.InvalidKeyPassedException;
@@ -56,6 +58,7 @@ import org.apache.juddi.v3.error.KeyUnavailableException;
 import org.apache.juddi.v3.error.ValueNotAllowedException;
 import org.apache.juddi.validation.ValidatePublish;
 import org.apache.juddi.validation.ValidateUDDIKey;
+import org.uddi.api_v3.SaveBusiness;
 import org.uddi.api_v3.SaveTModel;
 import org.uddi.api_v3.TModel;
 import org.uddi.v3_service.DispositionReportFaultMessage;
@@ -288,7 +291,7 @@ public class Install {
 
                 for (org.apache.juddi.model.BusinessService service : modelBusinessEntity.getBusinessServices()) {
                         service.setAuthorizedName(rootPublisher.getAuthorizedName());
-                        service.setNodeId(nodeId);
+                        service.setNodeId(modelBusinessEntity.getNodeId());
                         service.setCreated(now);
                         service.setModified(now);
                         service.setModifiedIncludingChildren(now);
@@ -310,6 +313,9 @@ public class Install {
                 }
 
                 em.persist(modelBusinessEntity);
+                SaveBusiness sb = new SaveBusiness();
+                sb.getBusinessEntity().add(rootBusinessEntity);
+                ReplicationNotifier.Enqueue(UDDIPublicationImpl.getChangeRecord(modelBusinessEntity, rootBusinessEntity, modelBusinessEntity.getNodeId()));
 
                 return modelBusinessEntity.getEntityKey();
 
@@ -485,6 +491,10 @@ public class Install {
                                         modelTModel.setNodeId(nodeId);
 
                                         em.persist(modelTModel);
+                                        
+                                        SaveTModel stm = new SaveTModel();
+                                        stm.getTModel().add(apiTModel);
+                                        ReplicationNotifier.Enqueue(UDDIPublicationImpl.getChangeRecord(modelTModel, apiTModel, nodeId));
                                 }
 
                         }


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


[7/9] juddi git commit: JUDDI-241 Adding additional changes required by replication api. Not all tests pass on juddi api

Posted by al...@apache.org.
http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-core/src/main/java/org/apache/juddi/validation/ValidateClerk.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/validation/ValidateClerk.java b/juddi-core/src/main/java/org/apache/juddi/validation/ValidateClerk.java
index 49956a8..3542c12 100644
--- a/juddi-core/src/main/java/org/apache/juddi/validation/ValidateClerk.java
+++ b/juddi-core/src/main/java/org/apache/juddi/validation/ValidateClerk.java
@@ -86,10 +86,11 @@ public class ValidateClerk extends ValidateUDDIApi {
 			throw new ValueNotAllowedException(new ErrorMessage("errors.node.NoName"));
 		
 		//make sure node exists
-		Object obj = em.find(org.apache.juddi.model.Node.class, nodeName);
+                //edit, doesn't matter if it doesn't exist, it'll be created on save of the clerk
+		/*Object obj = em.find(org.apache.juddi.model.Node.class, nodeName);
 		if (obj == null)
 			throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NodeNotFound", nodeName));
-
+*/
 	}
 	
 	

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java b/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java
index c24f70d..ca560f1 100644
--- a/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java
+++ b/juddi-core/src/main/java/org/apache/juddi/validation/ValidatePublish.java
@@ -1509,7 +1509,6 @@ public class ValidatePublish extends ValidateUDDIApi {
                 }
                 for (int i = 0; i < elems.size(); i++) {
                         validateLang(elems.get(i).getLang());
-                        //TODO verify this is correct
                         validateURL(elems.get(i).getValue());
                 }
         }

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-core/src/main/java/org/apache/juddi/validation/ValidateReplication.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/validation/ValidateReplication.java b/juddi-core/src/main/java/org/apache/juddi/validation/ValidateReplication.java
index e5cbf43..460c94d 100644
--- a/juddi-core/src/main/java/org/apache/juddi/validation/ValidateReplication.java
+++ b/juddi-core/src/main/java/org/apache/juddi/validation/ValidateReplication.java
@@ -111,4 +111,8 @@ public class ValidateReplication extends ValidateUDDIApi {
                 return false;
         }
 
+        public void validateSetReplicationNodes(ReplicationConfiguration replicationConfiguration) throws DispositionReportFaultMessage {
+                
+        }
+
 }

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-core/src/main/resources/messages.properties
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/resources/messages.properties b/juddi-core/src/main/resources/messages.properties
index c1bcbd2..18f7cfc 100644
--- a/juddi-core/src/main/resources/messages.properties
+++ b/juddi-core/src/main/resources/messages.properties
@@ -292,3 +292,4 @@ errors.replication.negativeLimit=The specified response limit is either 0 or a n
 errors.replication.limitVectorNull=The high water mark vector limit specified OriginatingUSN is null or invalid
 errors.replication.limitVectorNoNode=No node name was specified
 errors.replication.configNodeNotFound=No specified node name is not currently registered as a node. Use the jUDDI Service API to register it. Node id: 
+errors.replication.configNull=No replication config was present in the message
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-core/src/test/java/org/apache/juddi/api/impl/API_091_RMISubscriptionListenerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/test/java/org/apache/juddi/api/impl/API_091_RMISubscriptionListenerIntegrationTest.java b/juddi-core/src/test/java/org/apache/juddi/api/impl/API_091_RMISubscriptionListenerIntegrationTest.java
index 3f909a3..ef864c1 100644
--- a/juddi-core/src/test/java/org/apache/juddi/api/impl/API_091_RMISubscriptionListenerIntegrationTest.java
+++ b/juddi-core/src/test/java/org/apache/juddi/api/impl/API_091_RMISubscriptionListenerIntegrationTest.java
@@ -91,7 +91,6 @@ public class API_091_RMISubscriptionListenerIntegrationTest
            
             
 		} catch (Exception e2) {
-			// TODO Auto-generated catch block
 			e2.printStackTrace();
 			Assert.fail();
 		}

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-core/src/test/java/org/apache/juddi/api/impl/API_160_ReplicationTest.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/test/java/org/apache/juddi/api/impl/API_160_ReplicationTest.java b/juddi-core/src/test/java/org/apache/juddi/api/impl/API_160_ReplicationTest.java
new file mode 100644
index 0000000..6cf0f2b
--- /dev/null
+++ b/juddi-core/src/test/java/org/apache/juddi/api/impl/API_160_ReplicationTest.java
@@ -0,0 +1,266 @@
+/*
+ * Copyright 2014 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.api.impl;
+
+import java.math.BigInteger;
+import java.rmi.RemoteException;
+import java.util.List;
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.juddi.Registry;
+import org.apache.juddi.api_v3.Clerk;
+import org.apache.juddi.api_v3.ClerkList;
+import org.apache.juddi.api_v3.DeleteClerk;
+import org.apache.juddi.api_v3.DeleteNode;
+import org.apache.juddi.api_v3.Node;
+import org.apache.juddi.api_v3.NodeList;
+import org.apache.juddi.api_v3.SaveClerk;
+import org.apache.juddi.api_v3.SaveNode;
+import org.apache.juddi.replication.ReplicationNotifier;
+import org.apache.juddi.v3.error.FatalErrorException;
+import org.apache.juddi.v3.tck.TckPublisher;
+import org.apache.juddi.v3.tck.TckSecurity;
+import org.apache.juddi.v3.tck.TckTModel;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.uddi.api_v3.DispositionReport;
+import org.uddi.repl_v3.ChangeRecord;
+import org.uddi.repl_v3.ChangeRecordIDType;
+import org.uddi.repl_v3.CommunicationGraph;
+import org.uddi.repl_v3.DoPing;
+import org.uddi.repl_v3.HighWaterMarkVectorType;
+import org.uddi.repl_v3.ReplicationConfiguration;
+import org.uddi.v3_service.DispositionReportFaultMessage;
+import org.uddi.v3_service.UDDIReplicationPortType;
+import org.uddi.v3_service.UDDISecurityPortType;
+
+/**
+ *
+ * @author Alex O'Ree
+ */
+public class API_160_ReplicationTest {
+
+        private static Log logger = LogFactory.getLog(API_141_JIRATest.class);
+        static UDDIReplicationPortType repl = new UDDIReplicationImpl();
+        static JUDDIApiImpl juddi = new JUDDIApiImpl();
+        static ReplicationNotifier notifier = null;
+        protected static String authInfoJoe = null;
+        protected static String authInfoMary = null;
+        protected static String authInfoSam = null;
+        protected static String authInfoRoot = null;
+        protected static String authInfoUDDI = null;
+
+        @AfterClass
+        public static void stopManager() throws ConfigurationException {
+                Registry.stop();
+        }
+
+        @BeforeClass
+        public static void startManager() throws ConfigurationException {
+                Registry.start();
+
+                try {
+
+                        UDDISecurityPortType security = new UDDISecurityImpl();
+                        authInfoRoot = TckSecurity.getAuthToken(security, TckPublisher.getRootPublisherId(), TckPublisher.getRootPassword());
+
+                } catch (RemoteException e) {
+                        logger.error(e.getMessage(), e);
+                        Assert.fail("Could not obtain authInfo token.");
+                }
+
+        }
+
+        @Test
+        public void getPing() throws Exception {
+                String node = repl.doPing(new DoPing());
+                Assert.assertNotNull(node);
+        }
+
+        @Test
+        public void getGetHighWaterMarks() throws Exception {
+                List<ChangeRecordIDType> highWaterMarks = repl.getHighWaterMarks();
+
+                Assert.assertNotNull(highWaterMarks);
+                Assert.assertFalse(highWaterMarks.isEmpty());
+                for (int i = 0; i < highWaterMarks.size(); i++) {
+                        Assert.assertNotNull(highWaterMarks.get(i).getNodeID());
+                        //If the highest originatingUSN for a specific node within the registry is not known, then the responding node MUST return a highWaterMark for that node with an originatingUSN of 0 (zero).
+                        Assert.assertNotNull(highWaterMarks.get(i).getOriginatingUSN());
+                        Assert.assertTrue(highWaterMarks.get(i).getOriginatingUSN() >= 0);
+
+                        /* if (highWaterMarks.get(i).getOriginatingUSN() > 0) {
+                         List<ChangeRecord> changeRecords = repl.getChangeRecords("test", null, BigInteger.valueOf(highWaterMarks.get(i).getOriginatingUSN()), null);
+                         Assert.assertNotNull(changeRecords);
+                         Assert.assertFalse(changeRecords.isEmpty());
+                                
+                         }*/
+                }
+        }
+
+        @Test(expected = FatalErrorException.class)
+        public void getChangeRecordsInvalid() throws DispositionReportFaultMessage, RemoteException {
+                List<ChangeRecordIDType> highWaterMarks = repl.getHighWaterMarks();
+
+                HighWaterMarkVectorType highWaterMarkVectorType = new HighWaterMarkVectorType();
+                highWaterMarkVectorType.getHighWaterMark().add(highWaterMarks.get(0));
+                List<ChangeRecord> changeRecords = repl.getChangeRecords("test", null, BigInteger.valueOf(highWaterMarks.get(0).getOriginatingUSN()), highWaterMarkVectorType);
+                Assert.fail("unexpected success");
+        }
+
+        /**
+         * add a clerk and node, delete the node, then try to access the clerk.
+         * it should have been deleted
+         *
+         * @throws Exception
+         */
+        @Test
+        public void testAddClerkNodeThenDelete() throws Exception {
+                SaveClerk sc = new SaveClerk();
+                sc.setAuthInfo(authInfoRoot);
+                Clerk c = new Clerk();
+                c.setName("clerk1");
+
+                c.setPassword("pass");
+                c.setPublisher("username");
+                c.setNode(new Node());
+                c.getNode().setName("test_node");
+                c.getNode().setClientName("test_client");
+                c.getNode().setProxyTransport(org.apache.juddi.v3.client.transport.JAXWSTransport.class.getCanonicalName());
+                c.getNode().setCustodyTransferUrl("http://localhost");
+                c.getNode().setDescription("http://localhost");
+                c.getNode().setInquiryUrl("http://localhost");
+                c.getNode().setPublishUrl("http://localhost");
+                c.getNode().setReplicationUrl("http://localhost");
+                c.getNode().setSecurityUrl("http://localhost");
+                c.getNode().setSubscriptionListenerUrl("http://localhost");
+                c.getNode().setSubscriptionUrl("http://localhost");
+
+                sc.getClerk().add(c);
+                juddi.saveClerk(sc);
+
+                juddi.deleteClerk(new DeleteClerk(authInfoRoot, "clerk1"));
+
+                ClerkList allNodes = juddi.getAllClerks(authInfoRoot);
+                boolean found = false;
+                for (int i = 0; i < allNodes.getClerk().size(); i++) {
+                        if (allNodes.getClerk().get(i).getName().equals("clerk1")) {
+                                found = true;
+                        }
+
+                }
+                Assert.assertFalse(found);
+
+                NodeList allNodes1 = juddi.getAllNodes(authInfoRoot);
+                for (int i = 0; i < allNodes1.getNode().size(); i++) {
+                        if (allNodes1.getNode().get(i).getName().equals("test_node")) {
+                                return;
+                        }
+                }
+                //TODO revise cascade deletes on nodes and clerks
+                Assert.fail("node unexpected deleted");
+        }
+
+        @Test
+        public void testAddClerkExistingNode() throws Exception {
+
+                SaveClerk sc = new SaveClerk();
+                sc.setAuthInfo(authInfoRoot);
+                Clerk c = new Clerk();
+                c.setName("clerk1");
+
+                c.setPassword("pass");
+                c.setPublisher("username");
+                c.setNode(new Node());
+                c.getNode().setName("test_node");
+                c.getNode().setClientName("test_client");
+                c.getNode().setProxyTransport(org.apache.juddi.v3.client.transport.JAXWSTransport.class.getCanonicalName());
+                c.getNode().setCustodyTransferUrl("http://localhost");
+                c.getNode().setDescription("http://localhost");
+                c.getNode().setInquiryUrl("http://localhost");
+                c.getNode().setPublishUrl("http://localhost");
+                c.getNode().setReplicationUrl("http://localhost");
+                c.getNode().setSecurityUrl("http://localhost");
+                c.getNode().setSubscriptionListenerUrl("http://localhost");
+                c.getNode().setSubscriptionUrl("http://localhost");
+                sc.getClerk().add(c);
+
+                SaveNode saveNode = new SaveNode();
+                saveNode.setAuthInfo(authInfoRoot);
+                saveNode.getNode().add(c.getNode());
+
+                juddi.saveNode(saveNode);
+
+                juddi.saveClerk(sc);
+                //delete it
+                juddi.deleteClerk(new DeleteClerk(authInfoRoot, "clerk1"));
+
+                juddi.deleteNode(new DeleteNode(authInfoRoot, "test_node"));
+                //confirm it's gone
+                NodeList allNodes = juddi.getAllNodes(authInfoRoot);
+                boolean found = false;
+                for (int i = 0; i < allNodes.getNode().size(); i++) {
+                        if (allNodes.getNode().get(i).getName().equals("test_node")) {
+                                found = true;
+                        }
+
+                }
+                Assert.assertFalse(found);
+        }
+
+        @Test
+        public void setReplicationConfig() throws Exception {
+
+                Node node = new Node();
+                node.setName("test_node");
+                node.setClientName("test_client");
+                node.setProxyTransport(org.apache.juddi.v3.client.transport.JAXWSTransport.class.getCanonicalName());
+                node.setCustodyTransferUrl("http://localhost");
+                node.setDescription("http://localhost");
+                node.setInquiryUrl("http://localhost");
+                node.setPublishUrl("http://localhost");
+                node.setReplicationUrl("http://localhost");
+                node.setSecurityUrl("http://localhost");
+                node.setSubscriptionListenerUrl("http://localhost");
+                node.setSubscriptionUrl("http://localhost");
+
+                SaveNode saveNode = new SaveNode();
+                saveNode.setAuthInfo(authInfoRoot);
+                saveNode.getNode().add(node);
+
+                juddi.saveNode(saveNode);
+
+                ReplicationConfiguration r = new ReplicationConfiguration();
+                r.setCommunicationGraph(new CommunicationGraph());
+              //  r.getCommunicationGraph().getEdge().add(new CommunicationGraph.Edge());
+                r.getCommunicationGraph().getNode().add("test_node");
+
+                DispositionReport setReplicationNodes = juddi.setReplicationNodes(authInfoRoot, r);
+
+                ReplicationConfiguration replicationNodes = juddi.getReplicationNodes(authInfoRoot);
+                Assert.assertNotNull(replicationNodes.getCommunicationGraph());
+                Assert.assertNotNull(replicationNodes.getCommunicationGraph().getNode());
+                Assert.assertEquals("test_node", replicationNodes.getCommunicationGraph().getNode().get(0));
+                Assert.assertNotNull(replicationNodes.getMaximumTimeToGetChanges());
+                Assert.assertNotNull(replicationNodes.getMaximumTimeToSyncRegistry());
+                Assert.assertNotNull(replicationNodes.getTimeOfConfigurationUpdate());
+                Assert.assertNotNull(replicationNodes.getSerialNumber());
+
+        }
+}

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-core/src/test/java/org/apache/juddi/replication/ReplicationNotifierTest.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/test/java/org/apache/juddi/replication/ReplicationNotifierTest.java b/juddi-core/src/test/java/org/apache/juddi/replication/ReplicationNotifierTest.java
new file mode 100644
index 0000000..0931f76
--- /dev/null
+++ b/juddi-core/src/test/java/org/apache/juddi/replication/ReplicationNotifierTest.java
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2014 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.juddi.replication;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.juddi.Registry;
+import org.apache.juddi.api.impl.API_141_JIRATest;
+import org.apache.juddi.api.impl.UDDIReplicationImpl;
+import org.apache.juddi.model.ChangeRecord;
+import org.junit.AfterClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+import org.junit.BeforeClass;
+import org.uddi.api_v3.BusinessEntity;
+import org.uddi.api_v3.Name;
+import org.uddi.api_v3.SaveBusiness;
+import org.uddi.v3_service.UDDIReplicationPortType;
+
+/**
+ *
+ * @author Alex O'Ree
+ */
+public class ReplicationNotifierTest {
+        private static Log logger = LogFactory.getLog(API_141_JIRATest.class);
+        static UDDIReplicationPortType repl = new UDDIReplicationImpl();
+        static ReplicationNotifier notifier = null;
+        protected static String authInfoJoe = null;
+        protected static String authInfoMary = null;
+        protected static String authInfoSam = null;
+        protected static String authInfoRoot = null;
+        protected static String authInfoUDDI = null;
+        @AfterClass
+        public static void stopManager() throws ConfigurationException {
+                Registry.stop();
+        }
+
+        @BeforeClass
+        public static void startManager() throws ConfigurationException {
+                Registry.start();
+                notifier = new ReplicationNotifier();
+
+        }
+        
+       
+        
+        /**
+         * Test of getNewChangeRecord method, of class ReplicationNotifier.
+         */
+        @Test
+        public void testGetNewChangeRecord() throws Exception {
+                System.out.println("getNewChangeRecord");
+                
+ 
+                     
+           
+                
+        }
+        
+}

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-tomcat/build.xml
----------------------------------------------------------------------
diff --git a/juddi-tomcat/build.xml b/juddi-tomcat/build.xml
index 1808d0e..1f23d6f 100644
--- a/juddi-tomcat/build.xml
+++ b/juddi-tomcat/build.xml
@@ -43,5 +43,57 @@
 			</fileset>
 		</chmod>
 	</target>
+	
+	
+	<!-- node 2 -->
+	<property name="lib2.dir" value="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/lib"/>
+	<property name="webapps2.dir" value="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/webapps"/>
+	<property name="conf2.dir" value="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/conf"/>
+	<property name="endorsed2.dir" value="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/endorsed"/>
+
+	<target name="unzip-tomcat2">
+		<mkdir dir="${basedir}/target/tomcat2"/>
+		<unzip dest="${basedir}/target/tomcat2" src="${dependency.tomcat.zip}"/>
+		<unzip dest="${webapps.dir}/juddiv3" src="${dependency.juddiv3.war}"/>
+		<unzip dest="${webapps.dir}/juddi-gui" src="${dependency.juddi-gui.war}"/>
+	</target>
+	
+	<target name="copy-resources2" depends="unzip-tomcat2">
+		<copy file="${basedir}/catalina.sh" todir="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/bin" overwrite="true"/>
+		<copy file="${basedir}/catalina.bat" todir="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/bin" overwrite="true"/>
+		<copy file="${basedir}/truststore.jks" todir="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/bin" overwrite="true"/>
+		<copy file="${basedir}/truststore.jks" todir="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/" overwrite="true"/>
+		
+		<copy file="${basedir}/juddi-cryptor.bat" todir="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/bin" overwrite="true"/>
+		<copy file="${basedir}/juddi-md5.bat" todir="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/bin" overwrite="true"/>
+		<copy file="${basedir}/juddi-cryptor.sh" todir="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/bin" overwrite="true"/>
+		<copy file="${basedir}/juddi-md5.sh" todir="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/bin" overwrite="true"/>
+		
+		
+		<copy file="${basedir}/juddiv3Node2.xml" tofile="${webapps2.dir}/juddiv3/WEB-INF/classes/juddiv3.xml" overwrite="true"/>
+		<copy file="${basedir}/uddiNode2.xml" tofile="${webapps2.dir}/juddi-gui/WEB-INF/classes/META-INF/uddi.xml" overwrite="true"/>
+		<copy file="${basedir}/serverNode2.xml" tofile="${conf2.dir}/server.xml" overwrite="true"/>
+		
+		
+		
+        <copy file="${basedir}/tomcat-users.xml" todir="${conf2.dir}" overwrite="true"/>
+		<copy file="${basedir}/context.xml" todir="${webapps2.dir}/juddiv3/META-INF" overwrite="true"/>
+		<copy file="${basedir}/keystore.jks" todir="${conf2.dir}" overwrite="true"/>
+		
+ 		<copy file="${dependency.mysql.jar}" todir="${lib2.dir}"/>
+		<copy file="${dependency.postgres.jar}" todir="${lib2.dir}"/>
+		<copy file="${dependency.log4j.jar}" todir="${lib2.dir}"/>
+		<copy file="${dependency.derby.jar}" todir="${lib2.dir}"/>
+		<copy file="${dependency.commons-discovery.jar}" todir="${lib2.dir}"/>
+		<copy file="${dependency.jaxws.jar}" todir="${endorsed2.dir}"/>
+	</target>
+	
+	<target name="package-tomcat2" depends="copy-resources2">
+		<chmod perm="ugo+x">
+			<fileset dir="${basedir}/target/tomcat2/apache-tomcat-${apache.tomcat.version}/bin">
+				<include name="*.sh"/>
+			</fileset>
+		</chmod>
+	</target>
 
 </project>

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-tomcat/juddi_install_data_node2/root_BusinessEntity.xml
----------------------------------------------------------------------
diff --git a/juddi-tomcat/juddi_install_data_node2/root_BusinessEntity.xml b/juddi-tomcat/juddi_install_data_node2/root_BusinessEntity.xml
new file mode 100644
index 0000000..6c8b682
--- /dev/null
+++ b/juddi-tomcat/juddi_install_data_node2/root_BusinessEntity.xml
@@ -0,0 +1,668 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright 2001-2009 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */ -->
+ <!-- 
+  This file contains the root business entity structure that represents your registry.  The key chosen (or generated) for this entity will serve
+  as the node id for all entities published within the registry.  The services contained within this business entity reflect the UDDI APIs that
+  you wish to support (adding or subtracting the services here will not enable/disable them, simply add/omit them from being discovered via UDDI).
+  
+  The top-level business entity and sub-entities all use keys as unique identifiers.  They are left blank by default which means the system will
+  generate a key (generated as root partition with GUID appended).  You can choose to create your own, human-readable keys but they must match
+  the root key generator created in the root_tModelKeyGen.xml file.  Matching means they must equal the root key generator with the keyword
+  "keygenerator" replaced by your own string.
+  
+  Example:
+  
+  root_tModelKeyGen.xml key is uddi:www.mycompany.com:registry:keygenerator
+  
+  Legal user-defined keys are:
+  
+  uddi:www.mycompany.com:registry:ubr-node (for the businessKey)
+  uddi:www.mycompany.com:registry:inquiry-service (for the inquiry service service key)
+  uddi:www.mycompany.com:registry:inquiry-service-wsdlDeployment (for the inquiry service binding template that represents the WSDL)
+  
+  
+See below for other fields that you may want to edit...
+-->
+<businessEntity xmlns="urn:uddi-org:api_v3" xmlns:xml="http://www.w3.org/XML/1998/namespace" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+     <!-- Change the name field to represent the name of your registry -->
+     <name xml:lang="en">An Apache jUDDI Node</name>
+     <!-- Change the description field to provided a brief description of your registry -->
+     <description xml:lang="en">This is a UDDI registry node as implemented by Apache jUDDI.</description>
+     <discoveryURLs>
+          <!-- This discovery URL should point to the home installation URL of jUDDI -->
+          <discoveryURL useType="homepage">${juddi.server.baseurl}</discoveryURL>
+     </discoveryURLs>
+     <categoryBag>
+          <keyedReference tModelKey="uddi:uddi.org:categorization:nodes" keyValue="node"  keyName="uddi.org:categorization:nodes"/>
+     </categoryBag>
+     <businessServices>
+          <!-- As mentioned above, you may want to provide user-defined keys for these (and the services/bindingTemplates below.  Services that you
+          don't intend to support should be removed entirely -->
+          <!-- inquiry v3 -->
+          <businessService serviceKey="uddi:another.juddi.apache.org:services-inquiry" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">UDDI Inquiry Service</name>
+               <description xml:lang="en">Web Service supporting UDDI Inquiry API</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-inquiry-ws" serviceKey="uddi:another.juddi.apache.org:services-inquiry">
+                         <description>UDDI Inquiry API V3</description>
+                         <!-- This should be changed to the WSDL URL of the inquiry API.  An access point inside a bindingTemplate will be found for every service
+                         in this file.  They all must point to their API's WSDL URL -->
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/inquiry?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_inquiry">
+                                   <instanceDetails>
+                                        <instanceParms>
+                <![CDATA[
+                  <?xml version="1.0" encoding="utf-8" ?>
+                  <UDDIinstanceParmsContainer xmlns="urn:uddi-org:policy_v3_instanceParms">
+                    <defaultSortOrder>
+                      uddi:uddi.org:sortorder:binarysort
+                    </defaultSortOrder>
+                  </UDDIinstanceParmsContainer>
+                ]]>
+                                        </instanceParms>
+                                   </instanceDetails>
+                              </tModelInstanceInfo>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+    
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-inquiry-ws-ssl" serviceKey="uddi:another.juddi.apache.org:services-inquiry">
+                         <description>UDDI Inquiry API V3 SSL</description>
+                         <!-- This should be changed to the WSDL URL of the inquiry API.  An access point inside a bindingTemplate will be found for every service
+                         in this file.  They all must point to their API's WSDL URL -->
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/inquiry?wsdl</accessPoint> 
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_inquiry">
+                                   <instanceDetails>
+                                        <instanceParms>
+                <![CDATA[
+                  <?xml version="1.0" encoding="utf-8" ?>
+                  <UDDIinstanceParmsContainer xmlns="urn:uddi-org:policy_v3_instanceParms">
+                    <defaultSortOrder>
+                      uddi:uddi.org:sortorder:binarysort
+                    </defaultSortOrder>
+                  </UDDIinstanceParmsContainer>
+                ]]>
+                                        </instanceParms>
+                                   </instanceDetails>
+                              </tModelInstanceInfo>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3"/>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+               </bindingTemplates>
+               <categoryBag>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:namespace" keyName="uddi-org:xml:namespace" keyValue="urn:uddi-org:v3_service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:wsdl:types" keyName="uddi-org:wsdl:types" keyValue="service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:localname" keyName="uddi-org:xml:localName" keyValue="UDDIInquiryService"/>
+               </categoryBag>
+          </businessService>
+          <!-- inquiry v2 -->
+          <businessService serviceKey="uddi:another.juddi.apache.org:services-inquiryv2" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">UDDIv2 Inquiry Service</name>
+               <description xml:lang="en">Web Service supporting UDDIv2 Inquiry API</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-inquiryv2-ws" serviceKey="uddi:another.juddi.apache.org:services-inquiryv2">
+                         <description>UDDI Inquiry API V2</description>
+                         <!-- This should be changed to the WSDL URL of the inquiry API.  An access point inside a bindingTemplate will be found for every service
+                         in this file.  They all must point to their API's WSDL URL -->
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/inquiryv2?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+    
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-inquiryv2-ws-ssl" serviceKey="uddi:another.juddi.apache.org:services-inquiryv2">
+                         <description>UDDI Inquiry API V3 SSL</description>
+                         <!-- This should be changed to the WSDL URL of the inquiry API.  An access point inside a bindingTemplate will be found for every service
+                         in this file.  They all must point to their API's WSDL URL -->
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/inquiryv2?wsdl</accessPoint> 
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3"/>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+               </bindingTemplates>
+               <categoryBag>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:namespace" keyName="uddi-org:xml:namespace" keyValue="urn:uddi-org:inquiry_v2"/>
+                    <keyedReference tModelKey="uddi:uddi.org:wsdl:types" keyName="uddi-org:wsdl:types" keyValue="service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:localname" keyName="uddi-org:xml:localName" keyValue="Inquire"/>
+               </categoryBag>
+          </businessService>
+          <!-- inquiry v3 REST -->
+          <businessService serviceKey="uddi:another.juddi.apache.org:services-inquiry-rest" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">UDDI Inquiry REST Service</name>
+               <description xml:lang="en">Web Service supporting UDDI Inquiry API via HTTP GET</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-inquiry-rest" serviceKey="uddi:another.juddi.apache.org:services-inquiry-rest">
+                         <description>UDDI Inquiry API V3 REST</description>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:rest" />
+                         </tModelInstanceDetails>
+                         <accessPoint useType="wadlDeployment">${juddi.server.baseurl}/services/inquiryRest?_wadl</accessPoint>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wadl" keyValue="wadlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-inquiry-rest-ssl" serviceKey="uddi:another.juddi.apache.org:services-inquiry-rest">
+                         <description>UDDI Inquiry API V3 REST SSL</description>
+                         <accessPoint useType="wadlDeployment">${juddi.server.baseurlsecure}/services/inquiryRest?_wadl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3"/>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:rest" />
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wadl" keyValue="wadlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+               </bindingTemplates>
+               <categoryBag>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:namespace" keyName="uddi-org:xml:namespace" keyValue="localhost"/>
+                    <keyedReference tModelKey="uddi:uddi.org:wadl:types" keyName="uddi-org:wadl:types" keyValue="service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:localname" keyName="uddi-org:xml:localName" keyValue="Servicename"/>
+               </categoryBag>
+          </businessService>
+          <!-- publish v3 -->
+          <businessService serviceKey="uddi:another.juddi.apache.org:services-publish" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">UDDI Publish Service</name>
+               <description xml:lang="en">Web Service supporting UDDI Publish API</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-publish-ws" serviceKey="uddi:another.juddi.apache.org:services-publish">
+                         <description>UDDI Publication API V3</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/publish?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_publication">
+                                   <instanceDetails>
+                                        <instanceParms>
+                <![CDATA[
+                  <?xml version="1.0" encoding="utf-8" ?>
+                  <UDDIinstanceParmsContainer xmlns="urn:uddi-org:policy_v3_instanceParms">
+                    <authInfoUse>required</authInfoUse>
+                  </UDDIinstanceParmsContainer>
+                ]]>
+                                        </instanceParms>
+                                   </instanceDetails>
+                              </tModelInstanceInfo>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+		
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-publish-ws-ssl" serviceKey="uddi:another.juddi.apache.org:services-publish">
+                         <description>UDDI Publication API V3 SSL</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/publish?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_publication">
+                                   <instanceDetails>
+                                        <instanceParms>
+                <![CDATA[
+                  <?xml version="1.0" encoding="utf-8" ?>
+                  <UDDIinstanceParmsContainer xmlns="urn:uddi-org:policy_v3_instanceParms">
+                    <authInfoUse>required</authInfoUse>
+                  </UDDIinstanceParmsContainer>
+                ]]>
+                                        </instanceParms>
+                                   </instanceDetails>
+                              </tModelInstanceInfo>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_security" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+		
+               </bindingTemplates>
+               <categoryBag>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:namespace" keyName="uddi-org:xml:namespace" keyValue="urn:uddi-org:v3_service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:wsdl:types" keyName="uddi-org:wsdl:types" keyValue="service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:localname" keyName="uddi-org:xml:localName" keyValue="UDDIPublicationService"/>
+               </categoryBag>
+          </businessService>
+ 
+          <!-- publish v2 -->
+          <businessService serviceKey="uddi:another.juddi.apache.org:services-publishv2" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">UDDIv2 Publish Service</name>
+               <description xml:lang="en">Web Service supporting UDDIv2 Publish API</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-publishv2-ws" serviceKey="uddi:another.juddi.apache.org:services-publishv2">
+                         <description>UDDIv2 Publication API V2</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/publishv2?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-publishv2-ws-ssl" serviceKey="uddi:another.juddi.apache.org:services-publishv2">
+                         <description>UDDI Publication API V2 SSL</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/publishv2?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3" />
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+               </bindingTemplates>
+               <categoryBag>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:namespace" keyName="uddi-org:xml:namespace" keyValue="urn:uddi-org:inquiry_v2"/>
+                    <keyedReference tModelKey="uddi:uddi.org:wsdl:types" keyName="uddi-org:wsdl:types" keyValue="service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:localname" keyName="uddi-org:xml:localName" keyValue="Publish"/>
+               </categoryBag>
+          </businessService>
+ 
+          <!-- security v3 -->
+
+          <businessService serviceKey="uddi:another.juddi.apache.org:services-security" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">UDDI Security Service</name>
+               <description xml:lang="en">Web Service supporting UDDI Security API</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-security-ws" serviceKey="uddi:another.juddi.apache.org:services-security">
+                         <description>UDDI Security API V3</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/security?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_security" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-security-ws-ssl" serviceKey="uddi:another.juddi.apache.org:services-security">
+                         <description>UDDI Security API V3 SSL</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/security?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_security" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+               </bindingTemplates>
+               <categoryBag>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:namespace" keyName="uddi-org:xml:namespace" keyValue="urn:uddi-org:v3_service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:wsdl:types" keyName="uddi-org:wsdl:types" keyValue="service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:localname" keyName="uddi-org:xml:localName" keyValue="UDDISecurityService"/>
+               </categoryBag>
+          </businessService>
+          <!-- custody v3 -->
+          <businessService serviceKey="uddi:another.juddi.apache.org:services-custodytransfer" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">UDDI Custody and Ownership Transfer Service</name>
+               <description xml:lang="en">Web Service supporting UDDI Custody and Ownership Transfer API</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-custodytransfer-ws" serviceKey="uddi:another.juddi.apache.org:services-custodytransfer">
+                         <description>UDDI Custody and Ownership Transfer API V3</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/custody-transfer?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_ownership_transfer">
+                                   <instanceDetails>
+                                        <instanceParms>
+                <![CDATA[
+                <?xml version="1.0" encoding="utf-8" ?>
+                <UDDIinstanceParmsContainer
+                 xmlns="urn:uddi-org:policy_v3_instanceParms">
+                  <authInfoUse>required</authInfoUse>
+                </UDDIinstanceParmsContainer>
+                ]]>
+                                        </instanceParms>
+                                   </instanceDetails>
+			  
+                              </tModelInstanceInfo>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+		
+		
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-custodytransfer-ws-ssl" serviceKey="uddi:another.juddi.apache.org:services-custodytransfer">
+                         <description>UDDI Custody and Ownership Transfer API V3 SSL</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/custody-transfer?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_ownership_transfer">
+                                   <instanceDetails>
+                                        <instanceParms>
+                <![CDATA[
+                <?xml version="1.0" encoding="utf-8" ?>
+                <UDDIinstanceParmsContainer
+                 xmlns="urn:uddi-org:policy_v3_instanceParms">
+                  <authInfoUse>required</authInfoUse>
+                </UDDIinstanceParmsContainer>
+                ]]>
+                                        </instanceParms>
+                                   </instanceDetails>
+                              </tModelInstanceInfo>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3"/>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+		
+		
+               </bindingTemplates>
+               <categoryBag>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:namespace" keyName="uddi-org:xml:namespace" keyValue="urn:uddi-org:v3_service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:wsdl:types" keyName="uddi-org:wsdl:types" keyValue="service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:localname" keyName="uddi-org:xml:localName" keyValue="UDDICustodyTransferService"/>
+               </categoryBag>
+          </businessService>
+                
+          <!-- subscription v3 -->
+          <businessService serviceKey="uddi:another.juddi.apache.org:services-subscription" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">UDDI Subscription Service</name>
+               <description xml:lang="en">Web Service supporting UDDI Subscription API</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-subscription-ws" serviceKey="uddi:another.juddi.apache.org:services-subscription">
+                         <description>UDDI Subscription API V3</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/subscription?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_subscription">
+                                   <instanceDetails>
+                                        <instanceParms>
+                <![CDATA[
+                <?xml version="1.0" encoding="utf-8" ?>
+                <UDDIinstanceParmsContainer
+                xmlns="urn:uddi-org:policy_v3_instanceParms">
+                <authInfoUse>required</authInfoUse>
+                <filterUsingFindAPI>supported</filterUsingFindAPI>
+                </UDDIinstanceParmsContainer>
+                ]]>
+                                        </instanceParms>
+                                   </instanceDetails>
+                              </tModelInstanceInfo>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+		
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-subscription-ws-ssl" serviceKey="uddi:another.juddi.apache.org:services-subscription">
+                         <description>UDDI Subscription API V3 SSL</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/subscription?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_subscription">
+                                   <instanceDetails>
+                                        <instanceParms>
+                <![CDATA[
+                <?xml version="1.0" encoding="utf-8" ?>
+                <UDDIinstanceParmsContainer
+                xmlns="urn:uddi-org:policy_v3_instanceParms">
+                <authInfoUse>required</authInfoUse>
+                <filterUsingFindAPI>supported</filterUsingFindAPI>
+                </UDDIinstanceParmsContainer>
+                ]]>
+                                        </instanceParms>
+                                   </instanceDetails>
+                              </tModelInstanceInfo>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3"/>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+               </bindingTemplates>
+               <categoryBag>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:namespace" keyName="uddi-org:xml:namespace" keyValue="urn:uddi-org:v3_service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:wsdl:types" keyName="uddi-org:wsdl:types" keyValue="service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:localname" keyName="uddi-org:xml:localName" keyValue="UDDISubscriptionService"/>
+               </categoryBag>
+          </businessService>
+          <!-- subscription listener v3 -->
+          <businessService serviceKey="uddi:another.juddi.apache.org:services-subscriptionlistener" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">UDDI Subscription Listener Service</name>
+               <description xml:lang="en">Web Service supporting UDDI Subscription Listener API</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-subscriptionlistener-ws" serviceKey="uddi:another.juddi.apache.org:services-subscriptionlistener">
+                         <description>UDDI Subscription Listener API V3</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/subscription-listener?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_subscriptionlistener" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+		
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-subscriptionlistener-ws-ssl" serviceKey="uddi:another.juddi.apache.org:services-subscriptionlistener">
+                         <description>UDDI Subscription Listener API V3 SSL</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/subscription-listener?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_subscriptionlistener" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+		
+		
+               </bindingTemplates>
+               <categoryBag>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:namespace" keyName="uddi-org:xml:namespace" keyValue="urn:uddi-org:v3_service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:wsdl:types" keyName="uddi-org:wsdl:types" keyValue="service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:localname" keyName="uddi-org:xml:localName" keyValue="UDDISubscriptionListenerService"/>
+               </categoryBag>
+          </businessService>
+	
+
+          <businessService serviceKey="uddi:another.juddi.apache.org:services-valueset" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">UDDI Value Set API Service</name>
+               <description xml:lang="en">Web Service supporting UDDI Value Set Validation service. This service provides tModel value validation and is
+                    configured using the jUDDI Publisher Service</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-valueset-ws" serviceKey="uddi:another.juddi.apache.org:services-valueset">
+                         <description>UDDI Value Set Validation API Version 3</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/valueset-validation?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_valuesetvalidation" />
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+		
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-valueset-ws-ssl" serviceKey="uddi:another.juddi.apache.org:services-valueset">
+                         <description>UDDI Value Set Validation API Version 3 SSL</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/valueset-validation?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_valuesetvalidation" />
+
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+		
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-valueset-cp" serviceKey="uddi:another.juddi.apache.org:services-valueset">
+                         <description>UDDI Value Set Validation API Version 3 using InVM Classpath Transport. Use this endpoint for Value Set Validation when
+                              located on the same instance of jUDDI.</description>
+                         <accessPoint useType="classpath">classpath:/org.apache.juddi.api.impl.UDDIValueSetValidationImpl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:v3_valuesetvalidation" />
+                         </tModelInstanceDetails>
+                    </bindingTemplate>
+		
+               </bindingTemplates>
+          </businessService>
+	
+	
+          <businessService serviceKey="uddi:another.juddi.apache.org:services-valueset-cache" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">UDDI Value Set Caching API Service</name>
+               <description xml:lang="en">Web Service supporting UDDI Value Set Caching service. This service provides tModel value validation and is
+                    configured using the jUDDI Publisher Service</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-valueset-cache-ws" serviceKey="uddi:another.juddi.apache.org:services-valueset-cache">
+                         <description>UDDI Value Set Caching API Version 3</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/valueset-caching?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi-org:valueSetCaching_v3" />
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+		
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-valueset-cache-ws-ssl" serviceKey="uddi:another.juddi.apache.org:services-valueset-cache">
+                         <description>UDDI Value Set caching API Version 3 SSL</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/valueset-caching?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi-org:valueSetCaching_v3" />
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+
+
+
+
+
+                         </categoryBag>
+                    </bindingTemplate>
+		
+               </bindingTemplates>
+          </businessService>
+	
+	
+	
+
+
+          <businessService serviceKey="uddi:another.juddi.apache.org:replication" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">UDDI Replication API Version 3</name>
+               <description xml:lang="en">UDDI Replication API Version 3</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-replication-ws" serviceKey="uddi:another.juddi.apache.org:replication">
+                         <description>UDDI Value Set Validation API Version 3</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/replication?wsdl</accessPoint>
+
+                         <tModelInstanceInfo
+                              tModelKey="uddi:uddi.org:v3_replication" />
+                         <tModelInstanceInfo 
+                              tModelKey="uddi:uddi.org:protocol:mutualauthenticatedssl3" />
+		  
+
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+               </bindingTemplates>
+          </businessService>
+	
+	
+                
+          <!-- juddi api service -->
+          <businessService serviceKey="uddi:another.juddi.apache.org:services-publisher" businessKey="uddi:another.juddi.apache.org:businesses-asf">
+               <name xml:lang="en">jUDDI Publisher Service</name>
+               <description xml:lang="en">Web Service supporting jUDDI specific API</description>
+               <bindingTemplates>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-publisher-ws" serviceKey="uddi:another.juddi.apache.org:services-publisher">
+                         <description>jUDDI Publisher Service API V3</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurl}/services/publisher?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+                    <bindingTemplate bindingKey="uddi:another.juddi.apache.org:servicebindings-publisher-ws-ssl" serviceKey="uddi:another.juddi.apache.org:services-publisher">
+                         <description>jUDDI Publisher Service API V3 SSL</description>
+                         <accessPoint useType="wsdlDeployment">${juddi.server.baseurlsecure}/services/publisher?wsdl</accessPoint>
+                         <tModelInstanceDetails>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:serverauthenticatedssl3"/>
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:protocol:soap" />
+                              <tModelInstanceInfo tModelKey="uddi:uddi.org:transport:http" />
+			
+                         </tModelInstanceDetails>
+                         <categoryBag>
+                              <keyedReference keyName="uddi-org:types:wsdl" keyValue="wsdlDeployment" tModelKey="uddi:uddi.org:categorization:types"/>
+                         </categoryBag>
+                    </bindingTemplate>
+               </bindingTemplates>
+               <categoryBag>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:namespace" keyName="uddi-org:xml:namespace" keyValue="urn:juddi-apache-org:v3_service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:wsdl:types" keyName="uddi-org:wsdl:types" keyValue="service"/>
+                    <keyedReference tModelKey="uddi:uddi.org:xml:localname" keyName="uddi-org:xml:localName" keyValue="JUDDIApiService"/>
+               </categoryBag>
+          </businessService>
+     </businessServices>
+</businessEntity>
+
+
+
+

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-tomcat/juddi_install_data_node2/root_Publisher.xml
----------------------------------------------------------------------
diff --git a/juddi-tomcat/juddi_install_data_node2/root_Publisher.xml b/juddi-tomcat/juddi_install_data_node2/root_Publisher.xml
new file mode 100644
index 0000000..a5949f1
--- /dev/null
+++ b/juddi-tomcat/juddi_install_data_node2/root_Publisher.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright 2001-2009 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */ -->
+<publisher xmlns="urn:juddi-apache-org:api_v3" authorizedName="root">
+  <publisherName>root publisher</publisherName>
+  <isAdmin>true</isAdmin>
+</publisher>

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-tomcat/juddi_install_data_node2/root_tModelKeyGen.xml
----------------------------------------------------------------------
diff --git a/juddi-tomcat/juddi_install_data_node2/root_tModelKeyGen.xml b/juddi-tomcat/juddi_install_data_node2/root_tModelKeyGen.xml
new file mode 100644
index 0000000..3ae411a
--- /dev/null
+++ b/juddi-tomcat/juddi_install_data_node2/root_tModelKeyGen.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright 2001-2009 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */ -->
+<!-- 
+  In this file, you only need to edit the tModelKey just below.  This will determine your root partition; the base that all system-generated
+  keys will use.  The keywords "uddi" and "keygenerator" must enclose the partition, but you are free to edit the interior.  The general format
+  is a domain name followed by a colon-delimited list of keywords (known as key-specific strings).
+  
+  Examples:
+  
+  uddi:www.mycompany.com:registry:keygenerator
+  uddi:uddi.acme.com:keygenerator
+  uddi:engineering.umich.edu:soa:ubr:keygenerator
+ -->
+<tModel tModelKey="uddi:another.juddi.apache.org:keygenerator" xmlns="urn:uddi-org:api_v3">
+  <name>uddi-org:keyGenerator</name>
+  <description>Root domain key generator</description>
+  <overviewDoc>
+    <overviewURL useType="text">
+      http://uddi.org/pubs/uddi_v3.htm#keyGen</overviewURL>
+  </overviewDoc>
+  <categoryBag>
+    <keyedReference tModelKey="uddi:uddi.org:categorization:types" keyName="uddi-org:types:keyGenerator"
+      keyValue="keyGenerator" />
+  </categoryBag>
+</tModel>

http://git-wip-us.apache.org/repos/asf/juddi/blob/455149a9/juddi-tomcat/pom.xml
----------------------------------------------------------------------
diff --git a/juddi-tomcat/pom.xml b/juddi-tomcat/pom.xml
index 52b3a2f..cf23952 100644
--- a/juddi-tomcat/pom.xml
+++ b/juddi-tomcat/pom.xml
@@ -139,6 +139,7 @@
 								<ant antfile="${basedir}/build.xml">
 									<property name="dependency.tomcat.zip" value="${dependency.tomcat.zip}" />
 									<target name="package-tomcat" />
+									<target name="package-tomcat2" />
 								</ant>
 							</tasks>
 						</configuration>


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


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

Posted by al...@apache.org.
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/JUDDI-241
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


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

Posted by al...@apache.org.
http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java b/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
index 2148827..a271d7e 100644
--- a/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
+++ b/juddi-core/src/main/java/org/apache/juddi/mapping/MappingApiToModel.java
@@ -16,36 +16,55 @@
  */
 package org.apache.juddi.mapping;
 
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.GregorianCalendar;
+import java.util.HashSet;
 import java.util.List;
+import javax.persistence.EntityManager;
 import javax.xml.bind.JAXB;
 import javax.xml.bind.JAXBElement;
 import javax.xml.transform.dom.DOMResult;
-
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.juddi.jaxb.JAXBMarshaller;
+import org.apache.juddi.model.Address;
 import org.apache.juddi.model.BindingTemplate;
 import org.apache.juddi.model.BusinessService;
 import org.apache.juddi.model.CanonicalizationMethod;
+import org.apache.juddi.model.CommunicationGraph;
+import org.apache.juddi.model.Contact;
+import org.apache.juddi.model.ControlMessage;
+import org.apache.juddi.model.Edge;
+import org.apache.juddi.model.KeyDataValue;
 import org.apache.juddi.model.KeyInfo;
+import org.apache.juddi.model.Node;
+import org.apache.juddi.model.Operator;
+import org.apache.juddi.model.OperatorStatusType;
 import org.apache.juddi.model.Publisher;
 import org.apache.juddi.model.Reference;
 import org.apache.juddi.model.Signature;
 import org.apache.juddi.model.SignatureMethod;
 import org.apache.juddi.model.SignatureTransform;
+import org.apache.juddi.model.SignatureTransformDataValue;
 import org.apache.juddi.model.SignatureValue;
 import org.apache.juddi.model.SignedInfo;
 import org.apache.juddi.model.Tmodel;
-import org.apache.juddi.model.KeyDataValue;
-import org.apache.juddi.model.SignatureTransformDataValue;
+import org.apache.juddi.model.UddiEntity;
+import org.apache.juddi.v3.error.ErrorMessage;
+import org.apache.juddi.v3.error.ValueNotAllowedException;
 import org.uddi.api_v3.Description;
+import org.uddi.api_v3.OperationalInfo;
+import org.uddi.api_v3.SaveBinding;
+import org.uddi.repl_v3.ChangeRecord;
+import org.uddi.repl_v3.ReplicationConfiguration;
 import org.uddi.sub_v3.ObjectFactory;
 import org.uddi.v3_service.DispositionReportFaultMessage;
 import org.w3._2000._09.xmldsig_.DSAKeyValueType;
+import org.w3._2000._09.xmldsig_.KeyInfoType;
 import org.w3._2000._09.xmldsig_.KeyValueType;
 import org.w3._2000._09.xmldsig_.PGPDataType;
 import org.w3._2000._09.xmldsig_.RSAKeyValueType;
@@ -83,8 +102,8 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapPublisher(org.apache.juddi.api_v3.Publisher apiPublisher,
-                org.apache.juddi.model.Publisher modelPublisher)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.Publisher modelPublisher)
+             throws DispositionReportFaultMessage {
                 modelPublisher.setAuthorizedName(apiPublisher.getAuthorizedName());
                 modelPublisher.setPublisherName(apiPublisher.getPublisherName());
                 modelPublisher.setEmailAddress(apiPublisher.getEmailAddress());
@@ -104,8 +123,8 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapBusinessEntity(org.uddi.api_v3.BusinessEntity apiBusinessEntity,
-                org.apache.juddi.model.BusinessEntity modelBusinessEntity)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.BusinessEntity modelBusinessEntity)
+             throws DispositionReportFaultMessage {
 
                 modelBusinessEntity.setEntityKey(apiBusinessEntity.getBusinessKey());
 
@@ -120,15 +139,15 @@ public class MappingApiToModel {
                 }
 
                 mapBusinessServices(apiBusinessEntity.getBusinessServices(),
-                        modelBusinessEntity.getBusinessServices(),
-                        modelBusinessEntity.getServiceProjections(),
-                        modelBusinessEntity);
+                     modelBusinessEntity.getBusinessServices(),
+                     modelBusinessEntity.getServiceProjections(),
+                     modelBusinessEntity);
 
                 mapBusinessSignature(apiBusinessEntity.getSignature(), modelBusinessEntity);
         }
 
         private static List<Signature> mapApiSignaturesToModelSignatures(List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 List<Signature> modelSignatures = new ArrayList<Signature>();
                 modelSignatures.clear();
                 for (org.w3._2000._09.xmldsig_.SignatureType signatureType : apiSignatures) {
@@ -224,7 +243,7 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapBusinessServiceSignature(List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures, BusinessService modelBusinessService)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 List<Signature> modelSignatures = mapApiSignaturesToModelSignatures(apiSignatures);
                 for (Signature modelSignature : modelSignatures) {
                         modelSignature.setBusinessService(modelBusinessService);
@@ -239,7 +258,7 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapTmodelSignatures(List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures, Tmodel modelTmodel)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 List<Signature> modelSignatures = mapApiSignaturesToModelSignatures(apiSignatures);
                 for (Signature modelSignature : modelSignatures) {
                         modelSignature.setTmodel(modelTmodel);
@@ -254,7 +273,7 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapBindingTemplateSignatures(List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures, BindingTemplate modelBindingTemplate)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 List<Signature> modelSignatures = mapApiSignaturesToModelSignatures(apiSignatures);
                 for (Signature modelSignature : modelSignatures) {
                         modelSignature.setBindingTemplate(modelBindingTemplate);
@@ -269,7 +288,7 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapPublisherSignatures(List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures, Publisher modelPublisher)
-                throws DispositionReportFaultMessage {
+             throws DispositionReportFaultMessage {
                 List<Signature> modelSignatures = mapApiSignaturesToModelSignatures(apiSignatures);
                 for (Signature modelSignature : modelSignatures) {
                         modelSignature.setPublisher(modelPublisher);
@@ -284,8 +303,8 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapBusinessSignature(List<org.w3._2000._09.xmldsig_.SignatureType> apiSignatures,
-                org.apache.juddi.model.BusinessEntity modelBusinessEntity)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.BusinessEntity modelBusinessEntity)
+             throws DispositionReportFaultMessage {
                 List<Signature> modelSignatures = mapApiSignaturesToModelSignatures(apiSignatures);
                 for (Signature modelSignature : modelSignatures) {
                         modelSignature.setBusinessEntity(modelBusinessEntity);
@@ -301,9 +320,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapBusinessNames(List<org.uddi.api_v3.Name> apiNameList,
-                List<org.apache.juddi.model.BusinessName> modelNameList,
-                org.apache.juddi.model.BusinessEntity modelBusinessEntity)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.BusinessName> modelNameList,
+             org.apache.juddi.model.BusinessEntity modelBusinessEntity)
+             throws DispositionReportFaultMessage {
                 modelNameList.clear();
 
                 for (org.uddi.api_v3.Name apiName : apiNameList) {
@@ -319,9 +338,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapBusinessDescriptions(List<org.uddi.api_v3.Description> apiDescList,
-                List<org.apache.juddi.model.BusinessDescr> modelDescList,
-                org.apache.juddi.model.BusinessEntity modelBusinessEntity)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.BusinessDescr> modelDescList,
+             org.apache.juddi.model.BusinessEntity modelBusinessEntity)
+             throws DispositionReportFaultMessage {
                 modelDescList.clear();
 
                 for (org.uddi.api_v3.Description apiDesc : apiDescList) {
@@ -337,9 +356,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapDiscoveryUrls(org.uddi.api_v3.DiscoveryURLs apiDiscUrls,
-                List<org.apache.juddi.model.DiscoveryUrl> modelDiscUrlList,
-                org.apache.juddi.model.BusinessEntity modelBusinessEntity)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.DiscoveryUrl> modelDiscUrlList,
+             org.apache.juddi.model.BusinessEntity modelBusinessEntity)
+             throws DispositionReportFaultMessage {
                 modelDiscUrlList.clear();
 
                 if (apiDiscUrls != null) {
@@ -358,9 +377,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapContacts(org.uddi.api_v3.Contacts apiContacts,
-                List<org.apache.juddi.model.Contact> modelContactList,
-                org.apache.juddi.model.BusinessEntity modelBusinessEntity)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.Contact> modelContactList,
+             org.apache.juddi.model.BusinessEntity modelBusinessEntity)
+             throws DispositionReportFaultMessage {
                 modelContactList.clear();
 
                 if (apiContacts != null) {
@@ -373,7 +392,7 @@ public class MappingApiToModel {
                                 mapContactDescriptions(apiContact.getDescription(), modelContact.getContactDescrs(), modelContact, modelBusinessEntity.getEntityKey());
                                 mapContactEmails(apiContact.getEmail(), modelContact.getEmails(), modelContact, modelBusinessEntity.getEntityKey());
                                 mapContactPhones(apiContact.getPhone(), modelContact.getPhones(), modelContact, modelBusinessEntity.getEntityKey());
-                                mapContactAddresses(apiContact.getAddress(), modelContact.getAddresses(), modelContact, modelBusinessEntity.getEntityKey());
+                                mapContactAddresses(apiContact.getAddress(), modelContact.getAddresses(), modelContact);
 
                                 modelContactList.add(modelContact);
                         }
@@ -389,10 +408,10 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapContactDescriptions(List<org.uddi.api_v3.Description> apiDescList,
-                List<org.apache.juddi.model.ContactDescr> modelDescList,
-                org.apache.juddi.model.Contact modelContact,
-                String businessKey)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.ContactDescr> modelDescList,
+             org.apache.juddi.model.Contact modelContact,
+             String businessKey)
+             throws DispositionReportFaultMessage {
                 modelDescList.clear();
 
                 for (org.uddi.api_v3.Description apiDesc : apiDescList) {
@@ -409,10 +428,10 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapPersonNames(List<org.uddi.api_v3.PersonName> apiPersonNameList,
-                List<org.apache.juddi.model.PersonName> modelPersonNameList,
-                org.apache.juddi.model.Contact modelContact,
-                String businessKey)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.PersonName> modelPersonNameList,
+             org.apache.juddi.model.Contact modelContact,
+             String businessKey)
+             throws DispositionReportFaultMessage {
                 modelPersonNameList.clear();
 
                 for (org.uddi.api_v3.PersonName apiPersonName : apiPersonNameList) {
@@ -429,10 +448,10 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapContactEmails(List<org.uddi.api_v3.Email> apiEmailList,
-                List<org.apache.juddi.model.Email> modelEmailList,
-                org.apache.juddi.model.Contact modelContact,
-                String businessKey)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.Email> modelEmailList,
+             org.apache.juddi.model.Contact modelContact,
+             String businessKey)
+             throws DispositionReportFaultMessage {
                 modelEmailList.clear();
 
                 for (org.uddi.api_v3.Email apiEmail : apiEmailList) {
@@ -449,10 +468,10 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapContactPhones(List<org.uddi.api_v3.Phone> apiPhoneList,
-                List<org.apache.juddi.model.Phone> modelPhoneList,
-                org.apache.juddi.model.Contact modelContact,
-                String businessKey)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.Phone> modelPhoneList,
+             org.apache.juddi.model.Contact modelContact,
+             String businessKey)
+             throws DispositionReportFaultMessage {
                 modelPhoneList.clear();
 
                 for (org.uddi.api_v3.Phone apiPhone : apiPhoneList) {
@@ -469,10 +488,10 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapContactAddresses(List<org.uddi.api_v3.Address> apiAddressList,
-                List<org.apache.juddi.model.Address> modelAddressList,
-                org.apache.juddi.model.Contact modelContact,
-                String businessKey)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.Address> modelAddressList,
+             org.apache.juddi.model.Contact modelContact
+        )
+             throws DispositionReportFaultMessage {
                 modelAddressList.clear();
 
                 for (org.uddi.api_v3.Address apiAddress : apiAddressList) {
@@ -481,7 +500,7 @@ public class MappingApiToModel {
                         modelAddress.setTmodelKey(apiAddress.getTModelKey());
                         modelAddress.setUseType(apiAddress.getUseType());
 
-                        mapAddressLines(apiAddress.getAddressLine(), modelAddress.getAddressLines(), modelAddress, businessKey, modelContact.getId());
+                        mapAddressLines(apiAddress.getAddressLine(), modelAddress.getAddressLines(), modelAddress, modelContact.getId());
 
                         modelAddressList.add(modelAddress);
                 }
@@ -492,16 +511,15 @@ public class MappingApiToModel {
          * @param apiAddressLineList
          * @param modelAddressLineList
          * @param modelAddress
-         * @param businessKey
+         *
          * @param contactId
          * @throws DispositionReportFaultMessage
          */
         public static void mapAddressLines(List<org.uddi.api_v3.AddressLine> apiAddressLineList,
-                List<org.apache.juddi.model.AddressLine> modelAddressLineList,
-                org.apache.juddi.model.Address modelAddress,
-                String businessKey,
-                Long contactId)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.AddressLine> modelAddressLineList,
+             org.apache.juddi.model.Address modelAddress,
+             Long contactId)
+             throws DispositionReportFaultMessage {
                 modelAddressLineList.clear();
 
                 for (org.uddi.api_v3.AddressLine apiAddressLine : apiAddressLineList) {
@@ -517,9 +535,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapBusinessIdentifiers(org.uddi.api_v3.IdentifierBag apiIdentifierBag,
-                List<org.apache.juddi.model.BusinessIdentifier> modelIdentifierList,
-                org.apache.juddi.model.BusinessEntity modelBusinessEntity)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.BusinessIdentifier> modelIdentifierList,
+             org.apache.juddi.model.BusinessEntity modelBusinessEntity)
+             throws DispositionReportFaultMessage {
                 modelIdentifierList.clear();
 
                 if (apiIdentifierBag != null) {
@@ -539,10 +557,10 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapBusinessServices(org.uddi.api_v3.BusinessServices apiBusinessServices,
-                List<org.apache.juddi.model.BusinessService> modelBusinessServiceList,
-                List<org.apache.juddi.model.ServiceProjection> modelServiceProjectionList,
-                org.apache.juddi.model.BusinessEntity modelBusinessEntity)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.BusinessService> modelBusinessServiceList,
+             List<org.apache.juddi.model.ServiceProjection> modelServiceProjectionList,
+             org.apache.juddi.model.BusinessEntity modelBusinessEntity)
+             throws DispositionReportFaultMessage {
                 modelBusinessServiceList.clear();
                 if (apiBusinessServices != null) {
                         List<org.uddi.api_v3.BusinessService> apiBusinessServiceList = apiBusinessServices.getBusinessService();
@@ -551,7 +569,7 @@ public class MappingApiToModel {
 
                                 // If the parent businessEntity key and the service businessEntity key (if provided) do not match, it's a projection.
                                 if (apiBusinessService.getBusinessKey() != null && apiBusinessService.getBusinessKey().length() > 0
-                                        && !modelBusinessEntity.getEntityKey().equalsIgnoreCase(apiBusinessService.getBusinessKey())) {
+                                     && !modelBusinessEntity.getEntityKey().equalsIgnoreCase(apiBusinessService.getBusinessKey())) {
 
                                         modelBusinessService.setEntityKey(apiBusinessService.getServiceKey());
                                         org.apache.juddi.model.ServiceProjection modelServiceProjection = new org.apache.juddi.model.ServiceProjection(modelBusinessEntity, modelBusinessService);
@@ -573,9 +591,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapBusinessService(org.uddi.api_v3.BusinessService apiBusinessService,
-                org.apache.juddi.model.BusinessService modelBusinessService,
-                org.apache.juddi.model.BusinessEntity modelBusinessEntity)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.BusinessService modelBusinessService,
+             org.apache.juddi.model.BusinessEntity modelBusinessEntity)
+             throws DispositionReportFaultMessage {
 
                 modelBusinessService.setBusinessEntity(modelBusinessEntity);
                 modelBusinessService.setEntityKey(apiBusinessService.getServiceKey());
@@ -599,9 +617,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapServiceNames(List<org.uddi.api_v3.Name> apiNameList,
-                List<org.apache.juddi.model.ServiceName> modelNameList,
-                org.apache.juddi.model.BusinessService modelBusinessService)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.ServiceName> modelNameList,
+             org.apache.juddi.model.BusinessService modelBusinessService)
+             throws DispositionReportFaultMessage {
                 modelNameList.clear();
 
                 for (org.uddi.api_v3.Name apiName : apiNameList) {
@@ -617,9 +635,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapServiceDescriptions(List<org.uddi.api_v3.Description> apiDescList,
-                List<org.apache.juddi.model.ServiceDescr> modelDescList,
-                org.apache.juddi.model.BusinessService modelBusinessService)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.ServiceDescr> modelDescList,
+             org.apache.juddi.model.BusinessService modelBusinessService)
+             throws DispositionReportFaultMessage {
                 modelDescList.clear();
 
                 for (org.uddi.api_v3.Description apiDesc : apiDescList) {
@@ -635,9 +653,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapBindingTemplates(org.uddi.api_v3.BindingTemplates apiBindingTemplates,
-                List<org.apache.juddi.model.BindingTemplate> modelBindingTemplateList,
-                org.apache.juddi.model.BusinessService modelBusinessService)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.BindingTemplate> modelBindingTemplateList,
+             org.apache.juddi.model.BusinessService modelBusinessService)
+             throws DispositionReportFaultMessage {
                 modelBindingTemplateList.clear();
 
                 if (apiBindingTemplates != null) {
@@ -660,9 +678,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapBindingTemplate(org.uddi.api_v3.BindingTemplate apiBindingTemplate,
-                org.apache.juddi.model.BindingTemplate modelBindingTemplate,
-                org.apache.juddi.model.BusinessService modelBusinessService)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.BindingTemplate modelBindingTemplate,
+             org.apache.juddi.model.BusinessService modelBusinessService)
+             throws DispositionReportFaultMessage {
 
                 modelBindingTemplate.setBusinessService(modelBusinessService);
                 modelBindingTemplate.setEntityKey(apiBindingTemplate.getBindingKey());
@@ -691,9 +709,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapBindingDescriptions(List<org.uddi.api_v3.Description> apiDescList,
-                List<org.apache.juddi.model.BindingDescr> modelDescList,
-                org.apache.juddi.model.BindingTemplate modelBindingTemplate)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.BindingDescr> modelDescList,
+             org.apache.juddi.model.BindingTemplate modelBindingTemplate)
+             throws DispositionReportFaultMessage {
                 modelDescList.clear();
                 for (org.uddi.api_v3.Description apiDesc : apiDescList) {
                         modelDescList.add(new org.apache.juddi.model.BindingDescr(modelBindingTemplate, apiDesc.getLang(), apiDesc.getValue()));
@@ -707,8 +725,8 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapCategoryBag(org.uddi.api_v3.CategoryBag apiCategoryBag,
-                org.apache.juddi.model.CategoryBag modelCategoryBag)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.CategoryBag modelCategoryBag)
+             throws DispositionReportFaultMessage {
 
                 if (apiCategoryBag != null) {
                         List<org.uddi.api_v3.KeyedReference> krList = apiCategoryBag.getKeyedReference();
@@ -718,7 +736,7 @@ public class MappingApiToModel {
                                         //modelKeyedReferences.clear();
                                         org.uddi.api_v3.KeyedReference apiKeyedReference = (org.uddi.api_v3.KeyedReference) elem;
                                         modelKeyedReferences.add(new org.apache.juddi.model.KeyedReference(modelCategoryBag,
-                                                apiKeyedReference.getTModelKey(), apiKeyedReference.getKeyName(), apiKeyedReference.getKeyValue()));
+                                             apiKeyedReference.getTModelKey(), apiKeyedReference.getKeyName(), apiKeyedReference.getKeyValue()));
                                 }
                         }
                         List<org.uddi.api_v3.KeyedReferenceGroup> krgList = apiCategoryBag.getKeyedReferenceGroup();
@@ -746,9 +764,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapKeyedReferenceGroup(org.uddi.api_v3.KeyedReferenceGroup apiKeyedReferenceGroup,
-                org.apache.juddi.model.KeyedReferenceGroup modelKeyedReferenceGroup,
-                org.apache.juddi.model.CategoryBag modelCategoryBag)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.KeyedReferenceGroup modelKeyedReferenceGroup,
+             org.apache.juddi.model.CategoryBag modelCategoryBag)
+             throws DispositionReportFaultMessage {
                 if (apiKeyedReferenceGroup != null) {
                         modelKeyedReferenceGroup.setCategoryBag(modelCategoryBag);
                         modelKeyedReferenceGroup.setTmodelKey(apiKeyedReferenceGroup.getTModelKey());
@@ -757,7 +775,7 @@ public class MappingApiToModel {
                                 List<org.apache.juddi.model.KeyedReference> modelKeyedReferences = modelKeyedReferenceGroup.getKeyedReferences();
                                 for (org.uddi.api_v3.KeyedReference apiKeyedReference : apiKeyedReferenceGroup.getKeyedReference()) {
                                         modelKeyedReferences.add(new org.apache.juddi.model.KeyedReference(modelKeyedReferenceGroup,
-                                                apiKeyedReference.getTModelKey(), apiKeyedReference.getKeyName(), apiKeyedReference.getKeyValue()));
+                                             apiKeyedReference.getTModelKey(), apiKeyedReference.getKeyName(), apiKeyedReference.getKeyValue()));
                                 }
                         }
 
@@ -773,9 +791,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapTModelInstanceDetails(org.uddi.api_v3.TModelInstanceDetails apiTModelInstDetails,
-                List<org.apache.juddi.model.TmodelInstanceInfo> modelTModelInstInfoList,
-                org.apache.juddi.model.BindingTemplate modelBindingTemplate)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.TmodelInstanceInfo> modelTModelInstInfoList,
+             org.apache.juddi.model.BindingTemplate modelBindingTemplate)
+             throws DispositionReportFaultMessage {
                 modelTModelInstInfoList.clear();
 
                 if (apiTModelInstDetails != null) {
@@ -799,9 +817,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapTModelInstanceInfoDescriptions(List<org.uddi.api_v3.Description> apiDescList,
-                List<org.apache.juddi.model.TmodelInstanceInfoDescr> modelDescList,
-                org.apache.juddi.model.TmodelInstanceInfo modelTModelInstInfo)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.TmodelInstanceInfoDescr> modelDescList,
+             org.apache.juddi.model.TmodelInstanceInfo modelTModelInstInfo)
+             throws DispositionReportFaultMessage {
                 modelDescList.clear();
 
                 for (org.uddi.api_v3.Description apiDesc : apiDescList) {
@@ -816,17 +834,17 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapInstanceDetails(org.uddi.api_v3.InstanceDetails apiInstanceDetails,
-                org.apache.juddi.model.TmodelInstanceInfo modelTmodelInstInfo)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.TmodelInstanceInfo modelTmodelInstInfo)
+             throws DispositionReportFaultMessage {
                 modelTmodelInstInfo.getInstanceDetailsDescrs().clear();
 
                 if (apiInstanceDetails != null) {
                         List<org.uddi.api_v3.Description> descriptions = apiInstanceDetails.getDescription();
                         List<org.uddi.api_v3.OverviewDoc> overviewdocs = apiInstanceDetails.getOverviewDoc();
                         for (org.uddi.api_v3.Description apiDesc : descriptions) {
-                                org.apache.juddi.model.InstanceDetailsDescr modelInstanceDetailsDescr =
-                                        new org.apache.juddi.model.InstanceDetailsDescr(
-                                        modelTmodelInstInfo, apiDesc.getLang(), apiDesc.getValue());
+                                org.apache.juddi.model.InstanceDetailsDescr modelInstanceDetailsDescr
+                                     = new org.apache.juddi.model.InstanceDetailsDescr(
+                                          modelTmodelInstInfo, apiDesc.getLang(), apiDesc.getValue());
                                 modelTmodelInstInfo.getInstanceDetailsDescrs().add(modelInstanceDetailsDescr);
                         }
                         for (org.uddi.api_v3.OverviewDoc apiOverviewDoc : overviewdocs) {
@@ -845,8 +863,8 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapOverviewDoc(org.uddi.api_v3.OverviewDoc apiOverviewDoc,
-                org.apache.juddi.model.OverviewDoc modelOverviewDoc)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.OverviewDoc modelOverviewDoc)
+             throws DispositionReportFaultMessage {
                 if (apiOverviewDoc != null) {
 
                         List<Description> descContent = apiOverviewDoc.getDescription();
@@ -854,7 +872,7 @@ public class MappingApiToModel {
                                 org.uddi.api_v3.Description description = (org.uddi.api_v3.Description) elem;
                                 if (description != null) {
                                         org.apache.juddi.model.OverviewDocDescr modelOverviewDocDescr = new org.apache.juddi.model.OverviewDocDescr(
-                                                modelOverviewDoc, description.getLang(), description.getValue());
+                                             modelOverviewDoc, description.getLang(), description.getValue());
                                         modelOverviewDoc.getOverviewDocDescrs().add(modelOverviewDocDescr);
                                 }
                         }
@@ -876,8 +894,8 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapTModel(org.uddi.api_v3.TModel apiTModel,
-                org.apache.juddi.model.Tmodel modelTModel)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.Tmodel modelTModel)
+             throws DispositionReportFaultMessage {
 
                 modelTModel.setEntityKey(apiTModel.getTModelKey());
                 modelTModel.setName(apiTModel.getName().getValue());
@@ -902,9 +920,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapTModelDescriptions(List<org.uddi.api_v3.Description> apiDescList,
-                List<org.apache.juddi.model.TmodelDescr> modelDescList,
-                org.apache.juddi.model.Tmodel modelTModel)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.TmodelDescr> modelDescList,
+             org.apache.juddi.model.Tmodel modelTModel)
+             throws DispositionReportFaultMessage {
                 modelDescList.clear();
 
                 for (org.uddi.api_v3.Description apiDesc : apiDescList) {
@@ -920,9 +938,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapTModelIdentifiers(org.uddi.api_v3.IdentifierBag apiIdentifierBag,
-                List<org.apache.juddi.model.TmodelIdentifier> modelIdentifierList,
-                org.apache.juddi.model.Tmodel modelTModel)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.TmodelIdentifier> modelIdentifierList,
+             org.apache.juddi.model.Tmodel modelTModel)
+             throws DispositionReportFaultMessage {
                 modelIdentifierList.clear();
 
                 if (apiIdentifierBag != null) {
@@ -941,9 +959,9 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapTModelOverviewDocs(List<org.uddi.api_v3.OverviewDoc> apiOverviewDocList,
-                List<org.apache.juddi.model.OverviewDoc> modelOverviewDocList,
-                org.apache.juddi.model.Tmodel modelTmodel)
-                throws DispositionReportFaultMessage {
+             List<org.apache.juddi.model.OverviewDoc> modelOverviewDocList,
+             org.apache.juddi.model.Tmodel modelTmodel)
+             throws DispositionReportFaultMessage {
                 modelOverviewDocList.clear();
 
                 for (org.uddi.api_v3.OverviewDoc apiOverviewDoc : apiOverviewDocList) {
@@ -960,8 +978,8 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapPublisherAssertion(org.uddi.api_v3.PublisherAssertion apiPubAssertion,
-                org.apache.juddi.model.PublisherAssertion modelPubAssertion)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.PublisherAssertion modelPubAssertion)
+             throws DispositionReportFaultMessage {
 
                 modelPubAssertion.setId(new org.apache.juddi.model.PublisherAssertionId(apiPubAssertion.getFromKey(), apiPubAssertion.getToKey()));
 
@@ -988,8 +1006,8 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapSubscription(org.uddi.sub_v3.Subscription apiSubscription,
-                org.apache.juddi.model.Subscription modelSubscription)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.Subscription modelSubscription)
+             throws DispositionReportFaultMessage {
 
                 modelSubscription.setSubscriptionKey(apiSubscription.getSubscriptionKey());
                 modelSubscription.setBindingKey(apiSubscription.getBindingKey());
@@ -1008,7 +1026,6 @@ public class MappingApiToModel {
                         modelSubscription.setBrief(Boolean.FALSE);
                 }
 
-
                 String rawFilter = JAXBMarshaller.marshallToString(new ObjectFactory().createSubscriptionFilter(apiSubscription.getSubscriptionFilter()), "org.uddi.sub_v3");
                 logger.debug("marshalled subscription filter:  " + rawFilter);
                 modelSubscription.setSubscriptionFilter(rawFilter);
@@ -1022,8 +1039,8 @@ public class MappingApiToModel {
          * @throws DispositionReportFaultMessage
          */
         public static void mapClientSubscriptionInfo(org.apache.juddi.api_v3.ClientSubscriptionInfo apiClientSubscriptionInfo,
-                org.apache.juddi.model.ClientSubscriptionInfo modelClientSubscriptionInfo)
-                throws DispositionReportFaultMessage {
+             org.apache.juddi.model.ClientSubscriptionInfo modelClientSubscriptionInfo)
+             throws DispositionReportFaultMessage {
 
                 modelClientSubscriptionInfo.setLastNotified(new Date());
                 modelClientSubscriptionInfo.setSubscriptionKey(apiClientSubscriptionInfo.getSubscriptionKey());
@@ -1132,10 +1149,10 @@ public class MappingApiToModel {
                         } else if (x509IssuerSerialOrX509SKIOrX509SubjectName instanceof String) {
                                 modelKeyInfoValue.setKeyDataValueString((String) x509IssuerSerialOrX509SKIOrX509SubjectName);
                         } else if (x509IssuerSerialOrX509SKIOrX509SubjectName instanceof X509IssuerSerialType) {
-                        	modelKeyInfoValue.setKeyDataType(X509IssuerSerialType.class.getSimpleName());
-                        	X509IssuerSerialType x509IssuerSerialType = (X509IssuerSerialType) x509IssuerSerialOrX509SKIOrX509SubjectName;
-                        	modelKeyInfoValue.setKeyDataValueString(x509IssuerSerialType.getX509IssuerName());
-                        	modelKeyInfoValue.setKeyDataValueBytes(x509IssuerSerialType.getX509SerialNumber().toByteArray());
+                                modelKeyInfoValue.setKeyDataType(X509IssuerSerialType.class.getSimpleName());
+                                X509IssuerSerialType x509IssuerSerialType = (X509IssuerSerialType) x509IssuerSerialOrX509SKIOrX509SubjectName;
+                                modelKeyInfoValue.setKeyDataValueString(x509IssuerSerialType.getX509IssuerName());
+                                modelKeyInfoValue.setKeyDataValueBytes(x509IssuerSerialType.getX509SerialNumber().toByteArray());
                         } else if (x509IssuerSerialOrX509SKIOrX509SubjectName != null) {
                                 throw new RuntimeException("Unrecognized Value for Element: " + tagName + ": " + x509IssuerSerialOrX509SKIOrX509SubjectName.getClass().getCanonicalName());
                         }
@@ -1358,4 +1375,201 @@ public class MappingApiToModel {
                 String str = serializer.writeToString(xformEl);
                 return str;
         }
+
+        public static org.apache.juddi.model.ChangeRecord mapChangeRecord(ChangeRecord rec) throws UnsupportedEncodingException {
+                org.apache.juddi.model.ChangeRecord r = new org.apache.juddi.model.ChangeRecord();
+                r.setId(rec.getChangeID().getOriginatingUSN());
+                r.setNodeID(rec.getChangeID().getNodeID());
+                StringWriter sw = new StringWriter();
+                JAXB.marshal(rec, sw);
+                r.setContents(sw.toString().getBytes("UTF8"));
+                return r;
+
+        }
+
+        public static void mapOperationalInfo(UddiEntity model, OperationalInfo operationalInfo) {
+                if (operationalInfo == null || model == null) {
+                        return;
+                }
+                if (operationalInfo.getCreated() != null) {
+                        model.setCreated(operationalInfo.getCreated().toGregorianCalendar().getTime());
+                }
+                model.setAuthorizedName(operationalInfo.getAuthorizedName());
+                if (operationalInfo.getModified() != null) {
+                        model.setModified(operationalInfo.getModified().toGregorianCalendar().getTime());
+                }
+                if (operationalInfo.getModifiedIncludingChildren() != null) {
+                        model.setModifiedIncludingChildren(operationalInfo.getModifiedIncludingChildren().toGregorianCalendar().getTime());
+                }
+                model.setNodeId(operationalInfo.getNodeID());
+
+        }
+
+        public static void mapSaveBindingToChangeRecord(SaveBinding recordIn, List<org.apache.juddi.model.ChangeRecord> recordsOut) {
+                List<org.apache.juddi.model.ChangeRecord> r = new ArrayList<org.apache.juddi.model.ChangeRecord>();
+
+        }
+
+        public static void mapReplicationConfiguration(ReplicationConfiguration replicationConfiguration, org.apache.juddi.model.ReplicationConfiguration model, EntityManager em) throws DispositionReportFaultMessage {
+
+                model.setMaximumTimeToGetChanges(replicationConfiguration.getMaximumTimeToGetChanges());
+                model.setMaximumTimeToSyncRegistry(replicationConfiguration.getMaximumTimeToSyncRegistry());
+                model.setSerialNumber(null);
+
+                //the spec doesn't specify what the format should be, however there was an example
+                //2002 03 04 1859Z
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddkkmmZ");
+                model.setTimeOfConfigurationUpdate(sdf.format(new Date()));
+                model.setContact(mapContact(replicationConfiguration.getRegistryContact().getContact()));
+                model.setCommunicationGraph(mapCommunicationGraph(replicationConfiguration.getCommunicationGraph(), em));
+                model.setOperator(mapOperators(replicationConfiguration.getOperator()));
+                if (replicationConfiguration.getSignature() != null) {
+                        model.setSignatures(mapApiSignaturesToModelSignatures(replicationConfiguration.getSignature()));
+                }
+
+        }
+
+        private static Contact mapContact(org.uddi.api_v3.Contact contact) throws DispositionReportFaultMessage {
+                Contact model = new Contact();
+                model.setAddresses(new ArrayList<Address>());
+                mapContactAddresses(contact.getAddress(), model.getAddresses(), model);
+                if (model.getAddresses().isEmpty()) {
+                        model.setAddresses(null);
+                }
+                return model;
+        }
+
+        private static CommunicationGraph mapCommunicationGraph(org.uddi.repl_v3.CommunicationGraph communicationGraph, EntityManager em) throws DispositionReportFaultMessage {
+                if (communicationGraph == null) {
+                        return null;
+                }
+                CommunicationGraph model = new CommunicationGraph();
+
+                /**
+                 * Following the listing of nodes is the controlledMessage
+                 * element that lists the set of messages over which this
+                 * communication graph is intended to administer control of. If
+                 * a message element local name is listed in the
+                 * controlledMessage element, then such messages SHALL only be
+                 * sent between nodes that are listed in the subsequent edges of
+                 * the graph. In contrast, communication restrictions are not
+                 * imposed on replication messages not identified in the
+                 * controlledMessage element.
+                 */
+                if (communicationGraph.getControlledMessage() != null) {
+                        model.setControlMessage(new ArrayList<ControlMessage>());
+                        for (int k = 0; k < communicationGraph.getControlledMessage().size(); k++) {
+                                model.getControlMessage().add(new ControlMessage(communicationGraph.getControlledMessage().get(k)));
+                        }
+                }
+                model.setNode(new ArrayList<Node>());
+                for (int i = 0; i < communicationGraph.getNode().size(); i++) {
+                        Node find = em.find(org.apache.juddi.model.Node.class, communicationGraph.getNode().get(i));
+                        if (find == null) {
+                                throw new ValueNotAllowedException(new ErrorMessage("errors.replication.configNodeNotFound", communicationGraph.getNode().get(i)));
+                        }
+                        model.getNode().add(find);
+                }
+                if (communicationGraph.getEdge() != null) {
+                        List<Edge> ret = new ArrayList<Edge>();
+                        for (int i = 0; i < communicationGraph.getEdge().size(); i++) {
+                                Edge e = new Edge();
+                                e.setCommunicationGraph(model);
+                                Node find = em.find(org.apache.juddi.model.Node.class, communicationGraph.getEdge().get(i).getMessageReceiver());
+                                if (find == null) {
+                                        throw new ValueNotAllowedException(new ErrorMessage("errors.replication.configNodeNotFound", communicationGraph.getEdge().get(i).getMessageReceiver()));
+                                }
+                                e.setMessageReceiver(find);
+                                find = em.find(org.apache.juddi.model.Node.class, communicationGraph.getEdge().get(i).getMessageSender());
+                                if (find == null) {
+                                        throw new ValueNotAllowedException(new ErrorMessage("errors.replication.configNodeNotFound", communicationGraph.getEdge().get(i).getMessageSender()));
+                                }
+                                e.setMessageSender(find);
+
+                                /**
+                                 * The message elements contain the local name
+                                 * of the Replication API message elements. They
+                                 * indicate that only messages of the type
+                                 * explicitly identified for a particular edge
+                                 * MAY be sent from the specified messageSender
+                                 * to the specified messageReceiver.
+                                 */
+                                if (communicationGraph.getEdge().get(i).getMessage() != null) {
+                                        e.setMessage(new ArrayList<ControlMessage>());
+                                        for (int k = 0; k < communicationGraph.getEdge().get(i).getMessage().size(); k++) {
+                                                e.getMessages().add(new ControlMessage(communicationGraph.getEdge().get(i).getMessage().get(k)));
+                                        }
+                                }
+                                if (communicationGraph.getEdge().get(i).getMessageReceiverAlternate() != null) {
+                                        e.setMessageReceiverAlternate(new HashSet<Node>());
+                                        for (int k = 0; k < communicationGraph.getEdge().get(i).getMessageReceiverAlternate().size(); k++) {
+                                                find = em.find(org.apache.juddi.model.Node.class, communicationGraph.getEdge().get(i).getMessageSender());
+                                                if (find == null) {
+                                                        throw new ValueNotAllowedException(new ErrorMessage("errors.replication.configNodeNotFound", communicationGraph.getEdge().get(i).getMessageSender()));
+                                                }
+                                                e.getMessageReceiverAlternate().add(find);
+                                        }
+                                }
+
+                                ret.add(e);
+                        }
+                        model.setEdge(ret);
+                }
+
+                return model;
+
+        }
+
+        private static List<Operator> mapOperators(List<org.uddi.repl_v3.Operator> api) throws DispositionReportFaultMessage {
+                if (api == null) {
+                        return null;
+                }
+                List<Operator> model = new ArrayList<Operator>();
+                for (int i = 0; i < api.size(); i++) {
+                        Operator op = new Operator();
+                        op.setSoapReplicationURL(api.get(i).getSoapReplicationURL());
+
+                        if (!api.get(i).getContact().isEmpty()) {
+                                op.setContact(new ArrayList<Contact>());
+                                for (int k = 0; k < api.get(i).getContact().size(); k++) {
+                                        op.getContact().add(mapContact(api.get(i).getContact().get(k)));
+                                }
+                        }
+                        op.setOperatorNodeID(api.get(i).getOperatorNodeID());
+                        op.setOperatorStatus(mapOperatorStatus(api.get(i).getOperatorStatus()));
+                        if (!api.get(i).getKeyInfo().isEmpty()) {
+                                op.setKeyInfo(new ArrayList<KeyInfo>());
+                                for (int k = 0; k < api.get(i).getKeyInfo().size(); k++) {
+                                        //TODO api.get(i).getKeyInfo().get(k)
+                                        org.apache.juddi.model.KeyInfo modelKeyInfo = new KeyInfo();
+                                        modelKeyInfo.setXmlID(api.get(i).getKeyInfo().get(i).getId());
+                                        modelKeyInfo.setKeyDataValue(new ArrayList<KeyDataValue>());
+                                        if (api.get(i).getKeyInfo().get(i).getContent() != null) {
+                                                modelKeyInfo.setKeyDataValue(new ArrayList<KeyDataValue>());
+                                                for (int x = 0; x < api.get(i).getKeyInfo().get(k).getContent().size(); x++) {
+                                                        mapKeyValue((JAXBElement) api.get(i).getKeyInfo().get(k).getContent().get(x), modelKeyInfo.getKeyDataValue());
+                                                }
+                                        }
+                                        op.getKeyInfo().add(modelKeyInfo);
+                                }
+
+                        }
+                        model.add(op);
+
+                }
+                return model;
+        }
+
+        private static OperatorStatusType mapOperatorStatus(org.uddi.repl_v3.OperatorStatusType operatorStatus) {
+                switch (operatorStatus) {
+                        case NEW:
+                                return OperatorStatusType.NEW;
+                        case NORMAL:
+                                return OperatorStatusType.NORMAL;
+                        case RESIGNED:
+                                return OperatorStatusType.RESIGNED;
+                }
+                return null;
+        }
+
 }

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java b/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
index 868eed5..e9bf41a 100644
--- a/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
+++ b/juddi-core/src/main/java/org/apache/juddi/mapping/MappingModelToApi.java
@@ -23,10 +23,15 @@ import javax.xml.datatype.DatatypeConfigurationException;
 import javax.xml.datatype.DatatypeFactory;
 import org.w3._2000._09.xmldsig_.X509IssuerSerialType;
 import java.io.ByteArrayInputStream;
+import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.xml.bind.JAXB;
 import javax.xml.bind.JAXBElement;
 
 import javax.xml.bind.JAXBException;
@@ -53,7 +58,6 @@ import org.apache.juddi.model.UddiEntity;
 import org.apache.juddi.model.KeyDataValue;
 import org.apache.juddi.model.Node;
 import org.apache.juddi.model.ReplicationConfiguration;
-import org.apache.juddi.model.ReplicationMessage;
 import org.apache.juddi.model.SignatureTransformDataValue;
 import org.apache.juddi.subscription.TypeConvertor;
 import org.apache.juddi.v3.error.ErrorMessage;
@@ -62,6 +66,8 @@ import org.uddi.api_v3.BusinessEntity;
 import org.uddi.api_v3.CompletionStatus;
 import org.uddi.api_v3.Contacts;
 import org.uddi.api_v3.OperationalInfo;
+import org.uddi.repl_v3.ChangeRecord;
+import org.uddi.repl_v3.ChangeRecordIDType;
 import org.uddi.repl_v3.CommunicationGraph;
 import org.uddi.repl_v3.Operator;
 import org.uddi.repl_v3.OperatorStatusType;
@@ -1219,14 +1225,16 @@ public class MappingModelToApi {
                         mapContacts(model.get(i).getContact(), c, new BusinessEntity());
                         op.getContact().addAll(c.getContact());
 
-                        for (int x = 0; x < model.get(i).getKeyInfo().size(); x++) {
-                                KeyInfoType apiKeyInfo = new KeyInfoType();
-                                KeyInfo modelKeyInfo = model.get(i).getKeyInfo().get(x);
-                                apiKeyInfo.setId(modelKeyInfo.getXmlID());
-                                List<KeyDataValue> modelKeyDataValueList = modelKeyInfo.getKeyDataValue();
-                                List<Object> apiX509KeyInfoList = apiKeyInfo.getContent();
-                                mapModelKeyDataValue(modelKeyDataValueList, apiX509KeyInfoList);
-                                op.getKeyInfo().add(apiKeyInfo);
+                        if (model.get(i).getKeyInfo() != null) {
+                                for (int x = 0; x < model.get(i).getKeyInfo().size(); x++) {
+                                        KeyInfoType apiKeyInfo = new KeyInfoType();
+                                        KeyInfo modelKeyInfo = model.get(i).getKeyInfo().get(x);
+                                        apiKeyInfo.setId(modelKeyInfo.getXmlID());
+                                        List<KeyDataValue> modelKeyDataValueList = modelKeyInfo.getKeyDataValue();
+                                        List<Object> apiX509KeyInfoList = apiKeyInfo.getContent();
+                                        mapModelKeyDataValue(modelKeyDataValueList, apiX509KeyInfoList);
+                                        op.getKeyInfo().add(apiKeyInfo);
+                                }
                         }
                         api.add(op);
                 }
@@ -1252,9 +1260,10 @@ public class MappingModelToApi {
                         CommunicationGraph.Edge apiEdge = new CommunicationGraph.Edge();
                         apiEdge.setMessageReceiver(modelEdge.getMessageReceiver().getName());
                         apiEdge.setMessageSender(modelEdge.getMessageSender().getName());
-                        Iterator<ReplicationMessage> it2 = modelEdge.getMessages().iterator();
+                        
+                        Iterator<ControlMessage> it2 = modelEdge.getMessages().iterator();
                         while (it2.hasNext()) {
-                                apiEdge.getMessage().add(it2.next().getMsg());
+                                apiEdge.getMessage().add(it2.next().getMessage());
                         }
                         Iterator<Node> it3 = modelEdge.getMessageReceiverAlternate().iterator();
                         while (it3.hasNext()) {
@@ -1281,4 +1290,27 @@ public class MappingModelToApi {
                         api.add(it.next().getName());
                 }
         }
+
+        public static ChangeRecord mapChangeRecord(org.apache.juddi.model.ChangeRecord cr) {
+                if (cr == null) {
+                        return null;
+                }
+                ChangeRecord ret = new ChangeRecord();
+
+                StringReader sr = null;
+                try {
+                        sr = new StringReader(new String(cr.getContents(), "UTF8"));
+                } catch (UnsupportedEncodingException ex) {
+                        Logger.getLogger(MappingModelToApi.class.getName()).log(Level.SEVERE, null, ex);
+                }
+                ret = JAXB.unmarshal(sr, ChangeRecord.class);
+                //secret sauce here, if this is -1, that means that the record originated at this node and needs to be populated with the databases record id
+                if (cr.getOriginatingUSN()==null || cr.getOriginatingUSN() == -1L) {
+                        ret.setChangeID(new ChangeRecordIDType(cr.getNodeID(), cr.getId()));
+                } else {
+                        ret.setChangeID(new ChangeRecordIDType(cr.getNodeID(), cr.getOriginatingUSN()));
+                }
+                return ret;
+                        
+        }
 }

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/model/ChangeRecord.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/model/ChangeRecord.java b/juddi-core/src/main/java/org/apache/juddi/model/ChangeRecord.java
index 0a9379d..e9113b4 100644
--- a/juddi-core/src/main/java/org/apache/juddi/model/ChangeRecord.java
+++ b/juddi-core/src/main/java/org/apache/juddi/model/ChangeRecord.java
@@ -19,19 +19,28 @@ package org.apache.juddi.model;
 import java.io.Serializable;
 import javax.persistence.Column;
 import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
 import javax.persistence.Id;
+import javax.persistence.Lob;
 import javax.persistence.Table;
+import javax.persistence.TableGenerator;
 
 @Entity
 @Table(name = "j3_chg_record")
 public class ChangeRecord implements Serializable {
 
+        private static final long serialVersionUID = 1L;
+
         protected String nodeID;
         protected Long originatingUSN;
-        
+        private byte[] contents;
+        private RecordType e = RecordType.ChangeRecordNull;
         private Long id;
+        private String entityKey;
 
-        @Column(name="change_contents")
+        @Column(name = "change_contents")
+        @Lob
         public byte[] getContents() {
                 return contents;
         }
@@ -39,22 +48,8 @@ public class ChangeRecord implements Serializable {
         public void setContents(byte[] contents) {
                 this.contents = contents;
         }
-        /*protected ChangeRecordIDType changeID;
-         protected Object changeRecordNull;
-         protected ChangeRecordNewData changeRecordNewData;
-         protected ChangeRecordDelete changeRecordDelete;
-         protected ChangeRecordPublisherAssertion changeRecordPublisherAssertion;
-         protected ChangeRecordHide changeRecordHide;
-         protected ChangeRecordDeleteAssertion changeRecordDeleteAssertion;
-         protected ChangeRecordAcknowledgement changeRecordAcknowledgement;
-         protected ChangeRecordCorrection changeRecordCorrection;
-         protected ChangeRecordNewDataConditional changeRecordNewDataConditional;
-         protected ChangeRecordConditionFailed changeRecordConditionFailed;
-         protected boolean acknowledgementRequested;
-         * */
-        byte[] contents;
-
-        enum RecordType {
+
+        public enum RecordType {
 
                 ChangeRecordNewData,
                 ChangeRecordDelete,
@@ -64,10 +59,27 @@ public class ChangeRecord implements Serializable {
                 ChangeRecordAcknowledgement,
                 ChangeRecordCorrection,
                 ChangeRecordNewDataConditional,
-                ChangeRecordConditionFailed
+                ChangeRecordConditionFailed,
+                ChangeRecordNull
+        }
+
+        public void setRecordType(RecordType e) {
+                this.e = e;
+        }
+
+        @Column(name = "record_type")
+        public RecordType getRecordType() {
+                return e;
         }
 
         @Id
+        @GeneratedValue(strategy = GenerationType.TABLE,
+             generator = "personGen")
+        @TableGenerator(name = "personGen",
+             table = "JPAGEN_GENERATORS",
+             pkColumnName = "NAME",
+             pkColumnValue = "JPAGEN_PERSON_GEN",
+             valueColumnName = "VALUE")
         public Long getId() {
                 return id;
         }
@@ -76,7 +88,7 @@ public class ChangeRecord implements Serializable {
                 this.id = id;
         }
 
-        @Column(name="node_id")
+        @Column(name = "node_id")
         public String getNodeID() {
                 return nodeID;
         }
@@ -85,8 +97,16 @@ public class ChangeRecord implements Serializable {
                 this.nodeID = value;
         }
 
-        
-        @Column(name="orginating_usn")
+        @Column(name = "entity_key")
+        public String getEntityKey() {
+                return entityKey;
+        }
+
+        public void setEntityKey(String value) {
+                this.entityKey = value;
+        }
+
+        @Column(name = "orginating_usn")
         public Long getOriginatingUSN() {
                 return originatingUSN;
         }
@@ -95,4 +115,3 @@ public class ChangeRecord implements Serializable {
                 this.originatingUSN = value;
         }
 }
-
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/model/Clerk.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/model/Clerk.java b/juddi-core/src/main/java/org/apache/juddi/model/Clerk.java
index f471712..fe0ca52 100644
--- a/juddi-core/src/main/java/org/apache/juddi/model/Clerk.java
+++ b/juddi-core/src/main/java/org/apache/juddi/model/Clerk.java
@@ -38,7 +38,7 @@ public class Clerk implements java.io.Serializable {
 	private String clerkName;
 	@Column(name="publisher_id", nullable = false, length=255)
 	private String publisherId;
-	@ManyToOne(cascade = CascadeType.MERGE, fetch = FetchType.EAGER)
+	@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
 	private Node node;
 	@Column(name="cred", length=255)
 	private String cred;

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/model/CommunicationGraph.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/model/CommunicationGraph.java b/juddi-core/src/main/java/org/apache/juddi/model/CommunicationGraph.java
index e0251f1..b2ec7d0 100644
--- a/juddi-core/src/main/java/org/apache/juddi/model/CommunicationGraph.java
+++ b/juddi-core/src/main/java/org/apache/juddi/model/CommunicationGraph.java
@@ -26,9 +26,12 @@ import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.OneToMany;
 import javax.persistence.Table;
+import javax.persistence.TableGenerator;
 
 @Entity
 @Table(name = "j3_chg_graph")
@@ -78,6 +81,13 @@ public class CommunicationGraph implements Serializable {
 
         @Id
         @Column(name = "j3_id")
+        @GeneratedValue(strategy = GenerationType.TABLE,
+             generator = "cfggrphGen")
+        @TableGenerator(name = "cfggrphGen",
+             table = "JPAGEN_CFGGRPH",
+             pkColumnName = "NAME",
+             pkColumnValue = "JPAGEN_PERSON_GEN",
+             valueColumnName = "VALUE")
         public Long getId() {
                 return id;
         }

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/model/Contact.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/model/Contact.java b/juddi-core/src/main/java/org/apache/juddi/model/Contact.java
index 8aa62f7..4f8b62d 100644
--- a/juddi-core/src/main/java/org/apache/juddi/model/Contact.java
+++ b/juddi-core/src/main/java/org/apache/juddi/model/Contact.java
@@ -77,7 +77,7 @@ public class Contact implements java.io.Serializable {
 	}
 
 	@ManyToOne(fetch = FetchType.LAZY)
-	@JoinColumn(name = "entity_key", nullable = false)
+	@JoinColumn(name = "entity_key", nullable = true)
 	public BusinessEntity getBusinessEntity() {
 		return this.businessEntity;
 	}

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/model/ControlMessage.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/model/ControlMessage.java b/juddi-core/src/main/java/org/apache/juddi/model/ControlMessage.java
index 2c5f10d..ce79b8f 100644
--- a/juddi-core/src/main/java/org/apache/juddi/model/ControlMessage.java
+++ b/juddi-core/src/main/java/org/apache/juddi/model/ControlMessage.java
@@ -29,6 +29,10 @@ import javax.persistence.Id;
 public class ControlMessage implements Serializable{
         private static final long serialVersionUID = 1L;
         
+        public ControlMessage(){}
+        public ControlMessage(String msg){
+                this.message = msg;
+        }
         
         private Long id;
 

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/model/Edge.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/model/Edge.java b/juddi-core/src/main/java/org/apache/juddi/model/Edge.java
index 63625ef..768bb23 100644
--- a/juddi-core/src/main/java/org/apache/juddi/model/Edge.java
+++ b/juddi-core/src/main/java/org/apache/juddi/model/Edge.java
@@ -36,18 +36,26 @@ import javax.persistence.Table;
 public class Edge {
 
         private Long id;
-        private Set<ReplicationMessage>  message;
+        private List<ControlMessage>  message;
         private Node messageSender;
         private Node messageReceiver;
         private Set<Node> messageReceiverAlternate;
         private CommunicationGraph parent;
 
+         /**
+         * link the parent object
+         * @param val 
+         */
         @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = CommunicationGraph.class)
         //@JoinColumn(name = "OWNER_ID")
         public CommunicationGraph getCommunicationGraph() {
                 return parent;
         }
 
+        /**
+         * link the parent object
+         * @param val 
+         */
         public void setCommunicationGraph(CommunicationGraph val) {
                 parent = val;
         }
@@ -56,14 +64,14 @@ public class Edge {
          * The message elements contain the local name of the Replication API message elements
          * @return 
          */
-        @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = ReplicationMessage.class)
-        public Set<ReplicationMessage> getMessages() {
+        @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, targetEntity = ControlMessage.class)
+        public List<ControlMessage> getMessages() {
                 if (message == null) {
-                        message = new HashSet<ReplicationMessage>();
+                        message = new ArrayList<ControlMessage>();
                 }
                 return this.message;
         }
-        public void setMessages(Set<ReplicationMessage>  values) {
+        public void setMessages(List<ControlMessage>  values) {
                 this.message = values;
         }
 
@@ -113,7 +121,7 @@ public class Edge {
                 return id;
         }
 
-        public void setMessage(Set<ReplicationMessage> message) {
+        public void setMessage(List<ControlMessage> message) {
                 this.message = message;
         }
 
@@ -121,9 +129,7 @@ public class Edge {
                 this.messageReceiverAlternate = messageReceiverAlternate;
         }
 
-        public void setParent(CommunicationGraph parent) {
-                this.parent = parent;
-        }
+     
 
         public void setId(Long id) {
                 this.id = id;

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/model/PublisherAssertion.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/model/PublisherAssertion.java b/juddi-core/src/main/java/org/apache/juddi/model/PublisherAssertion.java
index 82efe29..742c252 100644
--- a/juddi-core/src/main/java/org/apache/juddi/model/PublisherAssertion.java
+++ b/juddi-core/src/main/java/org/apache/juddi/model/PublisherAssertion.java
@@ -16,6 +16,7 @@ package org.apache.juddi.model;
  */
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import javax.persistence.AttributeOverride;
 import javax.persistence.AttributeOverrides;
@@ -29,11 +30,13 @@ import javax.persistence.ManyToOne;
 import javax.persistence.OneToMany;
 import javax.persistence.OrderBy;
 import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
 
 /**
  * @author <a href="mailto:kurt@apache.org">Kurt T Stam</a>
  */
-@Entity
+        @Entity
 @Table(name = "j3_publisher_assertion")
 public class PublisherAssertion implements java.io.Serializable {
 
@@ -46,6 +49,7 @@ public class PublisherAssertion implements java.io.Serializable {
 	private String keyValue;
 	private String fromCheck;
 	private String toCheck;
+	private Date modified;
 
 	public PublisherAssertion() {
 	}
@@ -63,6 +67,20 @@ public class PublisherAssertion implements java.io.Serializable {
 		this.fromCheck = fromCheck;
 		this.toCheck = toCheck;
 	}
+        
+	public void setModified(Date created) {
+		this.modified = created;
+	}
+	
+	@Temporal(TemporalType.TIMESTAMP)
+	@Column(name = "modified", nullable = false, length = 29)
+	public Date getModified() {
+		if (modified!=null) {
+			return new Date(modified.getTime());
+		} else {
+			return null;
+		}
+	}
 
 	@EmbeddedId
 	@AttributeOverrides({

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/model/ReplicationConfiguration.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/model/ReplicationConfiguration.java b/juddi-core/src/main/java/org/apache/juddi/model/ReplicationConfiguration.java
index 86e34c9..a481412 100644
--- a/juddi-core/src/main/java/org/apache/juddi/model/ReplicationConfiguration.java
+++ b/juddi-core/src/main/java/org/apache/juddi/model/ReplicationConfiguration.java
@@ -25,11 +25,14 @@ import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
 import javax.persistence.Id;
 import javax.persistence.OneToMany;
 import javax.persistence.OneToOne;
 import javax.persistence.OrderBy;
 import javax.persistence.Table;
+import javax.persistence.TableGenerator;
 
 @Entity
 @Table(name = "j3_chg_replconf")
@@ -37,7 +40,7 @@ public class ReplicationConfiguration implements Serializable {
 
         private static final long serialVersionUID = 1L;
         
-        private long serialNumber;
+        private Long serialNumber;
         private String timeOfConfigurationUpdate;
         private List<Operator> operator = new ArrayList<Operator>(0);
         private CommunicationGraph communicationGraph;
@@ -73,8 +76,15 @@ public class ReplicationConfiguration implements Serializable {
          */
         @Column(name = "serialnumb")
         @OrderBy(value = "SerialNumber DESC")
-        @Id
-        public long getSerialNumber() {
+         @Id
+        @GeneratedValue(strategy = GenerationType.TABLE,
+             generator = "replcfgGen")
+        @TableGenerator(name = "replcfgGen",
+             table = "JPAGEN_REPLGEN",
+             pkColumnName = "NAME",
+             pkColumnValue = "JPAGEN_PERSON_GEN",
+             valueColumnName = "VALUE")
+        public Long getSerialNumber() {
                 return serialNumber;
         }
 
@@ -82,7 +92,7 @@ public class ReplicationConfiguration implements Serializable {
          * Sets the value of the serialNumber property.
          *
          */
-        public void setSerialNumber(long value) {
+        public void setSerialNumber(Long value) {
                 this.serialNumber = value;
         }
 

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/model/ReplicationMessage.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/model/ReplicationMessage.java b/juddi-core/src/main/java/org/apache/juddi/model/ReplicationMessage.java
deleted file mode 100644
index 35ca14e..0000000
--- a/juddi-core/src/main/java/org/apache/juddi/model/ReplicationMessage.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2013 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.juddi.model;
-
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
-
-/**
- *
- * @author Alex O'Ree
- */
-@Entity(name = "j3_repl_messages")
-public class ReplicationMessage {
-        
-        private Long id;
-        private String msg;
-
-        @Column(name ="j3_repl_message")
-        public String getMsg() {
-                return msg;
-        }
-
-        public void setMsg(String msg) {
-                this.msg = msg;
-        }
-
-        @Id
-        public Long getId() {
-                return id;
-        }
-
-        public void setId(Long id) {
-                this.id = id;
-        }
-
-}

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/replication/ChangeList.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/replication/ChangeList.java b/juddi-core/src/main/java/org/apache/juddi/replication/ChangeList.java
deleted file mode 100644
index 88d1b65..0000000
--- a/juddi-core/src/main/java/org/apache/juddi/replication/ChangeList.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.apache.juddi.replication;
-
-import org.apache.juddi.subscription.*;
-import org.apache.commons.collections.buffer.CircularFifoBuffer;
-import org.apache.commons.collections.Buffer;
-import org.apache.commons.collections.BufferUtils;
-
-public class ChangeList<T>  {
-	private static ChangeList<String> nl = null;
-	private static Buffer list = null;
-	
-	private ChangeList() {	
-		list = BufferUtils.synchronizedBuffer(new CircularFifoBuffer(10));
-	}
-	
-	public static ChangeList<String> getInstance() {
-		if (nl == null) {
-			nl = new ChangeList<String>();
-		}
-		return nl;	
-	}
-	
-	public Buffer getNotifications() {
-		return list;
-	}
-}

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/replication/ReplicationNotifier.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/replication/ReplicationNotifier.java b/juddi-core/src/main/java/org/apache/juddi/replication/ReplicationNotifier.java
index 4a91348..15b16ab 100644
--- a/juddi-core/src/main/java/org/apache/juddi/replication/ReplicationNotifier.java
+++ b/juddi-core/src/main/java/org/apache/juddi/replication/ReplicationNotifier.java
@@ -26,8 +26,6 @@ import javax.persistence.EntityManager;
 import javax.persistence.EntityTransaction;
 import javax.persistence.Query;
 import javax.xml.ws.BindingProvider;
-
-
 import org.apache.commons.configuration.ConfigurationException;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -36,8 +34,8 @@ import org.apache.juddi.config.AppConfig;
 import org.apache.juddi.config.PersistenceManager;
 import org.apache.juddi.config.Property;
 import org.apache.juddi.mapping.MappingModelToApi;
+import org.apache.juddi.model.ChangeRecord;
 import org.apache.juddi.model.ReplicationConfiguration;
-
 import org.apache.juddi.v3.client.UDDIService;
 import org.uddi.repl_v3.ChangeRecordIDType;
 import org.uddi.repl_v3.CommunicationGraph;
@@ -46,17 +44,21 @@ import org.uddi.repl_v3.NotifyChangeRecordsAvailable;
 import org.uddi.v3_service.UDDIReplicationPortType;
 
 /**
- * 
+ * Handles when local records have been changed, change journal storage and
+ * notifications to all remote replication nodes that something has been
+ * altered.
+ *
  * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
  *
  */
 public class ReplicationNotifier extends TimerTask {
 
-        private Log log = LogFactory.getLog(this.getClass());
+        private static Log log = LogFactory.getLog(ReplicationNotifier.class);
         private Timer timer = null;
         private long startBuffer = AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_START_BUFFER, 20000l); // 20s startup delay default 
         private long interval = AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_INTERVAL, 300000l); //5 min default
         private long acceptableLagTime = AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_ACCEPTABLE_LAGTIME, 1000l); //1000 milliseconds
+        private static String node = null;
 
         /**
          * default constructor
@@ -70,6 +72,7 @@ public class ReplicationNotifier extends TimerTask {
                 if (queue == null) {
                         queue = new ConcurrentLinkedQueue();
                 }
+                node = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID, "UNDEFINED_NODE_NAME");
         }
 
         @Override
@@ -80,13 +83,85 @@ public class ReplicationNotifier extends TimerTask {
         }
 
         //ReplicationNotifier.Enqueue(this);
-        public synchronized static void Enqueue(Object change) {
+        public synchronized static void Enqueue(org.apache.juddi.model.ChangeRecord change) {
                 if (queue == null) {
-                        queue = new ConcurrentLinkedQueue();
+                        queue = new ConcurrentLinkedQueue<ChangeRecord>();
                 }
                 queue.add(change);
         }
-        static Queue queue;
+        static Queue<ChangeRecord> queue;
+
+        /**
+         *
+         * @param j must be one of the UDDI save APIs
+         */
+        protected void ProcessChangeRecord(ChangeRecord j) {
+                //store and convert the changes to database model
+
+                EntityManager em = PersistenceManager.getEntityManager();
+                EntityTransaction tx = null;
+                try {
+                        tx = em.getTransaction();
+                        tx.begin();
+
+                        em.persist(j);
+                        tx.commit();
+                } catch (Exception ex) {
+                        log.error("error", ex);
+                        if (tx != null && tx.isActive()) {
+                                tx.rollback();
+                        }
+                } finally {
+                        em.close();
+                }
+
+                log.info("ChangeRecord: " + j.getId() + "," + j.getEntityKey() + "," + j.getNodeID() + "," + j.getOriginatingUSN() + "," + j.getRecordType().toString());
+                org.uddi.repl_v3.ReplicationConfiguration repcfg = FetchEdges();
+
+                //TODO figure out what this statement means 7.5.3
+                /**
+                 * In the absence of a communicationGraph element from the
+                 * Replication Configuration Structure, all nodes listed in the
+                 * node element MAY send any and all messages to any other node
+                 * of the registry.
+                 */
+                if (repcfg == null) {
+                        log.info("No replication configuration is defined!");
+                        return;
+
+                }
+                Iterator<CommunicationGraph.Edge> it = repcfg.getCommunicationGraph().getEdge().iterator();
+
+                while (it.hasNext()) {
+                        //send each change set to the replication node in the graph
+
+                        UDDIReplicationPortType x = new UDDIService().getUDDIReplicationPort();
+                        CommunicationGraph.Edge next = it.next();
+                        //next.getMessageReceiver(); //Node ID
+                        Node destinationNode = getNode(next.getMessageSender());
+                        if (destinationNode == null) {
+                                log.warn(next.getMessageSender() + " node was not found, cannot deliver replication messages");
+                        } else {
+                                //TODO the spec talks about control messages, should we even support it? seems pointless
+                                ((BindingProvider) x).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, destinationNode.getReplicationUrl());
+                                NotifyChangeRecordsAvailable req = new NotifyChangeRecordsAvailable();
+
+                                req.setNotifyingNode(node);
+                                HighWaterMarkVectorType highWaterMarkVectorType = new HighWaterMarkVectorType();
+                              
+                                highWaterMarkVectorType.getHighWaterMark().add(new ChangeRecordIDType(node, j.getId()));
+                                req.setChangesAvailable(highWaterMarkVectorType);
+
+                                try {
+                                        x.notifyChangeRecordsAvailable(req);
+                                        log.info("Successfully sent change record available message to " + destinationNode.getName());
+                                } catch (Exception ex) {
+                                        log.warn("Unable to send change notification to " + destinationNode.getName(), ex);
+                                }
+                        }
+                }
+
+        }
 
         public synchronized void run() {
                 log.debug("Replication thread triggered");
@@ -94,53 +169,22 @@ public class ReplicationNotifier extends TimerTask {
                         queue = new ConcurrentLinkedQueue();
                 }
                 while (!queue.isEmpty()) {
-                        log.info("Notifying nodes of change records " + queue.size());
-                        //TODO identify chnage set format
-                        Object j = queue.poll();
-                        org.uddi.repl_v3.ReplicationConfiguration repcfg = FetchEdges();
-                        if (repcfg == null) {
-                                log.debug("No replication configuration is defined!");
-                                queue.clear();
-                                break;
-                        }
-                        Iterator<CommunicationGraph.Edge> it = repcfg.getCommunicationGraph().getEdge().iterator();
-
-                        while (it.hasNext()) {
-
-                                //for (int i = 0; i < endpoints.size(); i++) {
-                                UDDIReplicationPortType x = new UDDIService().getUDDIReplicationPort();
-                                CommunicationGraph.Edge next = it.next();
-                                next.getMessageReceiver(); //Node ID
-                                Node destinationNode = getNode(next.getMessageSender());
-                                if (destinationNode == null) {
-                                        log.warn(next.getMessageSender() + " node was not found, cannot deliver replication messages");
-                                } else {
-                                        ((BindingProvider) x).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, destinationNode.getReplicationUrl());
-                                        NotifyChangeRecordsAvailable req = new NotifyChangeRecordsAvailable();
-                                        String node = "UNKNOWN";
-                                        try {
-                                                node = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID);
-                                        } catch (ConfigurationException ex) {
-                                                log.fatal(ex);
-                                        }
-                                        req.setNotifyingNode(node);
-                                        HighWaterMarkVectorType highWaterMarkVectorType = new HighWaterMarkVectorType();
-                                        String nextWatermark = ""; //TODO get current watermark + 1 toString()
-                                        //TODO save watermark along with change set
-
-                                        highWaterMarkVectorType.getHighWaterMark().add(new ChangeRecordIDType(node, 1L));
-                                        req.setChangesAvailable(highWaterMarkVectorType);
-                                        try {
-                                                x.notifyChangeRecordsAvailable(req);
-                                        } catch (Exception ex) {
-                                                log.warn("Unable to send change notification to " + next.getMessageSender(), ex);
-                                        }
-                                }
-                        }
+                        //for each change at this node
+                        log.info("Replication, Notifying nodes of new change records. " + queue.size() + " remaining");
+
+                        ChangeRecord j = queue.poll();
+                        ProcessChangeRecord(j);
+
                 }
         }
 
-        private org.uddi.repl_v3.ReplicationConfiguration FetchEdges() {
+        /**
+         * returns the latest version of the replication config or null if there
+         * is no config
+         *
+         * @return
+         */
+        public static org.uddi.repl_v3.ReplicationConfiguration FetchEdges() {
 
                 EntityManager em = PersistenceManager.getEntityManager();
                 EntityTransaction tx = null;
@@ -173,7 +217,6 @@ public class ReplicationNotifier extends TimerTask {
         private Node getNode(String messageSender) {
                 EntityManager em = PersistenceManager.getEntityManager();
                 EntityTransaction tx = null;
-                org.uddi.repl_v3.ReplicationConfiguration item = new org.uddi.repl_v3.ReplicationConfiguration();
                 try {
                         tx = em.getTransaction();
                         tx.begin();


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


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

Posted by al...@apache.org.
http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java
index 2e1fdbb..98c6c15 100644
--- a/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java
+++ b/juddi-core/src/main/java/org/apache/juddi/api/impl/UDDIPublicationImpl.java
@@ -14,21 +14,53 @@
  * limitations under the License.
  *
  */
-
 package org.apache.juddi.api.impl;
 
 import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.GregorianCalendar;
 import java.util.Iterator;
 import java.util.List;
-import java.util.ArrayList;
-
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import javax.jws.WebService;
 import javax.persistence.EntityManager;
 import javax.persistence.EntityTransaction;
 import javax.xml.bind.JAXB;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
 import javax.xml.ws.Holder;
-
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.juddi.api.util.PublicationQuery;
+import org.apache.juddi.api.util.QueryStatus;
+import org.apache.juddi.config.AppConfig;
+import org.apache.juddi.config.PersistenceManager;
+import org.apache.juddi.config.Property;
+import org.apache.juddi.mapping.MappingApiToModel;
+import org.apache.juddi.mapping.MappingModelToApi;
+import org.apache.juddi.model.BindingTemplate;
+import org.apache.juddi.model.BusinessEntity;
+import org.apache.juddi.model.BusinessService;
+import org.apache.juddi.model.ChangeRecord;
+import org.apache.juddi.model.Tmodel;
+import org.apache.juddi.model.UddiEntityPublisher;
+import org.apache.juddi.query.DeletePublisherAssertionByBusinessQuery;
+import org.apache.juddi.query.FetchBusinessEntitiesQuery;
+import org.apache.juddi.query.FetchTModelsQuery;
+import org.apache.juddi.query.FindBusinessByPublisherQuery;
+import org.apache.juddi.query.FindPublisherAssertionByBusinessQuery;
+import org.apache.juddi.query.FindTModelByPublisherQuery;
+import org.apache.juddi.query.TModelQuery;
+import org.apache.juddi.query.util.DynamicQuery;
+import org.apache.juddi.query.util.FindQualifiers;
+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.ValidatePublish;
 import org.uddi.api_v3.AddPublisherAssertions;
 import org.uddi.api_v3.AssertionStatusItem;
 import org.uddi.api_v3.BindingDetail;
@@ -41,6 +73,8 @@ import org.uddi.api_v3.DeleteService;
 import org.uddi.api_v3.DeleteTModel;
 import org.uddi.api_v3.GetRegisteredInfo;
 import org.uddi.api_v3.InfoSelection;
+import org.uddi.api_v3.ListDescription;
+import org.uddi.api_v3.OperationalInfo;
 import org.uddi.api_v3.PublisherAssertion;
 import org.uddi.api_v3.RegisteredInfo;
 import org.uddi.api_v3.SaveBinding;
@@ -49,885 +83,1234 @@ import org.uddi.api_v3.SaveService;
 import org.uddi.api_v3.SaveTModel;
 import org.uddi.api_v3.ServiceDetail;
 import org.uddi.api_v3.TModelDetail;
+import org.uddi.repl_v3.ChangeRecordDelete;
+import org.uddi.repl_v3.ChangeRecordDeleteAssertion;
+import org.uddi.repl_v3.ChangeRecordHide;
+import org.uddi.repl_v3.ChangeRecordIDType;
+import org.uddi.repl_v3.ChangeRecordNewData;
+import org.uddi.repl_v3.ChangeRecordPublisherAssertion;
+import org.uddi.repl_v3.FromSignatures;
 import org.uddi.v3_service.DispositionReportFaultMessage;
 import org.uddi.v3_service.UDDIPublicationPortType;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.juddi.mapping.MappingApiToModel;
-import org.apache.juddi.mapping.MappingModelToApi;
-import org.apache.juddi.v3.error.ErrorMessage;
-import org.apache.juddi.v3.error.FatalErrorException;
-import org.apache.juddi.validation.ValidatePublish;
-import org.apache.juddi.query.FetchBusinessEntitiesQuery;
-import org.apache.juddi.query.FetchTModelsQuery;
-import org.apache.juddi.query.FindBusinessByPublisherQuery;
-import org.apache.juddi.query.FindTModelByPublisherQuery;
-import org.apache.juddi.query.FindPublisherAssertionByBusinessQuery;
-import org.apache.juddi.query.DeletePublisherAssertionByBusinessQuery;
-import org.apache.juddi.query.TModelQuery;
-import org.apache.juddi.model.UddiEntityPublisher;
-import org.apache.juddi.api.util.PublicationQuery;
-import org.apache.juddi.api.util.QueryStatus;
-import org.apache.juddi.config.AppConfig;
-import org.apache.juddi.config.PersistenceManager;
-import org.apache.juddi.config.Property;
-import org.apache.juddi.query.util.DynamicQuery;
-import org.apache.juddi.query.util.FindQualifiers;
-import org.uddi.api_v3.ListDescription;
 
 /**
  * This class implements the UDDI Publication Service
+ *
  * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a> (and many others)
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a> added support for
+ * replication and several bug fixes
  */
-@WebService(serviceName="UDDIPublicationService", 
-			endpointInterface="org.uddi.v3_service.UDDIPublicationPortType",
-			targetNamespace = "urn:uddi-org:v3_service")
+@WebService(serviceName = "UDDIPublicationService",
+     endpointInterface = "org.uddi.v3_service.UDDIPublicationPortType",
+     targetNamespace = "urn:uddi-org:v3_service")
 public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPublicationPortType {
 
         private static Log log = LogFactory.getLog(UDDIInquiryImpl.class);
         private UDDIServiceCounter serviceCounter;
-    
+
+        private static DatatypeFactory df = null;
+
         public UDDIPublicationImpl() {
-            super();
-            serviceCounter = ServiceCounterLifecycleResource.getServiceCounter(UDDIPublicationImpl.class);
-        }
-	
-        
-        
-	public void addPublisherAssertions(AddPublisherAssertions 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 ValidatePublish(publisher).validateAddPublisherAssertions(em, body);
-	
-			List<org.uddi.api_v3.PublisherAssertion> apiPubAssertionList = body.getPublisherAssertion();
-			for (org.uddi.api_v3.PublisherAssertion apiPubAssertion : apiPubAssertionList) {
-				
-				org.apache.juddi.model.PublisherAssertion modelPubAssertion = new org.apache.juddi.model.PublisherAssertion();
-				
-				MappingApiToModel.mapPublisherAssertion(apiPubAssertion, modelPubAssertion);
-				
-				org.apache.juddi.model.PublisherAssertion existingPubAssertion = em.find(modelPubAssertion.getClass(), modelPubAssertion.getId());
-				boolean persistNewAssertion = true;
-				if (existingPubAssertion != null) {
-					if (modelPubAssertion.getTmodelKey().equalsIgnoreCase(existingPubAssertion.getTmodelKey()) &&
-						modelPubAssertion.getKeyName().equalsIgnoreCase(existingPubAssertion.getKeyName()) &&
-						modelPubAssertion.getKeyValue().equalsIgnoreCase(existingPubAssertion.getKeyValue())) {
-						// This pub assertion is already been "asserted".  Simply need to set the "check" value on the existing (and persistent) assertion
-						if (publisher.isOwner(existingPubAssertion.getBusinessEntityByFromKey()))
-							existingPubAssertion.setFromCheck("true");
-						if (publisher.isOwner(existingPubAssertion.getBusinessEntityByToKey()))
-							existingPubAssertion.setToCheck("true");
-						
-						persistNewAssertion = false;
-					}
-					else {
+                super();
+                serviceCounter = ServiceCounterLifecycleResource.getServiceCounter(UDDIPublicationImpl.class);
+                if (df == null) {
+                        try {
+                                df = DatatypeFactory.newInstance();
+                        } catch (DatatypeConfigurationException ex) {
+                                logger.fatal(ex);
+                        }
+                }
+        }
+
+        @Override
+        public void addPublisherAssertions(AddPublisherAssertions 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 ValidatePublish(publisher).validateAddPublisherAssertions(em, body);
+
+                        List<org.uddi.api_v3.PublisherAssertion> apiPubAssertionList = body.getPublisherAssertion();
+                        List<ChangeRecord> changes = new ArrayList<ChangeRecord>();
+                        for (org.uddi.api_v3.PublisherAssertion apiPubAssertion : apiPubAssertionList) {
+
+                                org.apache.juddi.model.PublisherAssertion modelPubAssertion = new org.apache.juddi.model.PublisherAssertion();
+
+                                MappingApiToModel.mapPublisherAssertion(apiPubAssertion, modelPubAssertion);
+
+                                org.apache.juddi.model.PublisherAssertion existingPubAssertion = em.find(modelPubAssertion.getClass(), modelPubAssertion.getId());
+                                boolean persistNewAssertion = true;
+                                if (existingPubAssertion != null) {
+                                        if (modelPubAssertion.getTmodelKey().equalsIgnoreCase(existingPubAssertion.getTmodelKey())
+                                             && modelPubAssertion.getKeyName().equalsIgnoreCase(existingPubAssertion.getKeyName())
+                                             && modelPubAssertion.getKeyValue().equalsIgnoreCase(existingPubAssertion.getKeyValue())) {
+                                                // This pub assertion is already been "asserted".  Simply need to set the "check" value on the existing (and persistent) assertion
+                                                if (publisher.isOwner(existingPubAssertion.getBusinessEntityByFromKey())) {
+                                                        existingPubAssertion.setFromCheck("true");
+                                                }
+                                                if (publisher.isOwner(existingPubAssertion.getBusinessEntityByToKey())) {
+                                                        existingPubAssertion.setToCheck("true");
+                                                }
+
+                                                persistNewAssertion = false;
+                                        } else {
 						// Otherwise, it is a new relationship between these entities.  Remove the old one so the new one can be added.
-						// TODO: the model only seems to allow one assertion per two business (primary key is fromKey and toKey). Spec seems to imply as 
-						// many relationships as desired (the differentiator would be the keyedRef values).
-						em.remove(existingPubAssertion);
-					}
-				}
-	
-				if (persistNewAssertion) {
-					org.apache.juddi.model.BusinessEntity beFrom = em.find(org.apache.juddi.model.BusinessEntity.class, modelPubAssertion.getId().getFromKey());
-					org.apache.juddi.model.BusinessEntity beTo = em.find(org.apache.juddi.model.BusinessEntity.class, modelPubAssertion.getId().getToKey());
-					modelPubAssertion.setBusinessEntityByFromKey(beFrom);
-					modelPubAssertion.setBusinessEntityByToKey(beTo);
-	
-					modelPubAssertion.setFromCheck("false");
-					modelPubAssertion.setToCheck("false");
-	
-					em.persist(modelPubAssertion);
-					
-					if (publisher.isOwner(modelPubAssertion.getBusinessEntityByFromKey()))
-						modelPubAssertion.setFromCheck("true");
-					if (publisher.isOwner(modelPubAssertion.getBusinessEntityByToKey()))
-						modelPubAssertion.setToCheck("true");
-				}
-				
-			}
-	
-			tx.commit();
+                                                // TODO: the model only seems to allow one assertion per two business (primary key is fromKey and toKey). Spec seems to imply as 
+                                                // many relationships as desired (the differentiator would be the keyedRef values).
+                                                em.remove(existingPubAssertion);
+                                        }
+                                }
+
+                                if (persistNewAssertion) {
+                                        org.apache.juddi.model.BusinessEntity beFrom = em.find(org.apache.juddi.model.BusinessEntity.class, modelPubAssertion.getId().getFromKey());
+                                        org.apache.juddi.model.BusinessEntity beTo = em.find(org.apache.juddi.model.BusinessEntity.class, modelPubAssertion.getId().getToKey());
+                                        modelPubAssertion.setBusinessEntityByFromKey(beFrom);
+                                        modelPubAssertion.setBusinessEntityByToKey(beTo);
+
+                                        modelPubAssertion.setFromCheck("false");
+                                        modelPubAssertion.setToCheck("false");
+
+                                        if (publisher.isOwner(modelPubAssertion.getBusinessEntityByFromKey())) {
+                                                modelPubAssertion.setFromCheck("true");
+                                        }
+                                        if (publisher.isOwner(modelPubAssertion.getBusinessEntityByToKey())) {
+                                                modelPubAssertion.setToCheck("true");
+                                        }
+                                        modelPubAssertion.setModified(new Date());
+                                        em.persist(modelPubAssertion);
+
+                                        changes.add(getChangeRecord_NewAssertion(apiPubAssertion, modelPubAssertion, node));
+
+                                }
+
+                        }
+
+                        tx.commit();
+                        for (int i = 0; i < changes.size(); i++) {
+                                ReplicationNotifier.Enqueue(changes.get(i));
+                        }
+
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.ADD_PUBLISHERASSERTIONS, 
-                                QueryStatus.SUCCESS, procTime);			
+                        serviceCounter.update(PublicationQuery.ADD_PUBLISHERASSERTIONS,
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.ADD_PUBLISHERASSERTIONS, QueryStatus.FAILED, procTime);                      
-                    throw drfm;
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.ADD_PUBLISHERASSERTIONS, QueryStatus.FAILED, procTime);
+                        throw drfm;
                 } finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-	public void deleteBinding(DeleteBinding 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 ValidatePublish(publisher).validateDeleteBinding(em, body);
-			
-			List<String> entityKeyList = body.getBindingKey();
-			for (String entityKey : entityKeyList) {
-				Object obj = em.find(org.apache.juddi.model.BindingTemplate.class, entityKey);
-	
-				((org.apache.juddi.model.BindingTemplate)obj).getBusinessService().setModifiedIncludingChildren(new Date());
-				// JUDDI-421:  now the businessEntity parent will have it's modifiedIncludingChildren set
-				((org.apache.juddi.model.BindingTemplate)obj).getBusinessService().getBusinessEntity().setModifiedIncludingChildren(new Date());
-				
-				em.remove(obj);
-			}
-	
-			tx.commit();
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        public void deleteBinding(DeleteBinding 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 ValidatePublish(publisher).validateDeleteBinding(em, body);
+
+                        List<String> entityKeyList = body.getBindingKey();
+                        List<ChangeRecord> changes = new ArrayList<ChangeRecord>();
+                        for (String entityKey : entityKeyList) {
+                                deleteBinding(entityKey, em);
+                                changes.add(getChangeRecord_deleteBinding(entityKey, node));
+                        }
+                        tx.commit();
+                        for (int i = 0; i < changes.size(); i++) {
+                                ReplicationNotifier.Enqueue(changes.get(i));
+                        }
+
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.DELETE_BINDING, 
-                                QueryStatus.SUCCESS, procTime);                      
+                        serviceCounter.update(PublicationQuery.DELETE_BINDING,
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.DELETE_BINDING, QueryStatus.FAILED, procTime);                      
-                    throw drfm;
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-	public void deleteBusiness(DeleteBusiness 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 ValidatePublish(publisher).validateDeleteBusiness(em, body);
-			
-			List<String> entityKeyList = body.getBusinessKey();
-			for (String entityKey : entityKeyList) {
-				Object obj = em.find(org.apache.juddi.model.BusinessEntity.class, entityKey);
-				em.remove(obj);
-			}
-	
-			tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.DELETE_BUSINESS, QueryStatus.SUCCESS, procTime);               
+                        serviceCounter.update(PublicationQuery.DELETE_BINDING, QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        /**
+         * deletes the referenced object, assuming authorization rules are
+         * already processed and there is already an open transaction
+         *
+         * @param entityKey
+         * @param em
+         * @throws DispositionReportFaultMessage
+         */
+        protected void deleteBinding(String entityKey, EntityManager em) throws DispositionReportFaultMessage {
+
+                Object obj = em.find(org.apache.juddi.model.BindingTemplate.class, entityKey);
+
+                ((org.apache.juddi.model.BindingTemplate) obj).getBusinessService().setModifiedIncludingChildren(new Date());
+                // JUDDI-421:  now the businessEntity parent will have it's modifiedIncludingChildren set
+                ((org.apache.juddi.model.BindingTemplate) obj).getBusinessService().getBusinessEntity().setModifiedIncludingChildren(new Date());
+
+                em.remove(obj);
+
+        }
+
+        public void deleteBusiness(DeleteBusiness 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 ValidatePublish(publisher).validateDeleteBusiness(em, body);
+
+                        List<String> entityKeyList = body.getBusinessKey();
+                        List<ChangeRecord> changes = new ArrayList<ChangeRecord>();
+                        for (String entityKey : entityKeyList) {
+                                deleteBusiness(entityKey, em);
+                                changes.add(getChangeRecord_deleteBusiness(entityKey, node));
+                        }
+
+                        tx.commit();
+                        for (int i = 0; i < changes.size(); i++) {
+                                ReplicationNotifier.Enqueue(changes.get(i));
+                        }
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.DELETE_BUSINESS, QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.DELETE_BUSINESS, QueryStatus.FAILED, procTime);                      
-                    throw drfm;
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-	public void deletePublisherAssertions(DeletePublisherAssertions 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 ValidatePublish(publisher).validateDeletePublisherAssertions(em, body);
-			
-			List<org.uddi.api_v3.PublisherAssertion> entityList = body.getPublisherAssertion();
-			for (org.uddi.api_v3.PublisherAssertion entity : entityList) {
-				org.apache.juddi.model.PublisherAssertionId pubAssertionId = new org.apache.juddi.model.PublisherAssertionId(entity.getFromKey(), entity.getToKey());
-				Object obj = em.find(org.apache.juddi.model.PublisherAssertion.class, pubAssertionId);
-				em.remove(obj);
-			}
-	
-			tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.DELETE_PUBLISHERASSERTIONS, 
-                                QueryStatus.SUCCESS, procTime);
+                        serviceCounter.update(PublicationQuery.DELETE_BUSINESS, QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        /**
+         * deletes the referenced object, assuming authorization rules are
+         * already processed and there is already an open transaction
+         *
+         * @param entityKey
+         * @param em
+         * @throws DispositionReportFaultMessage
+         */
+        protected void deleteBusiness(String key, EntityManager em) throws DispositionReportFaultMessage {
+                Object obj = em.find(org.apache.juddi.model.BusinessEntity.class, key);
+                em.remove(obj);
+        }
+
+        public void deletePublisherAssertions(DeletePublisherAssertions 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 ValidatePublish(publisher).validateDeletePublisherAssertions(em, body);
+
+                        List<org.uddi.api_v3.PublisherAssertion> entityList = body.getPublisherAssertion();
+                        List<ChangeRecord> changes = new ArrayList<ChangeRecord>();
+                        for (org.uddi.api_v3.PublisherAssertion entity : entityList) {
+                                deletePublisherAssertion(entity, em);
+                                changes.add(getChangeRecord_deletePublisherAssertion(entity, node));
+                        }
+
+                        tx.commit();
+                        for (int i = 0; i < changes.size(); i++) {
+                                ReplicationNotifier.Enqueue(changes.get(i));
+                        }
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.DELETE_PUBLISHERASSERTIONS,
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.DELETE_PUBLISHERASSERTIONS, QueryStatus.FAILED, procTime);                      
-                    throw drfm;                        
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-	public void deleteService(DeleteService 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 ValidatePublish(publisher).validateDeleteService(em, body);
-			
-			List<String> entityKeyList = body.getServiceKey();
-			for (String entityKey : entityKeyList) {
-				Object obj = em.find(org.apache.juddi.model.BusinessService.class, entityKey);
-				
-				((org.apache.juddi.model.BusinessService)obj).getBusinessEntity().setModifiedIncludingChildren(new Date());
-				
-				em.remove(obj);
-			}
-	
-			tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.DELETE_SERVICE, 
-                                QueryStatus.SUCCESS, procTime);
+                        serviceCounter.update(PublicationQuery.DELETE_PUBLISHERASSERTIONS, QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        /**
+         * deletes the referenced object, assuming authorization rules are
+         * already processed and there is already an open transaction
+         *
+         * @param entityKey
+         * @param em
+         * @throws DispositionReportFaultMessage
+         */
+        protected void deletePublisherAssertion(org.uddi.api_v3.PublisherAssertion entity, EntityManager em) throws DispositionReportFaultMessage {
+                org.apache.juddi.model.PublisherAssertionId pubAssertionId = new org.apache.juddi.model.PublisherAssertionId(entity.getFromKey(), entity.getToKey());
+                Object obj = em.find(org.apache.juddi.model.PublisherAssertion.class, pubAssertionId);
+                em.remove(obj);
+        }
+
+        public void deleteService(DeleteService 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 ValidatePublish(publisher).validateDeleteService(em, body);
+
+                        List<String> entityKeyList = body.getServiceKey();
+                        List<ChangeRecord> changes = new ArrayList<ChangeRecord>();
+                        for (String entityKey : entityKeyList) {
+                                deleteService(entityKey, em);
+                                changes.add(getChangeRecord_deleteService(entityKey, node));
+                        }
+
+                        tx.commit();
+                        for (int i = 0; i < changes.size(); i++) {
+                                ReplicationNotifier.Enqueue(changes.get(i));
+                        }
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.DELETE_SERVICE,
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.DELETE_SERVICE, QueryStatus.FAILED, procTime);                      
-                    throw drfm;                                               
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-
-	public void deleteTModel(DeleteTModel 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 ValidatePublish(publisher).validateDeleteTModel(em, body);
-	
-			// tModels are only lazily deleted!
-			List<String> entityKeyList = body.getTModelKey();
-			for (String entityKey : entityKeyList) {
-				Object obj = em.find(org.apache.juddi.model.Tmodel.class, entityKey);
-				((org.apache.juddi.model.Tmodel)obj).setDeleted(true);
-				
-			}
-			
-			tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.DELETE_TMODEL, QueryStatus.SUCCESS, procTime);                      
+                        serviceCounter.update(PublicationQuery.DELETE_SERVICE, QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        /**
+         * deletes the referenced object, assuming authorization rules are
+         * already processed and there is already an open transaction
+         *
+         * @param entityKey
+         * @param em
+         * @throws DispositionReportFaultMessage
+         */
+        protected void deleteService(String key, EntityManager em) throws DispositionReportFaultMessage {
+                Object obj = em.find(org.apache.juddi.model.BusinessService.class, key);
+                ((org.apache.juddi.model.BusinessService) obj).getBusinessEntity().setModifiedIncludingChildren(new Date());
+                em.remove(obj);
+        }
+
+        public void deleteTModel(DeleteTModel 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 ValidatePublish(publisher).validateDeleteTModel(em, body);
+
+                        // tModels are only lazily deleted!
+                        List<String> entityKeyList = body.getTModelKey();
+                        List<ChangeRecord> changes = new ArrayList<ChangeRecord>();
+                        for (String entityKey : entityKeyList) {
+                                deleteTModel(entityKey, em);
+                                changes.add(getChangeRecord_deleteTModel(entityKey, node));
+                        }
+
+                        tx.commit();
+
+                        for (int i = 0; i < changes.size(); i++) {
+                                ReplicationNotifier.Enqueue(changes.get(i));
+                        }
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.DELETE_TMODEL, QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.DELETE_TMODEL, QueryStatus.FAILED, procTime);                      
-                    throw drfm;                                               
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-
-	public List<AssertionStatusItem> getAssertionStatusReport(String authInfo,
-			CompletionStatus completionStatus)
-			throws DispositionReportFaultMessage {
-	        long startTime = System.currentTimeMillis();
-
-		EntityManager em = PersistenceManager.getEntityManager();
-		EntityTransaction tx = em.getTransaction();
-		try {
-			tx.begin();
-	
-			UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
-	
-			List<org.uddi.api_v3.AssertionStatusItem> result = PublicationHelper.getAssertionStatusItemList(publisher, completionStatus, em);
-	
-			tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.GET_ASSERTIONSTATUSREPORT, 
-                                QueryStatus.SUCCESS, procTime);                      
+                        serviceCounter.update(PublicationQuery.DELETE_TMODEL, QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        /**
+         * deletes the referenced object, assuming authorization rules are
+         * already processed and there is already an open transaction
+         *
+         * @param entityKey
+         * @param em
+         * @throws DispositionReportFaultMessage
+         */
+        protected void deleteTModel(String key, EntityManager em) {
+                Object obj = em.find(org.apache.juddi.model.Tmodel.class, key);
+                ((org.apache.juddi.model.Tmodel) obj).setDeleted(true);
+        }
+
+        public List<AssertionStatusItem> getAssertionStatusReport(String authInfo,
+             CompletionStatus completionStatus)
+             throws DispositionReportFaultMessage {
+                long startTime = System.currentTimeMillis();
+
+                EntityManager em = PersistenceManager.getEntityManager();
+                EntityTransaction tx = em.getTransaction();
+                try {
+                        tx.begin();
+
+                        UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
+
+                        List<org.uddi.api_v3.AssertionStatusItem> result = PublicationHelper.getAssertionStatusItemList(publisher, completionStatus, em);
+
+                        tx.commit();
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.GET_ASSERTIONSTATUSREPORT,
+                             QueryStatus.SUCCESS, procTime);
 
-			return result;
+                        return result;
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.GET_ASSERTIONSTATUSREPORT, QueryStatus.FAILED, procTime);                      
-                    throw drfm;                                               
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-	public List<PublisherAssertion> getPublisherAssertions(String authInfo)
-			throws DispositionReportFaultMessage {
-	        long startTime = System.currentTimeMillis();
-
-		EntityManager em = PersistenceManager.getEntityManager();
-		EntityTransaction tx = em.getTransaction();
-		try {
-			tx.begin();
-	
-			UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
-			
-			List<org.uddi.api_v3.PublisherAssertion> result = new ArrayList<org.uddi.api_v3.PublisherAssertion>(0);
-	
-			List<?> businessKeysFound = null;
-			businessKeysFound = FindBusinessByPublisherQuery.select(em, null, publisher, businessKeysFound);
-			
-			List<org.apache.juddi.model.PublisherAssertion> pubAssertionList = FindPublisherAssertionByBusinessQuery.select(em, businessKeysFound, null);
-                        if (pubAssertionList!=null)
-			for(org.apache.juddi.model.PublisherAssertion modelPubAssertion : pubAssertionList) {
-				org.uddi.api_v3.PublisherAssertion apiPubAssertion = new org.uddi.api_v3.PublisherAssertion();
-	
-				MappingModelToApi.mapPublisherAssertion(modelPubAssertion, apiPubAssertion);
-				
-				result.add(apiPubAssertion);
-			}
-			
-			tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.GET_PUBLISHERASSERTIONS, 
-                                QueryStatus.SUCCESS, procTime);                      
-			return result;
+                        serviceCounter.update(PublicationQuery.GET_ASSERTIONSTATUSREPORT, QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        public List<PublisherAssertion> getPublisherAssertions(String authInfo)
+             throws DispositionReportFaultMessage {
+                long startTime = System.currentTimeMillis();
+
+                EntityManager em = PersistenceManager.getEntityManager();
+                EntityTransaction tx = em.getTransaction();
+                try {
+                        tx.begin();
+
+                        UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
+
+                        List<org.uddi.api_v3.PublisherAssertion> result = new ArrayList<org.uddi.api_v3.PublisherAssertion>(0);
+
+                        List<?> businessKeysFound = null;
+                        businessKeysFound = FindBusinessByPublisherQuery.select(em, null, publisher, businessKeysFound);
+
+                        List<org.apache.juddi.model.PublisherAssertion> pubAssertionList = FindPublisherAssertionByBusinessQuery.select(em, businessKeysFound, null);
+                        if (pubAssertionList != null) {
+                                for (org.apache.juddi.model.PublisherAssertion modelPubAssertion : pubAssertionList) {
+                                        org.uddi.api_v3.PublisherAssertion apiPubAssertion = new org.uddi.api_v3.PublisherAssertion();
+
+                                        MappingModelToApi.mapPublisherAssertion(modelPubAssertion, apiPubAssertion);
+
+                                        result.add(apiPubAssertion);
+                                }
+                        }
+
+                        tx.commit();
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.GET_PUBLISHERASSERTIONS,
+                             QueryStatus.SUCCESS, procTime);
+                        return result;
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.GET_PUBLISHERASSERTIONS, 
-                            QueryStatus.FAILED, procTime);                      
-                    throw drfm;                                               			
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-
-	public RegisteredInfo getRegisteredInfo(GetRegisteredInfo 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 ValidatePublish(publisher).validateRegisteredInfo(body);
-
-			List<?> businessKeysFound = null;
-			businessKeysFound = FindBusinessByPublisherQuery.select(em, null, publisher, businessKeysFound);
-	
-			
-			List<?> tmodelKeysFound = null;
-
-			if (body.getInfoSelection().equals(InfoSelection.HIDDEN))
-				tmodelKeysFound = FindTModelByPublisherQuery.select(em, null, publisher, tmodelKeysFound, new DynamicQuery.Parameter(TModelQuery.ENTITY_ALIAS + ".deleted",  Boolean.TRUE, DynamicQuery.PREDICATE_EQUALS));
-			else if (body.getInfoSelection().equals(InfoSelection.VISIBLE))
-				tmodelKeysFound = FindTModelByPublisherQuery.select(em, null, publisher, tmodelKeysFound, new DynamicQuery.Parameter(TModelQuery.ENTITY_ALIAS + ".deleted",  Boolean.FALSE, DynamicQuery.PREDICATE_EQUALS));
-			else
-				tmodelKeysFound = FindTModelByPublisherQuery.select(em, null, publisher, tmodelKeysFound);
-				
-			RegisteredInfo result = new RegisteredInfo();
-			
-			// Sort and retrieve the final results
-			List<?> queryResults = FetchBusinessEntitiesQuery.select(em, new FindQualifiers(), businessKeysFound, null, null, null);
-			if (queryResults.size() > 0) {
-				result.setBusinessInfos(new org.uddi.api_v3.BusinessInfos());
-				
-				for (Object item : queryResults) {
-					org.apache.juddi.model.BusinessEntity modelBusinessEntity = (org.apache.juddi.model.BusinessEntity)item;
-					org.uddi.api_v3.BusinessInfo apiBusinessInfo = new org.uddi.api_v3.BusinessInfo();
-					
-					MappingModelToApi.mapBusinessInfo(modelBusinessEntity, apiBusinessInfo);
-					
-					result.getBusinessInfos().getBusinessInfo().add(apiBusinessInfo);
-				}
-			}
-	
-			// Sort and retrieve the final results
-			queryResults = FetchTModelsQuery.select(em, new FindQualifiers(), tmodelKeysFound, null, null, null);
-			if (queryResults.size() > 0) {
-				result.setTModelInfos(new org.uddi.api_v3.TModelInfos());
-				
-				for (Object item : queryResults) {
-					org.apache.juddi.model.Tmodel modelTModel = (org.apache.juddi.model.Tmodel)item;
-					org.uddi.api_v3.TModelInfo apiTModelInfo = new org.uddi.api_v3.TModelInfo();
-					
-					MappingModelToApi.mapTModelInfo(modelTModel, apiTModelInfo);
-					
-					result.getTModelInfos().getTModelInfo().add(apiTModelInfo);
-				}
-			}
-			
-			tx.commit();	
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.GET_REGISTEREDINFO, 
-                                QueryStatus.SUCCESS, procTime);                      
+                        serviceCounter.update(PublicationQuery.GET_PUBLISHERASSERTIONS,
+                             QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        public RegisteredInfo getRegisteredInfo(GetRegisteredInfo 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 ValidatePublish(publisher).validateRegisteredInfo(body);
+
+                        List<?> businessKeysFound = null;
+                        businessKeysFound = FindBusinessByPublisherQuery.select(em, null, publisher, businessKeysFound);
 
-			return result;
+                        List<?> tmodelKeysFound = null;
+
+                        if (body.getInfoSelection().equals(InfoSelection.HIDDEN)) {
+                                tmodelKeysFound = FindTModelByPublisherQuery.select(em, null, publisher, tmodelKeysFound, new DynamicQuery.Parameter(TModelQuery.ENTITY_ALIAS + ".deleted", Boolean.TRUE, DynamicQuery.PREDICATE_EQUALS));
+                        } else if (body.getInfoSelection().equals(InfoSelection.VISIBLE)) {
+                                tmodelKeysFound = FindTModelByPublisherQuery.select(em, null, publisher, tmodelKeysFound, new DynamicQuery.Parameter(TModelQuery.ENTITY_ALIAS + ".deleted", Boolean.FALSE, DynamicQuery.PREDICATE_EQUALS));
+                        } else {
+                                tmodelKeysFound = FindTModelByPublisherQuery.select(em, null, publisher, tmodelKeysFound);
+                        }
+
+                        RegisteredInfo result = new RegisteredInfo();
+
+                        // Sort and retrieve the final results
+                        List<?> queryResults = FetchBusinessEntitiesQuery.select(em, new FindQualifiers(), businessKeysFound, null, null, null);
+                        if (queryResults.size() > 0) {
+                                result.setBusinessInfos(new org.uddi.api_v3.BusinessInfos());
+
+                                for (Object item : queryResults) {
+                                        org.apache.juddi.model.BusinessEntity modelBusinessEntity = (org.apache.juddi.model.BusinessEntity) item;
+                                        org.uddi.api_v3.BusinessInfo apiBusinessInfo = new org.uddi.api_v3.BusinessInfo();
+
+                                        MappingModelToApi.mapBusinessInfo(modelBusinessEntity, apiBusinessInfo);
+
+                                        result.getBusinessInfos().getBusinessInfo().add(apiBusinessInfo);
+                                }
+                        }
+
+                        // Sort and retrieve the final results
+                        queryResults = FetchTModelsQuery.select(em, new FindQualifiers(), tmodelKeysFound, null, null, null);
+                        if (queryResults.size() > 0) {
+                                result.setTModelInfos(new org.uddi.api_v3.TModelInfos());
+
+                                for (Object item : queryResults) {
+                                        org.apache.juddi.model.Tmodel modelTModel = (org.apache.juddi.model.Tmodel) item;
+                                        org.uddi.api_v3.TModelInfo apiTModelInfo = new org.uddi.api_v3.TModelInfo();
+
+                                        MappingModelToApi.mapTModelInfo(modelTModel, apiTModelInfo);
+
+                                        result.getTModelInfos().getTModelInfo().add(apiTModelInfo);
+                                }
+                        }
+
+                        tx.commit();
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.GET_REGISTEREDINFO,
+                             QueryStatus.SUCCESS, procTime);
+
+                        return result;
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.GET_REGISTEREDINFO, 
-                            QueryStatus.FAILED, procTime);                      
-                    throw drfm;                                                                 
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-
-	public BindingDetail saveBinding(SaveBinding 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());
-			publisher.populateKeyGeneratorKeys(em);
-			ValidatePublish validator = new ValidatePublish(publisher);
-			validator.validateSaveBinding(em, body, null, publisher);
-	
-			BindingDetail result = new BindingDetail();
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.GET_REGISTEREDINFO,
+                             QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        public BindingDetail saveBinding(SaveBinding 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());
+                        publisher.populateKeyGeneratorKeys(em);
+                        ValidatePublish validator = new ValidatePublish(publisher);
+                        validator.validateSaveBinding(em, body, null, publisher);
+
+                        BindingDetail result = new BindingDetail();
                         result.setListDescription(new ListDescription());
-			List<org.uddi.api_v3.BindingTemplate> apiBindingTemplateList = body.getBindingTemplate();
-			for (org.uddi.api_v3.BindingTemplate apiBindingTemplate : apiBindingTemplateList) {
-				
-				org.apache.juddi.model.BindingTemplate modelBindingTemplate = new org.apache.juddi.model.BindingTemplate();
-                                
-				org.apache.juddi.model.BusinessService modelBusinessService = new org.apache.juddi.model.BusinessService();
-				modelBusinessService.setEntityKey(apiBindingTemplate.getServiceKey());
-				
-				MappingApiToModel.mapBindingTemplate(apiBindingTemplate, modelBindingTemplate, modelBusinessService);
-	
-				setOperationalInfo(em, modelBindingTemplate, publisher, false);
-	
-				em.persist(modelBindingTemplate);
-				
-				result.getBindingTemplate().add(apiBindingTemplate);
-                                result.getListDescription().setActualCount(result.getListDescription().getActualCount()+1);
-                                result.getListDescription().setIncludeCount(result.getListDescription().getIncludeCount()+1);
-				validator.validateSaveBindingMax(em, modelBindingTemplate.getBusinessService().getEntityKey());
-			}
-	
-			tx.commit();
+                        List<org.uddi.api_v3.BindingTemplate> apiBindingTemplateList = body.getBindingTemplate();
+                        List<org.apache.juddi.model.ChangeRecord> changes = new ArrayList<ChangeRecord>();
+
+                        for (org.uddi.api_v3.BindingTemplate apiBindingTemplate : apiBindingTemplateList) {
+
+                                org.apache.juddi.model.BindingTemplate modelBindingTemplate = new org.apache.juddi.model.BindingTemplate();
+
+                                org.apache.juddi.model.BusinessService modelBusinessService = new org.apache.juddi.model.BusinessService();
+                                modelBusinessService.setEntityKey(apiBindingTemplate.getServiceKey());
+
+                                MappingApiToModel.mapBindingTemplate(apiBindingTemplate, modelBindingTemplate, modelBusinessService);
+
+                                setOperationalInfo(em, modelBindingTemplate, publisher, false);
+
+                                em.persist(modelBindingTemplate);
+
+                                result.getBindingTemplate().add(apiBindingTemplate);
+                                result.getListDescription().setActualCount(result.getListDescription().getActualCount() + 1);
+                                result.getListDescription().setIncludeCount(result.getListDescription().getIncludeCount() + 1);
+                                validator.validateSaveBindingMax(em, modelBindingTemplate.getBusinessService().getEntityKey());
+                                changes.add(getChangeRecord(modelBindingTemplate, apiBindingTemplate, node));
+                        }
+
+                        tx.commit();
+                        for (int i = 0; i < changes.size(); i++) {
+                                ReplicationNotifier.Enqueue(changes.get(i));
+                        }
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.SAVE_BINDING, 
-                                QueryStatus.SUCCESS, procTime);                      
+                        serviceCounter.update(PublicationQuery.SAVE_BINDING,
+                             QueryStatus.SUCCESS, procTime);
 
-			return result;
+                        return result;
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.SAVE_BINDING, 
-                            QueryStatus.FAILED, procTime);                      
-                    throw drfm;                                                                 
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-
-	public BusinessDetail saveBusiness(SaveBusiness body)
-			throws DispositionReportFaultMessage {
-	        long startTime = System.currentTimeMillis();
-               if (!body.getBusinessEntity().isEmpty()) {
-                log.debug("Inbound save business request for key " + body.getBusinessEntity().get(0).getBusinessKey());
-                 }
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.SAVE_BINDING,
+                             QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        public BusinessDetail saveBusiness(SaveBusiness body)
+             throws DispositionReportFaultMessage {
+                long startTime = System.currentTimeMillis();
+                if (!body.getBusinessEntity().isEmpty()) {
+                        log.debug("Inbound save business request for key " + body.getBusinessEntity().get(0).getBusinessKey());
+                }
                 EntityManager em = PersistenceManager.getEntityManager();
-		EntityTransaction tx = em.getTransaction();
-		try {
-			tx.begin();
-			
-			UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
-			publisher.populateKeyGeneratorKeys(em);
-			ValidatePublish validator = new ValidatePublish(publisher);
-			validator.validateSaveBusiness(em, body, null, publisher);
-	
-			BusinessDetail result = new BusinessDetail();
-			
-			List<org.uddi.api_v3.BusinessEntity> apiBusinessEntityList = body.getBusinessEntity();
-			for (org.uddi.api_v3.BusinessEntity apiBusinessEntity : apiBusinessEntityList) {
-				
-				org.apache.juddi.model.BusinessEntity modelBusinessEntity = new org.apache.juddi.model.BusinessEntity();
-				
-				MappingApiToModel.mapBusinessEntity(apiBusinessEntity, modelBusinessEntity);
-
-				setOperationalInfo(em, modelBusinessEntity, publisher);
+                EntityTransaction tx = em.getTransaction();
+                try {
+                        tx.begin();
+
+                        UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
+                        publisher.populateKeyGeneratorKeys(em);
+                        ValidatePublish validator = new ValidatePublish(publisher);
+                        validator.validateSaveBusiness(em, body, null, publisher);
+
+                        BusinessDetail result = new BusinessDetail();
+
+                        List<org.uddi.api_v3.BusinessEntity> apiBusinessEntityList = body.getBusinessEntity();
+                        List<ChangeRecord> changes = new ArrayList<ChangeRecord>();
+
+                        for (org.uddi.api_v3.BusinessEntity apiBusinessEntity : apiBusinessEntityList) {
+
+                                org.apache.juddi.model.BusinessEntity modelBusinessEntity = new org.apache.juddi.model.BusinessEntity();
+
+                                MappingApiToModel.mapBusinessEntity(apiBusinessEntity, modelBusinessEntity);
+
+                                setOperationalInfo(em, modelBusinessEntity, publisher);
                                 log.debug("Saving business " + modelBusinessEntity.getEntityKey());
-	
-				em.persist(modelBusinessEntity);
-	
-				result.getBusinessEntity().add(apiBusinessEntity);
-			}
-			
-			//check how many business this publisher owns.
-			validator.validateSaveBusinessMax(em);
-	
-			tx.commit();
+
+                                em.persist(modelBusinessEntity);
+                                changes.add(getChangeRecord(modelBusinessEntity, apiBusinessEntity, node));
+                                result.getBusinessEntity().add(apiBusinessEntity);
+                        }
+
+                        //check how many business this publisher owns.
+                        validator.validateSaveBusinessMax(em);
+
+                        tx.commit();
+                        for (int i = 0; i < changes.size(); i++) {
+                                ReplicationNotifier.Enqueue(changes.get(i));
+                        }
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.SAVE_BUSINESS, 
-                                QueryStatus.SUCCESS, procTime);                      
+                        serviceCounter.update(PublicationQuery.SAVE_BUSINESS,
+                             QueryStatus.SUCCESS, procTime);
 
-			return result;
+                        return result;
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.SAVE_BUSINESS, 
-                            QueryStatus.FAILED, procTime);                      
-                    throw drfm;                                                                 	
-		} catch (Exception ex){
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.SAVE_BUSINESS,
+                             QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } catch (Exception ex) {
                         StringWriter sw = new StringWriter();
-                        if (body!=null)
-                        JAXB.marshal(body, sw);
-                  log.fatal("unexpected error!" + sw.toString(), ex);
-                  throw new FatalErrorException(new ErrorMessage("E_fatalError", ex.getMessage()));
+                        if (body != null) {
+                                JAXB.marshal(body, sw);
+                        }
+                        log.fatal("unexpected error!" + sw.toString(), ex);
+                        throw new FatalErrorException(new ErrorMessage("E_fatalError", ex.getMessage()));
                 } finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-
-	public ServiceDetail saveService(SaveService 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());
-			publisher.populateKeyGeneratorKeys(em);
-			ValidatePublish validator = new ValidatePublish(publisher);
-			validator.validateSaveService(em, body, null, publisher);
-			
-			ServiceDetail result = new ServiceDetail();
-	
-			List<org.uddi.api_v3.BusinessService> apiBusinessServiceList = body.getBusinessService();
-			for (org.uddi.api_v3.BusinessService apiBusinessService : apiBusinessServiceList) {
-				
-				org.apache.juddi.model.BusinessService modelBusinessService = new org.apache.juddi.model.BusinessService();
-				org.apache.juddi.model.BusinessEntity modelBusinessEntity = new org.apache.juddi.model.BusinessEntity();
-				modelBusinessEntity.setEntityKey(apiBusinessService.getBusinessKey());
-				
-				MappingApiToModel.mapBusinessService(apiBusinessService, modelBusinessService, modelBusinessEntity);
-	
-				setOperationalInfo(em, modelBusinessService, publisher, false);
-
-				em.persist(modelBusinessService);
-				
-				result.getBusinessService().add(apiBusinessService);
-				
-				validator.validateSaveServiceMax(em, modelBusinessService.getBusinessEntity().getEntityKey());
-			}
-			
-			
-			tx.commit();
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        public ServiceDetail saveService(SaveService 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());
+                        publisher.populateKeyGeneratorKeys(em);
+                        ValidatePublish validator = new ValidatePublish(publisher);
+                        validator.validateSaveService(em, body, null, publisher);
+
+                        ServiceDetail result = new ServiceDetail();
+
+                        List<org.uddi.api_v3.BusinessService> apiBusinessServiceList = body.getBusinessService();
+                        List<ChangeRecord> changes = new ArrayList<ChangeRecord>();
+                        for (org.uddi.api_v3.BusinessService apiBusinessService : apiBusinessServiceList) {
+
+                                org.apache.juddi.model.BusinessService modelBusinessService = new org.apache.juddi.model.BusinessService();
+                                org.apache.juddi.model.BusinessEntity modelBusinessEntity = new org.apache.juddi.model.BusinessEntity();
+                                modelBusinessEntity.setEntityKey(apiBusinessService.getBusinessKey());
+
+                                MappingApiToModel.mapBusinessService(apiBusinessService, modelBusinessService, modelBusinessEntity);
+
+                                setOperationalInfo(em, modelBusinessService, publisher, false);
+
+                                em.persist(modelBusinessService);
+
+                                result.getBusinessService().add(apiBusinessService);
+                                changes.add(getChangeRecord(modelBusinessService, apiBusinessService, node));
+                                validator.validateSaveServiceMax(em, modelBusinessService.getBusinessEntity().getEntityKey());
+                        }
+
+                        tx.commit();
+                        for (int i = 0; i < changes.size(); i++) {
+                                ReplicationNotifier.Enqueue(changes.get(i));
+                        }
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.SAVE_SERVICE, 
-                                QueryStatus.SUCCESS, procTime);                      
+                        serviceCounter.update(PublicationQuery.SAVE_SERVICE,
+                             QueryStatus.SUCCESS, procTime);
 
-			return result;
+                        return result;
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.SAVE_SERVICE, 
-                            QueryStatus.FAILED, procTime);                      
-                    throw drfm;                                                                         			
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-
-	public TModelDetail saveTModel(SaveTModel 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());
-			publisher.populateKeyGeneratorKeys(em);
-			new ValidatePublish(publisher).validateSaveTModel(em, body, null, publisher);
-	
-			TModelDetail result = new TModelDetail();
-	
-			List<org.uddi.api_v3.TModel> apiTModelList = body.getTModel();
-			for (org.uddi.api_v3.TModel apiTModel : apiTModelList) {
-				
-				org.apache.juddi.model.Tmodel modelTModel = new org.apache.juddi.model.Tmodel();
-				
-				MappingApiToModel.mapTModel(apiTModel, modelTModel);
-	
-				setOperationalInfo(em, modelTModel, publisher);
-	
-				em.persist(modelTModel);
-				
-				result.getTModel().add(apiTModel);
-				
-			}
-	
-			tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.SAVE_TMODEL, 
-                                QueryStatus.SUCCESS, procTime);                      
+                        serviceCounter.update(PublicationQuery.SAVE_SERVICE,
+                             QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        public TModelDetail saveTModel(SaveTModel 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());
+                        publisher.populateKeyGeneratorKeys(em);
+                        new ValidatePublish(publisher).validateSaveTModel(em, body, null, publisher);
+
+                        TModelDetail result = new TModelDetail();
+
+                        List<org.uddi.api_v3.TModel> apiTModelList = body.getTModel();
+                        List<ChangeRecord> changes = new ArrayList<ChangeRecord>();
+                        for (org.uddi.api_v3.TModel apiTModel : apiTModelList) {
+
+                                org.apache.juddi.model.Tmodel modelTModel = new org.apache.juddi.model.Tmodel();
+
+                                MappingApiToModel.mapTModel(apiTModel, modelTModel);
+
+                                setOperationalInfo(em, modelTModel, publisher);
+
+                                em.persist(modelTModel);
+
+                                result.getTModel().add(apiTModel);
+                                changes.add(getChangeRecord(modelTModel, apiTModel, node));
+
+                        }
+
+                        tx.commit();
+                        for (int i = 0; i < changes.size(); i++) {
+                                ReplicationNotifier.Enqueue(changes.get(i));
+                        }
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.SAVE_TMODEL,
+                             QueryStatus.SUCCESS, procTime);
 
-			return result;
+                        return result;
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.SAVE_TMODEL, 
-                            QueryStatus.FAILED, procTime);                      
-                    throw drfm;                                                                                                 
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-
-	public void setPublisherAssertions(String authInfo,
-			Holder<List<PublisherAssertion>> publisherAssertion)
-			throws DispositionReportFaultMessage {
-	        long startTime = System.currentTimeMillis();
-
-		EntityManager em = PersistenceManager.getEntityManager();
-		EntityTransaction tx = em.getTransaction();
-		try {
-			tx.begin();
-	
-			UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
-			
-			new ValidatePublish(publisher).validateSetPublisherAssertions(em, publisherAssertion);
-			
-			List<?> businessKeysFound = null;
-			businessKeysFound = FindBusinessByPublisherQuery.select(em, null, publisher, businessKeysFound);
-	
-			// First, wipe out all previous assertions associated with this publisher
-			DeletePublisherAssertionByBusinessQuery.delete(em, businessKeysFound);
-			
-			// Slate is clean for all assertions involving this publisher, now we simply need to add the new ones (and they will all be "new").
-			List<org.uddi.api_v3.PublisherAssertion> apiPubAssertionList = publisherAssertion.value;
-			for (org.uddi.api_v3.PublisherAssertion apiPubAssertion : apiPubAssertionList) {
-				
-				org.apache.juddi.model.PublisherAssertion modelPubAssertion = new org.apache.juddi.model.PublisherAssertion();
-				
-				MappingApiToModel.mapPublisherAssertion(apiPubAssertion, modelPubAssertion);
-				
-				org.apache.juddi.model.BusinessEntity beFrom = em.find(org.apache.juddi.model.BusinessEntity.class, modelPubAssertion.getId().getFromKey());
-				org.apache.juddi.model.BusinessEntity beTo = em.find(org.apache.juddi.model.BusinessEntity.class, modelPubAssertion.getId().getToKey());
-				modelPubAssertion.setBusinessEntityByFromKey(beFrom);
-				modelPubAssertion.setBusinessEntityByToKey(beTo);
-				
-				modelPubAssertion.setFromCheck("false");
-				modelPubAssertion.setToCheck("false");
-				
-				em.persist(modelPubAssertion);
-	
-				if (publisher.isOwner(modelPubAssertion.getBusinessEntityByFromKey()))
-					modelPubAssertion.setFromCheck("true");
-				if (publisher.isOwner(modelPubAssertion.getBusinessEntityByToKey()))
-					modelPubAssertion.setToCheck("true");
-				
-			}
-	
-			tx.commit();
                         long procTime = System.currentTimeMillis() - startTime;
-                        serviceCounter.update(PublicationQuery.SET_PUBLISHERASSERTIONS, 
-                                QueryStatus.SUCCESS, procTime);                      
+                        serviceCounter.update(PublicationQuery.SAVE_TMODEL,
+                             QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        @Override
+        public void setPublisherAssertions(String authInfo,
+             Holder<List<PublisherAssertion>> publisherAssertion)
+             throws DispositionReportFaultMessage {
+                long startTime = System.currentTimeMillis();
+
+                EntityManager em = PersistenceManager.getEntityManager();
+                EntityTransaction tx = em.getTransaction();
+                try {
+                        tx.begin();
+
+                        UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
+
+                        new ValidatePublish(publisher).validateSetPublisherAssertions(em, publisherAssertion);
+
+                        List<?> businessKeysFound = null;
+                        businessKeysFound = FindBusinessByPublisherQuery.select(em, null, publisher, businessKeysFound);
+
+                        //TODO this has to be reworked to record what was deleted.
+                        
+                        // First, wipe out all previous assertions associated with this publisher
+                        DeletePublisherAssertionByBusinessQuery.delete(em, businessKeysFound);
+
+                        // Slate is clean for all assertions involving this publisher, now we simply need to add the new ones (and they will all be "new").
+                        List<org.uddi.api_v3.PublisherAssertion> apiPubAssertionList = publisherAssertion.value;
+
+                        List<ChangeRecord> changes = new ArrayList<ChangeRecord>();
+                        for (org.uddi.api_v3.PublisherAssertion apiPubAssertion : apiPubAssertionList) {
+
+                                org.apache.juddi.model.PublisherAssertion modelPubAssertion = new org.apache.juddi.model.PublisherAssertion();
+
+                                MappingApiToModel.mapPublisherAssertion(apiPubAssertion, modelPubAssertion);
+
+                                org.apache.juddi.model.BusinessEntity beFrom = em.find(org.apache.juddi.model.BusinessEntity.class, modelPubAssertion.getId().getFromKey());
+                                org.apache.juddi.model.BusinessEntity beTo = em.find(org.apache.juddi.model.BusinessEntity.class, modelPubAssertion.getId().getToKey());
+                                modelPubAssertion.setBusinessEntityByFromKey(beFrom);
+                                modelPubAssertion.setBusinessEntityByToKey(beTo);
+
+                                modelPubAssertion.setFromCheck("false");
+                                modelPubAssertion.setToCheck("false");
+
+                                
+                                if (publisher.isOwner(modelPubAssertion.getBusinessEntityByFromKey())) {
+                                        modelPubAssertion.setFromCheck("true");
+                                }
+                                if (publisher.isOwner(modelPubAssertion.getBusinessEntityByToKey())) {
+                                        modelPubAssertion.setToCheck("true");
+                                }
+                                em.persist(modelPubAssertion);
+
+                                
+                                changes.add(getChangeRecord_NewAssertion(apiPubAssertion, modelPubAssertion, node));
+
+                        }
+
+                        tx.commit();
+                        for (int i=0; i < changes.size(); i++)
+                                ReplicationNotifier.Enqueue(changes.get(i));
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.SET_PUBLISHERASSERTIONS,
+                             QueryStatus.SUCCESS, procTime);
                 } catch (DispositionReportFaultMessage drfm) {
-                    long procTime = System.currentTimeMillis() - startTime;
-                    serviceCounter.update(PublicationQuery.SET_PUBLISHERASSERTIONS, 
-                            QueryStatus.FAILED, procTime);                      
-                    throw drfm;                                                                                                 
-		} finally {
-			if (tx.isActive()) {
-				tx.rollback();
-			}
-			em.close();
-		}
-	}
-
-	private void setOperationalInfo(EntityManager em, org.apache.juddi.model.BusinessEntity uddiEntity, UddiEntityPublisher publisher) throws DispositionReportFaultMessage {
-
-		uddiEntity.setAuthorizedName(publisher.getAuthorizedName());
-
-		Date now = new Date();
-		uddiEntity.setModified(now);
-		uddiEntity.setModifiedIncludingChildren(now);
-
-		String nodeId = "";
-		try 
-		{ nodeId = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID); } 
-		catch (ConfigurationException ce) 
-		{ throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval", Property.JUDDI_NODE_ID)); }
-		uddiEntity.setNodeId(nodeId);
-		
-		org.apache.juddi.model.BusinessEntity existingUddiEntity = em.find(uddiEntity.getClass(), uddiEntity.getEntityKey());
-		if (existingUddiEntity != null)
-			uddiEntity.setCreated(existingUddiEntity.getCreated());
-		else
-			uddiEntity.setCreated(now);
-		
-		List<org.apache.juddi.model.BusinessService> serviceList = uddiEntity.getBusinessServices();
-		for (org.apache.juddi.model.BusinessService service : serviceList)
-			setOperationalInfo(em, service, publisher, true);
-		
-		
-		if (existingUddiEntity != null)
-			em.remove(existingUddiEntity);
-		
-	}
-
-	private void setOperationalInfo(EntityManager em, org.apache.juddi.model.BusinessService uddiEntity, UddiEntityPublisher publisher, boolean isChild) throws DispositionReportFaultMessage {
-
-		uddiEntity.setAuthorizedName(publisher.getAuthorizedName());
-
-		Date now = new Date();
-		uddiEntity.setModified(now);
-		uddiEntity.setModifiedIncludingChildren(now);
-		
-		if(!isChild) {
-			org.apache.juddi.model.BusinessEntity parent = em.find(org.apache.juddi.model.BusinessEntity.class, uddiEntity.getBusinessEntity().getEntityKey());
-			parent.setModifiedIncludingChildren(now);
-			em.persist(parent);
-		}
-
-		String nodeId = "";
-		try 
-		{ nodeId = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID); } 
-		catch (ConfigurationException ce) 
-		{ throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval", Property.JUDDI_NODE_ID)); }
-		uddiEntity.setNodeId(nodeId);
-		
-		org.apache.juddi.model.BusinessService existingUddiEntity = em.find(uddiEntity.getClass(), uddiEntity.getEntityKey());
-		if (existingUddiEntity != null) {
-			uddiEntity.setCreated(existingUddiEntity.getCreated());
-		}
-		else
-			uddiEntity.setCreated(now);
-		
-		List<org.apache.juddi.model.BindingTemplate> bindingList = uddiEntity.getBindingTemplates();
-		for (org.apache.juddi.model.BindingTemplate binding : bindingList)
-			setOperationalInfo(em, binding, publisher, true);
-		
-		
-		if (existingUddiEntity != null)
-			em.remove(existingUddiEntity);
-		
-	}
-
-	private void setOperationalInfo(EntityManager em, org.apache.juddi.model.BindingTemplate uddiEntity, UddiEntityPublisher publisher, boolean isChild) throws DispositionReportFaultMessage {
-
-		uddiEntity.setAuthorizedName(publisher.getAuthorizedName());
-
-		Date now = new Date();
-		uddiEntity.setModified(now);
-		uddiEntity.setModifiedIncludingChildren(now);
-
-		if(!isChild) {
-			org.apache.juddi.model.BusinessService parent = em.find(org.apache.juddi.model.BusinessService.class, uddiEntity.getBusinessService().getEntityKey());
-			parent.setModifiedIncludingChildren(now);
-			em.persist(parent);
-			
-			// JUDDI-421:  now the businessEntity parent will have it's modifiedIncludingChildren set
-			org.apache.juddi.model.BusinessEntity businessParent = em.find(org.apache.juddi.model.BusinessEntity.class, parent.getBusinessEntity().getEntityKey());
-			businessParent.setModifiedIncludingChildren(now);
-			em.persist(businessParent);
-		}
-
-		String nodeId = "";
-		try 
-		{ nodeId = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID); } 
-		catch (ConfigurationException ce) 
-		{ throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval", Property.JUDDI_NODE_ID)); }
-		uddiEntity.setNodeId(nodeId);
-		
-		org.apache.juddi.model.BindingTemplate existingUddiEntity = em.find(uddiEntity.getClass(), uddiEntity.getEntityKey());
-		if (existingUddiEntity != null)
-			uddiEntity.setCreated(existingUddiEntity.getCreated());
-		else
-			uddiEntity.setCreated(now);
-		
-		if (existingUddiEntity != null)
-			em.remove(existingUddiEntity);
-		
-	}
-	
-	private void setOperationalInfo(EntityManager em, org.apache.juddi.model.Tmodel uddiEntity, UddiEntityPublisher publisher) throws DispositionReportFaultMessage {
-
-		uddiEntity.setAuthorizedName(publisher.getAuthorizedName());
-		
-		Date now = new Date();
-		uddiEntity.setModified(now);
-		uddiEntity.setModifiedIncludingChildren(now);
-
-		String nodeId = "";
-		try 
-		{ nodeId = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID); } 
-		catch (ConfigurationException ce) 
-		{ throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval", Property.JUDDI_NODE_ID)); }
-		uddiEntity.setNodeId(nodeId);
-		
-		org.apache.juddi.model.Tmodel existingUddiEntity = em.find(uddiEntity.getClass(), uddiEntity.getEntityKey());
-		if (existingUddiEntity != null)
-			uddiEntity.setCreated(existingUddiEntity.getCreated());
-		else
-			uddiEntity.setCreated(now);
-		
-		if (existingUddiEntity != null)
-			em.remove(existingUddiEntity);
-		
-	}
-	
+                        long procTime = System.currentTimeMillis() - startTime;
+                        serviceCounter.update(PublicationQuery.SET_PUBLISHERASSERTIONS,
+                             QueryStatus.FAILED, procTime);
+                        throw drfm;
+                } finally {
+                        if (tx.isActive()) {
+                                tx.rollback();
+                        }
+                        em.close();
+                }
+        }
+
+        private void setOperationalInfo(EntityManager em, org.apache.juddi.model.BusinessEntity uddiEntity, UddiEntityPublisher publisher) throws DispositionReportFaultMessage {
+
+                uddiEntity.setAuthorizedName(publisher.getAuthorizedName());
+
+                Date now = new Date();
+                uddiEntity.setModified(now);
+                uddiEntity.setModifiedIncludingChildren(now);
+
+                String nodeId = "";
+                try {
+                        nodeId = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID);
+                } catch (ConfigurationException ce) {
+                        throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval", Property.JUDDI_NODE_ID));
+                }
+                uddiEntity.setNodeId(nodeId);
+
+                org.apache.juddi.model.BusinessEntity existingUddiEntity = em.find(uddiEntity.getClass(), uddiEntity.getEntityKey());
+                if (existingUddiEntity != null) {
+                        uddiEntity.setCreated(existingUddiEntity.getCreated());
+                } else {
+                        uddiEntity.setCreated(now);
+                }
+
+                List<org.apache.juddi.model.BusinessService> serviceList = uddiEntity.getBusinessServices();
+                for (org.apache.juddi.model.BusinessService service : serviceList) {
+                        setOperationalInfo(em, service, publisher, true);
+                }
+
+                if (existingUddiEntity != null) {
+                        em.remove(existingUddiEntity);
+                }
+
+        }
+
+        private void setOperationalInfo(EntityManager em, org.apache.juddi.model.BusinessService uddiEntity, UddiEntityPublisher publisher, boolean isChild) throws DispositionReportFaultMessage {
+
+                uddiEntity.setAuthorizedName(publisher.getAuthorizedName());
+
+                Date now = new Date();
+                uddiEntity.setModified(now);
+                uddiEntity.setModifiedIncludingChildren(now);
+
+                if (!isChild) {
+                        org.apache.juddi.model.BusinessEntity parent = em.find(org.apache.juddi.model.BusinessEntity.class, uddiEntity.getBusinessEntity().getEntityKey());
+                        parent.setModifiedIncludingChildren(now);
+                        em.persist(parent);
+                }
+
+                String nodeId = "";
+                try {
+                        nodeId = AppConfig.getConfiguration().getString(Property.JUDDI_NODE_ID);
+                } catch (ConfigurationException ce) {
+                        throw new FatalErrorException(new ErrorMessage("errors.configuration.Retrieval", Property.JUDDI_NODE_ID));
+                }
+                uddiEntity.setNodeId(nodeId);
+
+                org.apache.juddi.model.BusinessService existingUddiEntity = em.find(uddiEntity.getClass(), uddiEntity.getEntityKey());
+                if (existingUddiEntity != null) {
+                        uddiEntity.setCreated(existingUddiEntity.getCreated());
+                } else {
+                        uddiEntity.setCreated(now);
+                }
+
+                List<org.apache.juddi.model.BindingTemplate> bindingList = uddiEntity.getBindingTemplates();
+         

<TRUNCATED>

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


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

Posted by al...@apache.org.
http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java b/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java
index 7d06b0c..933f476 100644
--- a/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java
+++ b/juddi-core/src/main/java/org/apache/juddi/subscription/SubscriptionNotifier.java
@@ -143,7 +143,7 @@ public class SubscriptionNotifier extends TimerTask {
 		if ((firedOnTime(scheduledExecutionTime()) || alwaysNotify) && registryMayContainUpdates()) {
 			long startTime = System.currentTimeMillis();
 			desiredDate = null;
-			log.debug("Start Notification background task; checking if subscription notifications need to be send out..");
+			log.info("Start Notification background task; checking if subscription notifications need to be send out..");
 			
 			Collection<Subscription> subscriptions = getAllAsyncSubscriptions();
 			for (Subscription subscription : subscriptions) {
@@ -164,23 +164,23 @@ public class SubscriptionNotifier extends TimerTask {
 							SubscriptionResultsList resultList = subscriptionImpl.getSubscriptionResults(getSubscriptionResults, publisher);
                                                         String token = resultList.getChunkToken();
 							if (resultListContainsChanges(resultList)) {
-								log.debug("We have a change and need to notify " + subscription.getSubscriptionKey());
+								log.info("We have a change and need to notify " + subscription.getSubscriptionKey());
                                                                 resultList.setChunkToken(null);
                                                                //Note that the chunkToken is not returned with this structure for this API.  
 								notify(getSubscriptionResults,resultList, notificationDate);
 							} else {
-								log.debug("No changes where recorded, no need to notify.");
+								log.info("No changes where recorded, no need to notify.");
 							}
                                                         while (!token.equalsIgnoreCase("0"))
                                                         {
                                                             resultList = subscriptionImpl.getSubscriptionResults(getSubscriptionResults, publisher);
                                                             if (resultListContainsChanges(resultList)) {
-                                                                    log.debug("We have a change and need to notify " + subscription.getSubscriptionKey());
+                                                                    log.info("We have a change and need to notify " + subscription.getSubscriptionKey());
                                                                     resultList.setChunkToken(null);
                                                                    //Note that the chunkToken is not returned with this structure for this API.  
                                                                     notify(getSubscriptionResults,resultList, notificationDate);
                                                             } else {
-                                                                    log.debug("No changes where recorded, no need to notify.");
+                                                                    log.info("No changes where recorded, no need to notify.");
                                                             }
                                                         }
                                                             
@@ -199,14 +199,14 @@ public class SubscriptionNotifier extends TimerTask {
             long endTime   = System.currentTimeMillis();
             
             if ((endTime-startTime) > interval) {
-            	log.debug("Notification background task duration exceeds the JUDDI_NOTIFICATION_INTERVAL" +
+            	log.info("Notification background task duration exceeds the JUDDI_NOTIFICATION_INTERVAL" +
             			" of " + interval + ". Notification background task took " 
             			+ (endTime - startTime) + " milliseconds.");
             } else {
-            	log.debug("Notification background task took " + (endTime - startTime) + " milliseconds.");
+            	log.info("Notification background task took " + (endTime - startTime) + " milliseconds.");
             }
 		} else {
-			log.debug("Skipping current notification cycle because lagtime is too great.");
+			log.warn("Skipping current notification cycle because lagtime is too great.");
 		}
  	}
 	/**
@@ -254,7 +254,7 @@ public class SubscriptionNotifier extends TimerTask {
 			if (log.isDebugEnabled()) log.debug("Period " + period.getStartPoint() + " " + period.getEndPoint());
 			getSubscriptionResults.setCoveragePeriod(period);
 		} else {
-			log.debug("Client does not yet want a notification. The next desidered notification Date " + nextDesiredNotificationDate + ". The current interval [" 
+			log.info("Client does not yet want a notification. The next desidered notification Date " + nextDesiredNotificationDate + ". The current interval [" 
 				+ startPoint + " , " + endPoint + "] therefore skipping this notification cycle.");
 			if (desiredDate==null || nextDesiredNotificationDate.getTime() < desiredDate.getTime()) {
 				desiredDate = nextDesiredNotificationDate;

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/java/org/apache/juddi/validation/ValidateReplication.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/validation/ValidateReplication.java b/juddi-core/src/main/java/org/apache/juddi/validation/ValidateReplication.java
index fed1760..e5cbf43 100644
--- a/juddi-core/src/main/java/org/apache/juddi/validation/ValidateReplication.java
+++ b/juddi-core/src/main/java/org/apache/juddi/validation/ValidateReplication.java
@@ -14,18 +14,101 @@
  * limitations under the License.
  *
  */
-
 package org.apache.juddi.validation;
 
+import java.math.BigInteger;
+import javax.xml.ws.WebServiceContext;
 import org.apache.juddi.model.UddiEntityPublisher;
+import org.apache.juddi.v3.error.ErrorMessage;
+import org.apache.juddi.v3.error.FatalErrorException;
+import org.apache.juddi.v3.error.ValueNotAllowedException;
+import org.uddi.repl_v3.HighWaterMarkVectorType;
+import org.uddi.repl_v3.NotifyChangeRecordsAvailable;
+import org.uddi.repl_v3.ReplicationConfiguration;
+import org.uddi.v3_service.DispositionReportFaultMessage;
 
 /**
- * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
+ * @author <a href="mailto:alexoree@apache.org">Alex O'Ree</a>
+ * Processing an inbound replication message may fail due to a server internal
+ * error. The common behavior for all error cases is to return an E_fatalError
+ * error code. Error reporting SHALL be that specified by Section 4.8 – Success
+ * and Error Reporting of this specification.
  */
 public class ValidateReplication extends ValidateUDDIApi {
 
-	public ValidateReplication(UddiEntityPublisher publisher) {
-		super(publisher);
-	}
-	
+        public ValidateReplication(UddiEntityPublisher publisher) {
+                super(publisher);
+        }
+
+        public void validateNotifyChangeRecordsAvailable(NotifyChangeRecordsAvailable body, WebServiceContext ctx) throws DispositionReportFaultMessage {
+                //TODO
+        }
+
+        public void validateGetChangeRecords(String requestingNode, HighWaterMarkVectorType changesAlreadySeen, BigInteger responseLimitCount, HighWaterMarkVectorType responseLimitVector, ReplicationConfiguration FetchEdges, WebServiceContext ctx) throws DispositionReportFaultMessage {
+                //TODO
+
+                if (requestingNode == null || requestingNode.trim().equalsIgnoreCase("")) {
+                        //requestingNode: The requestingNode element provides the identity of the calling node.  
+                        //This is the unique key for the calling node and SHOULD be specified within the Replication Configuration Structure.
+                        throw new FatalErrorException(new ErrorMessage("errors.replication.nodeNotSpecified"));
+                }
+                if (!ContainsNode(requestingNode, FetchEdges)) {
+                        throw new FatalErrorException(new ErrorMessage("errors.replication.unknownNode"));
+                }
+
+                if (changesAlreadySeen != null) {
+                        // changesAlreadySeen: The changesAlreadySeen element, if present, indicates changes from each
+                        //node that the requestor has successfully processed, and thus which should not be resent, if possible.
+
+                        //no validation needed?
+                }
+
+                if (responseLimitCount != null && responseLimitVector != null) {
+                        throw new FatalErrorException(new ErrorMessage("errors.replication.bothLimitsSpecified"));
+                }
+                if (responseLimitCount != null) {
+                        //can't be 0 since 0 is banned as being a change record id
+                        if (responseLimitCount.longValue() <= 0) {
+                                throw new FatalErrorException(new ErrorMessage("errors.replication.negativeLimit", responseLimitCount.toString()));
+                        }
+                }
+                if (responseLimitVector != null) {
+                        for (int i = 0; i < responseLimitVector.getHighWaterMark().size(); i++) {
+                                if (responseLimitVector.getHighWaterMark().get(i).getOriginatingUSN() == null
+                                     || responseLimitVector.getHighWaterMark().get(i).getOriginatingUSN() <= 0) {
+                                        throw new FatalErrorException(new ErrorMessage("errors.replication.limitVectorNull"));
+                                }
+                                if (responseLimitVector.getHighWaterMark().get(i).getNodeID()== null
+                                     || responseLimitVector.getHighWaterMark().get(i).getNodeID().trim().equalsIgnoreCase("")) {
+                                        throw new FatalErrorException(new ErrorMessage("errors.replication.limitVectorNoNode"));
+                                }
+                        }
+                }
+
+                /**
+                 * responseLimitCount or responseLimitVector: A caller MAY place
+                 * an upper bound on the number of change records he wishes to
+                 * receive in response to this message by either providing a
+                 * integer responseLimitCount, or, using responseLimitVector,
+                 * indicating for each node in the graph the first change
+                 * originating there that he does not wish to be returned.
+                 *
+                 */
+        }
+
+        private static boolean ContainsNode(String requestingNode, ReplicationConfiguration FetchEdges) {
+                if (FetchEdges == null) {
+                        return false;
+                }
+                if (FetchEdges.getCommunicationGraph() == null) {
+                        return false;
+                }
+                for (int i = 0; i < FetchEdges.getCommunicationGraph().getNode().size(); i++) {
+                        if (FetchEdges.getCommunicationGraph().getNode().get(i).equalsIgnoreCase(requestingNode)) {
+                                return true;
+                        }
+                }
+                return false;
+        }
+
 }

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/main/resources/messages.properties
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/resources/messages.properties b/juddi-core/src/main/resources/messages.properties
index 408106b..c1bcbd2 100644
--- a/juddi-core/src/main/resources/messages.properties
+++ b/juddi-core/src/main/resources/messages.properties
@@ -281,3 +281,14 @@ notifications.smtp.userfriendly.body=Hello %s,<br><br>You are currently register
 #username
 #node
 #search results or a specific item
+
+
+
+#replication error messages
+errors.replication.nodeNotSpecified=The requestor's node name must be specified
+errors.replication.unknownNode=The requestor's node is NOT in the replication configuration graph. Access Denied
+errors.replication.bothLimitsSpecified=responseLimitCount or responseLimitVector: A caller MAY place an upper bound on the number of change records he wishes to receive in response to this message by either providing a integer responseLimitCount, or, using responseLimitVector, indicating for each node in the graph the first change originating there that he does not wish to be returned.
+errors.replication.negativeLimit=The specified response limit is either 0 or a negative number.
+errors.replication.limitVectorNull=The high water mark vector limit specified OriginatingUSN is null or invalid
+errors.replication.limitVectorNoNode=No node name was specified
+errors.replication.configNodeNotFound=No specified node name is not currently registered as a node. Use the jUDDI Service API to register it. Node id: 

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-core/src/test/java/org/apache/juddi/util/JPAUtil.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/test/java/org/apache/juddi/util/JPAUtil.java b/juddi-core/src/test/java/org/apache/juddi/util/JPAUtil.java
index 6c2eeca..b862063 100644
--- a/juddi-core/src/test/java/org/apache/juddi/util/JPAUtil.java
+++ b/juddi-core/src/test/java/org/apache/juddi/util/JPAUtil.java
@@ -35,8 +35,9 @@ import org.apache.juddi.config.PersistenceManager;
 		System.out.println("object=" + object);
 	}
  */
+@Deprecated
 public class JPAUtil {
-	//TODO Comment from Code Review: This class does not seem to be in use. Do we need it?
+	//REMOVE Comment from Code Review: This class does not seem to be in use. Do we need it?
 	
 	public static void persistEntity(Object uddiEntity, Object entityKey) {
 		EntityManager em = PersistenceManager.getEntityManager();

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/EntryPoint.java
----------------------------------------------------------------------
diff --git a/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/EntryPoint.java b/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/EntryPoint.java
index 2752e43..d9a86cf 100644
--- a/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/EntryPoint.java
+++ b/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/EntryPoint.java
@@ -15,7 +15,10 @@
  */
 package org.apache.juddi.samples;
 
+import java.util.List;
+import org.apache.juddi.api_v3.Node;
 import org.apache.juddi.v3.client.config.UDDIClient;
+import org.apache.juddi.v3.client.config.UDDINode;
 import org.apache.juddi.v3.client.transport.Transport;
 import org.uddi.api_v3.DiscardAuthToken;
 import org.uddi.api_v3.GetAuthToken;
@@ -35,17 +38,17 @@ public class EntryPoint {
                         System.out.println("____________________________");
                         System.out.println(" 1) Login (get an auth token)");
                         System.out.println(" 2) Compare Two Binding/tModelInstanceInfo - QOS Example");
-                        System.out.println(" 3) jUDDI Admin service - Register a Node");
+                        System.out.println(" 3) jUDDI Admin service - Register a Node (quick add of the jUDDI cloud server)");
                         System.out.println(" 4) Find Binding by QOS Parameters (Binding/tModelInstanceInfo)");
                         System.out.println(" 5) Find Service by QOS Parameters (Binding/tModelInstanceInfo)");
                         System.out.println(" 6) UDDI Create Bulk (makes N business/services");
-                        System.out.println(" 7) UDDI Custody Transfer");
+                        System.out.println(" 7) UDDI Custody Transfer (within a single node)");
                         System.out.println(" 8) UDDI Digital Signatures - Sign a Business");
                         System.out.println(" 9) UDDI Digital Signatures - Sign a Service");
                         System.out.println("10) UDDI Digital Signatures - Sign a tModel");
                         System.out.println("11) UDDI Digital Signatures - Search for Signed Items");
                         System.out.println("12) Find a Binding, lists all bindings for all services");
-                        System.out.println("13) Find Endpoints of a service");
+                        System.out.println("13) Find Endpoints of a service (given the key)");
                         System.out.println("14) Get the details of a service");
                         System.out.println("15) Make a Key Generator tModel");
                         System.out.println("16) Create a Business Relationship Between two users and two Businesses");
@@ -59,6 +62,17 @@ public class EntryPoint {
                         System.out.println("24) Delete a subscription");
                         System.out.println("25) Delete all subscriptions");
                         System.out.println("26) Subscriptions - Asynchronous, publisher assertion subscriptions");
+                        System.out.println("27) Replication - do_ping");
+                        System.out.println("28) Replication - get high watermarks");
+                        System.out.println("29) Replication - get change records");
+                        System.out.println("30) Replication - Setup replication between two nodes");
+                        System.out.println("31) Quick add the jUDDI cloud node to *this's configuration file");
+                        System.out.println("32) Add a node to *this's configuration file");
+                        System.out.println("33) Register a *this node to a jUDDI server");
+                        System.out.println("34) View all registered remote nodes on a jUDDI server");
+                        System.out.println("35) View all registered nodes for this client");
+                        System.out.println("36) UnRegister a node on a jUDDI server");
+
                         System.out.println("q) quit");
                         System.out.print("Selection: ");
                         input = System.console().readLine();
@@ -93,7 +107,7 @@ public class EntryPoint {
                         CompareByTModelInstanceInfoQOS.main(null);
                 }
                 if (input.equals("3")) {
-                        new JuddiAdminService().go(authtoken);
+                        new JuddiAdminService().quickRegisterRemoteCloud(authtoken);
                 }
                 if (input.equals("4")) {
                         SearchByQos.doFindBinding(authtoken);
@@ -256,10 +270,146 @@ public class EntryPoint {
                 if (input.equals("25")) {
                         new UddiSubscriptionManagement().DeleteAllSubscriptions(authtoken);
                 }
-                 if (input.equals("26")) {
+                if (input.equals("26")) {
                         new UddiSubscribeAssertionStatus().Fire();
 
                 }
+                if (input.equals("27")) {
+                        //System.out.println("27) Replication - do_ping");
+
+                        System.out.print("URL: ");
+                        String key2 = (System.console().readLine());
+                        new UddiReplication().DoPing(key2);
+
+                }
+                if (input.equals("28")) {
+                        //System.out.println("28) Replication - get high watermarks");
+                        System.out.print("URL: ");
+                        String key2 = (System.console().readLine());
+                        new UddiReplication().GetHighWatermarks(key2);
+
+                }
+                if (input.equals("29")) {
+                        //System.out.println("29) Replication - get change records");
+                        System.out.print("URL: ");
+                        String key2 = (System.console().readLine());
+
+                        System.out.print("Change ID to fetch: ");
+                        String id = (System.console().readLine());
+
+                        new UddiReplication().GetChangeRecords(key2, Long.parseLong(id));
+
+                }
+                if (input.equals("30")) {
+                        // System.out.println("30) Replication - Setup replication between two nodes");
+                        new JuddiAdminService().setupReplication();
+
+                }
+                if (input.equals("31")) {
+                        //System.out.println("31) Quick add the jUDDI cloud node to *this's configuration file");
+                        new JuddiAdminService().quickRegisterLocalCloud();
+                }
+                if (input.equals("32")) {
+                        // System.out.println("32) Add a node to *this's configuration file");
+                        UDDIClient clerkManager = new UDDIClient("META-INF/simple-publish-uddi.xml");
+                        UDDINode node = new UDDINode();
+                        System.out.print("Name (must be unique: ");
+                        node.setClientName(System.console().readLine());
+                        System.out.print("Description: ");
+                        node.setDescription(System.console().readLine());
+
+                        node.setHomeJUDDI(false);
+                        System.out.print("Inquiry URL: ");
+                        node.setInquiryUrl(System.console().readLine());
+
+                        System.out.print("Inquiry REST URL (optional): ");
+                        node.setInquiryRESTUrl(System.console().readLine());
+
+                        System.out.print("jUDDI API URL (optional): ");
+                        node.setJuddiApiUrl(System.console().readLine());
+                        System.out.print("Custody Transfer URL: ");
+                        node.setCustodyTransferUrl(System.console().readLine());
+                        System.out.print("Publish URL: ");
+                        node.setPublishUrl(System.console().readLine());
+                        System.out.print("Replication URL: ");
+                        node.setReplicationUrl(System.console().readLine());
+                        System.out.print("Security URL: ");
+                        node.setSecurityUrl(System.console().readLine());
+                        System.out.print("Subscription URL: ");
+                        node.setSubscriptionUrl(System.console().readLine());
+                        System.out.print("Transport (defaults to JAXWS): ");
+                        node.setProxyTransport(System.console().readLine());
+                        if (node.getProxyTransport() == null) {
+                                node.setProxyTransport(org.apache.juddi.v3.client.transport.JAXWSTransport.class.getCanonicalName());
+                        }
+                        System.out.print("Factory Initial (optional): ");
+                        node.setFactoryInitial(System.console().readLine());
+                        System.out.print("Factory Naming Provider (optional): ");
+                        node.setFactoryNamingProvider(System.console().readLine());
+                        System.out.print("Factory URL Packages (optional): ");
+                        node.setFactoryURLPkgs(System.console().readLine());
+
+                        clerkManager.getClientConfig().addUDDINode(node);
+                        clerkManager.getClientConfig().saveConfig();
+                        System.out.println("Saved.");
+                }
+                if (input.equals("32")) {
+
+                        //System.out.println("32) Register a *this node to a jUDDI server");
+                        UDDIClient clerkManager = new UDDIClient("META-INF/simple-publish-uddi.xml");
+                        List<Node> uddiNodeList = clerkManager.getClientConfig().getUDDINodeList();
+                        System.out.println();
+                        
+                        System.out.println("Locally defined nodes:");
+                        for (int i = 0; i < uddiNodeList.size(); i++) {
+                                System.out.println("________________________________________________________________________________");
+                                System.out.println(i + ") Node name: " + uddiNodeList.get(i).getName());
+                                System.out.println(i + ") Node description: " + uddiNodeList.get(i).getDescription());
+                                System.out.println(i + ") Transport: " + uddiNodeList.get(i).getProxyTransport());
+                                System.out.println(i + ") jUDDI URL: " + uddiNodeList.get(i).getJuddiApiUrl());
+                        }
+                        System.out.println("Local Node to publish to remote jUDDI instance: ");
+                        int index=Integer.parseInt(System.console().readLine());
+                        
+                        System.out.println("Pick a node (remote jUDDI instance) to publish the selected node information to");
+                        for (int i = 0; i < uddiNodeList.size(); i++) {
+                                System.out.println("________________________________________________________________________________");
+                                System.out.println(i + ") Node name: " + uddiNodeList.get(i).getName());
+                                System.out.println(i + ") Node description: " + uddiNodeList.get(i).getDescription());
+                                System.out.println(i + ") Transport: " + uddiNodeList.get(i).getProxyTransport());
+                                System.out.println(i + ") jUDDI URL: " + uddiNodeList.get(i).getJuddiApiUrl());
+                        }
+                        System.out.println("Node to publish to remote jUDDI instance: ");
+                        int index2=Integer.parseInt(System.console().readLine());
+                        
+                        
+                        new JuddiAdminService().registerLocalNodeToRemoteNode(authtoken, uddiNodeList.get(index), uddiNodeList.get(index2)); 
+                        
+                }
+                if (input.equals("34")) {
+
+                        // System.out.println("33) View all register remote nodes on a jUDDI server");
+                        new JuddiAdminService().viewRemoteNodes(authtoken);
+                }
+
+                if (input.equals("35")) {
+                        UDDIClient clerkManager = new UDDIClient("META-INF/simple-publish-uddi.xml");
+                        List<Node> uddiNodeList = clerkManager.getClientConfig().getUDDINodeList();
+                        for (int i = 0; i < uddiNodeList.size(); i++) {
+                                System.out.println("________________________________________________________________________________");
+                                System.out.println("Client name: " + uddiNodeList.get(i).getClientName());
+                                System.out.println("Node name: " + uddiNodeList.get(i).getName());
+                                System.out.println("Node description: " + uddiNodeList.get(i).getDescription());
+                                System.out.println("Transport: " + uddiNodeList.get(i).getProxyTransport());
+                                System.out.println(i + ") jUDDI URL: " + uddiNodeList.get(i).getJuddiApiUrl());
+
+                        }
+
+                }
+                if (input.equals("36")) {
+
+                        //System.out.println("35) UnRegister a node on a jUDDI server");
+                }
 
         }
 }

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/JuddiAdminService.java
----------------------------------------------------------------------
diff --git a/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/JuddiAdminService.java b/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/JuddiAdminService.java
index 01b6694..2ffa170 100644
--- a/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/JuddiAdminService.java
+++ b/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/JuddiAdminService.java
@@ -15,13 +15,21 @@
  */
 package org.apache.juddi.samples;
 
+import java.rmi.RemoteException;
+import java.util.List;
+import javax.xml.bind.JAXB;
+import org.apache.commons.configuration.ConfigurationException;
 import org.apache.juddi.api_v3.Node;
+import org.apache.juddi.api_v3.NodeDetail;
+import org.apache.juddi.api_v3.NodeList;
 import org.apache.juddi.api_v3.SaveNode;
 import org.apache.juddi.jaxb.PrintJUDDI;
 import org.apache.juddi.v3.client.config.UDDIClerk;
 import org.apache.juddi.v3.client.config.UDDIClient;
 import org.apache.juddi.v3.client.config.UDDIClientContainer;
+import org.apache.juddi.v3.client.config.UDDINode;
 import org.apache.juddi.v3.client.transport.Transport;
+import org.apache.juddi.v3.client.transport.TransportException;
 import org.apache.juddi.v3_service.JUDDIApiPortType;
 import org.uddi.api_v3.AuthToken;
 import org.uddi.api_v3.GetAuthToken;
@@ -34,62 +42,124 @@ import org.uddi.v3_service.UDDISecurityPortType;
  */
 public class JuddiAdminService {
 
-    private static UDDISecurityPortType security = null;
-    private static UDDIPublicationPortType publish = null;
-    static JUDDIApiPortType juddi = null;
-    static UDDIClerk clerk = null;
-
-    public JuddiAdminService() {
-        try {
-            // create a manager and read the config in the archive; 
-            // you can use your config file name
-            UDDIClient clerkManager = new UDDIClient("META-INF/simple-publish-uddi.xml");
-            clerk = clerkManager.getClerk("default");
-            // The transport can be WS, inVM, RMI etc which is defined in the uddi.xml
-            Transport transport = clerkManager.getTransport();
-            // Now you create a reference to the UDDI API
-            security = transport.getUDDISecurityService();
-            publish = transport.getUDDIPublishService();
-            juddi = transport.getJUDDIApiService();
-        } catch (Exception e) {
-            e.printStackTrace();
+        private static UDDISecurityPortType security = null;
+        private static UDDIPublicationPortType publish = null;
+        static JUDDIApiPortType juddi = null;
+        static UDDIClerk clerk = null;
+        static UDDIClient clerkManager = null;
+
+        public JuddiAdminService() {
+                try {
+                        // create a manager and read the config in the archive; 
+                        // you can use your config file name
+                        clerkManager = new UDDIClient("META-INF/simple-publish-uddi.xml");
+                        clerk = clerkManager.getClerk("default");
+                        // The transport can be WS, inVM, RMI etc which is defined in the uddi.xml
+                        Transport transport = clerkManager.getTransport();
+                        // Now you create a reference to the UDDI API
+                        security = transport.getUDDISecurityService();
+                        publish = transport.getUDDIPublishService();
+                        juddi = transport.getJUDDIApiService();
+                } catch (Exception e) {
+                        e.printStackTrace();
+                }
+        }
+
+        static Node getCloudInstance() {
+                Node n = new Node();
+                n.setClientName("juddicloud");
+                n.setName("juddicloud");
+                n.setCustodyTransferUrl("http://uddi-jbossoverlord.rhcloud.com/services/custody-transfer");
+                n.setDescription("juddicloud");
+                n.setProxyTransport("org.apache.juddi.v3.client.transport.JAXWSTransport");
+                n.setInquiryUrl("http://uddi-jbossoverlord.rhcloud.com/services/inquiry");
+                n.setJuddiApiUrl("http://uddi-jbossoverlord.rhcloud.com/services/juddi-api");
+                n.setPublishUrl("http://uddi-jbossoverlord.rhcloud.com/services/publish");
+                n.setSecurityUrl("http://uddi-jbossoverlord.rhcloud.com/services/security");
+                n.setSubscriptionListenerUrl("http://uddi-jbossoverlord.rhcloud.com/services/subscription-listener");
+                n.setSubscriptionUrl("http://uddi-jbossoverlord.rhcloud.com/services/subscription");
+                n.setReplicationUrl("uddi-jbossoverlord.rhcloud.com/services/replication");
+                return n;
+        }
+
+        public void quickRegisterRemoteCloud(String token) {
+                try {
+                        // Setting up the values to get an authentication token for the 'root' user ('root' user has admin privileges
+                        // and can save other publishers).
+                        SaveNode node = new SaveNode();
+                        node.setAuthInfo(token);
+
+                        node.getNode().add(getCloudInstance());
+
+                        PrintJUDDI<SaveNode> p = new PrintJUDDI<SaveNode>();
+                        System.out.println("Before sending");
+                        System.out.println(p.print(node));
+                        juddi.saveNode(node);
+                        System.out.println("Saved");
+
+                } catch (Exception e) {
+                        e.printStackTrace();
+                }
+        }
+
+        void setupReplication() {
+                throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
+        }
+
+        void viewRemoteNodes(String authtoken) throws ConfigurationException, TransportException, RemoteException {
+
+                List<Node> uddiNodeList = clerkManager.getClientConfig().getUDDINodeList();
+                System.out.println();
+                System.out.println("Select a node");
+                for (int i = 0; i < uddiNodeList.size(); i++) {
+                        System.out.print(i + 1);
+                        System.out.println(") " + uddiNodeList.get(i).getName() + uddiNodeList.get(i).getDescription());
+                }
+                System.out.println("Node #: ");
+                int index = Integer.parseInt(System.console().readLine()) - 1;
+                String node = uddiNodeList.get(index).getName();
+                Transport transport = clerkManager.getTransport(node);
+
+                JUDDIApiPortType juddiApiService = transport.getJUDDIApiService();
+
+                NodeList allNodes = juddiApiService.getAllNodes(authtoken);
+                if (allNodes == null || allNodes.getNode().isEmpty()) {
+                        System.out.println("No nodes registered!");
+                } else {
+                        for (int i = 0; i < allNodes.getNode().size(); i++) {
+                                System.out.println("_______________________________________________________________________________");
+                                System.out.println("Name :" + allNodes.getNode().get(i).getName());
+                                System.out.println("Inquiry :" + allNodes.getNode().get(i).getInquiryUrl());
+                                System.out.println("Publish :" + allNodes.getNode().get(i).getPublishUrl());
+                                System.out.println("Securit :" + allNodes.getNode().get(i).getSecurityUrl());
+                                System.out.println("Replication :" + allNodes.getNode().get(i).getReplicationUrl());
+                                System.out.println("Subscription :" + allNodes.getNode().get(i).getSubscriptionUrl());
+                                System.out.println("Custody Xfer :" + allNodes.getNode().get(i).getCustodyTransferUrl());
+
+                        }
+                }
+
         }
-    }
-
-    public void go(String token) {
-        try {
-            // Setting up the values to get an authentication token for the 'root' user ('root' user has admin privileges
-            // and can save other publishers).
-                
-            
-
-          
-            SaveNode node = new SaveNode();
-            node.setAuthInfo(token);
-            Node n = new Node();
-            n.setClientName("juddicloud");
-            n.setName("juddicloud");
-            n.setCustodyTransferUrl("http://uddi-jbossoverlord.rhcloud.com/services/custody-transfer");
-            n.setDescription("juddicloud");
-            n.setProxyTransport("org.apache.juddi.v3.client.transport.JAXWSTransport");
-            n.setInquiryUrl("http://uddi-jbossoverlord.rhcloud.com/services/inquiry");
-            n.setJuddiApiUrl("http://uddi-jbossoverlord.rhcloud.com/services/juddi-api");
-            n.setPublishUrl("http://uddi-jbossoverlord.rhcloud.com/services/publish");
-            n.setSecurityUrl( "http://uddi-jbossoverlord.rhcloud.com/services/security");
-            n.setSubscriptionListenerUrl("http://uddi-jbossoverlord.rhcloud.com/services/subscription-listener");
-            n.setSubscriptionUrl("http://uddi-jbossoverlord.rhcloud.com/services/subscription");
-            node.getNode().add(n);
-            
-            PrintJUDDI<SaveNode> p = new PrintJUDDI<SaveNode>();
-            System.out.println("Before sending");
-            System.out.println(p.print(node));
-            juddi.saveNode(node);
-            System.out.println("Saved");
-         
-            
-
-        } catch (Exception e) {
-            e.printStackTrace();
+
+        void quickRegisterLocalCloud() throws ConfigurationException {
+                UDDINode node = new UDDINode(getCloudInstance());
+                clerkManager.getClientConfig().addUDDINode(node);
+                clerkManager.getClientConfig().saveConfig();
+                System.out.println();
+                System.out.println("Added and saved.");
+        }
+
+        void registerLocalNodeToRemoteNode(String authtoken, Node cfg, Node publishTo) throws Exception {
+             
+                Transport transport = clerkManager.getTransport(publishTo.getName());
+
+                JUDDIApiPortType juddiApiService = transport.getJUDDIApiService();
+                SaveNode sn = new SaveNode();
+                sn.setAuthInfo(authtoken);
+                sn.getNode().add(cfg);
+                NodeDetail saveNode = juddiApiService.saveNode(sn);
+                JAXB.marshal(saveNode, System.out);
+                System.out.println("Success.");
+
         }
-    }
 }

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiFindEndpoints.java
----------------------------------------------------------------------
diff --git a/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiFindEndpoints.java b/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiFindEndpoints.java
index ba5fb41..637b501 100644
--- a/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiFindEndpoints.java
+++ b/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiFindEndpoints.java
@@ -56,7 +56,6 @@ public class UddiFindEndpoints {
 
         public void Fire(String authtoken, String key) {
                 try {
-                        //TODO Key! insert your key here!
                         if (key == null) {
                                 key = "uddi:juddi.apache.org:services-inquiry";
                         }

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiReplication.java
----------------------------------------------------------------------
diff --git a/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiReplication.java b/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiReplication.java
new file mode 100644
index 0000000..4878202
--- /dev/null
+++ b/juddi-examples/more-uddi-samples/src/main/java/org/apache/juddi/samples/UddiReplication.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright 2014 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.juddi.samples;
+
+import java.math.BigInteger;
+import java.rmi.RemoteException;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.xml.ws.BindingProvider;
+import org.apache.juddi.v3.client.UDDIService;
+import org.uddi.repl_v3.ChangeRecord;
+import org.uddi.repl_v3.ChangeRecordIDType;
+import org.uddi.repl_v3.DoPing;
+import org.uddi.repl_v3.HighWaterMarkVectorType;
+import org.uddi.v3_service.UDDIReplicationPortType;
+
+/**
+ *
+ * @author Alex O'Ree
+ */
+class UddiReplication {
+
+        public UddiReplication() {
+        }
+
+        String DoPing(String key2) {
+                try {
+                        UDDIReplicationPortType uddiReplicationPort = new UDDIService().getUDDIReplicationPort();
+                        ((BindingProvider) uddiReplicationPort).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, key2);
+                        String doPing = uddiReplicationPort.doPing(new DoPing());
+                        System.out.println("Ping Success, remote node's id is " + doPing);
+                        return doPing;
+                } catch (Exception ex) {
+                        Logger.getLogger(UddiReplication.class.getName()).log(Level.SEVERE, null, ex);
+                }
+                return null;
+        }
+
+        void GetHighWatermarks(String key2) {
+                try {
+                        UDDIReplicationPortType uddiReplicationPort = new UDDIService().getUDDIReplicationPort();
+                        ((BindingProvider) uddiReplicationPort).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, key2);
+                        List<ChangeRecordIDType> highWaterMarks = uddiReplicationPort.getHighWaterMarks();
+                        System.out.println("Success....");
+                        System.out.println("Node, USN");
+                        for (int i = 0; i < highWaterMarks.size(); i++) {
+                                System.out.println(
+                                     highWaterMarks.get(i).getNodeID() + ", "
+                                     + highWaterMarks.get(i).getOriginatingUSN());
+                        }
+                } catch (Exception ex) {
+                        Logger.getLogger(UddiReplication.class.getName()).log(Level.SEVERE, null, ex);
+                }
+        }
+
+        void GetChangeRecords(String key2, Long record) {
+                try {
+                        UDDIReplicationPortType uddiReplicationPort = new UDDIService().getUDDIReplicationPort();
+                        HighWaterMarkVectorType highWaterMarkVectorType = new HighWaterMarkVectorType();
+                        
+                        
+                        highWaterMarkVectorType.getHighWaterMark().add(new ChangeRecordIDType(DoPing(key2), record));
+                        ((BindingProvider) uddiReplicationPort).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, key2);
+                        List<ChangeRecord> changeRecords = uddiReplicationPort.getChangeRecords("random", null, BigInteger.valueOf(100), highWaterMarkVectorType);
+                        System.out.println("Success...." + changeRecords.size() + " records returned");
+                        System.out.println("Node, USN, type");
+                        for (int i = 0; i < changeRecords.size(); i++) {
+                                System.out.println(
+                                     changeRecords.get(i).getChangeID().getNodeID() + ", "
+                                     + changeRecords.get(i).getChangeID().getOriginatingUSN() + ": "
+                                     + GetChangeType(changeRecords.get(i)));
+                        }
+                } catch (Exception ex) {
+                        Logger.getLogger(UddiReplication.class.getName()).log(Level.SEVERE, null, ex);
+                }
+        }
+
+        private String GetChangeType(ChangeRecord get) {
+                if (get.getChangeRecordAcknowledgement() != null) {
+                        return "ACK";
+                }
+                if (get.getChangeRecordConditionFailed() != null) {
+                        return "ConditionFailed";
+                }
+                if (get.getChangeRecordCorrection() != null) {
+                        return "Correction";
+                }
+                if (get.getChangeRecordDelete() != null) {
+                        return "Deletion";
+                }
+                if (get.getChangeRecordDeleteAssertion() != null) {
+                        return "Delete Assertion";
+                }
+                if (get.getChangeRecordHide() != null) {
+                        return "Hide tmodel";
+                }
+                if (get.getChangeRecordNewData() != null) {
+                        return "New Data";
+                }
+                if (get.getChangeRecordNewDataConditional() != null) {
+                        return "New data conditional";
+                }
+                if (get.getChangeRecordNull() != null) {
+                        return "Null";
+                }
+                if (get.getChangeRecordPublisherAssertion() != null) {
+                        return "New publisher assertion";
+                }
+                return null;
+        }
+
+}

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-gui/src/main/webapp/ajax/assertions.jsp
----------------------------------------------------------------------
diff --git a/juddi-gui/src/main/webapp/ajax/assertions.jsp b/juddi-gui/src/main/webapp/ajax/assertions.jsp
index b5de546..7854912 100644
--- a/juddi-gui/src/main/webapp/ajax/assertions.jsp
+++ b/juddi-gui/src/main/webapp/ajax/assertions.jsp
@@ -44,7 +44,6 @@
         if (msg != null && msg.get() != null) {
             out.write(UddiHub.ToErrorAlert(msg.get()));
         } else if (data == null || data.isEmpty())
-                //TODO revise this
             out.write(UddiHub.ToErrorAlert(ResourceLoader.GetResource(session, "errors.nodatareturned")));
         else {
 

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-gui/src/main/webapp/ajax/copyitem.jsp
----------------------------------------------------------------------
diff --git a/juddi-gui/src/main/webapp/ajax/copyitem.jsp b/juddi-gui/src/main/webapp/ajax/copyitem.jsp
index 656623d..6f09ea6 100644
--- a/juddi-gui/src/main/webapp/ajax/copyitem.jsp
+++ b/juddi-gui/src/main/webapp/ajax/copyitem.jsp
@@ -9,7 +9,7 @@
 
 <%@include  file="../csrf.jsp" %>
 <%
-    //TODO for 3.2.1
+    //TODO for 3.3
     /*if (request.getMethod().equalsIgnoreCase("POST")) {
         UddiHub x = UddiHub.getInstance(application, session);
         out.write(x.copyEntity(request.getParameter("id"),

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddi-tomcat/juddiv3Node2.xml
----------------------------------------------------------------------
diff --git a/juddi-tomcat/juddiv3Node2.xml b/juddi-tomcat/juddiv3Node2.xml
index fac3a83..988eb81 100644
--- a/juddi-tomcat/juddiv3Node2.xml
+++ b/juddi-tomcat/juddiv3Node2.xml
@@ -16,15 +16,18 @@
 			<baseurlsecure>https://localhost:9443/juddiv3</baseurlsecure>
 		</server>
 		<!-- The node Id must be unique when setup in a cluster of UDDI servers implementing the replication API
-			don't worry, jUDDI doesn't implement it right now, but it may come in the future -->
-		<nodeId>uddi:juddi.apache.org:node2</nodeId>
+			don't worry, jUDDI doesn't implement it right now, but it may come in the future 
+			
+			 Per the spec, The value used MUST match the businessKey of the Node Business Entity
+			 -->
+		<nodeId>uddi:another.juddi.apache.org:node2</nodeId>
 		<!-- The key of the root business that all of the UDDI services are registered in, as defined in the install_data -->
 		<root>
 			<!-- this is the 'root' username, or owner of the node -->
 			<publisher>root</publisher>
 			<!-- The key of the root business that all of the UDDI services are registered in, as defined in the install_data -->
-			<businessId>uddi:juddi.apache.org:businesses-asf</businessId>
-			<partition>uddi:juddi.apache.org</partition>
+			<businessId>uddi:another.juddi.apache.org:node2</businessId>
+			<partition>uddi:another.juddi.apache.org</partition>
 		</root>
 		<seed>
 			<always>false</always>
@@ -189,5 +192,9 @@
 				<password encrypted="false">pass</password>-->
 			</smtp>
 		</mail>
+		
+		<logging>
+			<logInquirySearchPayloads>false</logInquirySearchPayloads>
+		</logging>
 	</juddi>
 </config>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/juddiv3-war/src/main/webapp/WEB-INF/classes/juddiv3.xml
----------------------------------------------------------------------
diff --git a/juddiv3-war/src/main/webapp/WEB-INF/classes/juddiv3.xml b/juddiv3-war/src/main/webapp/WEB-INF/classes/juddiv3.xml
index 3468b3d..788fdf1 100644
--- a/juddiv3-war/src/main/webapp/WEB-INF/classes/juddiv3.xml
+++ b/juddiv3-war/src/main/webapp/WEB-INF/classes/juddiv3.xml
@@ -16,7 +16,10 @@
 			<baseurlsecure>https://localhost:8443/juddiv3</baseurlsecure>
 		</server>
 		<!-- The node Id must be unique when setup in a cluster of UDDI servers implementing the replication API
-			don't worry, jUDDI doesn't implement it right now, but it may come in the future -->
+			don't worry, jUDDI doesn't implement it right now, but it may come in the future 
+			
+			 Per the spec, The value used MUST match the businessKey of the Node Business Entity
+			 -->
 		<nodeId>uddi:juddi.apache.org:node1</nodeId>
 		<!-- The key of the root business that all of the UDDI services are registered in, as defined in the install_data -->
 		<root>

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_091_RMISubscriptionListenerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_091_RMISubscriptionListenerIntegrationTest.java b/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_091_RMISubscriptionListenerIntegrationTest.java
index 4e36c5f..a25d29b 100644
--- a/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_091_RMISubscriptionListenerIntegrationTest.java
+++ b/uddi-tck/src/test/java/org/apache/juddi/v3/tck/JUDDI_091_RMISubscriptionListenerIntegrationTest.java
@@ -90,7 +90,6 @@ public class JUDDI_091_RMISubscriptionListenerIntegrationTest {
 
 
                 } catch (Exception e2) {
-                        // TODO Auto-generated catch block
                         e2.printStackTrace();
                         Assert.fail();
                 }

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerIntegrationBase.java
----------------------------------------------------------------------
diff --git a/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerIntegrationBase.java b/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerIntegrationBase.java
index d300523..ef90b62 100644
--- a/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerIntegrationBase.java
+++ b/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_090_SubscriptionListenerIntegrationBase.java
@@ -738,7 +738,7 @@ public abstract class UDDI_090_SubscriptionListenerIntegrationBase {
          * @throws Exception
          */
         @Test
-        @Ignore
+        //@Ignore
         public void joePublisherUpdate_PUBLISHERASSERTION_DETAIL_TO() throws Exception {
                 Assume.assumeTrue(TckPublisher.isEnabled());
                 Assume.assumeNotNull(getHostame());
@@ -781,8 +781,8 @@ public abstract class UDDI_090_SubscriptionListenerIntegrationBase {
                         AddPublisherAssertions pa = new AddPublisherAssertions();
                         pa.setAuthInfo(authInfoMary);
                         PublisherAssertion pas = new PublisherAssertion();
-                        pas.setToKey(TckBusiness.JOE_BUSINESS_KEY);
-                        pas.setFromKey(TckBusiness.MARY_BUSINESS_KEY);
+                        pas.setToKey(TckBusiness.MARY_BUSINESS_KEY);
+                        pas.setFromKey(TckBusiness.JOE_BUSINESS_KEY);
                         pas.setKeyedReference(new KeyedReference(UDDIConstants.RELATIONSHIPS, "parent", "parent-child"));
                         pa.getPublisherAssertion().add(pas);
 

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordDelete.java
----------------------------------------------------------------------
diff --git a/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordDelete.java b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordDelete.java
index ef4ef53..3e70b67 100644
--- a/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordDelete.java
+++ b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordDelete.java
@@ -30,6 +30,11 @@ import javax.xml.datatype.XMLGregorianCalendar;
 
 
 /**
+ * A changeRecordDelete element indicates that an item defined in the UDDI registry is to no longer be used and expunged from the data stores in each of the nodes. The item to be deleted is indicated in the change record by the key of an appropriate entity type; this must contain the unique key of some businessEntity, businessService, bindingTemplate, or tModel that is presently defined.  The changeRecordDelete element for deleting tModels corresponds to the administrative deletion of a tModel described in Section 6.1.3 Updates and Deletions of this specification.  The changeRecordDelete for a tModel does not correspond to any API described in this specification and should only appear in the replication stream as the result of an administrative function to permanently remove a tModel.
+
+Permanent deletions of tModel information within the node may be made administratively. In this event, a UDDI Node may insert a delete operation into the replication stream.  The publisher identifier for this operation is the account associated with the UDDI Node.  Note that a permanent deletion of tModel information from the registry must have the prior approval of the other nodes participating within the registry.
+
+The changeRecordDelete MUST contain a modified timestamp to allow multi-node registries to calculate consistent modifiedIncludingChildren timestamps as described in Section 3.8 operationalInfo Structure.
  * <p>Java class for anonymous complex type.
  * 
  * <p>The following schema fragment specifies the expected content contained within this class.

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordDeleteAssertion.java
----------------------------------------------------------------------
diff --git a/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordDeleteAssertion.java b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordDeleteAssertion.java
index 542058f..09e519a 100644
--- a/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordDeleteAssertion.java
+++ b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordDeleteAssertion.java
@@ -31,6 +31,34 @@ import org.uddi.api_v3.PublisherAssertion;
 
 
 /**
+ * The changeRecordPublisherAssertion element describes the information that UDDI replication MUST convey in order to support the business-to-business relationship definition supported by UDDI. 
+
+An implementation MUST be able to determine the Registry changes from the information transmitted within the replication stream.  The fromBusinessCheck and toBusinessCheck elements are Boolean values that represent which side of the business relationship is being asserted.  A changeRecordPublisherAssertion message may include one or both sides of the relationship.  For example, if the fromBusinessCheck is present and set to "true" then the assertion represents the parent-side of a parent-child relationship.
+* 
+* <br>
+* <img src="http://www.uddi.org/pubs/uddi-v3.0.2-20041019_files/image115.gif">
+* <br>
+* A changeRecordPublisherAssertion element indicates that one or both sides of the business relationship are to be inserted.
+<BR><BR>
+a.       changeRecordPublisherAssertion with:
+<BR><BR>
+&lt;fromBusinessCheck>true</fromBusinessCheck> and &lt;toBusinessCheck>true</toBusinessCheck> is used to indicate that both sides of the publisherAssertion (i.e., business relationship) are to be inserted. The two businessEntity elements that are referred to within the publisherAssertion MUST be in the custody of the node that originates the changeRecord.
+<BR><BR>
+b.      changeRecordPublisherAssertion with:
+<BR><BR>
+&lt;fromBusinessCheck>true</fromBusinessCheck> and &lt;toBusinessCheck>false</toBusinessCheck> is used to indicate that the fromBusinessCheck side of the publisherAssertion (i.e., business relationship) is to be inserted. The businessEntity that is referred to in the fromBusinessCheck MUST be in the custody of the node that originates the changeRecord.
+<BR><BR>
+c.       changeRecordPublisherAssertion with:
+<BR><BR>
+&lt;fromBusinessCheck>false</fromBusinessCheck> and &lt;toBusinessCheck>true</toBusinessCheck> is used to indicate that the toBusinessCheck side of the publisherAssertion (i.e., business relationship) is to be inserted. The businessEntity that is referred to in the toBusinessCheck MUST be in the custody of the node that originates the changeRecord.
+<BR><BR>
+d.      changeRecordPublisherAssertion with:
+<BR><BR>
+&lt;fromBusinessCheck>false</fromBusinessCheck> and &lt;toBusinessCheck>false</toBusinessCheck> if this is received in the replication stream, such a changeRecord will not generate any change to the registry. The node SHOULD log any events such as this.
+<BR><BR>
+The operationalInfo element MUST contain a modified date corresponding to the update for the publisher assertion. This modified date should be stored by nodes supporting the subscription APIs in order to respond to subscription requests involving find_relatedBusinesses and get_assertionStatusReport filters. Since the publisherAssertions corresponding to a relationship may be originated from more than one node, the modified date stored for any relationship corresponding to the publisher should be the most recent date received from any node.
+<BR><BR>
+To handle signed publisherAssertion elements, it is necessary to indicate which set of signatures are being completely replaced as a result of the originating node’s change to update one or both sides of the relationship represented by the publisherAssertion. The optional signature element in the publisherAssertion must be ignored in replication and the toSignatures and fromSignatures elements must be used to replace signatures stored for the publisherAssertion. One of the elements toSignatures, fromSignatures or both must appear in the changeRecordPublisherAssertion. The presence of a toSignatures or fromSignatures element indicates that the signatures associated with the "to" or "from" side of the relationship must be deleted and completely replaced with the Signatures in the toSignatures or fromSignatures element. In the case where a single publisherAssertion represents both sides of the relationship, the node originating the corresponding changeRecordPublisherAssertion must in
 clude both a toSignatures and fromSignatures element with the identical set of Signature elements in both the toSignatures and fromSignatures. When the toSignatures element is not present, no changes are made to the signature elements associated with the "to" side of the relationship in the node. Similarily, when the fromSignatures element is not present, no changes are made to the signature elements associated with the "from" side of the relationship in the node.
  * <p>Java class for anonymous complex type.
  * 
  * <p>The following schema fragment specifies the expected content contained within this class.

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordHide.java
----------------------------------------------------------------------
diff --git a/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordHide.java b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordHide.java
index 1fd75d6..86f4a13 100644
--- a/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordHide.java
+++ b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordHide.java
@@ -30,6 +30,9 @@ import javax.xml.datatype.XMLGregorianCalendar;
 
 
 /**
+ * A changeRecordHide element corresponds to the behavior of hiding a tModel described in the delete_tModel in the Publish API section of this Specification.  A tModel listed in a changeRecordHide should be marked as hidden, so that it is not returned in response to a find_tModel API call.
+
+The changeRecordHide MUST contain a modified timestamp to allow multi-node registries to calculate consistent modifiedIncludingChildren timestamps as described in Section 3.8 operationalInfo Structure.
  * <p>Java class for anonymous complex type.
  * 
  * <p>The following schema fragment specifies the expected content contained within this class.

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordIDType.java
----------------------------------------------------------------------
diff --git a/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordIDType.java b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordIDType.java
index 6c2c595..97461f5 100644
--- a/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordIDType.java
+++ b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordIDType.java
@@ -61,6 +61,19 @@ public class ChangeRecordIDType implements Serializable {
         public ChangeRecordIDType() {
         }
 
+        /**
+         * 
+         * @param node owning node of the item/source of request
+         * @param oUSN Each node SHALL maintain a strictly increasing register known as its Originating Update Sequence Number (USN).  An originating USN is assigned to a change record at its creation by a node. The originating USN SHALL NEVER decrease in value, even in the face of system crashes and restarts. UDDI nodes MUST NOT rely on an originating USN sequence increasing monotonically by a value of "1".  Gaps in a node's originating USN sequence MUST be allowed for as they are likely to occur in the face of system crashes and restarts.
+
+While processing changes to the Registry as a result of performing UDDI Replication, all replicated data MUST be assigned an additional unique and locally generated USN register value – a local USN. 
+
+The originating and local USN registers MUST be sufficiently large such that register rollover is not a concern. For this purpose, UDDI nodes MUST implement a USN of exactly 63 bits in size.
+
+Note that it is semantically meaningless to compare USNs that have been generated on different nodes; only USNs generated on the same node may be meaningfully compared to each other.
+
+NO change record MAY have a USN equal to 0 (zero).  
+         */
         public ChangeRecordIDType(String node, Long oUSN) {
                 originatingUSN = oUSN;
                 nodeID = node;

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordNewData.java
----------------------------------------------------------------------
diff --git a/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordNewData.java b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordNewData.java
index 3938581..7807e90 100644
--- a/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordNewData.java
+++ b/uddi-ws/src/main/java/org/uddi/repl_v3/ChangeRecordNewData.java
@@ -34,6 +34,12 @@ import org.uddi.api_v3.TModel;
 
 
 /**
+ * <img src="http://www.uddi.org/pubs/uddi-v3.0.2-20041019_files/image112.gif"><Br>
+ * A changeRecordNewData MUST not be empty; it must contain a valid semantic piece of new data. Change records of this type provide new or updated business or modeling information that is to be incorporated. Partial updates to a datum are not provided for; rather, the entire new contents of the datum and its operationalInfo are to be provided, and these replace any existing definition of the datum and its operationalInfo with the recipient of the change record. The hidden state (i.e. the deleted attribute) must be persisted through replication to allow for a custody transfer of hidden tModels between nodes via the replication protocol.
+
+The operationalInfo element MUST contain the operational information associated with the indicated new data. No validation other than schema assessment and presence requirements are performed by the consuming node. Specifically, the creation date may change; the creation date need not be earlier than the modification date; the modification date need not be earlier than the modified including children date.
+
+A changeRecordNewData is considered "successfully processed" once a node has received it, assigned a local USN to it, validated it, durably stored it in its change record journal, and then successfully incorporated it into the node’s data store.
  * <p>Java class for anonymous complex type.
  * 
  * <p>The following schema fragment specifies the expected content contained within this class.

http://git-wip-us.apache.org/repos/asf/juddi/blob/8b95902b/uddi-ws/src/main/java/org/uddi/v3_service/UDDIReplicationPortType.java
----------------------------------------------------------------------
diff --git a/uddi-ws/src/main/java/org/uddi/v3_service/UDDIReplicationPortType.java b/uddi-ws/src/main/java/org/uddi/v3_service/UDDIReplicationPortType.java
index 4effd0d..33f5416 100644
--- a/uddi-ws/src/main/java/org/uddi/v3_service/UDDIReplicationPortType.java
+++ b/uddi-ws/src/main/java/org/uddi/v3_service/UDDIReplicationPortType.java
@@ -107,6 +107,25 @@ public interface UDDIReplicationPortType extends Remote {
      * changeRecords element. Under all circumstances, all change records
      * returned therein by the message recipient MUST be returned sorted in
      * increasing order according to the recipient’s local USN.</p>
+     * 
+     * <p><b>A node that is ready to initiate replication of change records held
+     * at another node within the registry uses the get_changeRecords message.  
+     * Part of the message is a high water mark vector that contains for each 
+     * node of the registry the originating USN of the most recent change record
+     * that has been successfully processed by the invocating node. The effect 
+     * of receiving a get_changeRecords message causes a node to return to the 
+     * calling node change records it has generated locally and processed from 
+     * other nodes constrained by the directives of the high water mark vector 
+     * specified. As such, by invoking get_changeRecords a node obtains from its
+     * adjacent node all change records (constrained by the high water mark 
+     * vector) the adjacent node has generated locally or successfully processed
+     * from other nodes participating in the replication topology. What 
+     * constitutes an adjacent node is governed by the replication communication
+     * graph. Replication topology is controlled via a Replication Configuration
+     * Structure. Amongst other parameters, the Replication Configuration 
+     * Structure identifies one unique URL to represent the replication point, 
+     * soapReplicationURL, of each of the nodes of the registry. 
+     * </b></p>
      *
      * @param responseLimitVector responseLimitCount or responseLimitVector: A
      * caller MAY place an upper bound on the number of change records he wishes


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