diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/ebxml/SubscriptionDataSetNameQuery.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/ebxml/SubscriptionDataSetNameQuery.java index 5394945ece..a7da6696b9 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/ebxml/SubscriptionDataSetNameQuery.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/ebxml/SubscriptionDataSetNameQuery.java @@ -33,6 +33,7 @@ import com.raytheon.uf.common.registry.IResultFormatter; import com.raytheon.uf.common.registry.ebxml.encoder.IRegistryEncoder; import com.raytheon.uf.common.serialization.SerializationException; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; /** * Return the name of the data set the subscription is subscribed to. @@ -45,6 +46,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * ------------ ---------- ----------- -------------------------- * Aug 24, 2012 0743 djohnson Initial creation * Jun 24, 2013 2106 djohnson Pass encoder to result formatters. + * Jul 18, 2013 2193 mpduff Updated to work with site and shared subscriptions. * * * @@ -54,15 +56,23 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class SubscriptionDataSetNameQuery extends - SubscriptionFilterableQuery implements - IResultFormatter { + SubscriptionFilterableQuery implements IResultFormatter { + + @DynamicSerializeElement + private String registryObjectClass; /** * {@inheritDoc} */ + @SuppressWarnings("unchecked") @Override - public Class getObjectType() { - return Subscription.class; + public Class getObjectType() { + try { + return (Class) Class + .forName(registryObjectClass); + } catch (ClassNotFoundException e) { + throw new IllegalArgumentException(e); + } } /** @@ -72,13 +82,13 @@ public class SubscriptionDataSetNameQuery extends public Class getResultType() { return String.class; } + /** * {@inheritDoc} */ @Override public String decodeObject(RegistryObjectType registryObjectType, - IRegistryEncoder encoderStrategy) - throws SerializationException { + IRegistryEncoder encoderStrategy) throws SerializationException { Set returnedSlots = registryObjectType.getSlot(); // Cherry pick the values to return... @@ -92,4 +102,18 @@ public class SubscriptionDataSetNameQuery extends return null; } + /** + * @return the registryObjectClass + */ + public String getRegistryObjectClass() { + return registryObjectClass; + } + + /** + * @param registryObjectClass + * the registryObjectClass to set + */ + public void setRegistryObjectClass(String registryObjectClass) { + this.registryObjectClass = registryObjectClass; + } } diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/handlers/BaseSubscriptionHandler.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/handlers/BaseSubscriptionHandler.java index 00b822d233..f835ce8930 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/handlers/BaseSubscriptionHandler.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/handlers/BaseSubscriptionHandler.java @@ -48,6 +48,7 @@ import com.raytheon.uf.common.registry.handler.RegistryHandlerException; * Feb 20, 2013 1543 djohnson Add ability to filter on routes. * May 28, 2013 1650 djohnson Add getByNames. * Jun 24, 2013 2106 djohnson Now composes a registryHandler. + * Jul 18, 2013 2193 mpduff Changes for SubscriptionDataSetNameQuery. * * * @@ -127,8 +128,10 @@ public abstract class BaseSubscriptionHandler getSubscribedToDataSetNames() throws RegistryHandlerException { + SubscriptionDataSetNameQuery query = new SubscriptionDataSetNameQuery(); + query.setRegistryObjectClass(getRegistryObjectClass().getName()); RegistryQueryResponse response = registryHandler - .getObjects(new SubscriptionDataSetNameQuery()); + .getObjects(query); checkResponse(response, "getSubscribedToDataSetNames");