Merge branch 'omaha_14.2.1' into development (from 14.2.1-9)

Former-commit-id: 08dbf1f7ea [formerly dc7d6ceced] [formerly 8b6263bfbd] [formerly 08dbf1f7ea [formerly dc7d6ceced] [formerly 8b6263bfbd] [formerly 1c64a5c025 [formerly 8b6263bfbd [formerly 857ae00bea95a7981cb4752c1a7c147d725173e3]]]]
Former-commit-id: 1c64a5c025
Former-commit-id: 3f778f9f9f [formerly 972fa3bee6] [formerly ce9b772480f62374b4f578a3aa3691569ae98b58 [formerly 7fbbc1e118]]
Former-commit-id: 4dd289fbedb14cff7837a7f1aeed66c5959e4ee1 [formerly 7f932399b9]
Former-commit-id: d65c768373
This commit is contained in:
Steve Harris 2014-03-06 18:31:10 -06:00
commit 2acd9aac73
99 changed files with 2074 additions and 3532 deletions

View file

@ -542,16 +542,6 @@ public class NotificationDlg extends CaveSWTDialog implements ITableChange,
"com.raytheon.uf.viz.datadelivery", "icons/dd_new.png");
trayImg2 = id.createImage();
/*
* Check if the images are null.
*/
if (trayImg1 == null) {
System.out.println("*** Tray image 1 is null...");
} else {
System.out
.println("*** Tray image 1 is not null and should have an image...");
}
tray = display.getSystemTray();
createTray();

View file

@ -145,6 +145,7 @@ import com.raytheon.viz.ui.presenter.IDisplay;
* Feb 11, 2014 2771 bgonzale Use Data Delivery ID instead of Site.
* Feb 26, 2014 #2833 lvenable Added code to prevent the Subset (this) dialog from
* disappearing when the Subscription button is double clicked.
* Added dispose check for subscription button.
* </pre>
*
* @author mpduff
@ -449,8 +450,10 @@ public abstract class SubsetManagerDlg extends CaveSWTDialog implements
launchCreateSubscriptionGui(subscription);
}
// Enable the button.
subscribeBtn.setEnabled(true);
// Enable the subscription button if it is not disposed.
if (subscribeBtn.isDisposed() == false) {
subscribeBtn.setEnabled(true);
}
}
});

View file

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
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.
-->
<menuTemplate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<contribute xsi:type="bundleItem" file="bundles/LightningPlot60Min.xml"
menuText="1hr Lgtng Plot" id="1HrLightningPlot"
productInterval="3600">
<dataURI>/binlightning/%</dataURI>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/LightningPlot15Min.xml"
menuText="15min Lgtng Plot" id="15MinLightningPlot"
productInterval="900">
<dataURI>/binlightning/%</dataURI>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/LightningPlot15MinPN.xml"
menuText="15min Pos/Neg Lgtng Plot" id="15MinPNLightningPlot"
productInterval="900">
<dataURI>/binlightning/%</dataURI>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/LightningPlot5Min.xml"
menuText="5min Lgtng Plot" id="5MinLightningPlot"
productInterval="300">
<dataURI>/binlightning/%</dataURI>
</contribute>
<contribute xsi:type="bundleItem" file="bundles/LightningSeq.xml"
menuText="1min Lgtng Seq" id="1MinLightningSeq">
<dataURI>/binlightning/%</dataURI>
</contribute>
</menuTemplate>

View file

@ -1,2 +1,2 @@
com.raytheon.edex.subscription.data.ReplacementRecord
com.raytheon.edex.subscription.data.SubscriptionRecord
com.raytheon.edex.autobldsrv.data.ReplacementRecord
com.raytheon.edex.autobldsrv.data.SubscriptionRecord

View file

@ -0,0 +1,109 @@
/**
* 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.web;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
/**
*
* Interface for the registry federation manager for exposing web services for
* the web interface
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 2/27/2014 2769 bphillip Initial Creation
* </pre>
*
* @author bphillip
* @version 1
**/
@Path(IRegistryFederationManager.REGISTRY_FEDERATION_MANAGER_PATH)
public interface IRegistryFederationManager {
/** The path to these set of services */
public static final String REGISTRY_FEDERATION_MANAGER_PATH = "/federation/";
/**
* Gets if this registry is participating in the federation
*
* @return The value of the EBXML_REGISTRY_FEDERATION_ENABLED environment
* variable
*/
@GET
@Path("isFederated")
public String isFederated();
@GET
@Path("dataDeliveryId")
public String dataDeliveryId();
@GET
@Path("siteId")
public String siteId();
@GET
@Path("getObjectTypesReplicated")
public String getObjectTypesReplicated();
@GET
@Path("getFederationMembers")
public String getFederationMembers() throws Exception;
@GET
@Path("getReplicatingTo")
public String getReplicatingTo();
@GET
@Path("getReplicatingFrom")
public String getReplicatingFrom() throws Exception;
@GET
@Path("subscribeToRegistry/{registryId}")
public void subscribeToRegistry(@PathParam("registryId") String registryId)
throws Exception;
@GET
@Path("unsubscribeFromRegistry/{registryId}")
public void unsubscribeFromRegistry(
@PathParam("registryId") String registryId) throws Exception;
@GET
@Path("addReplicationServer/{registryId}")
public void addReplicationServer(@PathParam("registryId") String registryId)
throws Exception;
@GET
@Path("removeReplicationServer/{registryId}")
public void removeReplicationServer(
@PathParam("registryId") String registryId) throws Exception;
@GET
@Path("synchronizeWithRegistry/{registryId}")
public void synchronizeWithRegistry(
@PathParam("registryId") String registryId) throws Exception;
}

View file

@ -1,145 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.common.datadelivery.registry.web;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.xml.bind.JAXBException;
import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException;
import com.raytheon.uf.common.registry.services.RegistryServiceException;
/**
* <pre>
* Interface for Registry federation status
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 11/20/2013 2534 bphillip Initial Creation
* </pre>
*
* @author bphillip
* @version 1
**/
@Path(IRegistryFederationService.REGISTRY_FEDERATION_STATUS_PATH)
public interface IRegistryFederationService {
/** The path to these set of services */
public static final String REGISTRY_FEDERATION_STATUS_PATH = "/status/";
/**
* Gets if this registry is participating in the federation
*
* @return The value of the EBXML_REGISTRY_FEDERATION_ENABLED environment
* variable
*/
@GET
@Path("isFederated")
public String isFederated();
/**
* Gets information about this registry
*
* @return Information pertaining to the local registry
*/
@GET
@Path("getMyRegistryInfo")
public String getMyRegistryInfo();
/**
* Queries the NCF registry to get a list of registries in the federation
*
* @return The list of registries in the federation
* @throws MsgRegistryException
* If an error occurs while querying the NCF registry
*/
@GET
@Path("getFederationMembers")
public String getFederationMembers() throws MsgRegistryException;
/**
* Gets the list of registry that the local registry is subscribed to
*
* @return The list of registries that the local registry is subscribed to
*/
@GET
@Path("getRegistriesSubscribedTo")
public String getRegistriesSubscribedTo();
/**
* Gets a list of registries that are subscribing to the local registry
*
* @return The list of registries that are subscribing to the local registry
*/
@GET
@Path("getRegistrySubscribing")
public String getRegistrySubscribing();
/**
* Gets the list of object types that are currently being replicated
*
* @return The object list
*/
@GET
@Path("getObjectTypesReplicated")
public String getObjectTypesReplicated();
/**
* Kicks of a full registry sync with the specified registry
*
* @param registryId
* The registry ID to sync with
* @return status message
*/
@GET
@Path("syncWithRegistry/{registryId}")
public String syncWithRegistry(@PathParam("registryId") String registryId);
/**
* Subscribes to replication notifications from the specified registry
*
* @param registryId
* The ID of the registry to subscribe to
* @return Status message
* @throws JAXBException
* @throws RegistryServiceException
*/
@GET
@Path("subscribeToRegistry/{registryId}")
public String subscribeToRegistry(@PathParam("registryId") String registryId)
throws RegistryServiceException, JAXBException;
/**
* Unsubscribes from the specified registry
*
* @param registryId
* The ID of the registry to unsubscribe from
* @return The status message
*/
@GET
@Path("unsubscribeFromRegistry/{registryId}")
public String unsubscribeFromRegistry(
@PathParam("registryId") String registryId);
}

View file

