subscriptions) {
- statusHandler.debug("Notifying that subscriptions are available.");
+ /**
+ * Pull a SubscriptionRetrievalRequestWrapper off of the retrieval queue
+ * Will be two types 1.) SBN retrievals will come in the form of XML
+ * containing the data itself 2.) OPSNET retrievals will be the
+ * RetrievalRequestRecordPK object
+ *
+ * @param SubscriptionRetrievalRequestWrapper
+ * wrapper as byte array
+ */
+ public void notify(byte[] bytes) {
+
+ SubscriptionRetrievalRequestWrapper srrw = null;
- for (RetrievalTask retrievalTask : retrievalTasks) {
- executorService.execute(retrievalTask);
+ try {
+ srrw = SerializationUtil.transformFromThrift(
+ SubscriptionRetrievalRequestWrapper.class, bytes);
+
+ if (srrw != null) {
+ RetrievalTask task = getTasker(srrw);
+ task.run();
+ }
+
+ } catch (SerializationException e) {
+ statusHandler.handle(Priority.ERROR,
+ "Can't deserialize RetrievalRequestWrapper!", e);
}
}
@@ -93,13 +114,19 @@ public class RetrievalHandler implements RegistryInitializedListener {
public void executeAfterRegistryInit() {
// set all Running state retrievals to pending
retrievalDao.resetRunningRetrievalsToPending();
-
- for (RetrievalTask retrievalTask : retrievalTasks) {
- executorService.scheduleWithFixedDelay(retrievalTask, 30000,
- retrievalTaskFrequency.getMillis(), TimeUnit.MILLISECONDS);
- }
- executorService.scheduleWithFixedDelay(subNotifyTask, 30000,
+ // run the sub notifier every 30 sec for notifications
+ scheduledExecutorService.scheduleWithFixedDelay(subNotifyTask, 30000,
subnotifyTaskFrequency.getMillis(), TimeUnit.MILLISECONDS);
-
}
+
+ /**
+ * Get a RetrievalTask for the given network
+ * @param network
+ * @return RetrievalTask
+ */
+ private RetrievalTask getTasker(SubscriptionRetrievalRequestWrapper wrapper) {
+
+ return taskFactories.get(wrapper.getNetwork().name()).create(wrapper);
+ }
+
}
diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalRequestWrapper.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalRequestWrapper.java
new file mode 100644
index 0000000000..6564380516
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalRequestWrapper.java
@@ -0,0 +1,59 @@
+package com.raytheon.uf.edex.datadelivery.retrieval.handlers;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
+/**
+ * Wrapper for retrieval primary keys
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 30, 2014 2686 dhladky refactor of retrieval.
+ *
+ *
+ *
+ * @author dhladky
+ * @version 1.0
+ */
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.NONE)
+@DynamicSerialize
+public class RetrievalRequestWrapper {
+
+ @XmlAttribute
+ @DynamicSerializeElement
+ private Object payload;
+
+ /**
+ * Constructor.
+ */
+ public RetrievalRequestWrapper() {
+
+ }
+
+ /**
+ * Constructor
+ *
+ * @param payload
+ */
+ public RetrievalRequestWrapper(Object payload) {
+ this.payload = payload;
+ }
+
+ public void setPayload(Object payload) {
+ this.payload = payload;
+ }
+
+ public Object getPayload() {
+ return payload;
+ }
+
+}
diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTask.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTask.java
index b576bf98d4..a68424e7a8 100644
--- a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTask.java
+++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTask.java
@@ -26,7 +26,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecord;
/**
- * Inner class to process individual retrievals.
+ * Process subscription retrievals.
*
*
*
@@ -43,6 +43,7 @@ import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecord;
* Mar 05, 2013 1647 djohnson Change no retrievals found message to debug.
* Aug 09, 2013 1822 bgonzale Added parameters to processRetrievedPluginDataObjects.
* Oct 01, 2013 2267 bgonzale Removed request parameter and IRetrievalDao field.
+ * Jan 30, 2014 2686 dhladky refactor of retrieval.
*
*
*
@@ -61,57 +62,66 @@ public class RetrievalTask implements Runnable {
private final IRetrievalResponseCompleter retrievalCompleter;
private final IRetrievalsFinder retrievalDataFinder;
-
+
+ private final SubscriptionRetrievalRequestWrapper retrievalRequestWrapper;
public RetrievalTask(Network network,
IRetrievalsFinder retrievalDataFinder,
IRetrievalPluginDataObjectsProcessor retrievedDataProcessor,
- IRetrievalResponseCompleter retrievalCompleter) {
+ IRetrievalResponseCompleter retrievalCompleter,
+ SubscriptionRetrievalRequestWrapper retrievalRequestWrapper) {
+
this.network = network;
this.retrievalDataFinder = retrievalDataFinder;
this.retrievedDataProcessor = retrievedDataProcessor;
this.retrievalCompleter = retrievalCompleter;
+ this.retrievalRequestWrapper = retrievalRequestWrapper;
}
@Override
public void run() {
+
try {
- while (true) {
+
+ if (retrievalRequestWrapper.getRetrievalRequestWrappers() != null) {
+
+ for (RetrievalRequestWrapper retrieval : retrievalRequestWrapper.getRetrievalRequestWrappers()) {
+ // process individual requests for this subscription
+ boolean success = false;
+ RetrievalRequestRecord request = null;
- // process request
- boolean success = false;
- RetrievalRequestRecord request = null;
- try {
+ try {
+ // send this retrieval to be processed
+ RetrievalResponseXml retrievalResponse = retrievalDataFinder
+ .processRequest(retrieval);
- RetrievalResponseXml retrievalPluginDataObject = retrievalDataFinder
- .findRetrievals();
- // This forces the return from the while loop once there are
- // no more retrievals to process
- if (retrievalPluginDataObject == null) {
- if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
- statusHandler.debug("No " + network
- + " retrievals found.");
+ if (retrievalResponse == null) {
+ if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
+ statusHandler.debug("No " + network
+ + " retrievals found.");
+ }
+ continue;
}
- return;
+
+ success = retrievalResponse.isSuccess();
+ request = retrievedDataProcessor
+ .processRetrievedPluginDataObjects(retrievalResponse);
+
+ } catch (Exception e) {
+ statusHandler.error(network
+ + " retrieval processing error", e);
}
- success = retrievalPluginDataObject.isSuccess();
- request = retrievedDataProcessor
- .processRetrievedPluginDataObjects(retrievalPluginDataObject);
- } catch (Exception e) {
- statusHandler.error(
- network + " retrieval processing error", e);
- }
-
- if (request != null) {
- retrievalCompleter.completeRetrieval(request,
- new RetrievalResponseStatus(success));
+ if (request != null) {
+ retrievalCompleter.completeRetrieval(request,
+ new RetrievalResponseStatus(success));
+ }
}
}
} catch (Throwable e) {
// so thread can't die
statusHandler.error("Error caught in " + network
+ " retrieval thread", e);
- }
+ }
}
}
diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTaskFactory.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTaskFactory.java
new file mode 100644
index 0000000000..8227c07081
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTaskFactory.java
@@ -0,0 +1,67 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.edex.datadelivery.retrieval.handlers;
+
+import com.raytheon.uf.common.datadelivery.registry.Network;
+/**
+ * Factory to create RetrievalTasks for a specific Subscription Retrieval Request.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Feb 04, 2014 2686 dhladky Initial creation
+ *
+ *
+ *
+ * @author dhladky
+ * @version 1.0
+ */
+public class RetrievalTaskFactory {
+
+ private final Network network;
+
+ private final IRetrievalPluginDataObjectsProcessor retrievedDataProcessor;
+
+ private final IRetrievalResponseCompleter retrievalCompleter;
+
+ private final IRetrievalsFinder retrievalDataFinder;
+
+ public RetrievalTaskFactory(Network network,
+ IRetrievalsFinder retrievalDataFinder,
+ IRetrievalPluginDataObjectsProcessor retrievedDataProcessor,
+ IRetrievalResponseCompleter retrievalCompleter) {
+ this.network = network;
+ this.retrievalDataFinder = retrievalDataFinder;
+ this.retrievedDataProcessor = retrievedDataProcessor;
+ this.retrievalCompleter = retrievalCompleter;
+ }
+
+ /**
+ * RetrievalTask creator, Factory method
+ * @param retrievalRequest
+ * @return
+ */
+ public RetrievalTask create(SubscriptionRetrievalRequestWrapper retrievalRequest) {
+ return new RetrievalTask(network, retrievalDataFinder, retrievedDataProcessor, retrievalCompleter, retrievalRequest);
+ }
+}
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/SubscriptionRetrievalRequestWrapper.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/SubscriptionRetrievalRequestWrapper.java
new file mode 100644
index 0000000000..bf9910884b
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/handlers/SubscriptionRetrievalRequestWrapper.java
@@ -0,0 +1,98 @@
+/**
+ * This software was developed and / or modified by Raytheon Company,
+ * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
+ *
+ * U.S. EXPORT CONTROLLED TECHNICAL DATA
+ * This software product contains export-restricted data whose
+ * export/transfer/disclosure is restricted by U.S. law. Dissemination
+ * to non-U.S. persons whether in the United States or abroad requires
+ * an export license or other authorization.
+ *
+ * Contractor Name: Raytheon Company
+ * Contractor Address: 6825 Pine Street, Suite 340
+ * Mail Stop B8
+ * Omaha, NE 68106
+ * 402.291.0100
+ *
+ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+ * further licensing information.
+ **/
+package com.raytheon.uf.edex.datadelivery.retrieval.handlers;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import com.raytheon.uf.common.datadelivery.registry.Network;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
+
+/**
+ * Wrapper for objects placed on common retrieval queue
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 28, 2014 dhladky Initial creation
+ *
+ *
+ *
+ * @author dhladky
+ * @version 1.0
+ */
+@XmlRootElement
+@XmlAccessorType(XmlAccessType.NONE)
+@DynamicSerialize
+public class SubscriptionRetrievalRequestWrapper {
+
+ @XmlElements({ @XmlElement(name="retrievalRequestWrapper") })
+ @DynamicSerializeElement
+ private List retrievalRequestWrappers;
+
+ @XmlAttribute
+ @DynamicSerializeElement
+ private Network network;
+
+ /**
+ * Constructor.
+ */
+ public SubscriptionRetrievalRequestWrapper() {
+
+ }
+
+ /**
+ * Constructor
+ *
+ * @param network
+ * @param retrievalRequestWrappers
+ */
+ public SubscriptionRetrievalRequestWrapper(Network network, List retrievalRequestWrappers) {
+ this.setNetwork(network);
+ this.retrievalRequestWrappers = retrievalRequestWrappers;
+ }
+
+ public Network getNetwork() {
+ return network;
+ }
+
+ public void setNetwork(Network network) {
+ this.network = network;
+ }
+
+ public void setRetrievalRequestWrappers(List retrievalRequestWrappers) {
+ this.retrievalRequestWrappers = retrievalRequestWrappers;
+ }
+
+ public List getRetrievalRequestWrappers() {
+ return retrievalRequestWrappers;
+ }
+
+}
diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/RetrievalGeneratorUtilities.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/RetrievalGeneratorUtilities.java
index cf662845a6..029ae675ba 100644
--- a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/RetrievalGeneratorUtilities.java
+++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/RetrievalGeneratorUtilities.java
@@ -24,16 +24,21 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import com.raytheon.uf.common.datadelivery.registry.Network;
import com.raytheon.uf.common.datadelivery.registry.Parameter;
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
import com.raytheon.uf.common.dataplugin.level.Level;
import com.raytheon.uf.common.gridcoverage.GridCoverage;
+import com.raytheon.uf.common.serialization.SerializationUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.DataTime;
+import com.raytheon.uf.edex.core.EDEXUtil;
import com.raytheon.uf.edex.database.dao.CoreDao;
import com.raytheon.uf.edex.database.dao.DaoConfig;
+import com.raytheon.uf.edex.datadelivery.retrieval.handlers.RetrievalRequestWrapper;
+import com.raytheon.uf.edex.datadelivery.retrieval.handlers.SubscriptionRetrievalRequestWrapper;
/**
*
@@ -48,6 +53,7 @@ import com.raytheon.uf.edex.database.dao.DaoConfig;
* Nov 19, 2012 bsteffen Initial javadoc
* Dec 10, 2012 1259 bsteffen Switch Data Delivery from LatLon to referenced envelopes.
* Dec 11, 2013 2625 mpduff Remove creation of DataURI.
+ * Jan 30, 2014 2686 dhladky refactor of retrieval.
*
*
*
@@ -134,4 +140,33 @@ public class RetrievalGeneratorUtilities {
return dups;
}
+
+ /**
+ *
+ * Drops Retrievals by subscription into a common queue for processing
+ *
+ * @param destinationUri
+ * @param network
+ * @param payload
+ * @throws Exception
+ */
+ public static void sendToRetrieval(String destinationUri, Network network,
+ Object[] payload) throws Exception{
+
+ if (payload != null) {
+
+ List wrappers = new ArrayList(
+ payload.length);
+
+ for (Object o : payload) {
+ RetrievalRequestWrapper rrw = new RetrievalRequestWrapper(o);
+ wrappers.add(rrw);
+ }
+
+ SubscriptionRetrievalRequestWrapper srrw = new SubscriptionRetrievalRequestWrapper(
+ network, wrappers);
+ byte[] bytes = SerializationUtil.transformToThrift(srrw);
+ EDEXUtil.getMessageProducer().sendAsync(destinationUri, bytes);
+ }
+ }
}
diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/RetrievalPersistUtil.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/RetrievalPersistUtil.java
index 77d5d22fc4..850d3fef52 100644
--- a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/RetrievalPersistUtil.java
+++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/RetrievalPersistUtil.java
@@ -53,6 +53,7 @@ import com.raytheon.uf.edex.datadelivery.retrieval.mapping.PluginRouteList;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 26, 2012 1367 dhladky Common plugin route persistence
+ * Jan 30, 2014 2686 dhladky refactor of retrieval.
*
*
*
@@ -162,8 +163,8 @@ public final class RetrievalPersistUtil {
PluginRouteList prl = null;
try {
- prl = (PluginRouteList) getJaxbManager()
- .unmarshalFromXmlFile(file);
+ prl = getJaxbManager()
+ .unmarshalFromXmlFile(PluginRouteList.class, file);
} catch (Exception e) {
statusHandler.error(
"[Data Delivery] Configuration for plugin routes failed to load: File: "
diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.datadelivery.retrieval/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.plugin.datadelivery.retrieval/META-INF/MANIFEST.MF
index fadedfa812..c0efa94208 100644
--- a/edexOsgi/com.raytheon.uf.edex.plugin.datadelivery.retrieval/META-INF/MANIFEST.MF
+++ b/edexOsgi/com.raytheon.uf.edex.plugin.datadelivery.retrieval/META-INF/MANIFEST.MF
@@ -4,6 +4,9 @@ Bundle-Name: DataDelivery Retrieval Plug-in
Bundle-SymbolicName: com.raytheon.uf.edex.plugin.datadelivery.retrieval
Bundle-Version: 1.12.1174.qualifier
Bundle-Vendor: RAYTHEON
-Require-Bundle: com.raytheon.edex.common;bundle-version="1.11.7"
+Require-Bundle: com.raytheon.edex.common;bundle-version="1.11.7",
+ com.raytheon.uf.edex.datadelivery.retrieval;bundle-version="1.0.0",
+ com.raytheon.uf.common.datadelivery.registry;bundle-version="1.0.0",
+ com.raytheon.uf.common.status;bundle-version="1.12.1174"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.datadelivery.retrieval/res/spring/datadelivery-wfo-retrieval-process.xml b/edexOsgi/com.raytheon.uf.edex.plugin.datadelivery.retrieval/res/spring/datadelivery-wfo-retrieval-process.xml
index 59275fe6d4..0aef8ec85f 100644
--- a/edexOsgi/com.raytheon.uf.edex.plugin.datadelivery.retrieval/res/spring/datadelivery-wfo-retrieval-process.xml
+++ b/edexOsgi/com.raytheon.uf.edex.plugin.datadelivery.retrieval/res/spring/datadelivery-wfo-retrieval-process.xml
@@ -5,7 +5,7 @@
-
+
*
@@ -42,11 +46,16 @@ import com.raytheon.edex.plugin.AbstractDecoder;
*/
public class SbnDataDeliveryRetrievalDecoder extends AbstractDecoder {
+
+ private static final IUFStatusHandler statusHandler = UFStatus
+ .getHandler(SbnDataDeliveryRetrievalDecoder.class);
- private final ConcurrentLinkedQueue sbnRetrievalQueue;
-
- public SbnDataDeliveryRetrievalDecoder(ConcurrentLinkedQueue queue) {
- this.sbnRetrievalQueue = queue;
+ private String destinationUri;
+
+ private Network network = Network.SBN;
+
+ public SbnDataDeliveryRetrievalDecoder(String destinationUri) {
+ this.destinationUri = destinationUri;
}
/**
@@ -58,7 +67,14 @@ public class SbnDataDeliveryRetrievalDecoder extends AbstractDecoder {
* the headers
*/
public void process(byte[] data, Headers headers) {
- this.sbnRetrievalQueue.add(new String(data));
+ // drops to common retrieval queue for processing/persistence
+ String xml = new String(data);
+ try {
+ Object[] payload = new Object[]{xml};
+ RetrievalGeneratorUtilities.sendToRetrieval(destinationUri, network, payload);
+ } catch (Exception e) {
+ statusHandler.handle(Priority.ERROR, "Couldn't send SBN data to Retrieval Queue", e);
+ }
}
}
diff --git a/tests/unit/com/raytheon/uf/edex/datadelivery/bandwidth/retrieval/SubscriptionRetrievalAgentTest.java b/tests/unit/com/raytheon/uf/edex/datadelivery/bandwidth/retrieval/SubscriptionRetrievalAgentTest.java
index 7f658cfaba..027cabbf70 100644
--- a/tests/unit/com/raytheon/uf/edex/datadelivery/bandwidth/retrieval/SubscriptionRetrievalAgentTest.java
+++ b/tests/unit/com/raytheon/uf/edex/datadelivery/bandwidth/retrieval/SubscriptionRetrievalAgentTest.java
@@ -71,6 +71,7 @@ import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecordPK;
* Jan 30, 2013 1543 djohnson Initial creation
* Jul 10, 2013 2106 djohnson Inject providerHandler.
* Jan 15, 2014 2678 bgonzale Added Queue.
+ * Jan 30, 2014 2686 dhladky refactor of retrieval.
*
*
*
@@ -133,12 +134,8 @@ public class SubscriptionRetrievalAgentTest {
SubscriptionRetrievalAgent agent = new SubscriptionRetrievalAgent(
route, "someUri", new Object(), 1, null, bandwidthDao,
- retrievalDao, DataDeliveryHandlers.getProviderHandler(),
- retrievalQueue) {
- @Override
- void wakeRetrievalTasks() throws EdexException {
- // Do nothing
- }
+ retrievalDao, DataDeliveryHandlers.getProviderHandler()) {
+
};
agent.processAllocation(subscriptionRetrieval);
diff --git a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/DeserializeRetrievedDataFromIngestTest.java b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/DeserializeRetrievedDataFromIngestTest.java
index 5921978180..a864d5af33 100644
--- a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/DeserializeRetrievedDataFromIngestTest.java
+++ b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/DeserializeRetrievedDataFromIngestTest.java
@@ -67,6 +67,7 @@ import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecordPK;
* Nov 04, 2013 2506 bgonzale Fixed IRetreivalDao mock initialization.
* Test deserialization of data with leading and trailing
* content on the xml.
+ * Jan 30, 2014 2686 dhladky refactor of retrieval.
*
*
*
@@ -77,10 +78,7 @@ public class DeserializeRetrievedDataFromIngestTest {
private final File directory = TestUtil
.setupTestClassDir(DeserializeRetrievedDataFromIngestTest.class);
- private final ConcurrentLinkedQueue retrievalQueue = new ConcurrentLinkedQueue();
-
- private final DeserializeRetrievedDataFromIngest service = new DeserializeRetrievedDataFromIngest(
- retrievalQueue);
+ private final DeserializeRetrievedDataFromIngest service = new DeserializeRetrievedDataFromIngest();
private final IRetrievalDao mockDao = mock(IRetrievalDao.class);
@@ -103,7 +101,7 @@ public class DeserializeRetrievedDataFromIngestTest {
addRetrievalToQueue();
- final RetrievalResponseXml restored = service.findRetrievals();
+ final RetrievalResponseXml restored = service.processRequest(null);
// Just make sure the payload is present
assertThat(restored.getRetrievalAttributePluginDataObjects().get(0)
@@ -117,15 +115,15 @@ public class DeserializeRetrievedDataFromIngestTest {
addRetrievalToQueue();
- service.findRetrievals();
+ service.processRequest(null);
- assertThat(retrievalQueue, is(empty()));
+ //assertThat(retrievalQueue, is(empty()));
}
@Test
public void returnsNullWhenNothingInTheQueue() throws Exception {
- final RetrievalResponseXml restored = service.findRetrievals();
+ final RetrievalResponseXml restored = service.processRequest(null);
assertNull(restored);
}
@@ -136,7 +134,7 @@ public class DeserializeRetrievedDataFromIngestTest {
addSimulatedSBNRetrievalToQueue();
- final RetrievalResponseXml restored = service.findRetrievals();
+ final RetrievalResponseXml restored = service.processRequest(null);
// check for the payload
assertThat(restored.getRetrievalAttributePluginDataObjects().get(0)
@@ -158,7 +156,7 @@ public class DeserializeRetrievedDataFromIngestTest {
final List files = FileUtil.listFiles(directory,
FilenameFilters.ACCEPT_FILES, false);
- retrievalQueue.add(FileUtil.file2String(files.get(0)));
+ //retrievalQueue.add(FileUtil.file2String(files.get(0)));
}
private void addSimulatedSBNRetrievalToQueue()
@@ -178,7 +176,7 @@ public class DeserializeRetrievedDataFromIngestTest {
final List files = FileUtil.listFiles(directory,
FilenameFilters.ACCEPT_FILES, false);
- retrievalQueue.add(FileUtil.file2String(files.get(0)));
+ //retrievalQueue.add(FileUtil.file2String(files.get(0)));
}
private static class WmoHeaderWithLeadingAndTrailingContent extends
diff --git a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/PerformRetrievalPluginDataObjectsFinderTest.java b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/PerformRetrievalPluginDataObjectsFinderTest.java
index 98382b25a5..06f1a43406 100644
--- a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/PerformRetrievalPluginDataObjectsFinderTest.java
+++ b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/PerformRetrievalPluginDataObjectsFinderTest.java
@@ -53,6 +53,7 @@ import com.raytheon.uf.edex.datadelivery.retrieval.interfaces.IRetrievalResponse
* ------------ ---------- ----------- --------------------------
* Feb 06, 2013 1543 djohnson Initial creation
* Jan 15, 2014 2678 bgonzale Added Queue.
+ * Jan 30, 2014 2686 dhladky refactor of retrieval.
*
*
*
@@ -135,8 +136,8 @@ public class PerformRetrievalPluginDataObjectsFinderTest {
}
private void processRetrieval(RetrievalRequestRecord retrieval) {
- final PerformRetrievalsThenReturnFinder pluginDataObjectsFinder = new PerformRetrievalsThenReturnFinder(
- retrievalQueue, MOCK_DAO);
- pluginDataObjectsFinder.process(retrieval);
+ //final PerformRetrievalsThenReturnFinder pluginDataObjectsFinder = new PerformRetrievalsThenReturnFinder(
+ // retrievalQueue, MOCK_DAO);
+ //pluginDataObjectsFinder.process(retrieval);
}
}
diff --git a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalHandlerTest.java b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalHandlerTest.java
deleted file mode 100644
index 294cdd5c5b..0000000000
--- a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalHandlerTest.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/**
- * This software was developed and / or modified by Raytheon Company,
- * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
- *
- * U.S. EXPORT CONTROLLED TECHNICAL DATA
- * This software product contains export-restricted data whose
- * export/transfer/disclosure is restricted by U.S. law. Dissemination
- * to non-U.S. persons whether in the United States or abroad requires
- * an export license or other authorization.
- *
- * Contractor Name: Raytheon Company
- * Contractor Address: 6825 Pine Street, Suite 340
- * Mail Stop B8
- * Omaha, NE 68106
- * 402.291.0100
- *
- * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
- * further licensing information.
- **/
-package com.raytheon.uf.edex.datadelivery.retrieval.handlers;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import org.junit.Test;
-
-import com.raytheon.uf.common.time.domain.Durations;
-import com.raytheon.uf.common.time.domain.api.IDuration;
-import com.raytheon.uf.edex.datadelivery.retrieval.db.IRetrievalDao;
-
-/**
- * Test {@link RetrievalHandler}.
- *
- *
- *
- * SOFTWARE HISTORY
- *
- * Date Ticket# Engineer Description
- * ------------ ---------- ----------- --------------------------
- * Jul 06, 2012 740 djohnson Initial creation
- * Aug 09. 2012 1022 djohnson Changes to RetrievalHandler.
- * Nov 19, 2012 1166 djohnson Clean up JAXB representation of registry objects.
- * Jan 30, 2013 1543 djohnson RetrievalTask now requires a Network.
- * Feb 05, 2013 1580 mpduff EventBus refactor.
- * Feb 07, 2013 1543 djohnson Move test to its proper test class, as per peer review comments.
- * Mar 04, 2013 1647 djohnson RetrievalTasks are now scheduled via constructor parameter.
- *
- *
- *
- * @author djohnson
- * @version 1.0
- */
-
-public class RetrievalHandlerTest {
-
- private static final IDuration RETRIEVAL_TASK_FREQUENCY = Durations.of(5,
- TimeUnit.MINUTES);
-
- private static final IDuration SUBNOTIFY_TASK_FREQUENCY = Durations.of(1,
- TimeUnit.MINUTES);
-
- private final ScheduledExecutorService executorService = mock(ScheduledExecutorService.class);
-
- private final IRetrievalDao mockDao = mock(IRetrievalDao.class);
-
- private final RetrievalTask retrievalTask = mock(RetrievalTask.class);
-
- private final SubscriptionNotifyTask subNotifyTask = mock(SubscriptionNotifyTask.class);
-
- private final RetrievalHandler handler = new RetrievalHandler(
- executorService, mockDao, Arrays.asList(retrievalTask),
- subNotifyTask, RETRIEVAL_TASK_FREQUENCY, SUBNOTIFY_TASK_FREQUENCY);
-
- @Test
- public void testAllRunningRetrievalsAreResetToPendingOnConstruction() {
- handler.executeAfterRegistryInit();
- verify(mockDao).resetRunningRetrievalsToPending();
- }
-
- @Test
- public void testOnNotifyOfSubscriptionsARetrievalTaskIsExecuted() {
- handler.notify(Collections. emptyList());
-
- verify(executorService).execute(retrievalTask);
- }
-
- @Test
- public void testRetrievalTaskIsScheduledPerConstructorParameter() {
- handler.executeAfterRegistryInit();
- verify(executorService).scheduleWithFixedDelay(retrievalTask, 30000,
- RETRIEVAL_TASK_FREQUENCY.getMillis(), TimeUnit.MILLISECONDS);
- }
-
- @Test
- public void testSubscriptionNotifyTaskIsScheduledPerConstructorParameter() {
- handler.executeAfterRegistryInit();
- verify(executorService).scheduleWithFixedDelay(subNotifyTask, 30000,
- SUBNOTIFY_TASK_FREQUENCY.getMillis(), TimeUnit.MILLISECONDS);
- }
-}
diff --git a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTaskTest.java b/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTaskTest.java
deleted file mode 100644
index 853f530be7..0000000000
--- a/tests/unit/com/raytheon/uf/edex/datadelivery/retrieval/handlers/RetrievalTaskTest.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/**
- * This software was developed and / or modified by Raytheon Company,
- * pursuant to Contract DG133W-05-CQ-1067 with the US Government.
- *
- * U.S. EXPORT CONTROLLED TECHNICAL DATA
- * This software product contains export-restricted data whose
- * export/transfer/disclosure is restricted by U.S. law. Dissemination
- * to non-U.S. persons whether in the United States or abroad requires
- * an export license or other authorization.
- *
- * Contractor Name: Raytheon Company
- * Contractor Address: 6825 Pine Street, Suite 340
- * Mail Stop B8
- * Omaha, NE 68106
- * 402.291.0100
- *
- * See the AWIPS II Master Rights File ("Master Rights File.pdf") for
- * further licensing information.
- **/
-package com.raytheon.uf.edex.datadelivery.retrieval.handlers;
-
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.is;
-import static org.junit.Assert.assertThat;
-import static org.mockito.Mockito.mock;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.annotation.DirtiesContext.ClassMode;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.transaction.annotation.Transactional;
-
-import com.google.common.eventbus.Subscribe;
-import com.raytheon.uf.common.datadelivery.event.retrieval.DataRetrievalEvent;
-import com.raytheon.uf.common.datadelivery.registry.Network;
-import com.raytheon.uf.common.datadelivery.registry.Provider.ServiceType;
-import com.raytheon.uf.common.datadelivery.retrieval.xml.Retrieval;
-import com.raytheon.uf.common.datadelivery.retrieval.xml.RetrievalAttribute;
-import com.raytheon.uf.common.dataplugin.PluginDataObject;
-import com.raytheon.uf.common.event.EventBus;
-import com.raytheon.uf.common.localization.PathManagerFactoryTest;
-import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
-import com.raytheon.uf.common.serialization.SerializationException;
-import com.raytheon.uf.common.util.FileUtil;
-import com.raytheon.uf.common.util.SpringFiles;
-import com.raytheon.uf.common.util.TestUtil;
-import com.raytheon.uf.common.util.file.FilenameFilters;
-import com.raytheon.uf.edex.database.DataAccessLayerException;
-import com.raytheon.uf.edex.datadelivery.retrieval.ServiceTypeFactory;
-import com.raytheon.uf.edex.datadelivery.retrieval.adapters.RetrievalAdapter;
-import com.raytheon.uf.edex.datadelivery.retrieval.adapters.RetrievalAdapter.TranslationException;
-import com.raytheon.uf.edex.datadelivery.retrieval.db.IRetrievalDao;
-import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecord;
-import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecord.State;
-import com.raytheon.uf.edex.datadelivery.retrieval.db.RetrievalRequestRecordPK;
-import com.raytheon.uf.edex.datadelivery.retrieval.interfaces.IRetrievalResponse;
-
-/**
- * Test {@link RetrievalTask}.
- *
- *
- *
- * SOFTWARE HISTORY
- *
- * Date Ticket# Engineer Description
- * ------------ ---------- ----------- --------------------------
- * Jan 30, 2013 1543 djohnson Initial creation
- * Feb 07, 2013 1543 djohnson Add test to simulate SBN retrieval task behavior.
- * Feb 12, 2013 1543 djohnson Retrieval responses are now sent further down the chain.
- * Feb 15, 2013 1543 djohnson Class renames.
- * Mar 05, 2013 1647 djohnson Pass wmo header strategy to constructor.
- * Mar 19, 2013 1794 djohnson RetrievalTasks integrate at a queue.
- * Apr 29, 2013 1910 djohnson Unregister from EventBus after each test.
- * Aug 09, 2013 1822 bgonzale Added parameters to processRetrievedPluginDataObjects.
- * Oct 01, 2013 2267 bgonzale Pass request parameter instead of components of request.
- * Nov 04, 2013 2506 bgonzale removed IRetrievalDao parameter.
- * Jan 15, 2014 2678 bgonzale Added Queue.
- *
- *
- *
- * @author djohnson
- * @version 1.0
- */
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { SpringFiles.UNIT_TEST_DB_BEANS_XML,
- SpringFiles.RETRIEVAL_DATADELIVERY_DAOS_XML })
-@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
-public class RetrievalTaskTest {
- /**
- * Places the plugin data object into a collection for inspection.
- */
- public class PlaceInCollectionProcessor implements
- IRetrievalPluginDataObjectsProcessor {
- public final List pluginDataObjects = new ArrayList();
-
- /**
- * {@inheritDoc}
- *
- * @return RetrievalRequestRecord
- */
- @Override
- public RetrievalRequestRecord processRetrievedPluginDataObjects(
- RetrievalResponseXml retrievalPluginDataObjects)
- throws SerializationException, TranslationException {
- final List retrievalAttributePluginDataObjects = retrievalPluginDataObjects
- .getRetrievalAttributePluginDataObjects();
- final RetrievalRequestRecord requestRecord = dao
- .getById(retrievalPluginDataObjects.getRequestRecord());
- final Retrieval retrieval = requestRecord.getRetrievalObj();
- final ServiceType serviceType = retrieval.getServiceType();
- final RetrievalAdapter serviceRetrievalAdapter = ServiceTypeFactory
- .retrieveServiceRetrievalAdapter(serviceType);
- final Iterator attributesIter = retrieval
- .getAttributes().iterator();
-
- for (RetrievalResponseWrapper pluginDataObjectEntry : retrievalAttributePluginDataObjects) {
-
- if (!attributesIter.hasNext()) {
- throw new RuntimeException(
- "Did not find a RetrievalAttribute to match the retrieval response!");
- }
-
- // Restore the attribute xml prior to processing the response
- final IRetrievalResponse response = pluginDataObjectEntry
- .getRetrievalResponse();
- response.setAttribute(attributesIter.next());
-
- final Map processed = serviceRetrievalAdapter
- .processResponse(response);
- for (PluginDataObject[] pdos : processed.values()) {
- pluginDataObjects.addAll(Arrays.asList(pdos));
- }
- }
- return requestRecord;
- }
- }
-
- private RetrievalRequestRecord opsnetRetrieval;
-
- private RetrievalRequestRecord sbnRetrieval;
-
- @Autowired
- @Qualifier(value = "retrievalDao")
- private IRetrievalDao dao;
-
- private final ConcurrentLinkedQueue retrievalQueue = new ConcurrentLinkedQueue();
-
- private final PlaceInCollectionProcessor retrievedDataProcessor = new PlaceInCollectionProcessor();
-
- private final List eventsReceived = new ArrayList();
-
- @Before
- public void setUp() throws RegistryHandlerException {
- PathManagerFactoryTest.initLocalization();
-
- opsnetRetrieval = RetrievalRequestRecordFixture.INSTANCE.get(1);
- sbnRetrieval = RetrievalRequestRecordFixture.INSTANCE.get(2);
- opsnetRetrieval.setNetwork(Network.OPSNET);
- sbnRetrieval.setNetwork(Network.SBN);
-
- EventBus.register(this);
- }
-
- @After
- public void tearDown() {
- EventBus.unregister(this);
- }
-
- @Test
- public void processesRetrievalForItsSpecifiedNetwork()
- throws DataAccessLayerException {
-
- stageRetrievals();
-
- runRetrievalTask();
-
- verifyCorrectStateForRetrieval(opsnetRetrieval, State.COMPLETED);
- }
-
- @Test
- public void storesPluginDataObjectsForItsSpecifiedNetwork()
- throws DataAccessLayerException, SerializationException {
-
- stageRetrievals();
-
- runRetrievalTask();
-
- assertThat(retrievedDataProcessor.pluginDataObjects,
- hasSize(opsnetRetrieval.getRetrievalObj().getAttributes()
- .size()));
- }
-
- @Ignore("dataRetrievalEvent is no longer sent separately from storage, perhaps restore it later?")
- public void dataRetrievalEventIsSentForItsSpecifiedNetwork()
- throws Exception {
-
- stageRetrievals();
-
- runRetrievalTask();
-
- final int numberOfRetrievalAttributes = opsnetRetrieval
- .getRetrievalObj().getAttributes().size();
- assertThat(eventsReceived, hasSize(numberOfRetrievalAttributes));
- // TODO: Is there a way to distinguish between the events sent by the
- // separate retrieval attributes, e.g. to make sure each attribute sent
- // an event and not one attribute sent two?
- }
-
- // TODO: Add tests for one retrieval failing and another succeeding, make
- // sure correct events are sent and correct number of plugin data objects
- // generated
-
- @Test
- public void doesNotProcessRetrievalForAnotherNetwork()
- throws DataAccessLayerException {
-
- stageRetrievals();
-
- runRetrievalTask();
-
- verifyCorrectStateForRetrieval(sbnRetrieval, State.PENDING);
- }
-
- @Test
- public void retrievalTaskCanStoreDataToDirectoryThatAnotherTaskProcesses()
- throws Exception {
- dao.create(RetrievalRequestRecordFixture.INSTANCE.get());
-
- IRetrievalsFinder retrievalDataFinder = new PerformRetrievalsThenReturnFinder(
- retrievalQueue, dao);
-
- final ConcurrentLinkedQueue retrievalQueue = new ConcurrentLinkedQueue();
- final File testDirectory = TestUtil
- .setupTestClassDir(RetrievalTaskTest.class);
- IRetrievalPluginDataObjectsProcessor serializeToDirectory = new SerializeRetrievedDataToDirectory(
- testDirectory, new AlwaysSameWmoHeader("SMYG10 LYBM 280000"),
- dao);
-
- RetrievalTask downloadTask = new RetrievalTask(Network.OPSNET,
- retrievalDataFinder, serializeToDirectory,
- mock(IRetrievalResponseCompleter.class));
- RetrievalTask readDownloadsTask = new RetrievalTask(Network.OPSNET,
- new DeserializeRetrievedDataFromIngest(retrievalQueue),
- retrievedDataProcessor, new RetrievalResponseCompleter(
- mock(SubscriptionNotifyTask.class), dao));
-
- downloadTask.run();
-
- final List all = dao.getAll();
- for (RetrievalRequestRecord request : all) {
- assertThat(request.getState(), is(State.RUNNING));
- }
-
- for (File file : FileUtil.listFiles(testDirectory,
- FilenameFilters.ACCEPT_FILES, false)) {
- retrievalQueue.add(FileUtil.file2String(file));
- }
-
- readDownloadsTask.run();
-
- final List allRetrievals = dao.getAll();
- assertThat(allRetrievals, hasSize(1));
- assertThat(retrievedDataProcessor.pluginDataObjects, hasSize(2));
-
- for (RetrievalRequestRecord request : allRetrievals) {
- assertThat(request.getState(), is(State.COMPLETED));
- }
-
- }
-
- /**
- * Stage the retrievals in the database.
- */
- @Transactional
- private void stageRetrievals() {
-
- dao.create(opsnetRetrieval);
- retrievalQueue.add(opsnetRetrieval.getId());
- dao.create(sbnRetrieval);
- retrievalQueue.add(sbnRetrieval.getId());
- }
-
- /**
- * Run the actual retrieval task.
- */
- private void runRetrievalTask() {
- // Create required strategies for finding, processing, and completing
- // retrievals
- final IRetrievalsFinder retrievalDataFinder = new PerformRetrievalsThenReturnFinder(
- retrievalQueue, dao);
- final IRetrievalResponseCompleter retrievalCompleter = new RetrievalResponseCompleter(
- mock(SubscriptionNotifyTask.class), dao);
-
- new RetrievalTask(Network.OPSNET, retrievalDataFinder,
- retrievedDataProcessor, retrievalCompleter).run();
- }
-
- /**
- * Verify the retrieval record is in the expected state.
- *
- * @param retrieval
- * the retrieval
- * @param state
- * the expected state
- * @throws DataAccessLayerException
- */
- private void verifyCorrectStateForRetrieval(
- RetrievalRequestRecord retrieval, State state)
- throws DataAccessLayerException {
- RetrievalRequestRecord recordInDb = dao
- .getRequests(retrieval.getId().getSubscriptionName())
- .iterator().next();
-
- assertThat(recordInDb.getState(), is(equalTo(state)));
- }
-
- /**
- * This method will be invoked by the EventBus when a data retrieval event
- * is sent.
- *
- * @param event
- * the event
- */
- @Subscribe
- public void receivedDataDeliveryEvent(DataRetrievalEvent event) {
- eventsReceived.add(event);
- }
-}