Skip to content
Permalink
Browse files
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
  • Loading branch information
spyhunter99 committed Jan 8, 2015
1 parent 40b1d67 commit d7195270482912abf42a29e2ed7b647dd5cb910a
Showing 96 changed files with 6,604 additions and 1,064 deletions.
@@ -55,6 +55,8 @@
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.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.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 void adminDeleteTModel(DeleteTModel body)
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 void adminSaveSubscription(String authInfo, String publisherOrUsername, H
}

}

@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();
}
}
}

0 comments on commit d719527

Please sign in to comment.