@ -62,6 +62,7 @@ import com.raytheon.uf.common.registry.services.rest.IRepositoryItemsRestService
* 11/20/2013 2534 bphillip Added HTTPClient policy for rest connections. Eliminated service caching.
* 12/2/2013 1829 bphillip Removed expectedType argument on getRegistryObject method
* 1/15/2014 2613 bphillip Removed Service cache due to unexpected behavior
* 2/19/2014 2769 bphillip Added service cache
* </pre>
*
* @author bphillip
@ -105,7 +106,7 @@ public class RegistryRESTServices {
* @return The service implementation
*/
public IRegistryObjectsRestService getRegistryObjectService(String baseURL) {
return getPort(baseURL + REGISTRY_REST_SERVICE_PATH,
return createService(baseURL + REGISTRY_REST_SERVICE_PATH,
IRegistryObjectsRestService.class);
}
@ -142,7 +143,7 @@ public class RegistryRESTServices {
* @return The service implementation
*/
public IRepositoryItemsRestService getRepositoryItemService(String baseURL) {
return getPort(baseURL + REGISTRY_REST_SERVICE_PATH,
return createService(baseURL + REGISTRY_REST_SERVICE_PATH,
IRepositoryItemsRestService.class);
}
@ -171,7 +172,8 @@ public class RegistryRESTServices {
public Object accessXMLRestService(String url) {
String response = null;
try {
response = Resources.toString(new URL(url), Charset.forName("UTF8"));
response = Resources
.toString(new URL(url), Charset.forName("UTF8"));
} catch (Exception e) {
throw new RegistryServiceException(
"Error accessing REST service at URL: [" + url + "]", e);
@ -185,11 +187,6 @@ public class RegistryRESTServices {
}
}
protected <T extends Object> T getPort(String serviceUrl,
final Class<T> serviceInterface) {
return createService(serviceUrl, serviceInterface);
}
protected <T extends Object> T createService(String url,
Class<T> serviceClass) {
T service = JAXRSClientFactory.create(url, serviceClass);

View file

@ -73,6 +73,7 @@ import com.raytheon.uf.common.status.UFStatus;
* 10/30/2013 1538 bphillip Made methods in this class non-static
* 11/20/2013 2534 bphillip Eliminated service caching
* 1/15/2014 2613 bphillip Eliminated service caching...again
* 2/19/2014 2769 bphillip Renamed getPort method
* </pre>
*
* @author bphillip
@ -81,37 +82,37 @@ import com.raytheon.uf.common.status.UFStatus;
public class RegistrySOAPServices {
/** The logger */
private static final IUFStatusHandler statusHandler = UFStatus
protected static final IUFStatusHandler statusHandler = UFStatus
.getHandler(RegistrySOAPServices.class);
/** Default timeout for receiving HTTP data */
private static final long DEFAULT_RECEIVE_TIMEOUT = 60000;
protected static final long DEFAULT_RECEIVE_TIMEOUT = 60000;
/** Default value for establishing an HTTP connection */
private static final long DEFAULT_CONNECT_TIMEOUT = 10000;
protected static final long DEFAULT_CONNECT_TIMEOUT = 10000;
/** Path separator */
private static final String PATH_SEPARATOR = "/";
protected static final String PATH_SEPARATOR = "/";
/** WSDL suffix */
private static final String WSDL = "?wsdl";
protected static final String WSDL = "?wsdl";
/** The name of the notification listener service */
private static final String NOTIFICATION_SERVICE_NAME = "notificationListener";
protected static final String NOTIFICATION_SERVICE_NAME = "notificationListener";
/** The name of the lifecycle manager service */
private static final String LIFECYCLE_MANAGER_SERVICE_NAME = "lifecycleManager";
protected static final String LIFECYCLE_MANAGER_SERVICE_NAME = "lifecycleManager";
/** The name of the cataloger service */
private static final String CATALOGER_SERVICE_NAME = "cataloger";
protected static final String CATALOGER_SERVICE_NAME = "cataloger";
/** The name of the query service */
private static final String QUERY_SERVICE_NAME = "queryManager";
protected static final String QUERY_SERVICE_NAME = "queryManager";
/** The name of the validator service */
private static final String VALIDATOR_SERVICE_NAME = "validator";
protected static final String VALIDATOR_SERVICE_NAME = "validator";
private static final ProxyConfiguration proxyConfig;
protected static final ProxyConfiguration proxyConfig;
protected static final HTTPClientPolicy httpClientPolicy;
@ -187,7 +188,7 @@ public class RegistrySOAPServices {
*/
public NotificationListener getNotificationListenerServiceForUrl(
final String url) throws RegistryServiceException {
return getPort(url, NotificationListener.class);
return createService(url, NotificationListener.class);
}
/**
@ -210,7 +211,7 @@ public class RegistrySOAPServices {
* @return The lifecycle manager service at the given URL string
*/
public LifecycleManager getLifecycleManagerServiceForUrl(final String url) {
return getPort(url, LifecycleManager.class);
return createService(url, LifecycleManager.class);
}
/**
@ -233,7 +234,7 @@ public class RegistrySOAPServices {
* @return The cataloger service
*/
public Cataloger getCatalogerServiceForUrl(final String url) {
return getPort(url, Cataloger.class);
return createService(url, Cataloger.class);
}
/**
@ -255,7 +256,7 @@ public class RegistrySOAPServices {
* @return The query manager service at the given url string
*/
public QueryManager getQueryServiceForUrl(final String url) {
return getPort(url, QueryManager.class);
return createService(url, QueryManager.class);
}
/**
@ -281,7 +282,7 @@ public class RegistrySOAPServices {
*/
public Validator getValidatorServiceForUrl(final String url)
throws RegistryServiceException {
return getPort(url, Validator.class);
return createService(url, Validator.class);
}
/**
@ -336,7 +337,7 @@ public class RegistrySOAPServices {
}
@SuppressWarnings("unchecked")
private <T extends Object> T createService(String serviceUrl,
protected <T extends Object> T createService(String serviceUrl,
Class<?> serviceInterface) throws RegistryServiceException {
W3CEndpointReferenceBuilder endpointBuilder = new W3CEndpointReferenceBuilder();
endpointBuilder.wsdlDocumentLocation(serviceUrl.toString() + WSDL);
@ -354,11 +355,6 @@ public class RegistrySOAPServices {
return port;
}
private <T extends Object> T getPort(String serviceUrl,
final Class<T> serviceInterface) {
return createService(serviceUrl, serviceInterface);
}
/**
* Gets the proxy configuration
*

View file

@ -31,6 +31,8 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest;
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
import org.apache.cxf.annotations.FastInfoset;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
@ -44,6 +46,7 @@ import com.raytheon.uf.common.registry.EbxmlNamespaces;
* 2012 bphillip Initial implementation
* 10/17/2013 1682 bphillip Added software history
* 12/9/2013 2613 bphillip Changed to use FastInfoset
* 2/19/2014 2769 bphillip Added Transactional annotation to executeQuery method
* </pre>
*
* @author bphillip
@ -71,6 +74,7 @@ public interface QueryManager {
*/
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException;

View file

@ -37,6 +37,7 @@ import com.raytheon.uf.common.dataplugin.persist.IPersistableDataObject;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Feb 13, 2013 1543 djohnson Initial creation
* 2/19/2014 2769 bphillip Added loadById method
*
* </pre>
*
@ -110,6 +111,17 @@ public interface ISessionManagedDao<IDENTIFIER extends Serializable, ENTITY exte
*/
ENTITY getById(IDENTIFIER id);
/**
* Load an entity by its id. This method differs from the getById method in
* that it only returns a proxy. The database is not actually hit until the
* object is used.
*
* @param id
* the id
* @return the entity
*/
ENTITY loadById(IDENTIFIER id);
/**
* Get all of the entities of this type.
*

View file

@ -64,6 +64,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException;
* 10/8/2013 1682 bphillip Added the createCriteria method
* 12/9/2013 2613 bphillip Added flushAndClearSession method
* Jan 17, 2014 2459 mpduff Added null check to prevent NPE.
* 2/13/2014 2769 bphillip Added read-only flag to query methods and loadById method
*
* </pre>
*
@ -148,21 +149,34 @@ public abstract class SessionManagedDao<IDENTIFIER extends Serializable, ENTITY
* {@inheritDoc}
*/
@Override
@Transactional(propagation = Propagation.REQUIRED)
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public ENTITY getById(IDENTIFIER id) {
final Class<ENTITY> entityClass = getEntityClass();
return entityClass.cast(template.get(entityClass, id));
}
@Override
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public ENTITY loadById(IDENTIFIER id) {
final Class<ENTITY> entityClass = getEntityClass();
return entityClass.cast(template.load(entityClass, id));
}
/**
* {@inheritDoc}
*/
@Override
@Transactional(propagation = Propagation.REQUIRED)
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getAll() {
return query("from " + getEntityClass().getSimpleName());
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> loadAll() {
return this.template.loadAll(getEntityClass());
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public ENTITY uniqueResult(String queryString) {
return uniqueResult(queryString, new Object[0]);
}
@ -174,7 +188,7 @@ public abstract class SessionManagedDao<IDENTIFIER extends Serializable, ENTITY
* @param params
* @return
*/
@Transactional(propagation = Propagation.REQUIRED)
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
protected ENTITY uniqueResult(String queryString, Object... params) {
final List<ENTITY> results = executeHQLQuery(queryString, params);
if (results.isEmpty()) {
@ -186,6 +200,7 @@ public abstract class SessionManagedDao<IDENTIFIER extends Serializable, ENTITY
return results.get(0);
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> query(String queryString) {
return executeHQLQuery(queryString);
}
@ -197,12 +212,12 @@ public abstract class SessionManagedDao<IDENTIFIER extends Serializable, ENTITY
* @param params
* @return
*/
@Transactional(propagation = Propagation.REQUIRED)
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> query(String queryString, Object... params) {
return executeHQLQuery(queryString, 0, params);
}
@Transactional(propagation = Propagation.REQUIRED)
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> query(String queryString, Integer maxResults,
Object... params) {
return executeHQLQuery(queryString, maxResults, params);
@ -220,7 +235,7 @@ public abstract class SessionManagedDao<IDENTIFIER extends Serializable, ENTITY
* @throws DataAccessLayerException
* If errors are encountered during the HQL query
*/
@Transactional(propagation = Propagation.REQUIRED)
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public <T extends Object> List<T> executeHQLQuery(String queryString) {
return executeHQLQuery(queryString, 0);
}
@ -242,7 +257,7 @@ public abstract class SessionManagedDao<IDENTIFIER extends Serializable, ENTITY
* @throws DataAccessLayerException
* If Hibernate errors occur during the execution of the query
*/
@Transactional(propagation = Propagation.REQUIRED)
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public <T extends Object> List<T> executeHQLQuery(String queryString,
Object... params) {
return executeHQLQuery(queryString, 0, params);
@ -270,7 +285,7 @@ public abstract class SessionManagedDao<IDENTIFIER extends Serializable, ENTITY
* @return The results of the query
*/
@SuppressWarnings("unchecked")
@Transactional(propagation = Propagation.REQUIRED)
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public <T extends Object> List<T> executeHQLQuery(final String queryString,
Integer maxResults, Object... params) {
if (params.length % 2 != 0) {
@ -297,7 +312,7 @@ public abstract class SessionManagedDao<IDENTIFIER extends Serializable, ENTITY
}
@SuppressWarnings("unchecked")
@Transactional(propagation = Propagation.REQUIRED)
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public <T extends Object> Iterator<T> getQueryIterator(
final String queryString, Object... params) {
if (params.length == 0) {
@ -391,7 +406,7 @@ public abstract class SessionManagedDao<IDENTIFIER extends Serializable, ENTITY
* If errors occur in Hibernate while executing the query
*/
@SuppressWarnings("unchecked")
@Transactional(propagation = Propagation.REQUIRED)
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public <T extends Object> List<T> executeCriteriaQuery(
final DetachedCriteria criteria) {
if (criteria == null) {
@ -404,6 +419,11 @@ public abstract class SessionManagedDao<IDENTIFIER extends Serializable, ENTITY
this.getSessionFactory().getCurrentSession().evict(entity);
}
public ENTITY load(Serializable id) {
return this.template.load(getEntityClass(), id);
}
/**
* Low-level method to execute a unit of work.
*

View file

@ -0,0 +1,50 @@
<beans xmlns="http://www.springframework.org/schema/beans"
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://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext id="ebxml-federation" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<endpoint id="replicationMonitor"
uri="quartz://registry/replicationMonitor/?cron=0+0+0/1+*+*+?"/>
<endpoint id="updateUptime"
uri="quartz://registry/updateUptime/?cron=0+0/1+*+*+*+?" />
<endpoint id="purgeExpiredReplicationEvents"
uri="quartz://registry/purgeExpiredReplicationEvents/?cron=0+0+0/1+*+*+?" />
<endpoint id="processReplicationSubscriptions"
uri="quartz://registry/registryReplicationQuartz/?cron=${ebxml-replication-process.cron}" />
<endpoint id="processReplicationVMQueue" uri="vm:processReplication?concurrentConsumers=2"/>
<route id="replicationMonitorRoute">
<from uri="replicationMonitor"/>
<bean ref="RegistryFederationManager" method="verifyReplication"/>
</route>
<route id="updateUptimeRoute">
<from uri="updateUptime" />
<bean ref="RegistryFederationManager" method="updateUpTime" />
</route>
<route id="forwardReplication">
<from uri="processReplicationSubscriptions"/>
<to uri="processReplicationVMQueue"/>
</route>
<route id="processReplication">
<from uri="processReplicationVMQueue"/>
<bean ref="RegistryFederationManager" method="processReplicationEvents"/>
</route>
<route id="purgeExpiredReplicationEventsRoute">
<from uri="purgeExpiredReplicationEvents"/>
<bean ref="RegistryFederationManager" method="deleteExpiredEvents"/>
</route>
</camelContext>
</beans>

View file

@ -4,18 +4,28 @@
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="FederatedRegistryMonitor" class="com.raytheon.uf.edex.datadelivery.registry.availability.FederatedRegistryMonitor">
<constructor-arg ref="metadataTxTemplate"/>
<constructor-arg ref="registryObjectDao"/>
</bean>
<bean id="replicationEventDao"
class="com.raytheon.uf.edex.datadelivery.registry.dao.ReplicationEventDao">
<property name="sessionFactory" ref="metadataSessionFactory" />
</bean>
<bean id="FederationDbInit" class="com.raytheon.uf.edex.datadelivery.registry.federation.FederationDbInit">
<property name="dao" ref="registryObjectDao" />
</bean>
<bean id="RegistryFederationManager" class="com.raytheon.uf.edex.datadelivery.registry.federation.RegistryFederationManager">
<constructor-arg ref="lcmServiceImpl"/>
<constructor-arg ref="FederatedRegistryMonitor"/>
<constructor-arg ref="metadataTxTemplate"/>
<property name="registryObjectDao" ref="registryObjectDao"/>
<property name="replicationEventDao" ref="replicationEventDao"/>
<property name="registryDao" ref="registryDao"/>
<property name="registrySoapServices" ref="registryWebServiceClient"/>
<property name="txTemplate" ref="metadataTxTemplate"/>
<property name="soapService" ref="registryWebServiceClient"/>
<property name="localLifecycleManager" ref="lcmServiceImpl"/>
<property name="dataDeliveryRestClient" ref="dataDeliveryRestClient"/>
<property name="registryObjectDao" ref="registryObjectDao"/>
<property name="federatedRegistryMonitor" ref="FederatedRegistryMonitor"/>
<property name="federationDbInit" ref="FederationDbInit"/>
</bean>

View file

@ -23,19 +23,21 @@
<bean id="registryAvailabilityService"
class="com.raytheon.uf.edex.datadelivery.registry.web.RegistryAvailableRestService" />
<bean id="registryStatus" class="com.raytheon.uf.edex.datadelivery.registry.web.RegistryFederationStatus">
<property name="registryDao" ref="registryDao"/>
<property name="subscriptionDao" ref="subscriptionTypeDao"/>
<property name="federationManager" ref="RegistryFederationManager"/>
<property name="dataDeliveryRestClient" ref="dataDeliveryRestClient"/>
<property name="registrySoapServices" ref="registryWebServiceClient"/>
</bean>
<bean id="defineRegistryQuery" class="com.raytheon.uf.edex.datadelivery.registry.web.RegistryQueryDefinitionService">
<property name="registryObjectDao" ref="registryObjectDao"/>
</bean>
<!-- SOAP Service definitions -->
<jaxws:server id="RegistryFederationManagerService" address="/registryFederationManager">
<jaxws:inInterceptors>
<ref bean="webServiceInInterceptor" />
</jaxws:inInterceptors>
<jaxws:serviceBean>
<ref bean="RegistryFederationManager" />
</jaxws:serviceBean>
</jaxws:server>
<!-- REST Service Definitions -->
<jaxrs:server id="dataDeliveryRestServices" address="/dataDelivery">
@ -45,7 +47,7 @@
<jaxrs:serviceBeans>
<ref bean="registryDataAccessService" />
<ref bean="registryAvailabilityService" />
<ref bean="registryStatus"/>
<ref bean="RegistryFederationManager"/>
<ref bean="defineRegistryQuery"/>
</jaxrs:serviceBeans>
</jaxrs:server>

View file

@ -26,14 +26,13 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.VersionInfoType;
import org.springframework.transaction.support.TransactionTemplate;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.constants.StatusTypes;
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.edex.database.RunnableWithTransaction;
import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
@ -53,12 +52,14 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
* ------------ ---------- ----------- --------------------------
* 7/29/2013 2191 bphillip Initial implementation
* 12/2/2013 1829 bphillip Uses correct getter for getting date time value
* 2/19/2014 2769 bphillip Refactored to no longer extend Runnable
* </pre>
*
* @author bphillip
* @version 1
*/
public class FederatedRegistryMonitor extends RunnableWithTransaction {
@Transactional
public class FederatedRegistryMonitor {
/** The logger instance */
private static final IUFStatusHandler statusHandler = UFStatus
@ -74,9 +75,7 @@ public class FederatedRegistryMonitor extends RunnableWithTransaction {
super();
}
public FederatedRegistryMonitor(TransactionTemplate txTemplate,
RegistryObjectDao registryObjectDao) {
super(txTemplate);
public FederatedRegistryMonitor(RegistryObjectDao registryObjectDao) {
this.registryObjectDao = registryObjectDao;
}
@ -95,9 +94,9 @@ public class FederatedRegistryMonitor extends RunnableWithTransaction {
return cal.getTimeInMillis();
}
@Override
public void runWithTransaction() {
public void updateTime() {
try {
statusHandler.info("Updating registry uptime");
RegistryObjectType regObj = registryObjectDao
.getById(REGISTRY_AVAILABLE_ID);
if (regObj == null) {

View file

@ -0,0 +1,60 @@
/**
* 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.registry.dao;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.edex.database.dao.SessionManagedDao;
import com.raytheon.uf.edex.datadelivery.registry.federation.ReplicationEvent;
/**
* <pre>
*
* Data Access object for interactions with ReplicationEvent objects
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 2/19/2014 2769 bphillip Initial Creation
* </pre>
*
* @author bphillip
* @version 1
**/
public class ReplicationEventDao extends
SessionManagedDao<Long, ReplicationEvent> {
private static final String GET_REPLICATION_EVENT_QUERY = "from ReplicationEvent event where (event.source is null or event.source != '%s') and (event.replicatedTo is null or event.replicatedTo not like '%%%s%%') order by event.eventTime asc";
@Override
protected Class<ReplicationEvent> getEntityClass() {
return ReplicationEvent.class;
}
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public List<ReplicationEvent> getReplicationEvents(String remoteRegistry) {
return this.executeHQLQuery(String.format(GET_REPLICATION_EVENT_QUERY,
remoteRegistry, remoteRegistry));
}
}

View file

@ -0,0 +1,65 @@
/**
* 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.registry.federation;
import org.hibernate.cfg.AnnotationConfiguration;
import com.raytheon.uf.edex.database.init.DbInit;
/**
* <pre>
*
* Creates the database tables necessary for federation replication to function
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 2/19/2014 2769 bphillip Initial Creation
* </pre>
*
* @author bphillip
* @version 1
**/
public class FederationDbInit extends DbInit {
/** Query to check which tables exist in the ebxml database */
private static final String TABLE_CHECK_QUERY = "SELECT tablename FROM pg_tables where schemaname = 'awips' and tablename='registryreplicationevents';";
protected FederationDbInit() {
super("Data Delivery Federation");
}
@Override
protected String getTableCheckQuery() {
return TABLE_CHECK_QUERY;
}
@Override
protected AnnotationConfiguration getAnnotationConfiguration() {
/*
* Create a new configuration object which holds all the classes that
* this Hibernate SessionFactory is aware of
*/
AnnotationConfiguration aConfig = new AnnotationConfiguration();
aConfig.addAnnotatedClass(ReplicationEvent.class);
return aConfig;
}
}

View file

@ -25,6 +25,8 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.datatype.Duration;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.FederationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.OrganizationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PersonNameType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PersonType;
@ -32,6 +34,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PostalAddressType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.TelephoneNumberType;
import com.raytheon.uf.common.registry.constants.AssociationTypes;
import com.raytheon.uf.common.registry.constants.RegistryObjectTypes;
import com.raytheon.uf.common.registry.constants.StatusTypes;
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
@ -50,6 +53,7 @@ import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil;
* ------------ ---------- ----------- --------------------------
* 5/22/2013 1707 bphillip Initial implementation
* Feb 11, 2014 2771 bgonzale Removed siteIdentifier field and use Data Delivery ID instead.
* 2/19/2014 2769 bphillip Moved getFederationAssociation from RegistryFederationManager
* </pre>
*
* @author bphillip
@ -59,6 +63,9 @@ import com.raytheon.uf.edex.datadelivery.util.DataDeliveryIdUtil;
@XmlAccessorType(XmlAccessType.FIELD)
public class FederationProperties {
/** Constant used for names of registries in the registry database */
public static final String REGISTRY_SUFFIX = " Registry";
/**
* A RegistryType instance MAY have an attribute named conformanceProfile
* that declares the conformance profile that the server supports. The
@ -180,11 +187,11 @@ public class FederationProperties {
*/
public RegistryType createRegistryObject() {
RegistryType registryObj = new RegistryType();
registryObj.setId(DataDeliveryIdUtil.getId() + " Registry");
registryObj.setId(DataDeliveryIdUtil.getId() + REGISTRY_SUFFIX);
registryObj.setLid(registryObj.getId());
registryObj.setName(RegistryUtil
.getInternationalString(DataDeliveryIdUtil.getId()
+ " Registry Specification"));
+ " Registry Specification"));
registryObj.setObjectType(RegistryObjectTypes.REGISTRY);
registryObj.setDescription(registryObj.getName());
registryObj.setOwner(DataDeliveryIdUtil.getId());
@ -271,6 +278,24 @@ public class FederationProperties {
return siteAddress;
}
protected AssociationType getFederationAssociation(RegistryType registry,
FederationType federation) {
AssociationType association = new AssociationType();
association.setId(registry.getId()
+ " Federation Membership Association");
association.setLid(association.getId());
association.setObjectType(RegistryObjectTypes.ASSOCIATION);
association.setOwner(DataDeliveryIdUtil.getId());
association.setType(AssociationTypes.HAS_FEDERATION_MEMBER);
association.setStatus(StatusTypes.APPROVED);
association.setName(RegistryUtil.getInternationalString(registry
.getId() + " Federation Membership"));
association.setDescription(association.getName());
association.setTargetObject(registry.getId());
association.setSourceObject(federation.getId());
return association;
}
public String getConformanceProfile() {
return conformanceProfile;
}

View file

@ -0,0 +1,77 @@
/**
* 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.registry.federation;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
/**
*
* Exception class used by the registry federation manager for when a registry
* is not found in the federation
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 2/24/2014 2769 bphillip Initial Creation
* </pre>
*
* @author bphillip
* @version 1
**/
public class RegistryNotFoundException extends EbxmlRegistryException {
private static final long serialVersionUID = -8058778534952899091L;
/**
* Creates a new exception with the given message
*
* @param message
* The message to attach to the exception
*/
public RegistryNotFoundException(String message) {
super(message);
}
/**
* Creates a new exception with the given message and cause
*
* @param message
* The message to attach to the exception
* @param cause
* The underlying cause of the exception
*/
public RegistryNotFoundException(String message, Throwable cause) {
super(message, cause);
}
/**
* Creates a new exception with the given cause
*
* @param cause
* The underlying cause of the exception
*/
public RegistryNotFoundException(Throwable cause) {
super(cause);
}
}

View file

@ -0,0 +1,154 @@
/**
* 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.registry.federation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import com.raytheon.uf.common.dataplugin.persist.IPersistableDataObject;
/**
* <pre>
*
* Class encapsulating a registry event
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 2/19/2014 2769 bphillip Initial Creation
* </pre>
*
* @author bphillip
* @version 1
**/
@Entity
@Table(name = "registryreplicationevents")
public class ReplicationEvent implements IPersistableDataObject<Long> {
@Id
@GeneratedValue
private Long id;
@Column
private String source;
@Column
private String eventType;
@Column
private long eventTime;
@Column
private String objectId;
@Column
private String objectType;
@Column
private String replicatedTo;
public ReplicationEvent() {
super();
}
public ReplicationEvent(String eventType, long eventTime, String objectId,
String objectType, String source) {
super();
this.eventType = eventType;
this.eventTime = eventTime;
this.objectId = objectId;
this.objectType = objectType;
this.source = source;
}
@Override
public Long getIdentifier() {
return getId();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public void setSource(String source) {
this.source = source;
}
public String getEventType() {
return eventType;
}
public void setEventType(String eventType) {
this.eventType = eventType;
}
public long getEventTime() {
return eventTime;
}
public void setEventTime(long eventTime) {
this.eventTime = eventTime;
}
public String getObjectId() {
return objectId;
}
public void setObjectId(String objectId) {
this.objectId = objectId;
}
public String getObjectType() {
return objectType;
}
public void setObjectType(String objectType) {
this.objectType = objectType;
}
public String getReplicatedTo() {
return replicatedTo;
}
public void setReplicatedTo(String replicatedTo) {
this.replicatedTo = replicatedTo;
}
public void addReplicatedTo(String recipient) {
if (this.replicatedTo == null) {
this.replicatedTo = ":" + recipient + ":";
} else if (!this.replicatedTo.contains(recipient)) {
this.replicatedTo += ":" + recipient + ":";
}
}
public String getSource() {
return source;
}
}

View file

@ -1,105 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.datadelivery.registry.replication;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
/**
*
* Host configuration information
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 4/9/2013 1802 bphillip Initial implementation
* 6/4/2013 1707 bphillip Renamed and changed fields for clarity
* 11/20/2013 2534 bphillip Added reciprocate field
* </pre>
*
* @author bphillip
* @version 1
*/
@XmlAccessorType(XmlAccessType.NONE)
public class NotificationHostConfiguration {
/** The site that this registry is running at */
@XmlElement
private String registrySiteName;
/** Descripion of the host */
@XmlElement
private String registryDescription;
/** The name of the host */
@XmlElement
private String registryBaseURL;
/** True if subscriptions should be reciprocated */
@XmlElement
private boolean reciprocate = false;
public NotificationHostConfiguration() {
}
public NotificationHostConfiguration(String registrySiteName,
String registryDescription, String registryBaseURL) {
this.registrySiteName = registrySiteName;
this.registryDescription = registryDescription;
this.registryBaseURL = registryBaseURL;
}
public String getRegistrySiteName() {
return registrySiteName;
}
public void setRegistrySiteName(String registrySiteName) {
this.registrySiteName = registrySiteName;
}
public String getRegistryDescription() {
return registryDescription;
}
public void setRegistryDescription(String registryDescription) {
this.registryDescription = registryDescription;
}
public String getRegistryBaseURL() {
return registryBaseURL;
}
public void setRegistryBaseURL(String registryBaseURL) {
this.registryBaseURL = registryBaseURL;
}
public boolean isReciprocate() {
return reciprocate;
}
public void setReciprocate(boolean reciprocate) {
this.reciprocate = reciprocate;
}
}

View file

@ -19,8 +19,8 @@
**/
package com.raytheon.uf.edex.datadelivery.registry.replication;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
@ -43,6 +43,7 @@ import javax.xml.bind.annotation.XmlRootElement;
* 5/21/2013 1707 bphillip Removed unused fields
* 6/4/2013 1707 bphillip Renamed and changed fields for clarity
* 10/30/2013 1538 bphillip getRegistryReplicationServers returns empty list if no servers are specified
* 2/27/2014 2769 bphillip Changed replicationservers variable to set of strings
* </pre>
*
* @author bphillip
@ -53,19 +54,27 @@ import javax.xml.bind.annotation.XmlRootElement;
public class NotificationServers {
/** The server located upstream from this server */
@XmlElements({ @XmlElement(name = "registry", type = NotificationHostConfiguration.class) })
private CopyOnWriteArrayList<NotificationHostConfiguration> registryReplicationServers;
@XmlElements({ @XmlElement(name = "registry") })
private CopyOnWriteArraySet<String> registryReplicationServers;
public List<NotificationHostConfiguration> getRegistryReplicationServers() {
public Set<String> getRegistryReplicationServers() {
if (registryReplicationServers == null) {
registryReplicationServers = new CopyOnWriteArrayList<NotificationHostConfiguration>();
registryReplicationServers = new CopyOnWriteArraySet<String>();
}
return registryReplicationServers;
}
public void setRegistryReplicationServers(
List<NotificationHostConfiguration> registryReplicationServers) {
this.registryReplicationServers = new CopyOnWriteArrayList<NotificationHostConfiguration>(
Set<String> registryReplicationServers) {
this.registryReplicationServers = new CopyOnWriteArraySet<String>(
registryReplicationServers);
}
public void addReplicationServer(String registryId) {
this.getRegistryReplicationServers().add(registryId);
}
public void removeReplicationServer(String registryId) {
this.getRegistryReplicationServers().remove(registryId);
}
}

View file

@ -25,7 +25,7 @@ import org.apache.commons.lang.exception.ExceptionUtils;
import com.raytheon.uf.common.datadelivery.registry.web.IRegistryAvailableRestService;
import com.raytheon.uf.common.datadelivery.registry.web.IRegistryDataAccessService;
import com.raytheon.uf.common.datadelivery.registry.web.IRegistryFederationService;
import com.raytheon.uf.common.datadelivery.registry.web.IRegistryFederationManager;
import com.raytheon.uf.common.registry.constants.RegistryAvailability;
import com.raytheon.uf.common.registry.services.RegistryRESTServices;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -42,6 +42,7 @@ import com.raytheon.uf.common.status.UFStatus;
* ------------ ---------- ----------- --------------------------
* 10/30/2013 1538 bphillip Initial Creation
* 11/20/2013 2534 bphillip Eliminated service caching
* 2/27/2014 2769 bphillip Add RegistryFederationManager to exposed REST services
* </pre>
*
* @author bphillip
@ -62,9 +63,10 @@ public class DataDeliveryRESTServices extends RegistryRESTServices {
super();
}
public IRegistryFederationService getFederationService(String baseURL) {
return getPort(baseURL + DATA_DELIVERY_REST_SERVICE_PATH,
IRegistryFederationService.class);
public IRegistryFederationManager getRegistryFederationManager(
String baseURL) {
return createService(baseURL + DATA_DELIVERY_REST_SERVICE_PATH,
IRegistryFederationManager.class);
}
/**
@ -76,7 +78,7 @@ public class DataDeliveryRESTServices extends RegistryRESTServices {
*/
public IRegistryAvailableRestService getRegistryAvailableService(
String baseURL) {
return getPort(baseURL + DATA_DELIVERY_REST_SERVICE_PATH,
return createService(baseURL + DATA_DELIVERY_REST_SERVICE_PATH,
IRegistryAvailableRestService.class);
}
@ -118,7 +120,7 @@ public class DataDeliveryRESTServices extends RegistryRESTServices {
*/
public IRegistryDataAccessService getRegistryDataAccessService(
String baseURL) {
return getPort(baseURL + DATA_DELIVERY_REST_SERVICE_PATH,
return createService(baseURL + DATA_DELIVERY_REST_SERVICE_PATH,
IRegistryDataAccessService.class);
}

View file

@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.datadelivery.registry.web.IRegistryAvailableRestService;
import com.raytheon.uf.common.registry.constants.RegistryAvailability;
import com.raytheon.uf.edex.datadelivery.registry.federation.RegistryFederationManager;
import com.raytheon.uf.edex.registry.ebxml.dao.DbInit;
/**
@ -64,7 +65,8 @@ public class RegistryAvailableRestService implements
@GET
@Produces("text/plain")
public String isRegistryAvailable() {
if (DbInit.isDbInitialized()) {
if (DbInit.isDbInitialized()
&& RegistryFederationManager.initialized.get()) {
return RegistryAvailability.AVAILABLE;
} else {
return RegistryAvailability.DB_NOT_INITIALIZED;

View file

@ -1,349 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.edex.datadelivery.registry.web;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.xml.bind.JAXBException;
import javax.xml.transform.dom.DOMResult;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException;
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest;
import oasis.names.tc.ebxml.regrep.xsd.query.v4.ResponseOptionType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.DeliveryInfoType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SubscriptionType;
import org.springframework.transaction.annotation.Transactional;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.raytheon.uf.common.datadelivery.registry.web.IRegistryFederationService;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.registry.constants.AssociationTypes;
import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes;
import com.raytheon.uf.common.registry.constants.DeliveryMethodTypes;
import com.raytheon.uf.common.registry.constants.QueryReturnTypes;
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
import com.raytheon.uf.common.registry.services.RegistrySOAPServices;
import com.raytheon.uf.common.registry.services.RegistryServiceException;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.util.CollectionUtil;
import com.raytheon.uf.common.util.StringUtil;
import com.raytheon.uf.edex.datadelivery.registry.federation.RegistryFederationManager;
import com.raytheon.uf.edex.datadelivery.registry.replication.NotificationHostConfiguration;
import com.raytheon.uf.edex.registry.ebxml.dao.RegistryDao;
import com.raytheon.uf.edex.registry.ebxml.dao.SubscriptionDao;
import com.raytheon.uf.edex.registry.ebxml.services.notification.RegistrySubscriptionManager;
import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
/**
* <pre>
* Set of services used by the federation status web interface to modify federation associations
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 10/30/2013 1538 bphillip Initial Creation
* 11/20/2013 2534 bphillip Added interface
* 12/2/2013 1829 bphillip Changed to use modified call to getRegistryObject
* 12/9/2013 2613 bphillip Changed getRegistriesSubscribedTo to not execute remote queries
* </pre>
*
* @author bphillip
* @version 1
**/
@Path(IRegistryFederationService.REGISTRY_FEDERATION_STATUS_PATH)
@Transactional
public class RegistryFederationStatus implements IRegistryFederationService {
/** The logger instance */
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(RegistryFederationStatus.class);
/** Comparator to sort registry instances */
private static final Comparator<RegistryObjectType> REGISTRY_COMPARATOR = new Comparator<RegistryObjectType>() {
@Override
public int compare(RegistryObjectType o1, RegistryObjectType o2) {
return o1.getId().compareTo(o2.getId());
}
};
/** Data Access object for registry objects */
private RegistryDao registryDao;
/** Data Access object for registry subscription objects */
private SubscriptionDao subscriptionDao;
/** The registry replication manager */
private RegistryFederationManager federationManager;
/** Data Delivery rest services client */
private DataDeliveryRESTServices dataDeliveryRestClient;
/** Registry soap services client */
private RegistrySOAPServices registrySoapServices;
/**
* The address to the NCF registry loaded from the NCF_ADDRESS item in
* setup.env
*/
private String ncfAddress = System.getenv("NCF_ADDRESS");
@GET
@Path("isFederated")
public String isFederated() {
return System.getenv("EBXML_REGISTRY_FEDERATION_ENABLED");
}
@GET
@Path("getMyRegistryInfo")
public String getMyRegistryInfo() {
StringBuilder builder = new StringBuilder();
RegistryType myRegistry = registryDao
.getRegistryByBaseURL(RegistryUtil.LOCAL_REGISTRY_ADDRESS);
appendRegistryInfo(myRegistry, builder);
return builder.toString();
}
@GET
@Path("getFederationMembers")
public String getFederationMembers() throws MsgRegistryException {
StringBuilder builder = new StringBuilder();
QueryType query = new QueryType(
CanonicalQueryTypes.FIND_ASSOCIATED_OBJECTS);
query.getSlot().add(
new SlotType(QueryConstants.ASSOCIATION_TYPE,
new StringValueType(
AssociationTypes.HAS_FEDERATION_MEMBER)));
query.getSlot().add(
new SlotType(QueryConstants.SOURCE_OBJECT_ID,
new StringValueType(
RegistryFederationManager.FEDERATION_ID)));
QueryRequest queryRequest = new QueryRequest("Get Federation Members",
query, new ResponseOptionType(QueryReturnTypes.REGISTRY_OBJECT,
true));
List<RegistryObjectType> federationMembers = registrySoapServices
.getQueryServiceForHost(ncfAddress).executeQuery(queryRequest)
.getRegistryObjects();
Collections.sort(federationMembers, REGISTRY_COMPARATOR);
for (RegistryObjectType obj : federationMembers) {
if (obj instanceof RegistryType) {
RegistryType registry = (RegistryType) obj;
appendRegistryInfo(registry, builder);
}
}
return builder.toString();
}
@GET
@Path("getRegistriesSubscribedTo")
public String getRegistriesSubscribedTo() {
StringBuilder builder = new StringBuilder();
if (this.federationManager.getServers() != null
&& !CollectionUtil.isNullOrEmpty(this.federationManager
.getServers().getRegistryReplicationServers())) {
List<RegistryObjectType> registries = new ArrayList<RegistryObjectType>();
for (NotificationHostConfiguration hostConfig : this.federationManager
.getServers().getRegistryReplicationServers()) {
RegistryType reg = registryDao.getRegistryByBaseURL(hostConfig
.getRegistryBaseURL());
if (reg != null) {
registries.add(reg);
}
}
Collections.sort(registries, REGISTRY_COMPARATOR);
for (RegistryObjectType reg : registries) {
appendRegistryInfo((RegistryType) reg, builder);
}
}
return builder.toString();
}
@GET
@Path("getRegistrySubscribing")
public String getRegistrySubscribing() {
StringBuilder builder = new StringBuilder();
List<RegistryObjectType> registries = new ArrayList<RegistryObjectType>();
for (SubscriptionType sub : subscriptionDao.getAll()) {
DeliveryInfoType deliveryInfo = sub.getDeliveryInfo().get(0);
W3CEndpointReference endpointReference = deliveryInfo.getNotifyTo();
DOMResult dom = new DOMResult();
endpointReference.writeTo(dom);
Document doc = (Document) dom.getNode();
NodeList nodes = doc.getElementsByTagNameNS(
EbxmlNamespaces.ADDRESSING_URI,
RegistrySubscriptionManager.ADDRESS_TAG);
Node addressNode = nodes.item(0);
String serviceAddress = addressNode.getTextContent().trim();
String endpointType = addressNode
.getAttributes()
.getNamedItemNS(EbxmlNamespaces.RIM_URI,
RegistrySubscriptionManager.ENDPOINT_TAG)
.getNodeValue();
if (endpointType.equals(DeliveryMethodTypes.SOAP)) {
RegistryType registry = registryDao
.getRegistryByBaseURL(serviceAddress.replace(
"/notificationListener", ""));
if (registry != null && !registries.contains(registry)) {
registries.add(registry);
}
}
}
Collections.sort(registries, REGISTRY_COMPARATOR);
for (RegistryObjectType reg : registries) {
appendRegistryInfo((RegistryType) reg, builder);
}
return builder.toString();
}
@GET
@Path("getObjectTypesReplicated")
public String getObjectTypesReplicated() {
StringBuilder builder = new StringBuilder();
for (String objectType : RegistryFederationManager.getObjectTypes()) {
builder.append(objectType).append(StringUtil.NEWLINE);
}
return builder.toString();
}
@GET
@Path("syncWithRegistry/{registryId}")
public String syncWithRegistry(@PathParam("registryId") String registryId) {
StringBuilder builder = new StringBuilder();
RegistryType registry = registryDao.getById(registryId);
if (registry == null) {
builder.append("Registry [" + registryId
+ "] not in federation. Unable to synchronize.");
} else {
try {
federationManager.synchronizeRegistryWithFederation(registry
.getBaseURL());
} catch (Exception e) {
statusHandler.error("Error synchronizing registry!", e);
builder.append("Error synchronizing registry [" + registryId
+ "]: " + e.getLocalizedMessage());
}
}
return builder.toString();
}
@GET
@Path("subscribeToRegistry/{registryId}")
public String subscribeToRegistry(@PathParam("registryId") String registryId)
throws RegistryServiceException, JAXBException {
StringBuilder builder = new StringBuilder();
RegistryType registry = dataDeliveryRestClient.getRegistryObject(
ncfAddress, registryId);
if (registry == null) {
builder.append("Registry [")
.append(registryId)
.append("] not in federation. Unable to submit subscriptions.");
} else {
if (!federationManager.isSubscribedTo(registry)) {
federationManager.submitSubscriptionsToRegistry(registry);
builder.append("Successfully subscribed to registry [")
.append(registryId).append("]");
this.federationManager.addNotificationServer(registry);
federationManager.saveNotificationServers();
}
}
return builder.toString();
}
@GET
@Path("unsubscribeFromRegistry/{registryId}")
public String unsubscribeFromRegistry(
@PathParam("registryId") String registryId) {
StringBuilder builder = new StringBuilder();
RegistryType registry = registryDao.getById(registryId);
if (registry == null) {
builder.append("Registry [" + registryId
+ "] not in federation. Unable to unsubscribe.");
} else {
RegistryType localRegistry = registryDao
.getRegistryByBaseURL(RegistryUtil.LOCAL_REGISTRY_ADDRESS);
dataDeliveryRestClient.getRegistryDataAccessService(
registry.getBaseURL()).removeSubscriptionsForSite(
localRegistry.getOwner());
builder.append("Successfully unsubscribed from registry ["
+ registryId + "]");
federationManager.removeNotificationServer(registry.getBaseURL());
federationManager.saveNotificationServers();
}
return builder.toString();
}
/**
* Appends registry information to the stringbuilder
*
* @param registry
* The registry to get information for
* @param builder
* The string builder to append to
*/
private void appendRegistryInfo(RegistryType registry, StringBuilder builder) {
builder.append(registry.getId()).append(",");
builder.append(registry.getBaseURL()).append(",");
builder.append(registry.getConformanceProfile()).append(",");
builder.append(registry.getSpecificationVersion());
builder.append(StringUtil.NEWLINE);
}
public void setFederationManager(RegistryFederationManager federationManager) {
this.federationManager = federationManager;
}
public void setRegistryDao(RegistryDao registryDao) {
this.registryDao = registryDao;
}
public void setSubscriptionDao(SubscriptionDao subscriptionDao) {
this.subscriptionDao = subscriptionDao;
}
public void setDataDeliveryRestClient(
DataDeliveryRESTServices dataDeliveryRestClient) {
this.dataDeliveryRestClient = dataDeliveryRestClient;
}
public void setRegistrySoapServices(
RegistrySOAPServices registrySoapServices) {
this.registrySoapServices = registrySoapServices;
}
}

View file

@ -1,19 +1,10 @@
<!-- This file is intended to be overridden by sites. It contains the list of
registries that this registry wishes to subscribe to
The Registry site name is the WFO identifier of the target registry.
The registry description is an arbitrary description of that registry
The registry base URL is the base URL of the registry of the form http://HOST_NAME:8082
The reciprocate field instructs the target registry to subscribe to this registry.
registries that this registry wishes to subscribe to. Each entry is a data delivery ID.
The data delivery ID is generally the same as the WFO or regional headquarters such as
OAX, DMX, BCQ, etc.
-->
<NotificationServers>
<!-- Default configuration for the NCF does not define any servers -->
<!-- These are defined at the site level -->
<!-- <registry>-->
<!-- <registrySiteName>SITE_NAME</registrySiteName>-->
<!-- <registryDescription>Description of registry</registryDescription>-->
<!-- <registryBaseURL>BASE_URL</registryBaseURL>-->
<!-- <reciprocate>false</reciprocate> -->
<!-- </registry>-->
<!-- <registry>DataDelivery ID 1</registry> -->
<!-- <registry>DataDelivery ID 2</registry> -->
</NotificationServers>

View file

@ -5,6 +5,10 @@
<bean factory-bean="eventBus" factory-method="register">
<constructor-arg ref="RegistrySubscriptionManager" />
</bean>
<bean factory-bean="eventBus" factory-method="register">
<constructor-arg ref="RegistryFederationManager" />
</bean>
<bean factory-bean="eventBus" factory-method="register">
<constructor-arg ref="AuditableEventService" />

View file

@ -36,7 +36,6 @@
<bean id="RegistryGarbageCollector"
class="com.raytheon.uf.edex.registry.ebxml.services.RegistryGarbageCollector">
<constructor-arg ref="AuditableEventTypeDao" />
<constructor-arg ref="metadataTxTemplate"/>
</bean>
<bean id="objectReferenceResolver" class="com.raytheon.uf.edex.registry.ebxml.services.lifecycle.ObjectReferenceResolver">

View file

@ -1,26 +0,0 @@
<beans xmlns="http://www.springframework.org/schema/beans"
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://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<!-- This bean has the name of the processSubscriptionsFromVM endpoint (vm:processSubscriptions)
hard coded due to spring dependency issues. If the endpoint name is changed
here, it must also be changed in this class -->
<bean id="registrySubscriptionManagerInvoker"
class="com.raytheon.uf.edex.registry.ebxml.dao.EsbRouteRegistrySubscriptionManagerInvocation" />
<camelContext id="ebxml-notification" xmlns="http://camel.apache.org/schema/spring"
errorHandlerRef="errorHandler">
<endpoint id="processReplicationSubscriptions"
uri="quartz://registry/processSubscriptions/?cron=${ebxml-subscription-process.cron}" />
<route id="processSubscriptionsFromQuartz">
<from uri="processReplicationSubscriptions" />
<to uri="vm:processSubscriptions"/>
</route>
<route id="processSubscriptionsFromVM">
<from uri="vm:processSubscriptions?concurrentConsumers=2" />
<bean ref="RegistrySubscriptionManager" method="processSubscriptions" />
</route>
</camelContext>
</beans>

View file

@ -1,7 +1,7 @@
# The period which registry subscriptions are processed
ebxml-subscription-process.cron=0/20+*+*+*+*+?
# The period which registry replication occurs
ebxml-replication-process.cron=0/10+*+*+*+*+?
# The period which the registry runs the garbage collection
ebxml-garbage-collect-process.cron=0+0/5+*+*+*+?
ebxml-garbage-collect-process.cron=0+0+0/1+*+*+?
# When a federation synchonization is necessary, this is the number of threads
# that will be used for synchronization
ebxml-federation-sync-threads=3

View file

@ -24,6 +24,9 @@ import java.util.List;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
/**
@ -38,6 +41,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
* 7/30/2012 724 bphillip Initial creation
* 3/18/2013 1802 bphillip Modified to use transaction boundaries and spring injection
* 4/9/2013 1802 bphillip Removed exception catching
* 2/13/2014 2769 bphillip Added read only flags to query methods
*
* </pre>
*
@ -57,6 +61,7 @@ public class AssociationDao extends RegistryObjectTypeDao<AssociationType> {
* @throws EbxmlRegistryException
* If errors occur during interaction with the database
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<AssociationType> getByTargetAndType(String target, String type) {
return executeHQLQuery("from AssociationType obj where obj.targetObject='"
+ target + "' and obj.type='" + type + "'");
@ -73,6 +78,7 @@ public class AssociationDao extends RegistryObjectTypeDao<AssociationType> {
* @throws EbxmlRegistryException
* If errors occur during interaction with the database
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<AssociationType> getBySourceAndType(String source, String type) {
return executeHQLQuery("from AssociationType obj where obj.sourceObject='"
+ source + "' and obj.type='" + type + "'");
@ -91,6 +97,7 @@ public class AssociationDao extends RegistryObjectTypeDao<AssociationType> {
* @throws EbxmlRegistryException
* If errors occur during interaction with the database
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<AssociationType> getBySourceTargetAndType(String source,
String target, String type) {
return executeHQLQuery("from AssociationType obj where obj.sourceObject='"
@ -109,6 +116,7 @@ public class AssociationDao extends RegistryObjectTypeDao<AssociationType> {
* @throws EbxmlRegistryException
* If errors occur during interaction with the database
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<AssociationType> getAllAssociations(String objReferenced) {
return executeHQLQuery("from AssociationType obj where obj.sourceObject='"
+ objReferenced
@ -126,6 +134,7 @@ public class AssociationDao extends RegistryObjectTypeDao<AssociationType> {
* @throws EbxmlRegistryException
* If errors occur during interaction with the database
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<AssociationType> getAssociationsTo(String objReferenced) {
return executeHQLQuery("from AssociationType obj where obj.targetObject='"
+ objReferenced + "'");
@ -140,6 +149,7 @@ public class AssociationDao extends RegistryObjectTypeDao<AssociationType> {
* @throws EbxmlRegistryException
* If errors occur during interaction with the database
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<AssociationType> getAssociationsFrom(String objReferenced) {
return executeHQLQuery("from AssociationType obj where obj.sourceObject='"
+ objReferenced + "'");

View file

@ -107,7 +107,7 @@ public class AuditableEventTypeDao extends
private static final String ORDER_CLAUSE = " order by event.timestamp asc";
/** The number of hours to retain auditable events */
private static final int AUDITABLE_EVENT_RETENTION_TIME = 48;
public static final int AUDITABLE_EVENT_RETENTION_TIME = 48;
/** Cutoff parameter for the query to get the expired events */
private static final String GET_EXPIRED_EVENTS_QUERY_CUTOFF_PARAMETER = "cutoff";
@ -146,7 +146,7 @@ public class AuditableEventTypeDao extends
* @throws EbxmlRegistryException
* If errors occur purging auditable events
*/
@Transactional(propagation = Propagation.REQUIRED)
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public List<AuditableEventType> getExpiredEvents(int limit)
throws EbxmlRegistryException {
Calendar cutoffTime = TimeUtil.newGmtCalendar();
@ -174,6 +174,7 @@ public class AuditableEventTypeDao extends
* @throws EbxmlRegistryException
* @throws MsgRegistryException
*/
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public List<AuditableEventType> getEventsOfInterest(
SubscriptionType subscription, String serviceAddress,
XMLGregorianCalendar startTime, XMLGregorianCalendar endTime,
@ -336,6 +337,7 @@ public class AuditableEventTypeDao extends
* The delivery address to check
* @return The last sent date in millis
*/
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public Long getSendTime(AuditableEventType auditableEvent,
String subscriptionId, String deliveryAddress) {
SlotType slot = auditableEvent.getSlotByName(subscriptionId

View file

@ -23,6 +23,9 @@ import java.util.List;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationNodeType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
/**
* Data access object for retrieving ClassificationNodeTypes
*
@ -36,6 +39,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationNodeType;
* 8/3/2012 724 bphillip Added more methods for getting classification nodes
* 3/18/2013 1802 bphillip Modified to use transaction boundaries and spring injection
* 4/9/2013 1802 bphillip Removed exception catching
* 2/13/2014 2769 bphillip Added read only flags to query methods
*
* </pre>
*
@ -45,19 +49,23 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationNodeType;
public class ClassificationNodeDao extends
RegistryObjectTypeDao<ClassificationNodeType> {
/** Regex to use when querying for telephone types */
public static final String TELEPHONE_TYPE_REGEX = "urn:oasis:names:tc:ebxml-regrep:PhoneType:%";
private static final String GET_BY_PATH_QUERY = "select obj from ClassificationNodeType obj where obj.path=:path";
/** Regex to use when querying for postal address types */
public static final String ADDRESS_TYPE_REGEX = "urn:oasis:names:tc:ebxml-regrep:PostalAddressType%";
private static final String GET_NODE_FROM_CODE_QUERY = "select obj.id from ClassificationNodeType obj where obj.code=:code";
/** Regex to use when querying for email types */
public static final String EMAIL_TYPE_REGEX = "urn:oasis:names:tc:ebxml-regrep:EmailType:%";
private static final String GET_CODE_FROM_NODE_QUERY = "select obj.code from ClassificationNodeType obj where obj.id=:id";
private static final String GET_TELEPHONE_TYPES_QUERY = "select obj.code from ClassificationNodeType obj where obj.lid like 'urn:oasis:names:tc:ebxml-regrep:PhoneType:%'";
private static final String GET_ADDRESS_TYPES_QUERY = "select obj.code from ClassificationNodeType obj where obj.lid like 'urn:oasis:names:tc:ebxml-regrep:PostalAddressType%'";
private static final String GET_EMAIL_TYPES_QUERY = "select obj.code from ClassificationNodeType obj where obj.lid like 'urn:oasis:names:tc:ebxml-regrep:EmailType:%'";
public ClassificationNodeDao() {
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public boolean isValidNode(String id) {
return getById(id) != null;
}
@ -69,10 +77,10 @@ public class ClassificationNodeDao extends
* The path to get the classification node type for
* @return The ClassificationNode object with the specified path
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public ClassificationNodeType getByPath(String path) {
List<ClassificationNodeType> result = this
.executeHQLQuery("select obj from ClassificationNodeType obj where obj.path='"
+ path + "'");
List<ClassificationNodeType> result = this.executeHQLQuery(
GET_BY_PATH_QUERY, "path", path);
if (result.isEmpty()) {
return null;
} else {
@ -87,10 +95,10 @@ public class ClassificationNodeDao extends
* The code of the classification node
* @return The ID of the classification node with the given code
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public String getNodeFromCode(String code) {
List<String> results = this
.executeHQLQuery("select obj.id from ClassificationNodeType obj where obj.code='"
+ code + "'");
List<String> results = this.executeHQLQuery(GET_NODE_FROM_CODE_QUERY,
"code", code);
if (results.isEmpty()) {
return null;
@ -106,10 +114,10 @@ public class ClassificationNodeDao extends
* The object ID of the classification node
* @return The code of the classification node with the given ID
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public String getCodeFromNode(String id) {
List<String> results = this
.executeHQLQuery("select obj.code from ClassificationNodeType obj where obj.id='"
+ id + "'");
List<String> results = this.executeHQLQuery(GET_CODE_FROM_NODE_QUERY,
"id", id);
if (results.isEmpty()) {
return null;
@ -123,11 +131,10 @@ public class ClassificationNodeDao extends
*
* @return The codes of the telephone types in the registry
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<String> getTelephoneTypes() {
return this
.executeHQLQuery("select obj.code from ClassificationNodeType obj where obj.lid like '"
+ TELEPHONE_TYPE_REGEX + "'");
return this.executeHQLQuery(GET_TELEPHONE_TYPES_QUERY);
}
@ -136,11 +143,10 @@ public class ClassificationNodeDao extends
*
* @return The codes of the address types in the registry
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<String> getAddressTypes() {
return this
.executeHQLQuery("select obj.code from ClassificationNodeType obj where obj.lid like '"
+ ADDRESS_TYPE_REGEX + "'");
return this.executeHQLQuery(GET_ADDRESS_TYPES_QUERY);
}
@ -149,10 +155,9 @@ public class ClassificationNodeDao extends
*
* @return The codes dmail types in the registry
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<String> getEmailTypes() {
return this
.executeHQLQuery("select obj.code from ClassificationNodeType obj where obj.lid like '"
+ EMAIL_TYPE_REGEX + "'");
return this.executeHQLQuery(GET_EMAIL_TYPES_QUERY);
}
@Override

View file

@ -21,6 +21,9 @@ package com.raytheon.uf.edex.registry.ebxml.dao;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.FederationType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
/**
* Data access object for FederationType objects
*
@ -32,6 +35,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.FederationType;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 5/21/2013 2022 bphillip Initial implementation
* 2/13/2014 2769 bphillip Added read only flags to query methods
* </pre>
*
* @author bphillip
@ -46,10 +50,12 @@ public class FederationDao extends RegistryObjectTypeDao<FederationType> {
return FederationType.class;
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public long getFederationCount() {
return (Long) this.executeHQLQuery(COUNT_QUERY).get(0);
}
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public boolean federationsExist() {
return getFederationCount() > 0;
}

View file

@ -27,6 +27,8 @@ import java.util.List;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.IdentifiableType;
import org.hibernate.criterion.Property;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
@ -44,6 +46,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
* 4/9/2013 1802 bphillip Removed exception catching
* 10/08/2013 1682 bphillip Added the id like query
* 12/2/2013 1829 bphillip Now extends ExtensibleObjectTypeDao
* 2/13/2014 2769 bphillip Added read only flags to query methods
*
* </pre>
*
@ -68,6 +71,7 @@ public class IdentifiableTypeDao<ENTITY extends IdentifiableType> extends
* @throws EbxmlRegistryException
* If the query encounters errors
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getById(String... ids) throws EbxmlRegistryException {
return getById(Arrays.asList(ids));
}
@ -84,6 +88,7 @@ public class IdentifiableTypeDao<ENTITY extends IdentifiableType> extends
* If the query encounters errors
*/
@SuppressWarnings("unchecked")
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getById(List<String> ids) throws EbxmlRegistryException {
return createCriteria()
.add(Property.forName(QueryConstants.ID).in(ids)).list();
@ -97,6 +102,7 @@ public class IdentifiableTypeDao<ENTITY extends IdentifiableType> extends
* @return All IdentifiableType objects matching the given id
*/
@SuppressWarnings("unchecked")
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getByIdUsingLike(String id) {
return createCriteria().add(
Property.forName(QueryConstants.ID).like(id)).list();

View file

@ -25,6 +25,9 @@ import java.util.List;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.OrganizationType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.constants.AssociationTypes;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
@ -40,6 +43,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
* 7/30/2012 724 bphillip Initial creation
* 3/13/2013 1082 bphillip Modified to use spring injection and transaction boundaries
* 4/9/2013 1802 bphillip Removed exception catching
* 2/13/2014 2769 bphillip Added read only flags to query methods
*
* </pre>
*
@ -48,6 +52,8 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
*/
public class OrganizationDao extends RegistryObjectTypeDao<OrganizationType> {
private static final String GET_ORGANIZATION_BY_NAME_QUERY = "select obj from OrganizationType obj inner join obj.name.localizedString as theName where lower(obj.id) like :name1 or lower(theName.value) like :name2 order by obj.id asc";
/** The Association data access object */
private AssociationDao associationDao;
@ -65,6 +71,7 @@ public class OrganizationDao extends RegistryObjectTypeDao<OrganizationType> {
* @throws EbxmlRegistryException
* If errors occur during interaction with the database
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<OrganizationType> getAllOrganizations() {
return getAll();
}
@ -79,11 +86,12 @@ public class OrganizationDao extends RegistryObjectTypeDao<OrganizationType> {
* @throws EbxmlRegistryException
* If errors occur during interaction with the database
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<OrganizationType> getOrganizationByName(String name) {
List<OrganizationType> orgs = executeHQLQuery("select obj from OrganizationType obj inner join obj.name.localizedString as theName where lower(obj.id) like '%"
+ name.toLowerCase()
+ "%' or lower(theName.value) like '%"
+ name.toLowerCase() + "%' order by obj.id asc");
List<OrganizationType> orgs = executeHQLQuery(
GET_ORGANIZATION_BY_NAME_QUERY, "name1",
"%" + name.toLowerCase() + "%", "name2",
"%" + name.toLowerCase() + "%");
return orgs;
}
@ -96,6 +104,7 @@ public class OrganizationDao extends RegistryObjectTypeDao<OrganizationType> {
* @throws EbxmlRegistryException
* If errors occur during interaction with the database
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public OrganizationType getOrganizationForUser(String user)
throws EbxmlRegistryException {
List<AssociationType> associations = associationDao.getBySourceAndType(

View file

@ -26,6 +26,9 @@ import java.util.List;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.PersonType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.constants.AssociationTypes;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
@ -41,6 +44,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
* 7/30/2012 724 bphillip Initial creation
* 3/13/2013 1082 bphillip Modified to use spring injection and transaction boundaries
* 4/9/2013 1802 bphillip Removed exception catching
* 2/13/2014 2769 bphillip Added read only flags to query methods
*
* </pre>
*
@ -49,6 +53,15 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
*/
public class PersonDao extends RegistryObjectTypeDao<PersonType> {
private static final String GET_BY_FIRST_NAME_QUERY = "select obj from PersonType obj where lower(obj.personName.firstName) like :firstName order by obj.personName.lastName asc, obj.personName.firstName asc";
private static final String GET_BY_LAST_NAME_QUERY = "select obj from PersonType obj where lower(obj.personName.lastName) like :lastName order by obj.personName.lastName asc, obj.personName.firstName asc";
private static final String GET_BY_FIRST_AND_LAST_NAME_QUERY = "select obj from PersonType obj where lower(obj.personName.firstName) like :firstname and lower(obj.personName.lastName) like :lastName order by obj.personName.lastName asc, obj.personName.firstName asc";
private static final String GET_ALL_USER_NAMES_QUERY = "select obj.id, obj.personName.firstName, obj.personName.lastName from PersonType obj "
+ "order by obj.personName.lastName asc, obj.personName.firstName asc";
private AssociationDao associationDao;
/**
@ -65,14 +78,13 @@ public class PersonDao extends RegistryObjectTypeDao<PersonType> {
* The first name
* @return The matching users
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<PersonType> getByFirstName(String firstName) {
if (firstName == null || firstName.trim().isEmpty()) {
return Collections.emptyList();
}
return this
.executeHQLQuery("select obj from PersonType obj where lower(obj.personName.firstName) like '%"
+ firstName.toLowerCase()
+ "%' order by obj.personName.lastName asc, obj.personName.firstName asc");
return this.executeHQLQuery(GET_BY_FIRST_NAME_QUERY, ":firstName", "%"
+ firstName.toLowerCase() + "%");
}
@ -84,14 +96,13 @@ public class PersonDao extends RegistryObjectTypeDao<PersonType> {
* The last name
* @return The matching users
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<PersonType> getByLastName(String lastName) {
if (lastName == null || lastName.trim().isEmpty()) {
return Collections.emptyList();
}
return this
.executeHQLQuery("select obj from PersonType obj where lower(obj.personName.lastName) like '%"
+ lastName.toLowerCase()
+ "%' order by obj.personName.lastName asc, obj.personName.firstName asc");
return this.executeHQLQuery(GET_BY_LAST_NAME_QUERY, "lastName", "%"
+ lastName.toLowerCase() + "%");
}
@ -105,6 +116,7 @@ public class PersonDao extends RegistryObjectTypeDao<PersonType> {
* The last name
* @return The matching users
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<PersonType> getByFirstAndLastName(String firstName,
String lastName) {
if (firstName.trim().isEmpty() && lastName.trim().isEmpty()) {
@ -115,12 +127,9 @@ public class PersonDao extends RegistryObjectTypeDao<PersonType> {
} else if (lastName == null || lastName.trim().isEmpty()) {
return getByFirstName(firstName);
}
return this
.executeHQLQuery("select obj from PersonType obj where lower(obj.personName.firstName) like '%"
+ firstName.toLowerCase()
+ "%' and lower(obj.personName.lastName) like '%"
+ lastName.toLowerCase()
+ "%' order by obj.personName.lastName asc, obj.personName.firstName asc");
return this.executeHQLQuery(GET_BY_FIRST_AND_LAST_NAME_QUERY,
"firstName", "%" + firstName.toLowerCase() + "%", "lastName",
"%" + lastName.toLowerCase() + "%");
}
@ -131,6 +140,7 @@ public class PersonDao extends RegistryObjectTypeDao<PersonType> {
* The organization ID
* @return The users associated with the organization
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<PersonType> getEmployeesOfOrganization(String orgId) {
List<PersonType> employees = new ArrayList<PersonType>();
List<AssociationType> associations = associationDao.getByTargetAndType(
@ -149,10 +159,9 @@ public class PersonDao extends RegistryObjectTypeDao<PersonType> {
* the id, first name, and last name for each PersonType object in
* the registry
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public Object getAllUserNames() throws EbxmlRegistryException {
return this
.executeHQLQuery("select obj.id, obj.personName.firstName, obj.personName.lastName from PersonType obj "
+ "order by obj.personName.lastName asc, obj.personName.firstName asc");
return this.executeHQLQuery(GET_ALL_USER_NAMES_QUERY);
}
@ -161,6 +170,7 @@ public class PersonDao extends RegistryObjectTypeDao<PersonType> {
*
* @return All personType objects in the registry
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<PersonType> getAllUsers() throws EbxmlRegistryException {
return getByFirstAndLastName("", "");
}
@ -172,6 +182,7 @@ public class PersonDao extends RegistryObjectTypeDao<PersonType> {
* The ID of the person
* @return The person with the given ID
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public PersonType getByUserId(String userId) {
return this.getById(userId);
}

View file

@ -24,6 +24,9 @@ import java.util.List;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ParameterType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryDefinitionType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
/**
*
* Data access object for QueryDefinitionType objects
@ -36,6 +39,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryDefinitionType;
* ------------ ---------- ----------- --------------------------
* 10/8/2013 1682 bphillip Initial implementation
* 12/2/2013 1829 bphillip Changed get parameters for query method
* 2/13/2014 2769 bphillip Added read only flags to query methods
* </pre>
*
* @author bphillip
@ -55,6 +59,7 @@ public class QueryDefinitionDao extends
*
* @return The ids of the query definitions in the registry
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<String> getQueryIds() {
return executeHQLQuery(GET_QUERY_IDS_QUERY);
}
@ -66,6 +71,7 @@ public class QueryDefinitionDao extends
* The query id to get the parameters for
* @return The parameters for the specified query
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ParameterType> getParametersForQuery(String queryId) {
return this.getById(queryId).getParameter();
}

View file

@ -21,6 +21,9 @@ package com.raytheon.uf.edex.registry.ebxml.dao;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
/**
*
* Data access object for RegistryType objects
@ -41,6 +44,7 @@ public class RegistryDao extends RegistryObjectTypeDao<RegistryType> {
private static final String QUERY_BY_BASE_URL = "FROM RegistryType reg where reg.baseURL=:baseURL";
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public RegistryType getRegistryByBaseURL(String baseURL) {
return this.uniqueResult(QUERY_BY_BASE_URL, "baseURL", baseURL);
}

View file

@ -24,6 +24,9 @@ import java.util.List;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.edex.database.DataAccessLayerException;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
@ -41,6 +44,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
* 6/4/2013 2022 bphillip Added delete objects of type method
* 7/29/2013 2191 bphillip Added new methods to support registry synchronization
* 8/1/2013 1693 bphillip Added methods to facilitate implementation of the lifecyclemanager according to the 4.0 spec
* 2/13/2014 2769 bphillip Added read only flags to query methods
*
* </pre>
*
@ -96,6 +100,7 @@ public class RegistryObjectDao extends
* The object to get the next version number for
* @return The next version number
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public String getNextVersion(RegistryObjectType objectToVersion) {
String lid = objectToVersion.getLid();
String version = objectToVersion.getVersionInfo().getVersionName();
@ -126,6 +131,7 @@ public class RegistryObjectDao extends
* The id to check
* @return True if the id exists, else false
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public boolean idExists(String id) {
return ((Long) this.executeHQLQuery(ID_EXISTS_QUERY, "id", id).get(0)) != 0;
}
@ -137,6 +143,7 @@ public class RegistryObjectDao extends
* The lid to check
* @return Treu if the lid exists, else false
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public boolean lidExists(String lid) {
return ((Long) this.executeHQLQuery(LID_EXISTS_QUERY, "lid", lid)
.get(0)) != 0;
@ -149,6 +156,7 @@ public class RegistryObjectDao extends
* The object type to get the ids for
* @return The list of object ids of objects of the given type
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<String> getRegistryObjectIdsOfType(String objectType) {
return this.executeHQLQuery(GET_IDS_BY_OBJECT_TYPE, "objectType",
objectType);
@ -180,6 +188,7 @@ public class RegistryObjectDao extends
* @throws EbxmlRegistryException
* If the HQL query fails
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<RegistryObjectType> getAllRegistryObjects() {
return getAll();
}

View file

@ -27,6 +27,8 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Property;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
@ -44,6 +46,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
* 4/9/2013 1802 bphillip Removed exception catching. Added merge method.
* 8/1/2013 1693 bphillip Moved the merge method down to RegistryObjectDao
* 10/8/2013 1682 bphillip Added like lid method, changed to use criteria queries for simple operations
* 2/13/2014 2769 bphillip Added read only flags to query methods
*
* </pre>
*
@ -70,6 +73,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
* @return The list of registry objects;
*/
@SuppressWarnings("unchecked")
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getByLid(List<String> lids) {
return createCriteria().add(
Property.forName(QueryConstants.LID).in(lids)).list();
@ -84,6 +88,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
* The list of lids to query for
* @return The list of registry objects;
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getByLid(String... lids) {
return getByLid(Arrays.asList(lids));
}
@ -96,6 +101,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
* @return All IdentifiableType objects matching the given lid
*/
@SuppressWarnings("unchecked")
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getByLidUsingLike(String lid) {
return createCriteria().add(
Property.forName(QueryConstants.LID).like(lid)).list();
@ -111,6 +117,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
* @return The list of registry objects;
*/
@SuppressWarnings("unchecked")
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getByObjectType(List<String> objTypes) {
return createCriteria().add(
Property.forName(QueryConstants.OBJECT_TYPE).in(objTypes))
@ -127,6 +134,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
* @return The list of registry objects;
*/
@SuppressWarnings("unchecked")
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getByStatus(List<String> status) {
return createCriteria().add(
Property.forName(QueryConstants.STATUS).in(status)).list();
@ -142,6 +150,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
* @return The list of registry objects;
*/
@SuppressWarnings("unchecked")
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getByOwner(List<String> owner) {
return createCriteria().add(
Property.forName(QueryConstants.OWNER).in(owner)).list();
@ -156,6 +165,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
* The list of owners to query for
* @return The list of registry objects;
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getByOwner(String... owner) {
return getByOwner(Arrays.asList(owner));
}
@ -169,6 +179,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
* The list of names to query for
* @return The list of registry objects;
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getByName(List<String> names) {
StringBuilder str = new StringBuilder(
"select obj from RegistryObjectType obj inner join obj.name.localizedString as Strings where Strings.value in ");
@ -185,6 +196,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
* The list of descriptions to query for
* @return The list of registry objects;
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getByDescription(List<String> descriptions) {
StringBuilder str = new StringBuilder(
"select obj from RegistryObjectType obj inner join obj.description.localizedString as Strings where Strings.value in ");
@ -201,6 +213,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
* The list of classificationNodes to query for
* @return The list of registry objects;
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<ENTITY> getByClassification(List<String> classifications) {
StringBuilder str = new StringBuilder(
"select obj from RegistryObjectType obj inner join obj.classification as Classifications where ");
@ -236,6 +249,7 @@ public abstract class RegistryObjectTypeDao<ENTITY extends RegistryObjectType>
}
@Override
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public ENTITY getById(String id) {
return super.getById(id);
}

View file

@ -24,6 +24,9 @@ import java.util.List;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RoleType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.constants.AssociationTypes;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
@ -39,6 +42,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
* 7/30/2012 724 bphillip Initial creation
* 3/13/2013 1082 bphillip Modified to use spring injection and transaction boundaries
* 4/9/2013 1802 bphillip Removed exception catching
* 2/13/2014 2769 bphillip Added read only flags to query methods
*
* </pre>
*
@ -65,6 +69,7 @@ public class RoleDao extends RegistryObjectTypeDao<RoleType> {
* @throws EbxmlRegistryException
* If errors occur during interaction with the database
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public RoleType getUserRole(String user) throws EbxmlRegistryException {
List<AssociationType> associations = associationDao.getBySourceAndType(
user, AssociationTypes.HAS_ROLE);

View file

@ -25,6 +25,9 @@ import javax.xml.bind.JAXBException;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SubscriptionType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.serialization.JAXBManager;
import com.raytheon.uf.common.util.CollectionUtil;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
@ -40,6 +43,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
* ------------ ---------- ----------- --------------------------
* 3/13/2013 1082 bphillip Initial creation
* 9/5/2013 1538 bphillip Added eagerLoadAll method
* 2/13/2014 2769 bphillip Added read only flags to query methods
*
* </pre>
*
@ -72,6 +76,7 @@ public class SubscriptionDao extends RegistryObjectTypeDao<SubscriptionType> {
* @throws EbxmlRegistryException
* If errors occur while querying
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<SubscriptionType> eagerLoadAll() throws EbxmlRegistryException {
List<SubscriptionType> subs = this.template
.loadAll(SubscriptionType.class);
@ -103,6 +108,7 @@ public class SubscriptionDao extends RegistryObjectTypeDao<SubscriptionType> {
* If errors occur while eagerly fetching all attributes using
* jaxb
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public SubscriptionType eagerGetById(String subscriptionId)
throws EbxmlRegistryException {
List<SubscriptionType> result = this.query(EAGER_LOAD_QUERY, "id",

View file

@ -20,21 +20,15 @@
package com.raytheon.uf.edex.registry.ebxml.services;
import java.util.List;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AuditableEventType;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionTemplate;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.edex.database.RunnableWithTransaction;
import com.raytheon.uf.edex.registry.ebxml.dao.AuditableEventTypeDao;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
@ -54,6 +48,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
* 7/29/2013 2191 bphillip Added executors to remove orphaned slots and expired events
* 1/15/2014 2613 bphillip Added Hibernate flush() call
* 2/4/2014 2769 bphillip Removed flush and clear call
* 2/13/2014 2769 bphillip Refactored to no longer use executor threads
* </pre>
*
* @author bphillip
@ -70,23 +65,16 @@ public class RegistryGarbageCollector {
/** Sentinel to denote if the garbage collection is currently running */
private AtomicBoolean running = new AtomicBoolean(false);
/** The executor service to remove expired events */
private ThreadPoolExecutor expiredEventExecutor;
/** The transaction template to use for asynchronous tasks */
private TransactionTemplate txTemplate;
/** Data access object for AuditableEventType */
private AuditableEventTypeDao eventDao;
private static final int QUEUE_MAX_SIZE = 500;
/** The number of events to delete per batch */
private static final int DELETE_BATCH_SIZE = 100;
/**
* Creates a new GarbageCollector object
*/
public RegistryGarbageCollector() {
expiredEventExecutor = new ThreadPoolExecutor(1, 3, 1L,
TimeUnit.MINUTES, new LinkedBlockingQueue<Runnable>(250));
}
/**
@ -97,11 +85,9 @@ public class RegistryGarbageCollector {
* @param eventDao
* The auditable event dao to use
*/
public RegistryGarbageCollector(AuditableEventTypeDao eventDao,
TransactionTemplate txTemplate) {
public RegistryGarbageCollector(AuditableEventTypeDao eventDao) {
this();
this.eventDao = eventDao;
this.txTemplate = txTemplate;
}
@ -129,41 +115,15 @@ public class RegistryGarbageCollector {
* If errors occur while enqueuing events to be deleted
*/
private void purgeExpiredEvents() throws EbxmlRegistryException {
int limit = expiredEventExecutor.getQueue().remainingCapacity();
if (limit > QUEUE_MAX_SIZE * .25) {
List<AuditableEventType> expiredEvents = eventDao
.getExpiredEvents(limit);
for (AuditableEventType event : expiredEvents) {
try {
expiredEventExecutor.submit(new RemoveExpiredEvent(
txTemplate, event));
} catch (RejectedExecutionException e) {
// Could not add more to the queue since it is full
}
List<AuditableEventType> expiredEvents = null;
do {
expiredEvents = eventDao.getExpiredEvents(DELETE_BATCH_SIZE);
if (!expiredEvents.isEmpty()) {
statusHandler.info("Deleting " + expiredEvents.size()
+ " expired Auditable Events");
eventDao.deleteAll(expiredEvents);
}
}
}
/**
* Task to remove expired auditable eventss
*
* @author bphillip
*
*/
private class RemoveExpiredEvent extends RunnableWithTransaction {
/** The event to be removed */
private AuditableEventType event;
public RemoveExpiredEvent(TransactionTemplate txTemplate,
AuditableEventType event) {
super(txTemplate);
this.event = event;
}
@Override
public void runWithTransaction() {
eventDao.delete(event);
}
} while (!expiredEvents.isEmpty());
}
}

View file

@ -33,6 +33,7 @@ import org.apache.cxf.transport.http.AbstractHTTPDestination;
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.util.CollectionUtil;
/**
@ -46,6 +47,7 @@ import com.raytheon.uf.common.util.CollectionUtil;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 9/5/2013 1538 bphillip Initial implementation
* 2/27/2014 2769 bphillip Changed verbose output to debug level
* </pre>
*
* @author bphillip
@ -64,28 +66,31 @@ public class RegistryServiceInInterceptor extends
@SuppressWarnings("unchecked")
@Override
public void handleMessage(Message message) throws Fault {
StringBuilder logMessage = new StringBuilder();
HttpServletRequest request = (HttpServletRequest) message
.get(AbstractHTTPDestination.HTTP_REQUEST);
Map<String, List<String>> headers = (Map<String, List<String>>) message
.get(Message.PROTOCOL_HEADERS);
List<String> callingRegistryList = headers
.get(RegistryUtil.CALLING_REGISTRY_SOAP_HEADER_NAME);
if (request.getRequestURI().startsWith("/rest")) {
logMessage.append("REST: ");
} else {
logMessage.append("WS: ");
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
StringBuilder logMessage = new StringBuilder();
HttpServletRequest request = (HttpServletRequest) message
.get(AbstractHTTPDestination.HTTP_REQUEST);
Map<String, List<String>> headers = (Map<String, List<String>>) message
.get(Message.PROTOCOL_HEADERS);
List<String> callingRegistryList = headers
.get(RegistryUtil.CALLING_REGISTRY_SOAP_HEADER_NAME);
if (request.getRequestURI().startsWith("/rest")) {
logMessage.append("REST: ");
} else {
logMessage.append("WS: ");
}
logMessage.append("Request from [");
if (CollectionUtil.isNullOrEmpty(callingRegistryList)) {
logMessage.append(request.getRemoteAddr()).append("]: ")
.append(request.getMethod()).append(" ")
.append(request.getRequestURI());
} else {
logMessage.append(callingRegistryList.get(0)).append("]: ")
.append(request.getMethod()).append(" ")
.append(request.getRequestURI());
}
statusHandler.debug(logMessage.toString());
}
logMessage.append("Request from [");
if (CollectionUtil.isNullOrEmpty(callingRegistryList)) {
logMessage.append(request.getRemoteAddr()).append("]: ")
.append(request.getMethod()).append(" ")
.append(request.getRequestURI());
} else {
logMessage.append(callingRegistryList.get(0)).append("]: ")
.append(request.getMethod()).append(" ")
.append(request.getRequestURI());
}
statusHandler.info(logMessage.toString());
}
}

View file

@ -108,6 +108,7 @@ import com.raytheon.uf.edex.registry.events.CreateAuditTrailEvent;
* Separate update from create notifications.
* 12/2/2013 1829 bphillip Auditable events are not genereted via messages on the event bus
* 01/21/2014 2613 bphillip Removed verbose log message from removeObjects
* 2/19/2014 2769 bphillip Added current time to audit trail events
*
*
* </pre>
@ -302,7 +303,8 @@ public class LifecycleManagerImpl implements LifecycleManager {
}
EventBus.publish(new CreateAuditTrailEvent(request.getId(), request,
ActionTypes.delete, objectsToRemove));
ActionTypes.delete, objectsToRemove, TimeUtil
.currentTimeMillis()));
return response;
}
@ -463,6 +465,7 @@ public class LifecycleManagerImpl implements LifecycleManager {
// gives a close estimate to amount taken on each object
// individually, this will be millis in most cases, hopefully
long avTimePerRecord = objs.isEmpty() ? 0 : totalTime / objs.size();
long currentTime = TimeUtil.currentTimeMillis();
if (!objsCreated.isEmpty()) {
for (RegistryObjectType obj : objsCreated) {
EventBus.publish(new InsertRegistryEvent(obj.getId(), obj
@ -472,7 +475,7 @@ public class LifecycleManagerImpl implements LifecycleManager {
avTimePerRecord));
}
EventBus.publish(new CreateAuditTrailEvent(request.getId(),
request, ActionTypes.create, objsCreated));
request, ActionTypes.create, objsCreated, currentTime));
}
if (!objsUpdated.isEmpty()) {
for (RegistryObjectType obj : objsUpdated) {
@ -483,7 +486,7 @@ public class LifecycleManagerImpl implements LifecycleManager {
avTimePerRecord));
}
EventBus.publish(new CreateAuditTrailEvent(request.getId(),
request, ActionTypes.update, objsUpdated));
request, ActionTypes.update, objsUpdated, currentTime));
}
return response;
@ -738,7 +741,8 @@ public class LifecycleManagerImpl implements LifecycleManager {
}
if (!objectsToUpdate.isEmpty()) {
EventBus.publish(new CreateAuditTrailEvent(request.getId(),
request, ActionTypes.update, objectsToUpdate));
request, ActionTypes.update, objectsToUpdate, TimeUtil
.currentTimeMillis()));
}
long totalTime = System.currentTimeMillis() - startTime;

View file

@ -20,6 +20,7 @@
package com.raytheon.uf.edex.registry.ebxml.services.notification;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
@ -35,6 +36,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectRefType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SubscriptionType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.dataplugin.persist.IPersistableDataObject;
@ -75,6 +77,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
* AuditableEvents instead of integer
* 12/9/2013 2613 bphillip Changed start time boundary of get auditable events to be the last run time of the subscription
* 01/21/2014 2613 bphillip Changed start time boundary again and also a few minor cleanup items
* 2/13/2014 2769 bphillip Optimized sendNotifications method
* </pre>
*
* @author bphillip
@ -117,13 +120,14 @@ public class RegistryNotificationManager {
public List<ObjectRefType> getObjectsOfInterest(
SubscriptionType subscription) throws MsgRegistryException {
// Get objects that match selector query
return queryManager
.executeQuery(
new QueryRequest("Objects of Interest Query for ["
+ subscription.getId() + "]", subscription
.getSelector(), new ResponseOptionType(
QueryReturnTypes.OBJECT_REF, false)))
.getObjectRefList().getObjectRef();
QueryRequest queryRequest = new QueryRequest(
"Objects of Interest Query for [" + subscription.getId() + "]",
subscription.getSelector(), new ResponseOptionType(
QueryReturnTypes.OBJECT_REF, false));
queryRequest.setMaxResults(new BigInteger(System
.getProperty("ebxml-notification-batch-size")));
return queryManager.executeQuery(queryRequest).getObjectRefList()
.getObjectRef();
}
/**
@ -140,6 +144,7 @@ public class RegistryNotificationManager {
* @throws MsgRegistryException
* @throws EbxmlRegistryException
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public List<AuditableEventType> getEventsOfInterest(
SubscriptionType subscription, String serviceAddress,
XMLGregorianCalendar startTime, XMLGregorianCalendar endTime,
@ -164,6 +169,7 @@ public class RegistryNotificationManager {
* @throws EbxmlRegistryException
* If errors occur while creating or checking the notification
*/
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public NotificationType getNotification(SubscriptionType subscription,
String address, List<ObjectRefType> objectsOfInterest,
List<AuditableEventType> eventsOfInterest)
@ -226,53 +232,35 @@ public class RegistryNotificationManager {
* If errors occur while sending the notifications
* @throws MsgRegistryException
*/
protected XMLGregorianCalendar sendNotifications(
protected void sendNotifications(
SubscriptionNotificationListeners notificationListeners,
XMLGregorianCalendar startTime) throws EbxmlRegistryException,
MsgRegistryException {
XMLGregorianCalendar startTime, XMLGregorianCalendar endTime)
throws EbxmlRegistryException, MsgRegistryException {
// Object to hold the last timestampe of the latest event in order to
// update the subscription last run time correctly
XMLGregorianCalendar lastTime = null;
final List<NotificationListenerWrapper> listeners = notificationListeners.listeners;
final SubscriptionType subscription = notificationListeners.subscription;
List<ObjectRefType> objectsOfInterest = getObjectsOfInterest(subscription);
for (NotificationListenerWrapper listener : listeners) {
List<AuditableEventType> eventsOfInterest = getEventsOfInterest(
subscription, listener.address, startTime,
subscription.getEndTime(), objectsOfInterest);
if (!eventsOfInterest.isEmpty()) {
lastTime = eventsOfInterest.get(eventsOfInterest.size() - 1)
.getTimestamp();
int subListCount = eventsOfInterest.size()
/ notificationBatchSize;
int lastListSize = eventsOfInterest.size()
% notificationBatchSize;
try {
for (int i = 0; i < subListCount; i++) {
NotificationType notification = getNotification(
subscription,
listener.address,
objectsOfInterest,
eventsOfInterest.subList(notificationBatchSize
* i, notificationBatchSize * i
+ notificationBatchSize));
if (!notification.getEvent().isEmpty()) {
sendNotification(listener, notification,
listener.address);
List<AuditableEventType> eventsOfInterest = getEventsOfInterest(
subscription, listener.address, startTime, endTime,
objectsOfInterest);
if (!eventsOfInterest.isEmpty()) {
try {
int totalEvents = eventsOfInterest.size();
int endIndex = 0;
for (int startIndex = 0; startIndex < totalEvents; startIndex += notificationBatchSize) {
endIndex = startIndex + notificationBatchSize;
if (endIndex >= totalEvents) {
endIndex = totalEvents;
}
}
if (lastListSize > 0) {
NotificationType notification = getNotification(
subscription,
listener.address,
subscription, listener.address,
objectsOfInterest,
eventsOfInterest.subList(notificationBatchSize
* subListCount, notificationBatchSize
* subListCount + lastListSize));
eventsOfInterest.subList(startIndex, endIndex));
if (!notification.getEvent().isEmpty()) {
sendNotification(listener, notification,
listener.address);
@ -284,7 +272,6 @@ public class RegistryNotificationManager {
}
}
return lastTime;
}
/**

View file

@ -20,10 +20,7 @@
package com.raytheon.uf.edex.registry.ebxml.services.notification;
import java.util.Calendar;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.xml.datatype.Duration;
@ -43,17 +40,12 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.google.common.collect.Lists;
import com.google.common.eventbus.Subscribe;
import com.raytheon.uf.common.registry.constants.RegistryObjectTypes;
import com.raytheon.uf.common.registry.event.InsertRegistryEvent;
import com.raytheon.uf.common.registry.event.RemoveRegistryEvent;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.common.time.util.TimeUtil;
import com.raytheon.uf.edex.registry.ebxml.dao.DbInit;
import com.raytheon.uf.edex.registry.ebxml.dao.SubscriptionDao;
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
import com.raytheon.uf.edex.registry.ebxml.init.RegistryInitializedListener;
import com.raytheon.uf.edex.registry.ebxml.services.IRegistrySubscriptionManager;
import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
@ -83,16 +75,15 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
* 1/15/2014 2613 bphillip Added Hibernate flush and clear after subscription processing
* 01/21/2014 2613 bphillip Changed how last run time is updated for replication subscriptions
* 2/4/2014 2769 bphillip Removed flush and clear call
* 2/13/2014 2769 bphillip Removed caching of subscriptions
* </pre>
*
* @author bphillip
* @version 1
*/
@Transactional
@Component
public class RegistrySubscriptionManager implements
IRegistrySubscriptionManager, ApplicationContextAware,
RegistryInitializedListener {
IRegistrySubscriptionManager, ApplicationContextAware {
/** The logger instance */
private static final IUFStatusHandler statusHandler = UFStatus
@ -153,63 +144,12 @@ public class RegistrySubscriptionManager implements
private INotificationListenerFactory notificationListenerFactory;
private final ConcurrentMap<String, SubscriptionNotificationListeners> listeners = new ConcurrentHashMap<String, SubscriptionNotificationListeners>();
private ApplicationContext applicationContext;
public RegistrySubscriptionManager() {
}
@Override
public void executeAfterRegistryInit() throws EbxmlRegistryException {
for (SubscriptionType subscription : subscriptionDao.eagerLoadAll()) {
statusHandler.info("Adding Subscription: " + subscription.getId());
addSubscriptionListener(subscription);
}
}
private void addSubscriptionListener(SubscriptionType subscription)
throws EbxmlRegistryException {
final List<NotificationListenerWrapper> subscriptionListeners = getNotificationListenersForSubscription(subscription);
listeners.put(subscription.getId(),
new SubscriptionNotificationListeners(subscription,
subscriptionListeners));
}
/**
* Adds subscription notification listeners for any subscriptions.
*/
@Subscribe
public void addSubscriptionNotificationListeners(InsertRegistryEvent re) {
final String objectType = re.getObjectType();
if (RegistryObjectTypes.SUBSCRIPTION.equals(objectType)) {
final String id = re.getId();
try {
final SubscriptionType subscription = subscriptionDao
.eagerGetById(id);
addSubscriptionListener(subscription);
} catch (EbxmlRegistryException e) {
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
e);
}
}
}
/**
* Removes subscription notification listeners for any subscriptions.
*/
@Subscribe
public void removeSubscriptionNotificationListeners(RemoveRegistryEvent re) {
final String objectType = re.getObjectType();
if (RegistryObjectTypes.SUBSCRIPTION.equals(objectType)) {
listeners.remove(re.getId());
}
}
/**
* Get the notification listeners for a subscription.
*
@ -249,29 +189,22 @@ public class RegistrySubscriptionManager implements
* {@inheritDoc}
*/
@Override
@Transactional
public void processSubscriptions() {
if (!running.compareAndSet(false, true)) {
if (DbInit.isDbInitialized() && !running.compareAndSet(false, true)) {
return;
}
try {
statusHandler.info("Processing registry subscriptions...");
long start = TimeUtil.currentTimeMillis();
Collection<SubscriptionNotificationListeners> subs = listeners
.values();
List<SubscriptionType> subs = subscriptionDao.loadAll();
for (SubscriptionNotificationListeners subNotificationListener : subs) {
if (subscriptionDao
.getById(subNotificationListener.subscription.getId()) == null) {
statusHandler
.info("Registry subscription removed. Cancelling processing of subscription: "
+ subNotificationListener.subscription
.getId());
continue;
}
for (SubscriptionType subscription : subs) {
RegistrySubscriptionManager myself = (RegistrySubscriptionManager) applicationContext
.getBean("RegistrySubscriptionManager");
myself.processSubscription(subNotificationListener.subscription
.getId());
myself.processSubscription(subscription.getId());
}
if (!subs.isEmpty()) {
@ -373,14 +306,10 @@ public class RegistrySubscriptionManager implements
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void processSubscription(final String subscriptionName) {
try {
XMLGregorianCalendar currentTime = EbxmlObjectUtil
.getTimeAsXMLGregorianCalendar(TimeUtil.currentTimeMillis());
SubscriptionType subscription = subscriptionDao
.getById(subscriptionName);
if (subscription == null) {
statusHandler
.info("Registry subscription removed. Cancelling processing of subscription: "
+ subscriptionName);
return;
}
.load(subscriptionName);
if (!subscriptionShouldRun(subscription)) {
statusHandler
.info("Skipping subscription ["
@ -388,21 +317,28 @@ public class RegistrySubscriptionManager implements
+ "]. Required notification frequency interval has not elapsed.");
return;
}
statusHandler.info("Processing subscription [" + subscriptionName
+ "]...");
XMLGregorianCalendar startTime = subscription
.getSlotValue(EbxmlObjectUtil.SUBSCRIPTION_LAST_RUN_TIME_SLOT_NAME);
XMLGregorianCalendar endTime = subscription.getEndTime();
if (startTime == null) {
startTime = subscription.getStartTime();
}
XMLGregorianCalendar lastEventTime = notificationManager
.sendNotifications(listeners.get(subscriptionName),
startTime);
if (lastEventTime != null) {
updateLastRunTime(subscription, lastEventTime
.toGregorianCalendar().getTimeInMillis());
if (endTime == null) {
endTime = currentTime;
}
notificationManager
.sendNotifications(
new SubscriptionNotificationListeners(
subscription,
getNotificationListenersForSubscription(subscription)),
startTime, endTime);
updateLastRunTime(subscription, currentTime.toGregorianCalendar()
.getTimeInMillis());
} catch (Throwable e) {
statusHandler.error(
"Errors occurred while processing subscription ["

View file

@ -123,13 +123,13 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
* 10/2013 1682 bphillip Fixed federated query invocation
* 10/23/2013 1538 bphillip Remove extra executeQuery method
* 10/30/2013 1538 bphillip Changed to use non-static soap service client
* 2/19/2014 2769 bphillip Moved Transactional Annotation, fixed plugin cache usage
*
* </pre>
*
* @author bphillip
* @version 1.0
*/
@Transactional(propagation = Propagation.MANDATORY)
public class QueryManagerImpl implements QueryManager, ApplicationContextAware {
/** The logger */
@ -223,6 +223,7 @@ public class QueryManagerImpl implements QueryManager, ApplicationContextAware {
* The QueryResponse contains a set of objects that match the query.
*/
@Override
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(QueryRequest queryRequest)
throws MsgRegistryException {
String client = EbxmlObjectUtil.getClientHost(wsContext);
@ -518,7 +519,7 @@ public class QueryManagerImpl implements QueryManager, ApplicationContextAware {
String queryDefinition = query.getQueryDefinition();
RegistryQueryPlugin plugin = queryPlugins.get(queryDefinition);
if (plugin == null) {
QueryDefinitionType queryDef = queryDefinitionDao.getById(query
QueryDefinitionType queryDef = queryDefinitionDao.loadById(query
.getQueryDefinition());
if (queryDef == null) {
throw EbxmlExceptionUtil.createQueryExceptionType(
@ -551,7 +552,6 @@ public class QueryManagerImpl implements QueryManager, ApplicationContextAware {
.executeHQLQuery(queryString, queryParameters);
queryResponse.addRegistryObjects(results);
} else {
queryPlugins.put(queryDefinition, plugin);
checkQueryParameters(queryRequest.getQuery());
QueryResponse response = plugin.executeQuery(queryRequest);
consolidateQueryResponse(queryResponse, response);

View file

@ -28,6 +28,7 @@ import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.QueryManager;
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest;
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
@ -43,12 +44,13 @@ import com.raytheon.uf.common.registry.EbxmlNamespaces;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/11/2013 1707 bphillip Initial implementation
* 2/19/2014 2769 bphillip Added readOnly flag to Transactional annotation
* </pre>
*
* @author bphillip
* @version 1
*/
@Transactional
@Transactional(propagation = Propagation.REQUIRED, readOnly = true)
public class QueryManagerImplWrapper implements QueryManager {
private QueryManagerImpl queryManager;

View file

@ -30,6 +30,9 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest;
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao;
import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
@ -78,6 +81,7 @@ public class AdhocQuery extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -34,6 +34,9 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.util.CollectionUtil;
import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao;
@ -114,6 +117,7 @@ public class BasicQuery extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -36,6 +36,9 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.TaxonomyElementType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectTypeDao;
import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
@ -85,6 +88,7 @@ public class ClassificationSchemeSelector extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -33,6 +33,9 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.util.CollectionUtil;
import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao;
@ -108,6 +111,7 @@ public class FindAssociatedObjects extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -32,6 +32,9 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.util.CollectionUtil;
import com.raytheon.uf.edex.registry.ebxml.dao.AssociationDao;
@ -99,6 +102,7 @@ public class FindAssociations extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -32,6 +32,9 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao;
@ -73,6 +76,7 @@ public class GarbageCollectorQueryPlugin extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -32,6 +32,9 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest;
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.edex.registry.ebxml.dao.AuditableEventTypeDao;
import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
@ -93,6 +96,7 @@ public class GetAuditTrailById extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -39,6 +39,9 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes;
import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao;
@ -73,7 +76,6 @@ import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
* @author bphillip
* @version 1.0
*/
public class GetAuditTrailByLid extends RegistryQueryPlugin {
/** Data access object for accessing registry objects */
@ -85,6 +87,7 @@ public class GetAuditTrailByLid extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -31,6 +31,9 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest;
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes;
import com.raytheon.uf.common.status.IUFStatusHandler;
@ -98,6 +101,7 @@ public class GetAuditTrailByTimeInterval extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -36,6 +36,9 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryPackageType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.TaxonomyElementType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes;
import com.raytheon.uf.common.util.CollectionUtil;
@ -158,6 +161,7 @@ public class GetChildrenByParentId extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -30,6 +30,9 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest;
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
@ -69,6 +72,7 @@ public class GetClassificationSchemesById extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -36,6 +36,9 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectRefType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SubscriptionType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes;
import com.raytheon.uf.edex.registry.ebxml.dao.SubscriptionDao;
@ -85,6 +88,7 @@ public class GetNotification extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -19,7 +19,9 @@
**/
package com.raytheon.uf.edex.registry.ebxml.services.query.plugins;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException;
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest;
@ -56,12 +58,14 @@ import com.raytheon.uf.edex.registry.ebxml.services.query.RegistryQueryUtil;
* @author bphillip
* @version 1.0
*/
@Transactional(propagation = Propagation.REQUIRED)
public class GetObjectById extends RegistryQueryPlugin {
private RegistryObjectDao registryObjectDao;
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -30,6 +30,9 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest;
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao;
import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants;
@ -64,6 +67,7 @@ public class GetObjectsByLid extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -36,6 +36,9 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes;
import com.raytheon.uf.common.registry.constants.QueryReturnTypes;
@ -74,6 +77,7 @@ public class GetReferencedObject extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -30,6 +30,9 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest;
import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -76,6 +79,7 @@ public class GetRegistryPackagesByMemberId extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -37,6 +37,9 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
@ -204,6 +207,7 @@ public class KeywordSearch extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -34,6 +34,9 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryPackageType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.registry.constants.AssociationTypes;
import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes;
@ -78,6 +81,7 @@ public class RegistryPackageSelector extends RegistryQueryPlugin {
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public QueryResponse executeQuery(
@WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest)
throws MsgRegistryException {

View file

@ -9,13 +9,9 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationNodeType;
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.raytheon.uf.common.util.CollectionUtil;
import com.raytheon.uf.edex.registry.ebxml.dao.ClassificationNodeDao;
@Transactional(propagation = Propagation.REQUIRED)
public abstract class RegistryQueryPlugin implements QueryManager {
protected String queryDefinition;

View file

@ -93,6 +93,8 @@ public class EbxmlObjectUtil {
*/
public static final String HOME_SLOT_NAME = "urn:oasis:names:tc:ebxml-regrep:rim:RegistryObject:home";
public static final String EVENT_SOURCE_SLOT = "EventSource";
/** The name of the slot designated to hold the email notification formatter */
public static final String EMAIL_NOTIFICATION_FORMATTER_SLOT = "urn:oasis:names:tc:ebxml-regrep:rim:DeliveryInfo:emailNotificationFormatter";

View file

@ -49,12 +49,16 @@ public class CreateAuditTrailEvent extends Event {
private List<RegistryObjectType> objectsAffected;
private long eventTime;
public CreateAuditTrailEvent(String id, RegistryRequestType request,
String actionType, List<RegistryObjectType> objectsAffected) {
String actionType, List<RegistryObjectType> objectsAffected,
long eventTime) {
super(id);
this.request = request;
this.actionType = actionType;
this.objectsAffected = objectsAffected;
this.eventTime = eventTime;
}
public RegistryRequestType getRequest() {
@ -69,4 +73,8 @@ public class CreateAuditTrailEvent extends Event {
return objectsAffected;
}
public long getEventTime() {
return eventTime;
}
}

View file

@ -62,61 +62,55 @@ Date Ticket# Engineer Description
<table>
<tr>
<td>My Registry ID:</td>
<td><span id="myRegistryIdSpan">[Unknown]</span></td>
<td>Data Delivery ID:</td>
<td><span id="dataDeliveryIdSpan">[Unknown]</span></td>
</tr>
<tr>
<td>Site ID:</td>
<td><span id="registrySiteIdSpan">[Unknown]</span></td>
</tr>
<tr>
<td>Federated:</td>
<td><span id="federatedSpan">[Unknown]</span></td>
</tr>
<tr>
<td>Replicating To:</td>
<td><span id="replicatingToSpan">Retrieving Registry List...</span></td>
</tr>
<tr>
<td>Replicating From:</td>
<td><span id="replicatingFromSpan">Retrieving Registry List...</span></td>
</tr>
</table>
<br><br>
<table border ="1">
<tr>
<td>Resubmit Subscriptions To:</td>
<td><select id="resubmitSubsToRegistrySelect"></select></td>
<td style='width:90px'><button type="button" style='width:90px' onclick='resubmitSubs()'>Resubmit</button></td>
</tr>
<tr>
<td>Synchronize with Registry:</td>
<td>Synchronize With:</td>
<td><select id="syncWithRegistrySelect"></select></td>
<td style='width:90px'><button type="button" style='width:90px' onclick="sync()">Sync</button></td>
</tr>
<tr>
<td>Subscribe To Registry:</td>
<td>Subscribe To:</td>
<td><select id="subscribeToRegistrySelect"></select></td>
<td style='width:90px'><button type="button" style='width:90px' onclick="subscribe()">Subscribe</button></td>
</tr>
<tr>
<td>Unsubscribe From Registry:</td>
<td>Unsubscribe From:</td>
<td><select id="unsubscribeFromRegistrySelect"></select></td>
<td style='width:90px'><button type="button" style='width:90px' onclick="unsubscribe()">Unsubscribe</button></td>
</tr>
</table>
<br>
<b>My Registry is Subscribed To:</b>
<span id="subscribedToRegistriesSpan">Retrieving Registry List...</span>
<br>
<br>
<b>Registries Subscribing to My Registry:</b>
<span id="subscribedToRegistries">Retrieving Registry List...</span>
<br>
<br>
<b>Federation Members:<b>
<span id="federationMembersSpan"></span>
<br>
<br>
<b>Object Types Currently Replicated:</b>
<b>Object Types Replicated:</b>
<span id="replicatedObjectListSpan">Retrieving Object List...</span>
<br>
<br>
@ -127,38 +121,45 @@ Date Ticket# Engineer Description
function subscribe(){
var registryId = getComboValue("subscribeToRegistrySelect")
callRestService("dataDelivery/status/subscribeToRegistry",registryId);
callRestService("dataDelivery/federation/subscribeToRegistry",registryId);
location.reload(false)
}
function resubmitSubs(){
var registryId = getComboValue("resubmitSubsToRegistrySelect")
callRestService("dataDelivery/status/subscribeToRegistry",registryId);
callRestService("dataDelivery/federation/subscribeToRegistry",registryId);
}
function unsubscribe(){
var registryId = getComboValue("unsubscribeFromRegistrySelect")
callRestService("dataDelivery/status/unsubscribeFromRegistry",registryId);
location.reload(false)
callRestService("dataDelivery/federation/unsubscribeFromRegistry",registryId);
location.reload(false)
}
function sync(){
var registryId = getComboValue("syncWithRegistrySelect")
callRestService("dataDelivery/status/syncWithRegistry",registryId);
callRestService("dataDelivery/federation/synchronizeWithRegistry",registryId);
}
function populate(){
var isFederated = callRestService("dataDelivery/status/isFederated")
var isFederated = callRestService("dataDelivery/federation/isFederated")
var dataDeliveryId=callRestService("dataDelivery/federation/dataDeliveryId");
var siteId=callRestService("dataDelivery/federation/siteId");
var objectTypes = callRestService("dataDelivery/federation/getObjectTypesReplicated").split(",")
var federationMembers = new Array()
document.getElementById("federatedSpan").innerHTML=isFederated
document.getElementById("dataDeliveryIdSpan").innerHTML=dataDeliveryId
document.getElementById("registrySiteIdSpan").innerHTML=siteId
if(isFederated == "true"){
var myRegistryId=callRestService("dataDelivery/status/getMyRegistryInfo").split("\n")[0].split(",")[0]
document.getElementById("myRegistryIdSpan").innerHTML=myRegistryId
var subscriptionCandidates = new Array();
var replicatingToString = callRestService("dataDelivery/federation/getReplicatingTo")
var replicatingTo = replicatingToString.split(",")
var replicatingFromString = callRestService("dataDelivery/federation/getReplicatingFrom")
var replicatingFrom = replicatingFromString.split(",")
var registries = callRestService("dataDelivery/federation/getFederationMembers").split("\n")
var memberHTML = "<table border='1'><tr><th>Site</th><th>Base URL</th><th>Conformance Profile</th><th>Specification Version</th></tr>"
var registries = callRestService("dataDelivery/status/getFederationMembers").split("\n")
var federationMembers = new Array()
var subscribedTo=new Array()
var subscribedFrom=new Array()
for(var i = 0; i < registries.length-1;i++){
var tokens = registries[i].split(",")
memberHTML+="<tr>"
@ -170,39 +171,7 @@ Date Ticket# Engineer Description
federationMembers[i]=tokens[0]
}
memberHTML+="</table>"
document.getElementById("federationMembersSpan").innerHTML=memberHTML
memberHTML = "<table border='1'><tr><th>Site</th><th>Base URL</th><th>Conformance Profile</th><th>Specification Version</th></tr>"
registries = callRestService("dataDelivery/status/getRegistriesSubscribedTo").split("\n")
for(var i = 0; i < registries.length-1;i++){
var tokens = registries[i].split(",")
memberHTML+="<tr>"
memberHTML+="<td>"+tokens[0]+"</td>"
memberHTML+="<td>"+tokens[1]+"</td>"
memberHTML+="<td>"+tokens[2]+"</td>"
memberHTML+="<td>"+tokens[3]+"</td>"
memberHTML+="</tr>"
subscribedTo[i] = tokens[0]
}
memberHTML+="</table>"
document.getElementById("subscribedToRegistriesSpan").innerHTML=memberHTML
memberHTML = "<table border='1'><tr><th>Site</th><th>Base URL</th><th>Conformance Profile</th><th>Specification Version</th></tr>"
registries = callRestService("dataDelivery/status/getRegistrySubscribing").split("\n")
for(var i = 0; i < registries.length-1;i++){
var tokens = registries[i].split(",")
memberHTML+="<tr>"
memberHTML+="<td>"+tokens[0]+"</td>"
memberHTML+="<td>"+tokens[1]+"</td>"
memberHTML+="<td>"+tokens[2]+"</td>"
memberHTML+="<td>"+tokens[3]+"</td>"
memberHTML+="</tr>"
subscribedFrom[i]=tokens[0]
}
memberHTML+="</table>"
document.getElementById("subscribedToRegistries").innerHTML=memberHTML
var objectTypes = callRestService("dataDelivery/status/getObjectTypesReplicated").split("\n")
var objectTypeHTML = "<table border='1'><tr><th style='width:30px;'></th><th>Object Type</th></tr>"
for(var i = 0; i < objectTypes.length-1;i++){
objectTypeHTML+="<tr>"
@ -210,27 +179,28 @@ Date Ticket# Engineer Description
objectTypeHTML+="<td>"+objectTypes[i]+"</td>"
objectTypeHTML+="</tr>"
}
objectTypeHTML+="</table>";
for(var i = 0; i < federationMembers.length;i++){
var member=federationMembers[i]
if(subscribedTo.indexOf(member)== -1 && member!=myRegistryId){
if(replicatingFrom.indexOf(member)== -1 && member!=dataDeliveryId){
addOptionToList("subscribeToRegistrySelect",member,member)
}
if(member!=myRegistryId){
if(member!=dataDeliveryId){
addOptionToList("syncWithRegistrySelect",member,member)
}
if(subscribedTo.indexOf(member) != -1){
if(replicatingFrom.indexOf(member) != -1){
addOptionToList("unsubscribeFromRegistrySelect",member,member)
addOptionToList("resubmitSubsToRegistrySelect",member,member)
}
}
objectTypeHTML+="</table>";
document.getElementById("replicatedObjectListSpan").innerHTML=objectTypeHTML
document.getElementById("replicatingToSpan").innerHTML=replicatingToString
document.getElementById("replicatingFromSpan").innerHTML=replicatingFromString
document.getElementById("federationMembersSpan").innerHTML=memberHTML
}
}
</script>
</html>

View file

@ -1,20 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VizLauncher", "VizLauncher\VizLauncher.csproj", "{45B15612-0725-479C-8E1B-9B63F2FB45A3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{45B15612-0725-479C-8E1B-9B63F2FB45A3}.Debug|x86.ActiveCfg = Debug|x86
{45B15612-0725-479C-8E1B-9B63F2FB45A3}.Debug|x86.Build.0 = Debug|x86
{45B15612-0725-479C-8E1B-9B63F2FB45A3}.Release|x86.ActiveCfg = Release|x86
{45B15612-0725-479C-8E1B-9B63F2FB45A3}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

Binary file not shown.

View file

@ -1,79 +0,0 @@
namespace VizLauncher
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.lblFailureDetail = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(12, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(337, 50);
this.label1.TabIndex = 0;
this.label1.Text = "Failed to Start AWIPS II Viz!";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblFailureDetail
//
this.lblFailureDetail.BackColor = System.Drawing.Color.White;
this.lblFailureDetail.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblFailureDetail.Location = new System.Drawing.Point(14, 59);
this.lblFailureDetail.Name = "lblFailureDetail";
this.lblFailureDetail.Size = new System.Drawing.Size(335, 119);
this.lblFailureDetail.TabIndex = 1;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(361, 187);
this.Controls.Add(this.lblFailureDetail);
this.Controls.Add(this.label1);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Form1";
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Viz Launcher";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblFailureDetail;
}
}

View file

@ -1,20 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace VizLauncher
{
public partial class Form1 : Form
{
public Form1(String errorText)
{
InitializeComponent();
this.lblFailureDetail.Text = errorText;
}
}
}

View file

@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -1,31 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using VizLauncher.com.raytheon.viz.launcher;
namespace VizLauncher
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
VizLauncher.com.raytheon.viz.launcher.VizLauncher vizLauncher =
new VizLauncher.com.raytheon.viz.launcher.VizLauncher();
bool success = vizLauncher.run(Application.StartupPath);
if (success == false)
{
// Display the "Failure" dialog.
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(vizLauncher.getErrorDetail()));
}
Application.Exit();
}
}
}

View file

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("VizLauncher")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("VizLauncher")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("7f929b46-b56e-47eb-b6e6-ff79e54f6572")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -1,71 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VizLauncher.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VizLauncher.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}

View file

@ -1,117 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -1,30 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17929
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace VizLauncher.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}

View file

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>

View file

@ -1,94 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{45B15612-0725-479C-8E1B-9B63F2FB45A3}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VizLauncher</RootNamespace>
<AssemblyName>VizLauncher</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="com\raytheon\viz\launcher\environment\EnvironmentProperties.cs" />
<Compile Include="com\raytheon\viz\launcher\environment\VizEnvironment.cs" />
<Compile Include="com\raytheon\viz\launcher\process\AbstractProcessLauncher.cs" />
<Compile Include="com\raytheon\viz\launcher\process\impl\AlertvizProcessLauncher.cs" />
<Compile Include="com\raytheon\viz\launcher\process\impl\CaveProcessLauncher.cs" />
<Compile Include="com\raytheon\viz\launcher\process\IProcessLauncher.cs" />
<Compile Include="com\raytheon\viz\launcher\VizLauncher.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -1,3 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
</Project>

View file

@ -1,68 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using VizLauncher.com.raytheon.viz.launcher.environment;
using VizLauncher.com.raytheon.viz.launcher.process;
using VizLauncher.com.raytheon.viz.launcher.process.impl;
namespace VizLauncher.com.raytheon.viz.launcher
{
public class VizLauncher
{
private String errorDetail;
public bool run(String location)
{
VizEnvironment vizEnvironment = new VizEnvironment(location);
if (vizEnvironment.isReady() == false)
{
this.errorDetail = vizEnvironment.getExceptionText();
return false;
}
/* Alternatively, we would be able to construct both process launchers using Spring and inject them. */
// Construct the AlertViz Process Launcher.
IProcessLauncher alertvizProcessLauncher = new AlertvizProcessLauncher(vizEnvironment);
if (alertvizProcessLauncher.isReady() == false)
{
this.errorDetail = alertvizProcessLauncher.getExceptionText();
return false;
}
Thread alertvizThread = new Thread(alertvizProcessLauncher.launchProcess);
// Construct the CAVE Process Launcher.
IProcessLauncher caveProcessLauncher = new CaveProcessLauncher(vizEnvironment);
if (caveProcessLauncher.isReady() == false)
{
this.errorDetail = caveProcessLauncher.getExceptionText();
return false;
}
Thread caveThread = new Thread(caveProcessLauncher.launchProcess);
// Start AlertViz.
alertvizThread.Start();
// Delay - Give Alertviz Time To Start.
Thread.Sleep(1000);
// Start CAVE.
caveThread.Start();
// Wait for CAVE.
caveThread.Join();
// Wait for AlertViz.
alertvizThread.Join();
return true;
}
public String getErrorDetail()
{
return this.errorDetail;
}
}
}

View file

@ -1,34 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace VizLauncher.com.raytheon.viz.launcher.environment
{
public abstract class EnvironmentProperties
{
/* Environment Properties */
public static readonly String USER_HOME_ENV_PROPERTY = "%HOMEDRIVE%%HOMEPATH%";
public static readonly String COMPUTER_NAME_ENV_PROPERTY = "%COMPUTERNAME%";
/* Registry Constants */
public static readonly String A2_JAVA_REG = @"Software\Raytheon\Runtime Environment\AWIPS II Java";
public static readonly String A2_PYTHON_REG = @"Software\Raytheon\Runtime Environment\AWIPS II Python";
public static readonly String JAVA_JRE_VALUE_NAME = "JavaJreDirectory";
public static readonly String PYTHON_INSTALL_NAME = "PythonInstallDirectory";
/* Environment Additions */
public static readonly String ENVIRONMENT_VARIABLE_PATH = "Path";
public static readonly String ENVIRONMENT_VARIABLE_PYTHON_PATH = "PythonPath";
public static readonly String PATH_PYTHON_DLLS = Path.DirectorySeparatorChar + "DLLs";
public static readonly String PATH_JAVA_BIN = Path.DirectorySeparatorChar + "bin";
public static readonly String PYTHON_PATH_PYTHON_LIBTK =
Path.DirectorySeparatorChar + "Lib" + Path.DirectorySeparatorChar + "lib-tk";
public static readonly String PYTHON_PATH_PYTHON_DLLS = Path.DirectorySeparatorChar + "DLLs";
public static readonly String PYTHON_PATH_PYTHON_LIB = Path.DirectorySeparatorChar + "Lib";
}
}

View file

@ -1,137 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.Win32;
namespace VizLauncher.com.raytheon.viz.launcher.environment
{
public class VizEnvironment
{
private static readonly String CONSOLE_LOGS_DIRECTORY =
Path.DirectorySeparatorChar + "caveData" + Path.DirectorySeparatorChar +
"logs" + Path.DirectorySeparatorChar + "consoleLogs";
private String location;
private String logDirectory = null;
private String path = null;
private String pythonPath = null;
// did an error occur while initializing this object?
private bool ready;
// details about the error that has occurred.
private String exceptionText;
public VizEnvironment(String location)
{
this.location = location;
this.init();
}
private void init()
{
/* For now we will assume that the environment properties will be available */
// determine the location of the user's "home" directory.
String homeDirectory =
this.resolveEnvironmentProperty(EnvironmentProperties.USER_HOME_ENV_PROPERTY);
// determine the computer name.
String computerName =
this.resolveEnvironmentProperty(EnvironmentProperties.COMPUTER_NAME_ENV_PROPERTY);
// construct the path to the log directory.
this.logDirectory = homeDirectory + CONSOLE_LOGS_DIRECTORY +
Path.DirectorySeparatorChar + computerName;
// retrieve the jdk directory from the registry.
String jdkDirectory =
this.retrieveRegistryProperty(EnvironmentProperties.A2_JAVA_REG,
EnvironmentProperties.JAVA_JRE_VALUE_NAME);
if (jdkDirectory == null)
{
this.notReady("Unable to retrieve the Java JDK Path from the registry!");
return;
}
// retrieve the python location from the registry.
String pythonLocation =
this.retrieveRegistryProperty(EnvironmentProperties.A2_PYTHON_REG,
EnvironmentProperties.PYTHON_INSTALL_NAME);
if (pythonLocation == null)
{
this.notReady("Unable to retrieve the Python Install Location from the registry!");
return;
}
// Construct the PATH.
this.path = pythonLocation + Path.PathSeparator;
this.path += pythonLocation + EnvironmentProperties.PATH_PYTHON_DLLS + Path.PathSeparator;
this.path += jdkDirectory + EnvironmentProperties.PATH_JAVA_BIN;
// Construct the PYTHON_PATH.
this.pythonPath = pythonLocation + EnvironmentProperties.PYTHON_PATH_PYTHON_LIBTK + Path.PathSeparator;
this.pythonPath += pythonLocation + EnvironmentProperties.PYTHON_PATH_PYTHON_DLLS + Path.PathSeparator;
this.pythonPath += pythonLocation + EnvironmentProperties.PYTHON_PATH_PYTHON_LIB + Path.PathSeparator;
this.pythonPath += pythonLocation;
this.ready = true;
}
private String resolveEnvironmentProperty(String property)
{
return Environment.ExpandEnvironmentVariables(property);
}
private String retrieveRegistryProperty(String registryKeyName, String valueName)
{
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(registryKeyName);
if (registryKey == null)
{
return null;
}
Object registryValue = registryKey.GetValue(valueName, null);
if (registryValue == null)
{
return null;
}
return registryValue.ToString();
}
private void notReady(String reason)
{
this.ready = false;
this.exceptionText = reason;
}
public String getLocation()
{
return this.location;
}
public String getLogDirectory()
{
return this.logDirectory;
}
public String getPath()
{
return this.path;
}
public String getPythonPath()
{
return this.pythonPath;
}
public bool isReady()
{
return this.ready;
}
public String getExceptionText()
{
return this.exceptionText;
}
}
}

View file

@ -1,137 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
using VizLauncher.com.raytheon.viz.launcher.environment;
namespace VizLauncher.com.raytheon.viz.launcher.process
{
public abstract class AbstractProcessLauncher : IProcessLauncher
{
private static readonly String LOG_DATE_FORMAT = "yyyyMMdd_HHmmss";
protected static readonly String LOG_SUFFIX = ".log";
protected Process process = null;
private StreamWriter logFileWriter;
protected VizEnvironment vizEnvironment;
private bool ready = false;
private String exceptionText = null;
public AbstractProcessLauncher(VizEnvironment vizEnvironment)
{
this.vizEnvironment = vizEnvironment;
// Prepare the log file.
if (Directory.Exists(vizEnvironment.getLogDirectory()) == false)
{
Directory.CreateDirectory(vizEnvironment.getLogDirectory());
}
String logName = vizEnvironment.getLogDirectory() +
Path.DirectorySeparatorChar + this.constructLogName(this.determineLogDate());
// Prepare the process.
this.process = new Process();
this.process.StartInfo = this.constructProcessStartInfo(vizEnvironment);
this.process.OutputDataReceived += new DataReceivedEventHandler(processOutputHandler);
this.validate();
if (this.ready == false)
{
return;
}
/*
* Access the log file for write access; other processes will have read-only access to
* the log file until it is closed.
**/
this.logFileWriter =
new StreamWriter(File.Open(logName, FileMode.Append,
FileAccess.Write, FileShare.Read));
}
private String determineLogDate()
{
return DateTime.Now.ToString(LOG_DATE_FORMAT);
}
private ProcessStartInfo constructProcessStartInfo(VizEnvironment vizEnvironment)
{
ProcessStartInfo processStartInfo =
new ProcessStartInfo(this.constructProcessName(vizEnvironment.getLocation()));
// include the default system PATH in the application PATH
String systemPath = System.Environment.GetEnvironmentVariable("PATH");
processStartInfo.EnvironmentVariables[EnvironmentProperties.ENVIRONMENT_VARIABLE_PATH] =
vizEnvironment.getPath() + this.getApplicationSpecificPath() + systemPath;
processStartInfo.EnvironmentVariables[EnvironmentProperties.ENVIRONMENT_VARIABLE_PYTHON_PATH] =
vizEnvironment.getPythonPath();
processStartInfo.UseShellExecute = false;
processStartInfo.Arguments = this.getCommandLineArguments();
processStartInfo.RedirectStandardOutput = true;
return processStartInfo;
}
protected void validate()
{
String application = this.process.StartInfo.FileName;
/* ensure that the specified application exists. */
if (File.Exists(application) == false)
{
this.ready = false;
this.exceptionText = "Unable to find the specified Viz application: " + application;
return;
}
this.ready = true;
}
public virtual void launchProcess()
{
this.runProcess();
this.closeLog();
}
protected void runProcess()
{
this.process.Start();
this.process.BeginOutputReadLine();
this.process.WaitForExit();
this.process.CancelOutputRead();
}
protected void closeLog()
{
this.logFileWriter.Close();
}
private void processOutputHandler(Object sendingProcess, DataReceivedEventArgs outline)
{
if (String.IsNullOrEmpty(outline.Data))
{
return;
}
this.logFileWriter.WriteLine(outline.Data);
}
public bool isReady()
{
return this.ready;
}
public String getExceptionText()
{
return this.exceptionText;
}
protected virtual String getApplicationSpecificPath()
{
return String.Empty;
}
protected abstract String constructProcessName(String location);
protected abstract String constructLogName(String logDate);
protected abstract String getCommandLineArguments();
}
}

View file

@ -1,16 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace VizLauncher.com.raytheon.viz.launcher.process
{
public interface IProcessLauncher
{
void launchProcess();
bool isReady();
String getExceptionText();
}
}

View file

@ -1,62 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;
using VizLauncher.com.raytheon.viz.launcher.process;
using VizLauncher.com.raytheon.viz.launcher.environment;
namespace VizLauncher.com.raytheon.viz.launcher.process.impl
{
public class AlertvizProcessLauncher : AbstractProcessLauncher
{
private static readonly String LOG_PREFIX = "alertviz_";
private static readonly String COMMAND_LINE_ARGUMENTS = "-component thinalertviz";
private static readonly String ALERTVIZ_PROCESS_NAME = "alertviz";
private static readonly String ALERTVIZ_EXECUTABLE =
Path.DirectorySeparatorChar + "AlertViz" +
Path.DirectorySeparatorChar + "alertviz.exe";
public AlertvizProcessLauncher(VizEnvironment vizEnvironment) : base(vizEnvironment)
{
}
public override void launchProcess()
{
// need to verify that another AlertViz process is not already running.
if (this.isAlertVizAlreadyRunning())
{
// do not start a new AlertViz process.
return;
}
this.runProcess();
while (this.process.ExitCode != 0)
{
this.runProcess();
}
this.closeLog();
}
private Boolean isAlertVizAlreadyRunning()
{
return (Process.GetProcessesByName(ALERTVIZ_PROCESS_NAME).Length > 0);
}
protected override String constructProcessName(String location)
{
return location + ALERTVIZ_EXECUTABLE;
}
protected override String constructLogName(String logDate)
{
return LOG_PREFIX + logDate + AbstractProcessLauncher.LOG_SUFFIX;
}
protected override String getCommandLineArguments()
{
return COMMAND_LINE_ARGUMENTS;
}
}
}

View file

@ -1,45 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using VizLauncher.com.raytheon.viz.launcher.process;
using VizLauncher.com.raytheon.viz.launcher.environment;
namespace VizLauncher.com.raytheon.viz.launcher.process.impl
{
public class CaveProcessLauncher : AbstractProcessLauncher
{
private static readonly String LOG_PREFIX = "cave_";
private static readonly String COMMAND_LINE_ARGUMENTS = "-component thinclient";
private static readonly String CAVE_DIRECTORY = Path.DirectorySeparatorChar + "CAVE";
private static readonly String CAVE_EXECUTABLE =
CAVE_DIRECTORY + Path.DirectorySeparatorChar + "cave.exe";
public CaveProcessLauncher(VizEnvironment vizEnvironment)
: base(vizEnvironment)
{
}
protected override String getApplicationSpecificPath()
{
return Path.PathSeparator + this.vizEnvironment.getLocation() +
CAVE_DIRECTORY + Path.DirectorySeparatorChar + "lib" + Path.PathSeparator;
}
protected override String constructProcessName(String location)
{
return location + CAVE_EXECUTABLE;
}
protected override String constructLogName(String logDate)
{
return LOG_PREFIX + logDate + AbstractProcessLauncher.LOG_SUFFIX;
}
protected override String getCommandLineArguments()
{
return COMMAND_LINE_ARGUMENTS;
}
}
}

View file

@ -9,7 +9,7 @@
Name: awips2-ldm
Summary: AWIPS II LDM Distribution
Version: %{_ldm_version}
Release: 9
Release: 10
Group: AWIPSII
BuildRoot: /tmp
BuildArch: noarch

View file

@ -53,11 +53,11 @@
# are started by the "exec" command and are in the same process group.
#
#EXEC "pqact"
EXEC "noaaportIngester -m 224.0.1.1 -n -u 3 -t mhs -r 1 -s NMC"
EXEC "noaaportIngester -m 224.0.1.2 -n -u 4 -t mhs -r 1 -s GOES"
EXEC "noaaportIngester -m 224.0.1.3 -n -u 5 -t mhs -r 1 -s NMC2"
EXEC "noaaportIngester -m 224.0.1.4 -n -u 6 -t mhs -r 1 -s NOAAPORT_OPT"
EXEC "noaaportIngester -m 224.0.1.5 -n -u 7 -t mhs -r 1 -s NMC3"
EXEC "noaaportIngester -b 10000 -m 224.0.1.1 -n -u 3 -t mhs -r 1 -s NMC"
EXEC "noaaportIngester -b 10000 -m 224.0.1.2 -n -u 4 -t mhs -r 1 -s GOES"
EXEC "noaaportIngester -b 10000 -m 224.0.1.3 -n -u 5 -t mhs -r 1 -s NMC2"
EXEC "noaaportIngester -b 10000 -m 224.0.1.4 -n -u 6 -t mhs -r 1 -s NOAAPORT_OPT"
EXEC "noaaportIngester -b 10000 -m 224.0.1.5 -n -u 7 -t mhs -r 1 -s NMC3"
#
# rtstats uses the LDM to send product latency statistics to the UPC.
# For more info on rtstats please see the man page.

View file

@ -53,11 +53,11 @@
# are started by the "exec" command and are in the same process group.
#
#EXEC "pqact"
EXEC "noaaportIngester -m 224.0.1.1 -n -u 3 -t mhs -r 1 -s NMC"
EXEC "noaaportIngester -m 224.0.1.2 -n -u 4 -t mhs -r 1 -s GOES"
EXEC "noaaportIngester -m 224.0.1.3 -n -u 5 -t mhs -r 1 -s NMC2"
EXEC "noaaportIngester -m 224.0.1.4 -n -u 6 -t mhs -r 1 -s NOAAPORT_OPT"
EXEC "noaaportIngester -m 224.0.1.5 -n -u 7 -t mhs -r 1 -s NMC3"
EXEC "noaaportIngester -b 10000 -m 224.0.1.1 -n -u 3 -t mhs -r 1 -s NMC"
EXEC "noaaportIngester -b 10000 -m 224.0.1.2 -n -u 4 -t mhs -r 1 -s GOES"
EXEC "noaaportIngester -b 10000 -m 224.0.1.3 -n -u 5 -t mhs -r 1 -s NMC2"
EXEC "noaaportIngester -b 10000 -m 224.0.1.4 -n -u 6 -t mhs -r 1 -s NOAAPORT_OPT"
EXEC "noaaportIngester -b 10000 -m 224.0.1.5 -n -u 7 -t mhs -r 1 -s NMC3"
#
# rtstats uses the LDM to send product latency statistics to the UPC.
# For more info on rtstats please see the man page.

View file

@ -53,11 +53,11 @@
# are started by the "exec" command and are in the same process group.
#
#EXEC "pqact"
EXEC "noaaportIngester -m 224.0.1.1 -n -u 3 -t mhs -r 1 -s NMC"
EXEC "noaaportIngester -m 224.0.1.2 -n -u 4 -t mhs -r 1 -s GOES"
EXEC "noaaportIngester -m 224.0.1.3 -n -u 5 -t mhs -r 1 -s NMC2"
EXEC "noaaportIngester -m 224.0.1.4 -n -u 6 -t mhs -r 1 -s NOAAPORT_OPT"
EXEC "noaaportIngester -m 224.0.1.5 -n -u 7 -t mhs -r 1 -s NMC3"
EXEC "noaaportIngester -b 10000 -m 224.0.1.1 -n -u 3 -t mhs -r 1 -s NMC"
EXEC "noaaportIngester -b 10000 -m 224.0.1.2 -n -u 4 -t mhs -r 1 -s GOES"
EXEC "noaaportIngester -b 10000 -m 224.0.1.3 -n -u 5 -t mhs -r 1 -s NMC2"
EXEC "noaaportIngester -b 10000 -m 224.0.1.4 -n -u 6 -t mhs -r 1 -s NOAAPORT_OPT"
EXEC "noaaportIngester -b 10000 -m 224.0.1.5 -n -u 7 -t mhs -r 1 -s NMC3"
#
# rtstats uses the LDM to send product latency statistics to the UPC.
# For more info on rtstats please see the man page.

View file

@ -53,11 +53,11 @@
# are started by the "exec" command and are in the same process group.
#
#EXEC "pqact"
EXEC "noaaportIngester -m 224.0.1.1 -n -u 3 -t mhs -r 1 -s NMC"
EXEC "noaaportIngester -m 224.0.1.2 -n -u 4 -t mhs -r 1 -s GOES"
EXEC "noaaportIngester -m 224.0.1.3 -n -u 5 -t mhs -r 1 -s NMC2"
EXEC "noaaportIngester -m 224.0.1.4 -n -u 6 -t mhs -r 1 -s NOAAPORT_OPT"
EXEC "noaaportIngester -m 224.0.1.5 -n -u 7 -t mhs -r 1 -s NMC3"
EXEC "noaaportIngester -b 10000 -m 224.0.1.1 -n -u 3 -t mhs -r 1 -s NMC"
EXEC "noaaportIngester -b 10000 -m 224.0.1.2 -n -u 4 -t mhs -r 1 -s GOES"
EXEC "noaaportIngester -b 10000 -m 224.0.1.3 -n -u 5 -t mhs -r 1 -s NMC2"
EXEC "noaaportIngester -b 10000 -m 224.0.1.4 -n -u 6 -t mhs -r 1 -s NOAAPORT_OPT"
EXEC "noaaportIngester -b 10000 -m 224.0.1.5 -n -u 7 -t mhs -r 1 -s NMC3"
#
# rtstats uses the LDM to send product latency statistics to the UPC.
# For more info on rtstats please see the man page.

View file

@ -68,7 +68,7 @@ wrapper.java.additional.6=-Damqj.read_write_pool_size=32
wrapper.java.additional.7=-Dqpid.broker.exceptionHandler.continue=true
# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=2048
wrapper.java.maxmemory=1536
wrapper.ping.timeout=300