Issue #2352 - Data Browser Must Check For Subscriptions Belonging to the Local Site

Change-Id: I23392906a7d829852af2991dd096d4b5e76765aa

Former-commit-id: b569410bc4 [formerly 89342e59b9] [formerly b569410bc4 [formerly 89342e59b9] [formerly b8d2c6cffc [formerly 5b4c9794eb396f02cdf024d2df2089add4719910]]]
Former-commit-id: b8d2c6cffc
Former-commit-id: 2465a0625b [formerly 13751ede70]
Former-commit-id: ed8fa698dd
This commit is contained in:
Mike Duff 2013-09-11 09:47:04 -05:00
parent 15d1bbdf5e
commit 2b81983331
6 changed files with 33 additions and 13 deletions

View file

@ -48,6 +48,7 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.util.FileUtil; import com.raytheon.uf.common.util.FileUtil;
import com.raytheon.uf.viz.core.localization.LocalizationManager;
import com.raytheon.uf.viz.core.notification.NotificationMessage; import com.raytheon.uf.viz.core.notification.NotificationMessage;
import com.raytheon.uf.viz.datadelivery.common.ui.IDialogClosed; import com.raytheon.uf.viz.datadelivery.common.ui.IDialogClosed;
import com.raytheon.uf.viz.datadelivery.common.ui.SortImages.SortDirection; import com.raytheon.uf.viz.datadelivery.common.ui.SortImages.SortDirection;
@ -83,6 +84,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
* Jan 10, 2013 1346 mpduff Add additional information to the dataset details output. * Jan 10, 2013 1346 mpduff Add additional information to the dataset details output.
* Feb 15, 2013 1638 mschenke Moved Util.EOL into FileUtil * Feb 15, 2013 1638 mschenke Moved Util.EOL into FileUtil
* Apr 10, 2013 1891 djohnson Declare variable as List. * Apr 10, 2013 1891 djohnson Declare variable as List.
* Sep 11, 2013 2352 mpduff Add siteId to getSubscribedToDataSetNames method.
* *
* </pre> * </pre>
* *
@ -369,7 +371,8 @@ public class BrowserTableComp extends TableComp implements IDialogClosed {
for (String param : paramList) { for (String param : paramList) {
sb.append("--- ").append(param); sb.append("--- ").append(param);
sb.append(getSpacing(max + 1, param)); sb.append(getSpacing(max + 1, param));
sb.append(paramMap.get(param).getDefinition()).append(FileUtil.EOL); sb.append(paramMap.get(param).getDefinition()).append(
FileUtil.EOL);
} }
} }
@ -623,7 +626,8 @@ public class BrowserTableComp extends TableComp implements IDialogClosed {
Set<String> datasetNames = Collections.emptySet(); Set<String> datasetNames = Collections.emptySet();
try { try {
datasetNames = DataDeliveryHandlers.getSubscriptionHandler() datasetNames = DataDeliveryHandlers.getSubscriptionHandler()
.getSubscribedToDataSetNames(); .getSubscribedToDataSetNames(
LocalizationManager.getInstance().getCurrentSite());
} catch (RegistryHandlerException e) { } catch (RegistryHandlerException e) {
statusHandler.handle(Priority.PROBLEM, statusHandler.handle(Priority.PROBLEM,
"Unable to retrieve subscription dataset names!", e); "Unable to retrieve subscription dataset names!", e);

View file

@ -49,6 +49,7 @@ import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
* May 28, 2013 1650 djohnson Add getByNames. * May 28, 2013 1650 djohnson Add getByNames.
* Jun 24, 2013 2106 djohnson Now composes a registryHandler. * Jun 24, 2013 2106 djohnson Now composes a registryHandler.
* Jul 18, 2013 2193 mpduff Changes for SubscriptionDataSetNameQuery. * Jul 18, 2013 2193 mpduff Changes for SubscriptionDataSetNameQuery.
* Sep 11, 2013 2352 mpduff Add siteId to getSubscribedToDataSetNames method.
* *
* </pre> * </pre>
* *
@ -126,10 +127,11 @@ public abstract class BaseSubscriptionHandler<T extends Subscription, QUERY exte
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public Set<String> getSubscribedToDataSetNames() public Set<String> getSubscribedToDataSetNames(String siteId)
throws RegistryHandlerException { throws RegistryHandlerException {
SubscriptionDataSetNameQuery query = new SubscriptionDataSetNameQuery(); SubscriptionDataSetNameQuery query = new SubscriptionDataSetNameQuery();
query.setRegistryObjectClass(getRegistryObjectClass().getName()); query.setRegistryObjectClass(getRegistryObjectClass().getName());
query.setOfficeId(siteId);
RegistryQueryResponse<String> response = registryHandler RegistryQueryResponse<String> response = registryHandler
.getObjects(query); .getObjects(query);

View file

@ -43,6 +43,7 @@ import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
* Oct 10, 2012 0726 djohnson Add {@link #getActive()}. * Oct 10, 2012 0726 djohnson Add {@link #getActive()}.
* Feb 20, 2013 1543 djohnson Add ability to filter on routes. * Feb 20, 2013 1543 djohnson Add ability to filter on routes.
* May 28, 2013 1650 djohnson Add getByNames. * May 28, 2013 1650 djohnson Add getByNames.
* Sep 11, 2013 2352 mpduff Add siteId to getSubscribedToDataSetNames method.
* *
* </pre> * </pre>
* *
@ -108,13 +109,18 @@ public interface IBaseSubscriptionHandler<T extends Subscription> extends
throws RegistryHandlerException; throws RegistryHandlerException;
/** /**
* Get the {@link Set} of data set names that are subscribed to. * Get the {@link Set} of data set names that are subscribed to for the
* provided site.
*
* @param siteId
* The site id
* *
* @return the {@link Set} of data set names * @return the {@link Set} of data set names
* @throws RegistryHandlerException * @throws RegistryHandlerException
* on error * on error
*/ */
Set<String> getSubscribedToDataSetNames() throws RegistryHandlerException; Set<String> getSubscribedToDataSetNames(String siteId)
throws RegistryHandlerException;
/** /**
* Retrieve all active subscriptions. * Retrieve all active subscriptions.

View file

@ -53,6 +53,7 @@ import com.raytheon.uf.common.util.CollectionUtil;
* 4/9/2013 1802 bphillip Using constant values from constants package instead of RegistryUtil * 4/9/2013 1802 bphillip Using constant values from constants package instead of RegistryUtil
* May 28, 2013 1650 djohnson Add getByNames. * May 28, 2013 1650 djohnson Add getByNames.
* May 29, 2013 1650 djohnson Fix ability to delete multiple types of subscriptions at once. * May 29, 2013 1650 djohnson Fix ability to delete multiple types of subscriptions at once.
* Sep 11, 2013 2352 mpduff Add siteId to getSubscribedToDataSetNames method.
* *
* </pre> * </pre>
* *
@ -147,11 +148,13 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public Set<String> getSubscribedToDataSetNames() public Set<String> getSubscribedToDataSetNames(String siteId)
throws RegistryHandlerException { throws RegistryHandlerException {
Set<String> names = Sets.newHashSet(); Set<String> names = Sets.newHashSet();
names.addAll(siteSubscriptionHandler.getSubscribedToDataSetNames()); names.addAll(siteSubscriptionHandler
names.addAll(sharedSubscriptionHandler.getSubscribedToDataSetNames()); .getSubscribedToDataSetNames(siteId));
names.addAll(sharedSubscriptionHandler
.getSubscribedToDataSetNames(siteId));
return names; return names;
} }

View file

@ -57,6 +57,7 @@ import com.raytheon.uf.common.util.CollectionUtil;
* May 28, 2013 1650 djohnson Add getByNames. * May 28, 2013 1650 djohnson Add getByNames.
* May 29, 2013 1650 djohnson Fix ability to delete multiple types of subscriptions at once. * May 29, 2013 1650 djohnson Fix ability to delete multiple types of subscriptions at once.
* May 31, 2013 1650 djohnson Fix ability to get shared subscriptions by id. * May 31, 2013 1650 djohnson Fix ability to get shared subscriptions by id.
* Sep 11, 2013 2352 mpduff Add siteId to getSubscribedToDataSetNames method.
* *
* </pre> * </pre>
* *
@ -206,11 +207,12 @@ public class SubscriptionHandler implements ISubscriptionHandler {
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public Set<String> getSubscribedToDataSetNames() public Set<String> getSubscribedToDataSetNames(String siteId)
throws RegistryHandlerException { throws RegistryHandlerException {
Set<String> set = Sets.newHashSet(); Set<String> set = Sets.newHashSet();
set.addAll(siteSubscriptionHandler.getSubscribedToDataSetNames()); set.addAll(siteSubscriptionHandler.getSubscribedToDataSetNames(siteId));
set.addAll(sharedSubscriptionHandler.getSubscribedToDataSetNames()); set.addAll(sharedSubscriptionHandler
.getSubscribedToDataSetNames(siteId));
return set; return set;
} }

View file

@ -42,6 +42,7 @@ import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
* Feb 20, 2013 1543 djohnson Implement route filtering. * Feb 20, 2013 1543 djohnson Implement route filtering.
* May 15, 2013 1040 mpduff Office Id now a set. * May 15, 2013 1040 mpduff Office Id now a set.
* May 28, 2013 1650 djohnson Add getByNames. * May 28, 2013 1650 djohnson Add getByNames.
* Sep 11, 2013 2352 mpduff Add siteId to getSubscribedToDataSetNames method.
* *
* </pre> * </pre>
* *
@ -116,11 +117,13 @@ public class BaseMemorySubscriptionHandler<T extends Subscription> extends
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public Set<String> getSubscribedToDataSetNames() public Set<String> getSubscribedToDataSetNames(String siteId)
throws RegistryHandlerException { throws RegistryHandlerException {
Set<String> retVal = new HashSet<String>(); Set<String> retVal = new HashSet<String>();
for (T obj : getAll()) { for (T obj : getAll()) {
retVal.add(obj.getDataSetName()); if (matches(siteId, obj.getOfficeIDs())) {
retVal.add(obj.getDataSetName());
}
} }
return retVal; return retVal;