Issue #2545 Renamed datadelivery edex impl files to facilitate modes exclusion. Added
monilithic impl config file for a registry that runs as an ncf and wfo for devRegistry mode. Added empty site and shared and local subscription handlers to enable the FindSubscriptionHandler bean to be configured through spring. Fix for re-routing Insert and Update registry events as data set metadata events which was lost when the registry was configured to distinguish between insert and update events. Moved subscriptionRoutesToSchedule bean (and other beans specific to an implementation) to the ncf, wfo, and monolithic edex impl spring files. Removed the wfo and ncf specific code from HibernateBandwidthInitializer.executeAfterRegistryInit() since the customized subscription handlers will be injected through spring. Removed the SBN route from wfo mode. Amend: Comment updates from peer review. Change-Id: Ic4c0dca8ebf1e86537e46a6231af58bb65c83cf8 Former-commit-id:2f37534433
[formerly5576ac6134
] [formerly053f20c70b
] [formerly95a1914c71
[formerly053f20c70b
[formerly c245f741b9e78d8e4503698336d9929536e72e0d]]] Former-commit-id:95a1914c71
Former-commit-id: 19437f081eb72b80741e738e53af17b271610621 [formerly04829d37e2
] Former-commit-id:3c86e33ea4
This commit is contained in:
parent
6fd3e0873b
commit
3aa399c82e
18 changed files with 942 additions and 88 deletions
|
@ -236,7 +236,9 @@
|
|||
<include>ebxml.*\.xml</include>
|
||||
<includeMode>dataDeliveryTemplate</includeMode>
|
||||
<include>datadelivery-wfo-cron.xml</include>
|
||||
<exclude>.*datadelivery-ncf.*</exclude>
|
||||
<include>bandwidth-datadelivery-edex-impl-wfo.xml</include>
|
||||
<exclude>.*datadelivery.*-ncf.*</exclude>
|
||||
<exclude>.*datadelivery.*-monolithic.*</exclude>
|
||||
<exclude>harvester-*</exclude>
|
||||
<exclude>crawler-*</exclude>
|
||||
</mode>
|
||||
|
@ -244,7 +246,9 @@
|
|||
<!-- Central Registry production mode -->
|
||||
<include>ebxml.*\.xml</include>
|
||||
<includeMode>dataDeliveryTemplate</includeMode>
|
||||
<exclude>.*datadelivery-wfo.*</exclude>
|
||||
<include>bandwidth-datadelivery-edex-impl-ncf.xml</include>
|
||||
<exclude>.*datadelivery.*-wfo.*</exclude>
|
||||
<exclude>.*datadelivery.*-monolithic.*</exclude>
|
||||
</mode>
|
||||
|
||||
<mode name="statsTemplate" template="true">
|
||||
|
@ -299,9 +303,10 @@
|
|||
are for DEVELOPMENT purposes only -->
|
||||
<mode name="devRegistry">
|
||||
<include>ebxml.*\.xml</include>
|
||||
<include>adhoc-datadelivery-wfo.xml</include>
|
||||
<include>datadelivery-wfo-cron.xml</include>
|
||||
<includeMode>dataDeliveryTemplate</includeMode>
|
||||
<exclude>.*datadelivery-ncf.*</exclude>
|
||||
<include>bandwidth-datadelivery-edex-impl-monolithic.xml</include>
|
||||
<exclude>.*datadelivery.*-ncf.*</exclude>
|
||||
</mode>
|
||||
<mode name="sbnSimulator">
|
||||
<include>.*sbn-simulator-wfo.*</include>
|
||||
|
|
|
@ -48,6 +48,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Dec 06, 2012 1397 djohnson Add dynamic serialize class annotation.
|
||||
* Jan 25, 2013 1528 djohnson Subscription priority is now an enum.
|
||||
* Sep 20, 2013 2397 bgonzale Added Map of Bucket Descriptions.
|
||||
* Nov 19, 2013 2545 bgonzale Added 'add' method stub. Still work to do.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -95,6 +96,17 @@ public class BandwidthGraphData {
|
|||
priorityMap = new HashMap<String, SubscriptionPriority>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the other BandwidthGraphData data to this object.
|
||||
*
|
||||
* @param other
|
||||
*/
|
||||
public void add(BandwidthGraphData other) {
|
||||
/*
|
||||
* TODO merge SBN and OPSNET data into on Bandwidth Graph Data
|
||||
*/
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the dataMap
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,240 @@
|
|||
/**
|
||||
* 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 java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.Network;
|
||||
import com.raytheon.uf.common.datadelivery.registry.PendingSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SharedSubscription;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
|
||||
/**
|
||||
* SharedSubscriptionHandler that performs no operations. Injected when shared
|
||||
* subscriptions should be ignored. Used by the wfo registry since wfos do not
|
||||
* process shared subscriptions.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 4, 2013 2545 bgonzale Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bgonzale
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class EmptySharedSubscriptionHandler implements
|
||||
ISharedSubscriptionHandler {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionTypeHandler#getByPendingSubscription(com.raytheon.uf.common.datadelivery.registry.PendingSubscription)
|
||||
*/
|
||||
@Override
|
||||
public SharedSubscription getByPendingSubscription(
|
||||
PendingSubscription pending) throws RegistryHandlerException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionTypeHandler#getByPendingSubscriptionId(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public SharedSubscription getByPendingSubscriptionId(String id)
|
||||
throws RegistryHandlerException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionTypeHandler#getActiveByDataSetAndProvider(java.lang.String, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public List<SharedSubscription> getActiveByDataSetAndProvider(
|
||||
String dataSetName, String providerName)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getByName(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public SharedSubscription getByName(String name)
|
||||
throws RegistryHandlerException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getByNames(java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public List<SharedSubscription> getByNames(Collection<String> names)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getByOwner(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public List<SharedSubscription> getByOwner(String owner)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getByGroupName(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public List<SharedSubscription> getByGroupName(String group)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getByFilters(java.lang.String, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public List<SharedSubscription> getByFilters(String group, String officeId)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getSubscribedToDataSetNames(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getSubscribedToDataSetNames(String siteId)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_SET;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getActive()
|
||||
*/
|
||||
@Override
|
||||
public List<SharedSubscription> getActive() throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getActiveForRoute(com.raytheon.uf.common.datadelivery.registry.Network)
|
||||
*/
|
||||
@Override
|
||||
public List<SharedSubscription> getActiveForRoute(Network route)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getActiveForRoutes(com.raytheon.uf.common.datadelivery.registry.Network[])
|
||||
*/
|
||||
@Override
|
||||
public List<SharedSubscription> getActiveForRoutes(Network... routes)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#getById(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public SharedSubscription getById(String id)
|
||||
throws RegistryHandlerException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#getAll()
|
||||
*/
|
||||
@Override
|
||||
public List<SharedSubscription> getAll() throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#store(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void store(SharedSubscription obj) throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#update(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void update(SharedSubscription obj) throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#delete(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void delete(SharedSubscription obj) throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#deleteById(java.lang.String, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String username, String registryId)
|
||||
throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#deleteByIds(java.lang.String, java.util.List)
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(String username, List<String> registryIds)
|
||||
throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#delete(java.lang.String, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void delete(String username, SharedSubscription obj)
|
||||
throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#delete(java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public void delete(Collection<SharedSubscription> objects)
|
||||
throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#delete(java.lang.String, java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public void delete(String username, Collection<SharedSubscription> objects)
|
||||
throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,238 @@
|
|||
/**
|
||||
* 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 java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.Network;
|
||||
import com.raytheon.uf.common.datadelivery.registry.PendingSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
|
||||
/**
|
||||
* SiteSubscriptionHandler that performs no operations. Injected when site
|
||||
* subscriptions should be ignored. Used by the ncf registry since it does not
|
||||
* process site subscriptions.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 4, 2013 2545 bgonzale Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bgonzale
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class EmptySiteSubscriptionHandler implements ISiteSubscriptionHandler {
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionTypeHandler#getByPendingSubscription(com.raytheon.uf.common.datadelivery.registry.PendingSubscription)
|
||||
*/
|
||||
@Override
|
||||
public SiteSubscription getByPendingSubscription(PendingSubscription pending)
|
||||
throws RegistryHandlerException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionTypeHandler#getByPendingSubscriptionId(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public SiteSubscription getByPendingSubscriptionId(String id)
|
||||
throws RegistryHandlerException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionTypeHandler#getActiveByDataSetAndProvider(java.lang.String, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public List<SiteSubscription> getActiveByDataSetAndProvider(
|
||||
String dataSetName, String providerName)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getByName(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public SiteSubscription getByName(String name)
|
||||
throws RegistryHandlerException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getByNames(java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public List<SiteSubscription> getByNames(Collection<String> names)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getByOwner(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public List<SiteSubscription> getByOwner(String owner)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getByGroupName(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public List<SiteSubscription> getByGroupName(String group)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getByFilters(java.lang.String, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public List<SiteSubscription> getByFilters(String group, String officeId)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getSubscribedToDataSetNames(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getSubscribedToDataSetNames(String siteId)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_SET;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getActive()
|
||||
*/
|
||||
@Override
|
||||
public List<SiteSubscription> getActive() throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getActiveForRoute(com.raytheon.uf.common.datadelivery.registry.Network)
|
||||
*/
|
||||
@Override
|
||||
public List<SiteSubscription> getActiveForRoute(Network route)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.datadelivery.registry.handlers.IBaseSubscriptionHandler#getActiveForRoutes(com.raytheon.uf.common.datadelivery.registry.Network[])
|
||||
*/
|
||||
@Override
|
||||
public List<SiteSubscription> getActiveForRoutes(Network... routes)
|
||||
throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#getById(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public SiteSubscription getById(String id) throws RegistryHandlerException {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#getAll()
|
||||
*/
|
||||
@Override
|
||||
public List<SiteSubscription> getAll() throws RegistryHandlerException {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#store(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void store(SiteSubscription obj) throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#update(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void update(SiteSubscription obj) throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#delete(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void delete(SiteSubscription obj) throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#deleteById(java.lang.String, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String username, String registryId)
|
||||
throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#deleteByIds(java.lang.String, java.util.List)
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(String username, List<String> registryIds)
|
||||
throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#delete(java.lang.String, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void delete(String username, SiteSubscription obj)
|
||||
throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#delete(java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public void delete(Collection<SiteSubscription> objects)
|
||||
throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.common.registry.handler.IRegistryObjectHandler#delete(java.lang.String, java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public void delete(String username, Collection<SiteSubscription> objects)
|
||||
throws RegistryHandlerException {
|
||||
}
|
||||
|
||||
}
|
|
@ -18,4 +18,5 @@ Require-Bundle: com.raytheon.uf.common.datadelivery.bandwidth;bundle-version="1.
|
|||
com.raytheon.uf.edex.core;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.registry.ebxml;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.datadelivery.service;bundle-version="1.0.0"
|
||||
Import-Package: com.raytheon.edex.site
|
||||
Import-Package: com.raytheon.edex.site,
|
||||
com.raytheon.uf.common.event
|
||||
|
|
|
@ -4,7 +4,23 @@
|
|||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
|
||||
|
||||
<bean id="bandwidthManagerCreator"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.WfoBandwidthManagerCreator" />
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.ncf.MonolithicBandwidthManagerCreator" />
|
||||
|
||||
<util:list id="subscriptionRoutesToSchedule">
|
||||
<value>OPSNET</value>
|
||||
<value>SBN</value>
|
||||
</util:list>
|
||||
|
||||
<bean id="bandwidthInitializer"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.HibernateBandwidthInitializer">
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.util.FindActiveSubscriptionsForRoute">
|
||||
<constructor-arg ref="SubscriptionHandler" />
|
||||
<constructor-arg ref="subscriptionRoutesToSchedule" />
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="opsnetSubscriptionRetrievalAgentPrototype"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.SubscriptionRetrievalAgent"
|
|
@ -6,6 +6,36 @@
|
|||
<bean id="bandwidthManagerCreator"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.ncf.NcfBandwidthManagerCreator" />
|
||||
|
||||
<bean name="sharedSubscriptionHandler"
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.SubscriptionHandler">
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.EmptySiteSubscriptionHandler">
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.SharedSubscriptionHandler">
|
||||
<property name="registryHandler" ref="registryHandler" />
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<util:list id="subscriptionRoutesToSchedule">
|
||||
<value>SBN</value>
|
||||
</util:list>
|
||||
|
||||
<bean id="bandwidthInitializer"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.HibernateBandwidthInitializer">
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.util.FindActiveSubscriptionsForRoute">
|
||||
<constructor-arg ref="sharedSubscriptionHandler" />
|
||||
<constructor-arg ref="subscriptionRoutesToSchedule" />
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="sbnSubscriptionRetrievalAgentPrototype"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.SubscriptionRetrievalAgent"
|
||||
scope="prototype">
|
|
@ -3,10 +3,6 @@
|
|||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
|
||||
|
||||
<util:list id="subscriptionRoutesToSchedule">
|
||||
<value>SBN</value>
|
||||
</util:list>
|
||||
|
||||
<bean id="SBNRetrievalPlan"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalPlan">
|
||||
<property name="network" value="SBN" />
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
/**
|
||||
* 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.bandwidth.ncf;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.registry.Coverage;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.IDataSetMetaDataHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
|
||||
import com.raytheon.uf.common.util.JarUtil;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.BandwidthManager;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.EdexBandwidthContextFactory.IEdexBandwidthManagerCreator;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.IBandwidthManager;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDao;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil;
|
||||
|
||||
/**
|
||||
* {@link IEdexBandwidthManagerCreator} A bandwidth manager creator for
|
||||
* bandwidth managers that act standalone. They do not have parent or client
|
||||
* registries, but handle the scheduling themselves. This creator will configure
|
||||
* the manager with the spring files to configure SBN and OPSNET retrievals.
|
||||
*
|
||||
* This is primarily for a development EDEX mode for registry so that testing
|
||||
* can be on a standalone box.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 13, 2013 2545 bgonzale Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bgonzale
|
||||
* @version 1.0
|
||||
*/
|
||||
public class MonolithicBandwidthManagerCreator<T extends Time, C extends Coverage>
|
||||
extends NcfBandwidthManagerCreator<T, C> {
|
||||
|
||||
/**
|
||||
* NCF {@link BandwidthManager} implementation.
|
||||
*/
|
||||
static class MonolithicBandwidthManager<T extends Time, C extends Coverage>
|
||||
extends NcfBandwidthManager<T, C> {
|
||||
|
||||
private static final String[] BANDWIDTH_MANAGER_FILES = new String[] {
|
||||
JarUtil.getResResourcePath("/spring/bandwidth-datadelivery-monolithic-edex-impl.xml"),
|
||||
JarUtil.getResResourcePath("/spring/bandwidth-datadelivery-edex-impl.xml"),
|
||||
JarUtil.getResResourcePath("/spring/bandwidth-datadelivery.xml"),
|
||||
JarUtil.getResResourcePath("/spring/bandwidth-datadelivery-daos.xml"),
|
||||
JarUtil.getResResourcePath("/spring/bandwidth-datadelivery-eventbus.xml"),
|
||||
JarUtil.getResResourcePath("/spring/thrift-bandwidth.xml"),
|
||||
JarUtil.getResResourcePath("/spring/bandwidth-datadelivery-wfo.xml") };
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param dbInit
|
||||
* @param bandwidthDao
|
||||
* @param retrievalManager
|
||||
* @param bandwidthDaoUtil
|
||||
*/
|
||||
public MonolithicBandwidthManager(IBandwidthDbInit dbInit,
|
||||
IBandwidthDao<T, C> bandwidthDao, RetrievalManager retrievalManager,
|
||||
BandwidthDaoUtil<T, C> bandwidthDaoUtil,
|
||||
IDataSetMetaDataHandler dataSetMetaDataHandler,
|
||||
ISubscriptionHandler subscriptionHandler,
|
||||
ISubscriptionNotificationService subscriptionNotificationService) {
|
||||
super(dbInit, bandwidthDao, retrievalManager, bandwidthDaoUtil,
|
||||
dataSetMetaDataHandler, subscriptionHandler,
|
||||
subscriptionNotificationService);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getSpringFilesForNewInstance() {
|
||||
return BANDWIDTH_MANAGER_FILES;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public IBandwidthManager<T, C> getBandwidthManager(IBandwidthDbInit dbInit,
|
||||
IBandwidthDao bandwidthDao, RetrievalManager retrievalManager,
|
||||
BandwidthDaoUtil bandwidthDaoUtil,
|
||||
IDataSetMetaDataHandler dataSetMetaDataHandler,
|
||||
ISubscriptionHandler subscriptionHandler,
|
||||
ISubscriptionNotificationService subscriptionNotificationService) {
|
||||
return new MonolithicBandwidthManager(dbInit, bandwidthDao,
|
||||
retrievalManager,
|
||||
bandwidthDaoUtil, dataSetMetaDataHandler, subscriptionHandler,
|
||||
subscriptionNotificationService);
|
||||
}
|
||||
|
||||
}
|
|
@ -22,13 +22,17 @@ package com.raytheon.uf.edex.datadelivery.bandwidth.ncf;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.eventbus.AllowConcurrentEvents;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.raytheon.uf.common.datadelivery.bandwidth.ProposeScheduleResponse;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Coverage;
|
||||
import com.raytheon.uf.common.datadelivery.registry.DataDeliveryRegistryObjectTypes;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.IDataSetMetaDataHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
|
||||
import com.raytheon.uf.common.registry.event.UpdateRegistryEvent;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.util.JarUtil;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.BandwidthManager;
|
||||
|
@ -56,6 +60,8 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil;
|
|||
* Jul 10, 2013 2106 djohnson Dependency inject registry handlers.
|
||||
* Oct 3 2013 1797 dhladky Generics added
|
||||
* Nov 08, 2013 2506 bgonzale Added subscription notification service to bandwidth manager.
|
||||
* Nov 19, 2013 2545 bgonzale Added registryEventListener method for update events.
|
||||
* Reschedule updated shared subscriptions.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -97,6 +103,26 @@ public class NcfBandwidthManagerCreator<T extends Time, C extends Coverage> impl
|
|||
subscriptionNotificationService);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen for Registry update events. Filter for subscription specific
|
||||
* events. Sends corresponding subscription notification events.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@Override
|
||||
@Subscribe
|
||||
@AllowConcurrentEvents
|
||||
public void registryEventListener(UpdateRegistryEvent event) {
|
||||
super.registryEventListener(event);
|
||||
if (DataDeliveryRegistryObjectTypes.SHARED_SUBSCRIPTION
|
||||
.equals(event.getObjectType())) {
|
||||
Subscription<T, C> subscription = getRegistryObjectById(
|
||||
getSubscriptionHandler(), event.getId());
|
||||
subscriptionUpdated(subscription);
|
||||
sendSubscriptionNotificationEvent(event, subscription);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getSpringFilesForNewInstance() {
|
||||
return NCF_BANDWIDTH_MANAGER_FILES;
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
|
||||
|
||||
<bean id="bandwidthManagerCreator"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.WfoBandwidthManagerCreator" />
|
||||
|
||||
<bean name="localSubscriptionHandler"
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.SubscriptionHandler">
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.handler.LocalSiteSubscriptionHandler">
|
||||
<property name="registryHandler" ref="registryHandler" />
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="com.raytheon.uf.common.datadelivery.registry.handlers.EmptySharedSubscriptionHandler">
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<util:list id="subscriptionRoutesToSchedule">
|
||||
<value>OPSNET</value>
|
||||
</util:list>
|
||||
|
||||
<bean id="bandwidthInitializer"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.HibernateBandwidthInitializer">
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.util.FindActiveSubscriptionsForRoute">
|
||||
<constructor-arg ref="localSubscriptionHandler" />
|
||||
<constructor-arg ref="subscriptionRoutesToSchedule" />
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="opsnetSubscriptionRetrievalAgentPrototype"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.SubscriptionRetrievalAgent"
|
||||
scope="prototype">
|
||||
<constructor-arg value="OPSNET" />
|
||||
<constructor-arg value="notifyRetrieval" />
|
||||
<constructor-arg ref="retrievalAgentNotifier" />
|
||||
<constructor-arg value="${bandwidth.default.retrieval.priority}" />
|
||||
<constructor-arg ref="retrievalManager" />
|
||||
<constructor-arg ref="bandwidthDao" />
|
||||
<constructor-arg ref="retrievalDao" />
|
||||
<constructor-arg ref="ProviderHandler" />
|
||||
</bean>
|
||||
|
||||
<bean id="sbnSubscriptionRetrievalAgentPrototype"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.SubscriptionRetrievalAgent"
|
||||
scope="prototype">
|
||||
<constructor-arg value="SBN" />
|
||||
<constructor-arg value="notifyRetrieval" />
|
||||
<constructor-arg ref="retrievalAgentNotifier" />
|
||||
<constructor-arg value="${bandwidth.default.retrieval.priority}" />
|
||||
<constructor-arg ref="retrievalManager" />
|
||||
<constructor-arg ref="bandwidthDao" />
|
||||
<constructor-arg ref="retrievalDao" />
|
||||
<constructor-arg ref="ProviderHandler" />
|
||||
</bean>
|
||||
|
||||
<util:map id="retrievalAgents">
|
||||
<entry key="Retrievals-1" value-ref="opsnetSubscriptionRetrievalAgentPrototype" />
|
||||
<entry key="Retrievals-2" value-ref="opsnetSubscriptionRetrievalAgentPrototype" />
|
||||
<entry key="Retrievals-3" value-ref="opsnetSubscriptionRetrievalAgentPrototype" />
|
||||
<entry key="Retrievals-4" value-ref="opsnetSubscriptionRetrievalAgentPrototype" />
|
||||
<entry key="Retrievals-5" value-ref="opsnetSubscriptionRetrievalAgentPrototype" />
|
||||
<entry key="Retrievals-6" value-ref="sbnSubscriptionRetrievalAgentPrototype" />
|
||||
<entry key="Retrievals-7" value-ref="sbnSubscriptionRetrievalAgentPrototype" />
|
||||
<entry key="Retrievals-8" value-ref="sbnSubscriptionRetrievalAgentPrototype" />
|
||||
<entry key="Retrievals-9" value-ref="sbnSubscriptionRetrievalAgentPrototype" />
|
||||
<entry key="Retrievals-10" value-ref="sbnSubscriptionRetrievalAgentPrototype" />
|
||||
</util:map>
|
||||
|
||||
</beans>
|
|
@ -28,17 +28,6 @@
|
|||
<constructor-arg ref="retrievalDao" />
|
||||
</bean>
|
||||
|
||||
<bean id="bandwidthInitializer"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.hibernate.HibernateBandwidthInitializer">
|
||||
<constructor-arg>
|
||||
<bean
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.util.FindActiveSubscriptionsForRoute">
|
||||
<constructor-arg ref="SubscriptionHandler" />
|
||||
<constructor-arg ref="subscriptionRoutesToSchedule" />
|
||||
</bean>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<!-- Used as the context for creating the BandwidthManager -->
|
||||
<bean id="bandwidthContextFactory"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.EdexBandwidthContextFactory">
|
||||
|
|
|
@ -3,11 +3,6 @@
|
|||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
|
||||
|
||||
<util:list id="subscriptionRoutesToSchedule">
|
||||
<value>OPSNET</value>
|
||||
<value>SBN</value>
|
||||
</util:list>
|
||||
|
||||
<bean id="OPSNETRetrievalPlan"
|
||||
class="com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalPlan">
|
||||
<property name="network" value="OPSNET" />
|
||||
|
|
|
@ -125,6 +125,8 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
|||
* Oct 23, 2013 2385 bphillip Change schedule method to scheduleAdhoc
|
||||
* Oct 30, 2013 2448 dhladky Moved methods to TimeUtil.
|
||||
* Nov 04, 2013 2506 bgonzale Added removeBandwidthSubscriptions method.
|
||||
* Nov 19, 2013 2545 bgonzale changed getBandwidthGraphData to protected.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
|
@ -879,7 +881,7 @@ public abstract class BandwidthManager<T extends Time, C extends Coverage>
|
|||
*
|
||||
* @return the graph data
|
||||
*/
|
||||
private BandwidthGraphData getBandwidthGraphData() {
|
||||
protected BandwidthGraphData getBandwidthGraphData() {
|
||||
return new BandwidthGraphDataAdapter(retrievalManager).get();
|
||||
}
|
||||
|
||||
|
|
|
@ -108,7 +108,8 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthUtil;
|
|||
* Added subscriptionNotificationService field.
|
||||
* Send notifications.
|
||||
* Nov 15, 2013 2545 bgonzale Added check for subscription events before sending
|
||||
* notifications.
|
||||
* notifications. Republish dataset metadata registry
|
||||
* insert and update events as dataset metadata events.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -335,7 +336,8 @@ public abstract class EdexBandwidthManager<T extends Time, C extends Coverage>
|
|||
try {
|
||||
Subscription<T, C> sub = (Subscription<T, C>) RegistryEncoders
|
||||
.ofType(JAXB).decodeObject(
|
||||
((RemoveRegistryEvent) event).getRemovedObject());
|
||||
((RemoveRegistryEvent) event)
|
||||
.getRemovedObject());
|
||||
sendSubscriptionNotificationEvent(event, sub);
|
||||
} catch (SerializationException e) {
|
||||
statusHandler
|
||||
|
@ -348,8 +350,8 @@ public abstract class EdexBandwidthManager<T extends Time, C extends Coverage>
|
|||
}
|
||||
|
||||
/**
|
||||
* Create a hook into the EDEX Notification sub-system to receive the the
|
||||
* necessary InsertRegistryEvents to drive Bandwidth Management.
|
||||
* Listen for registry insert events necessary to drive Bandwidth
|
||||
* Management.
|
||||
*
|
||||
* @param re
|
||||
* The <code>InsertRegistryEvent</code> Object to evaluate.
|
||||
|
@ -358,33 +360,9 @@ public abstract class EdexBandwidthManager<T extends Time, C extends Coverage>
|
|||
@AllowConcurrentEvents
|
||||
public void registryEventListener(InsertRegistryEvent re) {
|
||||
final String objectType = re.getObjectType();
|
||||
final String id = re.getId();
|
||||
|
||||
if (DataDeliveryRegistryObjectTypes.DATASETMETADATA.equals(objectType)) {
|
||||
|
||||
DataSetMetaData dsmd = getDataSetMetaData(id);
|
||||
|
||||
if (dsmd != null) {
|
||||
// Repost the Object to the BandwidthEventBus to free
|
||||
// the notification thread.
|
||||
|
||||
// TODO: A hack to prevent rap_f and rap datasets being
|
||||
// Identified as the
|
||||
// same dataset...
|
||||
Matcher matcher = RAP_PATTERN.matcher(dsmd.getUrl());
|
||||
if (matcher.matches()) {
|
||||
statusHandler
|
||||
.info("Found rap_f dataset - updating dataset name from ["
|
||||
+ dsmd.getDataSetName() + "] to [rap_f]");
|
||||
dsmd.setDataSetName("rap_f");
|
||||
}
|
||||
// TODO: End of hack..
|
||||
|
||||
BandwidthEventBus.publish(dsmd);
|
||||
} else {
|
||||
statusHandler.error("No DataSetMetaData found for id [" + id
|
||||
+ "]");
|
||||
}
|
||||
publishDataSetMetaDataEvent(re);
|
||||
}
|
||||
if (DataDeliveryRegistryObjectTypes.isRecurringSubscription(re
|
||||
.getObjectType())) {
|
||||
|
@ -394,24 +372,15 @@ public abstract class EdexBandwidthManager<T extends Time, C extends Coverage>
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a hook into the EDEX Notification sub-system to receive
|
||||
* UpdateRegistryEvents. Filter for subscription specific events.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@Subscribe
|
||||
@AllowConcurrentEvents
|
||||
public void registryEventListener(UpdateRegistryEvent event) {
|
||||
if (DataDeliveryRegistryObjectTypes.isRecurringSubscription(event
|
||||
.getObjectType())) {
|
||||
Subscription<T, C> sub = getRegistryObjectById(subscriptionHandler,
|
||||
event.getId());
|
||||
sendSubscriptionNotificationEvent(event, sub);
|
||||
protected void registryEventListener(UpdateRegistryEvent event) {
|
||||
final String objectType = event.getObjectType();
|
||||
|
||||
if (DataDeliveryRegistryObjectTypes.DATASETMETADATA.equals(objectType)) {
|
||||
publishDataSetMetaDataEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
private void sendSubscriptionNotificationEvent(RegistryEvent event,
|
||||
protected void sendSubscriptionNotificationEvent(RegistryEvent event,
|
||||
Subscription<T, C> sub) {
|
||||
final String objectType = event.getObjectType();
|
||||
|
||||
|
@ -447,11 +416,37 @@ public abstract class EdexBandwidthManager<T extends Time, C extends Coverage>
|
|||
}
|
||||
}
|
||||
|
||||
private void publishDataSetMetaDataEvent(RegistryEvent re) {
|
||||
final String id = re.getId();
|
||||
DataSetMetaData dsmd = getDataSetMetaData(id);
|
||||
|
||||
if (dsmd != null) {
|
||||
// Repost the Object to the BandwidthEventBus to free
|
||||
// the notification thread.
|
||||
|
||||
// TODO: A hack to prevent rap_f and rap datasets being
|
||||
// Identified as the
|
||||
// same dataset...
|
||||
Matcher matcher = RAP_PATTERN.matcher(dsmd.getUrl());
|
||||
if (matcher.matches()) {
|
||||
statusHandler
|
||||
.info("Found rap_f dataset - updating dataset name from ["
|
||||
+ dsmd.getDataSetName() + "] to [rap_f]");
|
||||
dsmd.setDataSetName("rap_f");
|
||||
}
|
||||
// TODO: End of hack..
|
||||
|
||||
BandwidthEventBus.publish(dsmd);
|
||||
} else {
|
||||
statusHandler.error("No DataSetMetaData found for id [" + id + "]");
|
||||
}
|
||||
}
|
||||
|
||||
private DataSetMetaData<T> getDataSetMetaData(String id) {
|
||||
return getRegistryObjectById(dataSetMetaDataHandler, id);
|
||||
}
|
||||
|
||||
private static <M> M getRegistryObjectById(
|
||||
protected static <M> M getRegistryObjectById(
|
||||
IRegistryObjectHandler<M> handler, String id) {
|
||||
try {
|
||||
return handler.getById(id);
|
||||
|
@ -462,6 +457,13 @@ public abstract class EdexBandwidthManager<T extends Time, C extends Coverage>
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the subscriptionHandler
|
||||
*/
|
||||
public ISubscriptionHandler getSubscriptionHandler() {
|
||||
return subscriptionHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process a {@link GriddedDataSetMetaData} that was received from the event
|
||||
* bus.
|
||||
|
|
|
@ -22,14 +22,20 @@ package com.raytheon.uf.edex.datadelivery.bandwidth;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.eventbus.AllowConcurrentEvents;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.raytheon.edex.site.SiteUtil;
|
||||
import com.raytheon.uf.common.datadelivery.bandwidth.IBandwidthService;
|
||||
import com.raytheon.uf.common.datadelivery.bandwidth.IProposeScheduleResponse;
|
||||
import com.raytheon.uf.common.datadelivery.bandwidth.data.BandwidthGraphData;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Coverage;
|
||||
import com.raytheon.uf.common.datadelivery.registry.DataDeliveryRegistryObjectTypes;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.IDataSetMetaDataHandler;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.ISubscriptionHandler;
|
||||
import com.raytheon.uf.common.datadelivery.service.ISubscriptionNotificationService;
|
||||
import com.raytheon.uf.common.registry.event.UpdateRegistryEvent;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.util.JarUtil;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.EdexBandwidthContextFactory.IEdexBandwidthManagerCreator;
|
||||
|
@ -55,6 +61,9 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthDaoUtil;
|
|||
* Oct 2, 2013 1797 dhladky Generics
|
||||
* Oct 28, 2013 2506 bgonzale SBN (Shared) Scheduled at the central registry.
|
||||
* Added subscription notification service to bandwidth manager.
|
||||
* Nov 19, 2013 2545 bgonzale Added registryEventListener method for update events.
|
||||
* Added getBandwidthGraphData.
|
||||
* Reschedule updated local subscriptions.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -100,6 +109,32 @@ public class WfoBandwidthManagerCreator<T extends Time, C extends Coverage> impl
|
|||
subscriptionNotificationService);
|
||||
}
|
||||
|
||||
/**
|
||||
* Listen for Registry update events. Filter for subscription specific
|
||||
* events. Sends corresponding subscription notification events.
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@Override
|
||||
@Subscribe
|
||||
@AllowConcurrentEvents
|
||||
public void registryEventListener(UpdateRegistryEvent event) {
|
||||
super.registryEventListener(event);
|
||||
if (DataDeliveryRegistryObjectTypes.SITE_SUBSCRIPTION.equals(event
|
||||
.getObjectType())) {
|
||||
Subscription<T, C> subscription = getRegistryObjectById(
|
||||
getSubscriptionHandler(), event.getId());
|
||||
boolean isLocalOrigination = subscription.getOriginatingSite()
|
||||
.equals(
|
||||
SiteUtil.getSite());
|
||||
|
||||
if (isLocalOrigination) {
|
||||
subscriptionUpdated(subscription);
|
||||
}
|
||||
sendSubscriptionNotificationEvent(event, subscription);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String[] getSpringFilesForNewInstance() {
|
||||
return WFO_BANDWIDTH_MANAGER_FILES;
|
||||
|
@ -134,6 +169,13 @@ public class WfoBandwidthManagerCreator<T extends Time, C extends Coverage> impl
|
|||
return ncfBandwidthService.schedule(subscriptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BandwidthGraphData getBandwidthGraphData() {
|
||||
BandwidthGraphData data = super.getBandwidthGraphData();
|
||||
data.add(ncfBandwidthService.getBandwidthGraphData());
|
||||
return data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
/**
|
||||
* 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.bandwidth.handler;
|
||||
|
||||
import com.raytheon.edex.site.SiteUtil;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.ebxml.SiteSubscriptionQuery;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.SiteSubscriptionHandler;
|
||||
import com.raytheon.uf.common.registry.handler.IRegistryObjectHandler;
|
||||
|
||||
/**
|
||||
* {@link IRegistryObjectHandler} implementation for {@link SiteSubscription}.
|
||||
* Retrieves only subscritions for the given site id. If the site id is not set
|
||||
* then it retrieves all.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Nov 14, 2013 2545 bgonzale Initial creation.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bgonzale
|
||||
* @version 1.0
|
||||
*/
|
||||
public class LocalSiteSubscriptionHandler extends SiteSubscriptionHandler {
|
||||
|
||||
private String officeId;
|
||||
|
||||
/**
|
||||
* Default Constructor.
|
||||
*/
|
||||
public LocalSiteSubscriptionHandler() {
|
||||
this(SiteUtil.getSite());
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialization Constructor.
|
||||
*
|
||||
* @param officeId
|
||||
*/
|
||||
public LocalSiteSubscriptionHandler(String officeId) {
|
||||
this.officeId = officeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected SiteSubscriptionQuery getQuery() {
|
||||
SiteSubscriptionQuery query = new SiteSubscriptionQuery();
|
||||
if (officeId != null) {
|
||||
query.setOfficeId(officeId);
|
||||
}
|
||||
return query;
|
||||
}
|
||||
|
||||
}
|
|
@ -6,7 +6,6 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
import com.raytheon.edex.site.SiteUtil;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SharedSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
|
@ -36,6 +35,8 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager;
|
|||
* Sep 06, 2013 2344 bgonzale Removed attempt to add to immutable empty set.
|
||||
* Oct 16, 2013 2267 bgonzale executeAfterRegistryInit subscribes to all local. Removed is shared checks.
|
||||
* Nov 04, 2013 2506 bgonzale added site field. facilitates testing.
|
||||
* Nov 19, 2013 2545 bgonzale Removed programmatic customization for central, client, and dev(monolithic)
|
||||
* registries since the injected FindSubscription handler will be configured now.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -101,26 +102,11 @@ public class HibernateBandwidthInitializer implements BandwidthInitializer {
|
|||
public void executeAfterRegistryInit() {
|
||||
Set<Subscription> activeSubscriptions = new HashSet<Subscription>();
|
||||
try {
|
||||
final String localOffice = SiteUtil.getSite();
|
||||
final boolean isRegistry = System.getProperty("edex.run.mode")
|
||||
.equals("registry");
|
||||
final boolean isCentralRegistry = System.getProperty(
|
||||
"edex.run.mode").equals("centralRegistry");
|
||||
|
||||
// Load active subscriptions
|
||||
for (Subscription sub : findSubscriptionsStrategy
|
||||
.findSubscriptionsToSchedule()) {
|
||||
boolean isShared = (sub instanceof SharedSubscription);
|
||||
boolean isLocalOffice = sub.getOfficeIDs()
|
||||
.contains(localOffice);
|
||||
|
||||
if ((isCentralRegistry && isShared)
|
||||
|| (isRegistry && isLocalOffice && !isShared)) {
|
||||
activeSubscriptions.add(sub);
|
||||
statusHandler.info("Scheduling Subscription: " + sub);
|
||||
} else {
|
||||
statusHandler.info("Not Scheduling Subscription: " + sub);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
|
|
Loading…
Add table
Reference in a new issue