diff --git a/cave/com.raytheon.uf.viz.ncep.dataplugins.feature/feature.xml b/cave/com.raytheon.uf.viz.ncep.dataplugins.feature/feature.xml
index 8e72775764..9a259e2ea3 100644
--- a/cave/com.raytheon.uf.viz.ncep.dataplugins.feature/feature.xml
+++ b/cave/com.raytheon.uf.viz.ncep.dataplugins.feature/feature.xml
@@ -121,13 +121,6 @@
version="0.0.0"
unpack="false"/>
-
-
%-5p %d [%t] %c{0}: %m%n
+
+
+
+
+ ${edex.home}/logs/edex-${edex.run.mode}-notification-%d{yyyyMMdd}.log
+ 30
+
+
+
+ %-5p %d [%t] %c{0}: %m%n
+
+
+
+
+
+
+ ${edex.home}/logs/edex-${edex.run.mode}-retrieval-%d{yyyyMMdd}.log
+ 30
+
+
+
+ %-5p %d [%t] %c{0}: %m%n
+
+
@@ -131,12 +155,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
diff --git a/edexOsgi/build.edex/esb/conf/modes.xml b/edexOsgi/build.edex/esb/conf/modes.xml
index b78be04e4c..ebcf64e368 100644
--- a/edexOsgi/build.edex/esb/conf/modes.xml
+++ b/edexOsgi/build.edex/esb/conf/modes.xml
@@ -88,7 +88,6 @@
excludeDpaAndOgcaww-ingest.xml
- ncccfp-ingest.xmlncep-util-on-edex-ingestncep-util-on-edex-ingestGribncscd-ingest.xml
diff --git a/edexOsgi/com.raytheon.uf.common.dataaccess/src/com/raytheon/uf/common/dataaccess/impl/DefaultGeometryData.java b/edexOsgi/com.raytheon.uf.common.dataaccess/src/com/raytheon/uf/common/dataaccess/impl/DefaultGeometryData.java
index 74ce85cc70..2bde0a4673 100644
--- a/edexOsgi/com.raytheon.uf.common.dataaccess/src/com/raytheon/uf/common/dataaccess/impl/DefaultGeometryData.java
+++ b/edexOsgi/com.raytheon.uf.common.dataaccess/src/com/raytheon/uf/common/dataaccess/impl/DefaultGeometryData.java
@@ -73,7 +73,7 @@ public class DefaultGeometryData implements IGeometryData {
protected String locationName;
- protected Map attributes;
+ protected Map attributes = new HashMap();
@Override
public Object getAttribute(String key) {
@@ -277,6 +277,10 @@ public class DefaultGeometryData implements IGeometryData {
this.dataMap.put(parameter, data);
}
+ public void addAttribute(String key, Object value) {
+ attributes.put(key, value);
+ }
+
public void setGeometry(Geometry geom) {
this.geometry = geom;
}
diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/META-INF/MANIFEST.MF
index e9f65cb151..5249d58877 100644
--- a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/META-INF/MANIFEST.MF
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/META-INF/MANIFEST.MF
@@ -24,9 +24,11 @@ Require-Bundle: com.raytheon.uf.common.registry.schemas.ebxml;bundle-version="1.
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
javax.measure;bundle-version="1.0.0",
com.raytheon.uf.common.datadelivery.request;bundle-version="1.0.0",
- org.apache.commons.codec;bundle-version="1.4.0"
+ org.apache.commons.codec;bundle-version="1.4.0",
+ org.apache.commons.cxf;bundle-version="1.0.0"
Export-Package: com.raytheon.uf.common.datadelivery.registry,
com.raytheon.uf.common.datadelivery.registry.ebxml,
- com.raytheon.uf.common.datadelivery.registry.handlers
+ com.raytheon.uf.common.datadelivery.registry.handlers,
+ com.raytheon.uf.common.datadelivery.registry.web
diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/services/rest/IRegistryAvailableRestService.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/web/IRegistryAvailableRestService.java
similarity index 82%
rename from edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/services/rest/IRegistryAvailableRestService.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/web/IRegistryAvailableRestService.java
index ea17639d56..cc4dde94be 100644
--- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/services/rest/IRegistryAvailableRestService.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/web/IRegistryAvailableRestService.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.registry.services.rest;
+package com.raytheon.uf.common.datadelivery.registry.web;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@@ -34,14 +34,17 @@ import javax.ws.rs.Produces;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 5/21/2013 2022 bphillip Initial implementation
+ * 10/30/2013 1538 bphillip Moved data delivery specific servics out of registry plugin
*
*
* @author bphillip
* @version 1
*/
-@Path("/rest/registryAvailable")
+@Path(IRegistryAvailableRestService.REGISTRY_AVAILABILITY_PATH_PREFIX)
public interface IRegistryAvailableRestService {
+ public static final String REGISTRY_AVAILABILITY_PATH_PREFIX = "/registryAvailable";
+
/**
* Method that simply returns a string. This method is called to see if
* registry services are available for a registry
diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/services/rest/IRegistryDataAccessService.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/web/IRegistryDataAccessService.java
similarity index 84%
rename from edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/services/rest/IRegistryDataAccessService.java
rename to edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/web/IRegistryDataAccessService.java
index 8234045d26..2b7f9ef988 100644
--- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/services/rest/IRegistryDataAccessService.java
+++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/web/IRegistryDataAccessService.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.registry.services.rest;
+package com.raytheon.uf.common.datadelivery.registry.web;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
@@ -40,14 +40,17 @@ import com.raytheon.uf.common.registry.services.rest.response.RestCollectionResp
* 9/20/2013 2385 bphillip Added subscription backup functions
* 10/8/2013 1682 bphillip Added rest functions for use with the query web interface
* 10/23/2013 2385 bphillip restoreSubscriptions throws JAXBException
+ * 10/30/2013 1538 bphillip Moved data delivery specific servics out of registry plugin
*
*
* @author bphillip
* @version 1
*/
+@Path(IRegistryDataAccessService.DATA_ACCESS_PATH_PREFIX)
public interface IRegistryDataAccessService {
- public static final String DATA_ACCESS_PATH_PREFIX = "/rest/dataAccess/";
+ /** Root path to this set of services */
+ public static final String DATA_ACCESS_PATH_PREFIX = "/dataAccess";
/**
* Gets the ids of registry objects of the given object type
@@ -57,7 +60,7 @@ public interface IRegistryDataAccessService {
* @return List of ids for registry objects of the given type
*/
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "getRegistryObjectIds/{objectType}")
+ @Path("getRegistryObjectIds/{objectType}")
public RestCollectionResponse getRegistryObjectIdsOfType(
@PathParam("objectType") String objectType);
@@ -67,7 +70,7 @@ public interface IRegistryDataAccessService {
* @return The query definitions currently contained in the registry
*/
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "getQueries")
+ @Path("getQueries")
public String getValidQueries();
/**
@@ -78,7 +81,7 @@ public interface IRegistryDataAccessService {
* @return The parameters for a given query definition
*/
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "getParametersForQuery/{queryId}")
+ @Path("getParametersForQuery/{queryId}")
public String getParametersForQuery(@PathParam("queryId") String queryId);
/**
@@ -90,7 +93,7 @@ public interface IRegistryDataAccessService {
* If errors occur while removing the subscriptions
*/
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "removeSubscriptionsFor/{siteId}")
+ @Path("removeSubscriptionsFor/{siteId}")
public void removeSubscriptionsForSite(@PathParam("siteId") String siteId)
throws RegistryException;
@@ -101,7 +104,7 @@ public interface IRegistryDataAccessService {
* @return The page containing the subscriptions
*/
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "getSubscriptions")
+ @Path("getSubscriptions")
public String getSubscriptions();
/**
@@ -113,7 +116,7 @@ public interface IRegistryDataAccessService {
* @return Status message about whether the backup was successful
*/
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "backupSubscription/{subscriptionName}")
+ @Path("backupSubscription/{subscriptionName}")
public String backupSubscription(
@PathParam("subscriptionName") String subscriptionName);
@@ -123,7 +126,7 @@ public interface IRegistryDataAccessService {
* @return Status message about whether the backup was successful
*/
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "backupAllSubscriptions/")
+ @Path("backupAllSubscriptions/")
public String backupAllSubscriptions();
/**
@@ -134,7 +137,7 @@ public interface IRegistryDataAccessService {
* @return Status message about whether the backup was successful
*/
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "restoreSubscription/{subscriptionName}")
+ @Path("restoreSubscription/{subscriptionName}")
public String restoreSubscription(
@PathParam("subscriptionName") String subscriptionName);
@@ -144,7 +147,7 @@ public interface IRegistryDataAccessService {
* @return Status messages relating to the success or failure of the restore
*/
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "restoreSubscriptions/")
+ @Path("restoreSubscriptions/")
public String restoreSubscriptions();
/**
@@ -153,7 +156,7 @@ public interface IRegistryDataAccessService {
* @return Status message
*/
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "clearSubscriptionBackupFiles/")
+ @Path("clearSubscriptionBackupFiles/")
public String clearSubscriptionBackupFiles();
}
diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.maps/src/com/raytheon/uf/common/dataplugin/maps/dataaccess/MapsQueryAssembler.java b/edexOsgi/com.raytheon.uf.common.dataplugin.maps/src/com/raytheon/uf/common/dataplugin/maps/dataaccess/MapsQueryAssembler.java
index 06daebae34..8ca1910e19 100644
--- a/edexOsgi/com.raytheon.uf.common.dataplugin.maps/src/com/raytheon/uf/common/dataplugin/maps/dataaccess/MapsQueryAssembler.java
+++ b/edexOsgi/com.raytheon.uf.common.dataplugin.maps/src/com/raytheon/uf/common/dataplugin/maps/dataaccess/MapsQueryAssembler.java
@@ -43,6 +43,7 @@ import com.vividsolutions.jts.geom.Envelope;
* Jan 28, 2013 bkowal Initial creation
* Feb 14, 2013 1614 bsteffen Refactor data access framework to use
* single request.
+ * Oct 30, 2013 mnash Allow for no parameters to be set.
*
*
*
@@ -152,8 +153,7 @@ public class MapsQueryAssembler {
* the original request that we are processing
* @return the query
*/
- public static String assembleGetAvailableLocationNames(
-IDataRequest request) {
+ public static String assembleGetAvailableLocationNames(IDataRequest request) {
return assembleQuery(request, Boolean.TRUE);
}
@@ -190,8 +190,10 @@ IDataRequest request) {
// add any additional database columns the user has specified as
// parameters
// for additional information, refer to: http://tinyurl.com/arnayco
- for (String parameter : request.getParameters()) {
- columns.add(parameter);
+ if (request.getParameters() != null) {
+ for (String parameter : request.getParameters()) {
+ columns.add(parameter);
+ }
}
}
List constraints = new ArrayList();
diff --git a/edexOsgi/com.raytheon.uf.common.python/src/com/raytheon/uf/common/python/PyJavaUtil.java b/edexOsgi/com.raytheon.uf.common.python/src/com/raytheon/uf/common/python/PyJavaUtil.java
index 735518ec3e..99e5c16f0c 100644
--- a/edexOsgi/com.raytheon.uf.common.python/src/com/raytheon/uf/common/python/PyJavaUtil.java
+++ b/edexOsgi/com.raytheon.uf.common.python/src/com/raytheon/uf/common/python/PyJavaUtil.java
@@ -30,6 +30,7 @@ package com.raytheon.uf.common.python;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 22, 2013 mnash Initial creation
+ * Oct 30, 2013 mnash Add method for searching for subclasses
*
*
*
@@ -42,4 +43,8 @@ public class PyJavaUtil {
public static boolean isArray(Object obj) {
return obj.getClass().isArray();
}
+
+ public static boolean isSubclass(Object obj, Class> clazz) {
+ return clazz.isAssignableFrom(obj.getClass());
+ }
}
diff --git a/edexOsgi/com.raytheon.uf.common.python/utility/common_static/base/python/GeometryHandler.py b/edexOsgi/com.raytheon.uf.common.python/utility/common_static/base/python/GeometryHandler.py
new file mode 100644
index 0000000000..5e39ba413a
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.python/utility/common_static/base/python/GeometryHandler.py
@@ -0,0 +1,56 @@
+# #
+# 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.
+# #
+
+
+from com.vividsolutions.jts.io import WKTReader
+from com.vividsolutions.jts.geom import Geometry
+from shapely.geometry.base import BaseGeometry
+from shapely import wkt
+
+from com.raytheon.uf.common.python import PyJavaUtil
+
+#
+# Handler for geometries from Python to Java and back.
+#
+#
+#
+# SOFTWARE HISTORY
+#
+# Date Ticket# Engineer Description
+# ------------ ---------- ----------- --------------------------
+# 10/14/13 2250 mnash Initial creation of JUtil handler
+#
+#
+
+def shapelyToJTS(val):
+ valtype = type(val)
+ if issubclass(valtype, BaseGeometry):
+ reader = WKTReader()
+ retObj = reader.read(val.to_wkt())
+ return True, retObj
+ return False, val
+
+def jtsToShapely(obj, customConverter=None):
+ if PyJavaUtil.isSubclass(obj, Geometry):
+ return True, _toShapely(obj)
+ return False, obj
+
+def _toShapely(obj):
+ return wkt.loads(obj.toText())
diff --git a/edexOsgi/com.raytheon.uf.common.python/utility/common_static/base/python/JUtil.py b/edexOsgi/com.raytheon.uf.common.python/utility/common_static/base/python/JUtil.py
index 926dbb11ab..c71c85b0e3 100644
--- a/edexOsgi/com.raytheon.uf.common.python/utility/common_static/base/python/JUtil.py
+++ b/edexOsgi/com.raytheon.uf.common.python/utility/common_static/base/python/JUtil.py
@@ -18,25 +18,29 @@
# further licensing information.
# #
-
-from java.lang import Integer, Float, Long, Boolean, String, Object, Double
-from java.util import HashMap, LinkedHashMap, ArrayList
-from java.util import Collections
-from java.util import Date
-from java.lang.reflect import Array
from collections import OrderedDict
-
-from shapely.geometry.base import BaseGeometry
-from shapely import wkt
-
-import jep
-import datetime
-from com.raytheon.uf.common.python import PyJavaUtil
+from java.util import HashMap, LinkedHashMap, ArrayList
+from java.lang import String
#
# Provides convenience methods for Java-Python bridging
#
+# For utilization of the basics, doing the following will work just fine :
#
+# import JUtil
+# JUtil.pyValToJavaObj(val)
+#
+# However, to do more advanced conversion, you can register a handler and it will then be
+# available to do the necessary conversion.
+#
+# For example, Geometry objects are not currently handled. The GeometryHandler module will
+# handle them however. Code would be written as follows :
+#
+# import JUtil
+# from GeometryHandler import jtsToShapely, shapelyToJTS
+# JUtil.registerJavaToPython(jtsToShapely)
+# JUtil.registerPythonToJava(shapelyToJTS)
+# JUtil.pyValToJavaObj(val)
#
# SOFTWARE HISTORY
#
@@ -46,12 +50,58 @@ from com.raytheon.uf.common.python import PyJavaUtil
# 03/12/13 1759 dgilling Extend Java List types handled
# by javaObjToPyVal().
# 08/20/13 2250 mnash Handle Dates, doubles, and arrays
+# 10/15/13 mnash Refactor to reduce dependencies and clean up
#
#
-JEP_ARRAY_TYPE = type(jep.jarray(0,Object))
+
+
+def registerPythonToJava(method):
+ '''
+ We want to register new handlers per PythonInterpreter.
+ This allows us to utilize different conversions that may not
+ be needed for some PythonInterpreters, but to use them in others
+ where they are required.
+ '''
+ pythonHandlers.append(method)
+
+def registerJavaToPython(method):
+ javaHandlers.append(method)
+
+def pyValToJavaObj(val):
+ '''
+ The main method for Python to Java conversion in JUtil. If no conversion
+ method can be found, a string representation of the python value will be
+ returned as we do not want to crash the JVM.
+ '''
+ retVal = val
+ if retVal is not None :
+ for handleMethod in pythonHandlers:
+ success, obj = handleMethod(val)
+ if success:
+ retVal = obj
+ break
+ return retVal
+
+def javaObjToPyVal(obj, customConverter=None):
+ '''
+ The main method for Java to Python conversion in JUtil. If no conversion
+ method can be found, the PyJObject will be returned and may still be able
+ to be used that way from within Python.
+ '''
+ retVal = obj
+ if retVal is not None :
+ for handleMethod in javaHandlers:
+ success, val = handleMethod(obj, customConverter)
+ if success:
+ retVal = val
+ break
+ return retVal
def javaStringListToPylist(jlist):
+ '''
+ Going forward should use javaObjToPyVal instead.
+ '''
pylist = []
size = jlist.size()
for i in range(size):
@@ -59,30 +109,19 @@ def javaStringListToPylist(jlist):
return pylist
def pylistToJavaStringList(pylist):
+ '''
+ Going forward should use pyValToJavaObj instead.
+ '''
jlist = ArrayList();
for i in pylist:
jlist.add(String(i))
return jlist
-def javaStringMapToPyDict(javaMap):
- keys = javaMap.keySet()
- itr = keys.iterator()
- pyDict = {}
- while itr.hasNext():
- key = itr.next()
- val = javaMap.get(key)
- fval = str(val)
- if fval.find('[') > -1:
- exec "fval = " + fval
- else:
- try:
- fval = float(fval)
- except:
- pass
- pyDict[str(key)] = fval
- return pyDict
def javaMapToPyDict(javaMap, customConverter=None):
+ '''
+ Going forward should use javaObjToPyVal instead.
+ '''
keys = javaMap.keySet()
itr = keys.iterator()
if javaMap.jclassname == "java.util.LinkedHashMap":
@@ -96,6 +135,9 @@ def javaMapToPyDict(javaMap, customConverter=None):
return pyDict
def pyDictToJavaMap(pyDict):
+ '''
+ Going forward should use pyValToJavaObj instead.
+ '''
if pyDict is None :
return None
@@ -108,98 +150,13 @@ def pyDictToJavaMap(pyDict):
jmap.put(pyValToJavaObj(key), pyValToJavaObj(pyDict[key]))
return jmap
-def pyValToJavaObj(val):
- retObj = val
- valtype = type(val)
- # since Python on 64 bit has larger ints, we need to do a check
- # for compatibility with Java Integers
- if valtype is int and val <= Integer.MAX_VALUE and val >= Integer.MIN_VALUE :
- retObj = Integer(val)
- elif valtype is float:
- retObj = Float(val)
- elif valtype is long or valtype is int:
- retObj = Long(val)
- elif valtype is bool:
- retObj = Boolean(val)
- elif valtype is list:
- retObj = ArrayList()
- for i in val:
- retObj.add(pyValToJavaObj(i))
- elif valtype is tuple:
- tempList = ArrayList()
- for i in val:
- tempList.add(pyValToJavaObj(i))
- retObj = Collections.unmodifiableList(tempList)
- elif valtype is datetime.datetime:
- epoch = datetime.datetime.utcfromtimestamp(0)
- delta = val - epoch
- retObj = Date(long(delta.total_seconds()) * 1000)
- elif issubclass(valtype, dict):
- retObj = pyDictToJavaMap(val)
- elif issubclass(valtype, JavaWrapperClass):
- retObj = val.toJavaObj()
- elif issubclass(valtype, BaseGeometry):
- from com.vividsolutions.jts.io import WKTReader
- reader = WKTReader()
- retObj = reader.read(val.to_wkt())
- return retObj
-
-def javaObjToPyVal(obj, customConverter=None):
- retVal = None
- if obj is None:
- return retVal
- # handle pyjobjects
- if hasattr(obj, 'jclassname'):
- objtype = obj.jclassname
- if objtype == "java.lang.Integer":
- retVal = obj.intValue()
- elif objtype == "java.lang.Float":
- retVal = obj.floatValue()
- elif objtype == "java.lang.Long":
- retVal = obj.longValue()
- elif objtype == "java.lang.Boolean":
- retVal = bool(obj.booleanValue())
- elif objtype == "java.lang.Double":
- retVal = obj.doubleValue()
- elif objtype == "java.util.Date":
- retVal = datetime.datetime.fromtimestamp(obj.getTime() / 1000)
- elif objtype in ["com.vividsolutions.jts.geom.Geometry", "com.vividsolutions.jts.geom.GeometryCollection",
- "com.vividsolutions.jts.geom.Polygon", "com.vividsolutions.jts.geom.MultiPolygon",
- "com.vividsolutions.jts.geom.LineString", "com.vividsolutions.jts.geom.MultiLineString",
- "com.vividsolutions.jts.geom.Point", "com.vividsolutions.jts.geom.MultiPoint",
- "com.vividsolutions.jts.geom.LinearRing"] :
- retVal = wkt.loads(obj.toText())
- elif objtype in ["java.util.ArrayList", "java.util.Arrays$ArrayList"]:
- retVal = []
- size = obj.size()
- for i in range(size):
- retVal.append(javaObjToPyVal(obj.get(i), customConverter))
- elif objtype == "java.util.Collections$UnmodifiableRandomAccessList":
- tempList = []
- size = obj.size()
- for i in range(size):
- tempList.append(javaObjToPyVal(obj.get(i), customConverter))
- retVal = tuple(tempList)
- elif objtype == "java.util.HashMap":
- retVal = javaMapToPyDict(obj, customConverter)
- elif PyJavaUtil.isArray(obj):
- retVal = []
- size = Array.getLength(obj)
- for i in range(size):
- retVal.append(javaObjToPyVal(Array.get(obj, i), customConverter))
- elif customConverter is not None:
- retVal = customConverter(obj)
- if retVal is None:
- retVal = str(obj)
- # test for jep array type
- elif isinstance(obj, JEP_ARRAY_TYPE):
- retVal = []
- size = len(obj)
- for i in range(size):
- retVal.append(javaObjToPyVal(obj[i], customConverter))
- return retVal
-
class JavaWrapperClass(object):
def toJavaObj(self):
raise NotImplementedError, "Subclasses must override this method."
+# this initializes the basic handlers for Java->Python conversion and Python->Java conversion
+
+from JUtilHandler import javaBasicsToPyBasics, pyBasicsToJavaBasics, javaCollectionToPyCollection, pyCollectionToJavaCollection, javaClassToPyClass, pyClassToJavaClass
+
+pythonHandlers = [pyBasicsToJavaBasics, pyCollectionToJavaCollection, pyClassToJavaClass]
+javaHandlers = [javaBasicsToPyBasics, javaCollectionToPyCollection, javaClassToPyClass]
diff --git a/edexOsgi/com.raytheon.uf.common.python/utility/common_static/base/python/JUtilHandler.py b/edexOsgi/com.raytheon.uf.common.python/utility/common_static/base/python/JUtilHandler.py
new file mode 100644
index 0000000000..7034112f22
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.python/utility/common_static/base/python/JUtilHandler.py
@@ -0,0 +1,362 @@
+# #
+# 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.
+# #
+
+import JUtil
+
+#
+# Basic handler for Python to Java and back (this handles all the main things
+# that JUtil needs to do, but none of the special ones that should and can be
+# added if the code wants to be more powerful.
+#
+# Note : All methods that convert from Java to Python should take a custom converter, even if it is not used.
+#
+#
+#
+# SOFTWARE HISTORY
+#
+# Date Ticket# Engineer Description
+# ------------ ---------- ----------- --------------------------
+# 10/14/13 2250 mnash Initial creation of JUtil handler
+#
+#
+
+
+from java.lang import Integer, Float, Long, Boolean, String, Double, Number
+from java.util import Date
+from com.raytheon.uf.common.python import PyJavaUtil
+import datetime
+
+# Java -> Python conversion
+
+def javaBasicsToPyBasics(obj, customConverter=None):
+ '''
+ Determines the correct method to call out of the dict to convert Java basic
+ objects to Python
+ '''
+ if hasattr(obj, 'jclassname'):
+ classname = obj.jclassname
+ if classname in javaBasics :
+ return True, javaBasics[classname](obj)
+ else :
+ for javaClass in fallbackBasics :
+ if PyJavaUtil.isSubclass(obj, javaClass) :
+ return True, fallbackBasics[javaClass](obj, customConverter)
+ return False, obj
+
+def _toPythonInt(obj, customConverter=None):
+ '''
+ Turns a Java Integer to a Python int
+ '''
+ return obj.intValue()
+
+def _toPythonLong(obj, customConverter=None):
+ '''
+ Turns a Java Long to a Python long, or int,
+ depending on the architecture
+ '''
+ return obj.longValue()
+
+def _toPythonFloat(obj, customConverter=None):
+ '''
+ Turns a Java Float to a Python float
+ '''
+ return obj.floatValue()
+
+def _toPythonDouble(obj, customConverter=None):
+ '''
+ Turns a Java Double to a Python float
+ '''
+ return obj.doubleValue()
+
+def _toPythonBool(obj, customConverter=None):
+ '''
+ Turns a Java Boolean to a Python bool
+ '''
+ return bool(obj.booleanValue())
+
+def _toPythonString(obj, customConverter=None):
+ '''
+ Turns a Java String to a Python str
+ '''
+ return obj.toString()
+
+def _toPythonDatetime(obj, customConverter=None):
+ '''
+ Turns a Java Date to a Python datetime
+ '''
+ return datetime.datetime.fromtimestamp(obj.getTime() / 1000)
+
+# Python -> Java conversion
+
+def pyBasicsToJavaBasics(val):
+ '''
+ Method registered with JUtil to figure out any conversion of Python to Java.
+ Returns a default of String of that value if nothing else can be found.
+ '''
+ valtype = type(val)
+ if valtype in pythonBasics :
+ return True, pythonBasics[valtype](val)
+ return False, str(val)
+
+def _toJavaInt(val):
+ '''
+ Turns a Python int to a Java Integer, or a Long, depending the range
+ of the value.
+ '''
+ # since Python on 64 bit has larger ints, we need to do a check
+ # for compatibility with Java Integers
+ if val <= Integer.MAX_VALUE and val >= Integer.MIN_VALUE :
+ return Integer(val)
+ # outside the Java bounds for Integer, so make it a Java Long
+ return Long(val)
+
+def _toJavaFloat(val):
+ '''
+ Turns a Python float to a Java Float
+ '''
+ return Float(val)
+
+def _toJavaLong(val):
+ '''
+ Turns a Python long to a Java Long
+ '''
+ return Long(val)
+
+def _toJavaBoolean(val):
+ '''
+ Turns a Python bool to a Java Boolean
+ '''
+ return Boolean(val)
+
+def _toJavaString(val):
+ '''
+ Turns a Python str to a Java String
+ '''
+ return String(str(val))
+
+def _toJavaDate(val):
+ '''
+ Turns a Python datetime to a Java Date
+ '''
+ epoch = datetime.datetime.utcfromtimestamp(0)
+ delta = val - epoch
+ return Date(long(delta.total_seconds()) * 1000)
+
+# the dict that registers the Python data type to the method for conversion
+pythonBasics = {int:_toJavaInt, float:_toJavaFloat, long:_toJavaLong, bool:_toJavaBoolean, str:_toJavaString, unicode:_toJavaString, datetime.datetime:_toJavaDate}
+# the dict that registers the Java String of type to the method for conversion
+javaBasics = {'java.lang.Integer':_toPythonInt, 'java.lang.Float':_toPythonFloat, 'java.lang.Double':_toPythonDouble, 'java.lang.Long':_toPythonLong, 'java.lang.Boolean':_toPythonBool, 'java.lang.String':_toPythonString, 'java.util.Date':_toPythonDatetime}
+fallbackBasics = {Number:_toPythonFloat}
+'''
+The following methods will handle Python and Java collection conversion.
+'''
+from java.lang import Object
+from java.util import Collections, HashMap, LinkedHashMap, ArrayList
+from java.util import Date
+from java.lang.reflect import Array
+from java.util import List, Set, Map
+
+from collections import OrderedDict
+import jep
+
+# make a jarray to find out if we have that
+JEP_ARRAY_TYPE = type(jep.jarray(0, Object))
+
+# Java -> Python conversion
+
+def javaCollectionToPyCollection(obj, customConverter=None):
+ '''
+ Main method to register with JUtil for conversion of Java
+ collections to Python collections.
+ '''
+ if hasattr(obj, 'jclassname'):
+ classname = obj.jclassname
+ if classname in javaCollections :
+ return True, javaCollections[classname](obj, customConverter)
+ elif PyJavaUtil.isArray(obj):
+ return True, _fromJavaArray(obj, customConverter)
+ else :
+ # we have some fallback capability, if we don't specifically handle a class, we
+ # want to try some of the more common types and see if those are available for
+ # conversion
+ for javaClass in fallbackCollections :
+ if PyJavaUtil.isSubclass(obj, javaClass):
+ return True, fallbackCollections[javaClass](obj, customConverter)
+ elif isinstance(obj, JEP_ARRAY_TYPE):
+ return True, _fromJepArray(obj, customConverter)
+ return False, obj
+
+
+def _toPythonList(obj, customConverter=None):
+ '''
+ Converts to a Python list.
+ '''
+ retVal = []
+ size = obj.size()
+ for i in range(size):
+ retVal.append(JUtil.javaObjToPyVal(obj.get(i), customConverter))
+ return retVal
+
+def _toPythonTuple(obj, customConverter=None):
+ '''
+ Converts to a Python tuple.
+ '''
+ return tuple(_toPythonList(obj, customConverter))
+
+def _toPythonDict(obj, customConverter=None):
+ '''
+ Converts to a Python dict.
+ '''
+ return __toPythonDict(obj, {}, customConverter)
+
+def _toPythonSet(obj, customConverter=None):
+ '''
+ Converts to a Python set.
+ '''
+ retVal = set()
+ size = obj.size()
+ for i in range(size):
+ retVal.add(JUtil.javaObjToPyVal(obj.get(i), customConverter))
+ return retVal
+
+def _toPythonOrderedDict(obj, customConverter=None):
+ '''
+ Converts to a Python OrderedDict.
+ '''
+ return __toPythonDict(obj, OrderedDict(), customConverter)
+
+def _fromJavaArray(obj, customConverter=None):
+ '''
+ Converts from a Java array to a Python list.
+ '''
+ retVal = []
+ for i in range(size):
+ retVal.append(JUtil.javaObjToPyVal(Array.get(obj, i), customConverter))
+ return retVal
+
+def _fromJepArray(obj, customConverter=None):
+ '''
+ Converts from a Jep array to a Python list.
+ '''
+ retVal = []
+ size = len(obj)
+ for i in range(size):
+ retVal.append(JUtil.javaObjToPyVal(obj[i], customConverter))
+ return retVal
+
+def __toPythonDict(javaMap, pyDict, customConverter=None):
+ '''
+ Converts to a Python dict. Passed in the dict type, and then handles the key conversion.
+ '''
+ keys = javaMap.keySet()
+ itr = keys.iterator()
+ while itr.hasNext() :
+ key = itr.next()
+ obj = javaMap.get(key)
+ pyDict[JUtil.javaObjToPyVal(key)] = JUtil.javaObjToPyVal(obj, customConverter)
+ return pyDict
+
+# Python -> Java conversion
+
+def pyCollectionToJavaCollection(val):
+ '''
+ Main method registered with JUtil for conversion of collections in Python
+ to Java collections.
+ '''
+ valtype = type(val)
+ if valtype in pythonCollections :
+ return True, pythonCollections[valtype](val)
+ # not directly in the dict, so lets check whether they are subclasses
+ for pytype in pythonCollections :
+ if issubclass(pytype, valtype):
+ return True, pythonCollections[valtype](val)
+ return False, str(val)
+
+def _toJavaList(val):
+ '''
+ Turns a Python list to a Java List
+ '''
+ retObj = ArrayList()
+ for i in val :
+ retObj.add(JUtil.pyValToJavaObj(i))
+ return retObj
+
+def _toJavaUnmodifiableList(val):
+ '''
+ Turns a Python tuple to a Java UnmodifiableList
+ '''
+ return Collections.unmodifiableList(_toJavaList(val))
+
+def _toJavaLinkedMap(val):
+ '''
+ Turns a Python OrderedDict to a Java LinkedHashMap
+ '''
+ return __toJavaMap(val, LinkedHashMap())
+
+def _toJavaMap(val):
+ '''
+ Turns a Python dict to a Java HashMap
+ '''
+ return __toJavaMap(val, HashMap())
+
+def __toJavaMap(pyDict, jmap):
+ '''
+ Does the actual conversion of the elements inside of the dict to Map
+ '''
+ for key in pyDict:
+ jmap.put(JUtil.pyValToJavaObj(key), JUtil.pyValToJavaObj(pyDict[key]))
+ return jmap
+
+javaCollections = {'java.util.ArrayList':_toPythonList, 'java.util.Arrays$ArrayList':_toPythonList, 'java.util.Collections$UnmodifiableRandomAccessList':_toPythonTuple, 'java.util.HashMap':_toPythonDict, 'java.util.LinkedHashMap':_toPythonOrderedDict}
+pythonCollections = { list:_toJavaList, tuple:_toJavaUnmodifiableList, OrderedDict:_toJavaLinkedMap, dict:_toJavaMap }
+fallbackCollections = { List:_toPythonList, Map:_toPythonDict, Set:_toPythonSet }
+
+'''
+Handles other types of Java to Python conversion and back.
+'''
+
+def javaClassToPyClass(obj, customConverter=None):
+ '''
+ Main method to convert Java classes to Python classes that aren't already defined above.
+ Registers with JUtil
+ '''
+ if customConverter is not None :
+ return True, customConverter(obj)
+ return False, obj
+
+def pyClassToJavaClass(val):
+ '''
+ Main method that registers with JUtil to convert Python classes to Java classes.
+ '''
+ valtype = type(val)
+ for pyType in pythonClasses :
+ if issubclass(valtype, pyType):
+ return True, pythonClasses[pyType](val)
+ return False, str(val)
+
+def _toJavaClass(val):
+ '''
+ Utilizes the JUtil.JavaWrapperClass object and its corresponding
+ toJavaObj() method that returns a Java object.
+ '''
+ return val.toJavaObj()
+
+# registers the data type for conversion to a Java class.
+pythonClasses = {JUtil.JavaWrapperClass:_toJavaClass}
diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/IRegistryRequestService.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/IRegistryRequestService.java
deleted file mode 100644
index ed767bb84e..0000000000
--- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/IRegistryRequestService.java
+++ /dev/null
@@ -1,57 +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.registry;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPBinding.Style;
-
-/**
- *
- * Web service interface accessible to process Thrift serialized server requests
- *
- *
- *
- * @author bphillip
- * @version 1
- */
-@WebService(serviceName = "RegistryRequestService")
-@SOAPBinding(style = Style.RPC)
-public interface IRegistryRequestService {
-
- /**
- * Process the Thrift serialized request and return the Thrift serialized
- * response
- *
- * @param data
- * The Thrift serialized request
- * @return The Thrift serialized response
- */
- @WebMethod
- public byte[] request(byte[] data);
-}
diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/RegistryRequestService.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/RegistryRequestService.java
deleted file mode 100644
index dcb395fb3e..0000000000
--- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/RegistryRequestService.java
+++ /dev/null
@@ -1,80 +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.registry;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-
-/**
- *
- *
- * Service class for submitting registry requests to the EDEX ebxml registry via
- * JAX-WS
- *
- *
*
* @author bphillip
* @version 1
*/
@Transactional
+@Path(IRegistryDataAccessService.DATA_ACCESS_PATH_PREFIX)
public class RegistryDataAccessService implements IRegistryDataAccessService {
/** The logger */
@@ -113,6 +112,10 @@ public class RegistryDataAccessService implements IRegistryDataAccessService {
/** Lifecyclemanager */
private LifecycleManager lcm;
+ public RegistryDataAccessService() {
+
+ }
+
/**
* @see
* com.raytheon.uf.common.registry.services.rest.IRegistryDataAccessService
@@ -120,7 +123,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService {
*/
@Override
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "getRegistryObjectIds/{objectType}")
+ @Path("getRegistryObjectIds/{objectType}")
public RestCollectionResponse getRegistryObjectIdsOfType(
@PathParam("objectType") String objectType) {
statusHandler.info("Getting registry object ids of type [" + objectType
@@ -133,7 +136,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService {
@Override
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "getQueries")
+ @Path("getQueries")
public String getValidQueries() {
statusHandler.debug("Getting valid queries...");
List ids = queryDefinitionDao.getQueryIds();
@@ -146,7 +149,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService {
@Override
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "getParametersForQuery/{queryId}")
+ @Path("getParametersForQuery/{queryId}")
public String getParametersForQuery(@PathParam("queryId") String queryId) {
statusHandler.debug("Getting query parameters for query: " + queryId
+ "...");
@@ -168,7 +171,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService {
*/
@Override
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "removeSubscriptionsFor/{siteId}")
+ @Path("removeSubscriptionsFor/{siteId}")
public void removeSubscriptionsForSite(@PathParam("siteId") String siteId) {
statusHandler.info("Removing subscriptions for: " + siteId);
List subscriptions = registryObjectDao
@@ -205,7 +208,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService {
*/
@Override
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "getSubscriptions")
+ @Path("getSubscriptions")
public String getSubscriptions() {
String[] slotNames = new String[] { "name", "owner", "dataSetName",
"provider", "dataSetType", "route", "active", "groupName",
@@ -245,7 +248,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService {
*/
@Override
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "backupSubscription/{subscriptionName}")
+ @Path("backupSubscription/{subscriptionName}")
public String backupSubscription(
@PathParam("subscriptionName") String subscriptionName) {
StringBuilder response = new StringBuilder();
@@ -288,7 +291,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService {
*/
@Override
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "backupAllSubscriptions/")
+ @Path("backupAllSubscriptions/")
public String backupAllSubscriptions() {
StringBuilder response = new StringBuilder();
List subs = registryObjectDao
@@ -310,7 +313,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService {
*/
@Override
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "restoreSubscription/{subscriptionName}")
+ @Path("restoreSubscription/{subscriptionName}")
public String restoreSubscription(
@PathParam("subscriptionName") String subscriptionName) {
StringBuilder response = new StringBuilder();
@@ -367,7 +370,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService {
*/
@Override
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "restoreSubscriptions/")
+ @Path("restoreSubscriptions/")
public String restoreSubscriptions() {
StringBuilder response = new StringBuilder();
if (SUBSCRIPTION_BACKUP_DIR.exists()) {
@@ -391,7 +394,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService {
* .clearSubscriptionBackupFiles()
*/
@GET
- @Path(DATA_ACCESS_PATH_PREFIX + "clearSubscriptionBackupFiles/")
+ @Path("clearSubscriptionBackupFiles/")
public String clearSubscriptionBackupFiles() {
StringBuilder response = new StringBuilder();
if (SUBSCRIPTION_BACKUP_DIR.exists()) {
diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/web/RegistryFederationStatus.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/web/RegistryFederationStatus.java
new file mode 100644
index 0000000000..4643169c6a
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/web/RegistryFederationStatus.java
@@ -0,0 +1,446 @@
+/**
+ * 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.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.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.QueryLanguages;
+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.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.datadelivery.registry.replication.RegistryReplicationManager;
+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;
+
+/**
+ *
+ * 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
+ *
+ *
+ * @author bphillip
+ * @version 1
+ **/
+@Path(RegistryFederationStatus.REGISTRY_FEDERATION_STATUS_PATH)
+@Transactional
+public class RegistryFederationStatus {
+
+ /** The path to these set of services */
+ protected static final String REGISTRY_FEDERATION_STATUS_PATH = "/status/";
+
+ /** The logger instance */
+ private static final IUFStatusHandler statusHandler = UFStatus
+ .getHandler(RegistryFederationStatus.class);
+
+ /** Comparator to sort registry instances */
+ private static final Comparator REGISTRY_COMPARATOR = new Comparator() {
+ @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 RegistryReplicationManager replicationManager;
+
+ /** 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");
+
+ /**
+ * 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() {
+ return System.getenv("EBXML_REGISTRY_FEDERATION_ENABLED");
+ }
+
+ /**
+ * Gets if this registry is processing registry replication subscriptions
+ *
+ * @return The value of the EBXML_REGISTRY_SUBSCRIPTIONS_ENABLED environment
+ * variable
+ */
+ @GET
+ @Path("isProcessingSubscriptions")
+ public String isProcessingSubscriptions() {
+ return System.getenv("EBXML_REGISTRY_SUBSCRIPTIONS_ENABLED");
+ }
+
+ /**
+ * Gets information about this registry
+ *
+ * @return Information pertaining to the local registry
+ */
+ @GET
+ @Path("getMyRegistryInfo")
+ public String getMyRegistryInfo() {
+ StringBuilder builder = new StringBuilder();
+ RegistryType myRegistry = registryDao
+ .getRegistryByBaseURL(RegistryUtil.LOCAL_REGISTRY_ADDRESS);
+ appendRegistryInfo(myRegistry, builder);
+ return builder.toString();
+
+ }
+
+ /**
+ * 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 {
+ 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 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();
+ }
+
+ /**
+ * 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() {
+ StringBuilder builder = new StringBuilder();
+ if (this.replicationManager.getServers() != null
+ && !CollectionUtil.isNullOrEmpty(this.replicationManager
+ .getServers().getRegistryReplicationServers())) {
+ List registries = new ArrayList();
+ for (NotificationHostConfiguration hostConfig : this.replicationManager
+ .getServers().getRegistryReplicationServers()) {
+
+ SlotType queryLanguageSlot = new SlotType(
+ QueryConstants.QUERY_LANGUAGE, new StringValueType(
+ QueryLanguages.HQL));
+ SlotType queryExpressionSlot = new SlotType(
+ QueryConstants.QUERY_EXPRESSION, new StringValueType(
+ "FROM SubscriptionType sub where sub.id like 'Replication Subscription for%"
+ + RegistryUtil.LOCAL_REGISTRY_ADDRESS
+ + "%'"));
+ QueryType query = new QueryType();
+ query.setQueryDefinition(CanonicalQueryTypes.ADHOC_QUERY);
+ query.getSlot().add(queryLanguageSlot);
+ query.getSlot().add(queryExpressionSlot);
+
+ QueryRequest request = new QueryRequest();
+ request.setResponseOption(new ResponseOptionType(
+ QueryReturnTypes.REGISTRY_OBJECT, true));
+ request.setId("Replication Subscription Verification Query");
+ request.setQuery(query);
+ try {
+ if (!registrySoapServices
+ .getQueryServiceForHost(
+ hostConfig.getRegistryBaseURL())
+ .executeQuery(request).getRegistryObjects()
+ .isEmpty()) {
+ RegistryType registry = registryDao
+ .getRegistryByBaseURL(hostConfig
+ .getRegistryBaseURL());
+ if (registry != null) {
+ registries.add(registry);
+ }
+ }
+ } catch (Exception e) {
+ statusHandler.error("Error querying remote registry", e);
+ }
+
+ }
+ Collections.sort(registries, REGISTRY_COMPARATOR);
+ for (RegistryObjectType reg : registries) {
+ appendRegistryInfo((RegistryType) reg, builder);
+ }
+ }
+ return builder.toString();
+ }
+
+ /**
+ * 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() {
+ StringBuilder builder = new StringBuilder();
+ List registries = new ArrayList();
+ 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();
+ }
+
+ /**
+ * Gets the list of object types that are currently being replicated
+ *
+ * @return The object list
+ */
+ @GET
+ @Path("getObjectTypesReplicated")
+ public String getObjectTypesReplicated() {
+ StringBuilder builder = new StringBuilder();
+ for (String objectType : RegistryReplicationManager.getObjectTypes()) {
+ builder.append(objectType).append(StringUtil.NEWLINE);
+ }
+ return builder.toString();
+ }
+
+ /**
+ * 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) {
+ StringBuilder builder = new StringBuilder();
+ RegistryType registry = registryDao.getById(registryId);
+ if (registry == null) {
+ builder.append("Registry [" + registryId
+ + "] not in federation. Unable to synchronize.");
+ } else {
+ try {
+ replicationManager.synchronizeRegistryWithFederation(registry
+ .getBaseURL());
+ } catch (Exception e) {
+ statusHandler.error("Error synchronizing registry!", e);
+ builder.append("Error synchronizing registry [" + registryId
+ + "]: " + e.getLocalizedMessage());
+ }
+ }
+ return builder.toString();
+ }
+
+ /**
+ * Subscribes to replication notifications from the specified registry
+ *
+ * @param registryId
+ * The ID of the registry to subscribe to
+ * @return Status message
+ */
+ @GET
+ @Path("subscribeToRegistry/{registryId}")
+ public String subscribeToRegistry(@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 submit subscriptions.");
+ } else {
+ RegistryType localRegistry = registryDao
+ .getRegistryByBaseURL(RegistryUtil.LOCAL_REGISTRY_ADDRESS);
+
+ NotificationHostConfiguration config = new NotificationHostConfiguration(
+ registry.getId(), registry.getId(), registry.getBaseURL());
+ replicationManager.submitSubscriptionsToHost(config, localRegistry);
+ builder.append("Successfully subscribed to registry [" + registryId
+ + "]");
+ this.replicationManager.addNotificationServer(config);
+ replicationManager.saveNotificationServers();
+ }
+ return builder.toString();
+ }
+
+ /**
+ * 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) {
+ 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 + "]");
+ replicationManager.removeNotificationServer(registry.getBaseURL());
+ replicationManager.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).append(",");
+ builder.append(registry.getBaseURL()).append(",");
+ builder.append(registry.getConformanceProfile()).append(",");
+ builder.append(registry.getSpecificationVersion());
+ builder.append(StringUtil.NEWLINE);
+ }
+
+ public void setReplicationManager(
+ RegistryReplicationManager replicationManager) {
+ this.replicationManager = replicationManager;
+ }
+
+ 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;
+ }
+}
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/META-INF/MANIFEST.MF
index 1a9b10b1ff..41475792dd 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/META-INF/MANIFEST.MF
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/META-INF/MANIFEST.MF
@@ -34,8 +34,7 @@ Require-Bundle: com.raytheon.uf.common.registry.schemas.ebxml;bundle-version="1.
com.raytheon.uf.common.datadelivery.request;bundle-version="1.0.0",
javax.mail;bundle-version="1.0.0",
org.apache.commons.validator;bundle-version="1.2.0",
- com.sun.xml.bind;bundle-version="1.0.0",
- org.reflections;bundle-version="0.9.9"
+ com.sun.xml.bind;bundle-version="1.0.0"
Export-Package: com.raytheon.uf.edex.registry.ebxml.acp,
com.raytheon.uf.edex.registry.ebxml.dao,
com.raytheon.uf.edex.registry.ebxml.exception,
@@ -45,6 +44,7 @@ Export-Package: com.raytheon.uf.edex.registry.ebxml.acp,
com.raytheon.uf.edex.registry.ebxml.services.lifecycle,
com.raytheon.uf.edex.registry.ebxml.services.notification,
com.raytheon.uf.edex.registry.ebxml.services.query,
+ com.raytheon.uf.edex.registry.ebxml.services.query.plugins,
com.raytheon.uf.edex.registry.ebxml.services.validator,
com.raytheon.uf.edex.registry.ebxml.services.validator.types,
com.raytheon.uf.edex.registry.ebxml.util,
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-impl.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-impl.xml
index 204a44b0b3..d8d09cac58 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-impl.xml
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-impl.xml
@@ -44,6 +44,7 @@
+
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-querytypes.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-querytypes.xml
index fbdbdfd0d8..1637b27e5e 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-querytypes.xml
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-querytypes.xml
@@ -139,6 +139,7 @@
value="urn:oasis:names:tc:ebxml-regrep:query:GetReferencedObject" />
+
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-subscription.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-subscription.xml
index e8d76be31f..d0d5c6c7ef 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-subscription.xml
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-subscription.xml
@@ -5,6 +5,7 @@
+
-
-
+
+
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-webservices.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-webservices.xml
index 9b2254dc37..de004cce8e 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-webservices.xml
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-webservices.xml
@@ -2,6 +2,12 @@
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">
+
+
+
+
+
+
@@ -21,6 +28,7 @@
+
@@ -74,15 +82,6 @@
-
-
-
-
-
-
-
-
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/resources/com.raytheon.uf.edex.registry.ebxml.properties b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/resources/com.raytheon.uf.edex.registry.ebxml.properties
index 54063de7cc..bac6c8310d 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/resources/com.raytheon.uf.edex.registry.ebxml.properties
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/resources/com.raytheon.uf.edex.registry.ebxml.properties
@@ -11,4 +11,7 @@ ebxml-federation-sync-threads=3
ebxml-email.enabled=false
# The maximum number of events that will be batched and send
# in a registry replication notification
-ebxml-notification-batch-size=50
\ No newline at end of file
+ebxml-notification-batch-size=50
+# Configuration of thread pool used to handle web service requests
+ebxml-webserver-min-threads=2
+ebxml-webserver-max-threads=10
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/RegistryRemoteRequestWrapper.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/RegistryRemoteRequestWrapper.java
index 9b82aaf745..2dc99b9112 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/RegistryRemoteRequestWrapper.java
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/RegistryRemoteRequestWrapper.java
@@ -21,9 +21,6 @@ package com.raytheon.uf.edex.registry.ebxml;
import java.io.ByteArrayInputStream;
-import javax.jws.WebService;
-
-import com.raytheon.uf.common.registry.IRegistryRequestService;
import com.raytheon.uf.edex.auth.RemoteRequestRouteWrapper;
/**
@@ -37,18 +34,16 @@ import com.raytheon.uf.edex.auth.RemoteRequestRouteWrapper;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 5/3/2013 1948 bphillip Initial implementation
- * 7/26/2031 2232 mpduff Don't override executeThrift.
+ * 7/26/2013 2232 mpduff Don't override executeThrift.
+ * 10/30/2013 1538 bphillip Removed unused IRegistryRequestService interface
*
*
*
* @author bphillip
* @version 1
*/
-@WebService(endpointInterface = "com.raytheon.uf.common.registry.IRegistryRequestService")
-public class RegistryRemoteRequestWrapper extends RemoteRequestRouteWrapper
- implements IRegistryRequestService {
+public class RegistryRemoteRequestWrapper extends RemoteRequestRouteWrapper {
- @Override
public byte[] request(byte[] data) {
return executeThrift(new ByteArrayInputStream(data));
}
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/lifecycle/ObjectReferenceResolver.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/lifecycle/ObjectReferenceResolver.java
index 7c8d94568d..10b7ab92d4 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/lifecycle/ObjectReferenceResolver.java
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/lifecycle/ObjectReferenceResolver.java
@@ -63,6 +63,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil;
* ------------ ---------- ----------- --------------------------
* 8/5/2013 2191 bphillip Initial implementation
* 10/8/2013 1682 bphillip Added getReferenced objects methods
+ * 10/30/2013 1538 bphillip Changed to use non-static rest/soap clients
*
*
* @author bphillip
@@ -86,6 +87,8 @@ public class ObjectReferenceResolver {
/** Validator for validating REST endpoint addresses */
private UrlValidator urlValidator = new UrlValidator();
+ private RegistryRESTServices registryRestClient;
+
/** Cache holding the fields in each class that are object references */
private static LoadingCache, List> OBJECT_REFERENCE_FIELD_CACHE = CacheBuilder
.newBuilder().expireAfterAccess(1, TimeUnit.MINUTES)
@@ -386,8 +389,7 @@ public class ObjectReferenceResolver {
RegistryObjectType retVal = null;
if (urlValidator.isValid(ref)) {
- Object restResponse = RegistryRESTServices
- .accessXMLRestService(ref);
+ Object restResponse = registryRestClient.accessXMLRestService(ref);
if (restResponse instanceof QueryResponse) {
QueryResponse queryResponse = (QueryResponse) restResponse;
if (responseOk(queryResponse)) {
@@ -459,4 +461,8 @@ public class ObjectReferenceResolver {
this.queryManager = queryManager;
}
+ public void setRegistryRestClient(RegistryRESTServices registryRestClient) {
+ this.registryRestClient = registryRestClient;
+ }
+
}
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/NotificationListenerFactory.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/NotificationListenerFactory.java
index fb37c5f3e0..a6bfad0cc8 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/NotificationListenerFactory.java
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/NotificationListenerFactory.java
@@ -31,6 +31,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType;
import com.google.common.annotations.VisibleForTesting;
import com.raytheon.uf.common.registry.EbxmlNamespaces;
import com.raytheon.uf.common.registry.constants.DeliveryMethodTypes;
+import com.raytheon.uf.common.registry.services.RegistrySOAPServices;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.edex.registry.ebxml.services.notification.listeners.EmailNotificationListener;
@@ -48,6 +49,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.notification.listeners.WebSe
* ------------ ---------- ----------- --------------------------
* Apr 17, 2013 1672 djohnson Initial creation
* 10/20/2013 1682 bphillip Added synchronous notification delivery
+ * 10/30/2013 1538 bphillip Changed to use non-static web service clients
*
*
*
@@ -94,16 +96,22 @@ public class NotificationListenerFactory implements
}
}
+ /** Email sender */
private final EmailSender emailSender;
+ /** Registry soap service client */
+ private final RegistrySOAPServices registrySoapClient;
+
/**
* Constructor.
*
* @param emailSender
* the email sender
*/
- public NotificationListenerFactory(EmailSender emailSender) {
+ public NotificationListenerFactory(EmailSender emailSender,
+ RegistrySOAPServices registrySoapClient) {
this.emailSender = emailSender;
+ this.registrySoapClient = registrySoapClient;
}
/**
@@ -134,7 +142,8 @@ public class NotificationListenerFactory implements
@VisibleForTesting
NotificationListener getWebServiceNotificationListener(
final NotificationDestination destination) {
- return new WebServiceNotificationListener(destination);
+ return new WebServiceNotificationListener(destination,
+ registrySoapClient);
}
/**
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/NotificationListenerImpl.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/NotificationListenerImpl.java
index c42891d8eb..3b8e8e736c 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/NotificationListenerImpl.java
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/NotificationListenerImpl.java
@@ -88,6 +88,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
* 9/11/2013 2254 bphillip Cleaned up handling of notifications and removed unneccessary code
* 10/20/2013 1682 bphillip Added synchronous notification delivery
* 10/23/2013 1538 bphillip Added log message denoting when processing is complete and time duration
+ * 10/30/2013 1538 bphillip Changed to use non-static registry soap service client
*
*
*
@@ -117,6 +118,9 @@ public class NotificationListenerImpl implements NotificationListener {
/** Data access object for getting RegistryType objects */
private RegistryDao registryDao;
+ /** Registry soap service client */
+ private RegistrySOAPServices registrySoapClient;
+
@Override
public void onNotification(NotificationType notification) {
long startTime = TimeUtil.currentTimeMillis();
@@ -250,7 +254,7 @@ public class NotificationListenerImpl implements NotificationListener {
Collection objIds, Mode mode) throws EbxmlRegistryException {
try {
// Get a the remote query service
- QueryManager queryManager = RegistrySOAPServices
+ QueryManager queryManager = registrySoapClient
.getQueryServiceForHost(clientBaseURL);
// Create a query to get the current state of the affected objects
QueryRequest queryRequest = createGetCurrentStateQuery(
@@ -343,4 +347,9 @@ public class NotificationListenerImpl implements NotificationListener {
public void setRegistryDao(RegistryDao registryDao) {
this.registryDao = registryDao;
}
+
+ public void setRegistrySoapClient(RegistrySOAPServices registrySoapClient) {
+ this.registrySoapClient = registrySoapClient;
+ }
+
}
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/listeners/WebServiceNotificationListener.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/listeners/WebServiceNotificationListener.java
index 60d0742319..f97e9e3d00 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/listeners/WebServiceNotificationListener.java
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/listeners/WebServiceNotificationListener.java
@@ -50,6 +50,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil;
* Apr 16, 2013 1672 djohnson Extracted from RegistryNotificationManager.
* 8/28/2013 1538 bphillip Changed to catch a Throwable instead of just EbxmlRegistryException
* 10/20/2013 1682 bphillip Added synchronous notification delivery
+ * 10/30/2013 1538 bphillip Changed to use non-static soap service client
*
*
*
@@ -63,13 +64,19 @@ public class WebServiceNotificationListener implements NotificationListener {
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(WebServiceNotificationListener.class);
+ /** The destination of notifications sent via this listener */
private final String destination;
+ /** Registry soap service client */
+ private RegistrySOAPServices registrySoapClient;
+
/**
* @param destination
*/
- public WebServiceNotificationListener(NotificationDestination destination) {
+ public WebServiceNotificationListener(NotificationDestination destination,
+ RegistrySOAPServices registrySoapClient) {
this.destination = destination.getDestination();
+ this.registrySoapClient = registrySoapClient;
}
/**
@@ -120,8 +127,8 @@ public class WebServiceNotificationListener implements NotificationListener {
RegistryServiceException, MsgRegistryException {
statusHandler.info("Sending notification [" + notification.getId()
+ "]");
- RegistrySOAPServices.getNotificationListenerServiceForUrl(
- serviceAddress).synchronousNotification(notification);
+ registrySoapClient.getNotificationListenerServiceForUrl(serviceAddress)
+ .synchronousNotification(notification);
statusHandler.info("Notification [" + notification.getId() + "] sent!");
}
}
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryManagerImpl.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryManagerImpl.java
index a171a8e307..4af077512e 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryManagerImpl.java
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryManagerImpl.java
@@ -122,6 +122,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
* 10/8/2013 1682 bphillip Refactored querying
* 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
*
*
*
@@ -192,6 +193,8 @@ public class QueryManagerImpl implements QueryManager, ApplicationContextAware {
*/
private ObjectReferenceResolver referenceResolver;
+ private RegistrySOAPServices registrySoapClient;
+
/**
* Creates a new QueryManagerImpl
*/
@@ -795,7 +798,7 @@ public class QueryManagerImpl implements QueryManager, ApplicationContextAware {
statusHandler.info("Submitting federated query to ["
+ registryToQuery.getId() + "] at ["
+ registryToQuery.getBaseURL() + "]...");
- return RegistrySOAPServices.getQueryServiceForHost(
+ return registrySoapClient.getQueryServiceForHost(
registryToQuery.getBaseURL()).executeQuery(queryRequest);
}
@@ -859,4 +862,8 @@ public class QueryManagerImpl implements QueryManager, ApplicationContextAware {
this.sessionFactory = sessionFactory;
}
+ public void setRegistrySoapClient(RegistrySOAPServices registrySoapClient) {
+ this.registrySoapClient = registrySoapClient;
+ }
+
}
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetReferencedObject.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetReferencedObject.java
index c9c0175b84..60ba241641 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetReferencedObject.java
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetReferencedObject.java
@@ -57,6 +57,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil;
* ------------ ---------- ----------- --------------------------
* 9/18/2013 1705 bphillip Initial implementation
* 10/8/2013 1682 bphillip Refactored querying
+ * 10/30/2013 1538 bphillip Changed to use non-static soap service client
*
*
* @author bphillip
@@ -67,6 +68,9 @@ public class GetReferencedObject extends RegistryQueryPlugin {
/** Object used to resolve object references */
private ObjectReferenceResolver referenceResolver;
+ /** Registry soap service client */
+ private RegistrySOAPServices registrySoapClient;
+
@Override
@WebMethod(action = EXECUTE_QUERY_ACTION)
@WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse")
@@ -108,7 +112,7 @@ public class GetReferencedObject extends RegistryQueryPlugin {
query.setQuery(queryObj);
query.setResponseOption(new ResponseOptionType(
QueryReturnTypes.REGISTRY_OBJECT, true));
- QueryManager remoteQueryManager = RegistrySOAPServices
+ QueryManager remoteQueryManager = registrySoapClient
.getQueryServiceForHost(remoteAddress);
QueryResponse remoteResponse = remoteQueryManager
@@ -130,4 +134,8 @@ public class GetReferencedObject extends RegistryQueryPlugin {
this.referenceResolver = referenceResolver;
}
+ public void setRegistrySoapClient(RegistrySOAPServices registrySoapClient) {
+ this.registrySoapClient = registrySoapClient;
+ }
+
}
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/QueryProtocolRestService.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/QueryProtocolRestService.java
index cb97c2c478..df1981b448 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/QueryProtocolRestService.java
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/QueryProtocolRestService.java
@@ -66,12 +66,13 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil;
* 4/19/2013 1931 bphillip Initial implementation
* 5/21/2013 2022 bphillip Added interface and moved constants
* 10/8/2013 1682 bphillip Refactored to use parameter definitions from the registry
+ * 10/30/2013 1538 bphillip Changed root REST service path
*
*
* @author bphillip
* @version 1
*/
-@Path("/rest/search")
+@Path("/search")
@Service
@Transactional
public class QueryProtocolRestService implements IQueryProtocolRestService {
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RegistryObjectsRestService.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RegistryObjectsRestService.java
index 96bd37b01c..a8fa407dc4 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RegistryObjectsRestService.java
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RegistryObjectsRestService.java
@@ -73,12 +73,13 @@ import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao;
* ------------ ---------- ----------- --------------------------
* 4/19/2013 1931 bphillip Initial implementation
* 5/21/2013 2022 bphillip Added interface
+ * 10/30/2013 1538 bphillip Changed root REST service path
*
*
* @author bphillip
* @version 1
*/
-@Path("/rest/registryObjects/{objectId}")
+@Path("/registryObjects/{objectId}")
@Service
@Transactional
public class RegistryObjectsRestService implements IRegistryObjectsRestService {
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RepositoryItemsRestService.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RepositoryItemsRestService.java
index 9bc3a88b3b..aa1ea5c5d3 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RepositoryItemsRestService.java
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RepositoryItemsRestService.java
@@ -46,12 +46,13 @@ import com.raytheon.uf.edex.registry.ebxml.dao.ExtrinsicObjectDao;
* ------------ ---------- ----------- --------------------------
* 4/19/2013 1931 bphillip Initial implementation
* 5/21/2013 2022 bphillip Added interface and changed method name
+ * 10/30/2013 1538 bphillip Changed root REST service path
*
*
* @author bphillip
* @version 1
*/
-@Path("/rest/repositoryItems/{repositoryItemId}")
+@Path("/repositoryItems/{repositoryItemId}")
@Service
@Transactional
public class RepositoryItemsRestService implements IRepositoryItemsRestService {
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/RegistrySubscriptionBackup.html b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/RegistrySubscriptionBackup.html
index 9c6bb8c14d..c9b88c4a72 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/RegistrySubscriptionBackup.html
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/RegistrySubscriptionBackup.html
@@ -119,7 +119,7 @@
}
function callRESTService(func){
- var url = "http://"+window.location.host+"/rest/dataAccess/"+func;
+ var url = "http://"+window.location.host+"/dataDelivery/dataAccess/"+func;
var client = new XMLHttpRequest();
client.open("GET", url, false);
client.setRequestHeader("Content-Type", "text/plain");
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/WEB-INF/web.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/WEB-INF/web.xml
index 8d6af6a551..906d5501e8 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/WEB-INF/web.xml
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/WEB-INF/web.xml
@@ -11,21 +11,19 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
Data Delivery Web Services
-
-
- webAppRootKey
- registryEbxml
-
-
+
+
+ webAppRootKey
+ registryEbxml
+
+
contextConfigLocation/webServiceBeans.xml
-
- org.springframework.web.context.ContextLoaderListener
-
+ org.springframework.web.context.ContextLoaderListener
@@ -50,12 +48,16 @@
org.apache.cxf.transport.servlet.CXFServletstatic-welcome-file
- /RegistryUserMenu.html
+ /registry/RegistryInterface.htmlstatic-resources-list.*\.html .*\.js .*\.css
+
+ disable-address-updates
+ true
+ 1
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/dataDeliveryUtil.js b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/dataDeliveryUtil.js
index 5cb554ea33..99a72fc2bf 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/dataDeliveryUtil.js
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/dataDeliveryUtil.js
@@ -261,7 +261,7 @@ function enableElement(elemName){
*/
function splitArray(data){
if (data == null){
- return new Array();
+ return new Array();
}else{
var tokens = String(data).split(",")
return tokens
@@ -271,7 +271,7 @@ function splitArray(data){
/*
* Adds an entry into the select box with the provided name
*/
-function addOptionToList(selectBoxName,text,value){
+function addOptionToList(selectBoxName,text,value){
var selectBox = document.getElementById(selectBoxName)
var optn = document.createElement("OPTION");
optn.text = text;
@@ -279,6 +279,19 @@ function addOptionToList(selectBoxName,text,value){
selectBox.options.add(optn);
}
+/*
+ * Removes an entry from the select box with the provided name
+ */
+function removeOptionFromList(selectBoxName,value){
+ var selectBox = document.getElementById(selectBoxName)
+ for(var i = 0; i < selectBox.options.length;i++){
+ if(selectBox.options[i].value == value){
+ selectBox.options.remove(selectBox.options[i])
+ break;
+ }
+ }
+}
+
/*
* Sets the currently selected index of a select box element with
* the given name
@@ -916,5 +929,4 @@ Array.prototype.contains = function(item){
return this.indexOf(item)!=-1
}
-
-
+
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/RegistryInterface.html b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/RegistryInterface.html
index e5774bfc69..1337ef3cc2 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/RegistryInterface.html
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/RegistryInterface.html
@@ -51,13 +51,14 @@ Date Ticket# Engineer Description
+
EDEX EBXML Registry Interface
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/federation/status.html b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/federation/status.html
new file mode 100644
index 0000000000..f061c21e30
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/federation/status.html
@@ -0,0 +1,207 @@
+
+
+
+
+
+
+
+
+ Federation Status
+
+
+
+
Federation Status
+
+
+
+
+
Federated:
+
[Unknown]
+
+
+
Processing Subscriptions:
+
[Unknown]
+
+
+
My Registry ID:
+
[Unknown]
+
+
+
+
+
+
+
+
Resubmit Subscriptions To:
+
+
+
+
+
Synchronize with Registry:
+
+
+
+
+
Subscribe To Registry:
+
+
+
+
+
Unsubscribe From Registry:
+
+
+
+
+
+
+My Registry is Subscribed To:
+
+
+
+
+
+
+
+Registries Subscribing to My Registry:
+
+
+
+
+Federation Members:
+
+
+
+
+
+Object Types Currently Replicated:
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/navigation.html b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/navigation.html
index 6037bbe008..b6c188b673 100644
--- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/navigation.html
+++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/navigation.html
@@ -10,11 +10,11 @@ an export license or other authorization.
Contractor Name: Raytheon Company
Contractor Address: 6825 Pine Street, Suite 340
- Mail Stop B8
+ Mail Stop B8
Omaha, NE 68106
402.291.0100
-See the AWIPS II Master Rights File ("Master Rights File.pdf") for
+See the AWIPS II Master Rights File ("Master Rights File.pdf") for
further licensing information.
-->
@@ -35,7 +35,7 @@ Date Ticket# Engineer Description
-
+
NAVIGATION LINKS
- Query Interface
+ Query Interface
- Subscription Backup
+ Subscription Backup
+
+ Federation Status
-
+