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 2015/01/08 01:44:51 UTC
[8/8] juddi git commit: JUDDI-241 fixing several issues with
publisher assertions JUDDI-256 updating the tck to fire up two nodes,
setup synchronization, then perform a custody transfer JUDDI-905 done for now,
reports transactions/second for a number of
JUDDI-241 fixing several issues with publisher assertions
JUDDI-256 updating the tck to fire up two nodes, setup synchronization, then perform a custody transfer
JUDDI-905 done for now, reports transactions/second for a number of basic save/delete operations
JUDDI-906 tck now fires up two nodes, replication is working yet, but needs some additional test cases
JUDDI-907 service code is in place, still need a ui component and test cases
JUDDI-908 functionality fixed, test case still needed
Project: http://git-wip-us.apache.org/repos/asf/juddi/repo
Commit: http://git-wip-us.apache.org/repos/asf/juddi/commit/d7195270
Tree: http://git-wip-us.apache.org/repos/asf/juddi/tree/d7195270
Diff: http://git-wip-us.apache.org/repos/asf/juddi/diff/d7195270
Branch: refs/heads/master
Commit: d7195270482912abf42a29e2ed7b647dd5cb910a
Parents: 40b1d67
Author: Alex <al...@apache.org>
Authored: Wed Jan 7 19:44:32 2015 -0500
Committer: Alex <al...@apache.org>
Committed: Wed Jan 7 19:44:32 2015 -0500
----------------------------------------------------------------------
.../org/apache/juddi/api/impl/JUDDIApiImpl.java | 53 +
.../juddi/api/impl/UDDIPublicationImpl.java | 164 +-
.../juddi/api/impl/UDDIReplicationImpl.java | 190 +-
.../org/apache/juddi/api/util/JUDDIQuery.java | 3 +-
.../java/org/apache/juddi/config/AppConfig.java | 23 +-
.../apache/juddi/mapping/MappingApiToModel.java | 17 +
.../apache/juddi/mapping/MappingModelToApi.java | 2 +-
.../juddi/replication/ReplicationNotifier.java | 5 +
.../org/apache/juddi/rmi/JUDDIApiService.java | 10 +-
.../juddi/validation/ValidatePublish.java | 7 +
.../src/main/resources/messages.properties | 4 +-
.../apache/juddi/api/runtime/juddiTestimpl.java | 8 +
.../org/apache/juddi/samples/EntryPoint.java | 3 +
.../apache/juddi/samples/JuddiAdminService.java | 41 +-
pom.xml | 2 +-
.../org/apache/juddi/v3/tck/TckPublisher.java | 8 +
.../java/org/apache/juddi/tckrunner/App.java | 7 +-
uddi-tck-runner/tck.properties | 8 +-
uddi-tck-runner/uddi.xml | 28 +
uddi-tck/context.xml | 30 +
.../juddi_install_data_node2/UDDI_Publisher.xml | 22 +
.../juddi_install_data_node2/UDDI_tModels.xml | 2362 ++++++++++++++++++
.../root_BusinessEntity.xml | 668 +++++
.../juddi_install_data_node2/root_Publisher.xml | 21 +
.../root_tModelKeyGen.xml | 40 +
uddi-tck/juddiv3Node1.xml | 200 ++
uddi-tck/juddiv3Node2.xml | 200 ++
uddi-tck/pom.xml | 134 +-
uddi-tck/serverNode2.xml | 144 ++
uddi-tck/src/main/resources/META-INF/uddi.xml | 31 +
.../tck/JUDDI_010_PublisherIntegrationTest.java | 1 +
..._RMISubscriptionListenerIntegrationTest.java | 1 +
...0_ClientSubscriptionInfoIntegrationTest.java | 1 +
...tSubscriptionCallbackAPIIntegrationTest.java | 1 +
.../v3/tck/JUDDI_200_GUI_IntegrationTest.java | 4 +-
.../tck/JUDDI_300_MultiNodeIntegrationTest.java | 457 ++++
.../tck/UDDI_010_PublisherIntegrationTest.java | 1 +
.../v3/tck/UDDI_020_TmodelIntegrationTest.java | 14 +-
.../UDDI_030_BusinessEntityIntegrationTest.java | 1 +
...UDDI_040_BusinessServiceIntegrationTest.java | 1 +
.../UDDI_040_PerformanceIntegrationTest.java | 1 +
...UDDI_050_BindingTemplateIntegrationTest.java | 1 +
...I_060_PublisherAssertionIntegrationTest.java | 1 +
.../tck/UDDI_070_FindEntityIntegrationTest.java | 1 +
.../UDDI_080_SubscriptionIntegrationTest.java | 1 +
.../juddi/v3/tck/UDDI_090_HttpExternalTest.java | 6 +
.../tck/UDDI_090_HttpMavenIntegrationTest.java | 9 +-
.../v3/tck/UDDI_090_RMIIntegrationTest.java | 5 +
.../v3/tck/UDDI_090_Smtp_ExternalTest.java | 13 +-
...090_SubscriptionListenerIntegrationBase.java | 17 +
.../UDDI_110_FindBusinessIntegrationTest.java | 1 +
...eCategoryBagsFindServiceIntegrationTest.java | 1 +
...CategoryBagsFindBusinessIntegrationTest.java | 1 +
..._140_NegativePublicationIntegrationTest.java | 1 +
.../v3/tck/UDDI_141_JIRAIntegrationTest.java | 1 +
...DDI_142_DigitalSignatureIntegrationTest.java | 1 +
...UDDI_150_CustodyTransferIntegrationTest.java | 1 +
.../v3/tck/UDDI_160_RESTIntergrationTest.java | 40 +-
...I_170_ValueSetValidationIntegrationTest.java | 1 +
uddi-tck/uddiNode2.xml | 134 +
.../api_v3/AdminDeleteSubscriptionRequest.java | 17 +-
.../api_v3/AdminDeleteSubscriptionResponse.java | 17 +-
.../apache/juddi/api_v3/AdminSaveBusiness.java | 17 +-
.../juddi/api_v3/AdminSaveBusinessResponse.java | 17 +-
.../juddi/api_v3/AdminSaveBusinessWrapper.java | 17 +-
.../api_v3/AdminSaveSubscriptionRequest.java | 17 +-
.../api_v3/AdminSaveSubscriptionResponse.java | 17 +-
.../apache/juddi/api_v3/AdminSaveTModel.java | 17 +-
.../juddi/api_v3/AdminSaveTModelResponse.java | 17 +-
.../juddi/api_v3/AdminSaveTModelWrapper.java | 17 +-
.../java/org/apache/juddi/api_v3/ClerkList.java | 17 +-
.../org/apache/juddi/api_v3/DeleteClerk.java | 17 +-
.../org/apache/juddi/api_v3/DeleteNode.java | 17 +-
.../org/apache/juddi/api_v3/GetAllClerks.java | 17 +-
.../juddi/api_v3/GetAllClerksResponse.java | 17 +-
.../api_v3/GetAllClientSubscriptionInfo.java | 17 +-
.../GetAllClientSubscriptionInfoResponse.java | 17 +-
.../org/apache/juddi/api_v3/GetAllNodes.java | 17 +-
.../juddi/api_v3/GetAllNodesResponse.java | 17 +-
.../juddi/api_v3/GetAllPublisherDetail.java | 17 +-
.../api_v3/GetEntityHistoryMessageRequest.java | 140 ++
.../api_v3/GetEntityHistoryMessageResponse.java | 78 +
.../juddi/api_v3/GetReplicationNodes.java | 17 +-
.../api_v3/GetReplicationNodesResponse.java | 17 +-
.../java/org/apache/juddi/api_v3/NodeList.java | 17 +-
.../org/apache/juddi/api_v3/ObjectFactory.java | 1556 ++++++------
.../juddi/api_v3/SetReplicationNodes.java | 17 +-
.../api_v3/SetReplicationNodesResponse.java | 17 +-
.../juddi/api_v3/SubscriptionWrapper.java | 17 +-
.../org/apache/juddi/api_v3/ValidValues.java | 17 +-
.../juddi/v3_service/JUDDIApiPortType.java | 23 +-
.../java/org/uddi/repl_v3/ChangeRecordHide.java | 2 +-
.../repl_v3/ChangeRecordPublisherAssertion.java | 6 +-
.../java/org/uddi/repl_v3/ObjectFactory.java | 151 +-
.../java/org/uddi/repl_v3/package-info.java | 39 +-
uddi-ws/src/main/resources/juddi_api_v1.wsdl | 60 +-
96 files changed, 6604 insertions(+), 1064 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/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 95dddbe..5693682 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
@@ -55,6 +55,8 @@ import org.apache.juddi.api_v3.DeletePublisher;
import org.apache.juddi.api_v3.GetAllClientSubscriptionInfoDetail;
import org.apache.juddi.api_v3.GetAllPublisherDetail;
import org.apache.juddi.api_v3.GetClientSubscriptionInfoDetail;
+import org.apache.juddi.api_v3.GetEntityHistoryMessageRequest;
+import org.apache.juddi.api_v3.GetEntityHistoryMessageResponse;
import org.apache.juddi.api_v3.GetPublisherDetail;
import org.apache.juddi.api_v3.NodeDetail;
import org.apache.juddi.api_v3.NodeList;
@@ -72,12 +74,14 @@ 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.ChangeRecord;
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.Tmodel;
import org.apache.juddi.model.UddiEntityPublisher;
+import org.apache.juddi.replication.ReplicationNotifier;
import org.apache.juddi.subscription.NotificationList;
import org.apache.juddi.v3.client.transport.Transport;
import org.apache.juddi.v3.error.ErrorMessage;
@@ -106,6 +110,8 @@ import org.uddi.api_v3.SaveBusiness;
import org.uddi.api_v3.SaveTModel;
import org.uddi.api_v3.TModelInfo;
import org.uddi.api_v3.TModelInfos;
+import org.uddi.repl_v3.ChangeRecordDelete;
+import org.uddi.repl_v3.ChangeRecords;
import org.uddi.repl_v3.CommunicationGraph;
import org.uddi.repl_v3.Operator;
import org.uddi.repl_v3.OperatorStatusType;
@@ -422,6 +428,8 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
for (String entityKey : entityKeyList) {
Object obj = em.find(org.apache.juddi.model.Tmodel.class, entityKey);
em.remove(obj);
+ ChangeRecord cr =UDDIPublicationImpl.getChangeRecord_deleteTModelDelete(entityKey, node);
+ ReplicationNotifier.Enqueue(cr);
}
tx.commit();
@@ -1526,4 +1534,49 @@ public class JUDDIApiImpl extends AuthenticatedService implements JUDDIApiPortTy
}
}
+
+ @Override
+ public GetEntityHistoryMessageResponse getEntityHistory(GetEntityHistoryMessageRequest body) throws DispositionReportFaultMessage, RemoteException {
+ long startTime = System.currentTimeMillis();
+ EntityManager em = PersistenceManager.getEntityManager();
+ EntityTransaction tx = em.getTransaction();
+ try {
+ tx.begin();
+ UddiEntityPublisher requestor = this.getEntityPublisher(em, body.getAuthInfo());
+ if (!((Publisher) requestor).isAdmin()) {
+ throw new UserMismatchException(new ErrorMessage("errors.AdminReqd"));
+ }
+ if (body.getMaxRecords()<=0)
+ body.setMaxRecords(20);
+ if (body.getOffset() < 0)
+ body.setOffset(0);
+ Query createQuery = em.createQuery("select m from ChangeRecord m where m.entityKey = :key order by m.id DESC");
+ createQuery.setMaxResults((int) body.getMaxRecords());
+ createQuery.setParameter("key", body.getEntityKey());
+ createQuery.setFirstResult((int)body.getOffset());
+ List<ChangeRecord> resultList = createQuery.getResultList();
+ GetEntityHistoryMessageResponse res = new GetEntityHistoryMessageResponse();
+ res.setChangeRecords(new ChangeRecords());
+ for (ChangeRecord cr : resultList) {
+ res.getChangeRecords().getChangeRecord().add(MappingModelToApi.mapChangeRecord(cr));
+ }
+
+ tx.rollback();
+ long procTime = System.currentTimeMillis() - startTime;
+ serviceCounter.update(JUDDIQuery.ADMIN_GET_HISTORY,
+ QueryStatus.SUCCESS, procTime);
+ return res;
+ } catch (DispositionReportFaultMessage drfm) {
+ long procTime = System.currentTimeMillis() - startTime;
+ serviceCounter.update(JUDDIQuery.ADMIN_GET_HISTORY,
+ QueryStatus.FAILED, procTime);
+ throw drfm;
+
+ } finally {
+ if (tx.isActive()) {
+ tx.rollback();
+ }
+ em.close();
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/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 10ba3c4..63c77ba 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
@@ -21,10 +21,7 @@ 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.logging.Level;
-import java.util.logging.Logger;
import javax.jws.WebService;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
@@ -89,9 +86,9 @@ 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 sun.util.BuddhistCalendar;
/**
* This class implements the UDDI Publication Service
@@ -337,8 +334,28 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
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));
+ org.apache.juddi.model.PublisherAssertion modelPubAssertion = new org.apache.juddi.model.PublisherAssertion();
+
+ MappingApiToModel.mapPublisherAssertion(entity, modelPubAssertion);
+
+ org.apache.juddi.model.PublisherAssertion existingPubAssertion = em.find(org.apache.juddi.model.PublisherAssertion.class,
+ modelPubAssertion.getId());
+
+ boolean fromkey = publisher.isOwner(em.find(BusinessEntity.class, entity.getFromKey()));
+ boolean tokey = publisher.isOwner(em.find(BusinessEntity.class, entity.getToKey()));
+ if (fromkey)
+ existingPubAssertion.setFromCheck("false");
+ if (tokey)
+ existingPubAssertion.setToCheck("false");
+ if ("false".equalsIgnoreCase(existingPubAssertion.getToCheck())
+ && "false".equalsIgnoreCase(existingPubAssertion.getFromCheck()))
+ em.remove(existingPubAssertion);
+ else {
+ existingPubAssertion.setModified(new Date());
+ em.persist(existingPubAssertion);
+ }
+
+ changes.add(getChangeRecord_deletePublisherAssertion(entity, node, fromkey, tokey, existingPubAssertion.getModified().getTime()));
}
tx.commit();
@@ -362,16 +379,42 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
/**
* deletes the referenced object, assuming authorization rules are
- * already processed and there is already an open transaction
+ * already processed and there is already an open transaction. this is primarily used
+ * to support replication calls, i.e. another node just changed a PA record and let us know
*
* @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);
+ protected void deletePublisherAssertion(org.uddi.repl_v3.ChangeRecordDeleteAssertion entity, EntityManager em) throws DispositionReportFaultMessage {
+
+ org.apache.juddi.model.PublisherAssertion modelPubAssertion = new org.apache.juddi.model.PublisherAssertion();
+
+ MappingApiToModel.mapPublisherAssertion(entity.getPublisherAssertion(), modelPubAssertion);
+
+ org.apache.juddi.model.PublisherAssertion existingPubAssertion = em.find(org.apache.juddi.model.PublisherAssertion.class,
+ modelPubAssertion.getId());
+
+ if (existingPubAssertion==null){
+ log.fatal("Can't delete a Publisher Assertion that isn't persisted int the database!");
+ return;
+ }
+ boolean fromkey = entity.isFromBusinessCheck();// publisher.isOwner(em.find(BusinessEntity.class, entity.getFromKey()));
+ boolean tokey = entity.isToBusinessCheck();// publisher.isOwner(em.find(BusinessEntity.class, entity.getToKey()));
+ if (fromkey) {
+ existingPubAssertion.setFromCheck("false");
+ }
+ if (tokey) {
+ existingPubAssertion.setToCheck("false");
+ }
+ if ("false".equalsIgnoreCase(existingPubAssertion.getToCheck())
+ && "false".equalsIgnoreCase(existingPubAssertion.getFromCheck())) {
+ em.remove(existingPubAssertion);
+ } else {
+ existingPubAssertion.setModified(new Date());
+ em.persist(existingPubAssertion);
+ }
+
}
public void deleteService(DeleteService body)
@@ -423,10 +466,17 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
*/
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);
+ //((org.apache.juddi.model.BusinessService) obj).getBusinessEntity().setModifiedIncludingChildren(new Date());
+ if (obj!=null)
+ em.remove(obj);
+ else
+ logger.warn("Unable to remove service with the key '" + key +"', it doesn't exist in the database");
}
+ /**
+ * {@inheritDoc }
+ */
+ @Override
public void deleteTModel(DeleteTModel body)
throws DispositionReportFaultMessage {
long startTime = System.currentTimeMillis();
@@ -445,7 +495,7 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
List<ChangeRecord> changes = new ArrayList<ChangeRecord>();
for (String entityKey : entityKeyList) {
deleteTModel(entityKey, em);
- changes.add(getChangeRecord_deleteTModel(entityKey, node));
+ changes.add(getChangeRecord_deleteTModelHide(entityKey, node));
}
tx.commit();
@@ -480,6 +530,10 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
((org.apache.juddi.model.Tmodel) obj).setDeleted(true);
}
+ /**
+ * {@inheritDoc }
+ */
+ @Override
public List<AssertionStatusItem> getAssertionStatusReport(String authInfo,
CompletionStatus completionStatus)
throws DispositionReportFaultMessage {
@@ -557,6 +611,10 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
}
}
+ /**
+ * {@inheritdoc}
+ *
+ */
public RegisteredInfo getRegisteredInfo(GetRegisteredInfo body)
throws DispositionReportFaultMessage {
long startTime = System.currentTimeMillis();
@@ -634,6 +692,10 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
}
}
+ /**
+ * {@inheritdoc}
+ *
+ */
public BindingDetail saveBinding(SaveBinding body)
throws DispositionReportFaultMessage {
long startTime = System.currentTimeMillis();
@@ -695,6 +757,10 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
}
}
+ /**
+ * {@inheritdoc}
+ *
+ */
public BusinessDetail saveBusiness(SaveBusiness body)
throws DispositionReportFaultMessage {
long startTime = System.currentTimeMillis();
@@ -762,6 +828,10 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
}
}
+ /**
+ * {@inheritdoc}
+ *
+ */
public ServiceDetail saveService(SaveService body)
throws DispositionReportFaultMessage {
long startTime = System.currentTimeMillis();
@@ -793,8 +863,9 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
em.persist(modelBusinessService);
result.getBusinessService().add(apiBusinessService);
- changes.add(getChangeRecord(modelBusinessService, apiBusinessService, node));
+
validator.validateSaveServiceMax(em, modelBusinessService.getBusinessEntity().getEntityKey());
+ changes.add(getChangeRecord(modelBusinessService, apiBusinessService, node));
}
tx.commit();
@@ -819,6 +890,11 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
}
}
+ /**
+ * {@inheritdoc}
+ *
+ */
+ @Override
public TModelDetail saveTModel(SaveTModel body)
throws DispositionReportFaultMessage {
long startTime = System.currentTimeMillis();
@@ -873,6 +949,10 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
}
}
+ /**
+ * {@inheritdoc}
+ *
+ */
@Override
public void setPublisherAssertions(String authInfo,
Holder<List<PublisherAssertion>> publisherAssertion)
@@ -1184,20 +1264,56 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
return cr;
}
- public static ChangeRecord getChangeRecord_deleteTModel(String entityKey, String node) {
+ /**
+ * this is for "hiding" a tmodel, not removing it entirely
+ * @param entityKey
+ * @param node
+ * @return
+ */
+ public static ChangeRecord getChangeRecord_deleteTModelHide(String entityKey, String node) {
ChangeRecord cr = new ChangeRecord();
cr.setEntityKey(entityKey);
cr.setNodeID(node);
-
cr.setRecordType(ChangeRecord.RecordType.ChangeRecordHide);
org.uddi.repl_v3.ChangeRecord crapi = new org.uddi.repl_v3.ChangeRecord();
crapi.setChangeID(new ChangeRecordIDType(node, -1L));
+
crapi.setChangeRecordHide(new ChangeRecordHide());
crapi.getChangeRecordHide().setTModelKey(entityKey);
crapi.getChangeRecordHide().setModified(df.newXMLGregorianCalendar(new GregorianCalendar()));
StringWriter sw = new StringWriter();
JAXB.marshal(crapi, sw);
+ //JAXB.marshal(crapi, System.out);
+ try {
+ cr.setContents(sw.toString().getBytes("UTF8"));
+ } catch (UnsupportedEncodingException ex) {
+ logger.error(ex);
+ }
+ return cr;
+ }
+
+ /**
+ * this is for deleting a tmodel, not hiding it
+ * @param entityKey
+ * @param node
+ * @return
+ */
+ public static ChangeRecord getChangeRecord_deleteTModelDelete(String entityKey, String node) {
+ ChangeRecord cr = new ChangeRecord();
+ cr.setEntityKey(entityKey);
+ cr.setNodeID(node);
+ cr.setRecordType(ChangeRecord.RecordType.ChangeRecordHide);
+ org.uddi.repl_v3.ChangeRecord crapi = new org.uddi.repl_v3.ChangeRecord();
+ crapi.setChangeID(new ChangeRecordIDType(node, -1L));
+
+ crapi.setChangeRecordDelete(new ChangeRecordDelete());
+ crapi.getChangeRecordDelete().setTModelKey(entityKey);
+ crapi.getChangeRecordDelete().setModified(df.newXMLGregorianCalendar(new GregorianCalendar()));
+
+ StringWriter sw = new StringWriter();
+ JAXB.marshal(crapi, sw);
+ //JAXB.marshal(crapi, System.out);
try {
cr.setContents(sw.toString().getBytes("UTF8"));
} catch (UnsupportedEncodingException ex) {
@@ -1230,14 +1346,18 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
public static ChangeRecord getChangeRecord(Tmodel modelBusinessEntity, org.uddi.api_v3.TModel apiBusinessEntity, String node) throws DispositionReportFaultMessage {
ChangeRecord cr = new ChangeRecord();
+ if (!apiBusinessEntity.getTModelKey().equals(modelBusinessEntity.getEntityKey()))
+ throw new FatalErrorException(new ErrorMessage("E_fatalError", "the model and api keys do not match when saving a tmodel!"));
cr.setEntityKey(modelBusinessEntity.getEntityKey());
cr.setNodeID(node);
+
cr.setRecordType(ChangeRecord.RecordType.ChangeRecordNewData);
org.uddi.repl_v3.ChangeRecord crapi = new org.uddi.repl_v3.ChangeRecord();
crapi.setChangeID(new ChangeRecordIDType(node, -1L));
crapi.setChangeRecordNewData(new ChangeRecordNewData());
crapi.getChangeRecordNewData().setTModel(apiBusinessEntity);
+ crapi.getChangeRecordNewData().getTModel().setTModelKey(modelBusinessEntity.getEntityKey());
crapi.getChangeRecordNewData().setOperationalInfo(new OperationalInfo());
MappingModelToApi.mapOperationalInfo(modelBusinessEntity, crapi.getChangeRecordNewData().getOperationalInfo());
StringWriter sw = new StringWriter();
@@ -1272,7 +1392,7 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
return cr;
}
- public static ChangeRecord getChangeRecord_deletePublisherAssertion(PublisherAssertion entity, String node) {
+ public static ChangeRecord getChangeRecord_deletePublisherAssertion(PublisherAssertion entity, String node, boolean ToBusinessDelete, boolean FromBusinessDelete, long timestamp) {
ChangeRecord cr = new ChangeRecord();
cr.setNodeID(node);
@@ -1281,8 +1401,12 @@ public class UDDIPublicationImpl extends AuthenticatedService implements UDDIPub
org.uddi.repl_v3.ChangeRecord crapi = new org.uddi.repl_v3.ChangeRecord();
crapi.setChangeID(new ChangeRecordIDType(node, -1L));
crapi.setChangeRecordDeleteAssertion(new ChangeRecordDeleteAssertion());
-
- crapi.getChangeRecordDeleteAssertion().setModified(df.newXMLGregorianCalendar(new GregorianCalendar()));
+ crapi.getChangeRecordDeleteAssertion().setPublisherAssertion(entity);
+ crapi.getChangeRecordDeleteAssertion().setToBusinessCheck(ToBusinessDelete);
+ crapi.getChangeRecordDeleteAssertion().setFromBusinessCheck(FromBusinessDelete);
+ GregorianCalendar gcal = new GregorianCalendar();
+ gcal.setTimeInMillis(timestamp);
+ crapi.getChangeRecordDeleteAssertion().setModified(df.newXMLGregorianCalendar(gcal));
StringWriter sw = new StringWriter();
JAXB.marshal(crapi, sw);
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/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 cba57fc..fbecd3b 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
@@ -16,6 +16,7 @@
*/
package org.apache.juddi.api.impl;
+import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.rmi.RemoteException;
@@ -37,6 +38,7 @@ import javax.jws.soap.SOAPBinding;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.Query;
+import javax.xml.bind.JAXB;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.ws.BindingProvider;
import org.apache.commons.configuration.ConfigurationException;
@@ -62,15 +64,12 @@ 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.v3.error.TransferNotAllowedException;
-import org.apache.juddi.validation.ValidateCustodyTransfer;
import org.apache.juddi.validation.ValidateReplication;
import org.uddi.api_v3.OperationalInfo;
-import org.uddi.custody_v3.DiscardTransferToken;
import org.uddi.custody_v3.TransferEntities;
import org.uddi.repl_v3.ChangeRecord;
import org.uddi.repl_v3.ChangeRecordAcknowledgement;
import org.uddi.repl_v3.ChangeRecordIDType;
-import org.uddi.repl_v3.ChangeRecordNewData;
import org.uddi.repl_v3.ChangeRecords;
import org.uddi.repl_v3.DoPing;
import org.uddi.repl_v3.GetChangeRecords;
@@ -119,14 +118,14 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
Set<String> addedNodes = diffNodeList(oldnodes, newNodes);
if (queue == null) {
- queue = new ConcurrentLinkedQueue<NotifyChangeRecordsAvailable>();
+ queue = new ConcurrentLinkedQueue<String>();
}
for (String s : addedNodes) {
if (!s.equals(node)) {
logger.info("This node: " + node + ". New replication node queue for synchronization: " + s);
- HighWaterMarkVectorType highWaterMarkVectorType = new HighWaterMarkVectorType();
- highWaterMarkVectorType.getHighWaterMark().add(new ChangeRecordIDType(s, 0L));
- queue.add(new NotifyChangeRecordsAvailable(s, highWaterMarkVectorType));
+ //HighWaterMarkVectorType highWaterMarkVectorType = new HighWaterMarkVectorType();
+ //highWaterMarkVectorType.getHighWaterMark().add(new ChangeRecordIDType(s, 0L));
+ queue.add(s);
}
}
@@ -146,21 +145,31 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
return ret;
}
+ /**
+ * returns items in "newNodes" that are not in "oldNodes"
+ *
+ * @param oldnodes
+ * @param newNodes
+ * @return
+ */
private static Set<String> diffNodeList(Set<String> oldnodes, Set<String> newNodes) {
Set<String> diff = new HashSet<String>();
- Iterator<String> iterator = null;
- /*oldnodes.iterator();
- while (iterator.hasNext()){
- String lhs=iterator.next();
- if (!newNodes.contains(lhs))
- diff.add(lhs);
- }*/
- iterator = newNodes.iterator();
+ Iterator<String> iterator = newNodes.iterator();
while (iterator.hasNext()) {
String lhs = iterator.next();
- if (!oldnodes.contains(lhs)) {
+ Iterator<String> iterator1 = oldnodes.iterator();
+ boolean found = false;
+ while (iterator1.hasNext()) {
+ String rhs = iterator1.next();
+ if (rhs.equalsIgnoreCase(lhs)) {
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
diff.add(lhs);
}
+
}
return diff;
}
@@ -168,7 +177,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
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 startBuffer = 5000l;//AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_START_BUFFER, 20000l); // 20s startup delay default
private long interval = 5000l;// AppConfig.getConfiguration().getLong(Property.JUDDI_NOTIFICATION_INTERVAL, 300000l); //5 min default
private static UDDIPublicationImpl pub = null;
@@ -191,7 +200,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
private synchronized void Init() {
if (queue == null) {
- queue = new ConcurrentLinkedQueue<NotifyChangeRecordsAvailable>();
+ queue = new ConcurrentLinkedQueue<String>();
}
timer = new PullTimerTask();
@@ -231,11 +240,11 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
}
//ok someone told me there's a change available
while (!queue.isEmpty()) {
- NotifyChangeRecordsAvailable poll = queue.poll();
- if (poll != null) {
- UDDIReplicationPortType replicationClient = getReplicationClient(poll.getNotifyingNode());
+ String poll = queue.poll();
+ if (poll != null && !poll.equalsIgnoreCase(node)) {
+ UDDIReplicationPortType replicationClient = getReplicationClient(poll);
if (replicationClient == null) {
- logger.fatal("unable to obtain a replication client to node " + poll.getNotifyingNode());
+ logger.fatal("unable to obtain a replication client to node " + poll);
} else {
try {
//get the high water marks for this node
@@ -246,23 +255,27 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
// logger.info("Node " + poll.getChangesAvailable().getHighWaterMark().get(xx).getNodeID()
// + " USN " + poll.getChangesAvailable().getHighWaterMark().get(xx).getOriginatingUSN());
//}
- GetChangeRecords body = new GetChangeRecords();
- body.setRequestingNode(node);
- body.setResponseLimitCount(BigInteger.valueOf(100));
-
- body.setChangesAlreadySeen(getLastChangeRecordFrom(poll.getNotifyingNode()));
- logger.info("fetching updates from " + poll.getNotifyingNode() + " since " + body.getChangesAlreadySeen().getHighWaterMark().get(0).getOriginatingUSN());
-
- List<ChangeRecord> records
- = replicationClient.getChangeRecords(body).getChangeRecord();
- //ok now we need to persist the change records
- logger.info("Change records retrieved " + records.size());
- for (int i = 0; i < records.size(); i++) {
- logger.info("Change records retrieved " + records.get(i).getChangeID().getNodeID() + " USN " + records.get(i).getChangeID().getOriginatingUSN());
- PersistChangeRecord(records.get(i));
+ int recordsreturned = 1;
+ while (recordsreturned > 0) {
+ GetChangeRecords body = new GetChangeRecords();
+ body.setRequestingNode(node);
+ body.setResponseLimitCount(BigInteger.valueOf(20));
+
+ body.setChangesAlreadySeen(getLastChangeRecordFrom(poll));
+ logger.info("fetching updates from " + poll + " since " + body.getChangesAlreadySeen().getHighWaterMark().get(0).getOriginatingUSN() + " items still in the queue: " + queue.size());
+
+ List<ChangeRecord> records
+ = replicationClient.getChangeRecords(body).getChangeRecord();
+ //ok now we need to persist the change records
+ logger.info("Change records retrieved from " + poll + ", " + records.size());
+ for (int i = 0; i < records.size(); i++) {
+ logger.info("Change records retrieved " + records.get(i).getChangeID().getNodeID() + " USN " + records.get(i).getChangeID().getOriginatingUSN());
+ PersistChangeRecord(records.get(i));
+ }
+ recordsreturned = records.size();
}
} catch (Exception ex) {
- logger.error("Error caught fetching replication changes from " + poll.getNotifyingNode(), ex);
+ logger.error("Error caught fetching replication changes from " + poll, ex);
}
}
} else {
@@ -287,6 +300,12 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
if (rec == null) {
return;
}
+ logger.debug("_______________________Remote change request " + rec.getChangeID().getNodeID() + ":" + rec.getChangeID().getOriginatingUSN());
+
+ if (rec.getChangeID().getNodeID().equalsIgnoreCase(node)){
+ logger.info("Just received a change record that i created, ignoring....");
+ return;
+ }
EntityManager em = PersistenceManager.getEntityManager();
EntityTransaction tx = em.getTransaction();
/**
@@ -298,10 +317,8 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
* a USN is less than the USN specified in the
* changesAlreadySeen highWaterMarkVector.
*/
- // StringWriter sw = new StringWriter();
- //JAXB.marshal(rec, sw);
- logger.info("_______________________Remote change request " + rec.getChangeID().getNodeID() + ":" + rec.getChangeID().getOriginatingUSN());
+
try {
tx.begin();
//the change record rec must also be persisted!!
@@ -309,6 +326,11 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
mapChangeRecord.setId(null);
em.persist(mapChangeRecord);
tx.commit();
+ logger.debug("Remote CR saved, it was from " + mapChangeRecord.getNodeID() +
+ " USN:" + mapChangeRecord.getOriginatingUSN() +
+ " Type:" + mapChangeRecord.getRecordType().name() +
+ " Key:"+mapChangeRecord.getEntityKey() +
+ " Local id:"+mapChangeRecord.getId());
tx = em.getTransaction();
tx.begin();
//<editor-fold defaultstate="collapsed" desc="delete a record">
@@ -343,7 +365,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
}
if (rec.getChangeRecordDeleteAssertion() != null && rec.getChangeRecordDeleteAssertion().getPublisherAssertion() != null) {
//delete a pa template
- pub.deletePublisherAssertion(rec.getChangeRecordDeleteAssertion().getPublisherAssertion(), em);
+ pub.deletePublisherAssertion(rec.getChangeRecordDeleteAssertion(), em);
}
//</editor-fold>
@@ -386,17 +408,16 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
BusinessEntity model = em.find(org.apache.juddi.model.BusinessEntity.class, rec.getChangeRecordNewData().getBusinessEntity().getBusinessKey());
if (model != null) {
ValidateNodeIdMatches(model.getNodeId(), rec.getChangeRecordNewData().getOperationalInfo());
- //TODO revisit access control rules
- em.remove(model);
+ //em.remove(model);
+ MappingApiToModel.mapBusinessEntity(rec.getChangeRecordNewData().getBusinessEntity(), model);
+ MappingApiToModel.mapOperationalInfoIncludingChildren(model, rec.getChangeRecordNewData().getOperationalInfo());
+ em.merge(model);
+ } else {
+ model = new BusinessEntity();
+ MappingApiToModel.mapBusinessEntity(rec.getChangeRecordNewData().getBusinessEntity(), model);
+ MappingApiToModel.mapOperationalInfoIncludingChildren(model, rec.getChangeRecordNewData().getOperationalInfo());
+ em.persist(model);
}
- model = new BusinessEntity();
- MappingApiToModel.mapBusinessEntity(rec.getChangeRecordNewData().getBusinessEntity(), model);
- // MappingApiToModel.mapOperationalInfo(model, rec.getChangeRecordNewData().getOperationalInfo());
-
- MappingApiToModel.mapOperationalInfoIncludingChildren(model, rec.getChangeRecordNewData().getOperationalInfo());
- logger.warn("Name size on save is " + model.getBusinessNames().size());
- em.persist(model);
-
}
if (rec.getChangeRecordNewData().getBusinessService() != null) {
BusinessEntity find = em.find(org.apache.juddi.model.BusinessEntity.class, rec.getChangeRecordNewData().getBusinessService().getBusinessKey());
@@ -591,6 +612,9 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
} catch (Exception drfm) {
logger.warn("Error persisting change record!", drfm);
+ StringWriter sw = new StringWriter();
+ JAXB.marshal(rec, sw);
+ logger.warn("This is the record that failed to persist: " + sw.toString());
} finally {
if (tx.isActive()) {
tx.rollback();
@@ -640,7 +664,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
//only time this is allowed is custody transfer
if (!modelNodeId.equals(newDataOperationalInfo.getNodeID())) {
//throw new Exception("node id mismatch!");
- logger.info("AUDIT, custory transfer from node, " + modelNodeId + " to " + newDataOperationalInfo.getNodeID() + "/" + newDataOperationalInfo.getAuthorizedName());
+ //logger.info("AUDIT, custory transfer from node, " + modelNodeId + " to " + newDataOperationalInfo.getNodeID() + "/" + newDataOperationalInfo.getAuthorizedName());
}
//if i already have a record and "own it" and the remote node has a record with the same key, reject the update
@@ -660,7 +684,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
*/
//so someone else attempted to update one of my records, reject it
if (modelNodeId.equals(node)) {
- throw new Exception("node id mismatch! this node already has a record for key " + newDataOperationalInfo.getEntityKey() + " and I'm the authority for it.");
+ //throw new Exception("node id mismatch! this node already has a record for key " + newDataOperationalInfo.getEntityKey() + " and I'm the authority for it.");
}
}
@@ -725,18 +749,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
@Override
public org.uddi.repl_v3.ChangeRecords getChangeRecords(
@WebParam(partName = "body", name = "get_changeRecords", targetNamespace = "urn:uddi-org:repl_v3") org.uddi.repl_v3.GetChangeRecords body
- ) throws DispositionReportFaultMessage, RemoteException {/*
- @WebResult(name = "changeRecord", targetNamespace = "urn:uddi-org:repl_v3")
- @RequestWrapper(localName = "get_changeRecords", targetNamespace = "urn:uddi-org:repl_v3", className = "org.uddi.repl_v3.GetChangeRecords")
- @ResponseWrapper(localName = "changeRecords", targetNamespace = "urn:uddi-org:repl_v3", className = "org.uddi.repl_v3.ChangeRecords")
-
- @Override
- public List<ChangeRecord> getChangeRecords(@WebParam(name = "requestingNode", targetNamespace = "urn:uddi-org:repl_v3") String requestingNode,
- @WebParam(name = "changesAlreadySeen", targetNamespace = "urn:uddi-org:repl_v3") HighWaterMarkVectorType changesAlreadySeen,
- @WebParam(name = "responseLimitCount", targetNamespace = "urn:uddi-org:repl_v3") BigInteger responseLimitCount,
- @WebParam(name = "responseLimitVector", targetNamespace = "urn:uddi-org:repl_v3") HighWaterMarkVectorType responseLimitVector)
- throws DispositionReportFaultMessage {*/
-
+ ) throws DispositionReportFaultMessage, RemoteException {
long startTime = System.currentTimeMillis();
String requestingNode = body.getRequestingNode();
HighWaterMarkVectorType changesAlreadySeen = body.getChangesAlreadySeen();
@@ -795,8 +808,10 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
}
}
- logger.debug("Query db for replication changes, lower index is " + (firstrecord - 1) + " last index " + lastrecord + " record limit " + maxrecords);
+ logger.info("Query db for replication changes, lower index is " + (firstrecord) + " last index " + lastrecord + " record limit " + maxrecords);
Query createQuery = null;
+ /*
+ //this don't work
if (lastrecord != null) {
createQuery = em.createQuery("select e from ChangeRecord e where "
+ "((e.id > :inbound AND e.nodeID = :node AND e.id < :lastrecord) OR "
@@ -808,18 +823,28 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
+ "((e.id > :inbound AND e.nodeID = :node) OR "
+ "(e.originatingUSN > :inbound AND e.nodeID <> :node)) "
+ "order by e.id ASC");
+ }*/
+ if (lastrecord != null) {
+ createQuery = em.createQuery("select e from ChangeRecord e where "
+ + "(e.id > :inbound AND e.nodeID = :node AND e.id < :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) "
+ + "order by e.id ASC");
}
createQuery.setMaxResults(maxrecords);
- createQuery.setParameter("inbound", firstrecord - 1);
+ createQuery.setParameter("inbound", firstrecord);
createQuery.setParameter("node", node);
List<org.apache.juddi.model.ChangeRecord> records = (List<org.apache.juddi.model.ChangeRecord>) createQuery.getResultList();
- logger.debug(records.size() + " CR records returned from query");
+ logger.info(records.size() + " CR records returned from query");
for (int i = 0; i < records.size(); i++) {
ChangeRecord r = MappingModelToApi.mapChangeRecord(records.get(i));
- //if (!Excluded(changesAlreadySeen, r)) {
- ret.add(r);
- //}
+ if (!Excluded(changesAlreadySeen, r)) {
+ ret.add(r);
+ }
}
@@ -842,6 +867,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
//JAXB.marshal(ret, System.out);
ChangeRecords x = new ChangeRecords();
x.getChangeRecord().addAll(ret);
+ //JAXB.marshal(x, System.out);
return x;
}
@@ -940,14 +966,15 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
//getChangeRecords from the remote node asynch
new ValidateReplication(null).validateNotifyChangeRecordsAvailable(body, ctx);
- queue.add(body);
logger.info(body.getNotifyingNode() + " just told me that there are change records available, enqueuing...size is " + queue.size());
- //ValidateReplication.unsupportedAPICall();
+ if (!queue.contains(body.getNotifyingNode())) {
+ queue.add(body.getNotifyingNode());
+ }
long procTime = System.currentTimeMillis() - startTime;
serviceCounter.update(ReplicationQuery.NOTIFY_CHANGERECORDSAVAILABLE,
QueryStatus.SUCCESS, procTime);
}
- private static Queue<NotifyChangeRecordsAvailable> queue = null;
+ private static Queue<String> queue = null;
/**
* transfers custody of an entity from node1/user1 to node2/user2
@@ -976,7 +1003,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
//ValidateReplication.unsupportedAPICall();
//a remote node just told me to give up control of some of my entities
- //EntityTransaction tx = em.getTransaction();
+ //EntityTransaction tx = em.getTransaction();
//confirm i have a replication config
boolean ok = false;
ReplicationConfiguration FetchEdges = ReplicationNotifier.FetchEdges();
@@ -994,7 +1021,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
}
new ValidateReplication(null).validateTransfer(em, body);
-
+
TransferEntities te = new TransferEntities();
te.setKeyBag(body.getKeyBag());
te.setTransferToken(body.getTransferToken());
@@ -1002,9 +1029,9 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
//make the change
//enqueue in replication notifier
//discard the token
- logger.info("request validated, processing transfer");
+ logger.debug("request validated, processing transfer");
List<ChangeRecord> executeTransfer = new UDDICustodyTransferImpl().executeTransfer(te, em, body.getTransferOperationalInfo().getAuthorizedName(), body.getTransferOperationalInfo().getNodeID());
-
+
for (ChangeRecord c : executeTransfer) {
try {
c.setChangeID(new ChangeRecordIDType());
@@ -1012,7 +1039,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
c.getChangeID().setOriginatingUSN(null);
ReplicationNotifier.Enqueue(MappingApiToModel.mapChangeRecord(c));
} catch (UnsupportedEncodingException ex) {
- logger.error("", ex);
+ logger.error("", ex);
}
}
/**
@@ -1047,7 +1074,7 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
* The acknowledgmentRequested attribute of this change
* record MUST be set to "true".
*
- *
+ *
*
* Finally, the custodial node invalidates the
* transferToken in order to prevent additional calls of
@@ -1064,8 +1091,9 @@ public class UDDIReplicationImpl extends AuthenticatedService implements UDDIRep
if (em != null && em.isOpen()) {
em.close();
}
- if (tx.isActive())
+ if (tx.isActive()) {
tx.rollback();
+ }
}
}
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/juddi-core/src/main/java/org/apache/juddi/api/util/JUDDIQuery.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/api/util/JUDDIQuery.java b/juddi-core/src/main/java/org/apache/juddi/api/util/JUDDIQuery.java
index 23f53f9..df501a9 100644
--- a/juddi-core/src/main/java/org/apache/juddi/api/util/JUDDIQuery.java
+++ b/juddi-core/src/main/java/org/apache/juddi/api/util/JUDDIQuery.java
@@ -46,6 +46,7 @@ public enum JUDDIQuery implements UDDIQuery {
SET_REPLICATION_NODES("set_replicationNodes"),
GET_REPLICATION_NODES("get_replicationNodes"),
ADMIN_SAVE_SUB("admin_saveClientSubscription"),
+ ADMIN_GET_HISTORY("admin_getEntityHistory"),
INVOKE_SYNCSUB("invoke_synchSubscription");
private String _query;
@@ -85,7 +86,7 @@ public enum JUDDIQuery implements UDDIQuery {
_inquiryQueries.put("set_replicationNodes", JUDDIQuery.SET_REPLICATION_NODES);
_inquiryQueries.put("get_replicationNodes", JUDDIQuery.GET_REPLICATION_NODES);
_inquiryQueries.put("admin_saveClientSubscription", JUDDIQuery.ADMIN_SAVE_SUB);
-
+ _inquiryQueries.put("admin_getEntityHistory", JUDDIQuery.ADMIN_GET_HISTORY);
_inquiryQueries.put("invoke_synchSubscription", JUDDIQuery.INVOKE_SYNCSUB);
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java b/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java
index 47c11a9..9a9f5e0 100644
--- a/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java
+++ b/juddi-core/src/main/java/org/apache/juddi/config/AppConfig.java
@@ -19,6 +19,7 @@ package org.apache.juddi.config;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Iterator;
import java.util.List;
import java.util.Properties;
@@ -118,7 +119,7 @@ public class AppConfig
//Hey! this may break things
propConfig.setAutoSave(true);
- log.info("Reading from properties file: " + loadedFrom);
+ log.info("Reading from jUDDI config file from: " + loadedFrom);
long refreshDelay = propConfig.getLong(Property.JUDDI_CONFIGURATION_RELOAD_DELAY, 1000l);
log.debug("Setting refreshDelay to " + refreshDelay);
FileChangedReloadingStrategy fileChangedReloadingStrategy = new FileChangedReloadingStrategy();
@@ -192,22 +193,32 @@ public class AppConfig
// The node Id is defined as the business key of the business entity categorized as a node. This entity is saved as part of the install.
// Only one business entity should be categorized as a node.
- String nodeId = "";
- CategoryBag categoryBag = new CategoryBag();
+ String nodeId = config.getString(Property.JUDDI_NODE_ID);
+ /*
+ CategoryBag categoryBag = new CategoryBag();
KeyedReference keyedRef = new KeyedReference();
keyedRef.setTModelKey(Constants.NODE_CATEGORY_TMODEL);
keyedRef.setKeyValue(Constants.NODE_KEYVALUE);
categoryBag.getKeyedReference().add(keyedRef);
List<?> keyList = FindBusinessByCategoryQuery.select(em, new FindQualifiers(), categoryBag, null);
if (keyList != null && keyList.size() > 1)
- throw new ConfigurationException("Only one business entity can be categorized as the node.");
-
+ {
+ StringBuilder sb = new StringBuilder();
+ Iterator<?> iterator = keyList.iterator();
+ while(iterator.hasNext()){
+ sb.append(iterator.next()).append(",");
+ }
+ //
+ //throw new ConfigurationException("Only one business entity can be categorized as the node. Config loaded from " + loadedFrom + " Key's listed at the node: " + sb.toString());
+ //unless of course, we are in a replicated environment
+ }
if (keyList != null && keyList.size() > 0) {
nodeId = (String)keyList.get(0);
}
else
throw new ConfigurationException("A node business entity was not found. Please make sure that the application is properly installed.");
- result.setProperty(Property.JUDDI_NODE_ID, nodeId);
+ */
+ result.setProperty(Property.JUDDI_NODE_ROOT_BUSINESS, nodeId);
//result.setProperty(Property.JUDDI_NODE_ROOT_BUSINESS, nodeId);
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/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 334fadd..ab814d6 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
@@ -1385,6 +1385,10 @@ public class MappingApiToModel {
r.setOriginatingUSN(rec.getChangeID().getOriginatingUSN());
if (rec.getChangeRecordNewData() != null) {
r.setRecordType(org.apache.juddi.model.ChangeRecord.RecordType.ChangeRecordNewData);
+ r.setEntityKey(rec.getChangeRecordNewData().getOperationalInfo().getEntityKey());
+ if (rec.getChangeRecordNewData().getOperationalInfo().getEntityKey() == null) {
+ throw new UnsupportedEncodingException("entity key is null! make sure it's filled out before saving!");
+ }
} else if (rec.getChangeRecordAcknowledgement() != null) {
r.setRecordType(org.apache.juddi.model.ChangeRecord.RecordType.ChangeRecordAcknowledgement);
} else if (rec.getChangeRecordConditionFailed() != null) {
@@ -1393,10 +1397,23 @@ public class MappingApiToModel {
r.setRecordType(org.apache.juddi.model.ChangeRecord.RecordType.ChangeRecordCorrection);
} else if (rec.getChangeRecordDelete() != null) {
r.setRecordType(org.apache.juddi.model.ChangeRecord.RecordType.ChangeRecordDelete);
+ if (rec.getChangeRecordDelete().getTModelKey() != null) {
+ r.setEntityKey(rec.getChangeRecordDelete().getTModelKey());
+ }
+ if (rec.getChangeRecordDelete().getBindingKey() != null) {
+ r.setEntityKey(rec.getChangeRecordDelete().getBindingKey());
+ }
+ if (rec.getChangeRecordDelete().getBusinessKey() != null) {
+ r.setEntityKey(rec.getChangeRecordDelete().getBusinessKey());
+ }
+ if (rec.getChangeRecordDelete().getServiceKey() != null) {
+ r.setEntityKey(rec.getChangeRecordDelete().getServiceKey());
+ }
} else if (rec.getChangeRecordDeleteAssertion() != null) {
r.setRecordType(org.apache.juddi.model.ChangeRecord.RecordType.ChangeRecordDeleteAssertion);
} else if (rec.getChangeRecordHide() != null) {
r.setRecordType(org.apache.juddi.model.ChangeRecord.RecordType.ChangeRecordHide);
+ r.setEntityKey(rec.getChangeRecordHide().getTModelKey());
} else if (rec.getChangeRecordNewDataConditional() != null) {
r.setRecordType(org.apache.juddi.model.ChangeRecord.RecordType.ChangeRecordNewDataConditional);
} else if (rec.getChangeRecordNull() != null) {
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/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 b100f05..26e37aa 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
@@ -1334,7 +1334,7 @@ public class MappingModelToApi {
if (cr == null) {
return null;
}
- ChangeRecord ret = new ChangeRecord();
+ ChangeRecord ret = null;
StringReader sr = null;
try {
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/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 465fdb5..429a9c5 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
@@ -107,6 +107,11 @@ public class ReplicationNotifier extends TimerTask {
em.persist(j);
+ log.debug("CR saved locally, it was from " + j.getNodeID() +
+ " USN:" + j.getOriginatingUSN() +
+ " Type:" + j.getRecordType().name() +
+ " Key:"+j.getEntityKey() +
+ " Local id:"+j.getId());
tx.commit();
} catch (Exception ex) {
log.error("error", ex);
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/juddi-core/src/main/java/org/apache/juddi/rmi/JUDDIApiService.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/main/java/org/apache/juddi/rmi/JUDDIApiService.java b/juddi-core/src/main/java/org/apache/juddi/rmi/JUDDIApiService.java
index 55e6497..00081e9 100644
--- a/juddi-core/src/main/java/org/apache/juddi/rmi/JUDDIApiService.java
+++ b/juddi-core/src/main/java/org/apache/juddi/rmi/JUDDIApiService.java
@@ -32,6 +32,8 @@ import org.apache.juddi.api_v3.DeleteClientSubscriptionInfo;
import org.apache.juddi.api_v3.DeleteNode;
import org.apache.juddi.api_v3.DeletePublisher;
import org.apache.juddi.api_v3.GetAllPublisherDetail;
+import org.apache.juddi.api_v3.GetEntityHistoryMessageRequest;
+import org.apache.juddi.api_v3.GetEntityHistoryMessageResponse;
import org.apache.juddi.api_v3.GetPublisherDetail;
import org.apache.juddi.api_v3.NodeDetail;
import org.apache.juddi.api_v3.NodeList;
@@ -169,10 +171,16 @@ public class JUDDIApiService extends UnicastRemoteObject implements JUDDIApiPort
}
@Override
- public void adminSaveSubscription(String authInfo, String publisherOrUsername, Holder<List<Subscription>> subscriptions) throws DispositionReportFaultMessage {
+ public void adminSaveSubscription(String authInfo, String publisherOrUsername, Holder<List<Subscription>> subscriptions) throws DispositionReportFaultMessage, RemoteException {
juddiAPI.adminSaveSubscription(authInfo, publisherOrUsername, subscriptions);
}
+ @Override
+ public GetEntityHistoryMessageResponse getEntityHistory(GetEntityHistoryMessageRequest body) throws DispositionReportFaultMessage,RemoteException {
+ return juddiAPI.getEntityHistory(body);
+
+ }
+
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/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 64ebdb9..dd0271f 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
@@ -342,6 +342,13 @@ public class ValidatePublish extends ValidateUDDIApi {
|| !pubAssertion.getKeyValue().equalsIgnoreCase(keyedRef.getKeyValue())) {
throw new AssertionNotFoundException(new ErrorMessage("errors.pubassertion.AssertionNotFound", entity.getFromKey() + ", " + entity.getToKey()));
}
+ //JUDDI-908
+ if (!publisher.isOwner(pubAssertion.getBusinessEntityByToKey()) &&
+ !publisher.isOwner(pubAssertion.getBusinessEntityByFromKey()))
+ {
+ throw new UserMismatchException(new ErrorMessage("errors.usermismatch.assertion"));
+ }
+
}
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/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 cdcace9..c326d56 100644
--- a/juddi-core/src/main/resources/messages.properties
+++ b/juddi-core/src/main/resources/messages.properties
@@ -298,4 +298,6 @@ errors.replication.configNodeNotFound=No specified node name is not currently li
errors.replication.configNull=No replication config was present in the message
errors.replication.contactNull=No replication contact was present in the message
errors.deleteNode.InReplicationConfig=The node to be deleted is currently referenced in the replication configuration. You must revise the configuration before deleting the node,
-errors.usermismatch.InvalidNode=The user is not authorized to alter the given entity. It is not owned by this jUDDI node. Try your request again on the authoritative node.
\ No newline at end of file
+errors.usermismatch.InvalidNode=The user is not authorized to alter the given entity. It is not owned by this jUDDI node. Try your request again on the authoritative node.
+
+errors.usermismatch.assertion=You have to be either the owner of the 'from' or 'to' business in order to delete a publisher assertion.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/juddi-core/src/test/java/org/apache/juddi/api/runtime/juddiTestimpl.java
----------------------------------------------------------------------
diff --git a/juddi-core/src/test/java/org/apache/juddi/api/runtime/juddiTestimpl.java b/juddi-core/src/test/java/org/apache/juddi/api/runtime/juddiTestimpl.java
index c127137..dc677ed 100644
--- a/juddi-core/src/test/java/org/apache/juddi/api/runtime/juddiTestimpl.java
+++ b/juddi-core/src/test/java/org/apache/juddi/api/runtime/juddiTestimpl.java
@@ -29,6 +29,8 @@ import org.apache.juddi.api_v3.DeleteClientSubscriptionInfo;
import org.apache.juddi.api_v3.DeleteNode;
import org.apache.juddi.api_v3.DeletePublisher;
import org.apache.juddi.api_v3.GetAllPublisherDetail;
+import org.apache.juddi.api_v3.GetEntityHistoryMessageRequest;
+import org.apache.juddi.api_v3.GetEntityHistoryMessageResponse;
import org.apache.juddi.api_v3.GetPublisherDetail;
import org.apache.juddi.api_v3.NodeDetail;
import org.apache.juddi.api_v3.NodeList;
@@ -184,5 +186,11 @@ public class juddiTestimpl implements JUDDIApiPortType {
public void adminSaveSubscription(String authInfo, String publisherOrUsername, Holder<List<Subscription>> subscriptions) throws DispositionReportFaultMessage {
CLIServerTest.sink = true;
}
+
+ //@Override
+ public GetEntityHistoryMessageResponse getEntityHistory(GetEntityHistoryMessageRequest body) throws DispositionReportFaultMessage, RemoteException {
+ CLIServerTest.sink = true;
+ return null;
+ }
}
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/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 aecdbb1..20d0579 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
@@ -463,6 +463,9 @@ public class EntryPoint {
new UddiCreatebulk("default").publishBusiness(null, 1, 1);
new UddiCreatebulk("uddi:another.juddi.apache.org:node2").publishBusiness(null, 1, 1);
}
+ if (input.equals("rep")) {
+ new JuddiAdminService().printStatus();
+ }
}
}
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/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 9cf086f..65f5863 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
@@ -19,6 +19,7 @@ import java.math.BigInteger;
import java.rmi.RemoteException;
import java.util.List;
import javax.xml.bind.JAXB;
+import javax.xml.ws.BindingProvider;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.juddi.api_v3.DeleteNode;
import org.apache.juddi.api_v3.Node;
@@ -26,14 +27,13 @@ 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.UDDIService;
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.Contact;
import org.uddi.api_v3.Description;
import org.uddi.api_v3.DispositionReport;
@@ -41,11 +41,13 @@ import org.uddi.api_v3.Email;
import org.uddi.api_v3.GetAuthToken;
import org.uddi.api_v3.PersonName;
import org.uddi.api_v3.Phone;
+import org.uddi.repl_v3.ChangeRecordIDType;
import org.uddi.repl_v3.CommunicationGraph;
import org.uddi.repl_v3.Operator;
import org.uddi.repl_v3.OperatorStatusType;
import org.uddi.repl_v3.ReplicationConfiguration;
import org.uddi.v3_service.UDDIPublicationPortType;
+import org.uddi.v3_service.UDDIReplicationPortType;
import org.uddi.v3_service.UDDISecurityPortType;
/**
@@ -481,6 +483,7 @@ public class JuddiAdminService {
op.getContact().add(new Contact());
op.getContact().get(0).getPersonName().add(new PersonName("bob", "en"));
op.getContact().get(0).setUseType("admin");
+ replicationNodes.getOperator().clear();
replicationNodes.getOperator().add(op);
op = new Operator();
@@ -514,4 +517,38 @@ public class JuddiAdminService {
}
+
+ void printStatus() throws Exception{
+
+
+ List<Node> uddiNodeList = clerkManager.getClientConfig().getUDDINodeList();
+
+ Transport transport = clerkManager.getTransport("default");
+ String authtoken = transport.getUDDISecurityService().getAuthToken(new GetAuthToken("root", "root")).getAuthInfo();
+
+ JUDDIApiPortType juddiApiService = transport.getJUDDIApiService();
+ System.out.println("fetching...");
+
+ ReplicationConfiguration replicationNodes = null;
+ try {
+ replicationNodes = juddiApiService.getReplicationNodes(authtoken);
+ } catch (Exception ex) {
+ System.out.println("Error getting replication config");
+ ex.printStackTrace();
+ replicationNodes = new ReplicationConfiguration();
+
+ }
+ UDDIReplicationPortType uddiReplicationPort = new UDDIService().getUDDIReplicationPort();
+
+ for (Operator o: replicationNodes.getOperator()){
+ System.out.println("*******************\n\rstats for node " + o.getOperatorNodeID());
+ ((BindingProvider)uddiReplicationPort).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, o.getSoapReplicationURL());
+
+ List<ChangeRecordIDType> highWaterMarks = uddiReplicationPort.getHighWaterMarks();
+ for (ChangeRecordIDType cr : highWaterMarks){
+ JAXB.marshal(cr, System.out);
+ }
+ }
+
+ }
}
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 09b69f9..8a5bf67 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,7 +31,7 @@
<sourceReleaseAssemblyDescriptor>source-release</sourceReleaseAssemblyDescriptor>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
- <cxf.version>2.7.13</cxf.version>
+ <cxf.version>2.7.14</cxf.version>
<springframework.version>3.2.2.RELEASE</springframework.version>
</properties>
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckPublisher.java
----------------------------------------------------------------------
diff --git a/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckPublisher.java b/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckPublisher.java
index 44543d0..8cf5a26 100644
--- a/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckPublisher.java
+++ b/uddi-tck-base/src/main/java/org/apache/juddi/v3/tck/TckPublisher.java
@@ -247,4 +247,12 @@ public class TckPublisher {
return 60;
}
+
+ public static boolean isSMTPEnabled() {
+ String x = tckProperties.getProperty("smtp.notify.enabled");
+ if (x.equalsIgnoreCase("true")) {
+ return true;
+ }
+ return false;
+ }
}
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/uddi-tck-runner/src/main/java/org/apache/juddi/tckrunner/App.java
----------------------------------------------------------------------
diff --git a/uddi-tck-runner/src/main/java/org/apache/juddi/tckrunner/App.java b/uddi-tck-runner/src/main/java/org/apache/juddi/tckrunner/App.java
index ec24bc6..b2b9077 100644
--- a/uddi-tck-runner/src/main/java/org/apache/juddi/tckrunner/App.java
+++ b/uddi-tck-runner/src/main/java/org/apache/juddi/tckrunner/App.java
@@ -74,6 +74,8 @@ public class App {
org.apache.juddi.v3.bpel.BPEL_010_IntegrationTest.class,
org.apache.juddi.v3.bpel.BPEL_020_IntegrationTest.class,
org.apache.juddi.v3.tck.JUDDI_010_PublisherIntegrationTest.class,
+ org.apache.juddi.v3.tck.JUDDI_100_ClientSubscriptionInfoIntegrationTest.class,
+ org.apache.juddi.v3.tck.JUDDI_300_MultiNodeIntegrationTest.class,
org.apache.juddi.v3.tck.UDDI_010_PublisherIntegrationTest.class,
org.apache.juddi.v3.tck.UDDI_020_TmodelIntegrationTest.class,
org.apache.juddi.v3.tck.UDDI_030_BusinessEntityIntegrationTest.class,
@@ -92,7 +94,7 @@ public class App {
org.apache.juddi.v3.tck.UDDI_090_Smtp_ExternalTest.class,
org.apache.juddi.v3.tck.UDDI_090_RMIIntegrationTest.class,
//org.apache.juddi.v3.tck.JUDDI_091_RMISubscriptionListenerIntegrationTest.class,
- org.apache.juddi.v3.tck.JUDDI_100_ClientSubscriptionInfoIntegrationTest.class,
+
org.apache.juddi.v3.tck.UDDI_110_FindBusinessIntegrationTest.class,
org.apache.juddi.v3.tck.UDDI_120_CombineCategoryBagsFindServiceIntegrationTest.class,
org.apache.juddi.v3.tck.UDDI_130_CombineCategoryBagsFindBusinessIntegrationTest.class,
@@ -185,7 +187,8 @@ public class App {
System.out.println("Failed Test Cases: " + result.getFailureCount());
System.out.println("Skipped Test Cases: " + result.getIgnoreCount());
System.out.println("Ran Test Cases: " + result.getRunCount());
- System.out.println("Time: " + result.getRunTime());
+ System.out.println("Time: " + result.getRunTime() + "ms which is " +
+ org.apache.commons.lang.time.DurationFormatUtils.formatDurationHMS(result.getRunTime()));
System.out.println("-------------------------------------");
System.out.println("Results written to " + filename);
http://git-wip-us.apache.org/repos/asf/juddi/blob/d7195270/uddi-tck-runner/tck.properties
----------------------------------------------------------------------
diff --git a/uddi-tck-runner/tck.properties b/uddi-tck-runner/tck.properties
index 81a3189..14b9417 100644
--- a/uddi-tck-runner/tck.properties
+++ b/uddi-tck-runner/tck.properties
@@ -40,11 +40,11 @@ sub.timeout=15
#does the UDDI server support the Custody Transfer API?
transfer.enabled=true
#does the UDDI server support the Replication API?
-replication.enabled=false
+replication.enabled=true
# if the UDDI server supports SMTP based notification
-smtp.notify.enabled=true
+smtp.notify.enabled=false
@@ -83,5 +83,5 @@ trustStorePassword=Test
# the TCK now has tests for uddiv2 and uddiv3
-uddiv2.enabled=false
-uddiv3.enabled=true
\ No newline at end of file
+uddiv2.enabled=true
+uddiv3.enabled=true
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@juddi.apache.org
For additional commands, e-mail: commits-help@juddi.apache.org