diff --git a/cave/com.raytheon.uf.viz.datadelivery.feature/feature.xml b/cave/com.raytheon.uf.viz.datadelivery.feature/feature.xml
index d98a45b0ea..0cbd7f3762 100644
--- a/cave/com.raytheon.uf.viz.datadelivery.feature/feature.xml
+++ b/cave/com.raytheon.uf.viz.datadelivery.feature/feature.xml
@@ -99,6 +99,13 @@
version="0.0.0"
unpack="false"/>
+
+
+ class="com.raytheon.uf.common.datadelivery.service.SendToServerSubscriptionNotificationService" />
+
+
@@ -28,6 +31,7 @@
+
*
@@ -68,6 +71,9 @@ public class DeleteGroupDlg extends CaveSWTDialog {
private final IUFStatusHandler statusHandler = UFStatus
.getHandler(DeleteGroupDlg.class);
+ private final IGroupDefinitionService groupService = DataDeliveryServices
+ .getGroupDefinitionService();
+
/**
* @param shell
* @param groupAction
@@ -144,8 +150,11 @@ public class DeleteGroupDlg extends CaveSWTDialog {
+ groupName + "?")) {
try {
- DataDeliveryHandlers.getGroupDefinitionHandler()
- .deleteByName(groupName);
+ groupService
+ .deleteGroupDefinition(
+ DataDeliveryHandlers
+ .getGroupDefinitionHandler()
+ .getByName(groupName));
groupAction.loadGroupNames();
return true;
} catch (RegistryHandlerException e) {
diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/GroupAddDlg.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/GroupAddDlg.java
index c3336c42c2..fa1c062988 100644
--- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/GroupAddDlg.java
+++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/GroupAddDlg.java
@@ -34,6 +34,7 @@ import org.eclipse.swt.widgets.Shell;
import com.raytheon.uf.common.datadelivery.registry.GroupDefinition;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
+import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/RequestFromServerPermissionsService.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/RequestFromServerPermissionsService.java
index 5876cde154..bd3426dc3f 100644
--- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/RequestFromServerPermissionsService.java
+++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/RequestFromServerPermissionsService.java
@@ -19,12 +19,14 @@
**/
package com.raytheon.uf.viz.datadelivery.subscription;
+import com.raytheon.uf.common.auth.resp.SuccessfulExecution;
import com.raytheon.uf.common.auth.user.IUser;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.request.DataDeliveryAuthRequest;
+import com.raytheon.uf.common.datadelivery.request.DataDeliveryConstants;
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
+import com.raytheon.uf.common.serialization.comm.RequestRouter;
import com.raytheon.uf.viz.core.exception.VizException;
-import com.raytheon.uf.viz.core.requests.ThriftClient;
/**
* {@link IPermissionsService} implementation that requests permissions from the
@@ -37,6 +39,7 @@ import com.raytheon.uf.viz.core.requests.ThriftClient;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jan 04, 2013 1441 djohnson Initial creation
+ * Jan 21, 2013 1441 djohnson Use RequestRouter.
*
*
*
@@ -93,8 +96,13 @@ public class RequestFromServerPermissionsService implements IPermissionsService
*/
private DataDeliveryAuthRequest sendAuthorizationRequest(
DataDeliveryAuthRequest request) throws VizException {
- return (DataDeliveryAuthRequest) ThriftClient
- .sendPrivilegedRequest(request);
+ try {
+ return (DataDeliveryAuthRequest) ((SuccessfulExecution) RequestRouter
+ .route(request, DataDeliveryConstants.DATA_DELIVERY_SERVER))
+ .getResponse();
+ } catch (Exception e) {
+ throw new VizException(e);
+ }
}
/**
diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionManagerDlg.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionManagerDlg.java
index cdd5b8ed02..e3ec6a4950 100644
--- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionManagerDlg.java
+++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionManagerDlg.java
@@ -53,6 +53,7 @@ import com.raytheon.uf.common.auth.user.IUser;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
+import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
import com.raytheon.uf.common.registry.handler.RegistryObjectHandlers;
import com.raytheon.uf.common.status.IUFStatusHandler;
diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionService.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionService.java
index 986e8ffc7b..8fc0783c17 100644
--- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionService.java
+++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionService.java
@@ -43,6 +43,7 @@ import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
import com.raytheon.uf.common.datadelivery.registry.handlers.IPendingSubscriptionHandler;
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
+import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionTableComp.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionTableComp.java
index 7611ac3fab..10c8330bd9 100644
--- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionTableComp.java
+++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SubscriptionTableComp.java
@@ -47,12 +47,12 @@ import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
import com.raytheon.uf.common.auth.user.IUser;
-import com.raytheon.uf.common.datadelivery.event.notification.SubscriptionNotificationResponse;
import com.raytheon.uf.common.datadelivery.registry.PendingSubscription;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
+import com.raytheon.uf.common.datadelivery.service.SubscriptionNotificationResponse;
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
import com.raytheon.uf.common.registry.handler.RegistryObjectHandlers;
import com.raytheon.uf.common.status.IUFStatusHandler;
diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubApprovalTableComp.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubApprovalTableComp.java
index a30fca28e5..20b78e220a 100644
--- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubApprovalTableComp.java
+++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubApprovalTableComp.java
@@ -33,14 +33,14 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
-import com.raytheon.uf.common.datadelivery.event.notification.ApprovedPendingSubscriptionNotificationResponse;
-import com.raytheon.uf.common.datadelivery.event.notification.BaseSubscriptionNotificationResponse;
-import com.raytheon.uf.common.datadelivery.event.notification.DeniedPendingSubscriptionNotificationResponse;
-import com.raytheon.uf.common.datadelivery.event.notification.PendingSubscriptionNotificationResponse;
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription;
import com.raytheon.uf.common.datadelivery.registry.PendingSubscription;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
+import com.raytheon.uf.common.datadelivery.service.ApprovedPendingSubscriptionNotificationResponse;
+import com.raytheon.uf.common.datadelivery.service.BaseSubscriptionNotificationResponse;
+import com.raytheon.uf.common.datadelivery.service.DeniedPendingSubscriptionNotificationResponse;
+import com.raytheon.uf.common.datadelivery.service.PendingSubscriptionNotificationResponse;
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubscriptionApprovalDlg.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubscriptionApprovalDlg.java
index 304d826ca4..49a2d98101 100644
--- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubscriptionApprovalDlg.java
+++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/approve/SubscriptionApprovalDlg.java
@@ -40,6 +40,7 @@ import com.raytheon.uf.common.datadelivery.registry.PendingSubscription;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.handlers.IPendingSubscriptionHandler;
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
+import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
import com.raytheon.uf.common.registry.handler.RegistryObjectHandlers;
import com.raytheon.uf.common.status.IUFStatusHandler;
@@ -57,7 +58,6 @@ import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
import com.raytheon.uf.viz.datadelivery.subscription.CancelForceApplyAndIncreaseLatencyDisplayText;
import com.raytheon.uf.viz.datadelivery.subscription.IPermissionsService;
import com.raytheon.uf.viz.datadelivery.subscription.IPermissionsService.IAuthorizedPermissionResponse;
-import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionNotificationService;
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService;
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService.ISubscriptionServiceResult;
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionService.ForceApplyPromptResponse;
diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/presenter/CreateSubscriptionDlgPresenter.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/presenter/CreateSubscriptionDlgPresenter.java
index 2fd942923b..03e2b4caa2 100644
--- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/presenter/CreateSubscriptionDlgPresenter.java
+++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/presenter/CreateSubscriptionDlgPresenter.java
@@ -48,6 +48,7 @@ import com.raytheon.uf.common.datadelivery.registry.Utils.SubscriptionStatus;
import com.raytheon.uf.common.datadelivery.registry.handlers.IPendingSubscriptionHandler;
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
import com.raytheon.uf.common.datadelivery.request.DataDeliveryPermission;
+import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
import com.raytheon.uf.common.registry.handler.RegistryObjectHandlers;
@@ -62,7 +63,6 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
import com.raytheon.uf.viz.datadelivery.subscription.CancelForceApplyAndIncreaseLatencyDisplayText;
import com.raytheon.uf.viz.datadelivery.subscription.GroupDefinitionManager;
-import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionNotificationService;
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService;
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService.ISubscriptionServiceResult;
import com.raytheon.uf.viz.datadelivery.subscription.view.ICreateSubscriptionDlgView;
diff --git a/cots/org.junit/.classpath b/cots/org.junit/.classpath
index 7363c566f4..e8a366c3b4 100644
--- a/cots/org.junit/.classpath
+++ b/cots/org.junit/.classpath
@@ -1,5 +1,7 @@
+
+
@@ -10,6 +12,5 @@
-
diff --git a/cots/org.junit/META-INF/MANIFEST.MF b/cots/org.junit/META-INF/MANIFEST.MF
index 7f2d8e6aba..e357195e12 100644
--- a/cots/org.junit/META-INF/MANIFEST.MF
+++ b/cots/org.junit/META-INF/MANIFEST.MF
@@ -11,7 +11,8 @@ Bundle-ClassPath: jmock-2.0.0.jar,
mockito-all-1.9.0.jar,
objenesis-1.2.jar,
powermock-mockito-1.4.12-full.jar,
- junit-4.10.jar
+ hamcrest-all-1.3.jar,
+ junit-dep-4.11.jar
Export-Package: javassist,
javassist.bytecode,
javassist.bytecode.analysis,
@@ -43,8 +44,28 @@ Export-Package: javassist,
net.sf.cglib.transform.impl,
net.sf.cglib.util,
org.hamcrest,
+ org.hamcrest.beans,
+ org.hamcrest.collection,
org.hamcrest.core,
+ org.hamcrest.generator,
+ org.hamcrest.generator.config,
+ org.hamcrest.generator.qdox,
+ org.hamcrest.generator.qdox.ant,
+ org.hamcrest.generator.qdox.directorywalker,
+ org.hamcrest.generator.qdox.junit,
+ org.hamcrest.generator.qdox.model,
+ org.hamcrest.generator.qdox.model.annotation,
+ org.hamcrest.generator.qdox.model.util,
+ org.hamcrest.generator.qdox.parser,
+ org.hamcrest.generator.qdox.parser.impl,
+ org.hamcrest.generator.qdox.parser.structs,
+ org.hamcrest.generator.qdox.tools,
+ org.hamcrest.integration,
org.hamcrest.internal,
+ org.hamcrest.number,
+ org.hamcrest.object,
+ org.hamcrest.text,
+ org.hamcrest.xml,
org.jmock,
org.jmock.api,
org.jmock.example.qcon,
diff --git a/cots/org.junit/build.properties b/cots/org.junit/build.properties
index da97b1e7e3..4679b8281a 100644
--- a/cots/org.junit/build.properties
+++ b/cots/org.junit/build.properties
@@ -8,4 +8,5 @@ bin.includes = META-INF/,\
mockito-all-1.9.0.jar,\
objenesis-1.2.jar,\
powermock-mockito-1.4.12-full.jar,\
- junit-4.10.jar
+ hamcrest-all-1.3.jar,\
+ junit-dep-4.11.jar
diff --git a/cots/org.junit/hamcrest-all-1.3-sources.jar b/cots/org.junit/hamcrest-all-1.3-sources.jar
new file mode 100644
index 0000000000..77dfc35d1f
Binary files /dev/null and b/cots/org.junit/hamcrest-all-1.3-sources.jar differ
diff --git a/cots/org.junit/hamcrest-all-1.3.jar b/cots/org.junit/hamcrest-all-1.3.jar
new file mode 100644
index 0000000000..6f62ba00c7
Binary files /dev/null and b/cots/org.junit/hamcrest-all-1.3.jar differ
diff --git a/cots/org.junit/junit-4.10-src.jar b/cots/org.junit/junit-4.10-src.jar
deleted file mode 100644
index 1449d28b5b..0000000000
Binary files a/cots/org.junit/junit-4.10-src.jar and /dev/null differ
diff --git a/cots/org.junit/junit-4.10.jar b/cots/org.junit/junit-4.10.jar
deleted file mode 100644
index bf5c0b9c6a..0000000000
Binary files a/cots/org.junit/junit-4.10.jar and /dev/null differ
diff --git a/cots/org.junit/junit-4.11-src.jar b/cots/org.junit/junit-4.11-src.jar
new file mode 100644
index 0000000000..80801569a5
Binary files /dev/null and b/cots/org.junit/junit-4.11-src.jar differ
diff --git a/cots/org.junit/junit-dep-4.11.jar b/cots/org.junit/junit-dep-4.11.jar
new file mode 100644
index 0000000000..93c717aa8a
Binary files /dev/null and b/cots/org.junit/junit-dep-4.11.jar differ
diff --git a/edexOsgi/build.edex/edex/.gitignore b/edexOsgi/build.edex/edex/.gitignore
new file mode 100644
index 0000000000..849ddff3b7
--- /dev/null
+++ b/edexOsgi/build.edex/edex/.gitignore
@@ -0,0 +1 @@
+dist/
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/META-INF/MANIFEST.MF
index e5cd0a4626..9a73f1811e 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/META-INF/MANIFEST.MF
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/META-INF/MANIFEST.MF
@@ -23,7 +23,8 @@ Require-Bundle: com.raytheon.uf.common.registry.schemas.ebxml;bundle-version="1.
com.raytheon.uf.common.gridcoverage;bundle-version="1.0.0",
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
- javax.measure;bundle-version="1.0.0"
+ javax.measure;bundle-version="1.0.0",
+ com.raytheon.uf.common.datadelivery.request;bundle-version="1.0.0"
Export-Package: com.raytheon.uf.common.datadelivery.registry,
com.raytheon.uf.common.datadelivery.registry.ebxml,
com.raytheon.uf.common.datadelivery.registry.handlers
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/GroupDefinitionServiceRequest.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/GroupDefinitionServiceRequest.java
new file mode 100644
index 0000000000..1bb6016c1e
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/GroupDefinitionServiceRequest.java
@@ -0,0 +1,85 @@
+/**
+ * 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.common.datadelivery.registry;
+
+import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
+
+/**
+ * Service request for {@link GroupDefinition}s.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2013 1441 djohnson Initial creation
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+@DynamicSerialize
+public class GroupDefinitionServiceRequest extends AbstractPrivilegedRequest {
+
+ public static enum Type {
+ DELETE;
+ }
+
+ @DynamicSerializeElement
+ private GroupDefinition group;
+
+ @DynamicSerializeElement
+ private Type type;
+
+ /**
+ * @return the type
+ */
+ public Type getType() {
+ return type;
+ }
+
+ /**
+ * @param type
+ * the type to set
+ */
+ public void setType(Type type) {
+ this.type = type;
+ }
+
+ /**
+ * @return the group
+ */
+ public GroupDefinition getGroup() {
+ return group;
+ }
+
+ /**
+ * @param group
+ * the group to set
+ */
+ public void setGroup(GroupDefinition group) {
+ this.group = group;
+ }
+
+}
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.request/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.common.datadelivery.request/META-INF/MANIFEST.MF
index ff054aa358..9c6d895d32 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.request/META-INF/MANIFEST.MF
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.request/META-INF/MANIFEST.MF
@@ -8,4 +8,5 @@ Require-Bundle: com.raytheon.uf.common.auth;bundle-version="1.12.1174",
com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
com.raytheon.uf.common.util;bundle-version="1.12.1174"
Export-Package: com.raytheon.uf.common.datadelivery.request;uses:="com.raytheon.uf.common.auth.req,com.raytheon.uf.common.serialization",
- com.raytheon.uf.common.datadelivery.request.user;uses:="com.raytheon.uf.common.auth.user"
+ com.raytheon.uf.common.datadelivery.request.user;uses:="com.raytheon.uf.common.auth.user",
+ com.raytheon.uf.common.datadelivery.service
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.request/src/com/raytheon/uf/common/datadelivery/service/BaseDataDeliveryService.java b/edexOsgi/com.raytheon.uf.common.datadelivery.request/src/com/raytheon/uf/common/datadelivery/service/BaseDataDeliveryService.java
new file mode 100644
index 0000000000..0eec53b63b
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.request/src/com/raytheon/uf/common/datadelivery/service/BaseDataDeliveryService.java
@@ -0,0 +1,69 @@
+/**
+ * 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.common.datadelivery.service;
+
+import java.rmi.RemoteException;
+
+import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest;
+import com.raytheon.uf.common.auth.resp.SuccessfulExecution;
+import com.raytheon.uf.common.datadelivery.request.DataDeliveryConstants;
+import com.raytheon.uf.common.serialization.ExceptionWrapper;
+import com.raytheon.uf.common.serialization.comm.RequestRouter;
+import com.raytheon.uf.common.serialization.comm.response.ServerErrorResponse;
+
+/**
+ * Base class for services that send requests to the data delivery server.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2013 1441 djohnson Initial creation
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+public class BaseDataDeliveryService {
+
+ /**
+ * Send a request to the data delivery server.
+ *
+ * @param request
+ * @return
+ * @throws Exception
+ */
+ protected Object sendRequest(T request) throws Exception {
+ Object object = RequestRouter.route(request,
+ DataDeliveryConstants.DATA_DELIVERY_SERVER);
+ if (object instanceof SuccessfulExecution) {
+ SuccessfulExecution response = (SuccessfulExecution) object;
+ return response.getResponse();
+ } else {
+ throw new RemoteException("Error communicating with the server!",
+ ExceptionWrapper
+ .unwrapThrowable(((ServerErrorResponse) object)
+ .getException()));
+ }
+ }
+}
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.service/.classpath b/edexOsgi/com.raytheon.uf.common.datadelivery.service/.classpath
new file mode 100644
index 0000000000..5fb20a28e5
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/.classpath
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.service/.project b/edexOsgi/com.raytheon.uf.common.datadelivery.service/.project
new file mode 100644
index 0000000000..0cee36f7f5
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/.project
@@ -0,0 +1,28 @@
+
+
+ com.raytheon.uf.common.datadelivery.service
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.service/.settings/org.eclipse.jdt.core.prefs b/edexOsgi/com.raytheon.uf.common.datadelivery.service/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..28b23bdfac
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Tue Feb 14 11:27:19 CST 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.service/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.common.datadelivery.service/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..242708d98c
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/META-INF/MANIFEST.MF
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: com.raytheon.uf.common.datadelivery.service
+Bundle-SymbolicName: com.raytheon.uf.common.datadelivery.service
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: RAYTHEON
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: javax.persistence
+Require-Bundle:
+ com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
+ com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174",
+ com.raytheon.uf.common.datadelivery.registry;bundle-version="1.0.0",
+ com.raytheon.uf.common.status;bundle-version="1.12.1174",
+ com.raytheon.uf.common.datadelivery.request;bundle-version="1.0.0",
+ com.raytheon.uf.common.registry.ebxml;bundle-version="1.0.0",
+ com.raytheon.uf.common.auth;bundle-version="1.12.1174"
+Export-Package:
+ com.raytheon.uf.common.datadelivery.service
+
+
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.service/build.properties b/edexOsgi/com.raytheon.uf.common.datadelivery.service/build.properties
new file mode 100644
index 0000000000..9f81850f2c
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/build.properties
@@ -0,0 +1,6 @@
+source.. = src/,\
+ res/
+output.. = bin/
+bin.includes = META-INF/,\
+ res/,\
+ .
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.service/res/spring/datadelivery-service.xml b/edexOsgi/com.raytheon.uf.common.datadelivery.service/res/spring/datadelivery-service.xml
new file mode 100644
index 0000000000..67c539da2f
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/res/spring/datadelivery-service.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/ApprovedPendingSubscriptionNotificationRequest.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/ApprovedPendingSubscriptionNotificationRequest.java
similarity index 96%
rename from edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/ApprovedPendingSubscriptionNotificationRequest.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/ApprovedPendingSubscriptionNotificationRequest.java
index 3cae3fca16..3f28d090b0 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/ApprovedPendingSubscriptionNotificationRequest.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/ApprovedPendingSubscriptionNotificationRequest.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.datadelivery.event.notification;
+package com.raytheon.uf.common.datadelivery.service;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/ApprovedPendingSubscriptionNotificationResponse.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/ApprovedPendingSubscriptionNotificationResponse.java
similarity index 95%
rename from edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/ApprovedPendingSubscriptionNotificationResponse.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/ApprovedPendingSubscriptionNotificationResponse.java
index 97abe5e0d1..af357e0b26 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/ApprovedPendingSubscriptionNotificationResponse.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/ApprovedPendingSubscriptionNotificationResponse.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.datadelivery.event.notification;
+package com.raytheon.uf.common.datadelivery.service;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/BaseSubscriptionNotificationRequest.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/BaseSubscriptionNotificationRequest.java
similarity index 97%
rename from edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/BaseSubscriptionNotificationRequest.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/BaseSubscriptionNotificationRequest.java
index 99cbd26efe..3670927e41 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/BaseSubscriptionNotificationRequest.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/BaseSubscriptionNotificationRequest.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.datadelivery.event.notification;
+package com.raytheon.uf.common.datadelivery.service;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.serialization.ISerializableObject;
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/BaseSubscriptionNotificationResponse.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/BaseSubscriptionNotificationResponse.java
similarity index 97%
rename from edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/BaseSubscriptionNotificationResponse.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/BaseSubscriptionNotificationResponse.java
index 567f1da440..b879907bc9 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/BaseSubscriptionNotificationResponse.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/BaseSubscriptionNotificationResponse.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.datadelivery.event.notification;
+package com.raytheon.uf.common.datadelivery.service;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler;
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/DeniedPendingSubscriptionNotificationRequest.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/DeniedPendingSubscriptionNotificationRequest.java
similarity index 96%
rename from edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/DeniedPendingSubscriptionNotificationRequest.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/DeniedPendingSubscriptionNotificationRequest.java
index 08dcacf8da..d5183fa270 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/DeniedPendingSubscriptionNotificationRequest.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/DeniedPendingSubscriptionNotificationRequest.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.datadelivery.event.notification;
+package com.raytheon.uf.common.datadelivery.service;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/DeniedPendingSubscriptionNotificationResponse.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/DeniedPendingSubscriptionNotificationResponse.java
similarity index 96%
rename from edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/DeniedPendingSubscriptionNotificationResponse.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/DeniedPendingSubscriptionNotificationResponse.java
index 3a3c60722f..cb7cfc7971 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/DeniedPendingSubscriptionNotificationResponse.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/DeniedPendingSubscriptionNotificationResponse.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.datadelivery.event.notification;
+package com.raytheon.uf.common.datadelivery.service;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/GroupDefinitionService.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/GroupDefinitionService.java
new file mode 100644
index 0000000000..ed7777375d
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/GroupDefinitionService.java
@@ -0,0 +1,75 @@
+/**
+ * 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.common.datadelivery.service;
+
+import com.raytheon.uf.common.datadelivery.registry.GroupDefinition;
+import com.raytheon.uf.common.datadelivery.registry.GroupDefinitionServiceRequest;
+import com.raytheon.uf.common.datadelivery.registry.GroupDefinitionServiceRequest.Type;
+import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
+
+/**
+ * Base implementation of {@link IGroupDefinitionService}.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2013 1441 djohnson Initial creation
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+
+public class GroupDefinitionService extends
+ BaseDataDeliveryService implements
+ IGroupDefinitionService {
+
+ /**
+ * {@inheritDoc}
+ * @throws Exception
+ */
+ @Override
+ public void deleteGroupDefinition(GroupDefinition group)
+ throws RegistryHandlerException {
+ GroupDefinitionServiceRequest request = new GroupDefinitionServiceRequest();
+ request.setGroup(group);
+ request.setType(Type.DELETE);
+
+ sendRequest(request);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected Object sendRequest(GroupDefinitionServiceRequest request)
+ throws RegistryHandlerException {
+ try {
+ return super.sendRequest(request);
+ } catch (Exception e) {
+ throw new RegistryHandlerException(e);
+ }
+ }
+
+}
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/IGroupDefinitionService.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/IGroupDefinitionService.java
new file mode 100644
index 0000000000..d99f0a96bb
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/IGroupDefinitionService.java
@@ -0,0 +1,52 @@
+/**
+ * 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.common.datadelivery.service;
+
+import com.raytheon.uf.common.datadelivery.registry.GroupDefinition;
+import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
+
+/**
+ * Defines the service to interact with {@link GroupDefinition} objects.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2013 1441 djohnson Initial creation
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+
+public interface IGroupDefinitionService {
+ /**
+ * Delete the group definition.
+ *
+ * @param group
+ * the group
+ * @throws RegistryHandlerException
+ */
+ void deleteGroupDefinition(GroupDefinition group)
+ throws RegistryHandlerException;
+}
diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/ISubscriptionNotificationService.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/ISubscriptionNotificationService.java
similarity index 98%
rename from cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/ISubscriptionNotificationService.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/ISubscriptionNotificationService.java
index 98216ec787..4394219ff2 100644
--- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/ISubscriptionNotificationService.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/ISubscriptionNotificationService.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.viz.datadelivery.subscription;
+package com.raytheon.uf.common.datadelivery.service;
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/PendingSubscriptionNotificationRequest.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/PendingSubscriptionNotificationRequest.java
similarity index 96%
rename from edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/PendingSubscriptionNotificationRequest.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/PendingSubscriptionNotificationRequest.java
index a531ea5629..af4cc15ad5 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/PendingSubscriptionNotificationRequest.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/PendingSubscriptionNotificationRequest.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.datadelivery.event.notification;
+package com.raytheon.uf.common.datadelivery.service;
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/PendingSubscriptionNotificationResponse.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/PendingSubscriptionNotificationResponse.java
similarity index 96%
rename from edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/PendingSubscriptionNotificationResponse.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/PendingSubscriptionNotificationResponse.java
index ef857f96a0..f88a77832f 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/PendingSubscriptionNotificationResponse.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/PendingSubscriptionNotificationResponse.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.datadelivery.event.notification;
+package com.raytheon.uf.common.datadelivery.service;
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription;
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SendToServerSubscriptionNotificationService.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/SendToServerSubscriptionNotificationService.java
similarity index 93%
rename from cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SendToServerSubscriptionNotificationService.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/SendToServerSubscriptionNotificationService.java
index 4153242b37..ef4645d3e2 100644
--- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/subscription/SendToServerSubscriptionNotificationService.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/SendToServerSubscriptionNotificationService.java
@@ -17,13 +17,8 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.viz.datadelivery.subscription;
+package com.raytheon.uf.common.datadelivery.service;
-import com.raytheon.uf.common.datadelivery.event.notification.ApprovedPendingSubscriptionNotificationRequest;
-import com.raytheon.uf.common.datadelivery.event.notification.BaseSubscriptionNotificationRequest;
-import com.raytheon.uf.common.datadelivery.event.notification.DeniedPendingSubscriptionNotificationRequest;
-import com.raytheon.uf.common.datadelivery.event.notification.PendingSubscriptionNotificationRequest;
-import com.raytheon.uf.common.datadelivery.event.notification.SubscriptionNotificationRequest;
import com.raytheon.uf.common.datadelivery.registry.InitialPendingSubscription;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.request.DataDeliveryConstants;
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/SubscriptionNotificationRequest.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/SubscriptionNotificationRequest.java
similarity index 96%
rename from edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/SubscriptionNotificationRequest.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/SubscriptionNotificationRequest.java
index 18774bdd64..261aade582 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/SubscriptionNotificationRequest.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/SubscriptionNotificationRequest.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.datadelivery.event.notification;
+package com.raytheon.uf.common.datadelivery.service;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/SubscriptionNotificationResponse.java b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/SubscriptionNotificationResponse.java
similarity index 96%
rename from edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/SubscriptionNotificationResponse.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/SubscriptionNotificationResponse.java
index f9c81eed46..b0c5d73482 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.event/src/com/raytheon/uf/common/datadelivery/event/notification/SubscriptionNotificationResponse.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.service/src/com/raytheon/uf/common/datadelivery/service/SubscriptionNotificationResponse.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.datadelivery.event.notification;
+package com.raytheon.uf.common.datadelivery.service;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.event/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.datadelivery.event/META-INF/MANIFEST.MF
index df1cbbaed8..49bf0e89f1 100644
--- a/edexOsgi/com.raytheon.uf.edex.datadelivery.event/META-INF/MANIFEST.MF
+++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.event/META-INF/MANIFEST.MF
@@ -19,4 +19,5 @@ Require-Bundle: com.google.guava;bundle-version="1.0.0",
com.raytheon.uf.common.event;bundle-version="1.0.0",
com.raytheon.uf.common.datadelivery.registry;bundle-version="1.0.0",
com.raytheon.uf.common.registry.event;bundle-version="1.0.0",
- com.raytheon.uf.common.registry.ebxml;bundle-version="1.0.0"
+ com.raytheon.uf.common.registry.ebxml;bundle-version="1.0.0",
+ com.raytheon.uf.common.datadelivery.service;bundle-version="1.0.0"
diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.event/res/spring/event-datadelivery.xml b/edexOsgi/com.raytheon.uf.edex.datadelivery.event/res/spring/event-datadelivery.xml
index 95920aaa57..de3b7a62fd 100644
--- a/edexOsgi/com.raytheon.uf.edex.datadelivery.event/res/spring/event-datadelivery.xml
+++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.event/res/spring/event-datadelivery.xml
@@ -24,19 +24,19 @@
-
+
-
+
-
+
-
+
diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.event/src/com/raytheon/uf/edex/datadelivery/event/handler/SubscriptionNotificationHandler.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.event/src/com/raytheon/uf/edex/datadelivery/event/handler/SubscriptionNotificationHandler.java
index 8af26056c7..cb31c53e84 100644
--- a/edexOsgi/com.raytheon.uf.edex.datadelivery.event/src/com/raytheon/uf/edex/datadelivery/event/handler/SubscriptionNotificationHandler.java
+++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.event/src/com/raytheon/uf/edex/datadelivery/event/handler/SubscriptionNotificationHandler.java
@@ -21,11 +21,11 @@ package com.raytheon.uf.edex.datadelivery.event.handler;
import java.util.Calendar;
-import com.raytheon.uf.common.datadelivery.event.notification.BaseSubscriptionNotificationRequest;
-import com.raytheon.uf.common.datadelivery.event.notification.BaseSubscriptionNotificationResponse;
import com.raytheon.uf.common.datadelivery.event.notification.NotificationRecord;
import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler;
+import com.raytheon.uf.common.datadelivery.service.BaseSubscriptionNotificationRequest;
+import com.raytheon.uf.common.datadelivery.service.BaseSubscriptionNotificationResponse;
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.feature/feature.xml b/edexOsgi/com.raytheon.uf.edex.datadelivery.feature/feature.xml
index 7420fa1438..af9645414a 100644
--- a/edexOsgi/com.raytheon.uf.edex.datadelivery.feature/feature.xml
+++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.feature/feature.xml
@@ -133,6 +133,13 @@
version="0.0.0"
unpack="false"/>
+
+
-
+
+
+
+
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.service/src/com/raytheon/uf/edex/datadelivery/service/services/GroupDefinitionServiceHandler.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.service/src/com/raytheon/uf/edex/datadelivery/service/services/GroupDefinitionServiceHandler.java
new file mode 100644
index 0000000000..c2b9abb06c
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.service/src/com/raytheon/uf/edex/datadelivery/service/services/GroupDefinitionServiceHandler.java
@@ -0,0 +1,131 @@
+/**
+ * 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.service.services;
+
+import java.util.List;
+
+import com.raytheon.uf.common.auth.exception.AuthorizationException;
+import com.raytheon.uf.common.auth.user.IUser;
+import com.raytheon.uf.common.datadelivery.registry.GroupDefinition;
+import com.raytheon.uf.common.datadelivery.registry.GroupDefinitionServiceRequest;
+import com.raytheon.uf.common.datadelivery.registry.Subscription;
+import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
+import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
+import com.raytheon.uf.common.datadelivery.service.IGroupDefinitionService;
+import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
+import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
+import com.raytheon.uf.common.util.CollectionUtil;
+import com.raytheon.uf.edex.auth.req.AbstractPrivilegedRequestHandler;
+import com.raytheon.uf.edex.auth.resp.AuthorizationResponse;
+
+/**
+ * Handles request from the {@link IGroupDefinitionService}.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2013 1441 djohnson Initial creation
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+
+public class GroupDefinitionServiceHandler extends
+ AbstractPrivilegedRequestHandler {
+
+ private final ISubscriptionNotificationService notificationService;
+
+ /**
+ * Constructor.
+ *
+ * @param notificationService
+ * the subscription notification service
+ */
+ public GroupDefinitionServiceHandler(
+ ISubscriptionNotificationService notificationService) {
+ this.notificationService = notificationService;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Object handleRequest(GroupDefinitionServiceRequest request)
+ throws Exception {
+ final IUser user = request.getUser();
+ switch (request.getType()) {
+ case DELETE:
+ handleDelete(request.getGroup(), user);
+ break;
+ }
+ return null;
+ }
+
+ /**
+ * Handles the delete of a group. First it updates any subscriptions in the
+ * group to not have a group, and then deletes the actual group.
+ *
+ * @param user
+ *
+ * @param groupDefinition
+ * @return
+ * @throws RegistryHandlerException
+ */
+ private void handleDelete(GroupDefinition group, IUser user)
+ throws RegistryHandlerException {
+
+ ISubscriptionHandler handler = DataDeliveryHandlers
+ .getSubscriptionHandler();
+ List subsForGroup = handler.getByGroupName(group
+ .getGroupName());
+ if (!CollectionUtil.isNullOrEmpty(subsForGroup)) {
+ for (Subscription sub : subsForGroup) {
+ sub.setGroupName(GroupDefinition.NO_GROUP);
+ handler.update(sub);
+
+ // TODO: Would be nice to use a subset of the
+ // SubscriptionService functionality here so we didn't have to
+ // manually send the subscription updated notification
+ String username = user != null ? user.uniqueId().toString()
+ : "none";
+ notificationService.sendUpdatedSubscriptionNotification(sub,
+ username);
+ }
+ }
+
+ DataDeliveryHandlers.getGroupDefinitionHandler().delete(group);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public AuthorizationResponse authorized(IUser user,
+ GroupDefinitionServiceRequest request)
+ throws AuthorizationException {
+ return new AuthorizationResponse(true);
+ }
+
+}
diff --git a/tests/.classpath b/tests/.classpath
index c7d4e8274f..751c016121 100644
--- a/tests/.classpath
+++ b/tests/.classpath
@@ -68,5 +68,6 @@
+
diff --git a/tests/unit/com/raytheon/uf/common/datadelivery/registry/ParameterFixture.java b/tests/unit/com/raytheon/uf/common/datadelivery/registry/ParameterFixture.java
index 1b1c4a8749..c9b5767533 100644
--- a/tests/unit/com/raytheon/uf/common/datadelivery/registry/ParameterFixture.java
+++ b/tests/unit/com/raytheon/uf/common/datadelivery/registry/ParameterFixture.java
@@ -59,7 +59,6 @@ public class ParameterFixture extends AbstractFixture {
obj.setBaseType("baseType" + seedValue);
obj.setDataType(DataType.GRID);
obj.setDefinition("definition" + seedValue);
- obj.setEnsemble(0);
obj.setFillValue("fillValue" + seedValue);
obj.setLevels(LevelsFixture.INSTANCE.get(seedValue));
obj.setLevelType(Arrays.asList(DataLevelTypeFixture.INSTANCE
diff --git a/tests/unit/com/raytheon/uf/common/datadelivery/registry/handlers/GroupDefinitionServiceTest.java b/tests/unit/com/raytheon/uf/common/datadelivery/registry/handlers/GroupDefinitionServiceTest.java
new file mode 100644
index 0000000000..0ef1a3125c
--- /dev/null
+++ b/tests/unit/com/raytheon/uf/common/datadelivery/registry/handlers/GroupDefinitionServiceTest.java
@@ -0,0 +1,135 @@
+/**
+ * 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.common.datadelivery.registry.handlers;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.Matchers.emptyCollectionOf;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.raytheon.uf.common.datadelivery.registry.GroupDefinition;
+import com.raytheon.uf.common.datadelivery.registry.GroupDefinitionServiceRequest;
+import com.raytheon.uf.common.datadelivery.registry.Subscription;
+import com.raytheon.uf.common.datadelivery.registry.SubscriptionBuilder;
+import com.raytheon.uf.common.datadelivery.service.GroupDefinitionService;
+import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
+import com.raytheon.uf.common.registry.RegistryManagerTest;
+import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
+import com.raytheon.uf.common.registry.handler.RegistryObjectHandlersUtil;
+import com.raytheon.uf.edex.datadelivery.service.services.GroupDefinitionServiceHandler;
+
+/**
+ * Test {@link GroupDefinitionHandler}.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2013 1441 djohnson Initial creation
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+
+public class GroupDefinitionServiceTest {
+
+ private static final String GROUP_NAME = "someGroup";
+
+ private ISubscriptionHandler subscriptionHandler;
+
+ private IGroupDefinitionHandler groupHandler;
+
+ private final ISubscriptionNotificationService subscriptionNotificationService = mock(ISubscriptionNotificationService.class);
+
+ private final GroupDefinitionService service = new GroupDefinitionService() {
+ @Override
+ protected Object sendRequest(GroupDefinitionServiceRequest request)
+ throws RegistryHandlerException {
+ try {
+ return new GroupDefinitionServiceHandler(
+ subscriptionNotificationService).handleRequest(request);
+ } catch (Exception e) {
+ throw new RegistryHandlerException(e);
+ }
+ }
+ };
+
+ private final GroupDefinition group = new GroupDefinition();
+
+ @Before
+ public void setUp() throws RegistryHandlerException {
+ RegistryObjectHandlersUtil.initMemory();
+ RegistryManagerTest.setMockInstance();
+
+ subscriptionHandler = DataDeliveryHandlers.getSubscriptionHandler();
+ groupHandler = DataDeliveryHandlers.getGroupDefinitionHandler();
+
+ group.setGroupName(GROUP_NAME);
+ groupHandler.store(group);
+
+ Subscription subscription = new SubscriptionBuilder().withGroupName(
+ GROUP_NAME).build();
+ Subscription subscription2 = new Subscription(subscription, "sub2");
+
+ subscriptionHandler.store(subscription);
+ subscriptionHandler.store(subscription2);
+ }
+
+ @Test
+ public void deletingAGroupUpdatesSubscriptionsToNotHaveAGroupName()
+ throws RegistryHandlerException {
+
+ service.deleteGroupDefinition(group);
+
+ assertThat(subscriptionHandler.getByGroupName(GROUP_NAME),
+ is(emptyCollectionOf(Subscription.class)));
+ }
+
+ @Test
+ public void deletingAGroupNotifiesOfSubscriptionUpdates()
+ throws RegistryHandlerException {
+ service.deleteGroupDefinition(group);
+
+ verify(subscriptionNotificationService, times(2))
+ .sendUpdatedSubscriptionNotification(any(Subscription.class),
+ anyString());
+ }
+
+ @Test
+ public void deletingAGroupDeletesTheGroup() throws RegistryHandlerException {
+
+ service.deleteGroupDefinition(group);
+
+ assertNull(groupHandler.getByName(GROUP_NAME));
+ }
+
+}
diff --git a/tests/unit/com/raytheon/uf/common/registry/RegistryManagerTest.java b/tests/unit/com/raytheon/uf/common/registry/RegistryManagerTest.java
index f71de52158..38ff11d5a7 100644
--- a/tests/unit/com/raytheon/uf/common/registry/RegistryManagerTest.java
+++ b/tests/unit/com/raytheon/uf/common/registry/RegistryManagerTest.java
@@ -19,8 +19,13 @@
**/
package com.raytheon.uf.common.registry;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyList;
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
import org.junit.Ignore;
-import org.mockito.Mockito;
/**
* Allows setting a specific {@link RegistryHandler} instance for test purposes.
@@ -48,9 +53,23 @@ public class RegistryManagerTest {
*
* @return the mock {@link RegistryHandler}.
*/
+ @SuppressWarnings({ "rawtypes", "unchecked" })
public static RegistryHandler setMockInstance() {
- RegistryHandler mock = Mockito.mock(RegistryHandler.class);
+ RegistryHandler mock = mock(RegistryHandler.class);
RegistryManagerTest.setInstance(mock);
+ RegistryQueryResponse response = mock(RegistryQueryResponse.class);
+ when(response.getStatus()).thenReturn(OperationStatus.SUCCESS);
+ // Handles the responses for deletes, stores, and updates...
+ // TODO: Handle retrieving objects?
+ when(mock.removeObjects(any(RegistryQuery.class))).thenReturn(response);
+ when(mock.removeObjects(anyString(), anyList())).thenReturn(response);
+ when(mock.removeObjects(anyString(), any(RegistryQuery.class)))
+ .thenReturn(response);
+ when(mock.storeObject(any())).thenReturn(response);
+ when(mock.storeOrReplaceObject(any())).thenReturn(response);
+ when(mock.removeObjects(anyString(), any(RegistryQuery.class)))
+ .thenReturn(response);
+
return mock;
}
diff --git a/tests/unit/com/raytheon/uf/viz/datadelivery/subscription/AbstractSubscriptionServiceTest.java b/tests/unit/com/raytheon/uf/viz/datadelivery/subscription/AbstractSubscriptionServiceTest.java
index ed367b5755..3fbbbd6c89 100644
--- a/tests/unit/com/raytheon/uf/viz/datadelivery/subscription/AbstractSubscriptionServiceTest.java
+++ b/tests/unit/com/raytheon/uf/viz/datadelivery/subscription/AbstractSubscriptionServiceTest.java
@@ -48,6 +48,7 @@ import com.raytheon.uf.common.datadelivery.registry.Subscription;
import com.raytheon.uf.common.datadelivery.registry.SubscriptionFixture;
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
+import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
import com.raytheon.uf.common.registry.handler.RegistryObjectHandlersUtil;
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionService.ISubscriptionServiceResult;
diff --git a/tests/unit/com/raytheon/uf/viz/datadelivery/subscription/xml/OperatorAdapterTest.java b/tests/unit/com/raytheon/uf/viz/datadelivery/subscription/xml/OperatorAdapterTest.java
index f5db77cbba..fe4ca85486 100644
--- a/tests/unit/com/raytheon/uf/viz/datadelivery/subscription/xml/OperatorAdapterTest.java
+++ b/tests/unit/com/raytheon/uf/viz/datadelivery/subscription/xml/OperatorAdapterTest.java
@@ -46,7 +46,7 @@ import com.raytheon.uf.viz.datadelivery.utils.TypeOperationItems;
* @author djohnson
* @version 1.0
*/
-@SuppressWarnings({ "unchecked", "rawtypes" })
+@SuppressWarnings({ "rawtypes" })
public class OperatorAdapterTest {
@Test
@@ -66,9 +66,9 @@ public class OperatorAdapterTest {
private void verifyOperatorsUnmarshalAsSameOperator(Operator... operators) {
for (Operator operator : operators) {
- assertThat(operator,
- is(sameInstance(OperatorAdapter.fromString(OperatorAdapter
- .toString(operator)))));
+ Operator expected = OperatorAdapter.fromString(OperatorAdapter
+ .toString(operator));
+ assertThat(operator, is(sameInstance(expected)));
}
}