From 7516b5ffbcd7e54785a0d1e3cf85cb235fb2fb3a Mon Sep 17 00:00:00 2001 From: Dave Hladky Date: Thu, 12 Jun 2014 11:58:42 -0500 Subject: [PATCH] Omaha #3280 Sister ticket to 3141 for DD repo. Setup SOAP metadata transfers for DPA Former-commit-id: 8b4bea63939089b805aaa3b08d6907c95c04230e --- .../common/dataplugin/madis/MadisRecord.java | 3 +- .../ebxml/RemoteSOAPRegistryHandler.java | 104 ++++++++++++++++ .../ebxml/RemoteSOAPRegistryManager.java | 113 ++++++++++++++++++ 3 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RemoteSOAPRegistryHandler.java create mode 100644 edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RemoteSOAPRegistryManager.java diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.madis/src/com/raytheon/uf/common/dataplugin/madis/MadisRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.madis/src/com/raytheon/uf/common/dataplugin/madis/MadisRecord.java index 4281638162..01dec9ace1 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.madis/src/com/raytheon/uf/common/dataplugin/madis/MadisRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.madis/src/com/raytheon/uf/common/dataplugin/madis/MadisRecord.java @@ -76,6 +76,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Dec 10, 2013 2616 mpduff Added stationId to the unique constraint * jan 22, 2014 2713 dhladky Calendar conversion. * Mar 21, 2014 2939 dhladky Fixed mismatches in HDF5, DB records. + * Jan 08, 2014 3141 dhladky Bad index for WFS requests. * * * @@ -88,7 +89,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @Table(name = "madis", uniqueConstraints = { @UniqueConstraint(columnNames = { "latitude", "longitude", "stationId", "refTime", "provider", "subProvider", "restriction" }) }) @org.hibernate.annotations.Table(appliesTo = "madis", indexes = { @Index(name = "madis_wfsQueryIndex", columnNames = { - "refTime", "location" }), }) + "insertTime", "location" }), }) @DynamicSerialize public class MadisRecord extends PersistablePluginDataObject implements ISpatialEnabled, IPointData { diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RemoteSOAPRegistryHandler.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RemoteSOAPRegistryHandler.java new file mode 100644 index 0000000000..203ad9c8f0 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RemoteSOAPRegistryHandler.java @@ -0,0 +1,104 @@ +/** +* 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.registry.ebxml; + +import com.raytheon.uf.common.registry.services.RegistrySOAPServices; + + +/** + * Remote version of the {@link SOAPRegistryManager}. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 06, 2014   #3141     dhladky     initial creation
+ * 
+ * + * @author dhladky + * @version 1.0 + */ +public class RemoteSOAPRegistryHandler extends RemoteSOAPRegistryManager { + + /** remote registry host **/ + private String host; + + /** remote registry port **/ + private String port; + + /** remote registry protocol **/ + private String protocol; + + /** remote host complete precursor URL */ + public String remoteHostUrl = null; + + /** default constructor **/ + public RemoteSOAPRegistryHandler() { + + } + + /** Bean constructor **/ + public RemoteSOAPRegistryHandler(RegistrySOAPServices rss) { + super(rss); + } + + @Override + protected String getRemoteHost() { + + if (remoteHostUrl == null) { + StringBuffer buf = new StringBuffer(); + buf.append(protocol); + buf.append("://"); + buf.append(host); + buf.append(":"); + buf.append(port); + + remoteHostUrl = buf.toString(); + } + + return remoteHostUrl; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public String getPort() { + return port; + } + + public void setPort(String port) { + this.port = port; + } + + public String getProtocol() { + return protocol; + } + + public void setProtocol(String protocol) { + this.protocol = protocol; + } +} diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RemoteSOAPRegistryManager.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RemoteSOAPRegistryManager.java new file mode 100644 index 0000000000..ee513f91a4 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RemoteSOAPRegistryManager.java @@ -0,0 +1,113 @@ +package com.raytheon.uf.common.registry.ebxml; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.LifecycleManager; +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.QueryManager; + +import com.raytheon.uf.common.registry.services.RegistrySOAPServices; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; + +/** + * + * A SOAP client implementation for use with the RegistryManager Class. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jun 06, 2014 #3141      dhladky     creation
+ * 
+ * 
+ * + * @author dhladky + * @version 1.0 + */ +public abstract class RemoteSOAPRegistryManager implements LifecycleManagerFactory, + QueryManagerFactory { + + protected static final IUFStatusHandler statusHandler = UFStatus + .getHandler(RemoteSOAPRegistryManager.class); + + /** SOAP service provider **/ + protected RegistrySOAPServices rss; + + /** + * default constructor. + */ + public RemoteSOAPRegistryManager() { + + } + + /** + * Constructor to conform to bean pattern. + */ + public RemoteSOAPRegistryManager(RegistrySOAPServices rss) { + setRss(rss); + } + + /** + * Get an implementation of LifeCycleManager that uses SOAP to submit + * requests to the registry. + * + * @return A SOAP implementation of LifeCycleManager. + * + * @see LifecycleManagerFactory + */ + @Override + public LifecycleManager getLifeCycleManager() { + // Retrieve a WebSevice client for the LifecycleManager. + LifecycleManager a = null; + try { + a = getRss().getLifecycleManagerServiceForHost(getRemoteHost()); + } catch (Exception e) { + statusHandler.error("Can't find the Remote LifeCycleManager SOAP service!", e); + } + + return a; + } + + /** + * Get an implementation of QueryManager that uses SOAP to submit requests + * to the registry. + * + * @return A SOAP implementation of QueryManager. + * + * @see QueryManagerFactory + */ + @Override + public QueryManager getQueryManager() { + + QueryManager qm = null; + try { + qm = getRss().getQueryServiceForHost(getRemoteHost()); + } catch (Exception e) { + statusHandler.error("Can't find the Remote QueryManager SOAP service!", e); + } + + return qm; + } + + /** + * Get the name of the remote host + * @return + */ + protected abstract String getRemoteHost(); + + /** + * get the registry SOAP service helper setup + * @return + */ + public RegistrySOAPServices getRss() { + return rss; + } + + /** + * Sets the registry SOAP service helper + * @param rss + */ + public void setRss(RegistrySOAPServices rss) { + this.rss = rss; + } +}