diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/NotificationTableComp.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/NotificationTableComp.java index 9cce3e06b1..955da9fbb4 100644 --- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/NotificationTableComp.java +++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/NotificationTableComp.java @@ -22,6 +22,7 @@ package com.raytheon.uf.viz.datadelivery.notification; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.TimeZone; @@ -81,6 +82,7 @@ import com.raytheon.uf.viz.datadelivery.utils.NotificationHandler; * Aug 30, 2013 2314 mpduff Sort the table data on load. * Sep 16, 2013 2375 mpduff Removed initial sorting. * Sep 26, 2013 2417 mpduff Fix the find all row selection. + * Oct 15, 2013 2451 skorolev Get highlighted rows after message update. * * * @author lvenable @@ -200,6 +202,9 @@ public class NotificationTableComp extends TableComp implements ITableFind { /** Count of messages receieved when the dialog is paused. */ private int messageReceivedWhilePausedCount = 0; + /** Highlighted row ids */ + private Set selectedRowIds = new HashSet(); + /** * Constructor. * @@ -231,13 +236,14 @@ public class NotificationTableComp extends TableComp implements ITableFind { */ private void init() { - startIndex = 0; - endIndex = pageConfig - 1; - pImage = new PriorityImages(this.getShell()); pImage.setPriorityDisplay(PriorityDisplay.ColorNumName); createColumns(); + + startIndex = 0; + endIndex = pageConfig - 1; + createBottomPageControls(); } @@ -1150,7 +1156,6 @@ public class NotificationTableComp extends TableComp implements ITableFind { if (indices != null) { if (indices.length > 0) { for (int index : indices) { - if (index >= startIndex && index <= endIndex) { if (startIndex == 0) { highlightIndex = index; @@ -1175,6 +1180,30 @@ public class NotificationTableComp extends TableComp implements ITableFind { table.select(indicesArr); } + } else { + // Highlight the rows which was selected on the table page. + if (!selectedRowIds.isEmpty()) { + Set ids = new HashSet(); + for (int i = 0; i < filteredTableList.getDataArray().size(); i++) { + NotificationRowData row = filteredTableList.getDataArray() + .get(i); + int idx = row.getId(); + if (selectedRowIds.contains(idx)) { + ids.add(i); + } + } + + int[] hlts = new int[ids.size()]; + int counter = 0; + + Iterator itr = ids.iterator(); + while (itr.hasNext()) { + hlts[counter] = itr.next(); + ++counter; + } + + table.select(hlts); + } } updateColumnSortImage(); @@ -1204,6 +1233,14 @@ public class NotificationTableComp extends TableComp implements ITableFind { protected void handleTableSelection(SelectionEvent e) { if (tableChangeCallback != null) { tableChangeCallback.tableSelection(); + int[] indices = table.getSelectionIndices(); + selectedRowIds.clear(); + // Extract selected notification ids from the table page + for (int index : indices) { + NotificationRowData rowData = filteredTableList + .getDataRow(index); + selectedRowIds.add(rowData.getId()); + } } } @@ -1235,6 +1272,9 @@ public class NotificationTableComp extends TableComp implements ITableFind { selectedPage = Integer.parseInt(selection); } + // Clean highlighted selections on the page + selectedRowIds.clear(); + // Calculate indices if (selectedPage >= 1) { diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/ParameterLevelsConverter.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/ParameterLevelsConverter.java index a8b0f981f6..441662a6c5 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/ParameterLevelsConverter.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/ParameterLevelsConverter.java @@ -3,31 +3,31 @@ package com.raytheon.uf.common.datadelivery.registry; import java.util.ArrayList; import java.util.List; -import com.raytheon.uf.common.registry.ebxml.slots.SlotConverter; - import oasis.names.tc.ebxml.regrep.xsd.rim.v4.CollectionValueType; 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.ValueType; +import com.raytheon.uf.common.registry.constants.CollectionTypes; +import com.raytheon.uf.common.registry.ebxml.slots.SlotConverter; + /** - * A SlotConverter implementation for converting a - * Levels Object into a RegistryObject slot type. A collection - * slot type will be created and it's elements will contain the - * RegistryObject id of the ParameterLevel Objects that would be - * created from the Levels Object. The type for the + * A SlotConverter implementation for converting a Levels Object + * into a RegistryObject slot type. A collection slot type will be created and + * it's elements will contain the RegistryObject id of the ParameterLevel + * Objects that would be created from the Levels Object. The type for the * collectionSlot will be set to 'Set'. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * May 15, 2012 455        jspinks     Initial creation
- *
+ * 
  * 
- * + * * @author jspinks * @version 1.0 * @@ -43,14 +43,13 @@ public class ParameterLevelsConverter implements SlotConverter { * The name to use for each SlotType created. * * @param slotValue - * The Object that is to be interrogated for slot values. Must - * be a Levels Object or an IllegalArgumentException will be - * thrown. + * The Object that is to be interrogated for slot values. Must be + * a Levels Object or an IllegalArgumentException will be thrown. * * @return A List of SlotType Objects extracted from the slotValue Object - * provided. The List will contain one collectionValue slot with - * the keys of all the extracted ParameterLevel Objects from the - * Levels Object. + * provided. The List will contain one collectionValue slot with the + * keys of all the extracted ParameterLevel Objects from the Levels + * Object. * * @throws IllegalArgumentException * If the slotValue Object provided cannot be converted to @@ -58,47 +57,48 @@ public class ParameterLevelsConverter implements SlotConverter { * */ @Override - public List getSlots(String slotName, Object slotValue) throws IllegalArgumentException { + public List getSlots(String slotName, Object slotValue) + throws IllegalArgumentException { List slots = new ArrayList(); - - + SlotType slot = new SlotType(); slot.setName(slotName); List collectionValues = new ArrayList(); CollectionValueType cvt = new CollectionValueType(); - - + if (slotValue instanceof Levels) { - Levels levels = (Levels)slotValue; + Levels levels = (Levels) slotValue; for (Double levelValue : levels.getLevel()) { ValueType vt = newEntrySlot(levels.getLevelType(), levelValue); collectionValues.add(vt); } + } else { + throw new IllegalArgumentException("Object of type " + + slotValue.getClass().getName() + + " cannot be converted by " + + ParameterLevelsConverter.class.getName()); } - else { - throw new IllegalArgumentException("Object of type " + slotValue.getClass().getName() + - " cannot be converted by " + ParameterLevelsConverter.class.getName()); - } - + cvt.setCollectionValue(collectionValues); - cvt.setCollectionType("urn:oasis:names:tc:ebxml-regrep:CollectionType:Set"); + cvt.setCollectionType(CollectionTypes.SET); slot.setSlotValue(cvt); slots.add(slot); return slots; } - + /** * Create a new value for inclusion in the collection slot values. * * @param value - * The Object to extract the slot value from. - * + * The Object to extract the slot value from. + * * @return A ValueType to add to the collection slot. */ private ValueType newEntrySlot(int levelType, double levelValue) { StringValueType entry = new StringValueType(); - entry.setStringValue(Integer.toString(levelType) + "-" + Double.toString(levelValue)); + entry.setStringValue(Integer.toString(levelType) + "-" + + Double.toString(levelValue)); return entry; } } diff --git a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/TimeSlotConverter.java b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/TimeSlotConverter.java index f94397ad4d..0b7d39931f 100644 --- a/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/TimeSlotConverter.java +++ b/edexOsgi/com.raytheon.uf.common.datadelivery.registry/src/com/raytheon/uf/common/datadelivery/registry/TimeSlotConverter.java @@ -12,6 +12,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ValueType; import com.raytheon.uf.common.datadelivery.registry.Time.STEP_UNIT; +import com.raytheon.uf.common.registry.constants.CollectionTypes; import com.raytheon.uf.common.registry.ebxml.CalendarAttribute; import com.raytheon.uf.common.registry.ebxml.slots.DateSlotConverter; import com.raytheon.uf.common.registry.ebxml.slots.SlotConverter; @@ -58,15 +59,15 @@ public class TimeSlotConverter implements SlotConverter { * @see java.util.Map */ @Override - public List getSlots(String slotName, Object slotValue) throws IllegalArgumentException { + public List getSlots(String slotName, Object slotValue) + throws IllegalArgumentException { List slots = new ArrayList(); - - + SlotType slot = new SlotType(); slot.setName(slotName); List collectionValues = new ArrayList(); CollectionValueType cvt = new CollectionValueType(); - + // Handle times for Point types if (slotValue instanceof PointTime) { @@ -80,11 +81,12 @@ public class TimeSlotConverter implements SlotConverter { } } - // Handle Gridded Times + // Handle Gridded Times } else if (slotValue instanceof GriddedTime) { - - GriddedTime t = (GriddedTime)slotValue; - SimpleDateFormat df = new SimpleDateFormat(CalendarAttribute.DATE_TIME_FORMAT); + + GriddedTime t = (GriddedTime) slotValue; + SimpleDateFormat df = new SimpleDateFormat( + CalendarAttribute.DATE_TIME_FORMAT); Calendar current = Calendar.getInstance(); Calendar end = Calendar.getInstance(); @@ -93,17 +95,18 @@ public class TimeSlotConverter implements SlotConverter { STEP_UNIT stepu = STEP_UNIT.valueOf(t.getStepUnit().toUpperCase()); Double step = t.getStep(); - - // Add One millisecond to handle the case when the step of the Time Object - // is exactly equal to the end time. + + // Add One millisecond to handle the case when the step of the Time + // Object + // is exactly equal to the end time. end.add(Calendar.MILLISECOND, 1); - + while (end.after(current)) { - collectionValues.add(newEntrySlot(df.format(current.getTime()))); + collectionValues + .add(newEntrySlot(df.format(current.getTime()))); - switch (stepu) - { + switch (stepu) { case SECOND: current.add(Calendar.SECOND, step.intValue()); break; @@ -124,29 +127,31 @@ public class TimeSlotConverter implements SlotConverter { break; } } - - } else { - throw new IllegalArgumentException("Object of type " + slotValue.getClass().getName() + - " cannot be converted by " + TimeSlotConverter.class.getName()); + + } else { + throw new IllegalArgumentException("Object of type " + + slotValue.getClass().getName() + + " cannot be converted by " + + TimeSlotConverter.class.getName()); } - + cvt.setCollectionValue(collectionValues); - cvt.setCollectionType("urn:oasis:names:tc:ebxml-regrep:CollectionType:List"); + cvt.setCollectionType(CollectionTypes.LIST); slot.setSlotValue(cvt); slots.add(slot); return slots; } - + /** * Create a new value for inclusion in the collection slot values. * * @param value - * The Object to extract the slot value from. - * + * The Object to extract the slot value from. + * * @return A ValueType to add to the collection slot. */ private ValueType newEntrySlot(String value) { - + StringValueType entry = new StringValueType(); entry.setStringValue(value); return entry; diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/RegistryNamespaceMapper.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/RegistryNamespaceMapper.java index 59eaafab7e..65d1d763fd 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/RegistryNamespaceMapper.java +++ b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/RegistryNamespaceMapper.java @@ -19,9 +19,7 @@ **/ package com.raytheon.uf.common.registry; -import java.util.HashMap; import java.util.Iterator; -import java.util.Map; import javax.xml.XMLConstants; import javax.xml.namespace.NamespaceContext; @@ -48,49 +46,6 @@ import com.sun.xml.bind.marshaller.NamespacePrefixMapper; public class RegistryNamespaceMapper extends NamespacePrefixMapper implements NamespaceContext { - /** Map which maps namespaceURIs to prefixes */ - public static final Map NAMESPACE_PREFIX_MAP = new HashMap( - 7); - - /** Map which maps prefixes to namespaceURIs */ - public static final Map PREFIX_NAMESPACE_MAP = new HashMap( - 7); - - static { - NAMESPACE_PREFIX_MAP.put("urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", - "rim"); - PREFIX_NAMESPACE_MAP.put("rim", - "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0"); - - NAMESPACE_PREFIX_MAP.put("urn:oasis:names:tc:ebxml-regrep:xsd:lcm:4.0", - "lcm"); - PREFIX_NAMESPACE_MAP.put("lcm", - "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:4.0"); - - NAMESPACE_PREFIX_MAP.put("urn:oasis:names:tc:ebxml-regrep:xsd:spi:4.0", - "spi"); - PREFIX_NAMESPACE_MAP.put("spi", - "urn:oasis:names:tc:ebxml-regrep:xsd:spi:4.0"); - - NAMESPACE_PREFIX_MAP.put( - "urn:oasis:names:tc:ebxml-regrep:xsd:query:4.0", "query"); - PREFIX_NAMESPACE_MAP.put("query", - "urn:oasis:names:tc:ebxml-regrep:xsd:query:4.0"); - - NAMESPACE_PREFIX_MAP.put("urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", - "rs"); - PREFIX_NAMESPACE_MAP.put("rs", - "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0"); - - NAMESPACE_PREFIX_MAP.put("http://www.w3.org/2005/08/addressing", - "addressing"); - PREFIX_NAMESPACE_MAP.put("addressing", - "http://www.w3.org/2005/08/addressing"); - - NAMESPACE_PREFIX_MAP.put("http://www.w3.org/1999/xlink", "xlink"); - PREFIX_NAMESPACE_MAP.put("xlink", "http://www.w3.org/1999/xlink"); - } - /** * Creates a new RegistryNamespaceMapper */ @@ -101,14 +56,14 @@ public class RegistryNamespaceMapper extends NamespacePrefixMapper implements @Override public String getPreferredPrefix(String namespaceURI, String suggestion, boolean requirePrefix) { - String prefix = NAMESPACE_PREFIX_MAP.get(namespaceURI); + String prefix = EbxmlNamespaces.NAMESPACE_PREFIX_MAP.get(namespaceURI); return prefix == null ? suggestion : prefix; } @Override public String getNamespaceURI(String prefix) { - String namespaceURI = PREFIX_NAMESPACE_MAP.get(prefix); + String namespaceURI = EbxmlNamespaces.PREFIX_NAMESPACE_MAP.get(prefix); return namespaceURI == null ? XMLConstants.NULL_NS_URI : namespaceURI; } diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/constants/Namespaces.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/constants/Namespaces.java deleted file mode 100644 index c77f751799..0000000000 --- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/constants/Namespaces.java +++ /dev/null @@ -1,52 +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.constants; - -/** - * - * Namespace constants - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#     Engineer    Description
- * ------------ ----------  ----------- --------------------------
- * 4/9/2013     1802        bphillip    Initial implementation
- * 
- * - * @author bphillip - * @version 1 - */ -public class Namespaces { - - public static final String ADDRESSING_NAMESPACE = "http://www.w3.org/2005/08/addressing"; - - public static final String EBXML_REGISTRY_INTERFACES_NAMESPACE_URI = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:interfaces:4.0"; - - public static final String EBXML_SPI_NAMESPACE_URI = "urn:oasis:names:tc:ebxml-regrep:wsdl:spi:interfaces:4.0"; - - public static final String EBXML_NOTIFICATION_LISTENER_NAMESPACE_URI = "urn:oasis:names:tc:ebxml-regrep:wsdl:NotificationListener:interfaces:4.0"; - - public static final String EBXML_RS_NAMESPACE_URI = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0"; - - public static final String EBXML_RIM_NAMESPACE_URI = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0"; - -} diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/constants/QueryLanguages.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/constants/QueryLanguages.java index 40ac96ff0d..9041365da3 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/constants/QueryLanguages.java +++ b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/constants/QueryLanguages.java @@ -39,13 +39,8 @@ package com.raytheon.uf.common.registry.constants; */ public class QueryLanguages { - public static final String EJBQL = "urn:oasis:names:tc:ebxml-regrep:QueryLanguage:EJBQL"; - - public static final String SPARQL = "urn:oasis:names:tc:ebxml-regrep:QueryLanguage:SPARQL"; - - public static final String SQL_92 = "urn:oasis:names:tc:ebxml-regrep:QueryLanguage:SQL-92"; + public static final String HQL = "urn:oasis:names:tc:ebxml-regrep:QueryLanguage:HQL"; public static final String XPATH = "urn:oasis:names:tc:ebxml-regrep:QueryLanguage:XPath"; - public static final String XQUERY = "urn:oasis:names:tc:ebxml-regrep:QueryLanguage:XQuery"; } diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/AdhocRegistryQuery.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/AdhocRegistryQuery.java index 836bc550ba..379d6bfd3e 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/AdhocRegistryQuery.java +++ b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/AdhocRegistryQuery.java @@ -12,6 +12,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; import com.raytheon.uf.common.registry.BaseQuery; import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.registry.constants.QueryLanguages; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -31,6 +32,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Jun 21, 2012 736 djohnson Add thrift serialization annotations. * Aug 02, 2012 955 djohnson Add generics and results retrieval to registry queries. * 4/9/2013 1802 bphillip Modified to use constants in constants package instead of RegistryUtil + * 10/10/2013 1683 bphillip Using correct id value for the HQL query language * * * @author jspinks @@ -147,7 +149,8 @@ public abstract class AdhocRegistryQuery extends BaseQuery { @Override public List getSlots() { List slots = new ArrayList(); - slots.add(RegistryUtil.newStringSlot("queryLanguage", "HQL")); + slots.add(RegistryUtil.newStringSlot("queryLanguage", + QueryLanguages.HQL)); slots.add(RegistryUtil.newStringSlot("queryExpression", getHQL())); return slots; } diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RegistryUtil.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RegistryUtil.java index 528b750f33..f45b3229f3 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RegistryUtil.java +++ b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/RegistryUtil.java @@ -306,8 +306,8 @@ public final class RegistryUtil { * on error reflectively accessing the object */ public static RegistryObjectType newRegistryObject(Object object, - IRegistryEncoder encoderStrategy) - throws SerializationException, ReflectionException { + IRegistryEncoder encoderStrategy) throws SerializationException, + ReflectionException { RegistryObjectType registryObject = new RegistryObjectType(); String registryObjectType = null; diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/SOAPRegistryManager.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/SOAPRegistryManager.java index cccb8c60b1..aa90515b35 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/SOAPRegistryManager.java +++ b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/SOAPRegistryManager.java @@ -10,6 +10,8 @@ import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.LifecycleManagerSOA import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.QueryManager; import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.QueryManagerSOAPService; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** * * A SOAP client implementation for use with the RegistryManager Class. @@ -32,11 +34,9 @@ public abstract class SOAPRegistryManager implements LifecycleManagerFactory, QueryManagerFactory { private static QName queryServiceName = new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:interfaces:4.0", - "QueryManagerService"); + EbxmlNamespaces.RR_INT_URI, "QueryManagerService"); - private static QName lcmServiceName = new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:interfaces:4.0", + private static QName lcmServiceName = new QName(EbxmlNamespaces.RR_INT_URI, "LifecycleManagerService"); /** diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/slots/KeySetSlotConverter.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/slots/KeySetSlotConverter.java index 02394fe4c4..f64efcee6b 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/slots/KeySetSlotConverter.java +++ b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/slots/KeySetSlotConverter.java @@ -9,23 +9,24 @@ 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.ValueType; +import com.raytheon.uf.common.registry.constants.CollectionTypes; + /** - * A SlotConverter implementation for converting the - * keys from a Map into a RegistryObject slot type. A collection - * slot type will be created and the key values converted to elements - * with slot values of a appropriate type for the key. The collection - * type for the slot will be set to Set. + * A SlotConverter implementation for converting the keys from a + * Map into a RegistryObject slot type. A collection slot type will be created + * and the key values converted to elements with slot values of a appropriate + * type for the key. The collection type for the slot will be set to Set. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * May 15, 2012 455        jspinks     Initial creation
- *
+ * 
  * 
- * + * * @author jspinks * @version 1.0 */ @@ -44,65 +45,66 @@ public class KeySetSlotConverter implements SlotConverter { * provided. * * @throws IllegalArgumentException - * If the slotValue Object provided is not an instance of Map, or - * the class of the keys of the Map cannot be converted. + * If the slotValue Object provided is not an instance of Map, + * or the class of the keys of the Map cannot be converted. * * @see java.util.Map */ @Override - public List getSlots(String slotName, Object slotValue) throws IllegalArgumentException { + public List getSlots(String slotName, Object slotValue) + throws IllegalArgumentException { List slots = new ArrayList(); - - + SlotType slot = new SlotType(); slot.setName(slotName); List collectionValues = new ArrayList(); CollectionValueType cvt = new CollectionValueType(); - - + if (slotValue instanceof Map) { - - for (Object o : ((Map)slotValue).keySet()) { + + for (Object o : ((Map) slotValue).keySet()) { ValueType vt = newEntrySlot(o); if (vt != null) { - collectionValues.add(vt); + collectionValues.add(vt); } else { - throw new IllegalArgumentException("Map with key type " + o.getClass().getName() + - " cannot be converted by " + KeySetSlotConverter.class.getName()); + throw new IllegalArgumentException("Map with key type " + + o.getClass().getName() + + " cannot be converted by " + + KeySetSlotConverter.class.getName()); } } - + } else { + throw new IllegalArgumentException("Object of type " + + slotValue.getClass().getName() + + " cannot be converted by " + + KeySetSlotConverter.class.getName()); } - else { - throw new IllegalArgumentException("Object of type " + slotValue.getClass().getName() + - " cannot be converted by " + KeySetSlotConverter.class.getName()); - } - + cvt.setCollectionValue(collectionValues); - cvt.setCollectionType("urn:oasis:names:tc:ebxml-regrep:CollectionType:Set"); + cvt.setCollectionType(CollectionTypes.SET); slot.setSlotValue(cvt); slots.add(slot); return slots; } - + /** * Create a new value for inclusion in the collection slot values. * * @param value - * The Object to extract the slot value from. - * + * The Object to extract the slot value from. + * * @return A ValueType to add to the collection slot. */ private ValueType newEntrySlot(Object value) { - + // TODO: Add more types as necessary. if (value instanceof String) { StringValueType entry = new StringValueType(); - entry.setStringValue((String)value); + entry.setStringValue((String) value); return entry; } - + return null; } } diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/slots/SetSlotConverter.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/slots/SetSlotConverter.java index 12f6c06805..716dbd34bc 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/slots/SetSlotConverter.java +++ b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/slots/SetSlotConverter.java @@ -9,6 +9,8 @@ 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.ValueType; +import com.raytheon.uf.common.registry.constants.CollectionTypes; + /** * A SlotConverter implementation for converting the members of a * Set into a RegistryObject slot type. A collection slot type will be created @@ -82,7 +84,7 @@ public class SetSlotConverter implements SlotConverter { } cvt.setCollectionValue(collectionValues); - cvt.setCollectionType("urn:oasis:names:tc:ebxml-regrep:CollectionType:Set"); + cvt.setCollectionType(CollectionTypes.SET); slot.setSlotValue(cvt); slots.add(slot); return slots; 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.registry.ebxml/src/com/raytheon/uf/common/registry/services/rest/IRegistryDataAccessService.java index 35f22fe369..03af0aff27 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.registry.ebxml/src/com/raytheon/uf/common/registry/services/rest/IRegistryDataAccessService.java @@ -39,6 +39,7 @@ import com.raytheon.uf.common.registry.services.rest.response.RestCollectionResp * ------------ ---------- ----------- -------------------------- * 7/29/2013 2191 bphillip Initial implementation * 9/20/2013 2385 bphillip Added subscription backup functions + * 10/8/2013 1682 bphillip Added rest functions for use with the query web interface * * * @author bphillip @@ -46,6 +47,8 @@ import com.raytheon.uf.common.registry.services.rest.response.RestCollectionResp */ public interface IRegistryDataAccessService { + public static final String DATA_ACCESS_PATH_PREFIX = "/rest/dataAccess/"; + /** * Gets the ids of registry objects of the given object type * @@ -54,10 +57,30 @@ public interface IRegistryDataAccessService { * @return List of ids for registry objects of the given type */ @GET - @Path("/rest/dataAccess/getRegistryObjectIds/{objectType}") + @Path(DATA_ACCESS_PATH_PREFIX + "getRegistryObjectIds/{objectType}") public RestCollectionResponse getRegistryObjectIdsOfType( @PathParam("objectType") String objectType); + /** + * Gets the list of query definitions currently contained in the registry + * + * @return The query definitions currently contained in the registry + */ + @GET + @Path(DATA_ACCESS_PATH_PREFIX + "getQueries") + public String getValidQueries(); + + /** + * Gets the valid parameters for a given query definition + * + * @param queryId + * The id of the query definition + * @return The parameters for a given query definition + */ + @GET + @Path(DATA_ACCESS_PATH_PREFIX + "getParametersForQuery/{queryId}") + public String getParametersForQuery(@PathParam("queryId") String queryId); + /** * Removes any subscriptions for the given site * @@ -67,7 +90,7 @@ public interface IRegistryDataAccessService { * If errors occur while removing the subscriptions */ @GET - @Path("/rest/dataAccess/removeSubscriptionsFor/{siteId}") + @Path(DATA_ACCESS_PATH_PREFIX + "removeSubscriptionsFor/{siteId}") public void removeSubscriptionsForSite(@PathParam("siteId") String siteId) throws RegistryException; @@ -78,7 +101,7 @@ public interface IRegistryDataAccessService { * @return The page containing the subscriptions */ @GET - @Path("/rest/dataAccess/getSubscriptions") + @Path(DATA_ACCESS_PATH_PREFIX + "getSubscriptions") public String getSubscriptions(); /** @@ -92,7 +115,7 @@ public interface IRegistryDataAccessService { * If marshalling/unmarshalling errors are encountered */ @GET - @Path("/rest/dataAccess/backupSubscription/{subscriptionName}") + @Path(DATA_ACCESS_PATH_PREFIX + "backupSubscription/{subscriptionName}") public String backupSubscription( @PathParam("subscriptionName") String subscriptionName) throws JAXBException; @@ -105,7 +128,7 @@ public interface IRegistryDataAccessService { * If marshalling/unmarshalling errors are encountered */ @GET - @Path("/rest/dataAccess/backupAllSubscriptions/") + @Path(DATA_ACCESS_PATH_PREFIX + "backupAllSubscriptions/") public String backupAllSubscriptions() throws JAXBException; /** @@ -117,7 +140,7 @@ public interface IRegistryDataAccessService { * @throws JAXBException */ @GET - @Path("/rest/dataAccess/restoreSubscription/{subscriptionName}") + @Path(DATA_ACCESS_PATH_PREFIX + "restoreSubscription/{subscriptionName}") public String restoreSubscription( @PathParam("subscriptionName") String subscriptionName) throws JAXBException; @@ -128,7 +151,7 @@ public interface IRegistryDataAccessService { * @return Status messages relating to the success or failure of the restore */ @GET - @Path("/rest/dataAccess/restoreSubscriptions/") + @Path(DATA_ACCESS_PATH_PREFIX + "restoreSubscriptions/") public String restoreSubscriptions(); /** @@ -137,7 +160,7 @@ public interface IRegistryDataAccessService { * @return Status message */ @GET - @Path("/rest/dataAccess/clearSubscriptionBackupFiles/") + @Path(DATA_ACCESS_PATH_PREFIX + "clearSubscriptionBackupFiles/") public String clearSubscriptionBackupFiles(); } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/META-INF/MANIFEST.MF index afabf1bc85..5fe77199b3 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/META-INF/MANIFEST.MF @@ -11,8 +11,10 @@ Require-Bundle: javax.persistence;bundle-version="1.0.0", com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174", com.raytheon.uf.edex.database;bundle-version="1.0.0", org.apache.commons.cxf;bundle-version="1.0.0", - com.raytheon.uf.common.status;bundle-version="1.12.1174" -Export-Package: com.raytheon.uf.common.registry.schemas.ebxml.util, + com.raytheon.uf.common.status;bundle-version="1.12.1174", + com.raytheon.uf.common.util;bundle-version="1.12.1174" +Export-Package: com.raytheon.uf.common.registry, + com.raytheon.uf.common.registry.schemas.ebxml.util, com.raytheon.uf.common.registry.schemas.ebxml.util.annotations, oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4, oasis.names.tc.ebxml.regrep.xsd.lcm.v4, diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/com/raytheon/uf/common/registry/EbxmlNamespaces.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/com/raytheon/uf/common/registry/EbxmlNamespaces.java new file mode 100644 index 0000000000..ea467735de --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/com/raytheon/uf/common/registry/EbxmlNamespaces.java @@ -0,0 +1,303 @@ +/** + * 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.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * + * Namespaces used by the EBXML 4.0 spec. This list consists of namespaces + * listed in section 1.6 of OASIS ebXML RegRep Version 4.0, Part 0: Overview + * Document + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/15/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class EbxmlNamespaces { + + /** Map which maps namespaceURIs to prefixes */ + public static final Map NAMESPACE_PREFIX_MAP; + + /** Map which maps prefixes to namespaceURIs */ + public static final Map PREFIX_NAMESPACE_MAP; + + public static final String OASIS_PREFIX = "urn:oasis:names:tc:ebxml-regrep:"; + + public static final String OASIS_XSD_PREFIX = OASIS_PREFIX + "xsd:"; + + public static final String OASIS_WSDL_PREFIX = OASIS_PREFIX + "wsdl:"; + + public static final String VERSION = ":4.0"; + + /** + * EbXML RegRep Part 3: XML Schema file xsd/lcm.xsd + *

+ * Schema used by the LifecycleManager interface + */ + public static final String LCM = "lcm"; + + public static final String LCM_URI = OASIS_XSD_PREFIX + LCM + VERSION; + + /** + * EbXML RegRep Part 3: XML Schema file xsd/query.xsd + *

+ * Schema used by the QueryManager interface + */ + public static final String QUERY = "query"; + + public static final String QUERY_URI = OASIS_XSD_PREFIX + QUERY + VERSION; + + /** + * ebXML RegRep Part 3: XML Schema file xsd/rim.xsd + *

+ * Schema used for information model objects specified by [re- + * grep-rim-v4.0]. + */ + public static final String RIM = "rim"; + + public static final String RIM_URI = OASIS_XSD_PREFIX + RIM + VERSION; + + /** + * ebXML RegRep Part 3: XML Schema file xsd/rs.xsd + *

+ * Common schema used by registry protocols defined by [re- grep-rs-v4.0]. + */ + public static final String RS = "rs"; + + public static final String RS_URI = OASIS_XSD_PREFIX + RS + VERSION; + + /** + * ebXML RegRep Part 3: XML Schema file xsd/spi.xsd + *

+ * Schema used by the service provider interfaces defined by [re- + * grep-rs-v4.0]. + */ + public static final String SPI = "spi"; + + public static final String SPI_URI = OASIS_XSD_PREFIX + SPI + VERSION; + + /** + * ebXML RegRep Part 4: WSDL file wsdl/1.1/Notification- + * ListenerBindings.wsdl + *

+ * WSDL binding definitions for NotificationListeners defined by + * [regrep-rs-v4.0]. + */ + public static final String NL_BIND = "nl-bind"; + + public static final String NL_BIND_URI = OASIS_WSDL_PREFIX + + "NotificationListener:bindings" + VERSION; + + /** + * ebXML RegRep Part 4: WSDL file wsdl/1.1/Notification- + * ListenerInterfaces.wsdl + *

+ * WSDL interface definitions for NotificationListeners defined by + * [regrep-rs-v4.0]. + */ + public static final String NL_INT = "nl-int"; + + public static final String NL_INT_URI = OASIS_WSDL_PREFIX + + "NotificationListener:interfaces" + VERSION; + + /** + * ebXML RegRep Part 4: WSDL file wsdl/1.1/Notification- + * ListenerServices.wsdl + *

+ * WSDL service definitions for NotificationListeners defined by + * [regrep-rs-v4.0]. + */ + public static final String NL_SERV = "nl-serv"; + + public static final String NL_SERV_URI = OASIS_WSDL_PREFIX + + "NotificationListener:services" + VERSION; + + /** + * ebXML RegRep Part 4: WSDL file wsdl/1.1/re- grep-server-binding.wsdl + *

+ * WSDL binding definitions for interfaces defined by [re- grep-rs-v4.0]. + */ + public static final String RR_BIND = "rr-bind"; + + public static final String RR_BIND_URI = OASIS_WSDL_PREFIX + + "registry:bindings" + VERSION; + + /** + * ebXML RegRep Part 4: WSDL file wsdl/1.1/regrep-server-in- terface.wsdl + *

+ * WSDL interface definitions for interfaces defined by [re- grep-rs-v4.0]. + */ + public static final String RR_INT = "rr-int"; + + public static final String RR_INT_URI = OASIS_WSDL_PREFIX + + "registry:interfaces" + VERSION; + + /** + * ebXML RegRep Part 4: WSDL file wsdl/1.1/re- grep-server-service.wsdl + *

+ * WSDL service definitions for services defined by [re- grep-rs-v4.0]. + */ + public static final String RR_SERV = "rr-serv"; + + public static final String RR_SERV_URI = OASIS_WSDL_PREFIX + + "registry:services" + VERSION; + + /** + * ebXML RegRep Part 4: WSDL file wsdl/1.1/regrep-server-binding.wsdl + *

+ * WSDL binding definitions for service provider interfaces for server + * plugins defined by [regrep-rs-v4.0]. + */ + public static final String SPI_ = "spi-"; + + public static final String SPI__URI = OASIS_WSDL_PREFIX + "spi:bindings" + + VERSION; + + /** + * ebXML RegRep Part 4: WSDL file wsdl/1.1/regrep-server-in- terface.wsdl + *

+ * WSDL interface definitions for service provider interfaces for server + * plugin defined by [regrep-rs-v4.0]. + */ + public static final String SPI_INT = "spi-int"; + + public static final String SPI_INT_URI = OASIS_WSDL_PREFIX + + "spi:interfaces" + VERSION; + + /** + * A normative XML Schema [XML Schema Part 1], [XML Schema Part 2] document + * for the "http://www.w3.org/2003/05/soap-encod- ing" namespace can be + * found at http://www.w3.org/2003/05/soap-encoding. + */ + public static final String ENC = "enc"; + + public static final String ENC_URI = "http://www.w3.org/2003/05/soap-encoding"; + + /** + * SOAP Version 1.2 Part 1. A normative XML Schema [XML Schema Part 1], [XML + * Schema Part 2] document for the + * "http://www.w3.org/2003/05/soap-envel- ope" namespace can be found at + * http://www.w3.org/2003/05/soap-envelope. + */ + public static final String ENV = "env"; + + public static final String ENV_URI = "http://www.w3.org/2003/05/soap-envelope"; + + /** + * WSDL namespace for WSDL MIME binding. + */ + public static final String MIME = "mime"; + + public static final String MIME_URI = "http://schemas.xmlsoap.org/wsdl/mime/"; + + /** + * WSDL 1.1 namespace defined by WSDL 1.1 specification. + */ + public static final String WSDL = "wsdl"; + + public static final String WSDL_URI = "http://schemas.xmlsoap.org/wsdl/"; + + /** + * XACML 2.0 Core: eXtensible Access Control Markup Language (XACML) Version + * 2.0 + */ + public static final String XACML = "xacml"; + + public static final String XACML_URI = "urn:oasis:names:tc:xacml:2.0:policy:schema:os"; + + /** + * XACML 2.0 Core: eXtensible Access Control Markup Language (XACML) Version + * 2.0 + */ + public static final String XACMLC = "xacmlc"; + + public static final String XACMLC_URI = "urn:oasis:names:tc:xacml:2.0:context:schema:os"; + + /** + * XML Linking Language (XLink) Version 1.1 + */ + public static final String XLINK = "xlink"; + + public static final String XLINK_URI = "http://www.w3.org/1999/xlink"; + + /** + * XML Schema [XML Schema Part 1], [XML Schema Part 2] specification + */ + public static final String XS = "xs"; + + public static final String XS_URI = "http://www.w3.org/2001/XMLSchema"; + + /** + * W3C XML Schema specification [XML Schema Part 1], [XML Schema Part 2]. + */ + public static final String XSI = "xsi"; + + public static final String XSI_URI = "http://www.w3.org/2001/XMLSchema-instance"; + + /** + * Addressing namespace + */ + public static final String ADDRESSING = "addressing"; + + public static final String ADDRESSING_URI = "http://www.w3.org/2005/08/addressing"; + + static { + Map prefixNamespaceMap = new HashMap(22); + Map namespacePrefixMap = new HashMap(22); + prefixNamespaceMap.put(LCM, LCM_URI); + prefixNamespaceMap.put(QUERY, QUERY_URI); + prefixNamespaceMap.put(RIM, RIM_URI); + prefixNamespaceMap.put(RS, RS_URI); + prefixNamespaceMap.put(SPI, SPI_URI); + prefixNamespaceMap.put(NL_BIND, NL_BIND_URI); + prefixNamespaceMap.put(NL_INT, NL_INT_URI); + prefixNamespaceMap.put(NL_SERV, NL_SERV_URI); + prefixNamespaceMap.put(RR_BIND, RR_BIND_URI); + prefixNamespaceMap.put(RR_INT, RR_INT_URI); + prefixNamespaceMap.put(RR_SERV, RR_SERV_URI); + prefixNamespaceMap.put(SPI_, SPI__URI); + prefixNamespaceMap.put(SPI_INT, SPI_INT_URI); + prefixNamespaceMap.put(ENC, ENC_URI); + prefixNamespaceMap.put(ENV, ENV_URI); + prefixNamespaceMap.put(MIME, MIME_URI); + prefixNamespaceMap.put(WSDL, WSDL_URI); + prefixNamespaceMap.put(XACML, XACML_URI); + prefixNamespaceMap.put(XACMLC, XACMLC_URI); + prefixNamespaceMap.put(XLINK, XLINK_URI); + prefixNamespaceMap.put(XS, XS_URI); + prefixNamespaceMap.put(XSI, XSI_URI); + for (String prefix : prefixNamespaceMap.keySet()) { + namespacePrefixMap.put(prefixNamespaceMap.get(prefix), prefix); + } + PREFIX_NAMESPACE_MAP = Collections.unmodifiableMap(prefixNamespaceMap); + NAMESPACE_PREFIX_MAP = Collections.unmodifiableMap(namespacePrefixMap); + } +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/CanonicalEbxmlQuery.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/com/raytheon/uf/common/registry/RegrepUtil.java similarity index 61% rename from edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/CanonicalEbxmlQuery.java rename to edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/com/raytheon/uf/common/registry/RegrepUtil.java index 9456e7d57b..1500bb6b5e 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/CanonicalEbxmlQuery.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/com/raytheon/uf/common/registry/RegrepUtil.java @@ -17,30 +17,28 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types; - +package com.raytheon.uf.common.registry; /** - * Implementation of a canonical ebXML query + * + * Constants for use in the ebxml schema project * *

  * 
  * SOFTWARE HISTORY
  * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/15/2013    1682        bphillip    Initial implementation
  * 
* * @author bphillip - * @version 1.0 + * @version 1 */ -public abstract class CanonicalEbxmlQuery extends AbstractEbxmlQuery { +public class RegrepUtil { - public boolean isCanonical() { - return true; - } + public static final String EBXML_SCHEMA = "ebxml"; + + public static final String DB_CACHE_REGION = "RegistryObjects"; } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/Cataloger.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/Cataloger.java index a63c87adf5..33371028af 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/Cataloger.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/Cataloger.java @@ -32,15 +32,27 @@ import oasis.names.tc.ebxml.regrep.xsd.spi.v4.CatalogObjectsResponse; import org.apache.cxf.annotations.GZIP; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** - * The Cataloger interface. * - * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.6 in JDK 6 Generated - * source version: 2.1 * + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @GZIP(threshold = 0) -@WebService(name = "Cataloger", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:wsdl:spi:interfaces:4.0") +@WebService(name = "Cataloger", targetNamespace = EbxmlNamespaces.SPI_INT_URI) @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @XmlSeeAlso({ oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectFactory.class, oasis.names.tc.ebxml.regrep.xsd.spi.v4.ObjectFactory.class, @@ -50,6 +62,9 @@ import org.apache.cxf.annotations.GZIP; oasis.names.tc.ebxml.regrep.xsd.query.v4.ObjectFactory.class }) public interface Cataloger { + public static final String CATALOG_OBJECTS_ACTION = EbxmlNamespaces.OASIS_WSDL_PREFIX + + ":spi:bindings:4.0:Cataloger#catalogObjects"; + /** * * @param partCatalogObjectsRequest @@ -57,10 +72,10 @@ public interface Cataloger { * oasis.names.tc.ebxml_regrep.xsd.spi._4.CatalogObjectsResponse * @throws MsgRegistryException */ - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:spi:bindings:4.0:Cataloger#catalogObjects") - @WebResult(name = "CatalogObjectsResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:spi:4.0", partName = "partCatalogObjectsResponse") + @WebMethod(action = CATALOG_OBJECTS_ACTION) + @WebResult(name = "CatalogObjectsResponse", targetNamespace = EbxmlNamespaces.SPI_URI, partName = "partCatalogObjectsResponse") public CatalogObjectsResponse catalogObjects( - @WebParam(name = "CatalogObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:spi:4.0", partName = "partCatalogObjectsRequest") CatalogObjectsRequest partCatalogObjectsRequest) + @WebParam(name = "CatalogObjectsRequest", targetNamespace = EbxmlNamespaces.SPI_URI, partName = "partCatalogObjectsRequest") CatalogObjectsRequest partCatalogObjectsRequest) throws MsgRegistryException; } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/CatalogerSOAPService.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/CatalogerSOAPService.java index e2ba960c7b..b94a2010ec 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/CatalogerSOAPService.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/CatalogerSOAPService.java @@ -20,59 +20,40 @@ package oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4; -import java.net.MalformedURLException; import java.net.URL; -import java.util.logging.Logger; + import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceFeature; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** * - * A service providing SOAP endpoints for Cataloger interface. * * - * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.6 in JDK 6 Generated - * source version: 2.1 + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ -@WebServiceClient(name = "CatalogerSOAPService", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", wsdlLocation = "file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl") +@WebServiceClient(name = "CatalogerSOAPService", targetNamespace = EbxmlNamespaces.RR_SERV_URI) public class CatalogerSOAPService extends Service { - private final static URL CATALOGERSOAPSERVICE_WSDL_LOCATION; - - private final static Logger logger = Logger - .getLogger(oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.CatalogerSOAPService.class - .getName()); - - static { - URL url = null; - try { - URL baseUrl; - baseUrl = oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.CatalogerSOAPService.class - .getResource("."); - url = new URL( - baseUrl, - "file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl"); - } catch (MalformedURLException e) { - logger.warning("Failed to create URL for the wsdl Location: 'file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl', retrying as a local file"); - logger.warning(e.getMessage()); - } - CATALOGERSOAPSERVICE_WSDL_LOCATION = url; - } - public CatalogerSOAPService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } - public CatalogerSOAPService() { - super(CATALOGERSOAPSERVICE_WSDL_LOCATION, new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", - "CatalogerSOAPService")); - } - /** * * A template SOAP endpoints for ebXML RegRep Cataloger interface. @@ -82,8 +63,7 @@ public class CatalogerSOAPService extends Service { */ @WebEndpoint(name = "CatalogerPort") public Cataloger getCatalogerPort() { - return super.getPort(new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", + return super.getPort(new QName(EbxmlNamespaces.RR_SERV_URI, "CatalogerPort"), Cataloger.class); } @@ -101,8 +81,7 @@ public class CatalogerSOAPService extends Service { */ @WebEndpoint(name = "CatalogerPort") public Cataloger getCatalogerPort(WebServiceFeature... features) { - return super.getPort(new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", + return super.getPort(new QName(EbxmlNamespaces.RR_SERV_URI, "CatalogerPort"), Cataloger.class, features); } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/LifecycleManager.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/LifecycleManager.java index cbe8217baf..8dd64f024e 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/LifecycleManager.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/LifecycleManager.java @@ -34,17 +34,27 @@ import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType; import org.apache.cxf.annotations.GZIP; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** * - * The portType for LifecycleManager abstract interface. * * - * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.6 in JDK 6 Generated - * source version: 2.1 + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @GZIP(threshold = 0) -@WebService(name = "LifecycleManager", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:interfaces:4.0") +@WebService(name = "LifecycleManager", targetNamespace = EbxmlNamespaces.RR_INT_URI) @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @XmlSeeAlso({ oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectFactory.class, oasis.names.tc.ebxml.regrep.xsd.spi.v4.ObjectFactory.class, @@ -54,6 +64,15 @@ import org.apache.cxf.annotations.GZIP; oasis.names.tc.ebxml.regrep.xsd.query.v4.ObjectFactory.class }) public interface LifecycleManager { + public static final String REMOVE_OBJECTS_ACTION = EbxmlNamespaces.OASIS_WSDL_PREFIX + + "registry:bindings:4.0:LifecycleManager#removeObjects"; + + public static final String SUBMIT_OBJECTS_ACTION = EbxmlNamespaces.OASIS_WSDL_PREFIX + + "registry:bindings:4.0:LifecycleManager#submitObjects"; + + public static final String UPDATE_OBJECTS_ACTION = EbxmlNamespaces.OASIS_WSDL_PREFIX + + "registry:bindings:4.0:LifecycleManager#updateObjects"; + /** * * @param partRemoveObjectsRequest @@ -61,10 +80,10 @@ public interface LifecycleManager { * oasis.names.tc.ebxml_regrep.xsd.rs._4.RegistryResponseType * @throws MsgRegistryException */ - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:bindings:4.0:LifecycleManager#removeObjects") - @WebResult(name = "RegistryResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", partName = "partRegistryResponse") + @WebMethod(action = REMOVE_OBJECTS_ACTION) + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") public RegistryResponseType removeObjects( - @WebParam(name = "RemoveObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:4.0", partName = "partRemoveObjectsRequest") RemoveObjectsRequest partRemoveObjectsRequest) + @WebParam(name = "RemoveObjectsRequest", targetNamespace = EbxmlNamespaces.LCM_URI, partName = "partRemoveObjectsRequest") RemoveObjectsRequest partRemoveObjectsRequest) throws MsgRegistryException; /** @@ -74,10 +93,10 @@ public interface LifecycleManager { * oasis.names.tc.ebxml_regrep.xsd.rs._4.RegistryResponseType * @throws MsgRegistryException */ - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:bindings:4.0:LifecycleManager#submitObjects") - @WebResult(name = "RegistryResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", partName = "partRegistryResponse") + @WebMethod(action = SUBMIT_OBJECTS_ACTION) + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") public RegistryResponseType submitObjects( - @WebParam(name = "SubmitObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:4.0", partName = "partSubmitObjectsRequest") SubmitObjectsRequest partSubmitObjectsRequest) + @WebParam(name = "SubmitObjectsRequest", targetNamespace = EbxmlNamespaces.LCM_URI, partName = "partSubmitObjectsRequest") SubmitObjectsRequest partSubmitObjectsRequest) throws MsgRegistryException; /** @@ -87,10 +106,10 @@ public interface LifecycleManager { * oasis.names.tc.ebxml_regrep.xsd.rs._4.RegistryResponseType * @throws MsgRegistryException */ - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:bindings:4.0:LifecycleManager#updateObjects") - @WebResult(name = "RegistryResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", partName = "partRegistryResponse") + @WebMethod(action = UPDATE_OBJECTS_ACTION) + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") public RegistryResponseType updateObjects( - @WebParam(name = "UpdateObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:4.0", partName = "partUpdateObjectsRequest") UpdateObjectsRequest partUpdateObjectsRequest) + @WebParam(name = "UpdateObjectsRequest", targetNamespace = EbxmlNamespaces.LCM_URI, partName = "partUpdateObjectsRequest") UpdateObjectsRequest partUpdateObjectsRequest) throws MsgRegistryException; } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/LifecycleManagerSOAPService.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/LifecycleManagerSOAPService.java index 2127d85055..9b58717665 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/LifecycleManagerSOAPService.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/LifecycleManagerSOAPService.java @@ -20,15 +20,16 @@ package oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4; -import java.net.MalformedURLException; import java.net.URL; -import java.util.logging.Logger; + import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceFeature; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** * * A service providing SOAP endpoints for LifecycleManager interface. @@ -38,42 +39,13 @@ import javax.xml.ws.WebServiceFeature; * source version: 2.1 * */ -@WebServiceClient(name = "LifecycleManagerSOAPService", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:interfaces:4.0", - wsdlLocation = "file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl") +@WebServiceClient(name = "LifecycleManagerSOAPService", targetNamespace = EbxmlNamespaces.RR_INT_URI) public class LifecycleManagerSOAPService extends Service { - private final static URL LIFECYCLEMANAGERSOAPSERVICE_WSDL_LOCATION; - - private final static Logger logger = Logger - .getLogger(oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.LifecycleManagerSOAPService.class - .getName()); - - static { - URL url = null; - try { - URL baseUrl; - baseUrl = oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.LifecycleManagerSOAPService.class - .getResource("."); - url = new URL( - baseUrl, - "file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl"); - } catch (MalformedURLException e) { - logger.warning("Failed to create URL for the wsdl Location: 'file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl', retrying as a local file"); - logger.warning(e.getMessage()); - } - LIFECYCLEMANAGERSOAPSERVICE_WSDL_LOCATION = url; - } - public LifecycleManagerSOAPService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } - public LifecycleManagerSOAPService() { - super(LIFECYCLEMANAGERSOAPSERVICE_WSDL_LOCATION, new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", - "LifecycleManagerSOAPService")); - } - /** * * A template SOAP endpoint for ebXML RegRep LifecycleManager interface. @@ -83,8 +55,7 @@ public class LifecycleManagerSOAPService extends Service { */ @WebEndpoint(name = "LifecycleManagerPort") public LifecycleManager getLifecycleManagerPort() { - return super.getPort(new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:interfaces:4.0", + return super.getPort(new QName(EbxmlNamespaces.RR_INT_URI, "LifecycleManagerPort"), LifecycleManager.class); } @@ -103,8 +74,7 @@ public class LifecycleManagerSOAPService extends Service { @WebEndpoint(name = "LifecycleManagerPort") public LifecycleManager getLifecycleManagerPort( WebServiceFeature... features) { - return super.getPort(new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:interfaces:4.0", + return super.getPort(new QName(EbxmlNamespaces.RR_INT_URI, "LifecycleManagerPort"), LifecycleManager.class, features); } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/MsgRegistryException.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/MsgRegistryException.java index 0ce4dfa8cf..5243303918 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/MsgRegistryException.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/MsgRegistryException.java @@ -24,14 +24,27 @@ import javax.xml.ws.WebFault; import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryExceptionType; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdapter; /** - * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.6 in JDK 6 Generated - * source version: 2.1 * + * + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ -@WebFault(name = "RegistryException", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0") +@WebFault(name = "RegistryException", targetNamespace = EbxmlNamespaces.RS_URI) @DynamicSerializeTypeAdapter(factory = MsgRegistryExceptionTypeAdapter.class) public class MsgRegistryException extends Exception { diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/NotificationListener.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/NotificationListener.java index 2abe53991e..70dee420aa 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/NotificationListener.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/NotificationListener.java @@ -23,24 +23,36 @@ package oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4; import javax.jws.Oneway; import javax.jws.WebMethod; import javax.jws.WebParam; +import javax.jws.WebResult; import javax.jws.WebService; import javax.jws.soap.SOAPBinding; import javax.jws.soap.SOAPBinding.Style; import javax.xml.bind.annotation.XmlSeeAlso; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.NotificationType; +import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType; import org.apache.cxf.annotations.GZIP; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** - * PortType for a NotificationListener interface + *
  * 
- * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.6 in JDK 6 Generated
- * source version: 2.1
+ * SOFTWARE HISTORY
  * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 10/20/2013    1682       bphillip    Added synchronous notification delivery
+ * 
+ * + * @author bphillip + * @version 1 */ @GZIP(threshold = 0) -@WebService(name = "NotificationListener", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:wsdl:NotificationListener:interfaces:4.0") +@WebService(name = "NotificationListener", targetNamespace = EbxmlNamespaces.NL_INT_URI) @SOAPBinding(style = Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE) @XmlSeeAlso({ oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectFactory.class, oasis.names.tc.ebxml.regrep.xsd.spi.v4.ObjectFactory.class, @@ -50,14 +62,23 @@ import org.apache.cxf.annotations.GZIP; oasis.names.tc.ebxml.regrep.xsd.query.v4.ObjectFactory.class }) public interface NotificationListener { + public static final String ON_NOTIFICATION_ACTION = EbxmlNamespaces.OASIS_WSDL_PREFIX + + "NotificationListener:bindings:4.0:NotificationListener:onNotification"; + /** * Delivers a Notification from registry to NotificationListener * * @param notification */ - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:NotificationListener:bindings:4.0:NotificationListener:onNotification") + @WebMethod(action = ON_NOTIFICATION_ACTION) @Oneway public void onNotification( - @WebParam(name = "Notification", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", partName = "Notification") NotificationType notification); + @WebParam(name = "Notification", targetNamespace = EbxmlNamespaces.RIM_URI, partName = "Notification") NotificationType notification); + + @WebMethod(action = "SynchronousNotification") + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") + public RegistryResponseType synchronousNotification( + @WebParam(name = "Notification", targetNamespace = EbxmlNamespaces.RIM_URI, partName = "Notification") NotificationType notification) + throws MsgRegistryException; } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/NotificationListenerSOAPService.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/NotificationListenerSOAPService.java index 10ae89c536..dc87c74f80 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/NotificationListenerSOAPService.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/NotificationListenerSOAPService.java @@ -20,63 +20,44 @@ package oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4; -import java.net.MalformedURLException; import java.net.URL; -import java.util.logging.Logger; + import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceFeature; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** - * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.6 in JDK 6 Generated - * source version: 2.1 + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ -@WebServiceClient(name = "NotificationListenerSOAPService", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", wsdlLocation = "file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl") +@WebServiceClient(name = "NotificationListenerSOAPService", targetNamespace = EbxmlNamespaces.RR_SERV_URI) public class NotificationListenerSOAPService extends Service { - private final static URL NOTIFICATIONLISTENERSOAPSERVICE_WSDL_LOCATION; - - private final static Logger logger = Logger - .getLogger(oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.NotificationListenerSOAPService.class - .getName()); - - static { - URL url = null; - try { - URL baseUrl; - baseUrl = oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.NotificationListenerSOAPService.class - .getResource("."); - url = new URL( - baseUrl, - "file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl"); - } catch (MalformedURLException e) { - logger.warning("Failed to create URL for the wsdl Location: 'file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl', retrying as a local file"); - logger.warning(e.getMessage()); - } - NOTIFICATIONLISTENERSOAPSERVICE_WSDL_LOCATION = url; - } - public NotificationListenerSOAPService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } - public NotificationListenerSOAPService() { - super(NOTIFICATIONLISTENERSOAPSERVICE_WSDL_LOCATION, new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", - "NotificationListenerSOAPService")); - } - /** * * @return returns NotificationListener */ @WebEndpoint(name = "NotificationListenerPort") public NotificationListener getNotificationListenerPort() { - return super.getPort(new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", + return super.getPort(new QName(EbxmlNamespaces.RR_SERV_URI, "NotificationListenerPort"), NotificationListener.class); } @@ -92,8 +73,7 @@ public class NotificationListenerSOAPService extends Service { @WebEndpoint(name = "NotificationListenerPort") public NotificationListener getNotificationListenerPort( WebServiceFeature... features) { - return super.getPort(new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", + return super.getPort(new QName(EbxmlNamespaces.RR_SERV_URI, "NotificationListenerPort"), NotificationListener.class, features); } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/QueryManager.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/QueryManager.java index 44d913fc0b..d847de2deb 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/QueryManager.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/QueryManager.java @@ -32,17 +32,24 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; import org.apache.cxf.annotations.GZIP; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** + *
  * 
- * The portType for QueryManager abstract interface.
+ * SOFTWARE HISTORY
  * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
* - * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.6 in JDK 6 Generated - * source version: 2.1 - * + * @author bphillip + * @version 1 */ @GZIP(threshold = 0) -@WebService(name = "QueryManager", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:interfaces:4.0") +@WebService(name = "QueryManager", targetNamespace = EbxmlNamespaces.RR_INT_URI) @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @XmlSeeAlso({ oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectFactory.class, oasis.names.tc.ebxml.regrep.xsd.spi.v4.ObjectFactory.class, @@ -52,16 +59,19 @@ import org.apache.cxf.annotations.GZIP; oasis.names.tc.ebxml.regrep.xsd.query.v4.ObjectFactory.class }) public interface QueryManager { + public static final String EXECUTE_QUERY_ACTION = EbxmlNamespaces.OASIS_WSDL_PREFIX + + "registry:bindings:4.0:QueryManager#executeQuery"; + /** * * @param partQueryRequest * @return returns oasis.names.tc.ebxml_regrep.xsd.query._4.QueryResponse * @throws MsgRegistryException */ - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:bindings:4.0:QueryManager#executeQuery") - @WebResult(name = "QueryResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:query:4.0", partName = "partQueryResponse") + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") public QueryResponse executeQuery( - @WebParam(name = "QueryRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:query:4.0", partName = "partQueryRequest") QueryRequest partQueryRequest) + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) throws MsgRegistryException; } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/QueryManagerSOAPService.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/QueryManagerSOAPService.java index 8d8f808d23..1e43849030 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/QueryManagerSOAPService.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/QueryManagerSOAPService.java @@ -20,59 +20,37 @@ package oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4; -import java.net.MalformedURLException; import java.net.URL; -import java.util.logging.Logger; + import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceFeature; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** + *
  * 
- * A service providing SOAP endpoint QueryManager interface.
+ * SOFTWARE HISTORY
  * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
* - * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.6 in JDK 6 Generated - * source version: 2.1 - * + * @author bphillip + * @version 1 */ -@WebServiceClient(name = "QueryManagerSOAPService", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", wsdlLocation = "file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl") +@WebServiceClient(name = "QueryManagerSOAPService", targetNamespace = EbxmlNamespaces.RR_SERV_URI) public class QueryManagerSOAPService extends Service { - private final static URL QUERYMANAGERSOAPSERVICE_WSDL_LOCATION; - - private final static Logger logger = Logger - .getLogger(oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.QueryManagerSOAPService.class - .getName()); - - static { - URL url = null; - try { - URL baseUrl; - baseUrl = oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.QueryManagerSOAPService.class - .getResource("."); - url = new URL( - baseUrl, - "file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl"); - } catch (MalformedURLException e) { - logger.warning("Failed to create URL for the wsdl Location: 'file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl', retrying as a local file"); - logger.warning(e.getMessage()); - } - QUERYMANAGERSOAPSERVICE_WSDL_LOCATION = url; - } - public QueryManagerSOAPService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } - public QueryManagerSOAPService() { - super(QUERYMANAGERSOAPSERVICE_WSDL_LOCATION, new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:interfaces:4.0", - "QueryManagerSOAPService")); - } - /** * * A template SOAP endpoint for ebXML RegRep QueryManager interface. @@ -82,8 +60,7 @@ public class QueryManagerSOAPService extends Service { */ @WebEndpoint(name = "QueryManagerPort") public QueryManager getQueryManagerPort() { - return super.getPort(new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:interfaces:4.0", + return super.getPort(new QName(EbxmlNamespaces.RR_INT_URI, "QueryManagerPort"), QueryManager.class); } @@ -101,8 +78,7 @@ public class QueryManagerSOAPService extends Service { */ @WebEndpoint(name = "QueryManagerPort") public QueryManager getQueryManagerPort(WebServiceFeature... features) { - return super.getPort(new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", + return super.getPort(new QName(EbxmlNamespaces.RR_SERV_URI, "QueryManagerPort"), QueryManager.class, features); } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/Validator.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/Validator.java index b941735768..3f8a9164f8 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/Validator.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/Validator.java @@ -32,15 +32,24 @@ import oasis.names.tc.ebxml.regrep.xsd.spi.v4.ValidateObjectsResponse; import org.apache.cxf.annotations.GZIP; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** - * The Validator interface. + *
  * 
- * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.6 in JDK 6 Generated
- * source version: 2.1
+ * SOFTWARE HISTORY
  * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @GZIP(threshold = 0) -@WebService(name = "Validator", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:wsdl:spi:interfaces:4.0") +@WebService(name = "Validator", targetNamespace = EbxmlNamespaces.SPI_INT_URI) @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) @XmlSeeAlso({ oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectFactory.class, oasis.names.tc.ebxml.regrep.xsd.spi.v4.ObjectFactory.class, @@ -50,6 +59,9 @@ import org.apache.cxf.annotations.GZIP; oasis.names.tc.ebxml.regrep.xsd.query.v4.ObjectFactory.class }) public interface Validator { + public static final String VALIDATE_OBJECTS_ACTION = EbxmlNamespaces.OASIS_WSDL_PREFIX + + "spi:bindings:4.0:Validator#validateObjects"; + /** * * @param partValidateObjectsRequest @@ -57,10 +69,10 @@ public interface Validator { * oasis.names.tc.ebxml_regrep.xsd.spi._4.ValidateObjectsResponse * @throws MsgRegistryException */ - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:spi:bindings:4.0:Validator#validateObjects") - @WebResult(name = "ValidateObjectsResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:spi:4.0", partName = "partValidateObjectsResponse") + @WebMethod(action = VALIDATE_OBJECTS_ACTION) + @WebResult(name = "ValidateObjectsResponse", targetNamespace = EbxmlNamespaces.SPI_URI, partName = "partValidateObjectsResponse") public ValidateObjectsResponse validateObjects( - @WebParam(name = "ValidateObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:spi:4.0", partName = "partValidateObjectsRequest") ValidateObjectsRequest partValidateObjectsRequest) + @WebParam(name = "ValidateObjectsRequest", targetNamespace = EbxmlNamespaces.SPI_URI, partName = "partValidateObjectsRequest") ValidateObjectsRequest partValidateObjectsRequest) throws MsgRegistryException; } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/ValidatorSOAPService.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/ValidatorSOAPService.java index 5b0633d6bd..12fa040641 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/ValidatorSOAPService.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/wsdl/registry/services/v4/ValidatorSOAPService.java @@ -20,59 +20,37 @@ package oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4; -import java.net.MalformedURLException; import java.net.URL; -import java.util.logging.Logger; + import javax.xml.namespace.QName; import javax.xml.ws.Service; import javax.xml.ws.WebEndpoint; import javax.xml.ws.WebServiceClient; import javax.xml.ws.WebServiceFeature; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** + *
  * 
- * A service providing SOAP endpoints for Validator interface.
+ * SOFTWARE HISTORY
  * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
* - * This class was generated by the JAX-WS RI. JAX-WS RI 2.1.6 in JDK 6 Generated - * source version: 2.1 - * + * @author bphillip + * @version 1 */ -@WebServiceClient(name = "ValidatorSOAPService", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", wsdlLocation = "file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl") +@WebServiceClient(name = "ValidatorSOAPService", targetNamespace = EbxmlNamespaces.RR_SERV_URI) public class ValidatorSOAPService extends Service { - private final static URL VALIDATORSOAPSERVICE_WSDL_LOCATION; - - private final static Logger logger = Logger - .getLogger(oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.ValidatorSOAPService.class - .getName()); - - static { - URL url = null; - try { - URL baseUrl; - baseUrl = oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.ValidatorSOAPService.class - .getResource("."); - url = new URL( - baseUrl, - "file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl"); - } catch (MalformedURLException e) { - logger.warning("Failed to create URL for the wsdl Location: 'file:/common/bphillip/DataDelivery_FILES/ebXML/regrep/wsdl/1.1/regrep-server-service.wsdl', retrying as a local file"); - logger.warning(e.getMessage()); - } - VALIDATORSOAPSERVICE_WSDL_LOCATION = url; - } - public ValidatorSOAPService(URL wsdlLocation, QName serviceName) { super(wsdlLocation, serviceName); } - public ValidatorSOAPService() { - super(VALIDATORSOAPSERVICE_WSDL_LOCATION, new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", - "ValidatorSOAPService")); - } - /** * * A template SOAP endpoint for ebXML RegRep Validator interface. @@ -82,8 +60,7 @@ public class ValidatorSOAPService extends Service { */ @WebEndpoint(name = "ValidatorPort") public Validator getValidatorPort() { - return super.getPort(new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", + return super.getPort(new QName(EbxmlNamespaces.RR_SERV_URI, "ValidatorPort"), Validator.class); } @@ -101,8 +78,7 @@ public class ValidatorSOAPService extends Service { */ @WebEndpoint(name = "ValidatorPort") public Validator getValidatorPort(WebServiceFeature... features) { - return super.getPort(new QName( - "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:services:4.0", + return super.getPort(new QName(EbxmlNamespaces.RR_SERV_URI, "ValidatorPort"), Validator.class, features); } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/Mode.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/Mode.java index 3b14ddff5c..052d380818 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/Mode.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/Mode.java @@ -45,7 +45,20 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </simpleType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ + @XmlType(name = "mode") @XmlEnum @DynamicSerialize diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/ObjectFactory.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/ObjectFactory.java index af35eb73eb..3aa044334c 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/ObjectFactory.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/ObjectFactory.java @@ -35,6 +35,18 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * of schema type definitions, element declarations and model groups. Factory * methods for each of these are provided in this class. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRegistry public class ObjectFactory implements ISerializableObject { diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/RemoveObjectsRequest.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/RemoveObjectsRequest.java index 00978f7516..36b4dfe71e 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/RemoveObjectsRequest.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/RemoveObjectsRequest.java @@ -35,6 +35,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryRequestType; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -62,7 +63,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "query", "objectRefList" }) @@ -74,7 +86,7 @@ public class RemoveObjectsRequest extends RegistryRequestType { @DynamicSerializeElement protected QueryType query; - @XmlElement(name = "ObjectRefList", namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0") + @XmlElement(name = "ObjectRefList", namespace = EbxmlNamespaces.RIM_URI) @DynamicSerializeElement protected ObjectRefListType objectRefList; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/SubmitObjectsRequest.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/SubmitObjectsRequest.java index 290fcb824b..a6f6946aab 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/SubmitObjectsRequest.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/SubmitObjectsRequest.java @@ -35,6 +35,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryRequestType; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -60,7 +61,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "registryObjectList" }) @@ -68,7 +80,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @DynamicSerialize public class SubmitObjectsRequest extends RegistryRequestType { - @XmlElement(name = "RegistryObjectList", namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0") + @XmlElement(name = "RegistryObjectList", namespace = EbxmlNamespaces.RIM_URI) @DynamicSerializeElement protected RegistryObjectListType registryObjectList; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/UpdateActionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/UpdateActionType.java index f7a06d31d6..5816bc0ed6 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/UpdateActionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/UpdateActionType.java @@ -65,7 +65,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "UpdateAction") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/UpdateObjectsRequest.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/UpdateObjectsRequest.java index 2802974a3c..07220be303 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/UpdateObjectsRequest.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/UpdateObjectsRequest.java @@ -36,6 +36,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryRequestType; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -63,7 +64,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "query", "objectRefList", "updateAction" }) @@ -75,7 +87,7 @@ public class UpdateObjectsRequest extends RegistryRequestType { @DynamicSerializeElement protected QueryType query; - @XmlElement(name = "ObjectRefList", namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0") + @XmlElement(name = "ObjectRefList", namespace = EbxmlNamespaces.RIM_URI) @DynamicSerializeElement protected ObjectRefListType objectRefList; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/package-info.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/package-info.java index ce80af5606..3fa2c7bbad 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/package-info.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/lcm/v4/package-info.java @@ -18,6 +18,8 @@ * further licensing information. **/ -@javax.xml.bind.annotation.XmlSchema(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:4.0", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@javax.xml.bind.annotation.XmlSchema(namespace = EbxmlNamespaces.LCM_URI, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package oasis.names.tc.ebxml.regrep.xsd.lcm.v4; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/ObjectFactory.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/ObjectFactory.java index 9b33e1fa18..fb84356e70 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/ObjectFactory.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/ObjectFactory.java @@ -25,6 +25,7 @@ import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.ISerializableObject; /** @@ -38,12 +39,24 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * of schema type definitions, element declarations and model groups. Factory * methods for each of these are provided in this class. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRegistry public class ObjectFactory implements ISerializableObject { private final static QName _ResponseOption_QNAME = new QName( - "urn:oasis:names:tc:ebxml-regrep:xsd:query:4.0", "ResponseOption"); + EbxmlNamespaces.QUERY_URI, "ResponseOption"); /** * Create a new ObjectFactory that can be used to create new instances of @@ -91,7 +104,7 @@ public class ObjectFactory implements ISerializableObject { * {@link ResponseOptionType }{@code >} * */ - @XmlElementDecl(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:query:4.0", name = "ResponseOption") + @XmlElementDecl(namespace = EbxmlNamespaces.QUERY_URI, name = "ResponseOption") public JAXBElement createResponseOption( ResponseOptionType value) { return new JAXBElement(_ResponseOption_QNAME, diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/QueryExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/QueryExceptionType.java index 2edc5b2c0d..54efc1579d 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/QueryExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/QueryExceptionType.java @@ -48,7 +48,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "QueryException") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/QueryRequest.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/QueryRequest.java index 6f78b94a09..ca6291f4cb 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/QueryRequest.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/QueryRequest.java @@ -67,7 +67,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "responseOption", "query" }) @@ -102,6 +113,24 @@ public class QueryRequest extends RegistryRequestType { /** The maxResults canonical query parameter name */ public static final String MAX_RESULTS = "maxResults"; + /** The responseOption query parameter name */ + public static final String RESPONSE_OPTION = "responseOption"; + + /** The returnRequest query parameter */ + public static final String RETURN_REQUEST = "returnRequest"; + + /** The default format for query responses */ + public static final String DEFAULT_RESPONSE_FORMAT = "application/ebrim+xml"; + + public static final BigInteger DEFAULT_MAX_RESULTS = new BigInteger("-1"); + + public static final BigInteger DEFAULT_START_INDEX = new BigInteger("0"); + + public static final BigInteger DEFAULT_DEPTH = new BigInteger("0"); + + public static final Boolean DEFAULT_MATCH_OLDER_VERSIONS = new Boolean( + false); + @XmlElement(name = "ResponseOption", required = true) @DynamicSerializeElement protected ResponseOptionType responseOption; @@ -297,7 +326,7 @@ public class QueryRequest extends RegistryRequestType { */ public String getFormat() { if (format == null) { - return "application/ebrim+xml"; + return DEFAULT_RESPONSE_FORMAT; } else { return format; } @@ -343,7 +372,7 @@ public class QueryRequest extends RegistryRequestType { */ public BigInteger getStartIndex() { if (startIndex == null) { - return new BigInteger("0"); + return DEFAULT_START_INDEX; } else { return startIndex; } @@ -368,7 +397,7 @@ public class QueryRequest extends RegistryRequestType { */ public BigInteger getMaxResults() { if (maxResults == null) { - return new BigInteger("-1"); + return DEFAULT_MAX_RESULTS; } else { return maxResults; } @@ -393,7 +422,7 @@ public class QueryRequest extends RegistryRequestType { */ public BigInteger getDepth() { if (depth == null) { - return new BigInteger("0"); + return DEFAULT_DEPTH; } else { return depth; } @@ -418,7 +447,7 @@ public class QueryRequest extends RegistryRequestType { */ public boolean isMatchOlderVersions() { if (matchOlderVersions == null) { - return false; + return DEFAULT_MATCH_OLDER_VERSIONS; } else { return matchOlderVersions; } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/QueryResponse.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/QueryResponse.java index 40366e77c8..1243867596 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/QueryResponse.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/QueryResponse.java @@ -52,7 +52,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/ResponseOptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/ResponseOptionType.java index 56b648066b..c7a0c4042b 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/ResponseOptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/ResponseOptionType.java @@ -59,7 +59,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ResponseOption") @XmlAccessorType(XmlAccessType.FIELD) @@ -67,6 +78,34 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @DynamicSerialize public class ResponseOptionType { + /** + * ObjectRef - This option specifies that the QueryResponse MUST contain a + * element. The purpose of this option is to return + * references to objects rather than the actual objects. + * + * RegistryObject - This option specifies that the QueryResponse MUST + * contain a element containing + * elements with xsi:type=rim:RegistryObjectType. + * + * LeafClass - This option specifies that the QueryResponse MUST contain a + * collection of element containing + * elements that have an xsi:type attribute that + * corresponds to leaf classes as defined in [regrep-xsd-v4.0]. No + * RepositoryItems SHOULD be included for any rim:ExtrinsicObjectType + * instance in the element. + * + * LeafClassWithRepositoryItem - This option is the same as the LeafClass + * option with the additional requirement that the response include the + * RepositoryItems, if any, for every rim:ExtrinsicObjectType instance in + * the element. + */ + public enum RETURN_TYPE { + ObjectRef, RegistryObject, LeafClass, LeafClassWithRepositoryItem + } + + /** The default return type */ + public static final RETURN_TYPE DEFAULT_RETURN_TYPE = RETURN_TYPE.LeafClassWithRepositoryItem; + @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @DynamicSerializeElement @@ -93,12 +132,16 @@ public class ResponseOptionType { */ public String getReturnType() { if (returnType == null) { - return "LeafClassWithRepositoryItem"; + return DEFAULT_RETURN_TYPE.toString(); } else { return returnType; } } + public RETURN_TYPE getReturnTypeEnum() { + return RETURN_TYPE.valueOf(getReturnType()); + } + /** * Sets the value of the returnType property. * diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/package-info.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/package-info.java index c42741b247..628ed8f178 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/package-info.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/query/v4/package-info.java @@ -18,6 +18,8 @@ * further licensing information. **/ -@javax.xml.bind.annotation.XmlSchema(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:query:4.0", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@javax.xml.bind.annotation.XmlSchema(namespace = EbxmlNamespaces.QUERY_URI, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package oasis.names.tc.ebxml.regrep.xsd.query.v4; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ActionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ActionType.java index 378cee8abf..f3089e7251 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ActionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ActionType.java @@ -40,6 +40,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -69,7 +70,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Action") @XmlAccessorType(XmlAccessType.FIELD) @@ -77,14 +89,15 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; "affectedObjectRefs" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Action") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Action") public class ActionType extends ExtensibleObjectType implements Serializable { private static final long serialVersionUID = -8469820571747325703L; @Id - @SequenceGenerator(name = "ActionTypeGenerator", schema = "ebxml", sequenceName = "ebxml.Action_sequence") + @SequenceGenerator(name = "ActionTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".Action_sequence") @GeneratedValue(generator = "ActionTypeGenerator") @XmlTransient private Integer key; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/AnyValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/AnyValueType.java index 47c27d1a2f..697fa6bb92 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/AnyValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/AnyValueType.java @@ -33,6 +33,7 @@ import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Type; import org.w3c.dom.Element; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -62,10 +63,22 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 * */ @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) @XmlRootElement(name = "AnyValue") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AnyValueType", propOrder = { "anyValue" }) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/AssociationType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/AssociationType.java index 6f6906a64e..21bedfb2a5 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/AssociationType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/AssociationType.java @@ -32,6 +32,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Index; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -62,15 +63,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Association") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AssociationType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Association") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Association") public class AssociationType extends RegistryObjectType { @XmlAttribute(required = true) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/AuditableEventType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/AuditableEventType.java index 4289f697f1..bf5a4403ec 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/AuditableEventType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/AuditableEventType.java @@ -42,6 +42,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Type; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -70,20 +71,31 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "AuditableEvent") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AuditableEventType", propOrder = { "action" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "AuditableEvent") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "AuditableEvent") public class AuditableEventType extends RegistryObjectType { @XmlElement(name = "Action", required = true) @DynamicSerializeElement @OneToMany(cascade = CascadeType.ALL) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected List action; @Column diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/BooleanValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/BooleanValueType.java index 205ff9ef96..365305a741 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/BooleanValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/BooleanValueType.java @@ -32,6 +32,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -59,15 +60,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "BooleanValue") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "BooleanValueType", propOrder = { "booleanValue" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "BooleanValue") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "BooleanValue") public class BooleanValueType extends ValueType { @Column(name = COLUMN_NAME) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ClassificationNodeType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ClassificationNodeType.java index fe36a35a9e..f0c627d261 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ClassificationNodeType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ClassificationNodeType.java @@ -32,6 +32,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Index; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -60,15 +61,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ClassificationNodeType") @XmlRootElement(name = "ClassificationNode") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "ClassificationNode") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "ClassificationNode") public class ClassificationNodeType extends TaxonomyElementType { @XmlAttribute diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ClassificationSchemeType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ClassificationSchemeType.java index c97d7ec901..1c5fff08c1 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ClassificationSchemeType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ClassificationSchemeType.java @@ -31,6 +31,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -58,15 +59,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ClassificationScheme") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ClassificationSchemeType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL, include = "all") -@Table(schema = "ebxml", name = "ClassificationScheme") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL, include = "all") +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "ClassificationScheme") public class ClassificationSchemeType extends TaxonomyElementType { @XmlAttribute(required = true) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ClassificationType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ClassificationType.java index 93a35e1e12..5fb960fb41 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ClassificationType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ClassificationType.java @@ -31,6 +31,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -61,15 +62,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Classification") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ClassificationType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Classification") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Classification") public class ClassificationType extends RegistryObjectType { @XmlAttribute diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/CollectionValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/CollectionValueType.java index 56c27e56d6..b10ada72d7 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/CollectionValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/CollectionValueType.java @@ -39,6 +39,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -68,22 +69,33 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "CollectionValue") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CollectionValueType", propOrder = { "collectionValue" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "CollectionValue") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "CollectionValue") public class CollectionValueType extends ValueType { @XmlElement(name = "Element") @DynamicSerializeElement @Column(name = COLUMN_NAME) @ManyToMany(cascade = CascadeType.ALL) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected List collectionValue; @XmlAttribute diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/CommentType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/CommentType.java index 049083bc49..5129aaa75a 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/CommentType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/CommentType.java @@ -54,7 +54,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Comment") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DateTimeValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DateTimeValueType.java index 52477bf78e..8f1f7d5c5c 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DateTimeValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DateTimeValueType.java @@ -39,6 +39,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Type; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -66,15 +67,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "DateTimeValue") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DateTimeValueType", propOrder = { "dateTimeValue" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "DateTimeValue") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "DateTimeValue") public class DateTimeValueType extends ValueType { @Column(name = "DateTimeValue") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DeliveryInfoType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DeliveryInfoType.java index a8a36276c9..477e8b7bd1 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DeliveryInfoType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DeliveryInfoType.java @@ -39,6 +39,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Type; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -70,19 +71,31 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "DeliveryInfo") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DeliveryInfoType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "DeliveryInfo") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "DeliveryInfo") public class DeliveryInfoType extends ExtensibleObjectType { @Id - @SequenceGenerator(name = "DeliveryInfoTypeGenerator", schema = "ebxml", sequenceName = "ebxml.DeliveryInfo_sequence") + @SequenceGenerator(name = "DeliveryInfoTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".DeliveryInfo_sequence") @GeneratedValue(generator = "DeliveryInfoTypeGenerator") @XmlTransient private Integer key; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DurationValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DurationValueType.java index 3203667d89..1e0f35f449 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DurationValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DurationValueType.java @@ -34,6 +34,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Type; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -61,15 +62,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "DurationValue") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DurationValueType", propOrder = { "durationValue" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "DurationValue") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "DurationValue") public class DurationValueType extends ValueType { @XmlElement(name = "Value") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DynamicObjectRefType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DynamicObjectRefType.java index 06b9e2caf1..7f96c0a3eb 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DynamicObjectRefType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/DynamicObjectRefType.java @@ -34,6 +34,7 @@ import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Cascade; import org.hibernate.annotations.CascadeType; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -62,15 +63,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "DynamicObjectRef") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DynamicObjectRefType", propOrder = { "query" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "DynamicObjectRef") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "DynamicObjectRef") public class DynamicObjectRefType extends ObjectRefType { @XmlElement(name = "Query", required = true) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/EmailAddressType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/EmailAddressType.java index ef45791286..448cb346c0 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/EmailAddressType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/EmailAddressType.java @@ -37,6 +37,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -62,21 +63,33 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "EmailAddress") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "EmailAddressType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "EmailAddress") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "EmailAddress") public class EmailAddressType extends ExtensibleObjectType implements Serializable { private static final long serialVersionUID = -2958054699149020163L; @Id - @SequenceGenerator(name = "EmailAddressTypeGenerator", schema = "ebxml", sequenceName = "ebxml.EmailAddress_sequence") + @SequenceGenerator(name = "EmailAddressTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".EmailAddress_sequence") @GeneratedValue(generator = "EmailAddressTypeGenerator") @XmlTransient private Integer key; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/EntryType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/EntryType.java index 2e9d7d69d3..2cdd18b281 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/EntryType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/EntryType.java @@ -36,6 +36,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -65,15 +66,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Entry") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "EntryType", propOrder = { "entryKey", "entryValue" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Entry") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Entry") public class EntryType implements Serializable { private static final long serialVersionUID = -641063902591977048L; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExtensibleObjectType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExtensibleObjectType.java index 51f37bb547..b4f7ae4c63 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExtensibleObjectType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExtensibleObjectType.java @@ -20,10 +20,12 @@ package oasis.names.tc.ebxml.regrep.xsd.rim.v4; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; @@ -48,6 +50,7 @@ import org.hibernate.annotations.BatchSize; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.status.IUFStatusHandler; @@ -77,7 +80,18 @@ import com.raytheon.uf.common.status.UFStatus; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ExtensibleObject") @XmlAccessorType(XmlAccessType.FIELD) @@ -90,7 +104,7 @@ import com.raytheon.uf.common.status.UFStatus; RegistryResponseType.class, RegistryRequestType.class }) @DynamicSerialize @MappedSuperclass -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL, include = "all") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL, include = "all") public abstract class ExtensibleObjectType { private static final IUFStatusHandler statusHandler = UFStatus @@ -98,7 +112,7 @@ public abstract class ExtensibleObjectType { @BatchSize(size = 500) @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinTable(schema = "ebxml", inverseJoinColumns = @JoinColumn(name = "child_slot_key")) + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA, inverseJoinColumns = @JoinColumn(name = "child_slot_key")) @XmlElement(name = "Slot") @DynamicSerializeElement protected Set slot; @@ -222,6 +236,28 @@ public abstract class ExtensibleObjectType { return (T) retVal; } + @SuppressWarnings("unchecked") + public List getSlotValueAsList(String slotName) { + List retVal = new ArrayList(); + for (SlotType slot : getSlot()) { + if (slot.getName().equals(slotName)) { + retVal.add((T) slot.getSlotValue().getValue()); + } + } + return retVal; + } + + public Map getSlotNameValues() { + if (this.getSlot().isEmpty()) { + return Collections.emptyMap(); + } + Map map = new HashMap(slot.size()); + for (SlotType slot : this.getSlot()) { + map.put(slot.getName(), slot.getSlotValue().getValue()); + } + return map; + } + /* * (non-Javadoc) * diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExternalIdentifierType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExternalIdentifierType.java index 537fc23bc5..6b76c1c4f3 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExternalIdentifierType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExternalIdentifierType.java @@ -31,6 +31,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -60,15 +61,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ExternalIdentifier") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ExternalIdentifierType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "ExternalIdentifier") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "ExternalIdentifier") public class ExternalIdentifierType extends RegistryObjectType { @XmlAttribute diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExternalLinkType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExternalLinkType.java index b6cd3da7d8..2863803cf6 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExternalLinkType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExternalLinkType.java @@ -34,6 +34,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -63,15 +64,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ExternalIdentifier") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ExternalLinkType", propOrder = { "externalRef" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "ExternalLink") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "ExternalLink") public class ExternalLinkType extends RegistryObjectType { @XmlElement(name = "ExternalRef", required = true) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExtrinsicObjectType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExtrinsicObjectType.java index c37803f2c7..bef05fe0bd 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExtrinsicObjectType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ExtrinsicObjectType.java @@ -41,6 +41,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -75,7 +76,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ExtrinsicObject") @XmlAccessorType(XmlAccessType.FIELD) @@ -84,8 +96,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @XmlSeeAlso({ CommentType.class }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "ExtrinsicObject") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "ExtrinsicObject") public class ExtrinsicObjectType extends RegistryObjectType { @XmlElement(name = "ContentVersionInfo") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/FederationType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/FederationType.java index fb5e871c02..2d809228c8 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/FederationType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/FederationType.java @@ -33,6 +33,7 @@ import javax.xml.datatype.Duration; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -56,15 +57,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Federation") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "FederationType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Federation") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Federation") public class FederationType extends RegistryObjectType { @Transient diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/FloatValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/FloatValueType.java index 6b0d21bbc2..6217f9fc2a 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/FloatValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/FloatValueType.java @@ -32,6 +32,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -59,15 +60,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "FloatValue") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "FloatValueType", propOrder = { "floatValue" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "FloatValue") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "FloatValue") public class FloatValueType extends ValueType { @Column(name = COLUMN_NAME) @XmlElement(name = "Value") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/IdentifiableListType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/IdentifiableListType.java index bfc0e83449..b11f842df9 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/IdentifiableListType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/IdentifiableListType.java @@ -56,7 +56,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "IdentifiableList") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/IdentifiableType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/IdentifiableType.java index b038d19f46..b5979aa35a 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/IdentifiableType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/IdentifiableType.java @@ -35,6 +35,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import com.raytheon.uf.common.dataplugin.persist.IPersistableDataObject; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -61,7 +62,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Identifiable") @XmlAccessorType(XmlAccessType.FIELD) @@ -69,7 +81,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @XmlSeeAlso({ RegistryObjectType.class }) @DynamicSerialize @MappedSuperclass -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL, include = "all") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL, include = "all") public abstract class IdentifiableType extends ExtensibleObjectType implements IPersistableDataObject { diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/IntegerValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/IntegerValueType.java index f408d757a6..2ac95d80a2 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/IntegerValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/IntegerValueType.java @@ -34,6 +34,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -61,15 +62,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "IntegerValue") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "IntegerValueType", propOrder = { "integerValue" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "IntegerValue") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "IntegerValue") public class IntegerValueType extends ValueType { @Column(name = COLUMN_NAME) @XmlElement(name = "Value") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/InternationalStringType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/InternationalStringType.java index b8ec7a2b39..4fbf6c76c2 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/InternationalStringType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/InternationalStringType.java @@ -43,6 +43,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -73,21 +74,33 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "InternationalString") @XmlAccessorType(XmlAccessType.FIELD) @DynamicSerialize @XmlType(name = "InternationalStringType", propOrder = { "localizedString" }) @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL, include = "all") -@Table(schema = "ebxml", name = "InternationalString") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL, include = "all") +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "InternationalString") public class InternationalStringType implements Serializable { private static final long serialVersionUID = 2414977045816695691L; @Id - @SequenceGenerator(name = "InternationalStringTypeGenerator", schema = "ebxml", sequenceName = "ebxml.InternationalString_sequence") + @SequenceGenerator(name = "InternationalStringTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".InternationalString_sequence") @GeneratedValue(generator = "InternationalStringTypeGenerator") @XmlTransient private Integer key; @@ -95,7 +108,7 @@ public class InternationalStringType implements Serializable { @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) @XmlElement(name = "LocalizedString") @DynamicSerializeElement - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected List localizedString; public InternationalStringType() { diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/InternationalStringValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/InternationalStringValueType.java index b37ee61b5a..ebd8c2868c 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/InternationalStringValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/InternationalStringValueType.java @@ -33,6 +33,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -61,15 +62,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "InternationalStringValue") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "InternationalStringValueType", propOrder = { "internationalStringValue" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "InternationalStringValue") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "InternationalStringValue") public class InternationalStringValueType extends ValueType { @XmlElement(name = "Value") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/LocalizedStringType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/LocalizedStringType.java index 9b0bab8320..ff819210bd 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/LocalizedStringType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/LocalizedStringType.java @@ -36,6 +36,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -64,19 +65,31 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "LocalizedString") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "LocalizedStringType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "LocalizedString") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "LocalizedString") public class LocalizedStringType { @Id - @SequenceGenerator(name = "LocalizedStringTypeGenerator", schema = "ebxml", sequenceName = "ebxml.LocalizedString_sequence") + @SequenceGenerator(name = "LocalizedStringTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".LocalizedString_sequence") @GeneratedValue(generator = "LocalizedStringTypeGenerator") @XmlTransient private Integer key; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/MapType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/MapType.java index ff44015122..5fcc5d0728 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/MapType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/MapType.java @@ -42,6 +42,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -70,21 +71,33 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Map") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "MapType", propOrder = { "entry" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Map") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Map") public class MapType implements Serializable { private static final long serialVersionUID = 5533297201296624269L; @Id - @SequenceGenerator(name = "MapTypeGenerator", schema = "ebxml", sequenceName = "ebxml.Map_sequence") + @SequenceGenerator(name = "MapTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".Map_sequence") @GeneratedValue(generator = "MapTypeGenerator") @XmlTransient protected Integer key; @@ -96,7 +109,7 @@ public class MapType implements Serializable { @XmlElement(name = "Entry") @DynamicSerializeElement @ManyToMany(cascade = CascadeType.ALL) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected List entry; public MapType() { diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/MapValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/MapValueType.java index 6cb7925460..a8d4bef6ce 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/MapValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/MapValueType.java @@ -32,6 +32,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Type; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -59,10 +60,21 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @Entity(name = "MapValue") -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "MapValueType", propOrder = { "mapValue" }) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/NotificationType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/NotificationType.java index c800dd9957..37fe0a9485 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/NotificationType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/NotificationType.java @@ -38,6 +38,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Cascade; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -65,22 +66,33 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Notification") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "NotificationType", propOrder = { "event" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Notification") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Notification") public class NotificationType extends RegistryObjectType { @XmlElement(name = "Event", required = true) @DynamicSerializeElement @ManyToMany @Cascade({}) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected List event; @XmlAttribute(required = true) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ObjectFactory.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ObjectFactory.java index f95f3dbddd..323987a784 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ObjectFactory.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ObjectFactory.java @@ -25,6 +25,7 @@ import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.ISerializableObject; /** @@ -38,27 +39,40 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * of schema type definitions, element declarations and model groups. Factory * methods for each of these are provided in this class. * + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRegistry public class ObjectFactory implements ISerializableObject { private final static QName _IdentifiableList_QNAME = new QName( - "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", "IdentifiableList"); + EbxmlNamespaces.RIM_URI, "IdentifiableList"); private final static QName _ObjectRefList_QNAME = new QName( - "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", "ObjectRefList"); + EbxmlNamespaces.RIM_URI, "ObjectRefList"); private final static QName _Notification_QNAME = new QName( - "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", "Notification"); + EbxmlNamespaces.RIM_URI, "Notification"); private final static QName _RegistryObject_QNAME = new QName( - "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", "RegistryObject"); + EbxmlNamespaces.RIM_URI, "RegistryObject"); private final static QName _RegistryObjectList_QNAME = new QName( - "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", "RegistryObjectList"); + EbxmlNamespaces.RIM_URI, "RegistryObjectList"); private final static QName _ObjectRef_QNAME = new QName( - "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", "ObjectRef"); + EbxmlNamespaces.RIM_URI, "ObjectRef"); /** * Create a new ObjectFactory that can be used to create new instances of @@ -546,7 +560,7 @@ public class ObjectFactory implements ISerializableObject { * {@link IdentifiableListType }{@code >} * */ - @XmlElementDecl(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", name = "IdentifiableList") + @XmlElementDecl(namespace = EbxmlNamespaces.RIM_URI, name = "IdentifiableList") public JAXBElement createIdentifiableList( IdentifiableListType value) { return new JAXBElement(_IdentifiableList_QNAME, @@ -558,7 +572,7 @@ public class ObjectFactory implements ISerializableObject { * {@link ObjectRefListType }{@code >} * */ - @XmlElementDecl(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", name = "ObjectRefList") + @XmlElementDecl(namespace = EbxmlNamespaces.RIM_URI, name = "ObjectRefList") public JAXBElement createObjectRefList( ObjectRefListType value) { return new JAXBElement(_ObjectRefList_QNAME, @@ -570,7 +584,7 @@ public class ObjectFactory implements ISerializableObject { * {@link NotificationType }{@code >} * */ - @XmlElementDecl(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", name = "Notification") + @XmlElementDecl(namespace = EbxmlNamespaces.RIM_URI, name = "Notification") public JAXBElement createNotification( NotificationType value) { return new JAXBElement(_Notification_QNAME, @@ -582,7 +596,7 @@ public class ObjectFactory implements ISerializableObject { * {@link RegistryObjectType }{@code >} * */ - @XmlElementDecl(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", name = "RegistryObject") + @XmlElementDecl(namespace = EbxmlNamespaces.RIM_URI, name = "RegistryObject") public JAXBElement createRegistryObject( RegistryObjectType value) { return new JAXBElement(_RegistryObject_QNAME, @@ -594,7 +608,7 @@ public class ObjectFactory implements ISerializableObject { * {@link RegistryObjectListType }{@code >} * */ - @XmlElementDecl(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", name = "RegistryObjectList") + @XmlElementDecl(namespace = EbxmlNamespaces.RIM_URI, name = "RegistryObjectList") public JAXBElement createRegistryObjectList( RegistryObjectListType value) { return new JAXBElement( @@ -607,7 +621,7 @@ public class ObjectFactory implements ISerializableObject { * {@code >} * */ - @XmlElementDecl(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", name = "ObjectRef") + @XmlElementDecl(namespace = EbxmlNamespaces.RIM_URI, name = "ObjectRef") public JAXBElement createObjectRef(ObjectRefType value) { return new JAXBElement(_ObjectRef_QNAME, ObjectRefType.class, null, value); diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ObjectRefListType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ObjectRefListType.java index 61d9964bb6..280ccd3102 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ObjectRefListType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ObjectRefListType.java @@ -42,6 +42,7 @@ import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Cascade; import org.hibernate.annotations.CascadeType; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -69,19 +70,31 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ObjectRefList") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ObjectRefListType", propOrder = { "objectRef" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "ObjectRefList") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "ObjectRefList") public class ObjectRefListType { @Id - @SequenceGenerator(name = "ObjectRefListTypeGenerator", schema = "ebxml", sequenceName = "ebxml.ObjectRefList_sequence") + @SequenceGenerator(name = "ObjectRefListTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".ObjectRefList_sequence") @GeneratedValue(generator = "ObjectRefListTypeGenerator") @XmlTransient private Integer key; @@ -90,7 +103,7 @@ public class ObjectRefListType { @DynamicSerializeElement @ManyToMany @Cascade({ CascadeType.SAVE_UPDATE }) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected List objectRef; public Integer getKey() { diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ObjectRefType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ObjectRefType.java index 70118fe2a1..7f3998f40b 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ObjectRefType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ObjectRefType.java @@ -36,6 +36,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import com.raytheon.uf.common.dataplugin.persist.IPersistableDataObject; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -61,7 +62,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ObjectRef") @XmlAccessorType(XmlAccessType.FIELD) @@ -69,9 +81,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @XmlSeeAlso({ DynamicObjectRefType.class }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) -@Table(schema = "ebxml", name = "ObjectRef") +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "ObjectRef") public class ObjectRefType extends ExtensibleObjectType implements IPersistableDataObject { diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/OrganizationType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/OrganizationType.java index 6def0b34c2..7936ddb0b7 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/OrganizationType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/OrganizationType.java @@ -25,6 +25,7 @@ import java.util.List; import javax.persistence.CascadeType; import javax.persistence.Entity; +import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; import javax.persistence.Table; @@ -38,6 +39,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -65,21 +67,32 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Organization") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "OrganizationType", propOrder = { "organization" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Organization") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Organization") public class OrganizationType extends PartyType { @XmlElement(name = "Organization") @DynamicSerializeElement @ManyToMany(cascade = CascadeType.ALL) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA, joinColumns = @JoinColumn(name = "org_id"), inverseJoinColumns = @JoinColumn(name = "org_id2")) protected List organization; @XmlAttribute diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ParameterType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ParameterType.java index 11a6bed5c6..1668f8c382 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ParameterType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ParameterType.java @@ -42,6 +42,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -76,19 +77,31 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Parameter") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ParameterType", propOrder = { "name", "description" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Parameter") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Parameter") public class ParameterType extends ExtensibleObjectType implements Serializable { @Id - @SequenceGenerator(name = "ParameterTypeGenerator", schema = "ebxml", sequenceName = "ebxml.Parameter_sequence") + @SequenceGenerator(name = "ParameterTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".Parameter_sequence") @GeneratedValue(generator = "ParameterTypeGenerator") @XmlTransient protected Integer key; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PartyType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PartyType.java index ae89a34c1a..1b219af2df 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PartyType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PartyType.java @@ -34,6 +34,7 @@ import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -61,7 +62,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Party") @XmlAccessorType(XmlAccessType.FIELD) @@ -75,19 +87,19 @@ public abstract class PartyType extends RegistryObjectType { @XmlElement(name = "PostalAddress") @DynamicSerializeElement @ManyToMany(cascade = CascadeType.ALL) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected List postalAddress; @XmlElement(name = "TelephoneNumber") @DynamicSerializeElement @ManyToMany(cascade = CascadeType.ALL) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected List telephoneNumber; @XmlElement(name = "EmailAddress") @DynamicSerializeElement @ManyToMany(cascade = CascadeType.ALL) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected List emailAddress; /** diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PersonNameType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PersonNameType.java index 56608680f9..ef7d410828 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PersonNameType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PersonNameType.java @@ -34,6 +34,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -59,15 +60,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "PersonName") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PersonNameType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "PersonName") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "PersonName") public class PersonNameType extends ExtensibleObjectType implements Serializable { diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PersonType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PersonType.java index e65c31d398..1c5318ab23 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PersonType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PersonType.java @@ -33,6 +33,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -58,6 +59,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 * */ @XmlRootElement(name = "Person") @@ -65,8 +78,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @XmlType(name = "PersonType", propOrder = { "personName" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Person") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Person") public class PersonType extends PartyType { @XmlElement(name = "PersonName") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PostalAddressType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PostalAddressType.java index dadafb042b..7a575d3646 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PostalAddressType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/PostalAddressType.java @@ -35,6 +35,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -65,19 +66,31 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "PostalAddress") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "PostalAddressType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "PostalAddress") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "PostalAddress") public class PostalAddressType extends ExtensibleObjectType { @Id - @SequenceGenerator(name = "PostalAddressTypeGenerator", schema = "ebxml", sequenceName = "ebxml.PostalAddress_sequence") + @SequenceGenerator(name = "PostalAddressTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".PostalAddress_sequence") @GeneratedValue(generator = "PostalAddressTypeGenerator") @XmlTransient private Integer key; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/QueryDefinitionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/QueryDefinitionType.java index df51633c07..ff44521629 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/QueryDefinitionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/QueryDefinitionType.java @@ -38,6 +38,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -66,7 +67,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "QueryDefinition") @XmlAccessorType(XmlAccessType.FIELD) @@ -74,14 +86,14 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; "queryExpression" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "QueryDefinition") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "QueryDefinition") public class QueryDefinitionType extends RegistryObjectType { @ManyToMany(cascade = CascadeType.ALL) @XmlElement(name = "Parameter") @DynamicSerializeElement - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected List parameter; @ManyToOne(cascade = CascadeType.ALL) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/QueryExpressionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/QueryExpressionType.java index f385a0c1d3..969afbe9b3 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/QueryExpressionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/QueryExpressionType.java @@ -38,6 +38,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -66,7 +67,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "QueryExpression") @XmlAccessorType(XmlAccessType.FIELD) @@ -74,13 +86,14 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @XmlSeeAlso({ StringQueryExpressionType.class, XMLQueryExpressionType.class }) @DynamicSerialize @Entity -@Table(schema = "ebxml", name = "QueryExpression") -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "QueryExpression") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public class QueryExpressionType extends ExtensibleObjectType { @Id - @SequenceGenerator(name = "QueryExpressionTypeGenerator", schema = "ebxml", sequenceName = "ebxml.QueryExpression_sequence") + @SequenceGenerator(name = "QueryExpressionTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".QueryExpression_sequence") @GeneratedValue(generator = "QueryExpressionTypeGenerator") @XmlTransient protected Integer key; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/QueryType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/QueryType.java index 2b87be7193..7ffd46c987 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/QueryType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/QueryType.java @@ -37,6 +37,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -63,19 +64,31 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Query") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "QueryType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Query") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Query") public class QueryType extends ExtensibleObjectType { @Id - @SequenceGenerator(name = "QueryTypeGenerator", schema = "ebxml", sequenceName = "ebxml.Query_sequence") + @SequenceGenerator(name = "QueryTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".Query_sequence") @GeneratedValue(generator = "QueryTypeGenerator") @XmlTransient private Integer key; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryObjectListType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryObjectListType.java index 92e35e3c68..330549dac3 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryObjectListType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryObjectListType.java @@ -42,6 +42,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Cascade; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -69,28 +70,40 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "RegistryObjectList") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RegistryObjectListType", propOrder = { "registryObject" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "RegistryObjectList") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "RegistryObjectList") public class RegistryObjectListType implements Serializable { private static final long serialVersionUID = -254507015539461400L; @Id - @SequenceGenerator(name = "RegistryObjectListTypeGenerator", schema = "ebxml", sequenceName = "ebxml.RegistryObjectList_sequence") + @SequenceGenerator(name = "RegistryObjectListTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".RegistryObjectList_sequence") @GeneratedValue(generator = "RegistryObjectListTypeGenerator") @XmlTransient private Integer key; @ManyToMany @Cascade({}) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) @XmlElement(name = "RegistryObject") @DynamicSerializeElement protected List registryObject; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryObjectType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryObjectType.java index 8ec47491bd..05662aa7e3 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryObjectType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryObjectType.java @@ -46,6 +46,7 @@ import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Cascade; import org.hibernate.annotations.Index; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -84,7 +85,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "RegistryObject") @XmlAccessorType(XmlAccessType.FIELD) @@ -102,9 +114,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; RoleType.class }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL, include = "all") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL, include = "all") @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) -@Table(schema = "ebxml", name = "RegistryObject") +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "RegistryObject") public class RegistryObjectType extends IdentifiableType { @XmlElement(name = "Name") @DynamicSerializeElement @@ -127,19 +139,19 @@ public class RegistryObjectType extends IdentifiableType { org.hibernate.annotations.CascadeType.DETACH, org.hibernate.annotations.CascadeType.MERGE }) @ManyToMany(fetch = FetchType.LAZY) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected Set classification; @XmlElement(name = "ExternalIdentifier") @DynamicSerializeElement @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected Set externalIdentifier; @XmlElement(name = "ExternalLink") @DynamicSerializeElement @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected Set externalLink; @XmlAttribute @@ -442,4 +454,8 @@ public class RegistryObjectType extends IdentifiableType { this.status = value; } + public String toString() { + return this.id; + } + } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryPackageType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryPackageType.java index 3187dddb20..f14e2f7f16 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryPackageType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryPackageType.java @@ -33,6 +33,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -61,15 +62,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "RegistryPackage") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RegistryPackageType", propOrder = { "registryObjectList" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "RegistryPackage") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "RegistryPackage") public class RegistryPackageType extends RegistryObjectType { @OneToOne(cascade = CascadeType.ALL) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryType.java index 2f8ee70580..681cf755cb 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RegistryType.java @@ -36,6 +36,7 @@ import javax.xml.datatype.Duration; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -72,15 +73,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Registry") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RegistryType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Registry") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Registry") public class RegistryType extends RegistryObjectType { @XmlAttribute(required = true) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RoleType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RoleType.java index 6bc62a4e34..82f3396856 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RoleType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/RoleType.java @@ -31,6 +31,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -59,15 +60,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Role") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "RoleType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Role") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Role") public class RoleType extends RegistryObjectType { @XmlAttribute(required = true) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceBindingType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceBindingType.java index f7d067fa22..71a1c620a3 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceBindingType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceBindingType.java @@ -31,6 +31,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -57,15 +58,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ServiceBinding") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ServiceBindingType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "ServiceBinding") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "ServiceBinding") public class ServiceBindingType extends RegistryObjectType { @XmlAttribute diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceEndpointType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceEndpointType.java index 54f2fc0012..4b94378b94 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceEndpointType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceEndpointType.java @@ -32,6 +32,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -60,15 +61,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ServiceEndpoint") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ServiceEndpointType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "ServiceEndpoint") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "ServiceEndpoint") public class ServiceEndpointType extends RegistryObjectType { @XmlAttribute diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceInterfaceType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceInterfaceType.java index 1f8619c5f9..f1fe97ab8f 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceInterfaceType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceInterfaceType.java @@ -32,6 +32,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; /** @@ -56,6 +57,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 * */ @XmlRootElement(name = "ServiceInterface") @@ -63,8 +76,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; @XmlType(name = "ServiceInterfaceType") @DynamicSerialize @Entity -@Table(schema = "ebxml", name = "ServiceInterface") -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "ServiceInterface") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public class ServiceInterfaceType extends RegistryObjectType { diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceType.java index 9315ffa309..e04c63e853 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ServiceType.java @@ -38,6 +38,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -67,21 +68,32 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Service") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ServiceType", propOrder = { "serviceEndpoint" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Service") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Service") public class ServiceType extends RegistryObjectType { @ManyToMany(cascade = CascadeType.ALL) @XmlElement(name = "ServiceEndpoint") @DynamicSerializeElement - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected List serviceEndpoint; @XmlAttribute diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SimpleLinkType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SimpleLinkType.java index c3cac1bc7d..952ad8874a 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SimpleLinkType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SimpleLinkType.java @@ -39,6 +39,8 @@ import org.w3.v1999.xlink.ActuateType; import org.w3.v1999.xlink.ShowType; import org.w3.v1999.xlink.TypeType; +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -66,19 +68,31 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "SimpleLink") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SimpleLinkType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "SimpleLink") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "SimpleLink") public class SimpleLinkType { @Id - @SequenceGenerator(name = "SimpleLinkTypeGenerator", schema = "ebxml", sequenceName = "ebxml.SimpleLink_sequence") + @SequenceGenerator(name = "SimpleLinkTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + "SimpleLink_sequence") @GeneratedValue(generator = "SimpleLinkTypeGenerator") @XmlTransient private Integer key; @@ -87,31 +101,31 @@ public class SimpleLinkType { return key; } - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @Transient protected TypeType type; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String href; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String role; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String arcrole; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String title; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @Transient protected ShowType show; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @Transient protected ActuateType actuate; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SlotType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SlotType.java index e122d4acf8..8e15ddc66d 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SlotType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SlotType.java @@ -45,6 +45,7 @@ import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Index; import com.raytheon.uf.common.dataplugin.persist.IPersistableDataObject; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -77,22 +78,34 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Slot") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SlotType", propOrder = { "slotValue" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL, include = "all") -@Table(schema = "ebxml", name = "Slot") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL, include = "all") +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Slot") public class SlotType extends ExtensibleObjectType implements IPersistableDataObject, Serializable { private static final long serialVersionUID = -2184582316481503043L; @Id - @SequenceGenerator(name = "ExtensibleObjectTypeGenerator", schema = "ebxml", sequenceName = "ebxml.Slot_sequence") + @SequenceGenerator(name = "ExtensibleObjectTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".Slot_sequence") @GeneratedValue(generator = "ExtensibleObjectTypeGenerator") @XmlTransient private Integer key; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SlotValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SlotValueType.java index ffa4fb1904..1b02b5cc7d 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SlotValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SlotValueType.java @@ -33,6 +33,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Type; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -60,15 +61,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "SlotValue") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SlotValueType", propOrder = { "slotValue" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "SlotValue") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "SlotValue") public class SlotValueType extends ValueType { @XmlElement(name = "Slot") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/StringQueryExpressionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/StringQueryExpressionType.java index 786fb9a44f..b108c25123 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/StringQueryExpressionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/StringQueryExpressionType.java @@ -31,6 +31,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -59,11 +60,22 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @Entity -@Table(schema = "ebxml", name = "StringQueryExpression") -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "StringQueryExpression") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) @XmlRootElement(name = "StringQueryExpression") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "StringQueryExpressionType", propOrder = { "value" }) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/StringValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/StringValueType.java index ebb5356ccd..b0434377a8 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/StringValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/StringValueType.java @@ -32,6 +32,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -60,15 +61,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "StringValue") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "StringValueType", propOrder = { "stringValue" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "StringValue") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "StringValue") public class StringValueType extends ValueType { @Column(name = COLUMN_NAME, columnDefinition = "text") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SubscriptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SubscriptionType.java index ce5fa97b7b..3f2f08db4c 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SubscriptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/SubscriptionType.java @@ -44,6 +44,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Type; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -73,21 +74,32 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Subscription") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SubscriptionType", propOrder = { "deliveryInfo", "selector" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Subscription") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Subscription") public class SubscriptionType extends RegistryObjectType { @OneToMany(cascade = CascadeType.ALL) @XmlElement(name = "DeliveryInfo") @DynamicSerializeElement - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected List deliveryInfo; @OneToOne(cascade = CascadeType.ALL) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/TaxonomyElementType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/TaxonomyElementType.java index c5aa3f878b..e76bcb6dd6 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/TaxonomyElementType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/TaxonomyElementType.java @@ -36,6 +36,7 @@ import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -63,7 +64,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "TaxonomyElement") @XmlAccessorType(XmlAccessType.FIELD) @@ -77,7 +89,7 @@ public abstract class TaxonomyElementType extends RegistryObjectType { @ManyToMany(cascade = CascadeType.ALL) @XmlElement(name = "ClassificationNode") @DynamicSerializeElement - @JoinTable(schema = "ebxml") + @JoinTable(schema = RegrepUtil.EBXML_SCHEMA) protected Set classificationNode; /** diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/TelephoneNumberType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/TelephoneNumberType.java index d02f0c098d..6684dff7c6 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/TelephoneNumberType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/TelephoneNumberType.java @@ -35,6 +35,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.registry.schemas.ebxml.util.annotations.RegistryObjectReference; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -63,6 +64,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 * */ @XmlRootElement(name = "TelephoneNumber") @@ -70,12 +83,13 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @XmlType(name = "TelephoneNumberType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "TelephoneNumber") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "TelephoneNumber") public class TelephoneNumberType extends ExtensibleObjectType { @Id - @SequenceGenerator(name = "TelephoneNumberTypeGenerator", schema = "ebxml", sequenceName = "ebxml.TelephoneNumber_sequence") + @SequenceGenerator(name = "TelephoneNumberTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".TelephoneNumber_sequence") @GeneratedValue(generator = "TelephoneNumberTypeGenerator") @XmlTransient private Integer key; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ValueType.java index 8e6e7b9c42..f2003aa677 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/ValueType.java @@ -38,6 +38,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import com.raytheon.uf.common.dataplugin.persist.IPersistableDataObject; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; /** @@ -61,7 +62,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "Value") @XmlAccessorType(XmlAccessType.FIELD) @@ -73,13 +85,14 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; DurationValueType.class, CollectionValueType.class }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "Value") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "Value") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public abstract class ValueType implements IPersistableDataObject { @Id - @SequenceGenerator(name = "ValueTypeGenerator", schema = "ebxml", sequenceName = "ebxml.Value_sequence") + @SequenceGenerator(name = "ValueTypeGenerator", schema = RegrepUtil.EBXML_SCHEMA, sequenceName = RegrepUtil.EBXML_SCHEMA + + ".Value_sequence") @GeneratedValue(generator = "ValueTypeGenerator") @XmlTransient protected Integer key; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/VersionInfoType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/VersionInfoType.java index b2095195f6..94b3044f0d 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/VersionInfoType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/VersionInfoType.java @@ -54,14 +54,25 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @Embeddable @XmlRootElement(name = "VersionInfo") @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class VersionInfoType implements Serializable, - IPersistableDataObject { + IPersistableDataObject, Comparable { private static final long serialVersionUID = -2869857115641981790L; @@ -135,4 +146,52 @@ public class VersionInfoType implements Serializable, return versionName; } + @Override + public int compareTo(VersionInfoType obj) { + + if (this.versionName == null && obj.getVersionName() == null) { + return 0; + } else if (this.versionName == null) { + return -1; + } else if (obj.getVersionName() == null) { + return 1; + } + + String[] versionParts1 = this.versionName.split("\\."); + String[] versionParts2 = obj.versionName.split("\\."); + + for (int i = 0; i < versionParts1.length; i++) { + int part1 = Integer.parseInt(versionParts1[i]); + if (i >= versionParts2.length) { + return 1; + } + int part2 = Integer.parseInt(versionParts2[i]); + if (part1 > part2) { + return 1; + } else if (part1 < part2) { + return -1; + } else if (i >= versionParts1.length - 1 + && versionParts2.length > i) { + return -1; + } + } + return 0; + } + + public boolean greaterThan(VersionInfoType obj) { + return this.compareTo(obj) > 0 ? true : false; + } + + public boolean greaterThanEquals(VersionInfoType obj) { + return this.compareTo(obj) >= 0 ? true : false; + } + + public boolean lessThan(VersionInfoType obj) { + return this.compareTo(obj) < 0 ? true : false; + } + + public boolean lessThanEquals(VersionInfoType obj) { + return this.compareTo(obj) <= 0 ? true : false; + } + } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/VocabularyTermType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/VocabularyTermType.java index c88b218d88..006407ace8 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/VocabularyTermType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/VocabularyTermType.java @@ -34,6 +34,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -60,15 +61,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "VocabularyTerm") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "VocabularyTermType") @DynamicSerialize @Entity -@Table(schema = "ebxml", name = "VocabularyTerm") -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "VocabularyTerm") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) public class VocabularyTermType implements Serializable { private static final long serialVersionUID = -7560901570669843677L; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/VocabularyTermValueType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/VocabularyTermValueType.java index 19644910df..c3ccff2258 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/VocabularyTermValueType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/VocabularyTermValueType.java @@ -33,6 +33,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Type; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -61,15 +62,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "VocabularyTermValue") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "VocabularyTermValueType", propOrder = { "vocabularyTermValue" }) @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "VocabularyTermValue") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "VocabularyTermValue") public class VocabularyTermValueType extends ValueType { @XmlElement(name = "Value") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/WorkflowActionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/WorkflowActionType.java index 1337e57bc1..164d8435b1 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/WorkflowActionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/WorkflowActionType.java @@ -31,6 +31,7 @@ import javax.xml.bind.annotation.XmlType; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -57,15 +58,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "WorkflowAction") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "WorkflowActionType") @DynamicSerialize @Entity -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) -@Table(schema = "ebxml", name = "WorkflowAction") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "WorkflowAction") public class WorkflowActionType extends RegistryObjectType { @XmlAttribute(required = true) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/XMLQueryExpressionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/XMLQueryExpressionType.java index b2d63fda5a..7609212bef 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/XMLQueryExpressionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/XMLQueryExpressionType.java @@ -34,6 +34,7 @@ import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Type; import org.w3c.dom.Element; +import com.raytheon.uf.common.registry.RegrepUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -62,11 +63,22 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @Entity -@Table(schema = "ebxml", name = "XMLQueryExpression") -@Cache(region = "registryObjects", usage = CacheConcurrencyStrategy.TRANSACTIONAL) +@Table(schema = RegrepUtil.EBXML_SCHEMA, name = "XMLQueryExpression") +@Cache(region = RegrepUtil.DB_CACHE_REGION, usage = CacheConcurrencyStrategy.TRANSACTIONAL) @XmlRootElement(name = "XMLQueryExpression") @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "XMLQueryExpressionType", propOrder = { "any" }) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/package-info.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/package-info.java index bfa0c39100..35081a00fa 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/package-info.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rim/v4/package-info.java @@ -18,6 +18,8 @@ * further licensing information. **/ -@javax.xml.bind.annotation.XmlSchema(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@javax.xml.bind.annotation.XmlSchema(namespace = EbxmlNamespaces.RIM_URI, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package oasis.names.tc.ebxml.regrep.xsd.rim.v4; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/AuthenticationExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/AuthenticationExceptionType.java index 73f254e0fb..a04263bdae 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/AuthenticationExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/AuthenticationExceptionType.java @@ -46,7 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "AuthenticationException") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/AuthorizationExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/AuthorizationExceptionType.java index f10bab1db8..8f9122dc7a 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/AuthorizationExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/AuthorizationExceptionType.java @@ -46,7 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "AuthorizationException") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/InvalidRequestExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/InvalidRequestExceptionType.java index 8185343466..a72d88ebef 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/InvalidRequestExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/InvalidRequestExceptionType.java @@ -46,7 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "InvalidRequestException") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ObjectExistsExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ObjectExistsExceptionType.java index 82004237af..c294e406e3 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ObjectExistsExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ObjectExistsExceptionType.java @@ -46,6 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 * */ @XmlRootElement(name = "ObjectExistsException") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ObjectFactory.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ObjectFactory.java index 187ef4cf06..2c1f9dae96 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ObjectFactory.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ObjectFactory.java @@ -25,6 +25,7 @@ import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.ISerializableObject; /** @@ -38,18 +39,30 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * of schema type definitions, element declarations and model groups. Factory * methods for each of these are provided in this class. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRegistry public class ObjectFactory implements ISerializableObject { private final static QName _RegistryResponse_QNAME = new QName( - "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", "RegistryResponse"); + EbxmlNamespaces.RS_URI, "RegistryResponse"); private final static QName _RegistryException_QNAME = new QName( - "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", "RegistryException"); + EbxmlNamespaces.RS_URI, "RegistryException"); private final static QName _RegistryRequest_QNAME = new QName( - "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", "RegistryRequest"); + EbxmlNamespaces.RS_URI, "RegistryRequest"); /** * Create a new ObjectFactory that can be used to create new instances of @@ -168,7 +181,7 @@ public class ObjectFactory implements ISerializableObject { * {@link RegistryResponseType }{@code >} * */ - @XmlElementDecl(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", name = "RegistryResponse") + @XmlElementDecl(namespace = EbxmlNamespaces.RS_URI, name = "RegistryResponse") public JAXBElement createRegistryResponse( RegistryResponseType value) { return new JAXBElement(_RegistryResponse_QNAME, @@ -180,7 +193,7 @@ public class ObjectFactory implements ISerializableObject { * {@link RegistryExceptionType }{@code >} * */ - @XmlElementDecl(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", name = "RegistryException") + @XmlElementDecl(namespace = EbxmlNamespaces.RS_URI, name = "RegistryException") public JAXBElement createRegistryException( RegistryExceptionType value) { return new JAXBElement(_RegistryException_QNAME, @@ -192,7 +205,7 @@ public class ObjectFactory implements ISerializableObject { * {@link RegistryRequestType }{@code >} * */ - @XmlElementDecl(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", name = "RegistryRequest") + @XmlElementDecl(namespace = EbxmlNamespaces.RS_URI, name = "RegistryRequest") public JAXBElement createRegistryRequest( RegistryRequestType value) { return new JAXBElement(_RegistryRequest_QNAME, diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ObjectNotFoundExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ObjectNotFoundExceptionType.java index 93db30092b..3005b85e0e 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ObjectNotFoundExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ObjectNotFoundExceptionType.java @@ -46,7 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ObjectNotFoundException") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/QuotaExceededExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/QuotaExceededExceptionType.java index 11082aff6c..dbfd5861f1 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/QuotaExceededExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/QuotaExceededExceptionType.java @@ -46,7 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "QuotaExceededException") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ReferencesExistExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ReferencesExistExceptionType.java index f484640522..68e3a10d84 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ReferencesExistExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/ReferencesExistExceptionType.java @@ -46,7 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ReferencesExistException") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/RegistryExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/RegistryExceptionType.java index 3fc00e4688..0c6f380b6b 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/RegistryExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/RegistryExceptionType.java @@ -60,7 +60,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "RegistryException") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/RegistryRequestType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/RegistryRequestType.java index 8c92ee2bf0..fe1fba8caa 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/RegistryRequestType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/RegistryRequestType.java @@ -64,7 +64,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "RegistryRequest") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/RegistryResponseType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/RegistryResponseType.java index 7a46b8bc5f..d0a5d3e479 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/RegistryResponseType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/RegistryResponseType.java @@ -44,8 +44,10 @@ import oasis.names.tc.ebxml.regrep.xsd.spi.v4.CatalogObjectsResponse; import oasis.names.tc.ebxml.regrep.xsd.spi.v4.FilterObjectsResponse; import oasis.names.tc.ebxml.regrep.xsd.spi.v4.ValidateObjectsResponse; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +import com.raytheon.uf.common.util.CollectionUtil; /** * Base type for all ebXML Registry responses @@ -73,6 +75,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 * */ @XmlRootElement(name = "RegistryResponse") @@ -88,11 +102,11 @@ public class RegistryResponseType extends ExtensibleObjectType { @DynamicSerializeElement protected List exception; - @XmlElement(name = "RegistryObjectList", namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0") + @XmlElement(name = "RegistryObjectList", namespace = EbxmlNamespaces.RIM_URI) @DynamicSerializeElement protected RegistryObjectListType registryObjectList; - @XmlElement(name = "ObjectRefList", namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0") + @XmlElement(name = "ObjectRefList", namespace = EbxmlNamespaces.RIM_URI) @DynamicSerializeElement protected ObjectRefListType objectRefList; @@ -111,7 +125,7 @@ public class RegistryResponseType extends ExtensibleObjectType { public List getRegistryObjects() { if (registryObjectList == null) { - return Collections.emptyList(); + this.registryObjectList = new RegistryObjectListType(); } return registryObjectList.getRegistryObject(); } @@ -134,7 +148,7 @@ public class RegistryResponseType extends ExtensibleObjectType { } public void addObjectRefs(Collection objRefs) { - if (objRefs == null || objRefs.isEmpty()) { + if (CollectionUtil.isNullOrEmpty(objRefs)) { return; } if (objectRefList == null) { @@ -143,6 +157,13 @@ public class RegistryResponseType extends ExtensibleObjectType { objectRefList.getObjectRef().addAll(objRefs); } + public void addObjectRef(ObjectRefType objRef) { + if (objectRefList == null) { + objectRefList = new ObjectRefListType(); + } + objectRefList.getObjectRef().add(objRef); + } + /** * Gets the value of the exception property. * diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/TimeoutExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/TimeoutExceptionType.java index fcee16cca2..7c340b2cc8 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/TimeoutExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/TimeoutExceptionType.java @@ -46,6 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 * */ @XmlRootElement(name = "TimeoutException") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/UnresolvedReferenceExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/UnresolvedReferenceExceptionType.java index 295999fedb..17f1b3eed7 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/UnresolvedReferenceExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/UnresolvedReferenceExceptionType.java @@ -46,7 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "UnresolvedReferenceException") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/UnsupportedCapabilityExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/UnsupportedCapabilityExceptionType.java index af2e36c62e..52e527876a 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/UnsupportedCapabilityExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/UnsupportedCapabilityExceptionType.java @@ -46,6 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 * */ @XmlRootElement(name = "UnsupportedCapabilityException") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/package-info.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/package-info.java index a9dd78624f..51e82e1010 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/package-info.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/rs/v4/package-info.java @@ -18,6 +18,8 @@ * further licensing information. **/ -@javax.xml.bind.annotation.XmlSchema(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@javax.xml.bind.annotation.XmlSchema(namespace = EbxmlNamespaces.RS_URI, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package oasis.names.tc.ebxml.regrep.xsd.rs.v4; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/CatalogObjectsRequest.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/CatalogObjectsRequest.java index 66f9a432cd..b08596d145 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/CatalogObjectsRequest.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/CatalogObjectsRequest.java @@ -37,6 +37,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectListType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryRequestType; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -63,7 +64,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "query", "objectRefList", "originalObjects", @@ -76,7 +88,7 @@ public class CatalogObjectsRequest extends RegistryRequestType { @DynamicSerializeElement protected QueryType query; - @XmlElement(name = "ObjectRefList", namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0") + @XmlElement(name = "ObjectRefList", namespace = EbxmlNamespaces.RIM_URI) @DynamicSerializeElement protected ObjectRefListType objectRefList; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/CatalogObjectsResponse.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/CatalogObjectsResponse.java index b78e40ac4a..1d800feb47 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/CatalogObjectsResponse.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/CatalogObjectsResponse.java @@ -46,7 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/CatalogingExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/CatalogingExceptionType.java index 5fb920e653..c5f7377792 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/CatalogingExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/CatalogingExceptionType.java @@ -48,7 +48,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "CatalogingException") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/FilterObjectsRequest.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/FilterObjectsRequest.java index 90b37eb027..7b6389c60b 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/FilterObjectsRequest.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/FilterObjectsRequest.java @@ -59,7 +59,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "originalObjects", "invocationControlFile" }) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/FilterObjectsResponse.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/FilterObjectsResponse.java index 572b68b86a..d6ca9ee9e0 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/FilterObjectsResponse.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/FilterObjectsResponse.java @@ -46,7 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/FilteringExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/FilteringExceptionType.java index 5f337536f5..4246368654 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/FilteringExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/FilteringExceptionType.java @@ -48,7 +48,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "FilteringException") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ObjectFactory.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ObjectFactory.java index f56a2c9a77..87b8050f98 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ObjectFactory.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ObjectFactory.java @@ -35,6 +35,18 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * of schema type definitions, element declarations and model groups. Factory * methods for each of these are provided in this class. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRegistry public class ObjectFactory implements ISerializableObject { diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ValidateObjectsRequest.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ValidateObjectsRequest.java index 0a8f31a274..87903afb20 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ValidateObjectsRequest.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ValidateObjectsRequest.java @@ -38,6 +38,7 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectListType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryRequestType; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -64,7 +65,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "query", "objectRefList", "originalObjects", @@ -77,7 +89,7 @@ public class ValidateObjectsRequest extends RegistryRequestType { @DynamicSerializeElement protected QueryType query; - @XmlElement(name = "ObjectRefList", namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0") + @XmlElement(name = "ObjectRefList", namespace = EbxmlNamespaces.RIM_URI) @DynamicSerializeElement protected ObjectRefListType objectRefList; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ValidateObjectsResponse.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ValidateObjectsResponse.java index 7ee4fbe8f2..2fcc985976 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ValidateObjectsResponse.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ValidateObjectsResponse.java @@ -48,7 +48,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "") diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ValidationExceptionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ValidationExceptionType.java index 60632f5878..22d1fb1d6b 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ValidationExceptionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/ValidationExceptionType.java @@ -48,7 +48,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement(name = "ValidationException") @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/package-info.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/package-info.java index a3897b969d..ef4ca332a4 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/package-info.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/oasis/names/tc/ebxml/regrep/xsd/spi/v4/package-info.java @@ -18,6 +18,8 @@ * further licensing information. **/ -@javax.xml.bind.annotation.XmlSchema(namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:spi:4.0", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@javax.xml.bind.annotation.XmlSchema(namespace = EbxmlNamespaces.SPI_URI, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package oasis.names.tc.ebxml.regrep.xsd.spi.v4; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ActuateType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ActuateType.java index dce9454de0..7e8f060d78 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ActuateType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ActuateType.java @@ -46,6 +46,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </simpleType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlType(name = "actuateType") @XmlEnum diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ArcType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ArcType.java index fee4dc3147..f951d230a6 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ArcType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ArcType.java @@ -32,6 +32,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -54,7 +55,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @@ -66,31 +78,31 @@ public class ArcType { @DynamicSerializeElement protected List title2; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink", required = true) + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI, required = true) @DynamicSerializeElement protected TypeType type; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String arcrole; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String title; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected ShowType show; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected ActuateType actuate; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String from; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @DynamicSerializeElement protected String to; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/Extended.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/Extended.java index 8dd2a3a6a3..843bf87b8b 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/Extended.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/Extended.java @@ -31,6 +31,7 @@ import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlType; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -60,7 +61,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @@ -75,15 +87,15 @@ public class Extended { @DynamicSerializeElement protected List extendedModel; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink", required = true) + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI, required = true) @DynamicSerializeElement protected TypeType type; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String role; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String title; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/LocatorType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/LocatorType.java index 62de2c6e6c..1263cf009c 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/LocatorType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/LocatorType.java @@ -32,6 +32,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -54,7 +55,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @@ -66,23 +78,23 @@ public class LocatorType { @DynamicSerializeElement protected List title1; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink", required = true) + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI, required = true) @DynamicSerializeElement protected TypeType type; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink", required = true) + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI, required = true) @DynamicSerializeElement protected String href; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String role; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String title; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @DynamicSerializeElement protected String label; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ObjectFactory.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ObjectFactory.java index 24e096e7a2..7a33a1181d 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ObjectFactory.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ObjectFactory.java @@ -25,6 +25,8 @@ import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** * This object contains factory methods for each Java content interface and Java * element interface generated in the org.w3._1999.xlink package. @@ -35,21 +37,33 @@ import javax.xml.namespace.QName; * of schema type definitions, element declarations and model groups. Factory * methods for each of these are provided in this class. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRegistry public class ObjectFactory { private final static QName _Resource_QNAME = new QName( - "http://www.w3.org/1999/xlink", "resource"); + EbxmlNamespaces.XLINK_URI, "resource"); private final static QName _Locator_QNAME = new QName( - "http://www.w3.org/1999/xlink", "locator"); + EbxmlNamespaces.XLINK_URI, "locator"); private final static QName _Arc_QNAME = new QName( - "http://www.w3.org/1999/xlink", "arc"); + EbxmlNamespaces.XLINK_URI, "arc"); private final static QName _Title_QNAME = new QName( - "http://www.w3.org/1999/xlink", "title"); + EbxmlNamespaces.XLINK_URI, "title"); /** * Create a new ObjectFactory that can be used to create new instances of @@ -112,7 +126,7 @@ public class ObjectFactory { * {@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/1999/xlink", name = "resource") + @XmlElementDecl(namespace = EbxmlNamespaces.XLINK_URI, name = "resource") public JAXBElement createResource(ResourceType value) { return new JAXBElement(_Resource_QNAME, ResourceType.class, null, value); @@ -123,7 +137,7 @@ public class ObjectFactory { * {@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/1999/xlink", name = "locator") + @XmlElementDecl(namespace = EbxmlNamespaces.XLINK_URI, name = "locator") public JAXBElement createLocator(LocatorType value) { return new JAXBElement(_Locator_QNAME, LocatorType.class, null, value); @@ -133,7 +147,7 @@ public class ObjectFactory { * Create an instance of {@link JAXBElement }{@code <}{@link ArcType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/1999/xlink", name = "arc") + @XmlElementDecl(namespace = EbxmlNamespaces.XLINK_URI, name = "arc") public JAXBElement createArc(ArcType value) { return new JAXBElement(_Arc_QNAME, ArcType.class, null, value); } @@ -143,7 +157,7 @@ public class ObjectFactory { * {@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/1999/xlink", name = "title") + @XmlElementDecl(namespace = EbxmlNamespaces.XLINK_URI, name = "title") public JAXBElement createTitle(TitleEltType value) { return new JAXBElement(_Title_QNAME, TitleEltType.class, null, value); diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ResourceType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ResourceType.java index 0c5670de34..39bb1e3b54 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ResourceType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ResourceType.java @@ -35,6 +35,7 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.w3c.dom.Element; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -57,7 +58,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @@ -70,19 +82,19 @@ public class ResourceType { @DynamicSerializeElement protected List content; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink", required = true) + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI, required = true) @DynamicSerializeElement protected TypeType type; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String role; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String title; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @DynamicSerializeElement protected String label; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ShowType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ShowType.java index cec0875933..0312ff44a0 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ShowType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/ShowType.java @@ -47,6 +47,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </simpleType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlType(name = "showType") @XmlEnum diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/Simple.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/Simple.java index 4a8ae66960..93fcb265b6 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/Simple.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/Simple.java @@ -33,6 +33,7 @@ import javax.xml.bind.annotation.XmlType; import org.w3c.dom.Element; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -60,7 +61,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @@ -73,31 +85,31 @@ public class Simple { @DynamicSerializeElement protected List content; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected TypeType type; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String href; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String role; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String arcrole; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected String title; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected ShowType show; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink") + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI) @DynamicSerializeElement protected ActuateType actuate; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/TitleEltType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/TitleEltType.java index ad542775b0..bc18a81c1f 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/TitleEltType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/TitleEltType.java @@ -33,6 +33,7 @@ import javax.xml.bind.annotation.XmlType; import org.w3c.dom.Element; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -55,7 +56,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @@ -68,7 +80,7 @@ public class TitleEltType { @DynamicSerializeElement protected List content; - @XmlAttribute(namespace = "http://www.w3.org/1999/xlink", required = true) + @XmlAttribute(namespace = EbxmlNamespaces.XLINK_URI, required = true) @DynamicSerializeElement protected TypeType type; diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/TypeType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/TypeType.java index d979dd63d6..b8100dc520 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/TypeType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/TypeType.java @@ -48,6 +48,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * </simpleType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlType(name = "typeType") @XmlEnum diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/package-info.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/package-info.java index 6bb8f84b1d..c018c620a9 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/package-info.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v1999/xlink/package-info.java @@ -18,6 +18,8 @@ * further licensing information. **/ -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.w3.org/1999/xlink", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@javax.xml.bind.annotation.XmlSchema(namespace = EbxmlNamespaces.XLINK_URI, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.w3.v1999.xlink; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/AttributedQNameType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/AttributedQNameType.java index 852eafe434..520d01e387 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/AttributedQNameType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/AttributedQNameType.java @@ -59,7 +59,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/AttributedURIType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/AttributedURIType.java index 98a11299a1..b4d90ae67a 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/AttributedURIType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/AttributedURIType.java @@ -60,6 +60,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 * */ @XmlRootElement diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/AttributedUnsignedLongType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/AttributedUnsignedLongType.java index 0b649dd145..09ccd7aaa7 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/AttributedUnsignedLongType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/AttributedUnsignedLongType.java @@ -61,7 +61,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/EndpointReferenceType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/EndpointReferenceType.java index abede91df4..cce39b0005 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/EndpointReferenceType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/EndpointReferenceType.java @@ -70,7 +70,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/MetadataType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/MetadataType.java index b3e9cac30d..e8ad8039d7 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/MetadataType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/MetadataType.java @@ -66,7 +66,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/ObjectFactory.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/ObjectFactory.java index 03a1c82b97..4ba6aac7ba 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/ObjectFactory.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/ObjectFactory.java @@ -32,6 +32,8 @@ import javax.xml.bind.annotation.XmlElementDecl; import javax.xml.bind.annotation.XmlRegistry; import javax.xml.namespace.QName; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** * This object contains factory methods for each Java content interface and Java * element interface generated in the org.w3._2005._08.addressing package. @@ -42,51 +44,63 @@ import javax.xml.namespace.QName; * of schema type definitions, element declarations and model groups. Factory * methods for each of these are provided in this class. * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRegistry public class ObjectFactory { private final static QName _ProblemIRI_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "ProblemIRI"); + EbxmlNamespaces.ADDRESSING_URI, "ProblemIRI"); private final static QName _EndpointReference_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "EndpointReference"); + EbxmlNamespaces.ADDRESSING_URI, "EndpointReference"); private final static QName _ProblemHeaderQName_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "ProblemHeaderQName"); + EbxmlNamespaces.ADDRESSING_URI, "ProblemHeaderQName"); private final static QName _ReferenceParameters_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "ReferenceParameters"); + EbxmlNamespaces.ADDRESSING_URI, "ReferenceParameters"); private final static QName _From_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "From"); + EbxmlNamespaces.ADDRESSING_URI, "From"); private final static QName _ReplyTo_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "ReplyTo"); + EbxmlNamespaces.ADDRESSING_URI, "ReplyTo"); private final static QName _Action_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "Action"); + EbxmlNamespaces.ADDRESSING_URI, "Action"); private final static QName _FaultTo_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "FaultTo"); + EbxmlNamespaces.ADDRESSING_URI, "FaultTo"); private final static QName _RetryAfter_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "RetryAfter"); + EbxmlNamespaces.ADDRESSING_URI, "RetryAfter"); private final static QName _To_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "To"); + EbxmlNamespaces.ADDRESSING_URI, "To"); private final static QName _ProblemAction_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "ProblemAction"); + EbxmlNamespaces.ADDRESSING_URI, "ProblemAction"); private final static QName _RelatesTo_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "RelatesTo"); + EbxmlNamespaces.ADDRESSING_URI, "RelatesTo"); private final static QName _Metadata_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "Metadata"); + EbxmlNamespaces.ADDRESSING_URI, "Metadata"); private final static QName _MessageID_QNAME = new QName( - "http://www.w3.org/2005/08/addressing", "MessageID"); + EbxmlNamespaces.ADDRESSING_URI, "MessageID"); /** * Create a new ObjectFactory that can be used to create new instances of @@ -165,7 +179,7 @@ public class ObjectFactory { * {@link AttributedURIType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "ProblemIRI") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "ProblemIRI") public JAXBElement createProblemIRI( AttributedURIType value) { return new JAXBElement(_ProblemIRI_QNAME, @@ -177,7 +191,7 @@ public class ObjectFactory { * {@link EndpointReferenceType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "EndpointReference") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "EndpointReference") public JAXBElement createEndpointReference( EndpointReferenceType value) { return new JAXBElement(_EndpointReference_QNAME, @@ -189,7 +203,7 @@ public class ObjectFactory { * {@link AttributedQNameType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "ProblemHeaderQName") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "ProblemHeaderQName") public JAXBElement createProblemHeaderQName( AttributedQNameType value) { return new JAXBElement(_ProblemHeaderQName_QNAME, @@ -201,7 +215,7 @@ public class ObjectFactory { * {@link ReferenceParametersType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "ReferenceParameters") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "ReferenceParameters") public JAXBElement createReferenceParameters( ReferenceParametersType value) { return new JAXBElement( @@ -214,7 +228,7 @@ public class ObjectFactory { * {@link EndpointReferenceType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "From") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "From") public JAXBElement createFrom( EndpointReferenceType value) { return new JAXBElement(_From_QNAME, @@ -226,7 +240,7 @@ public class ObjectFactory { * {@link EndpointReferenceType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "ReplyTo") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "ReplyTo") public JAXBElement createReplyTo( EndpointReferenceType value) { return new JAXBElement(_ReplyTo_QNAME, @@ -238,7 +252,7 @@ public class ObjectFactory { * {@link AttributedURIType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "Action") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "Action") public JAXBElement createAction(AttributedURIType value) { return new JAXBElement(_Action_QNAME, AttributedURIType.class, null, value); @@ -249,7 +263,7 @@ public class ObjectFactory { * {@link EndpointReferenceType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "FaultTo") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "FaultTo") public JAXBElement createFaultTo( EndpointReferenceType value) { return new JAXBElement(_FaultTo_QNAME, @@ -261,7 +275,7 @@ public class ObjectFactory { * {@link AttributedUnsignedLongType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "RetryAfter") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "RetryAfter") public JAXBElement createRetryAfter( AttributedUnsignedLongType value) { return new JAXBElement(_RetryAfter_QNAME, @@ -273,7 +287,7 @@ public class ObjectFactory { * {@link AttributedURIType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "To") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "To") public JAXBElement createTo(AttributedURIType value) { return new JAXBElement(_To_QNAME, AttributedURIType.class, null, value); @@ -284,7 +298,7 @@ public class ObjectFactory { * {@link ProblemActionType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "ProblemAction") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "ProblemAction") public JAXBElement createProblemAction( ProblemActionType value) { return new JAXBElement(_ProblemAction_QNAME, @@ -296,7 +310,7 @@ public class ObjectFactory { * {@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "RelatesTo") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "RelatesTo") public JAXBElement createRelatesTo(RelatesToType value) { return new JAXBElement(_RelatesTo_QNAME, RelatesToType.class, null, value); @@ -307,7 +321,7 @@ public class ObjectFactory { * {@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "Metadata") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "Metadata") public JAXBElement createMetadata(MetadataType value) { return new JAXBElement(_Metadata_QNAME, MetadataType.class, null, value); @@ -318,7 +332,7 @@ public class ObjectFactory { * {@link AttributedURIType }{@code >} * */ - @XmlElementDecl(namespace = "http://www.w3.org/2005/08/addressing", name = "MessageID") + @XmlElementDecl(namespace = EbxmlNamespaces.ADDRESSING_URI, name = "MessageID") public JAXBElement createMessageID( AttributedURIType value) { return new JAXBElement(_MessageID_QNAME, diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/ProblemActionType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/ProblemActionType.java index ac9c7105f6..c697d5e77f 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/ProblemActionType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/ProblemActionType.java @@ -64,7 +64,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/ReferenceParametersType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/ReferenceParametersType.java index 5f733c9b6c..990cd8dbcb 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/ReferenceParametersType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/ReferenceParametersType.java @@ -66,7 +66,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/RelatesToType.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/RelatesToType.java index 0f663b40e9..ef635d2135 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/RelatesToType.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/RelatesToType.java @@ -40,6 +40,7 @@ import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.XmlValue; import javax.xml.namespace.QName; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @@ -62,7 +63,18 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * </complexType> * * + *
  * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 2012                     bphillip    Initial implementation
+ * 10/17/2013    1682       bphillip    Added software history
+ * 
+ * + * @author bphillip + * @version 1 */ @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) @@ -70,6 +82,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @DynamicSerialize public class RelatesToType { + private static final String ADDRESSING_REPLY = EbxmlNamespaces.ADDRESSING_URI + + "/reply"; + @XmlValue @XmlSchemaType(name = "anyURI") @DynamicSerializeElement @@ -112,7 +127,7 @@ public class RelatesToType { */ public String getRelationshipType() { if (relationshipType == null) { - return "http://www.w3.org/2005/08/addressing/reply"; + return ADDRESSING_REPLY; } else { return relationshipType; } diff --git a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/package-info.java b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/package-info.java index b19a76d021..0bcd4d2077 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/package-info.java +++ b/edexOsgi/com.raytheon.uf.common.registry.schemas.ebxml/src/org/w3/v200508/addressing/package-info.java @@ -25,6 +25,8 @@ // Generated on: 2011.12.14 at 12:32:26 PM CST // -@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.w3.org/2005/08/addressing", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +@javax.xml.bind.annotation.XmlSchema(namespace = EbxmlNamespaces.ADDRESSING_URI, elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.w3.v200508.addressing; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + diff --git a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/CollectionUtil.java b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/CollectionUtil.java index c5a0605a6a..157fffe087 100644 --- a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/CollectionUtil.java +++ b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/CollectionUtil.java @@ -38,6 +38,7 @@ import java.util.Set; * ------------ ---------- ----------- -------------------------- * Jul 13, 2012 740 djohnson Initial creation * Feb 12, 2013 1543 djohnson Add combining of arrays. + * 10/8/2013 1682 bphillip Added subList, removeNulls, and removeAllInstancesOfObject methods * * * @@ -138,4 +139,54 @@ public final class CollectionUtil { } return retVal; } + + /** + * Extracts a sub-list of the given from the given list starting at + * startIndex. + * + * @param list + * The list to get the sub-list from + * @param startIndex + * The index to start at for extracting the sub-list + * @param size + * The desired size of the sublist + * @return The sublist + */ + public static List subList(List list, + int startIndex, int size) { + int endIndex = startIndex + size; + if (startIndex + size > list.size()) { + endIndex = list.size(); + } + return list.subList(startIndex, endIndex); + } + + /** + * Removes null values from the given collection + * + * @param collection + * The collection to remove nulls from + * @return The updated collection + */ + public static Collection removeNulls( + Collection collection) { + return removeAllInstancesOfObject(collection, null); + } + + /** + * Removes all values equal to the given object from the collection + * + * @param collection + * The collection to remove the values from + * @param objToRemove + * The object to remove from the collection + * @return The updated collection + */ + public static Collection removeAllInstancesOfObject( + Collection collection, Object objToRemove) { + while (collection.remove(objToRemove)) { + + } + return collection; + } } diff --git a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/dao/SessionManagedDao.java b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/dao/SessionManagedDao.java index e30f358307..fe2dd4af92 100644 --- a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/dao/SessionManagedDao.java +++ b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/dao/SessionManagedDao.java @@ -26,6 +26,7 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; +import org.hibernate.Criteria; import org.hibernate.Query; import org.hibernate.SessionFactory; import org.hibernate.criterion.DetachedCriteria; @@ -60,6 +61,7 @@ import com.raytheon.uf.edex.database.DataAccessLayerException; * 4/9/2013 1802 bphillip Modified how arguments are passed in to query methods * May 01, 2013 1967 njensen Fixed autoboxing for Eclipse 3.8 * Jun 24, 2013 2106 djohnson Use IDENTIFIER generic for method signature. + * 10/8/2013 1682 bphillip Added the createCriteria method * * * @@ -408,6 +410,16 @@ public abstract class SessionManagedDao * * @author djohnson @@ -178,7 +179,7 @@ public abstract class DbInit { * If the drop sql strings cannot be executed * @throws EbxmlRegistryException */ - private void createTables(final AnnotationConfiguration aConfig) + protected void createTables(final AnnotationConfiguration aConfig) throws SQLException { final String[] createSqls = aConfig .generateSchemaCreationScript(getDialect()); @@ -288,7 +289,7 @@ public abstract class DbInit { * If the drop sql strings cannot be executed * @throws EbxmlRegistryException */ - private void dropTables(final AnnotationConfiguration aConfig) + protected void dropTables(final AnnotationConfiguration aConfig) throws SQLException { final Work work = new Work() { diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/WfoRegistryFederationManager.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/WfoRegistryFederationManager.java index 0728456854..906c15c161 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/WfoRegistryFederationManager.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/federation/WfoRegistryFederationManager.java @@ -47,9 +47,6 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.support.TransactionTemplate; import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.common.registry.constants.Format; -import com.raytheon.uf.common.registry.constants.Languages; -import com.raytheon.uf.common.registry.constants.QueryReturnTypes; import com.raytheon.uf.common.registry.services.RegistryRESTServices; import com.raytheon.uf.common.registry.services.RegistrySOAPServices; import com.raytheon.uf.common.serialization.SerializationException; @@ -58,6 +55,7 @@ import com.raytheon.uf.edex.database.RunnableWithTransaction; import com.raytheon.uf.edex.datadelivery.registry.replication.RegistryReplicationManager; import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; import com.raytheon.uf.edex.registry.ebxml.init.RegistryInitializedListener; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; /** * @@ -71,6 +69,7 @@ import com.raytheon.uf.edex.registry.ebxml.init.RegistryInitializedListener; * ------------ ---------- ----------- -------------------------- * 5/22/2013 1707 bphillip Initial implementation * 7/29/2013 2191 bphillip Implemented registry sync for registries that have been down for an extended period of time + * 10/20/2013 1682 bphillip Fixed query invocation * * * @author bphillip @@ -187,17 +186,20 @@ public class WfoRegistryFederationManager extends RegistryFederationManager protected FederationType getFederation() throws EbxmlRegistryException { statusHandler .info("Attempting to acquire federation object from NCF..."); - QueryType query = new QueryType(CanonicalQueryTypes.GET_OBJECT_BY_ID, - new SlotType("id", new StringValueType(FEDERATION_ID))); - QueryRequest queryRequest = new QueryRequest("Query for federation", - "Query to get the status of the federation", - new ResponseOptionType(QueryReturnTypes.REGISTRY_OBJECT, true), - query, false, null, Format.EBRIM, Languages.EN_US, 0, 0, 0, - false); + QueryType query = new QueryType(); + query.setQueryDefinition(CanonicalQueryTypes.GET_OBJECT_BY_ID); + query.getSlot().add( + new SlotType(QueryConstants.ID, new StringValueType( + FEDERATION_ID))); + QueryRequest request = new QueryRequest(); + request.setResponseOption(new ResponseOptionType( + ResponseOptionType.RETURN_TYPE.RegistryObject.toString(), true)); + request.setId("Query For Federation"); + request.setQuery(query); QueryResponse response = null; try { response = RegistrySOAPServices.getQueryServiceForHost(ncfAddress) - .executeQuery(queryRequest); + .executeQuery(request); } catch (Exception e) { throw new EbxmlRegistryException( "Error getting Federation from NCF!", e); diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/replication/RegistryReplicationManager.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/replication/RegistryReplicationManager.java index 9b30c51c81..95600aa37d 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/replication/RegistryReplicationManager.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.registry/src/com/raytheon/uf/edex/datadelivery/registry/replication/RegistryReplicationManager.java @@ -61,11 +61,12 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import com.raytheon.uf.common.localization.PathManagerFactory; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.registry.RegistryException; import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; import com.raytheon.uf.common.registry.constants.DeliveryMethodTypes; -import com.raytheon.uf.common.registry.constants.Namespaces; import com.raytheon.uf.common.registry.constants.NotificationOptionTypes; +import com.raytheon.uf.common.registry.constants.QueryLanguages; import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; import com.raytheon.uf.common.registry.constants.StatusTypes; import com.raytheon.uf.common.registry.ebxml.RegistryUtil; @@ -81,6 +82,7 @@ import com.raytheon.uf.edex.datadelivery.registry.availability.FederatedRegistry import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; import com.raytheon.uf.edex.registry.ebxml.exception.NoReplicationServersAvailableException; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; /** @@ -98,6 +100,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; * 7/29/2013 2191 bphillip Implemented registry sync for registries that have been down for an extended period of time * 8/1/2013 1693 bphillip Switch to use rest service instead of query manager for federation synchronization * 9/5/2013 1538 bphillip Changed when the registry availability monitor is started + * 10/20/2013 1682 bphillip Fixed query invocation * * * @author bphillip @@ -497,13 +500,24 @@ public class RegistryReplicationManager { sub.setStartTime(EbxmlObjectUtil.getTimeAsXMLGregorianCalendar(0)); QueryType selectorQuery = new QueryType(); - selectorQuery.setQueryDefinition(CanonicalQueryTypes.BASIC_QUERY); - SlotType slot = new SlotType(); - StringValueType valType = new StringValueType(); - valType.setValue(objectType); - slot.setName("objectType"); - slot.setSlotValue(valType); - selectorQuery.getSlot().add(slot); + selectorQuery.setQueryDefinition(CanonicalQueryTypes.ADHOC_QUERY); + + SlotType expressionSlot = new SlotType(); + StringValueType expressionValue = new StringValueType(); + expressionValue + .setValue("FROM RegistryObjectType obj where obj.objectType='" + + objectType + "'"); + expressionSlot.setName(QueryConstants.QUERY_EXPRESSION); + expressionSlot.setSlotValue(expressionValue); + selectorQuery.getSlot().add(expressionSlot); + + SlotType languageSlot = new SlotType(); + StringValueType languageValue = new StringValueType(); + languageValue.setValue(QueryLanguages.HQL); + languageSlot.setName(QueryConstants.QUERY_LANGUAGE); + languageSlot.setSlotValue(languageValue); + selectorQuery.getSlot().add(languageSlot); + sub.setSelector(selectorQuery); Duration notificationInterval = DatatypeFactory.newInstance() @@ -519,11 +533,11 @@ public class RegistryReplicationManager { ref.writeTo(dom); Document doc = (Document) dom.getNode(); NodeList nodes = doc.getElementsByTagNameNS( - Namespaces.ADDRESSING_NAMESPACE, "Address"); + EbxmlNamespaces.ADDRESSING_URI, "Address"); for (int i = 0; i < nodes.getLength(); i++) { Node addressNode = nodes.item(i); Attr endpointTypeAttr = doc.createAttributeNS( - Namespaces.EBXML_RIM_NAMESPACE_URI, "endpointType"); + EbxmlNamespaces.RIM_URI, "endpointType"); endpointTypeAttr.setValue(endpointType); addressNode.getAttributes().setNamedItemNS(endpointTypeAttr); } 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 ef383745f3..b867831290 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 @@ -44,10 +44,6 @@ 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.adhoc, - com.raytheon.uf.edex.registry.ebxml.services.query.types, - com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical, - com.raytheon.uf.edex.registry.ebxml.services.query.types.ext, 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-querytypes.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-querytypes.xml index 789639aa32..fbdbdfd0d8 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 @@ -1,135 +1,144 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-registry-dao.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-registry-dao.xml index 1f61eaa5f4..f8b775e13d 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-registry-dao.xml +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-registry-dao.xml @@ -2,6 +2,10 @@ 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"> + + + + 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 3eed2007c6..e8d76be31f 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 @@ -16,14 +16,13 @@ - + - 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 7f60013840..907bb3c29f 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 @@ -6,8 +6,12 @@ - + + + + + @@ -16,7 +20,6 @@ class="com.raytheon.uf.edex.registry.ebxml.services.notification.NotificationListenerImpl"> - @@ -75,6 +78,7 @@ + + 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 3aecf07eea..bd36c16587 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 @@ -8,4 +8,5 @@ adhocsubscription-process.cron=0+0/20+*+*+*+? # that will be used for synchronization ebxml-federation-sync-threads=3 # Master switch enabling email transmission -ebxml-email.enabled=false \ No newline at end of file +ebxml-email.enabled=false +ebxml-notification-batch-size=100 \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/ClassificationNodeDao.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/ClassificationNodeDao.java index ba31010a1b..01a4e1bb01 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/ClassificationNodeDao.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/ClassificationNodeDao.java @@ -59,11 +59,7 @@ public class ClassificationNodeDao extends } public boolean isValidNode(String id) { - long result = (Long) this - .executeHQLQuery( - "select count(node) from ClassificationNodeType node where node.id=:id", - "id", id).get(0); - return result != 0; + return getById(id) != null; } /** diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/IdentifiableTypeDao.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/IdentifiableTypeDao.java index 448dc949b6..39b38b3fe8 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/IdentifiableTypeDao.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/IdentifiableTypeDao.java @@ -26,6 +26,8 @@ import java.util.List; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.IdentifiableType; +import org.hibernate.criterion.Property; + import com.raytheon.uf.edex.database.dao.SessionManagedDao; import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; @@ -41,6 +43,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; * ------------ ---------- ----------- -------------------------- * 3/18/2013 1082 bphillip Initial creation * 4/9/2013 1802 bphillip Removed exception catching + * 10/08/2013 1682 bphillip Added the id like query * * * @@ -85,26 +88,23 @@ public abstract class IdentifiableTypeDao * @throws EbxmlRegistryException * If the query encounters errors */ + @SuppressWarnings("unchecked") public List getById(List ids) throws EbxmlRegistryException { - return this.executeHQLQuery(HqlQueryUtil.assembleSingleParamQuery( - this.getEntityClass(), QueryConstants.ID, "in", ids)); + return createCriteria() + .add(Property.forName(QueryConstants.ID).in(ids)).list(); } /** - * Queries for all ids of registry objects matching the pattern of the given - * id. A query using 'like' will be executed. + * Gets all IdentifiableType objects matching (using like) the given id. * * @param id - * The id containing % or _ denoting wildcard characters - * @return List of ids matching the given id pattern - * @throws EbxmlRegistryException - * If errors occur during the query + * The id to query for + * @return All IdentifiableType objects matching the given id */ - public List getMatchingIds(String id) throws EbxmlRegistryException { - String hql = "select obj.id from " - + this.getEntityClass().getSimpleName() - + " obj where obj.id like :id"; - return this.executeHQLQuery(hql, "id", id); + @SuppressWarnings("unchecked") + public List getByIdUsingLike(String id) { + return createCriteria().add( + Property.forName(QueryConstants.ID).like(id)).list(); } } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/QueryDefinitionDao.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/QueryDefinitionDao.java new file mode 100644 index 0000000000..aa32cbab4b --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/QueryDefinitionDao.java @@ -0,0 +1,82 @@ +/** + * 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.registry.ebxml.dao; + +import java.util.List; + +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ParameterType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryDefinitionType; + +/** + * + * Data access object for QueryDefinitionType objects + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class QueryDefinitionDao extends + RegistryObjectTypeDao { + + /** + * Query used to get the query Ids of all the query definitions contained in + * the registry + */ + private static final String GET_QUERY_IDS_QUERY = "SELECT obj.id FROM QueryDefinitionType obj order by obj.id asc"; + + /** Query used to get the parameters for a given query */ + private static final String GET_QUERY_PARAMETERS_QUERY = "SELECT param " + + "FROM QueryDefinitionType def " + + "INNER JOIN def.parameter as param " + "WHERE def.id=:id"; + + /** + * Gets the ids of all the query definitions contained in the registry + * + * @return The ids of the query definitions in the registry + */ + public List getQueryIds() { + return executeHQLQuery(GET_QUERY_IDS_QUERY); + } + + /** + * Gets the parameters for the given query + * + * @param queryId + * The query id to get the parameters for + * @return The parameters for the specified query + */ + public List getParametersForQuery(String queryId) { + return executeHQLQuery(GET_QUERY_PARAMETERS_QUERY, "id", queryId); + } + + @Override + protected Class getEntityClass() { + return QueryDefinitionType.class; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/RegistryObjectTypeDao.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/RegistryObjectTypeDao.java index 6b4c131406..9598c062ef 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/RegistryObjectTypeDao.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/dao/RegistryObjectTypeDao.java @@ -25,8 +25,6 @@ import java.util.List; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; import org.hibernate.SessionFactory; -import org.hibernate.criterion.DetachedCriteria; -import org.hibernate.criterion.Projections; import org.hibernate.criterion.Property; import org.springframework.orm.hibernate3.HibernateTemplate; @@ -45,6 +43,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; * Jan 19, 2012 184 bphillip Initial creation * 4/9/2013 1802 bphillip Removed exception catching. Added merge method. * 8/1/2013 1693 bphillip Moved the merge method down to RegistryObjectDao + * 10/8/2013 1682 bphillip Added like lid method, changed to use criteria queries for simple operations * * * @@ -61,23 +60,6 @@ public abstract class RegistryObjectTypeDao public RegistryObjectTypeDao() { } - /** - * Queries for all lids of registry objects matching the pattern of the - * given id. A query using 'like' will be executed. - * - * @param lid - * The lid containing % or _ denoting wildcard characters - * @return List of lids matching the given id pattern - */ - public List getMatchingLids(String lid) { - DetachedCriteria criteria = DetachedCriteria.forClass(this - .getEntityClass()); - criteria = criteria.add(Property.forName(QueryConstants.LID).like(lid)); - criteria = criteria.setProjection(Projections - .property(QueryConstants.LID)); - return this.executeCriteriaQuery(criteria); - } - /** * Retrieves registry objects based on lid values * @@ -87,12 +69,10 @@ public abstract class RegistryObjectTypeDao * The list of lids to query for * @return The list of registry objects; */ + @SuppressWarnings("unchecked") public List getByLid(List lids) { - StringBuilder str = new StringBuilder(); - HqlQueryUtil.assembleSingleParamQuery(str, getEntityClass(), - QueryConstants.LID, "in", lids); - str.append(" order by obj.lid asc,obj.versionInfo.versionName desc"); - return executeHQLQuery(str.toString()); + return createCriteria().add( + Property.forName(QueryConstants.LID).in(lids)).list(); } /** @@ -108,6 +88,19 @@ public abstract class RegistryObjectTypeDao return getByLid(Arrays.asList(lids)); } + /** + * Gets all IdentifiableType objects matching (using like) the given lid. + * + * @param lid + * The id to query for + * @return All IdentifiableType objects matching the given lid + */ + @SuppressWarnings("unchecked") + public List getByLidUsingLike(String lid) { + return createCriteria().add( + Property.forName(QueryConstants.LID).like(lid)).list(); + } + /** * Retrieves registry objects based on objectType values * @@ -117,9 +110,11 @@ public abstract class RegistryObjectTypeDao * The list of objectTypes to query for * @return The list of registry objects; */ + @SuppressWarnings("unchecked") public List getByObjectType(List objTypes) { - return executeHQLQuery(HqlQueryUtil.assembleSingleParamQuery( - getEntityClass(), QueryConstants.OBJECT_TYPE, "in", objTypes)); + return createCriteria().add( + Property.forName(QueryConstants.OBJECT_TYPE).in(objTypes)) + .list(); } /** @@ -131,9 +126,10 @@ public abstract class RegistryObjectTypeDao * The list of statuses to query for * @return The list of registry objects; */ + @SuppressWarnings("unchecked") public List getByStatus(List status) { - return executeHQLQuery(HqlQueryUtil.assembleSingleParamQuery( - getEntityClass(), QueryConstants.STATUS, "in", status)); + return createCriteria().add( + Property.forName(QueryConstants.STATUS).in(status)).list(); } /** @@ -145,9 +141,10 @@ public abstract class RegistryObjectTypeDao * The list of owners to query for * @return The list of registry objects; */ + @SuppressWarnings("unchecked") public List getByOwner(List owner) { - return executeHQLQuery(HqlQueryUtil.assembleSingleParamQuery( - getEntityClass(), QueryConstants.OWNER, "in", owner)); + return createCriteria().add( + Property.forName(QueryConstants.OWNER).in(owner)).list(); } /** diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/cataloger/CatalogerImplWrapper.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/cataloger/CatalogerImplWrapper.java index 612cce8083..f531034af2 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/cataloger/CatalogerImplWrapper.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/cataloger/CatalogerImplWrapper.java @@ -30,6 +30,8 @@ import oasis.names.tc.ebxml.regrep.xsd.spi.v4.CatalogObjectsResponse; import org.springframework.transaction.annotation.Transactional; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** * * Wrapper for the cataloger service to be used with the SOAP interface. @@ -60,10 +62,10 @@ public class CatalogerImplWrapper implements Cataloger { } @Override - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:spi:bindings:4.0:Cataloger#catalogObjects") - @WebResult(name = "CatalogObjectsResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:spi:4.0", partName = "partCatalogObjectsResponse") + @WebMethod(action = CATALOG_OBJECTS_ACTION) + @WebResult(name = "CatalogObjectsResponse", targetNamespace = EbxmlNamespaces.SPI_URI, partName = "partCatalogObjectsResponse") public CatalogObjectsResponse catalogObjects( - @WebParam(name = "CatalogObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:spi:4.0", partName = "partCatalogObjectsRequest") CatalogObjectsRequest partCatalogObjectsRequest) + @WebParam(name = "CatalogObjectsRequest", targetNamespace = EbxmlNamespaces.SPI_URI, partName = "partCatalogObjectsRequest") CatalogObjectsRequest partCatalogObjectsRequest) throws MsgRegistryException { return cataloger.catalogObjects(partCatalogObjectsRequest); } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/lifecycle/LifecycleManagerImplWrapper.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/lifecycle/LifecycleManagerImplWrapper.java index bc34c6cc79..bab1ba435e 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/lifecycle/LifecycleManagerImplWrapper.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/lifecycle/LifecycleManagerImplWrapper.java @@ -33,6 +33,8 @@ import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** * * Wrapper for the lifecyclemanager service to be used with the SOAP interface. @@ -63,28 +65,28 @@ public class LifecycleManagerImplWrapper implements LifecycleManager { } @Override - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:bindings:4.0:LifecycleManager#removeObjects") - @WebResult(name = "RegistryResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", partName = "partRegistryResponse") + @WebMethod(action = REMOVE_OBJECTS_ACTION) + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") public RegistryResponseType removeObjects( - @WebParam(name = "RemoveObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:4.0", partName = "partRemoveObjectsRequest") RemoveObjectsRequest partRemoveObjectsRequest) + @WebParam(name = "RemoveObjectsRequest", targetNamespace = EbxmlNamespaces.LCM_URI, partName = "partRemoveObjectsRequest") RemoveObjectsRequest partRemoveObjectsRequest) throws MsgRegistryException { return lifecycleManager.removeObjects(partRemoveObjectsRequest); } @Override - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:bindings:4.0:LifecycleManager#submitObjects") - @WebResult(name = "RegistryResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", partName = "partRegistryResponse") + @WebMethod(action = SUBMIT_OBJECTS_ACTION) + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") public RegistryResponseType submitObjects( - @WebParam(name = "SubmitObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:4.0", partName = "partSubmitObjectsRequest") SubmitObjectsRequest partSubmitObjectsRequest) + @WebParam(name = "SubmitObjectsRequest", targetNamespace = EbxmlNamespaces.LCM_URI, partName = "partSubmitObjectsRequest") SubmitObjectsRequest partSubmitObjectsRequest) throws MsgRegistryException { return lifecycleManager.submitObjects(partSubmitObjectsRequest); } @Override - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:bindings:4.0:LifecycleManager#updateObjects") - @WebResult(name = "RegistryResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rs:4.0", partName = "partRegistryResponse") + @WebMethod(action = UPDATE_OBJECTS_ACTION) + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") public RegistryResponseType updateObjects( - @WebParam(name = "UpdateObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:lcm:4.0", partName = "partUpdateObjectsRequest") UpdateObjectsRequest partUpdateObjectsRequest) + @WebParam(name = "UpdateObjectsRequest", targetNamespace = EbxmlNamespaces.LCM_URI, partName = "partUpdateObjectsRequest") UpdateObjectsRequest partUpdateObjectsRequest) throws MsgRegistryException { return lifecycleManager.updateObjects(partUpdateObjectsRequest); } 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 9be2f1ccf7..7c8d94568d 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 @@ -21,7 +21,9 @@ package com.raytheon.uf.edex.registry.ebxml.services.lifecycle; import java.lang.reflect.Field; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.concurrent.TimeUnit; import javax.xml.bind.JAXBElement; @@ -60,6 +62,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 8/5/2013 2191 bphillip Initial implementation + * 10/8/2013 1682 bphillip Added getReferenced objects methods * * * @author bphillip @@ -190,6 +193,93 @@ public class ObjectReferenceResolver { return returnMessage.toString(); } + /** + * Gets all objects referenced by the given set of objects + * + * @param objs + * The set of objects to get the referenced objects for + * @return All objects referenced by the given set of objects + * @throws MsgRegistryException + * If errors occur while examining properties of the given + * classes + */ + public Set getReferencedObjects( + Set objs) throws MsgRegistryException { + Set referencedObjects = new HashSet(); + for (RegistryObjectType obj : objs) { + referencedObjects.addAll(getReferencedObjects(obj)); + } + return referencedObjects; + } + + /** + * Gets all objects referenced by the given object + * + * @param obj + * The object to get the referenced objects for + * @return All objects referenced by the given object + * @throws MsgRegistryException + * If errors occur whuile examining the properties of the given + * object + */ + public Set getReferencedObjects(RegistryObjectType obj) + throws MsgRegistryException { + try { + List fields = OBJECT_REFERENCE_FIELD_CACHE.get(obj + .getClass()); + Set referencedObjects = new HashSet( + fields.size(), 1); + + for (String field : fields) { + String propertyValue = (String) PropertyUtils.getProperty(obj, + field); + if (propertyValue == null) { + continue; + } + RegistryObjectType referencedObject = getReferencedObject(propertyValue); + if (referencedObject == null) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error resolving references", + new EbxmlRegistryException( + "Encountered unresolvable property [" + + propertyValue + "] on object [" + + obj.getId() + "]")); + } else { + referencedObjects.add(referencedObject); + } + } + + return referencedObjects; + } catch (Exception e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error getting referenced objects", e); + } + + } + + /** + * Gets the referenced object with the given reference + * + * @param objRef + * The reference to resolve + * @return The actual object referenced + * @throws EbxmlRegistryException + * If errors occur while resolving the reference + * @throws MsgRegistryException + * If errors occur while resolving the reference + */ + public RegistryObjectType getReferencedObject(String objRef) + throws EbxmlRegistryException, MsgRegistryException { + RegistryObjectType retVal = getStaticReferencedObject(objRef); + if (retVal == null) { + retVal = getDynamicReferencedObject(objRef); + if (retVal == null) { + retVal = getRESTReferencedObject(objRef); + } + } + return retVal; + } + /** * Checks if the object specified by ref on the object obj is a static * reference @@ -203,6 +293,13 @@ public class ObjectReferenceResolver { return getStaticReferencedObject(ref) != null; } + /** + * Gets the object referenced via static reference + * + * @param ref + * The object reference + * @return The actual object referenced by the given static reference + */ public RegistryObjectType getStaticReferencedObject(String ref) { return registryObjectDao.getById(ref); } @@ -230,6 +327,17 @@ public class ObjectReferenceResolver { return getDynamicReferencedObject(ref) != null; } + /** + * Gets the object referenced by the dynamic reference + * + * @param ref + * The dynamic reference + * @return The objec referenced by the dynamic reference + * @throws EbxmlRegistryException + * If errors occur while resolving the reference + * @throws MsgRegistryException + * If errors occur while resolving the reference + */ public RegistryObjectType getDynamicReferencedObject(String ref) throws EbxmlRegistryException, MsgRegistryException { DynamicObjectRefType dynamicRef = dynamicRefDao.getById(ref); @@ -264,6 +372,15 @@ public class ObjectReferenceResolver { return getRESTReferencedObject(ref) != null; } + /** + * Gets the object referenced by the given REST endpoint + * + * @param ref + * The REST endpoint reference + * @return The actual object referenced by the given REST endpoint + * @throws EbxmlRegistryException + * If errors occur while resolving the REST endpoint + */ public RegistryObjectType getRESTReferencedObject(String ref) throws EbxmlRegistryException { @@ -292,6 +409,13 @@ public class ObjectReferenceResolver { return retVal; } + /** + * Checks if the given URL is valid + * + * @param url + * the URL to check + * @return True if the URL is valid, else false + */ public boolean isValidURL(String url) { return urlValidator.isValid(url); } 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 e4c128f2ef..fb37c5f3e0 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 @@ -19,10 +19,17 @@ **/ package com.raytheon.uf.edex.registry.ebxml.services.notification; +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.NotificationListener; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.NotificationType; +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.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -40,6 +47,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.notification.listeners.WebSe * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 17, 2013 1672 djohnson Initial creation + * 10/20/2013 1682 bphillip Added synchronous notification delivery * * * @@ -73,6 +81,17 @@ public class NotificationListenerFactory implements statusHandler.warn("Unsupported delivery type: " + endpointType + ". Notification will not be delivered!"); } + + @Override + @WebMethod(action = "SynchronousNotification") + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") + public RegistryResponseType synchronousNotification( + @WebParam(name = "Notification", targetNamespace = EbxmlNamespaces.RIM_URI, partName = "Notification") NotificationType notification) + throws MsgRegistryException { + statusHandler.warn("Unsupported delivery type: " + endpointType + + ". Notification will not be delivered!"); + return null; + } } private final EmailSender emailSender; 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 2944c00065..36ab06197b 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 @@ -24,6 +24,9 @@ import java.util.Collection; import java.util.List; import javax.annotation.Resource; +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; import javax.xml.ws.WebServiceContext; import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; @@ -46,24 +49,27 @@ 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.rs.v4.RegistryResponseStatus; +import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType; import org.springframework.transaction.annotation.Transactional; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.registry.constants.ActionTypes; import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; import com.raytheon.uf.common.registry.constants.DeletionScope; -import com.raytheon.uf.common.registry.constants.Format; -import com.raytheon.uf.common.registry.constants.Languages; +import com.raytheon.uf.common.registry.constants.QueryLanguages; import com.raytheon.uf.common.registry.constants.QueryReturnTypes; 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.edex.registry.ebxml.dao.ClassificationNodeDao; import com.raytheon.uf.edex.registry.ebxml.dao.RegistryDao; import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; import com.raytheon.uf.edex.registry.ebxml.services.lifecycle.LifecycleManagerImpl; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; /** @@ -79,6 +85,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; * 4/9/2013 1802 bphillip Implemented notification handling * 5/21/2013 2022 bphillip Reworked how notifications are handled * 9/11/2013 2254 bphillip Cleaned up handling of notifications and removed unneccessary code + * 10/20/2013 1682 bphillip Added synchronous notification delivery * * * @@ -108,9 +115,6 @@ public class NotificationListenerImpl implements NotificationListener { /** Data access object for getting RegistryType objects */ private RegistryDao registryDao; - /** The classification node data access object */ - private ClassificationNodeDao classificationNodeDao; - @Override public void onNotification(NotificationType notification) { @@ -128,7 +132,8 @@ public class NotificationListenerImpl implements NotificationListener { List events = notification.getEvent(); - // Process the received auditable events and add them to the appropriate + // Process the received auditable events and add them to the + // appropriate // list based on the action performed for (AuditableEventType event : events) { @@ -137,13 +142,6 @@ public class NotificationListenerImpl implements NotificationListener { String eventType = action.getEventType(); List objectIds = new ArrayList(); - // Verify this is a valid event type - if (!classificationNodeDao.isValidNode(eventType)) { - statusHandler.info("Unknown event type [" + eventType - + "] received in notification"); - continue; - } - if (action.getAffectedObjectRefs() != null) { for (ObjectRefType ref : action.getAffectedObjectRefs() .getObjectRef()) { @@ -168,10 +166,10 @@ public class NotificationListenerImpl implements NotificationListener { Mode.CREATE_OR_REPLACE); lcm.submitObjects(submitRequest); } catch (MsgRegistryException e) { - statusHandler.error( + throw new RuntimeException( "Error creating objects in registry!", e); } catch (EbxmlRegistryException e) { - statusHandler.error( + throw new RuntimeException( "Error creating submit objects request!", e); } } else if (eventType.equals(ActionTypes.delete)) { @@ -192,14 +190,33 @@ public class NotificationListenerImpl implements NotificationListener { try { lcm.removeObjects(request); } catch (MsgRegistryException e) { - statusHandler.error( + throw new RuntimeException( "Error creating remove objects request!", e); } + } else { + statusHandler.info("Unknown event type [" + eventType + + "] received in notification"); } - } } + } + @Override + @WebMethod(action = "SynchronousNotification") + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") + public RegistryResponseType synchronousNotification( + @WebParam(name = "Notification", targetNamespace = EbxmlNamespaces.RIM_URI, partName = "Notification") NotificationType notification) + throws MsgRegistryException { + RegistryResponseType response = new RegistryResponseType(); + response.setRequestId(notification.getId()); + try { + onNotification(notification); + response.setStatus(RegistryResponseStatus.SUCCESS); + return response; + } catch (Throwable e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error processing notification.", e); + } } /** @@ -287,21 +304,23 @@ public class NotificationListenerImpl implements NotificationListener { } queryExpression.append(")"); - ResponseOptionType responseOption = new ResponseOptionType(); - responseOption.setReturnComposedObjects(true); - responseOption.setReturnType(QueryReturnTypes.REGISTRY_OBJECT); + SlotType queryLanguageSlot = new SlotType( + QueryConstants.QUERY_LANGUAGE, new StringValueType( + QueryLanguages.HQL)); + SlotType queryExpressionSlot = new SlotType( + QueryConstants.QUERY_EXPRESSION, new StringValueType( + queryExpression.toString())); + QueryType query = new QueryType(); + query.setQueryDefinition(CanonicalQueryTypes.ADHOC_QUERY); + query.getSlot().add(queryLanguageSlot); + query.getSlot().add(queryExpressionSlot); - SlotType queryLanguageSlot = new SlotType("queryLanguage", - new StringValueType("HQL")); - SlotType queryExpressionSlot = new SlotType("queryExpression", - new StringValueType(queryExpression.toString())); - QueryType selectorQuery = new QueryType( - CanonicalQueryTypes.ADHOC_QUERY, queryLanguageSlot, - queryExpressionSlot); - return new QueryRequest("NotificationListener object update", - "NotificationListener object Update", new ResponseOptionType( - QueryReturnTypes.REGISTRY_OBJECT, true), selectorQuery, - false, null, Format.EBRIM, Languages.EN_US, 0, 0, 0, false); + QueryRequest request = new QueryRequest(); + request.setResponseOption(new ResponseOptionType( + QueryReturnTypes.REGISTRY_OBJECT, true)); + request.setId("Notification Update Query"); + request.setQuery(query); + return request; } public void setLcm(LifecycleManagerImpl lcm) { @@ -312,13 +331,7 @@ public class NotificationListenerImpl implements NotificationListener { this.registryObjectDao = registryObjectDao; } - public void setClassificationNodeDao( - ClassificationNodeDao classificationNodeDao) { - this.classificationNodeDao = classificationNodeDao; - } - public void setRegistryDao(RegistryDao registryDao) { this.registryDao = registryDao; } - } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/NotificationListenerImplWrapper.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/NotificationListenerImplWrapper.java index 7a0517622a..e6b55c457d 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/NotificationListenerImplWrapper.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/NotificationListenerImplWrapper.java @@ -22,12 +22,19 @@ package com.raytheon.uf.edex.registry.ebxml.services.notification; import javax.jws.Oneway; import javax.jws.WebMethod; import javax.jws.WebParam; +import javax.jws.WebResult; +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.NotificationListener; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.NotificationType; +import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseStatus; +import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType; import org.springframework.transaction.annotation.Transactional; +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; + /** * * Wrapper for the notificationlistener service to be used with the SOAP @@ -40,6 +47,7 @@ import org.springframework.transaction.annotation.Transactional; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 7/11/2013 1707 bphillip Initial implementation + * 10/20/2013 1682 bphillip Added synchronous notification delivery * * * @author bphillip @@ -60,11 +68,29 @@ public class NotificationListenerImplWrapper implements NotificationListener { } @Override - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:NotificationListener:bindings:4.0:NotificationListener:onNotification") + @WebMethod(action = ON_NOTIFICATION_ACTION) @Oneway public void onNotification( - @WebParam(name = "Notification", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:rim:4.0", partName = "Notification") NotificationType notification) { + @WebParam(name = "Notification", targetNamespace = EbxmlNamespaces.RIM_URI, partName = "Notification") NotificationType notification) { notificationListener.onNotification(notification); } + @Override + @WebMethod(action = "SynchronousNotification") + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") + public RegistryResponseType synchronousNotification( + @WebParam(name = "Notification", targetNamespace = EbxmlNamespaces.RIM_URI, partName = "Notification") NotificationType notification) + throws MsgRegistryException { + RegistryResponseType response = new RegistryResponseType(); + response.setRequestId(notification.getId()); + try { + notificationListener.synchronousNotification(notification); + response.setStatus(RegistryResponseStatus.SUCCESS); + return response; + } catch (Throwable e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error processing notification.", e); + } + } + } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/RegistryNotificationManager.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/RegistryNotificationManager.java index f23696a82d..226dc5f8bd 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/RegistryNotificationManager.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/RegistryNotificationManager.java @@ -24,15 +24,16 @@ import java.math.BigInteger; import java.util.ArrayList; import java.util.List; -import javax.xml.bind.JAXBException; import javax.xml.datatype.XMLGregorianCalendar; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.soap.SOAPException; +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.ResponseOptionType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ActionType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AuditableEventType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.NotificationType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectRefType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SubscriptionType; @@ -40,16 +41,17 @@ import org.springframework.transaction.annotation.Transactional; import com.raytheon.uf.common.dataplugin.persist.IPersistableDataObject; import com.raytheon.uf.common.registry.constants.ActionTypes; +import com.raytheon.uf.common.registry.constants.QueryReturnTypes; import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; import com.raytheon.uf.common.registry.constants.StatusTypes; import com.raytheon.uf.common.registry.ebxml.RegistryUtil; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.edex.registry.ebxml.dao.AuditableEventTypeDao; -import com.raytheon.uf.edex.registry.ebxml.dao.NotificationTypeDao; import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; import com.raytheon.uf.edex.registry.ebxml.services.notification.RegistrySubscriptionManager.NotificationListenerWrapper; import com.raytheon.uf.edex.registry.ebxml.services.notification.RegistrySubscriptionManager.SubscriptionNotificationListeners; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImpl; import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; /** @@ -68,6 +70,8 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; * 5/21/2013 2022 bphillip Cleaned up unused method parameters and batching of notifications * 9/11/2013 2354 bphillip Added logic to ensure delete events get included in notifications * 9/30/2013 2191 bphillip Fixing federated replication + * 10/8/2013 1682 bphillip Moved get objects of interest from RegistrySubscriptionManager and javadoc + * 10/20/2013 1682 bphillip Added synchronous notification delivery * * * @author bphillip @@ -83,34 +87,77 @@ public class RegistryNotificationManager { /** Data access object for auditable events */ private AuditableEventTypeDao auditableEventDao; - /** Data access object for notifications */ - private NotificationTypeDao notificationDao; + /** The query manager implementation */ + private QueryManagerImpl queryManager; + + /** The maximum number of auditable events sent in a notification message */ + private int notificationBatchSize = Integer.parseInt(System + .getProperty("ebxml-notification-batch-size")); /** * Creates a new RegistryNotificationManager * - * @throws JAXBException - * @throws SOAPException - * @throws ParserConfigurationException */ public RegistryNotificationManager() { } - protected List getEventsOfInterest( + /** + * Gets the objects of interest for a given subscription + * + * @param subscription + * The subscription to get the objects of interest for + * @return The objects of interest for the given subscription + * @throws MsgRegistryException + * If errors occur while executing the subscription's selector + * query + */ + public List getObjectsOfInterest( + SubscriptionType subscription) throws MsgRegistryException { + // Get objects that match selector query + QueryType selectorQuery = subscription.getSelector(); + ResponseOptionType responseOption = EbxmlObjectUtil.queryObjectFactory + .createResponseOptionType(); + responseOption.setReturnType(QueryReturnTypes.OBJECT_REF); + QueryResponse queryResponse = queryManager.executeQuery(responseOption, + selectorQuery); + return queryResponse.getObjectRefList().getObjectRef(); + } + + /** + * Gets events of interest based on a start time and end time for the given + * list of objects + * + * @param startTime + * The lower time boundary for the query + * @param endTime + * The optional upper time boundary for the query + * @param objectsOfInterest + * The objects to get events for + * @return The events of interest for the given set of objects + */ + public List getEventsOfInterest( XMLGregorianCalendar startTime, XMLGregorianCalendar endTime, List objectsOfInterest) { return this.auditableEventDao.getEventsOfInterest(startTime, endTime, objectsOfInterest); } - protected List getEventsOfInterest( - SubscriptionType subscription, List objectsOfInterest) { - return this.auditableEventDao.getEventsOfInterest( - subscription.getStartTime(), subscription.getEndTime(), - objectsOfInterest); - } - - protected NotificationType getNotification(SubscriptionType subscription, + /** + * Constructs the NotificationType object for the given parameters + * + * @param subscription + * The subscription that this notification is for + * @param address + * The address to send the notification to + * @param objectsOfInterest + * The objects affected by the change + * @param eventsOfInterest + * The events related to the objects of interest + * @return The NotificationType object for the given parameters + * @throws EbxmlRegistryException + * If errors occur while creating or checking the notification + */ + public NotificationType getNotification(SubscriptionType subscription, String address, List objectsOfInterest, List eventsOfInterest) throws EbxmlRegistryException { @@ -121,12 +168,31 @@ public class RegistryNotificationManager { return notification; } + /** + * Sends a notification + * + * @param listener + * The notification listener to use to send the notification + * @param notification + * The notification to send + * @param address + * The address to send the notification to + * @throws MsgRegistryException + */ protected void sendNotification(NotificationListenerWrapper listener, - NotificationType notification, String address) { + NotificationType notification, String address) + throws MsgRegistryException { statusHandler.info("Sending notification [" + notification.getId() + "] to address [" + address + "]"); - listener.notificationListener.onNotification(notification); + + try { + listener.notificationListener.synchronousNotification(notification); + } catch (MsgRegistryException e) { + statusHandler.error("Notification [" + notification.getId() + + " failed to address [" + address + "]", e); + throw e; + } statusHandler.info("Notification [" + notification.getId() + " successfully sent to address [" + address + "]"); @@ -146,51 +212,77 @@ public class RegistryNotificationManager { * The objects of interest to send notifications for * @throws EbxmlRegistryException * If errors occur while sending the notifications + * @throws MsgRegistryException */ protected void sendNotifications( - SubscriptionNotificationListeners notificationListeners, - final List objectsOfInterest) - throws EbxmlRegistryException { - int SIZE_LIMIT = 10; + SubscriptionNotificationListeners notificationListeners) + throws EbxmlRegistryException, MsgRegistryException { final List listeners = notificationListeners.listeners; final SubscriptionType subscription = notificationListeners.subscription; + List objectsOfInterest = getObjectsOfInterest(subscription); + List eventsOfInterest = getEventsOfInterest( - subscription, objectsOfInterest); + subscription.getStartTime(), subscription.getEndTime(), + objectsOfInterest); if (!eventsOfInterest.isEmpty()) { for (NotificationListenerWrapper listener : listeners) { - int subListCount = eventsOfInterest.size() / SIZE_LIMIT; - int lastListSize = eventsOfInterest.size() % SIZE_LIMIT; - for (int i = 0; i < subListCount; i++) { + int subListCount = eventsOfInterest.size() + / notificationBatchSize; + int lastListSize = eventsOfInterest.size() + % notificationBatchSize; + try { + for (int i = 0; i < subListCount; i++) { - NotificationType notification = getNotification( - subscription, - listener.address, - objectsOfInterest, - eventsOfInterest.subList(SIZE_LIMIT * i, SIZE_LIMIT - * i + SIZE_LIMIT)); - if (!notification.getEvent().isEmpty()) { - sendNotification(listener, notification, - listener.address); + NotificationType notification = getNotification( + subscription, + listener.address, + objectsOfInterest, + eventsOfInterest.subList(notificationBatchSize + * i, notificationBatchSize * i + + notificationBatchSize)); + if (!notification.getEvent().isEmpty()) { + sendNotification(listener, notification, + listener.address); + } } - } - if (lastListSize > 0) { - NotificationType notification = getNotification( - subscription, listener.address, objectsOfInterest, - eventsOfInterest.subList(SIZE_LIMIT * subListCount, - SIZE_LIMIT * subListCount + lastListSize)); - if (!notification.getEvent().isEmpty()) { - sendNotification(listener, notification, - listener.address); + if (lastListSize > 0) { + NotificationType notification = getNotification( + subscription, + listener.address, + objectsOfInterest, + eventsOfInterest.subList(notificationBatchSize + * subListCount, notificationBatchSize + * subListCount + lastListSize)); + if (!notification.getEvent().isEmpty()) { + sendNotification(listener, notification, + listener.address); + } } + } catch (MsgRegistryException e) { + statusHandler.error("Notification delivery failed!", e); } } } } + /** + * Checks a notification to ensure that previously transmitted events are + * not being sent again + * + * @param notification + * The notification to check + * @param objectsOfInterest + * The objects affected by the change that generated the + * notification + * @param serviceAddress + * The destination address for the notification + * @throws EbxmlRegistryException + * If errors occur while checking the notification + */ protected void checkNotification(NotificationType notification, List objectsOfInterest, String serviceAddress) throws EbxmlRegistryException { @@ -352,8 +444,8 @@ public class RegistryNotificationManager { this.auditableEventDao = auditableEventDao; } - public void setNotificationDao(NotificationTypeDao notificationDao) { - this.notificationDao = notificationDao; + public void setQueryManager(QueryManagerImpl queryManager) { + this.queryManager = queryManager; } } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/RegistrySubscriptionManager.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/RegistrySubscriptionManager.java index ab7ab75efe..5042b408b5 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/RegistrySubscriptionManager.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/RegistrySubscriptionManager.java @@ -23,6 +23,7 @@ import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; import java.util.List; +import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicBoolean; @@ -35,14 +36,8 @@ import javax.xml.ws.wsaddressing.W3CEndpointReference; import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.NotificationListener; -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.query.v4.ResponseOptionType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AuditableEventType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.DateTimeValueType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.DeliveryInfoType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.NotificationType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectRefType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SubscriptionType; @@ -58,9 +53,8 @@ import org.w3c.dom.NodeList; import com.google.common.collect.Lists; import com.google.common.eventbus.Subscribe; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.registry.constants.DeliveryMethodTypes; -import com.raytheon.uf.common.registry.constants.Namespaces; -import com.raytheon.uf.common.registry.constants.QueryReturnTypes; import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; import com.raytheon.uf.common.registry.event.InsertRegistryEvent; import com.raytheon.uf.common.registry.event.RemoveRegistryEvent; @@ -72,7 +66,6 @@ import com.raytheon.uf.edex.registry.ebxml.dao.SubscriptionDao; import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; import com.raytheon.uf.edex.registry.ebxml.init.RegistryInitializedListener; import com.raytheon.uf.edex.registry.ebxml.services.IRegistrySubscriptionManager; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImpl; import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; /** @@ -93,6 +86,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; * 9/5/2013 1538 bphillip Changed processing of each subscription to be in their own transaction. Subscriptions are now loaded on startup * 9/11/2013 2354 bphillip Added handling of deleted objects * 9/30/2013 2191 bphillip Fixing federated replication + * 10/8/2013 1682 bphillip Moved getObjectsOfInterest into RegistryNotificationManager * * * @author bphillip @@ -161,9 +155,6 @@ public class RegistrySubscriptionManager implements /** The notification manager */ private RegistryNotificationManager notificationManager; - /** The local query manager */ - private QueryManagerImpl queryManager; - /** Data access object for subscription objects */ private SubscriptionDao subscriptionDao; @@ -180,6 +171,8 @@ public class RegistrySubscriptionManager implements public RegistrySubscriptionManager(boolean subscriptionProcessingEnabled) throws JAXBException { this.subscriptionProcessingEnabled = subscriptionProcessingEnabled; + Properties props = System.getProperties(); + System.out.println(); } @Override @@ -288,13 +281,13 @@ public class RegistrySubscriptionManager implements endpointReference.writeTo(dom); Document doc = (Document) dom.getNode(); NodeList nodes = doc.getElementsByTagNameNS( - Namespaces.ADDRESSING_NAMESPACE, + EbxmlNamespaces.ADDRESSING_URI, RegistrySubscriptionManager.ADDRESS_TAG); Node addressNode = nodes.item(0); String serviceAddress = addressNode.getTextContent().trim(); String endpointType = addressNode .getAttributes() - .getNamedItemNS(Namespaces.EBXML_RIM_NAMESPACE_URI, + .getNamedItemNS(EbxmlNamespaces.RIM_URI, RegistrySubscriptionManager.ENDPOINT_TAG) .getNodeValue(); final NotificationDestination destination = new NotificationDestination( @@ -459,9 +452,8 @@ public class RegistrySubscriptionManager implements } statusHandler.info("Processing subscription [" + subscriptionName + "]..."); - notificationManager.sendNotifications( - listeners.get(subscriptionName), - getObjectsOfInterest(subscription)); + notificationManager.sendNotifications(listeners + .get(subscriptionName)); updateLastRunTime(subscription, TimeUtil.currentTimeMillis()); } catch (Throwable e) { statusHandler.error( @@ -471,37 +463,6 @@ public class RegistrySubscriptionManager implements } - public NotificationType getOnDemandNotification(String address, - String subscriptionId, XMLGregorianCalendar startTime) - throws MsgRegistryException, EbxmlRegistryException { - SubscriptionNotificationListeners subscriptionListener = listeners - .get(subscriptionId); - SubscriptionType subscription = subscriptionDao - .getById(subscriptionListener.subscription.getId()); - List objectsOfInterest = getObjectsOfInterest(subscription); - List eventsOfInterest = notificationManager - .getEventsOfInterest(startTime, null, objectsOfInterest); - NotificationType notification = notificationManager.getNotification( - subscription, address, objectsOfInterest, eventsOfInterest); - return notification; - } - - private List getObjectsOfInterest( - SubscriptionType subscription) throws MsgRegistryException { - // Get objects that match selector query - QueryType selectorQuery = subscription.getSelector(); - ResponseOptionType responseOption = EbxmlObjectUtil.queryObjectFactory - .createResponseOptionType(); - responseOption.setReturnType(QueryReturnTypes.OBJECT_REF); - QueryResponse queryResponse = queryManager.executeQuery(responseOption, - selectorQuery); - return queryResponse.getObjectRefList().getObjectRef(); - } - - public void setQueryManager(QueryManagerImpl queryManager) { - this.queryManager = queryManager; - } - public void setSubscriptionDao(SubscriptionDao subscriptionDao) { this.subscriptionDao = subscriptionDao; } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/listeners/EmailNotificationListener.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/listeners/EmailNotificationListener.java index 44a9637ebd..c22d836a46 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/listeners/EmailNotificationListener.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/listeners/EmailNotificationListener.java @@ -19,15 +19,24 @@ **/ package com.raytheon.uf.edex.registry.ebxml.services.notification.listeners; +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.NotificationListener; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ExtrinsicObjectType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.NotificationType; +import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseStatus; +import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; import com.raytheon.uf.edex.registry.ebxml.services.notification.EmailSender; import com.raytheon.uf.edex.registry.ebxml.services.notification.NotificationDestination; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; /** * Email notification listener. @@ -39,6 +48,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.notification.NotificationDes * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 16, 2013 1672 djohnson Extracted from RegistryNotificationManager. + * 10/20/2013 1682 bphillip Added synchronous notification delivery * * * @@ -105,4 +115,22 @@ public class EmailNotificationListener implements NotificationListener { } } + @Override + @WebMethod(action = "SynchronousNotification") + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") + public RegistryResponseType synchronousNotification( + @WebParam(name = "Notification", targetNamespace = EbxmlNamespaces.RIM_URI, partName = "Notification") NotificationType notification) + throws MsgRegistryException { + RegistryResponseType response = new RegistryResponseType(); + response.setRequestId(notification.getId()); + try { + onNotification(notification); + response.setStatus(RegistryResponseStatus.SUCCESS); + return response; + } catch (Throwable e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error processing notification.", e); + } + } + } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/listeners/SpringBeanNotificationListener.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/listeners/SpringBeanNotificationListener.java index 9d9d19967b..3ca5c20cb5 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/listeners/SpringBeanNotificationListener.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/notification/listeners/SpringBeanNotificationListener.java @@ -19,14 +19,23 @@ **/ package com.raytheon.uf.edex.registry.ebxml.services.notification.listeners; +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.NotificationListener; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.NotificationType; +import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseStatus; +import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; import com.raytheon.uf.edex.core.EDEXUtil; import com.raytheon.uf.edex.registry.ebxml.services.notification.NotificationDestination; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; /** * Implements the plugin based notification listener of the EBXML specification. @@ -38,6 +47,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.notification.NotificationDes * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 17, 2013 1672 djohnson Initial creation + * 10/20/2013 1682 bphillip Added synchronous notification delivery * * * @@ -84,4 +94,22 @@ public class SpringBeanNotificationListener implements NotificationListener { } } + @Override + @WebMethod(action = "SynchronousNotification") + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") + public RegistryResponseType synchronousNotification( + @WebParam(name = "Notification", targetNamespace = EbxmlNamespaces.RIM_URI, partName = "Notification") NotificationType notification) + throws MsgRegistryException { + RegistryResponseType response = new RegistryResponseType(); + response.setRequestId(notification.getId()); + try { + onNotification(notification); + response.setStatus(RegistryResponseStatus.SUCCESS); + return response; + } catch (Throwable e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error processing notification.", e); + } + } + } 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 d3a731f224..60d0742319 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 @@ -19,14 +19,24 @@ **/ package com.raytheon.uf.edex.registry.ebxml.services.notification.listeners; +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.NotificationListener; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.NotificationType; +import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseStatus; +import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.registry.services.RegistrySOAPServices; +import com.raytheon.uf.common.registry.services.RegistryServiceException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; import com.raytheon.uf.edex.registry.ebxml.services.notification.NotificationDestination; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; /** * Notifies listeners via a web service. @@ -39,6 +49,7 @@ import com.raytheon.uf.edex.registry.ebxml.services.notification.NotificationDes * ------------ ---------- ----------- -------------------------- * 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 * * * @@ -74,6 +85,24 @@ public class WebServiceNotificationListener implements NotificationListener { } } + @Override + @WebMethod(action = "SynchronousNotification") + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") + public RegistryResponseType synchronousNotification( + @WebParam(name = "Notification", targetNamespace = EbxmlNamespaces.RIM_URI, partName = "Notification") NotificationType notification) + throws MsgRegistryException { + RegistryResponseType response = new RegistryResponseType(); + response.setRequestId(notification.getId()); + try { + onNotification(notification); + response.setStatus(RegistryResponseStatus.SUCCESS); + return response; + } catch (Throwable e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error processing notification.", e); + } + } + /** * Sends the notification via SOAP * @@ -83,13 +112,16 @@ public class WebServiceNotificationListener implements NotificationListener { * The address to send the notification to * @throws EbxmlRegistryException * If errors occur while sending the notification + * @throws MsgRegistryException + * @throws RegistryServiceException */ protected void sendNotificationViaSoap(NotificationType notification, - String serviceAddress) throws EbxmlRegistryException { + String serviceAddress) throws EbxmlRegistryException, + RegistryServiceException, MsgRegistryException { statusHandler.info("Sending notification [" + notification.getId() + "]"); RegistrySOAPServices.getNotificationListenerServiceForUrl( - serviceAddress).onNotification(notification); + 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 ecc82d0d98..c3b7245218 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 @@ -19,10 +19,13 @@ **/ package com.raytheon.uf.edex.registry.ebxml.services.query; -import java.math.BigInteger; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.concurrent.Callable; import java.util.concurrent.CancellationException; @@ -32,7 +35,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import javax.annotation.Resource; -import javax.xml.bind.JAXBException; import javax.xml.ws.WebServiceContext; import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; @@ -40,31 +42,49 @@ import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.QueryManager; import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; import oasis.names.tc.ebxml.regrep.xsd.query.v4.ResponseOptionType; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.ResponseOptionType.RETURN_TYPE; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ExtensibleObjectType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ExtrinsicObjectType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.FederationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.InternationalStringType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.LocalizedStringType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectRefListType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectRefType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ParameterType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryDefinitionType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryExpressionType; 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.StringQueryExpressionType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.XMLQueryExpressionType; import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseStatus; +import org.hibernate.SessionFactory; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.common.registry.constants.Format; -import com.raytheon.uf.common.registry.constants.Languages; import com.raytheon.uf.common.registry.constants.QueryReturnTypes; import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; import com.raytheon.uf.common.registry.services.RegistrySOAPServices; -import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.time.util.ITimer; import com.raytheon.uf.common.time.util.TimeUtil; +import com.raytheon.uf.common.util.CollectionUtil; +import com.raytheon.uf.edex.registry.ebxml.dao.ClassificationNodeDao; import com.raytheon.uf.edex.registry.ebxml.dao.FederationDao; +import com.raytheon.uf.edex.registry.ebxml.dao.QueryDefinitionDao; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.IRegistryQuery; +import com.raytheon.uf.edex.registry.ebxml.services.lifecycle.ObjectReferenceResolver; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.RegistryQueryPlugin; import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; @@ -99,6 +119,8 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; * Apr 24, 2013 1910 djohnson RegistryResponseStatus is now an enum. * Jun 24, 2013 2106 djohnson Transaction must already be open. * 9/5/2013 1538 bphillip Removed log message + * 10/8/2013 1682 bphillip Refactored querying + * 10/201 1682 bphillip Fixed federated query invocation * * * @@ -106,28 +128,36 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; * @version 1.0 */ @Transactional(propagation = Propagation.MANDATORY) -public class QueryManagerImpl implements QueryManager { +public class QueryManagerImpl implements QueryManager, ApplicationContextAware { /** The logger */ protected static final IUFStatusHandler statusHandler = UFStatus .getHandler(QueryManagerImpl.class); + /** Standard query error message */ private static final String QUERY_ERROR_MSG = "Error executing query"; + /** List of EBXML leaf classes */ + private static List> LEAF_CLASSES; + + /** Default sorter for sorting query results */ + private static final Comparator RESULT_SORTER = new Comparator() { + @Override + public int compare(RegistryObjectType o1, RegistryObjectType o2) { + return o1.getId().compareTo(o2.getId()); + } + }; + + private Map queryPlugins = new HashMap(); + + /** The web service context if this class was called via a web service */ @Resource private WebServiceContext wsContext; /** - * Boolean denoting that the results should be eagerly fetched from the - * database + * The Spring session factory */ - private boolean eagerFetch = false; - - /** - * Query type manager for getting query objects based on values provided in - * a submitted query - */ - private QueryTypeManager queryTypeMgr; + private SessionFactory sessionFactory; /** * Data access object for interacting with FederationType objects. Used @@ -135,6 +165,21 @@ public class QueryManagerImpl implements QueryManager { */ private FederationDao federationDao; + /** + * Data access object for interacting with Query Definitions + */ + private QueryDefinitionDao queryDefinitionDao; + + /** + * Data access object for getting classification nodes + */ + private ClassificationNodeDao classificationNodeDao; + + /** + * Data access object for getting registry objects + */ + private RegistryObjectDao registryObjectDao; + /** * Executor service used to submit queries to federation members in parallel * during the processing of a federated query @@ -142,51 +187,25 @@ public class QueryManagerImpl implements QueryManager { private final ExecutorService queryExecutor; /** - * ObjectRef - This option specifies that the QueryResponse MUST contain a - * element. The purpose of this option is to return - * references to objects rather than the actual objects. - * - * RegistryObject - This option specifies that the QueryResponse MUST - * contain a element containing - * elements with xsi:type=rim:RegistryObjectType. - * - * LeafClass - This option specifies that the QueryResponse MUST contain a - * collection of element containing - * elements that have an xsi:type attribute that - * corresponds to leaf classes as defined in [regrep-xsd-v4.0]. No - * RepositoryItems SHOULD be included for any rim:ExtrinsicObjectType - * instance in the element. - * - * LeafClassWithRepositoryItem - This option is the same as the LeafClass - * option with the additional requirement that the response include the - * RepositoryItems, if any, for every rim:ExtrinsicObjectType instance in - * the element. + * Utility object used to resolve registry object references */ - public enum RETURN_TYPE { - ObjectRef, RegistryObject, LeafClass, LeafClassWithRepositoryItem - } - - /** The default format for query responses */ - private static final String DEFAULT_RESPONSE_FORMAT = "application/ebrim+xml"; - - public static final int DEFAULT_MAX_RESULTS = -1; - - public static final int DEFAULT_START_INDEX = 0; - - public static final int DEFAULT_DEPTH = 0; - - public static final int TRANSITIVE_CLOSURE_DEPTH = -1; - - public static final boolean DEFAULT_MATCH_OLDER_VERSIONS = false; - - /** The default return type */ - public static final RETURN_TYPE DEFAULT_RETURN_TYPE = RETURN_TYPE.LeafClassWithRepositoryItem; + private ObjectReferenceResolver referenceResolver; /** * Creates a new QueryManagerImpl */ public QueryManagerImpl() { queryExecutor = Executors.newCachedThreadPool(); + + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) + throws BeansException { + for (RegistryQueryPlugin plugin : applicationContext.getBeansOfType( + RegistryQueryPlugin.class).values()) { + queryPlugins.put(plugin.getQueryDefinition(), plugin); + } } /** @@ -207,26 +226,26 @@ public class QueryManagerImpl implements QueryManager { timer.start(); statusHandler.info("QueryManager received executeQuery Request " + queryRequest.getId() + " from [" + client + "]"); - QueryResponse response = EbxmlObjectUtil.queryObjectFactory - .createQueryResponse(); + QueryResponse response = new QueryResponse(); response.setStatus(RegistryResponseStatus.SUCCESS); + ResponseOptionType responseOption = queryRequest.getResponseOption(); + int depth = queryRequest.getDepth().intValue(); String format = queryRequest.getFormat(); String lang = queryRequest.getLang(); + boolean matchOlderVersions = queryRequest.isMatchOlderVersions(); + int maxResults = queryRequest.getMaxResults().intValue(); + int startIndex = queryRequest.getStartIndex().intValue(); - if (!format.equals(DEFAULT_RESPONSE_FORMAT)) { - // TODO: Implement support for different response formats - response.getException() - .add(EbxmlExceptionUtil - .createUnsupportedCapabilityExceptionType( - QUERY_ERROR_MSG, - "This EBXML registry currently does not currently support queries specifying response types other than " - + DEFAULT_RESPONSE_FORMAT) - .getFaultInfo()); - } - - if (lang != null) { - // TODO: Add support for specifying the lang attribute - statusHandler.warn("Lang attribute currently not supported."); + /* + * We are only supporting the default response format. Support for + * others may be added later. + */ + if (!format.equals(QueryRequest.DEFAULT_RESPONSE_FORMAT)) { + throw EbxmlExceptionUtil.createUnsupportedCapabilityExceptionType( + QUERY_ERROR_MSG, + "This registry does not support the specified response format of [" + + format + "]. Accepted response formats are [" + + QueryRequest.DEFAULT_RESPONSE_FORMAT + "]"); } try { @@ -244,8 +263,81 @@ public class QueryManagerImpl implements QueryManager { } catch (EbxmlRegistryException e) { throw EbxmlExceptionUtil.createMsgRegistryException( QUERY_ERROR_MSG, e); - } + + List result = response.getRegistryObjects(); + processDepth(result, depth); + // Sort the result so iterative queries are consistent + CollectionUtil.removeNulls(result); + Collections.sort(result, RESULT_SORTER); + + // If we are not to match older versions, the results must be filtered + // to contain only the latest version of each object + if (!matchOlderVersions) { + Map versionMap = new HashMap( + result.size(), 1); + for (RegistryObjectType obj : result) { + RegistryObjectType existingObject = versionMap + .get(obj.getLid()); + if (existingObject == null + || obj.getVersionInfo().greaterThan( + existingObject.getVersionInfo())) { + versionMap.put(obj.getLid(), obj); + } + } + result = new ArrayList(versionMap.values()); + } + + switch (responseOption.getReturnTypeEnum()) { + case LeafClassWithRepositoryItem: + case LeafClass: + List leafObjects = new ArrayList(); + for (RegistryObjectType obj : result) { + if (isRimLeafClass(obj.getClass())) { + if (responseOption.getReturnTypeEnum().equals( + RETURN_TYPE.LeafClass) + && (obj instanceof ExtrinsicObjectType)) { + ExtrinsicObjectType extObj = (ExtrinsicObjectType) obj; + extObj.setRepositoryItem(null); + extObj.setRepositoryItemRef(null); + + } + leafObjects.add(obj); + } + } + response.getRegistryObjectList().setRegistryObject( + trimResult(leafObjects, startIndex, maxResults)); + + break; + case RegistryObject: + response.getRegistryObjectList().setRegistryObject( + trimResult(result, startIndex, maxResults)); + break; + case ObjectRef: + response.setRegistryObjectList(null); + response.setObjectRefList(new ObjectRefListType()); + for (RegistryObjectType obj : result) { + response.getObjectRefList().getObjectRef() + .add(new ObjectRefType(obj.getId())); + } + response.getObjectRefList() + .setObjectRef( + trimResult(response.getObjectRefs(), startIndex, + maxResults)); + break; + } + + /* + * Process the language constraint + */ + if (!responseOption.getReturnTypeEnum().equals(RETURN_TYPE.ObjectRef) + && lang != null && !lang.isEmpty()) { + for (RegistryObjectType obj : response.getRegistryObjects()) { + filterLanguage(obj.getName(), lang); + filterLanguage(obj.getDescription(), lang); + } + } + timer.stop(); String queryRequestId = queryRequest.getId(); statusHandler.info("QueryManager executeQuery id [" + queryRequestId @@ -255,6 +347,152 @@ public class QueryManagerImpl implements QueryManager { } + /** + * Initializes the static leaf classes + * + * @return The leaf class list + */ + private synchronized List> getLeafClasses() { + if (CollectionUtil.isNullOrEmpty(LEAF_CLASSES)) { + LEAF_CLASSES = new ArrayList>(); + List> leafClasses = new ArrayList>(); + for (Object obj : sessionFactory.getAllClassMetadata().keySet()) { + try { + Class clazz = Class.forName((String) obj); + if (clazz.getName().startsWith( + "oasis.names.tc.ebxml.regrep.xsd.rim.v4")) { + leafClasses.add(clazz); + } + } catch (ClassNotFoundException e) { + statusHandler.error( + "Error initializing RegRep database. Class not found: " + + obj, e); + } + } + LEAF_CLASSES.addAll(leafClasses); + for (Class clazz : leafClasses) { + if (ExtensibleObjectType.class.isAssignableFrom(clazz)) { + Class currentClass = clazz; + while (!currentClass.equals(Object.class)) { + currentClass = currentClass.getSuperclass(); + if (currentClass != null) { + LEAF_CLASSES.remove(currentClass); + } + } + } else { + LEAF_CLASSES.remove(clazz); + } + } + } + return LEAF_CLASSES; + } + + /** + * Checks if the given class is a EBXML leaf class as defined by the EBXML + * 4.0 spec + * + * @param clazzToCheck + * The class to check + * @return True if the given class is a leaf class + */ + public boolean isRimLeafClass(Class clazzToCheck) { + return getLeafClasses().contains(clazzToCheck); + } + + /** + * Filters the query to only include strings of a given language + * + * @param intlStr + * The International string to filter + * @param language + * The language to filter on + */ + private void filterLanguage(InternationalStringType intlStr, String language) { + if (intlStr != null) { + LocalizedStringType str = null; + for (LocalizedStringType localStr : intlStr.getLocalizedString()) { + if (localStr.getLang() != null + && localStr.getLang().equals(language)) { + str = localStr; + break; + } + } + if (str != null) { + intlStr.getLocalizedString().clear(); + intlStr.getLocalizedString().add(str); + } + } + } + + /** + * Processes the depth attribute + * + * @param result + * The result to process + * @param depth + * The depth used for resolving references + * @throws MsgRegistryException + * If errors occur while getting the referenced objects + */ + private void processDepth(List result, int depth) + throws MsgRegistryException { + /* + * A depth of 0 indicates that the server MUST return only those objects + * that match the query. + */ + if (depth == 0) { + return; + } + + Set objsToCheck = new HashSet( + result); + if (depth == -1) { + boolean transitiveClosure = false; + while (!transitiveClosure) { + Set referencedObjects = referenceResolver + .getReferencedObjects(objsToCheck); + if (result.containsAll(referencedObjects)) { + transitiveClosure = true; + } + result.addAll(referencedObjects); + } + + } else { + for (int i = 0; i < depth; i++) { + Set referencedObjects = referenceResolver + .getReferencedObjects(objsToCheck); + result.addAll(referencedObjects); + objsToCheck = referencedObjects; + } + } + + } + + /** + * Trims the result set based on the max results and start index of the + * query + * + * @param result + * The result to trim + * @param startIndex + * The start index for the results + * @param maxResults + * The maximum number of results to be returned + * @return The trimmed result list + */ + private List trimResult(List result, + int startIndex, int maxResults) { + if (maxResults == QueryRequest.DEFAULT_MAX_RESULTS.intValue() + && startIndex == QueryRequest.DEFAULT_START_INDEX.intValue()) { + return result; + } + if (maxResults == QueryRequest.DEFAULT_MAX_RESULTS.intValue()) { + return CollectionUtil.subList(result, startIndex, result.size() + - startIndex); + } + return CollectionUtil.subList(result, startIndex, maxResults); + } + /** * Executes a query on the local registry * @@ -272,15 +510,47 @@ public class QueryManagerImpl implements QueryManager { private void executeLocalQuery(QueryRequest queryRequest, QueryResponse queryResponse, String client) throws MsgRegistryException, EbxmlRegistryException { - IRegistryQuery query = getQuery(queryRequest.getQuery()); - query.executeQuery(queryRequest, queryResponse, client); - if (eagerFetch) { - try { - SerializationUtil.getJaxbManager().marshalToXml(queryResponse); - } catch (JAXBException e) { - throw new EbxmlRegistryException( - "Error eagerly fetching items", e); + QueryType query = queryRequest.getQuery(); + String queryDefinition = query.getQueryDefinition(); + RegistryQueryPlugin plugin = queryPlugins.get(queryDefinition); + if (plugin == null) { + QueryDefinitionType queryDef = queryDefinitionDao.getById(query + .getQueryDefinition()); + if (queryDef == null) { + throw EbxmlExceptionUtil.createQueryExceptionType( + "Query not found [" + queryDef + "]", "The query [" + + queryDef + + "] is not defined in this registry"); } + + QueryExpressionType queryExpression = queryDef.getQueryExpression(); + String queryLanguage = queryExpression.getQueryLanguage(); + + if (queryExpression instanceof XMLQueryExpressionType) { + throw EbxmlExceptionUtil + .createQueryExceptionType( + "Unsupported Query Expression Type", + "This registry does not support quries using the XMLQueryExpression type. Only StringExpressionType expressions are valid"); + } + if (classificationNodeDao.getById(queryLanguage) == null) { + throw EbxmlExceptionUtil.createQueryExceptionType( + "Unsupported query language [" + queryLanguage + "]", + "This registry does not support the query language [" + + queryLanguage + "]"); + } + checkQueryParameters(query); + String queryString = ((StringQueryExpressionType) queryExpression) + .getValue(); + Object[] queryParameters = RegistryQueryUtil.getQueryParameters( + queryDef, query); + List results = registryObjectDao + .executeHQLQuery(queryString, queryParameters); + queryResponse.addRegistryObjects(results); + } else { + queryPlugins.put(queryDefinition, plugin); + checkQueryParameters(queryRequest.getQuery()); + QueryResponse response = plugin.executeQuery(queryRequest); + consolidateQueryResponse(queryResponse, response); } } @@ -458,13 +728,12 @@ public class QueryManagerImpl implements QueryManager { QueryType query = new QueryType( CanonicalQueryTypes.FIND_ASSOCIATED_OBJECTS, associationTypeSlot, sourceObjectIdSlot); - QueryRequest queryRequest = new QueryRequest( - "Query for federation members", - "Query to get the members of the federation", - new ResponseOptionType(QueryReturnTypes.REGISTRY_OBJECT, true), - query, false, null, Format.EBRIM, Languages.EN_US, 0, 0, 0, - false); - QueryResponse response = executeQuery(queryRequest); + QueryRequest request = new QueryRequest(); + request.setResponseOption(new ResponseOptionType( + QueryReturnTypes.REGISTRY_OBJECT, true)); + request.setId("Get Members of Federation Query"); + request.setQuery(query); + QueryResponse response = executeQuery(request); if (response.getRegistryObjectList() != null) { List responseObjects = response .getRegistryObjectList().getRegistryObject(); @@ -531,36 +800,6 @@ public class QueryManagerImpl implements QueryManager { } } - /** - * Executes a query with the give parameters. This method is not exposed as - * a service and is only intended to be used internally - * - * @param response - * @param responseOption - * @param queryType - * @param depth - * @param matchOlderVersions - * @param maxResults - * @param startIndex - * @return The query response - * @throws MsgRegistryException - * If the query fails - */ - public QueryResponse executeQuery(ResponseOptionType responseOption, - QueryType queryType, int depth, boolean matchOlderVersions, - int maxResults, int startIndex) throws MsgRegistryException { - QueryRequest queryRequest = EbxmlObjectUtil.queryObjectFactory - .createQueryRequest(); - queryRequest.setResponseOption(responseOption); - queryRequest.setQuery(queryType); - queryRequest.setDepth(new BigInteger(String.valueOf(depth))); - queryRequest.setMatchOlderVersions(matchOlderVersions); - queryRequest.setMaxResults(new BigInteger(String.valueOf(maxResults))); - queryRequest.setStartIndex(new BigInteger(String.valueOf(startIndex))); - QueryResponse queryResponse = executeQuery(queryRequest); - return queryResponse; - } - public QueryResponse executeQuery(ResponseOptionType responseOption, QueryType queryType) throws MsgRegistryException { statusHandler @@ -569,49 +808,71 @@ public class QueryManagerImpl implements QueryManager { .createQueryRequest(); queryRequest.setResponseOption(responseOption); queryRequest.setQuery(queryType); - queryRequest.setDepth(new BigInteger(String.valueOf(DEFAULT_DEPTH))); - queryRequest.setMatchOlderVersions(DEFAULT_MATCH_OLDER_VERSIONS); - queryRequest.setMaxResults(new BigInteger(String - .valueOf(DEFAULT_MAX_RESULTS))); - queryRequest.setStartIndex(new BigInteger(String - .valueOf(DEFAULT_START_INDEX))); + queryRequest.setDepth(QueryRequest.DEFAULT_DEPTH); + queryRequest + .setMatchOlderVersions(QueryRequest.DEFAULT_MATCH_OLDER_VERSIONS); + queryRequest.setMaxResults(QueryRequest.DEFAULT_MAX_RESULTS); + queryRequest.setStartIndex(QueryRequest.DEFAULT_START_INDEX); QueryResponse queryResponse = executeQuery(queryRequest); return queryResponse; } /** - * Gets the query type implementation + * Checks to ensure that the specified query contains all the required + * parameters * - * @param queryType - * The query type to retrieve - * @return The implementation of the given query type + * @param query + * The query to check * @throws MsgRegistryException - * If the given query type does not have an implementation + * If the query parameters are invalid or missing */ - private IRegistryQuery getQuery(QueryType queryType) + private void checkQueryParameters(QueryType query) throws MsgRegistryException { - String queryDefinition = queryType.getQueryDefinition(); - - IRegistryQuery query = queryTypeMgr.getQueryType(queryDefinition); - if (query == null) { - throw EbxmlExceptionUtil.createUnsupportedCapabilityExceptionType( - QUERY_ERROR_MSG, - "The query type [" + queryType.getQueryDefinition() - + "] is not registered as a vaild query type"); + List parameters = queryDefinitionDao + .getParametersForQuery(query.getQueryDefinition()); + for (ParameterType param : parameters) { + if (param.getMinOccurs() != null) { + int minOccurs = param.getMinOccurs().intValue(); + List values = query.getSlotValueAsList(param + .getParameterName()); + if (values.size() < minOccurs + || (param.getMaxOccurs() != null && values.size() > param + .getMaxOccurs().intValue())) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Invalid parameters passed to query!", + new EbxmlRegistryException( + "Invalid parameter count detected for query [" + + query.getQueryDefinition() + + "] for parameter [" + + param.getParameterName() + "]")); + } + } } - return query; - } - - public void setQueryTypeMgr(QueryTypeManager queryTypeMgr) { - this.queryTypeMgr = queryTypeMgr; - } - - public void setEagerFetch(boolean eagerFetch) { - this.eagerFetch = eagerFetch; } public void setFederationDao(FederationDao federationDao) { this.federationDao = federationDao; } + public void setReferenceResolver(ObjectReferenceResolver referenceResolver) { + this.referenceResolver = referenceResolver; + } + + public void setQueryDefinitionDao(QueryDefinitionDao queryDefinitionDao) { + this.queryDefinitionDao = queryDefinitionDao; + } + + public void setClassificationNodeDao( + ClassificationNodeDao classificationNodeDao) { + this.classificationNodeDao = classificationNodeDao; + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } + + public void setSessionFactory(SessionFactory sessionFactory) { + this.sessionFactory = sessionFactory; + } + } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryManagerImplWrapper.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryManagerImplWrapper.java index 3b121369be..e37d95c8ec 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryManagerImplWrapper.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryManagerImplWrapper.java @@ -30,6 +30,8 @@ import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; import org.springframework.transaction.annotation.Transactional; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** * * Wrapper for the query service to be used with the SOAP interface. @@ -60,10 +62,10 @@ public class QueryManagerImplWrapper implements QueryManager { } @Override - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:registry:bindings:4.0:QueryManager#executeQuery") - @WebResult(name = "QueryResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:query:4.0", partName = "partQueryResponse") + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") public QueryResponse executeQuery( - @WebParam(name = "QueryRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:query:4.0", partName = "partQueryRequest") QueryRequest partQueryRequest) + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest partQueryRequest) throws MsgRegistryException { return queryManager.executeQuery(partQueryRequest); } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryParameters.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryParameters.java deleted file mode 100644 index a88782c580..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryParameters.java +++ /dev/null @@ -1,218 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; - -/** - * - * Container class used to hold query parameters extracted from slots - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Feb 21, 2012 #184       bphillip     Initial creation
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ -public class QueryParameters { - - /** The map of parameters */ - private Map> parameterMap; - - /** - * Creates a new empty set of query parameters - */ - public QueryParameters() { - parameterMap = new HashMap>(); - } - - /** - * Adds a parameter to the set - * - * @param parameterName - * The parameter name - * @param parameterValue - * The parameter value - */ - public void addParameter(String parameterName, Object parameterValue) { - if (parameterValue instanceof Collection) { - for (Object obj : ((Collection) parameterValue)) { - addParameter(parameterName, obj); - } - } else { - if (!containsParameter(parameterName)) { - parameterMap.put(parameterName, new ArrayList()); - } - parameterMap.get(parameterName).add(parameterValue); - } - } - - /** - * Adds a parameter contained within a slot to the set - * - * @param slot - * The slot containing the parameter value - */ - public void addParameter(SlotType slot) { - addParameter(slot.getName(), slot.getSlotValue().getValue()); - } - - /** - * Gets the values associated with this parameter - * - * @param parameterName - * The parameter to get the values for - * @return The values - */ - public List getParameter(String parameterName) { - return parameterMap.get(parameterName); - } - - /** - * Gets the item at the specified index in the list - * - * @param - * An object - * @param parameterName - * The parameter name to get - * @param index - * The value index to get - * @return The value at the specified index - */ - @SuppressWarnings("unchecked") - public T getParameter(String parameterName, int index) { - if (containsParameter(parameterName)) { - return (T) parameterMap.get(parameterName).get(index); - } - return null; - } - - /** - * Gets the first value in the value list for a given parameter - * - * @param - * An object class - * @param parameterName - * The parameter name to get - * @return The first value in the value list for the given parameter - */ - public T getFirstParameter(String parameterName) { - return getParameter(parameterName, 0); - } - - /** - * Gets the first value in the value list for a given parameter. If not - * found, return the default value provided - * - * @param - * An object class - * @param parameterName - * The parameter name to get - * @param defaultValue - * The default value to return if not found - * @return The first value in the value list for the given parameter, or the - * default value if not found - */ - public T getFirstParameter(String parameterName, - T defaultValue) { - T param = getParameter(parameterName, 0); - if (param == null) { - return defaultValue; - } else { - return param; - } - } - - /** - * Checks if a parameter is contained in this set - * - * @param parameterName - * The parameter name to check for - * @return True if the parameter name is contained in this set, else false - */ - public boolean containsParameter(String parameterName) { - return parameterMap.containsKey(parameterName); - } - - /** - * Checks if the given parameter list is contained in the set - * - * @param parameterNames - * The parameter names to check for - * @return True if all the parameters provided are in the list, else false - */ - public boolean containsParameters(String... parameterNames) { - return parameterMap.keySet().containsAll(Arrays.asList(parameterNames)); - } - - /** - * Removes the parameter value list from this set - * - * @param parameterName - * The parameter to remove the values for - * @return The values removed - */ - public List removeParameter(String parameterName) { - return parameterMap.remove(parameterName); - } - - /** - * Checks if this parameter set is empty - * - * @return True if empty - */ - public boolean isEmpty() { - return parameterMap.isEmpty(); - } - - /** - * Gets the underlying parameter map object - * - * @return The parameter map - */ - public Map> getParameterMap() { - return parameterMap; - } - - /** - * Sets the parameter map - * - * @param parameterMap - * The parameter map to set - */ - public void setParameterMap(Map> parameterMap) { - this.parameterMap = parameterMap; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryTypeManager.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryTypeManager.java deleted file mode 100644 index 54387a3339..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/QueryTypeManager.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query; - -import java.util.HashMap; -import java.util.Map; - -import com.raytheon.uf.edex.registry.ebxml.services.query.types.IRegistryQuery; - -/** - * This class contains a mapping of query definitions to query implementations. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012 184        bphillip     Initial creation
- * Jun 24, 2013 2106       djohnson     Remove static use.
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ -public class QueryTypeManager { - - /** The query map */ - private final Map queryTypeMap = new HashMap(); - - /** - * Private constructor - */ - public QueryTypeManager() { - } - - /** - * Gets a query implementation from the given query definition - * - * @param queryDefinition - * The query definition for which to get the associated - * implementation - * @return The query implementation - */ - public IRegistryQuery getQueryType(String queryDefinition) { - return queryTypeMap.get(queryDefinition); - } - - public Object addQueryTypes(IRegistryQuery... queries) { - for (IRegistryQuery query : queries) { - queryTypeMap.put(query.getQueryDefinition(), query); - } - return null; - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/RegistryQueryUtil.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/RegistryQueryUtil.java new file mode 100644 index 0000000000..e4f2bfa498 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/RegistryQueryUtil.java @@ -0,0 +1,227 @@ +/** + * 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.registry.ebxml.services.query; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import java.util.regex.Pattern; + +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.BooleanValueType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.DateTimeValueType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.IntegerValueType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ParameterType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryDefinitionType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType; + +import com.raytheon.uf.common.util.CollectionUtil; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; + +/** + * + * Utility class for querying + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class RegistryQueryUtil { + + /** Valid parameter types for Query Definition Parameters */ + public enum PARAMETER_DATA_TYPE { + STRING, TAXONOMYELEMENT, BOOLEAN, INTEGER, DATETIME + } + + /** + * Pattern used to replace the registry wildcard character of ? to the + * database wildcard of _ + */ + private static final Pattern REPLACE_LIKE_CHARS_PATTERN = Pattern + .compile("\\?"); + + /** + * Replaces the registry character wilcard (?) with the database wildcard + * (_) + * + * @param str + * The string to modify + * @return The modified string + */ + public static String substituteWildcardCharacters(String str) { + return REPLACE_LIKE_CHARS_PATTERN.matcher(str).replaceAll("_"); + } + + /** + * Gets the query parameters from a query definition in a format so it may + * be passed to the SessionManagedDao executing the query + * + * @param queryDef + * The Query Definition + * @param query + * The query object + * @return Array of parameter names and values to pass to the data access + * object + * @throws MsgRegistryException + * If errors occur while converting the default value + */ + public static Object[] getQueryParameters(QueryDefinitionType queryDef, + QueryType query) throws MsgRegistryException { + List parameters = queryDef.getParameter(); + if (CollectionUtil.isNullOrEmpty(parameters)) { + return new Object[] {}; + } + List params = new ArrayList(parameters.size() * 2); + + for (ParameterType param : parameters) { + String paramName = param.getParameterName(); + Object paramValue = query.getSlotValue(paramName); + if (paramValue == null && param.getDefaultValue() != null) { + paramValue = convertObject(getDataType(param.getDataType()), + param.getDefaultValue()); + } + params.add(paramName); + params.add(paramValue); + } + return params.toArray(new Object[params.size()]); + } + + /** + * Adds a slot to the query + * + * @param value + * The value to add + * @param parameter + * The parameter definition to determine method of adding slot to + * the query + * @param query + * The query to add the parameter slot to + * @throws MsgRegistryException + * If errors occur while creating calendar objects or if an + * unsupported data type is detected + */ + public static void addSlotToQuery(String value, ParameterType parameter, + QueryType query) throws MsgRegistryException { + + PARAMETER_DATA_TYPE paramType = getDataType(parameter.getDataType()); + String paramName = parameter.getParameterName(); + + if (paramType == null) { + throw EbxmlExceptionUtil.createUnsupportedCapabilityExceptionType( + "Unsupported parameter dataType!", "The data type [" + + parameter.getDataType() + + "] is currently unsupported"); + } + switch (paramType) { + case STRING: + case TAXONOMYELEMENT: + query.getSlot().add( + new SlotType(paramName, new StringValueType(value))); + break; + case BOOLEAN: + query.getSlot().add( + new SlotType(paramName, new BooleanValueType(Boolean + .parseBoolean(value)))); + break; + case INTEGER: + query.getSlot().add( + new SlotType(paramName, new IntegerValueType( + new BigInteger(value)))); + break; + case DATETIME: + try { + query.getSlot().add( + new SlotType(paramName, new DateTimeValueType( + DatatypeFactory.newInstance() + .newXMLGregorianCalendar(value)))); + } catch (DatatypeConfigurationException e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error creating dateTime slot!", e); + } + break; + default: + throw EbxmlExceptionUtil.createUnsupportedCapabilityExceptionType( + "Unsupported parameter dataType!", "The data type [" + + paramType + "] is currently unsupported"); + } + + } + + /** + * Gets that enum data type from the string representation + * + * @param dataType + * The String representation of the data type + * @return The enum representing the data type + */ + private static PARAMETER_DATA_TYPE getDataType(String dataType) { + return PARAMETER_DATA_TYPE.valueOf(dataType.toUpperCase()); + } + + /** + * Converts a string version of an object to the desired type + * + * @param desiredType + * The desired object type + * @param value + * THe value to convert + * @return The converted value + * @throws MsgRegistryException + * If errors occur while creating a XMLGregorianCalendar + */ + private static Object convertObject(PARAMETER_DATA_TYPE desiredType, + String value) throws MsgRegistryException { + switch (desiredType) { + case STRING: + case TAXONOMYELEMENT: + return value; + case BOOLEAN: + return Boolean.valueOf(value); + case INTEGER: + return Integer.valueOf(value); + case DATETIME: + try { + return DatatypeFactory.newInstance().newXMLGregorianCalendar( + value); + } catch (DatatypeConfigurationException e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error creating XMLGregorianCalendar!", e); + } + default: + throw EbxmlExceptionUtil.createUnsupportedCapabilityExceptionType( + "Unsupported parameter dataType!", "The data type [" + + desiredType + "] is currently unsupported"); + + } + } +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/AdhocQuery.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/AdhocQuery.java new file mode 100644 index 0000000000..d7964af8f6 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/AdhocQuery.java @@ -0,0 +1,122 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.Map; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; + +/** + * The canonical query AdhocQuery allows clients to invoke a client-specified ad + * hoc query in a client-specified query expression syntax that is supported by + * the server. This specification does not require a server to support any + * specific query expression syntax. It is likely that servers may support one + * or more common syntaxes such as SQL-92, XQuery, XPath, SPARQL, Search-WS, OGC + * Filter etc. + *

+ * Parameter Summary:
+ * queryExpression -- Value is a query expression string in the + * language specified by the + *

+ * queryLanguage -- Value is the id of a ClassificationNode within + * the canonical QueryLanguageScheme ClassificationScheme. + * + * queryLanguage parameter + *

+ * + *

+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2012            bphillip     Initial creation
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip    Changed abstract method signature, modified return processing, and changed static variables
+ * Jun 24, 2013 2106       djohnson    Requires a transaction to be open, will not create one.
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class AdhocQuery extends RegistryQueryPlugin { + + /** Data access object for registry objects */ + private RegistryObjectDao registryObjectDao; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + String queryLanguage = queryType + .getSlotValue(QueryConstants.QUERY_LANGUAGE); + String queryExpression = queryType + .getSlotValue(QueryConstants.QUERY_EXPRESSION); + + Map queryParams = queryType.getSlotNameValues(); + queryParams.remove(QueryConstants.QUERY_EXPRESSION); + queryParams.remove(QueryConstants.QUERY_LANGUAGE); + Object[] parameters = new Object[queryParams.size() * 2]; + int index = 0; + for (String key : queryParams.keySet()) { + parameters[index++] = key; + parameters[index++] = queryParams.get(key); + } + + if (registryObjectDao.getById(queryLanguage) == null) { + throw EbxmlExceptionUtil.createQueryExceptionType( + "AdhocQuery does not support the following query language: [" + + queryLanguage + "]", ""); + + } + + if (parameters.length == 0) { + return createResponse(registryObjectDao + .executeHQLQuery(queryExpression)); + + } else { + return createResponse(registryObjectDao.executeHQLQuery( + queryExpression, parameters)); + } + + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/BasicQuery.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/BasicQuery.java new file mode 100644 index 0000000000..5da0dcffa8 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/BasicQuery.java @@ -0,0 +1,279 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.common.util.CollectionUtil; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; + +/** + * The canonical query BasicQuery allows clients to query for RegistryObjects by + * their name, description, type, status and classifications. + *

+ * Parameter Summary:
+ * · classifications -- Set whose elements are path attribute + * values to ClassificationNodes. + *

+ * Matches RegistryObjects that have a classification whose classificationNode + * attribute value matches the id of the ClassificationNode where + * rim:RegistryObject[@xsi:type="rim:ClassificationNodeType"]/@path matches + * specified value + *

+ * · description -- Matches + * rim:RegistryObject/rim:Description/rim:LocalizedString/@value + *

+ * · matchOnAnyParameter -- If true then use logical OR between + * predicates for each parameter. + *

+ * · name -- Matches + * rim:RegistryObject/rim:Name/rim:LocalizedString/@value + *

+ * · objectType -- Matches RegistryObjects whose objectType + * attribute matches the id of the ClassificationNode where + * rim:ClassificationNode/@path matches specified value + *

+ * · owner -- Matches rim:RegistryObject/@owner. Note that a + * parameter value of “#@'@#rs:currentUserId()#@'@#” may be used to specify the + * id of the user associated with the current request + *

+ * · status -- Matches RegistryObjects whose status attribute + * matches the id of the ClassificationNode where rim:ClassificationNode/@path + * matches specified value + *

+ * · This query has several optional parameters + *

+ * · Each parameter implies a predicate within the underlying query + *

+ * · Predicates for each supplied parameter are combined using with an implicit + * LOGICAL AND if matchOnAnyParameter is unspecified or false. If it is + * specified as true then predicates for each supplied parameters are combined + * using a LOGICAL OR + *

+ * · If an optional parameter is not supplied then its corresponding predicate + * MUST NOT be included in the underlying query + *

+ * + * + * + *

+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2/13/2012    #184       bphillip    Initial creation
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * 8/1/2013     1693       bphillip    Fixed minor typo
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class BasicQuery extends RegistryQueryPlugin { + + /** Data Access object for registry objects */ + private RegistryObjectDao registryObjectDao; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + List classifications = queryType + .getSlotValueAsList(QueryConstants.CLASSIFICATIONS); + List classificationIds = getClassificationNodeIdFromPath(classifications); + + String description = queryType.getSlotValue(QueryConstants.DESCRIPTION); + String name = queryType.getSlotValue(QueryConstants.NAME); + Boolean matchOnAnyParameter = queryType + .getSlotValue(QueryConstants.MATCH_ANY); + String objectType = getClassificationNodeIdFromPath((String) queryType + .getSlotValue(QueryConstants.OBJECT_TYPE)); + String owner = queryType.getSlotValue(QueryConstants.OWNER); + String status = getClassificationNodeIdFromPath((String) queryType + .getSlotValue(QueryConstants.STATUS)); + + List clauses = new ArrayList(); + StringBuilder query = new StringBuilder(512); + query.append("SELECT distinct(obj) FROM RegistryObjectType obj "); + if (name != null) { + query.append(" INNER JOIN obj.name.localizedString as nameStrings "); + } + if (description != null) { + query.append(" INNER JOIN obj.description.localizedString as descriptionStrings "); + } + if (!CollectionUtil.isNullOrEmpty(classificationIds)) { + query.append(" INNER JOIN obj.classification as classification "); + } + query.append(" WHERE "); + + String conjunction = getConjunction(matchOnAnyParameter); + clauses.add(getClassficiationsClause(classificationIds)); + clauses.add(getDescriptionClause(description)); + clauses.add(getNameClause(name)); + clauses.add(getObjectTypeClause(objectType)); + clauses.add(getOwnerClause(owner)); + clauses.add(getStatusClause(status)); + assembleClauses(query, conjunction, clauses); + + List result = registryObjectDao + .executeHQLQuery(query.toString()); + if (!CollectionUtil.isNullOrEmpty(classificationIds)) { + for (int i = 0; i < result.size(); i++) { + if (!containsAllClassifications(result.get(i), + classificationIds)) { + result.remove(i--); + } + } + } + return createResponse(CollectionUtil.removeNulls(result)); + } + + /** + * Checks if the given registry object contains the referenced + * classifications + * + * @param obj + * The object to check + * @param classificationIds + * The ids of the classifications to check + * @return True if the object contains the given classifications, else false + */ + private boolean containsAllClassifications(RegistryObjectType obj, + List classificationIds) { + Set classifications = obj.getClassification(); + if (!CollectionUtil.isNullOrEmpty(classifications)) { + List ids = new ArrayList(classifications.size()); + for (ClassificationType cl : classifications) { + ids.add(cl.getClassificationNode()); + } + return ids.containsAll(classificationIds); + } + return false; + } + + /** + * Generates the classification HQL clause for the given set of ids + * + * @param ids + * The ids used to generated the HQL classifications clause + * @return The classifications query clause + */ + private String getClassficiationsClause(List ids) { + if (CollectionUtil.isNullOrEmpty(ids)) { + return null; + } + StringBuilder builder = new StringBuilder(150 * ids.size()); + for (int i = 0; i < ids.size(); i++) { + builder.append(" classification.classificationNode='") + .append(ids.get(i)).append("' "); + if (i != ids.size() - 1) { + builder.append("OR "); + } + } + return builder.toString(); + } + + /** + * Gets the description clause + * + * @param description + * The description to generate the query clause for + * @return null if the provided description is null, else the description + * query clause + */ + private String getDescriptionClause(String description) { + return description == null ? null : " descriptionStrings.value = '" + + description + "' "; + } + + /** + * Gets the name clause + * + * @param name + * The name to generate the query clause for + * @return null if the provided name is null, else the name query clause + */ + private String getNameClause(String name) { + return name == null ? null : " nameStrings.value = '" + name + "' "; + } + + /** + * Gets the objectType clause + * + * @param objectType + * The object type used to generate the query clause + * @return null if the provided objectType is null, else the objectType + * query clause + */ + private String getObjectTypeClause(String objectType) { + return objectType == null ? null : " obj.objectType = '" + objectType + + "' "; + } + + /** + * Gets the owner clause + * + * @param owner + * The owner used to generate the query clause + * @return null if the provided owner is null, else the owner clause + */ + private String getOwnerClause(String owner) { + return owner == null ? null : " obj.owner = '" + owner + "' "; + } + + /** + * Gets the status clause + * + * @param status + * The status used to generate the status clause + * @return null if the provided statis is null, else the status clause + */ + private String getStatusClause(String status) { + return status == null ? null : " obj.status = '" + status + "' "; + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/ClassificationSchemeSelector.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/ClassificationSchemeSelector.java similarity index 71% rename from edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/ClassificationSchemeSelector.java rename to edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/ClassificationSchemeSelector.java index df07f76087..916a69d382 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/ClassificationSchemeSelector.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/ClassificationSchemeSelector.java @@ -17,12 +17,18 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; +package com.raytheon.uf.edex.registry.ebxml.services.query.plugins; import java.util.ArrayList; import java.util.List; import java.util.Set; +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationNodeType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationSchemeType; @@ -30,12 +36,9 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.TaxonomyElementType; -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectTypeDao; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; /** * The canonical query ClassificationSchemeSelector allows clients to create a @@ -67,37 +70,29 @@ import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQu * 2/13/2012 #184 bphillip Initial creation * 3/18/2013 1802 bphillip Modified to use transaction boundaries and spring dao injection * 4/9/2013 1802 bphillip Changed abstract method signature, modified return processing, and changed static variables + * 10/8/2013 1682 bphillip Refactored querying * * * * @author bphillip * @version 1.0 */ +public class ClassificationSchemeSelector extends RegistryQueryPlugin { -public class ClassificationSchemeSelector extends CanonicalEbxmlQuery { - - /** The valid query parameter for this query **/ - private static final List QUERY_PARAMETERS = new ArrayList(); - static { - QUERY_PARAMETERS.add(QueryConstants.CLASSIFICATION_SCHEME_ID); - } - + /** Data access object for classification schemes */ private RegistryObjectTypeDao classificationSchemeTypeDao; @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); List retVal = new ArrayList(); - QueryParameters parameters = this.getParameterMap(queryType.getSlot(), - queryResponse); - // The client did not specify the required parameter - if (parameters.isEmpty()) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" - + QUERY_PARAMETERS.get(0) + "]"); - } + String schemeId = queryType + .getSlotValue(QueryConstants.CLASSIFICATION_SCHEME_ID); /* * Get the classification scheme and recursively extract the nodes into @@ -105,11 +100,10 @@ public class ClassificationSchemeSelector extends CanonicalEbxmlQuery { * the class description */ ClassificationSchemeType classificationScheme = classificationSchemeTypeDao - .getById((String) parameters - .getFirstParameter(QueryConstants.CLASSIFICATION_SCHEME_ID)); + .getById(schemeId); getNodeList(classificationScheme, retVal); - queryResponse.getRegistryObjectList().getRegistryObject() - .addAll(retVal); + classificationScheme.setClassificationNode(null); + return createResponse(retVal); } /** @@ -135,19 +129,8 @@ public class ClassificationSchemeSelector extends CanonicalEbxmlQuery { } } - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.CLASSIFICATION_SCHEME_SELECTOR; - } - public void setClassificationSchemeTypeDao( RegistryObjectTypeDao classificationSchemeTypeDao) { this.classificationSchemeTypeDao = classificationSchemeTypeDao; } - } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/FindAssociatedObjects.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/FindAssociatedObjects.java new file mode 100644 index 0000000000..7276cabc22 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/FindAssociatedObjects.java @@ -0,0 +1,181 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.ArrayList; +import java.util.List; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; +import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; + +/** + * The canonical query FindAssociatedObjects allows clients to find + * RegistryObjects that are associated with the specified RegistryObject and + * match the specified criteria. + *

+ * Parameter Summary:
+ * associationType -- Matches associated RegistryObjects of + * Association's whose type attribute references a ClassificationNode where + * rim:ClassificationNode/@path matches specified value + *

+ * matchOnAnyParameter -- If true then use logical OR between + * predicates for each parameter + *

+ * sourceObjectId --Matches target RegistryObjects of Associations + * where the source RegistryObject's id matches + * rim:/RegistryObject[@xsi:type="rim:AssociationType"]/@sourceObject.
+ * Allows use of % wildcard character to match multiple characters.
+ * Allows use of ? wildcard character to match a single character.
+ *

+ * sourceObjectType -- Matches target RegistryObjects of + * Associations whose sourceObject attribute references a RegistryObject whose + * objectType attribute matches the id of the ClassificationNode where + * rim:ClassificationNode/@path matches specified value + *

+ * targetObjectId -- + * + * Matches source RegistryObjects of Associations where the target + * RegistryObject's id matches + * rim:/RegistryObject[@xsi:type="rim:AssociationType"]/@targetObject.
+ * Allows use of % wildcard character to match multiple characters.
+ * Allows use of ? wildcard character to match a single character.
+ *

+ * targetObjectType -- + * + * Matches source RegistryObjects of Associations whose targetObject attribute + * references a RegistryObject whose objectType attribute matches the id of the + * ClassificationNode where rim:ClassificationNode/@path matches specified value + * + *

+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2/13/2012    #184       bphillip     Initial creation
+ * 3/18/2013    1802       bphillip     Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * Apr 23, 2013 1910       djohnson     Don't allow NPE on registry object list, remove non ANSI Javadoc.
+ * 5/21/2013    2022       bphillip     Set return type on call to findAssociations
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class FindAssociatedObjects extends RegistryQueryPlugin { + + /** Data access object for accessing registry objects */ + private RegistryObjectDao registryObjectDao; + + /** The FindAssociations query object */ + private FindAssociations findAssociations; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + String sourceObjectId = queryType + .getSlotValue(QueryConstants.SOURCE_OBJECT_ID); + String sourceObjectType = queryType + .getSlotValue(QueryConstants.SOURCE_OBJECT_TYPE); + String targetObjectId = queryType + .getSlotValue(QueryConstants.TARGET_OBJECT_ID); + String targetObjectType = queryType + .getSlotValue(QueryConstants.TARGET_OBJECT_TYPE); + + if (targetObjectId == null && sourceObjectId == null) { + throw EbxmlExceptionUtil + .createQueryExceptionType( + "Either sourceObjectId or targetObjectId MUST be specified. Neither were present in submitted query", + ""); + } + + if (sourceObjectId != null && targetObjectId != null) { + throw EbxmlExceptionUtil + .createQueryExceptionType( + "Both sourceObjectId and targetObjectId MUST NOT be specified.", + ""); + } + + if (sourceObjectType != null && targetObjectType != null) { + throw EbxmlExceptionUtil + .createQueryExceptionType( + "Both sourceObjectType and targetObjectType MUST NOT be specified.", + ""); + } + + /* + * First, find the associations + */ + + QueryResponse findAssociationsResponse = findAssociations + .executeQuery(queryRequest); + + List ids = new ArrayList(findAssociationsResponse + .getRegistryObjects().size()); + /* + * Then get the referenced objects based on the given parameters + */ + for (RegistryObjectType obj : findAssociationsResponse + .getRegistryObjects()) { + + if (sourceObjectId == null) { + ids.add(((AssociationType) obj).getSourceObject()); + } else { + ids.add(((AssociationType) obj).getTargetObject()); + } + } + + try { + return createResponse(registryObjectDao.getById(ids)); + } catch (EbxmlRegistryException e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error executing query", e); + } + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } + + public void setFindAssociations(FindAssociations findAssociations) { + this.findAssociations = findAssociations; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/FindAssociations.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/FindAssociations.java new file mode 100644 index 0000000000..5c451380e7 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/FindAssociations.java @@ -0,0 +1,210 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.ArrayList; +import java.util.List; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.common.util.CollectionUtil; +import com.raytheon.uf.edex.registry.ebxml.dao.AssociationDao; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.RegistryQueryUtil; + +/** + * The canonical query FindAssociations query allows clients to find + * Associations that match the specified criteria. + *

+ * Parameter Summary:
+ * · associationType -- Matches Associations whose type attribute + * references a ClassificationNode where rim:ClassificationNode/@path matches + * specified value + *

+ * · matchOnAnyParameter -- If true then use logical OR between + * predicates for each parameter + *

+ * · sourceObjectId -- Matches + * rim:/RegistryObject[@xsi:type="rim:AssociationType"]/@sourceObject.
+ * Allows use of “%” wildcard character to match multiple characters.
+ * Allows use of “?” wildcard character to match a single character.
+ *

+ * · sourceObjectType -- Matches Associations whose sourceObject + * attribute references a RegistryObject whose objectType attribute matches the + * id of the ClassificationNode where rim:ClassificationNode/@path matches + * specified value + *

+ * · targetObjectId -- Matches + * rim:/RegistryObject[@xsi:type="rim:AssociationType"]/@targetObject.
+ * Allows use of “%” wildcard character to match multiple characters.
+ * Allows use of “?” wildcard character to match a single character.
+ *

+ * · targetObjectType -- Matches Associations whose targetObject + * attribute references a RegistryObject whose objectType attribute matches the + * id of the ClassificationNode where rim:ClassificationNode/@path matches + * specified value + * + *

+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2/13/2012    #184       bphillip     Initial creation
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * 8/1/2013     1693       bphilip     Fixed minor typo
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class FindAssociations extends RegistryQueryPlugin { + + /** Data access object for accessing registry objects */ + protected RegistryObjectDao registryObjectDao; + + /** Data access object for associations */ + private AssociationDao associationDao; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + String associationType = getClassificationNodeIdFromPath((String) queryType + .getSlotValue(QueryConstants.ASSOCIATION_TYPE)); + String sourceObjectId = queryType + .getSlotValue(QueryConstants.SOURCE_OBJECT_ID); + String sourceObjectType = getClassificationNodeIdFromPath((String) queryType + .getSlotValue(QueryConstants.SOURCE_OBJECT_TYPE)); + String targetObjectId = queryType + .getSlotValue(QueryConstants.TARGET_OBJECT_ID); + String targetObjectType = getClassificationNodeIdFromPath((String) queryType + .getSlotValue(QueryConstants.TARGET_OBJECT_TYPE)); + Boolean matchOnAnyParameter = queryType + .getSlotValue(QueryConstants.MATCH_ANY); + String conjunction = getConjunction(matchOnAnyParameter); + + List clauses = new ArrayList(6); + StringBuilder query = new StringBuilder(1024); + query.append("FROM AssociationType obj "); + + clauses.add(getAssociationTypeClause(associationType)); + clauses.add(getSourceIdClause(sourceObjectId)); + clauses.add(getTargetIdClause(targetObjectId)); + if (!CollectionUtil.removeNulls(clauses).isEmpty()) { + query.append(" WHERE "); + assembleClauses(query, conjunction, clauses); + } + + List associations = associationDao + .executeHQLQuery(query.toString()); + + List toRemove = new ArrayList(); + for (AssociationType association : associations) { + if (sourceObjectType != null) { + if (CollectionUtil + .isNullOrEmpty(registryObjectDao + .executeHQLQuery( + "FROM RegistryObjectType obj WHERE obj.id=:id AND obj.objectType=:objectType", + "id", association.getSourceObject(), + "objectType", sourceObjectType))) { + toRemove.add(association); + } + } + if (targetObjectType != null) { + if (CollectionUtil + .isNullOrEmpty(registryObjectDao + .executeHQLQuery( + "FROM RegistryObjectType obj WHERE obj.id=:id AND obj.objectType=:objectType", + "id", association.getTargetObject(), + "objectType", targetObjectType))) { + toRemove.add(association); + } + } + } + associations.removeAll(toRemove); + return createResponse(associations); + + } + + /** + * Gets the associationType clause + * + * @param associationType + * The associationType used to generated the clause + * @return null if associationType is null, else the associationType query + * clause + */ + private String getAssociationTypeClause(String associationType) { + return associationType == null ? null : " obj.type = '" + + associationType + "' "; + } + + /** + * Gets the sourceId clause + * + * @param sourceId + * The sourceId used to generate the clause + * @return null if the sourceId is null, else the sourceId query clause + */ + private String getSourceIdClause(String sourceId) { + return sourceId == null ? null : " obj.sourceObject like '" + + RegistryQueryUtil.substituteWildcardCharacters(sourceId) + + "' "; + } + + /** + * Gets the targetId clause + * + * @param targetId + * The targetId used to generated the clause + * @return null if the targetId is null, else the targetId query clause + */ + private String getTargetIdClause(String targetId) { + return targetId == null ? null : " obj.targetObject like '" + + RegistryQueryUtil.substituteWildcardCharacters(targetId) + + "' "; + } + + public void setAssociationDao(AssociationDao associationDao) { + this.associationDao = associationDao; + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GarbageCollectorQueryPlugin.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GarbageCollectorQueryPlugin.java new file mode 100644 index 0000000000..1a7beb0919 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GarbageCollectorQueryPlugin.java @@ -0,0 +1,100 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.ArrayList; +import java.util.List; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; + +/** + * Garbage collector implementation to purge items from the registry + *

+ * The Garbage collector operates on these rules:
+ * The server MAY return any objects it considers as garbage or no longer + * relavant or needed
+ * The definition of what objects are garbage may be implementation, profile, or + * deployment specific
+ * The server MUST return the following types of objects
+ * --Dangling Associations - AssociationType instances that have an unresolvable + * or null sourceObject or targetObject attribute + *

+ * This implementation only checks for dangling associations + * + * + *

+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2012            bphillip     Initial creation
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class GarbageCollectorQueryPlugin extends RegistryQueryPlugin { + + /** Data access object for accessing registry objects */ + protected RegistryObjectDao registryObjectDao; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + List retVal = new ArrayList(); + List associations = registryObjectDao + .executeHQLQuery("FROM AssociationType"); + + for (AssociationType association : associations) { + String sourceObject = association.getSourceObject(); + String targetObject = association.getTargetObject(); + if ((sourceObject == null || registryObjectDao + .getById(sourceObject) == null) + || (targetObject == null || registryObjectDao + .getById(targetObject) == null)) { + retVal.add(association); + } + } + return createResponse(retVal); + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetAuditTrailById.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetAuditTrailById.java new file mode 100644 index 0000000000..841e1a24f7 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetAuditTrailById.java @@ -0,0 +1,127 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.ArrayList; +import java.util.List; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.xml.datatype.XMLGregorianCalendar; + +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.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.edex.registry.ebxml.dao.AuditableEventTypeDao; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; + +/** + * The canonical query GetAuditTrailByLid allows clients to get the change + * history or audit trail for all RegistryObjects whose lid attribute value is + * the same as the value of the lid parameter. + * + *

+ * Parameter Summary:
+ * · endTime -- Specifies the end of the time interval (inclusive) + * for rim:/RegistryObject[@xsi:type="rim:AuditableEventType"]/@timestamp value + *

+ * · lid -- Matches rim:/RegistryObject/@lid. + *

+ * startTime -- Specifies the end of the time interval (inclusive) + * for rim:/RegistryObject[@xsi:type="rim:AuditableEventType"]/@timestamp value + *

+ * + *

+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 2/15/2012    #184       bphillip     Initial creation
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class GetAuditTrailById extends RegistryQueryPlugin { + + /** Data Access Object for auditableEvents */ + private AuditableEventTypeDao auditableEventDao; + + /** + * Query to find events referencing the id provided to the query + */ + private static final String FIND_EVENTS_FOR_ID_QUERY = "select event from AuditableEventType as event " + + "left outer join event.action as action " + + "left outer join action.affectedObjects as AffectedObjects " + + "left outer join action.affectedObjectRefs as AffectedObjectRefs " + + "left outer join AffectedObjects.registryObject as RegistryObjects " + + "left outer join AffectedObjectRefs.objectRef as ObjRefs " + + "where (ObjRefs.id =:id OR RegistryObjects.id =:id) "; + + /** + * The order clause to append to the query to ensure uniform ordering of + * results + */ + private static final String ORDER_BY_CLAUSE = " order by event.timestamp desc"; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + String id = queryType.getSlotValue(QueryConstants.ID); + XMLGregorianCalendar startTime = queryType + .getSlotValue(QueryConstants.START_TIME); + XMLGregorianCalendar endTime = queryType + .getSlotValue(QueryConstants.END_TIME); + List parameters = new ArrayList(4); + StringBuilder query = new StringBuilder( + FIND_EVENTS_FOR_ID_QUERY.replaceAll(":id", "'" + id + "'")); + if (startTime != null) { + query.append(" AND event.timestamp >= :startTime "); + parameters.add(QueryConstants.START_TIME); + parameters.add(startTime); + } + if (endTime != null) { + query.append(" AND event.timestamp <= :endTime "); + parameters.add(QueryConstants.END_TIME); + parameters.add(endTime); + } + query.append(ORDER_BY_CLAUSE); + return createResponse(auditableEventDao.executeHQLQuery( + query.toString(), + parameters.toArray(new Object[parameters.size()]))); + } + + public void setAuditableEventDao(AuditableEventTypeDao auditableEventDao) { + this.auditableEventDao = auditableEventDao; + } +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetAuditTrailByLid.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetAuditTrailByLid.java new file mode 100644 index 0000000000..c8d6403d7b --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetAuditTrailByLid.java @@ -0,0 +1,147 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.xml.datatype.XMLGregorianCalendar; + +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.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AuditableEventType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.DateTimeValueType; +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.SlotType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; + +/** + * + *

+ * Parameter Summary:
+ * · endTime -- Specifies the end of the time interval (inclusive) + * for rim:/RegistryObject[@xsi:type="rim:AuditableEventType"]/@timestamp value + *

+ * · id -- Matches rim:/RegistryObject/@id. + *

+ * startTime -- Specifies the end of the time interval (inclusive) + * for rim:/RegistryObject[@xsi:type="rim:AuditableEventType"]/@timestamp value + *

+ * + *

+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2012            bphillip    Initial creation 
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip    Changed abstract method signature, modified return
+ *                                     processing, and changed static variables
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ + +public class GetAuditTrailByLid extends RegistryQueryPlugin { + + /** Data access object for accessing registry objects */ + private RegistryObjectDao registryObjectDao; + + /** GetAuditTrailById query object */ + private GetAuditTrailById getAuditTrailById; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + List retVal = new ArrayList(); + + String lid = queryType.getSlotValue(QueryConstants.LID); + XMLGregorianCalendar startTime = queryType + .getSlotValue(QueryConstants.START_TIME); + XMLGregorianCalendar endTime = queryType + .getSlotValue(QueryConstants.END_TIME); + + List ids = registryObjectDao.executeHQLQuery( + "SELECT obj.id FROM RegistryObjectType obj where obj.lid=:lid", + "lid", lid); + + for (String id : ids) { + QueryType byIdQuery = new QueryType( + CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_ID); + + byIdQuery.getSlot().add( + new SlotType(QueryConstants.ID, new StringValueType(id))); + if (startTime != null) { + byIdQuery.getSlot().add( + new SlotType(QueryConstants.START_TIME, + new DateTimeValueType(startTime))); + } + if (endTime != null) { + byIdQuery.getSlot().add( + new SlotType(QueryConstants.END_TIME, + new DateTimeValueType(endTime))); + } + QueryRequest getByIdRequest = new QueryRequest(); + getByIdRequest.setQuery(byIdQuery); + QueryResponse getByIdResponse = getAuditTrailById + .executeQuery(getByIdRequest); + for (RegistryObjectType obj : getByIdResponse.getRegistryObjects()) { + retVal.add((AuditableEventType) obj); + } + } + Collections.sort(retVal, new Comparator() { + @Override + public int compare(AuditableEventType o1, AuditableEventType o2) { + // Did the comparison backward so we get a descending list + // instead of ascending + return o2.getTimestamp().compare(o1.getTimestamp()); + } + }); + return createResponse(retVal); + } + + public void setGetAuditTrailById(GetAuditTrailById getAuditTrailById) { + this.getAuditTrailById = getAuditTrailById; + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetAuditTrailByTimeInterval.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetAuditTrailByTimeInterval.java new file mode 100644 index 0000000000..2271e59e7b --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetAuditTrailByTimeInterval.java @@ -0,0 +1,144 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.xml.datatype.XMLGregorianCalendar; + +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.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.common.time.util.TimeUtil; +import com.raytheon.uf.edex.registry.ebxml.dao.AuditableEventTypeDao; +import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; + +/** + * The canonical query GetAuditTrailByTimeInterval allows clients to get all + * changes to all objects in the server within a specified time interval. This + * query may be used to keep a client periodically synchronized with changes in + * the server. + *

+ * The server MUST return a set of AuditableEvents whose timestamp attribute is + * within the time interval specified by startTime and endTime parameters. The + * set is sorted by the timestamp attribute value in descending order (latest + * first) + *

+ * The server MUST only include AuditableEvents whose timestamp is >= startTime + * parameter + * + * value + *

+ * The server MUST only include AuditableEvents whose timestamp is <= endTime + * parameter value + * + * + * + *

+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2012            bphillip     Initial creation
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class GetAuditTrailByTimeInterval extends RegistryQueryPlugin { + + /** The logger */ + protected static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(GetAuditTrailByTimeInterval.class); + + /** Query to get all AuditableEvents within the given timestamp boundaries */ + private static final String TIME_INTERVAL_QUERY = "" + + "FROM AuditableEventType event " + + "WHERE event.timestamp >= :startTime " + + "AND event.timestamp <= :endTime " + + "ORDER BY event.timestamp desc"; + + private AuditableEventTypeDao auditableEventDao; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + XMLGregorianCalendar startTime = queryType + .getSlotValue(QueryConstants.START_TIME); + XMLGregorianCalendar endTime = queryType + .getSlotValue(QueryConstants.END_TIME); + + // Start time defaults to current Time + long currentTime = TimeUtil.currentTimeMillis(); + if (startTime == null) { + try { + startTime = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(currentTime); + } catch (EbxmlRegistryException e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error assigning start time", e); + } + } + + // End time defaults to 5 minutes before current time + if (endTime == null) { + try { + endTime = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(currentTime + - TimeUtil.MILLIS_PER_MINUTE * 5); + } catch (EbxmlRegistryException e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error assigning end time", e); + } + } + return createResponse(auditableEventDao.executeHQLQuery( + TIME_INTERVAL_QUERY, QueryConstants.START_TIME, startTime, + QueryConstants.END_TIME, endTime)); + } + + @Override + public String getQueryDefinition() { + return CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_TIME_INTERVAL; + } + + public void setAuditableEventDao(AuditableEventTypeDao auditableEventDao) { + this.auditableEventDao = auditableEventDao; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetChildrenByParentId.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetChildrenByParentId.java new file mode 100644 index 0000000000..45abfe3d48 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetChildrenByParentId.java @@ -0,0 +1,345 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.ArrayList; +import java.util.List; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.OrganizationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectListType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryPackageType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.TaxonomyElementType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.util.CollectionUtil; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryPackageDao; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; + +/** + * The canonical query GetChildrenByParentId allows clients to get the children + * of a RegistryObject whose Id attribute value is the same as the value + * specified for the parentId parameter. This query is used to query objects + * hierarchies with parent-child relationships such as the following: + *

+ * ClassificationScheme – Child ClassificationNodes + *

+ * Organization – Child Organizations + *

+ * RegistryPackage – RegistryPackage Members + *

+ * Query Semantics + *

+ * If objectType and parentId are both unspecified the server MUST return all + * RegistryObjects that are not members of a RegistryPackage (root level + * objects) + *

+ * If parentId parameter is unspecified and objectType parameter is specified + * the server MUST re - turn all root level objects for the object hierarchy + * identified by the objectType as follows: + *

+ * If objectType parameter value contains the string “ClassificationScheme” the + * server MUST return all ClassificationSchemes + *

+ * If objectType parameter value contains the string “Organization” the server + * MUST return all Organizations that are not a member of another Organization + * (root level Organizations) + *

+ * If objectType parameter value contains the string “RegistryPackage” the + * server MUST return all RegistryPackages that are not a member of another + * RegistryPackage (root level RegistryPackages) + *

+ *

+ * If parentId parameter is specified then the behavior is as follows: + *

+ * If objectType parameter value is unspecified or if its value contains the + * string “RegistryPackage” the server MUST return all RegistryObjects that are + * member of a RegistryPackage whose id is the same as the value of the parentId + * attribute + *

+ * If objectType parameter is specified and its value contains the string + * “ClassificationScheme” the server MUST return all ClassificationNodes that + * are children of a TaxonomyElementType instance whose id is the same as the + * value of the parentId attribute + *

+ * If objectType parameter is specified and its value contains the string + * “Organization” the server MUST return all Organizations that are members of + * an Organization whose id is the same as the value of the parentId attribute + *

+ * If depth parameter is specified then the server MUST also return all + * descendants upto the specified depth as described by the definition of the + * depth parameter above + *

+ * If exclusiveChildrenOnly is specified with a true value then the server MUST + * not return any descendants that have multiple parents + * + * + *

+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2012            bphillip     Initial creation
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class GetChildrenByParentId extends RegistryQueryPlugin { + + /** Data access object for accessing registry objects */ + protected RegistryObjectDao registryObjectDao; + + /** Data access object for getting registry packages */ + private RegistryPackageDao registryPackageDao; + + /** ClassificationScheme token */ + private static final String CLASSIFICATION_SCHEME = "ClassificationScheme"; + + /** Organization token */ + private static final String ORGANIZATION = "Organization"; + + /** RegistryPackage token */ + private static final String REGISTRY_PACKAGE = "RegistryPackage"; + + /** Root level object query */ + private static final String ROOT_LEVEL_OBJECT_QUERY = "FROM RegistryObjectType obj where obj.id NOT IN (:ids)"; + + private static final String ROOT_LEVEL_PACKAGE_QUERY = "FROM RegistryPackageType obj where obj.id NOT IN (:ids)"; + + private static final String ROOT_LEVEL_ORG_QUERY = "FROM OrganizationType org where org.id NOT IN (:ids)"; + + private static final String EXCLUSIVE_REGISTRY_PACKAGE_QUERY = "" + + "FROM RegistryPackageType pack " + + "INNER JOIN pack.registryObjectList as objList " + + "INNER JOIN objList.registryObject as registryObject " + + "WHERE registryObject.id = :id"; + + private static final String EXCLUSIVE_CLASSIFICATION_QUERY = "" + + "FROM ClassificationSchemeType obj" + + "INNER JOIN obj.classificationNode as nodes " + + "WHERE nodes.id = :id"; + + private static final String EXCLUSIVE_ORGANIZATION_QUERY = "" + + "FROM OrganizationType org" + + "INNER JOIN org.organization as orgs " + "WHERE orgs.id = :id"; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + List retVal = new ArrayList(); + Integer depth = queryType.getSlotValue(QueryConstants.DEPTH); + Boolean exclusiveChildrenOnly = queryType + .getSlotValue(QueryConstants.EXCLUSIVE_CHILDREN_ONLY); + String objectType = queryType.getSlotValue(QueryConstants.OBJECT_TYPE); + String parentId = queryType.getSlotValue(QueryConstants.PARENT_ID); + + if (depth == null) { + depth = 1; + } + if (exclusiveChildrenOnly == null) { + exclusiveChildrenOnly = false; + } + + if (parentId == null && objectType == null) { + return createResponse(getRootLevelPackageObjects(false)); + } else if (parentId == null && objectType != null) { + if (objectType.contains(CLASSIFICATION_SCHEME)) { + retVal = getClassificationSchemes(); + } else if (objectType.contains(ORGANIZATION)) { + retVal = getRootLevelOrganizationObjects(); + } else if (objectType.contains(REGISTRY_PACKAGE)) { + retVal = getRootLevelPackageObjects(true); + } + } else if (parentId != null) { + if (objectType == null) { + objectType = REGISTRY_PACKAGE; + } + if (depth <= 0) { + depth = Integer.MAX_VALUE; + } + List parentIds = new ArrayList(); + parentIds.add(parentId); + for (int i = depth; i > 0; i--) { + List descendants = getDescendants( + objectType, parentIds); + retVal.addAll(descendants); + parentIds.clear(); + for (RegistryObjectType descendant : descendants) { + parentIds.add(descendant.getId()); + } + } + if (exclusiveChildrenOnly) { + retVal = getExclusiveChildren(objectType, retVal); + } + } + + return createResponse(retVal); + } + + private List getDescendants(String objectType, + List parentIds) { + List retVal = new ArrayList(); + for (String parentId : parentIds) { + if (objectType.contains(REGISTRY_PACKAGE)) { + RegistryPackageType registryPackage = registryPackageDao + .getById(parentId); + if (registryPackage != null) { + RegistryObjectListType objList = registryPackage + .getRegistryObjectList(); + if (objList != null) { + retVal.addAll(objList.getRegistryObject()); + } + } + } else if (objectType.contains(CLASSIFICATION_SCHEME)) { + TaxonomyElementType taxonomyElement = (TaxonomyElementType) registryObjectDao + .getById(parentId); + if (taxonomyElement != null) { + retVal.addAll(taxonomyElement.getClassificationNode()); + } + } else if (objectType.contains(ORGANIZATION)) { + OrganizationType org = (OrganizationType) registryObjectDao + .getById(parentId); + if (org != null) { + retVal.addAll(org.getOrganization()); + } + } + } + return retVal; + } + + private List getExclusiveChildren(String objectType, + List objs) { + List exclusiveChildren = new ArrayList(); + if (objectType.equals(REGISTRY_PACKAGE)) { + for (RegistryObjectType obj : objs) { + List parents = registryObjectDao + .executeHQLQuery(EXCLUSIVE_REGISTRY_PACKAGE_QUERY, + "id", obj.getId()); + if (parents.size() < 2) { + exclusiveChildren.add(obj); + } + } + } else if (objectType.contains(CLASSIFICATION_SCHEME)) { + for (RegistryObjectType obj : objs) { + List parents = registryObjectDao + .executeHQLQuery(EXCLUSIVE_CLASSIFICATION_QUERY, "id", + obj.getId()); + if (parents.size() < 2) { + exclusiveChildren.add(obj); + } + } + } else if (objectType.contains(ORGANIZATION)) { + for (RegistryObjectType obj : objs) { + List parents = registryObjectDao + .executeHQLQuery(EXCLUSIVE_ORGANIZATION_QUERY, "id", + obj.getId()); + if (parents.size() < 2) { + exclusiveChildren.add(obj); + } + } + } + return exclusiveChildren; + + } + + private List getRootLevelPackageObjects( + boolean packagesOnly) { + List registryPackages = registryPackageDao + .getAll(); + List nonRootLevelObjects = new ArrayList(); + for (RegistryPackageType registryPackage : registryPackages) { + RegistryObjectListType objList = registryPackage + .getRegistryObjectList(); + if (objList != null) { + for (RegistryObjectType obj : objList.getRegistryObject()) { + nonRootLevelObjects.add(obj.getId()); + } + } + } + if (nonRootLevelObjects.isEmpty()) { + nonRootLevelObjects.add("---dummyentry---"); + } + if (packagesOnly) { + return registryObjectDao.executeHQLQuery(ROOT_LEVEL_PACKAGE_QUERY, + "ids", nonRootLevelObjects); + } else { + return registryObjectDao.executeHQLQuery(ROOT_LEVEL_OBJECT_QUERY, + "ids", nonRootLevelObjects); + } + } + + private List getRootLevelOrganizationObjects() { + List orgs = registryObjectDao + .executeHQLQuery("FROM OrganizationType"); + List nonRootLevelObjects = new ArrayList(); + for (OrganizationType org : orgs) { + List subOrgs = org.getOrganization(); + if (!CollectionUtil.isNullOrEmpty(subOrgs)) { + for (OrganizationType subOrg : subOrgs) { + nonRootLevelObjects.add(subOrg.getId()); + } + } + } + if (nonRootLevelObjects.isEmpty()) { + nonRootLevelObjects.add("---dummyentry---"); + } + return registryObjectDao.executeHQLQuery(ROOT_LEVEL_ORG_QUERY, "ids", + nonRootLevelObjects); + } + + private List getClassificationSchemes() { + return registryObjectDao + .executeHQLQuery("FROM ClassificationSchemeType"); + + } + + @Override + public String getQueryDefinition() { + return CanonicalQueryTypes.GET_CHILDREN_BY_PARENT_ID; + } + + public void setRegistryPackageDao(RegistryPackageDao registryPackageDao) { + this.registryPackageDao = registryPackageDao; + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetClassificationSchemesById.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetClassificationSchemesById.java new file mode 100644 index 0000000000..21316b2137 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetClassificationSchemesById.java @@ -0,0 +1,88 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.Collections; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; + +/** + * The canonical query GetClassificationSchemesById allows clients to fetch + * specified ClassificationSchemes. + * + *

+ * Parameter Summary:
+ * · id -- Matches + * rim:/RegistryObject[@xsi:type="rim:ClassificationSchemeType"]/@id.
+ * Allows use of “%” wildcard character to match multiple characters.
+ * Allows use of “?” wildcard character to match a single character.
+ *

+ * + *

+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2012            bphillip     Initial creation
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class GetClassificationSchemesById extends RegistryQueryPlugin { + + /** The get objects by id query object */ + private GetObjectById getObjectById; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + String id = queryType.getSlotValue(QueryConstants.ID); + if (id == null) { + return createResponse(Collections.emptyList()); + } + return getObjectById.executeQuery(queryRequest); + + } + + public void setGetObjectById(GetObjectById getObjectById) { + this.getObjectById = getObjectById; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetNotification.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetNotification.java new file mode 100644 index 0000000000..7ed9e6691b --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetNotification.java @@ -0,0 +1,169 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.Arrays; +import java.util.List; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; +import javax.xml.datatype.XMLGregorianCalendar; + +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.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AuditableEventType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.DateTimeValueType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectRefType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SubscriptionType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.edex.registry.ebxml.dao.SubscriptionDao; +import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; +import com.raytheon.uf.edex.registry.ebxml.services.notification.NotificationDestination; +import com.raytheon.uf.edex.registry.ebxml.services.notification.RegistryNotificationManager; +import com.raytheon.uf.edex.registry.ebxml.services.notification.RegistrySubscriptionManager; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; + +/** + * The canonical query GetNotification allows clients to “pull” any pending + * Notification for a Subscription at a time of their choosing. This is defined + * in detail under section titled “Pulling Notification on Demand”. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2012            bphillip     Initial creation
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip    Changed abstract method signature, modified return processing, and changed static variables
+ * Jun 24, 2013 2106       djohnson    Requires a transaction to be open, will not create one.
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class GetNotification extends RegistryQueryPlugin { + + /** The subscription manager */ + private RegistrySubscriptionManager subscriptionManager; + + /** The notification manager */ + private RegistryNotificationManager notificationManager; + + /** Data access object for accessing registry subscriptions */ + private SubscriptionDao subscriptionDao; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + String subscriptionId = queryType + .getSlotValue(QueryConstants.SUBSCRIPTION_ID); + DateTimeValueType startTimeSlot = queryType + .getSlotValue(QueryConstants.START_TIME); + XMLGregorianCalendar startTime = null; + + SubscriptionType subscription = subscriptionDao.getById(subscriptionId); + if (subscription == null) { + throw EbxmlExceptionUtil.createQueryExceptionType( + "No subscription with id: " + subscriptionId + + " present in registry", ""); + } + + List destinations; + try { + destinations = subscriptionManager + .getNotificationDestinations(subscription); + } catch (EbxmlRegistryException e1) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error getting notification destinations", e1); + } + if (destinations.isEmpty() && startTimeSlot == null) { + throw EbxmlExceptionUtil + .createQueryExceptionType( + "Subscription does not define any push delivery addresses. Start time must be defined.", + ""); + } + + if (startTimeSlot == null) { + startTimeSlot = subscription + .getSlotValue(EbxmlObjectUtil.SUBSCRIPTION_LAST_RUN_TIME_SLOT_NAME); + if (startTimeSlot == null) { + try { + startTime = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(0); + } catch (EbxmlRegistryException e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error creating gregorian calendar", e); + } + + } + } else { + startTime = startTimeSlot.getDateTimeValue(); + } + + List objectsOfInterest = notificationManager + .getObjectsOfInterest(subscription); + List eventsOfInterest = notificationManager + .getEventsOfInterest(startTime, null, objectsOfInterest); + try { + return createResponse(Arrays.asList(notificationManager + .getNotification(subscription, "Test Address", + objectsOfInterest, eventsOfInterest))); + } catch (EbxmlRegistryException e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error creating notification", e); + } + + } + + @Override + public String getQueryDefinition() { + return CanonicalQueryTypes.GET_NOTIFICATION; + } + + public void setSubscriptionManager( + RegistrySubscriptionManager subscriptionManager) { + this.subscriptionManager = subscriptionManager; + } + + public void setNotificationManager( + RegistryNotificationManager notificationManager) { + this.notificationManager = notificationManager; + } + + public void setSubscriptionDao(SubscriptionDao subscriptionDao) { + this.subscriptionDao = subscriptionDao; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetObjectById.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetObjectById.java new file mode 100644 index 0000000000..0498a106cc --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetObjectById.java @@ -0,0 +1,86 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import javax.jws.WebParam; + +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.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.RegistryQueryUtil; + +/** + * The canonical query GetObjectById allows clients to find RegistryObjects + * based upon the value of their id attribute. + * + * + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2012            bphillip     Initial creation
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * 4/19/2013    1931       bphillip    Fixed null pointer issue
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +@Transactional(propagation = Propagation.REQUIRED) +public class GetObjectById extends RegistryQueryPlugin { + + private RegistryObjectDao registryObjectDao; + + @Override + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryResponse response = new QueryResponse(); + QueryType queryType = queryRequest.getQuery(); + String id = queryType.getSlotValue(QueryConstants.ID); + + if (id.contains("?") || id.contains("%")) { + response.getRegistryObjects().addAll( + registryObjectDao.getByIdUsingLike(RegistryQueryUtil + .substituteWildcardCharacters(id))); + } else { + response.getRegistryObjects().add(registryObjectDao.getById(id)); + } + return response; + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetObjectsByLid.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetObjectsByLid.java new file mode 100644 index 0000000000..66953edb30 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetObjectsByLid.java @@ -0,0 +1,92 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.Arrays; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.RegistryQueryUtil; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; + +/** + * + * Canonical query plugin for retrieving objects by LID + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2012            bphillip     Initial creation
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class GetObjectsByLid extends RegistryQueryPlugin { + + /** Data access object for accessing registry objects */ + private RegistryObjectDao registryObjectDao; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + String lid = queryType.getSlotValue(QueryConstants.LID); + if (lid == null) { + throw EbxmlExceptionUtil.createQueryExceptionType( + "Canonical query [" + this.getQueryDefinition() + + "] is missing required parameter [lid]", ""); + } + + if (lid.contains("?") || lid.contains("%")) { + return createResponse(registryObjectDao + .getByLidUsingLike(RegistryQueryUtil + .substituteWildcardCharacters(lid))); + } else { + return createResponse(registryObjectDao + .getByLid(Arrays.asList(lid))); + } + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } + +} 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 new file mode 100644 index 0000000000..c9c0175b84 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetReferencedObject.java @@ -0,0 +1,133 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.Arrays; +import java.util.Collections; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.QueryManager; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.ResponseOptionType; +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.SlotType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.registry.constants.QueryReturnTypes; +import com.raytheon.uf.common.registry.services.RegistrySOAPServices; +import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; +import com.raytheon.uf.edex.registry.ebxml.services.lifecycle.ObjectReferenceResolver; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; + +/** + * + * EBXML Canonical query to get a referenced object + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 9/18/2013    1705        bphillip    Initial implementation
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class GetReferencedObject extends RegistryQueryPlugin { + + /** Object used to resolve object references */ + private ObjectReferenceResolver referenceResolver; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + RegistryObjectType referencedObject = null; + String objectReference = queryType + .getSlotValue(QueryConstants.OBJECT_REFERENCE); + if (objectReference == null) { + return createResponse(Collections.emptyList()); + } + + referencedObject = referenceResolver + .getStaticReferencedObject(objectReference); + if (referencedObject == null) { + try { + referencedObject = referenceResolver + .getDynamicReferencedObject(objectReference); + } catch (EbxmlRegistryException e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error resolving object!", e); + } + if (referencedObject == null) { + if (referenceResolver.isValidURL(objectReference)) { + String objectId = objectReference.substring(objectReference + .lastIndexOf("/") + 1); + String remoteAddress = objectReference.replace( + "/rest/registryObjects/" + objectId, ""); + QueryType queryObj = new QueryType(); + queryObj.setQueryDefinition(CanonicalQueryTypes.GET_REFERENCED_OBJECT); + SlotType slot = new SlotType( + QueryConstants.OBJECT_REFERENCE, + new StringValueType(objectId)); + queryObj.getSlot().add(slot); + QueryRequest query = new QueryRequest(); + query.setId("Resolve reference [" + objectReference + "]"); + query.setQuery(queryObj); + query.setResponseOption(new ResponseOptionType( + QueryReturnTypes.REGISTRY_OBJECT, true)); + QueryManager remoteQueryManager = RegistrySOAPServices + .getQueryServiceForHost(remoteAddress); + + QueryResponse remoteResponse = remoteQueryManager + .executeQuery(query); + referencedObject = remoteResponse.getRegistryObjects().get( + 0); + + } else { + throw EbxmlExceptionUtil.createQueryExceptionType( + "Unable to resolve reference for value [" + + objectReference + "]", ""); + } + } + } + return createResponse(Arrays.asList(referencedObject)); + } + + public void setReferenceResolver(ObjectReferenceResolver referenceResolver) { + this.referenceResolver = referenceResolver; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetRegistryPackagesByMemberId.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetRegistryPackagesByMemberId.java new file mode 100644 index 0000000000..42661fbde6 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/GetRegistryPackagesByMemberId.java @@ -0,0 +1,97 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.Collections; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; + +/** + * The canonical query GetRegistryPackagesByMemberId allows clients to get the + * RegistryPackages that a specified RegistryObject is a member of. + * + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2012            bphillip     Initial creation
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class GetRegistryPackagesByMemberId extends RegistryQueryPlugin { + + /** The logger */ + protected static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(GetAuditTrailByTimeInterval.class); + + /** Query to get the packages containing the given member */ + private static final String GET_PACKAGES_BY_MEMBER_ID_QUERY = "" + + "SELECT pack FROM RegistryPackageType pack " + + "INNER JOIN pack.registryObjectList as objList " + + "INNER JOIN objList.registryObject as registryObject " + + "WHERE registryObject.id = :memberId"; + + /** Data access object for accessing registry objects */ + private RegistryObjectDao registryObjectDao; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + String memberId = queryType.getSlotValue(QueryConstants.MEMBER_ID); + if (memberId == null) { + return createResponse(Collections.emptyList()); + } + + return createResponse(registryObjectDao.executeHQLQuery( + GET_PACKAGES_BY_MEMBER_ID_QUERY, QueryConstants.MEMBER_ID, + memberId)); + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/KeywordSearch.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/KeywordSearch.java new file mode 100644 index 0000000000..fe51df243d --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/KeywordSearch.java @@ -0,0 +1,383 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import com.raytheon.uf.common.registry.EbxmlNamespaces; +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.edex.registry.ebxml.dao.RegistryObjectDao; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; + +/** + * The canonical query KeyWordSearch allows clients to find RegistryObjects and + * RepositoryItems that contain text that matches keywords identified by + * specified search patterns. + *

+ * Parameter Summary:
+ * · keywords -- A space separated list of keywords to search for + *

+ * The value of the keywords parameter may consist of multiple terms where each + * term is separated by one or more spaces
+ * + * Example: ebxml regrep Semantics: Matches objects containing either “ebxml” or + * “regrep” + *

+ * + * · A term may be enclosed in double-quotes to include white space characters + * as a literal value.
+ * + * Example: “ebxml regrep” Semantics: Matches objects containing “ebxml regrep” + *

+ * · Terms may be specified using wildcard characters where '*' matches one or + * more characters and “?” matches a single character.
+ * + * Example: eb?ml reg* + *

+ * · Terms may be combined using boolean operators “AND”, “OR” and “NOT”. + * Absence of a boolean operator between terms implies an implicit OR operator + * between them.
+ * + * · Example: ebxml AND regrep Semantics: Matches objects containing “ebxml” and + * “regrep” + *

+ * Example: ebxml NOT regrep Semantics: Matches objects containing “ebxml” and + * not containg “regrep”
+ * + * Example: ebxml OR regrep Semantics: Matches objects containing “ebxml” or + * “regrep”
+ * + * Example: ebxml regrep Semantics: Matches objects containing “ebxml” or + * “regrep” + *

+ * · Terms may be grouped together using “(“ at the beginning and “)” at the end + * of the group. Grouping allowing boolean operators to be applied to a group of + * terms as a whole and enables more flexible searches.
+ * + * Example: ebxml AND (registry OR regrep) Semantics: Matches objects containing + * both “ebxml” and either “registry” or “regrep” + *

+ * + *

+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2012            bphillip     Initial creation
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class KeywordSearch extends RegistryQueryPlugin { + + /** The logger */ + protected static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(KeywordSearch.class); + + /** Pattern used to tokenize keywords */ + private static final Pattern KEYWORD_TOKENIZER_PATTERN = Pattern + .compile("\".*?\""); + + /** The default conjunction of 'OR' */ + private static final String DEFAULT_CONJUNCTION = "OR"; + + /** Token used for parsing the keyword string */ + private static final String QUOTE_PLACEHOLDER = "-QUOTE-"; + + /** Query used to get registry objects fitting the given set of keywords */ + private static final String REGISTRY_OBJECT_QUERY = "" + + "SELECT obj FROM RegistryObjectType obj " + + "INNER JOIN obj.name.localizedString as names " + + "INNER JOIN obj.description.localizedString as descriptions " + + "LEFT OUTER JOIN obj.slot as Slot " + + "LEFT OUTER JOIN Slot.slotValue as SlotValues WHERE "; + + /** Query used to get person objects fitting the given set of keywords */ + private static final String PERSON_QUERY = "SELECT person FROM PersonType person " + + "LEFT OUTER JOIN person.emailAddress as emailAddress " + + "LEFT OUTER JOIN person.postalAddress as postalAddress WHERE "; + + /** Query used to get organizations fitting the given set of keywords */ + private static final String ORGANIZATION_QUERY = "SELECT org FROM OrganizationType org " + + "LEFT OUTER JOIN org.emailAddress as emailAddress " + + "LEFT OUTER JOIN org.postalAddress as postalAddress WHERE "; + + /** Map of predefined queries for the object types */ + private static final Map> QUERY_MAP = new HashMap>(); + + static { + QUERY_MAP.put( + REGISTRY_OBJECT_QUERY, + Arrays.asList(new String[] { "names.value", + "descriptions.value", "Slot.name", + "SlotValues.stringValue" })); + QUERY_MAP.put(PERSON_QUERY, Arrays.asList(new String[] { + "person.personName.firstName", "person.personName.middleName", + "person.personName.lastName", "emailAddress.address", + "postalAddress.city", "postalAddress.country", + "postalAddress.postalCode", "postalAddress.stateOrProvince", + "postalAddress.street" })); + QUERY_MAP.put(ORGANIZATION_QUERY, Arrays.asList(new String[] { + "emailAddress.address", "postalAddress.city", + "postalAddress.country", "postalAddress.postalCode", + "postalAddress.stateOrProvince", "postalAddress.street" })); + } + + /** And token */ + private static final String AND = "AND"; + + /** And not token */ + private static final String AND_NOT = "AND NOT"; + + /** Or token */ + private static final String OR = "OR"; + + /** OR not token */ + private static final String OR_NOT = "OR NOT"; + + /** NOT token */ + private static final String NOT = "NOT"; + + /** Open peren token */ + private static final String OPEN_PEREN = "("; + + /** Close peren token */ + private static final String CLOSE_PEREN = ")"; + + /** Empty String */ + private static final String EMPTY_STRING = ""; + + /** Space */ + private static final String SPACE = " "; + + /** Quotation mark */ + private static final String QUOTE = "\""; + + /** Static array of valid conjunction combinations */ + private static final List CONJUNCTIONS = Arrays + .asList(new String[] { AND, AND_NOT, OR, OR_NOT, NOT }); + + /** Data access object for accessing registry objects */ + private RegistryObjectDao registryObjectDao; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + String keywords = queryType.getSlotValue(QueryConstants.KEYWORDS); + List tokens = tokenizeKeywords(keywords); + List queryStrings = new ArrayList(); + for (String prefix : QUERY_MAP.keySet()) { + StringBuilder query = new StringBuilder(); + query.append(prefix); + List values = QUERY_MAP.get(prefix); + for (int i = 0; i < values.size(); i++) { + query.append(assembleQuery(values.get(i), tokens)).toString(); + if (i != values.size() - 1) { + query.append(OR); + } + } + queryStrings.add(query.toString()); + } + + List results = new ArrayList(); + for (String query : queryStrings) { + List result = registryObjectDao + .executeHQLQuery(query); + results.addAll(result); + + } + return createResponse(results); + + } + + /** + * Assembles the query based on the given list of keyword tokens + * + * @param indexName + * The name of the index + * @param tokens + * The keyword tokens used to assmeble the query + * @return The assembled query + */ + private String assembleQuery(String indexName, List tokens) { + StringBuilder query = new StringBuilder(); + query.append(SPACE).append(OPEN_PEREN); + + boolean negateNext = false; + for (String token : tokens) { + if (isConjunction(token)) { + if (token.contains(NOT)) { + negateNext = true; + } + query.append(SPACE).append(token.replace(NOT, EMPTY_STRING)); + } else if (isPeren(token)) { + query.append(SPACE); + if (negateNext) { + query.append(SPACE).append(NOT).append(SPACE); + } + query.append(token); + } else { + query.append(SPACE).append(indexName); + if (negateNext) { + negateNext = false; + query.append(SPACE).append(NOT); + } + query.append(" LIKE '%").append(token).append("%'"); + } + } + query.append(CLOSE_PEREN).append(SPACE); + return query.toString(); + } + + /** + * Tokenizes the keywords. Handles quotes and conjunctions as per the EBXML + * 4.0 spec + * + * @param keywords + * The keywords to parse + * @return The tokenized keywords + */ + private List tokenizeKeywords(String keywords) { + Matcher matcher = KEYWORD_TOKENIZER_PATTERN.matcher(keywords); + List quotedStrings = new ArrayList(); + while (matcher.find()) { + quotedStrings.add(matcher.group()); + } + for (String quote : quotedStrings) { + keywords = keywords.replace(quote, QUOTE_PLACEHOLDER); + } + keywords = keywords.replaceAll(AND_NOT, "AND_NOT") + .replaceAll(OR_NOT, "OR_NOT") + .replaceAll("\\" + OPEN_PEREN, OPEN_PEREN + SPACE) + .replaceAll("\\" + CLOSE_PEREN, SPACE + CLOSE_PEREN); + + List keywordTokens = Arrays.asList(keywords.split(SPACE)); + CollectionUtil.removeAllInstancesOfObject(keywordTokens, EMPTY_STRING); + + for (int i = 0; i < keywordTokens.size(); i++) { + String token = keywordTokens.get(i); + if (token.equals(QUOTE_PLACEHOLDER)) { + keywordTokens + .add(i, + quotedStrings.remove(0).replaceAll(QUOTE, + EMPTY_STRING)); + keywordTokens.remove(i + 1); + } else if (token.equals("AND_NOT")) { + keywordTokens.add(i, AND_NOT); + keywordTokens.remove(i + 1); + } else if (token.equals("OR_NOT")) { + keywordTokens.add(i, OR_NOT); + keywordTokens.remove(i + 1); + } + } + + for (int i = 0; i < keywordTokens.size(); i++) { + String currentWord = keywordTokens.get(i); + String nextWord = null; + try { + nextWord = keywordTokens.get(i + 1); + } catch (IndexOutOfBoundsException e) { + } + + if (nextWord != null && !isPeren(currentWord) + && !isConjunction(currentWord) && !isClosePeren(nextWord) + && !isConjunction(nextWord)) { + keywordTokens.add(i + 1, DEFAULT_CONJUNCTION); + } + } + return keywordTokens; + } + + /** + * Checks if the given word is in the list of conjunctions + * + * @param word + * The word to check + * @return True if the word is a conjunction, else false + */ + private boolean isConjunction(String word) { + return CONJUNCTIONS.contains(word.trim().toUpperCase()); + } + + /** + * Checks if the given word is a perenthesis + * + * @param word + * The word to check + * @return True if the given word is a perenthesis + */ + private boolean isPeren(String word) { + return isOpenPeren(word) || isClosePeren(word); + } + + /** + * Checks if the given word is an open peren + * + * @param word + * The word to check + * @return True if the given word is an open peren + */ + private boolean isOpenPeren(String word) { + return OPEN_PEREN.equals(word); + } + + /** + * Checks if the given word is a closed peren + * + * @param word + * The word to check + * @return True if the given word is a closed peren + */ + private boolean isClosePeren(String word) { + return CLOSE_PEREN.equals(word); + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/RegistryPackageSelector.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/RegistryPackageSelector.java new file mode 100644 index 0000000000..5cfa4ede50 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/RegistryPackageSelector.java @@ -0,0 +1,128 @@ +/** + * 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.registry.ebxml.services.query.plugins; + +import java.util.ArrayList; +import java.util.List; + +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryPackageType; + +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.edex.registry.ebxml.dao.RegistryObjectDao; +import com.raytheon.uf.edex.registry.ebxml.dao.RegistryPackageDao; +import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; + +/** + * Query type allowing the client to select registry packages + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jan 18, 2012            bphillip     Initial creation
+ * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
+ * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
+ * 10/8/2013    1682       bphillip    Refactored querying
+ * 
+ * 
+ * + * @author bphillip + * @version 1.0 + */ +public class RegistryPackageSelector extends RegistryQueryPlugin { + + /** Data access object for accessing registry objects */ + private RegistryObjectDao registryObjectDao; + + /** Registry package data access object */ + private RegistryPackageDao registryPackageDao; + + /** Gets a package based on association type and the source object */ + private static final String PACKAGE_ASSOCIATION_QUERY = "FROM AssociationType obj " + + "WHERE obj.type=:associationType " + + "AND obj.sourceObject=:packageSource"; + + @Override + @WebMethod(action = EXECUTE_QUERY_ACTION) + @WebResult(name = "QueryResponse", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryResponse") + public QueryResponse executeQuery( + @WebParam(name = "QueryRequest", targetNamespace = EbxmlNamespaces.QUERY_URI, partName = "partQueryRequest") QueryRequest queryRequest) + throws MsgRegistryException { + QueryType queryType = queryRequest.getQuery(); + List packageIds = queryType + .getSlotValueAsList(QueryConstants.REGISTRY_PACKAGE_IDS); + + List retVal = new ArrayList(); + + List registryPackages; + try { + registryPackages = registryPackageDao.getById(packageIds); + } catch (EbxmlRegistryException e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error getting registry packages by ID!", e); + } + + for (RegistryPackageType registryPackage : registryPackages) { + if (registryPackage.getRegistryObjectList() != null) { + retVal.addAll(registryPackage.getRegistryObjectList() + .getRegistryObject()); + } + registryPackage.setRegistryObjectList(null); + retVal.add(registryPackage); + + List associations = registryObjectDao + .executeHQLQuery(PACKAGE_ASSOCIATION_QUERY, + "associationType", AssociationTypes.HAS_MEMBER, + "packageSource", registryPackage.getId()); + retVal.addAll(associations); + } + + return createResponse(retVal); + } + + @Override + public String getQueryDefinition() { + return CanonicalQueryTypes.REGISTRY_PACKAGE_SELECTOR; + } + + public void setRegistryPackageDao(RegistryPackageDao registryPackageDao) { + this.registryPackageDao = registryPackageDao; + } + + public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { + this.registryObjectDao = registryObjectDao; + } +} \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/RegistryQueryPlugin.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/RegistryQueryPlugin.java new file mode 100644 index 0000000000..071e688275 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/plugins/RegistryQueryPlugin.java @@ -0,0 +1,128 @@ +package com.raytheon.uf.edex.registry.ebxml.services.query.plugins; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.QueryManager; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationNodeType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import com.raytheon.uf.common.util.CollectionUtil; +import com.raytheon.uf.edex.registry.ebxml.dao.ClassificationNodeDao; + +@Transactional(propagation = Propagation.REQUIRED) +public abstract class RegistryQueryPlugin implements QueryManager { + + protected String queryDefinition; + + /** + * Data access object for classification nodes; + */ + protected ClassificationNodeDao classificationNodeDao; + + /** + * Gets the id of the classification node designated by the provided path + * + * @param classificationNodePath + * The classification node path + * @return The id of the classification node designated by the provided path + */ + protected String getClassificationNodeIdFromPath( + String classificationNodePath) { + if (classificationNodePath == null) { + return null; + } + ClassificationNodeType node = classificationNodeDao + .getByPath(classificationNodePath); + if (node == null) { + return null; + } + return node.getId(); + } + + /** + * Gets the ids of the classification nodes designated by the provided set + * of paths + * + * @param classificationNodePaths + * The classification node paths + * @return The ids of the classification nodes designated by the provided + * set of paths + */ + protected List getClassificationNodeIdFromPath( + List classificationNodePaths) { + if (CollectionUtil.isNullOrEmpty(classificationNodePaths)) { + return null; + } + List ids = new ArrayList(); + for (String path : classificationNodePaths) { + ids.add(getClassificationNodeIdFromPath(path)); + } + + return ids; + } + + /** + * Gets the conjunction based on the value of the matchOnAny parameter + * commonly given to many queries + * + * @param matchOnAny + * The value of the match on any parameter + * @return "OR" if matchOnAny is true, else "AND" + */ + protected String getConjunction(Boolean matchOnAny) { + return matchOnAny == null || !matchOnAny.booleanValue() ? "AND" : "OR"; + } + + /** + * Assembles the given list of query clauses into a query predicate + * + * @param query + * The query to append to + * @param conjunction + * The conjunction to use for joining the clauses + * @param clauses + * The clauses to assemble + */ + protected void assembleClauses(StringBuilder query, String conjunction, + List clauses) { + // Strip all the nulls out of the list + CollectionUtil.removeNulls(clauses); + + // Assemble the query + for (int i = 0; i < clauses.size(); i++) { + query.append(clauses.get(i)); + if (i != clauses.size() - 1) { + query.append(conjunction); + } + } + } + + protected QueryResponse createResponse( + Collection responseObjects) { + QueryResponse response = new QueryResponse(); + for (Object obj : responseObjects) { + response.getRegistryObjects().add((RegistryObjectType) obj); + } + return response; + } + + public String getQueryDefinition() { + return queryDefinition; + } + + public void setQueryDefinition(String queryDefinition) { + this.queryDefinition = queryDefinition; + } + + public void setClassificationNodeDao( + ClassificationNodeDao classificationNodeDao) { + this.classificationNodeDao = classificationNodeDao; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/AbstractEbxmlQuery.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/AbstractEbxmlQuery.java deleted file mode 100644 index 03ef530a7b..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/AbstractEbxmlQuery.java +++ /dev/null @@ -1,228 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; - -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImpl; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImpl.RETURN_TYPE; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; -import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; - -/** - * Abstract representation of a query used for querying the EBXML registry - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * 2/21/2012    #184       bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip    Refactor of registry query handling
- * Jun 24, 2013 2106       djohnson    Requires a transaction to be open, will not create one.
- * 9/5/2013     1538       bphillip    Removed log message
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ -public abstract class AbstractEbxmlQuery implements IRegistryQuery { - - protected static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(IRegistryQuery.class); - - protected abstract void query(QueryType queryType, - QueryResponse queryResponse, String client) - throws EbxmlRegistryException; - - protected abstract List getValidParameters(); - - protected boolean matchOlderVersions = false; - - protected int maxResults = -1; - - protected RETURN_TYPE returnType; - - protected RegistryObjectDao registryObjectDao; - - @Override - @Transactional(propagation = Propagation.MANDATORY) - public void executeQuery(QueryRequest queryRequest, - QueryResponse queryResponse, String client) - throws EbxmlRegistryException { - /* - * The full functionality of querying will be implemented at a later - * time under a different ticket. Parts of this method have been removed - * and will be more efficiently implemented - */ - - // TODO: Implement version matching using matchOlderVersions - // TODO: Handle max results. Partially handled currently by some queries - // TODO: Add support for specifying query depth - // TODO: Add support for start index - - returnType = getReturnType(queryRequest.getResponseOption() - .getReturnType()); - @SuppressWarnings("unused") - int depth = queryRequest.getDepth().intValue(); - matchOlderVersions = queryRequest.isMatchOlderVersions(); - maxResults = queryRequest.getMaxResults().intValue(); - if (maxResults < 0) { - maxResults = 0; - } - - query(queryRequest.getQuery(), queryResponse, client); - } - - protected QueryParameters getParameterMap(Collection slots, - QueryResponse queryResponse, boolean suppressWarnings) { - QueryParameters parameters = new QueryParameters(); - String slotName = null; - for (SlotType slot : slots) { - slotName = slot.getName(); - - if (this.getValidParameters().contains(slotName)) { - parameters.addParameter(slot); - - } else if (!suppressWarnings) { - queryResponse - .getException() - .add(EbxmlExceptionUtil - .createUnsupportedCapabilityExceptionType( - "Unsupported parameter specified", - "The canonical query [" - + this.getQueryDefinition() - + "] does not support the " - + slotName - + " parameter. This parameter will be ignored") - .getFaultInfo()); - } - } - return parameters; - } - - protected void setResponsePayload(QueryResponse queryResponse, - List values) { - switch (returnType) { - case ObjectRef: - queryResponse.setObjectRefList(EbxmlObjectUtil - .createObjectRefList(values)); - queryResponse.setTotalResultCount(BigInteger.valueOf(queryResponse - .getObjectRefList().getObjectRef().size())); - break; - case RegistryObject: - queryResponse.setRegistryObjectList(EbxmlObjectUtil - .createRegistryObjectList(values)); - queryResponse.setTotalResultCount(BigInteger.valueOf(queryResponse - .getRegistryObjectList().getRegistryObject().size())); - break; - case LeafClass: - // TODO: Add support for this type - case LeafClassWithRepositoryItem: - default: - // TODO: Add support for this type - queryResponse - .getException() - .add(EbxmlExceptionUtil - .createUnsupportedCapabilityExceptionType( - "Return type not currently not supported", - "The [" - + returnType - + "] return type is currently not supported") - .getFaultInfo()); - break; - - } - } - - protected QueryParameters getParameterMap(Collection slots, - QueryResponse queryResponse) { - return getParameterMap(slots, queryResponse, false); - } - - private RETURN_TYPE getReturnType(String returnType) { - for (RETURN_TYPE type : RETURN_TYPE.values()) { - if (type.name().equals(returnType)) { - return type; - } - } - return QueryManagerImpl.DEFAULT_RETURN_TYPE; - } - - @SuppressWarnings("unchecked") - protected List filterResults( - List results, Class filterClass) { - List retVal = new ArrayList(); - for (Object result : results) { - if (result.getClass().isArray()) { - Object[] resultArray = (Object[]) result; - for (Object obj : resultArray) { - if (filterClass == null) { - if (obj instanceof RegistryObjectType) { - retVal.add((T) obj); - } - } else { - if (obj.getClass().equals(filterClass)) { - retVal.add((T) obj); - } - } - - } - } else { - retVal.add((T) result); - } - } - return retVal; - } - - protected List filterResults( - List results) { - return filterResults(results, null); - } - - public void setRegistryObjectDao(RegistryObjectDao registryObjectDao) { - this.registryObjectDao = registryObjectDao; - } - - public void setReturnType(RETURN_TYPE returnType) { - this.returnType = returnType; - } - -} \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/ExtendedEbxmlQuery.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/ExtendedEbxmlQuery.java deleted file mode 100644 index b788446cf9..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/ExtendedEbxmlQuery.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.query.v4.ResponseOptionType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; - -/** - * Implementation of a custom ebXML query type - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012 184        bphillip     Initial creation
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ - -public abstract class ExtendedEbxmlQuery extends AbstractEbxmlQuery { - - protected static final String QUERY_EXTENSION_PREFIX = "urn:raytheon:names:tc:ebxml-regrep:query:"; - - public String getQueryDefinitionPrefix() { - return QUERY_EXTENSION_PREFIX; - } - - public String getQueryDefinition() { - return QUERY_EXTENSION_PREFIX + this.getClass().getSimpleName(); - } - - public boolean isCanonical() { - return false; - } - - public void execute(QueryResponse response, - ResponseOptionType responseOption, QueryType query, int depth, - boolean matchOlderVersions, int maxResults, int startIndex) { - - response.getException().add( - EbxmlExceptionUtil.createUnsupportedCapabilityExceptionType( - "Query type not supported", - "This query type is currently unsupported") - .getFaultInfo()); - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/IRegistryQuery.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/IRegistryQuery.java deleted file mode 100644 index b0a5bc262b..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/IRegistryQuery.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; - -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; - -/** - * Interface for query definition implementations - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012 184        bphillip     Initial creation
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ - -public interface IRegistryQuery { - - /** - * Gets the query definition associated with this implementation - * - * @return The query definition - */ - public String getQueryDefinition(); - - /** - * Executes the query - * - * @param queryRequest - * The query request object - * @param queryResponse - * The query response - * @throws EbxmlRegistryException - * If the query fails - */ - public void executeQuery(QueryRequest queryRequest, - QueryResponse queryResponse, String client) - throws EbxmlRegistryException; - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/AdhocQuery.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/AdhocQuery.java deleted file mode 100644 index 6aed28e4ca..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/AdhocQuery.java +++ /dev/null @@ -1,245 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Set; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImpl.RETURN_TYPE; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.adhoc.AdhocQueryExpression; -import com.raytheon.uf.edex.registry.ebxml.services.query.adhoc.AdhocQueryExpressionManager; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * The canonical query AdhocQuery allows clients to invoke a client-specified ad - * hoc query in a client-specified query expression syntax that is supported by - * the server. This specification does not require a server to support any - * specific query expression syntax. It is likely that servers may support one - * or more common syntaxes such as SQL-92, XQuery, XPath, SPARQL, Search-WS, OGC - * Filter etc. - *

- * Parameter Summary:
- * queryExpression -- Value is a query expression string in the - * language specified by the - *

- * queryLanguage -- Value is the id of a ClassificationNode within - * the canonical QueryLanguageScheme ClassificationScheme. - * - * queryLanguage parameter - *

- * - *

- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip    Changed abstract method signature, modified return processing, and changed static variables
- * Jun 24, 2013 2106       djohnson    Requires a transaction to be open, will not create one.
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ -public class AdhocQuery extends CanonicalEbxmlQuery { - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.QUERY_EXPRESSION); - QUERY_PARAMETERS.add(QueryConstants.QUERY_LANGUAGE); - } - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - QueryParameters parameters = getParameterMap(queryType.getSlot(), - queryResponse, true); - // The client did not specify the required parameter - if (!parameters.containsParameter(QueryConstants.QUERY_EXPRESSION)) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" - + QueryConstants.QUERY_EXPRESSION + "]"); - } - if (!parameters.containsParameter(QueryConstants.QUERY_LANGUAGE)) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" - + QueryConstants.QUERY_LANGUAGE + "]"); - } - - String queryExpression = null; - String queryExpressionSlot = parameters - .getFirstParameter(QueryConstants.QUERY_EXPRESSION); - String queryLanguage = parameters - .getFirstParameter(QueryConstants.QUERY_LANGUAGE); - - if (!queryLanguage.equals("HQL")) { - throw new EbxmlRegistryException( - "Adhoc query does not support the [" + queryLanguage - + "] query language!"); - } - - AdhocQueryExpression expression = AdhocQueryExpressionManager - .getInstance().getAdhocQueryExpression(queryExpressionSlot); - List results = null; - if (queryExpressionSlot.equals("SlotQuery")) { - queryLanguage = "HQL"; - Object[] params = new Object[queryType.getSlot().size() * 2]; - queryExpression = getSlotQuery(queryType.getSlot(), params); - results = registryObjectDao.executeHQLQuery(queryExpression, - maxResults, params); - } else if (expression == null) { - Object[] params = getQueryParams(queryType.getSlot()); - queryExpression = queryExpressionSlot; - results = registryObjectDao.executeHQLQuery(queryExpression, - maxResults, params); - } else { - queryLanguage = "HQL"; - Object[] params = getQueryParams(queryType.getSlot()); - queryExpression = expression.getQueryExpression(); - results = registryObjectDao.executeHQLQuery(queryExpression, - maxResults, params); - } - setResponsePayload(queryResponse, results); - - } - - /** - * Populates a query with the given slot values - * - * @param queryExpression - * The prepared query - * @param slots - * The slot values to substitute - * @return The prepared query - */ - private Object[] getQueryParams(Collection slots) { - List params = new ArrayList(); - String slotName = null; - String slotValue = null; - for (SlotType slot : slots) { - slotName = slot.getName(); - slotValue = slot.getSlotValue().getValue(); - if (!QUERY_PARAMETERS.contains(slotName)) { - params.add(slotName); - params.add(slotValue); - } - } - return params.toArray(new Object[params.size()]); - } - - /** - * Populates the slot query - * - * @param slots - * The slots containing values to substitute in - * @return The prepared query - */ - private String getSlotQuery(Collection slots, Object[] params) { - String slotName = null; - String slotValue = null; - String operand = null; - boolean firstClause = true; - StringBuffer hqlQuery = new StringBuffer(); - if (returnType.equals(RETURN_TYPE.ObjectRef)) { - hqlQuery.append("select obj.id from "); - } else { - hqlQuery.append("select obj from "); - } - hqlQuery.append(RegistryObjectType.class.getName()).append(" as obj "); - - int i = 0; - for (SlotType slot : slots) { - if (!QUERY_PARAMETERS.contains(slot.getName())) { - hqlQuery.append(" inner join obj.slot as slot").append(i++) - .append(" "); - } - } - - hqlQuery.append(" where "); - - int paramIndex = 0; - i = 0; - for (SlotType slot : slots) { - slotName = slot.getName(); - slotValue = slot.getSlotValue().getValue(); - operand = null; - if (!QUERY_PARAMETERS.contains(slotName)) { - if (!firstClause) { - hqlQuery.append(" AND "); - } - Set childSlots = slot.getSlot(); - if (childSlots != null && !childSlots.isEmpty()) { - // should this loop over all children checking for an - // operand child? - SlotType operandSlot = childSlots - .toArray(new SlotType[childSlots.size()])[0]; - if (operandSlot.getName().equals("operand")) { - operand = operandSlot.getSlotValue().getValue(); - } - } - if (operand == null) { - operand = "="; - } - String paramHolder = "slotValue_" + i; - params[paramIndex++] = paramHolder; - params[paramIndex++] = slotValue; - hqlQuery.append(" (slot").append(i).append(".name='") - .append(slotName).append("' AND slot").append(i) - .append(".slotValue.") - .append(slot.getSlotValue().getColumnName()) - .append(" ").append(operand).append(" :") - .append(paramHolder).append(") "); - i++; - firstClause = false; - } - } - return hqlQuery.toString(); - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.ADHOC_QUERY; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/BasicQuery.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/BasicQuery.java deleted file mode 100644 index 31846cc8ee..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/BasicQuery.java +++ /dev/null @@ -1,238 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationNodeType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.dao.HqlQueryUtil; -import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectTypeDao; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImpl.RETURN_TYPE; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * The canonical query BasicQuery allows clients to query for RegistryObjects by - * their name, description, type, status and classifications. - *

- * Parameter Summary:
- * · classifications -- Set whose elements are path attribute - * values to ClassificationNodes. - *

- * Matches RegistryObjects that have a classification whose classificationNode - * attribute value matches the id of the ClassificationNode where - * rim:RegistryObject[@xsi:type="rim:ClassificationNodeType"]/@path matches - * specified value - *

- * · description -- Matches - * rim:RegistryObject/rim:Description/rim:LocalizedString/@value - *

- * · matchOnAnyParameter -- If true then use logical OR between - * predicates for each parameter. - *

- * · name -- Matches - * rim:RegistryObject/rim:Name/rim:LocalizedString/@value - *

- * · objectType -- Matches RegistryObjects whose objectType - * attribute matches the id of the ClassificationNode where - * rim:ClassificationNode/@path matches specified value - *

- * · owner -- Matches rim:RegistryObject/@owner. Note that a - * parameter value of “#@'@#rs:currentUserId()#@'@#” may be used to specify the - * id of the user associated with the current request - *

- * · status -- Matches RegistryObjects whose status attribute - * matches the id of the ClassificationNode where rim:ClassificationNode/@path - * matches specified value - *

- * · This query has several optional parameters - *

- * · Each parameter implies a predicate within the underlying query - *

- * · Predicates for each supplied parameter are combined using with an implicit - * LOGICAL AND if matchOnAnyParameter is unspecified or false. If it is - * specified as true then predicates for each supplied parameters are combined - * using a LOGICAL OR - *

- * · If an optional parameter is not supplied then its corresponding predicate - * MUST NOT be included in the underlying query - *

- * - * - * - *

- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * 2/13/2012    #184       bphillip    Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 8/1/2013     1693       bphillip    Fixed minor typo
- * 
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ -public class BasicQuery extends CanonicalEbxmlQuery { - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - private RegistryObjectTypeDao classificationDao; - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.CLASSIFICATIONS); - QUERY_PARAMETERS.add(QueryConstants.DESCRIPTION); - QUERY_PARAMETERS.add(QueryConstants.MATCH_ANY); - QUERY_PARAMETERS.add(QueryConstants.NAME); - QUERY_PARAMETERS.add(QueryConstants.OBJECT_TYPE); - QUERY_PARAMETERS.add(QueryConstants.OWNER); - QUERY_PARAMETERS.add(QueryConstants.STATUS); - } - - private boolean buildClassificationsClause(StringBuilder query, - List classifications) throws EbxmlRegistryException { - if (classifications == null || classifications.isEmpty()) { - return true; - } - - List ids = new ArrayList(); - for (int i = 0; i < classifications.size(); i++) { - String subQuery = HqlQueryUtil.assembleSingleParamQuery( - ClassificationType.class, "classifiedObject", - HqlQueryUtil.EQUALS, classifications.get(i)); - if (i == 0) { - ids = classificationDao.executeHQLQuery(subQuery); - } else { - ids.retainAll(classificationDao.executeHQLQuery(subQuery)); - } - } - - if (ids.isEmpty()) { - return false; - } - HqlQueryUtil.assembleInClause(query, "obj." + QueryConstants.ID, ids); - return true; - } - - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - - QueryParameters params = getParameterMap(queryType.getSlot(), - queryResponse); - String description = params - .getFirstParameter(QueryConstants.DESCRIPTION); - String name = params.getFirstParameter(QueryConstants.NAME); - String objectType = params - .getFirstParameter(QueryConstants.OBJECT_TYPE); - String owner = params.getFirstParameter(QueryConstants.OWNER); - String status = params.getFirstParameter(QueryConstants.STATUS); - String conjunction = HqlQueryUtil.AND; - if (params.containsParameter(QueryConstants.MATCH_ANY)) { - if (((Boolean) params.getFirstParameter(QueryConstants.MATCH_ANY)) - .booleanValue()) { - conjunction = HqlQueryUtil.OR; - } - } - - StringBuilder query = new StringBuilder(); - if (returnType.equals(RETURN_TYPE.ObjectRef)) { - query.append("select obj.id "); - } else { - query.append("select obj "); - } - query.append("from RegistryObjectType ").append(HqlQueryUtil.OBJ); - if (params.containsParameter(QueryConstants.NAME)) { - query.append(HqlQueryUtil.INNER_JOIN).append(HqlQueryUtil.OBJ_DOT) - .append(QueryConstants.NAME) - .append(".localizedString as names "); - } - if (params.containsParameter(QueryConstants.DESCRIPTION)) { - query.append(HqlQueryUtil.INNER_JOIN).append(HqlQueryUtil.OBJ_DOT) - .append(QueryConstants.DESCRIPTION) - .append(".localizedString as descriptions "); - } - query.append(HqlQueryUtil.WHERE); - if (description != null) { - query.append("descriptions.value='").append(description) - .append("'"); - query.append(conjunction); - } - if (name != null) { - query.append("names.value='").append(name).append("'"); - query.append(conjunction); - } - if (objectType != null) { - HqlQueryUtil - .assembleSingleParamClause(query, - QueryConstants.OBJECT_TYPE, HqlQueryUtil.EQUALS, - objectType); - query.append(conjunction); - } - if (owner != null) { - HqlQueryUtil.assembleSingleParamClause(query, QueryConstants.OWNER, - HqlQueryUtil.EQUALS, owner); - query.append(conjunction); - } - if (status != null) { - HqlQueryUtil.assembleSingleParamClause(query, - QueryConstants.STATUS, HqlQueryUtil.EQUALS, status); - query.append(conjunction); - } - - if (!buildClassificationsClause(query, - params.getParameter(QueryConstants.CLASSIFICATIONS))) { - return; - } - setResponsePayload(queryResponse, registryObjectDao.executeHQLQuery( - query.substring(0, query.length() - conjunction.length()), - maxResults)); - - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.BASIC_QUERY; - } - - public void setClassificationDao( - RegistryObjectTypeDao classificationDao) { - this.classificationDao = classificationDao; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/ExportObject.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/ExportObject.java deleted file mode 100644 index e07edacaf5..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/ExportObject.java +++ /dev/null @@ -1,209 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.math.BigInteger; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationNodeType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.OrganizationType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.TaxonomyElementType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * Parameterized Query to export an Object and its descendent tree. Used by tree - * structures such as RegistryPackage, TaxonomyElement, Organization - *

- * Parameter Summary:
- * · id -- ID of desired object. Use '%' and '_' as wildcard to - * match multiple and single characters respectively. - *

- * · depth -- Specifies the depth or number of levels of children - * to fetch. A depth of 0 (default) indicates that the server MUST return only - * those objects that match the id parameter (root objects). A depth of N where - * N is greater that 0 indicates that the server MUST also return objects that - * are descendants of root objects upto N levels. A depth of -1 indicates that - * the server MUST return all descendent objects as well. Descendents MUST be - * returned using the nested syntax supported by objects capable of having - * children. - * - *

- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * 2/13/2012    #184       bphillip    Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ - -public class ExportObject extends CanonicalEbxmlQuery { - - private static final BigInteger DEFAULT_DEPTH = new BigInteger("0"); - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.ID); - QUERY_PARAMETERS.add(QueryConstants.DEPTH); - } - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - List retVal = new ArrayList(); - - QueryParameters parameters = getParameterMap(queryType.getSlot(), - queryResponse); - if (!parameters.containsParameter(QueryConstants.ID)) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" + QueryConstants.ID - + "]"); - } - String id = parameters.getFirstParameter(QueryConstants.ID); - int depth = parameters.getFirstParameter(QueryConstants.DEPTH, - DEFAULT_DEPTH).intValue(); - - List ids = registryObjectDao.getMatchingIds(id); - - if (!ids.isEmpty()) { - List objects = registryObjectDao.getById(ids); - - /* - * Indicates that the server MUST return only those objects that - * match the id parameter (root objects) - */ - if (depth == 0) { - for (RegistryObjectType obj : objects) { - getChildren(obj, retVal, 0, 1); - retVal.add(obj); - } - } - /* - * indicates that the server MUST return all descendant objects as - * well. Descendants MUST be returned using the nested syntax - * supported by objects capable of having children. - */ - else if (depth == -1) { - for (RegistryObjectType obj : objects) { - getChildren(obj, retVal, depth, -1); - retVal.add(obj); - } - } - /* - * Indicates that the server MUST also return objects that are - * descendants of root objects up to depth levels - */ - else if (depth > 0) { - for (RegistryObjectType obj : objects) { - getChildren(obj, retVal, depth, 1); - retVal.add(obj); - } - } else { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] received invalid value for the [" - + QueryConstants.DEPTH + "] parameter. " + depth - + " is not a valid value. Values must be >= -1"); - } - for (int i = 0; i < retVal.size(); i++) { - TaxonomyElementType element = null; - if (retVal.get(i) instanceof TaxonomyElementType) { - element = (TaxonomyElementType) retVal.get(i); - registryObjectDao.evict(element); - element.getClassificationNode().clear(); - } - } - } - queryResponse.getRegistryObjectList().getRegistryObject() - .addAll(retVal); - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - /** - * Recursively removes the children objects of the given object if the - * targetLevel is equal to the current level. - * - * @param obj - * The current object - * @param targetLevel - * The level at which to remove children - * @param currentLevel - * The current level in the object tree - * @throws EbxmlRegistryException - * If the properties of the object are unable to be examined. - */ - private void getChildren(RegistryObjectType obj, - List objList, int targetLevel, int currentLevel) - throws EbxmlRegistryException { - if (obj instanceof TaxonomyElementType) { - TaxonomyElementType taxObj = (TaxonomyElementType) obj; - Set nodes = taxObj.getClassificationNode(); - for (ClassificationNodeType node : nodes) { - if (currentLevel <= targetLevel || targetLevel == -1) { - objList.add(node); - } - if (currentLevel < targetLevel || targetLevel == -1) { - getChildren(node, objList, targetLevel, currentLevel + 1); - } - } - } else if (obj instanceof OrganizationType) { - OrganizationType taxObj = (OrganizationType) obj; - List orgs = taxObj.getOrganization(); - for (OrganizationType node : orgs) { - if (currentLevel <= targetLevel || targetLevel == -1) { - objList.add(node); - } - if (currentLevel < targetLevel || targetLevel == -1) { - getChildren(node, objList, targetLevel, currentLevel + 1); - } - } - orgs.clear(); - } - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.EXPORT_OBJECT; - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/ExtrinsicObjectQuery.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/ExtrinsicObjectQuery.java deleted file mode 100644 index bbd04d88df..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/ExtrinsicObjectQuery.java +++ /dev/null @@ -1,125 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectRefListType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImpl.RETURN_TYPE; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; -import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; - -/** - * BsicQuery extension for ExtrinsicObjects. Adds mimeTypes parameter. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 
- * 
- * - * @author bphillip - * @version 1.0 - * @see com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical - * .BasicQuery - */ - -public class ExtrinsicObjectQuery extends CanonicalEbxmlQuery { - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - private static final String QUERY_STRING = "FROM ExtrinsicObjectType obj WHERE obj.mimeTypes in (:mimeTypes)"; - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.CLASSIFICATIONS); - QUERY_PARAMETERS.add(QueryConstants.DESCRIPTION); - QUERY_PARAMETERS.add(QueryConstants.MATCH_ANY); - QUERY_PARAMETERS.add(QueryConstants.NAME); - QUERY_PARAMETERS.add(QueryConstants.OBJECT_TYPE); - QUERY_PARAMETERS.add(QueryConstants.STATUS); - QUERY_PARAMETERS.add(QueryConstants.MIME_TYPES); - } - - private BasicQuery basicQuery; - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - QueryParameters params = getParameterMap(queryType.getSlot(), - queryResponse); - - QueryResponse basicQueryResponse = new QueryResponse(); - basicQuery.setReturnType(RETURN_TYPE.ObjectRef); - basicQuery.query(queryType, basicQueryResponse, client); - ObjectRefListType basicQueryResult = basicQueryResponse - .getObjectRefList(); - if (basicQueryResult == null - || basicQueryResult.getObjectRef().isEmpty()) { - return; - } - - List ids = EbxmlObjectUtil - .getIdsFromObjectRefListType(basicQueryResult); - List mimeTypes = params.getParameter(QueryConstants.MIME_TYPES); - if (mimeTypes == null) { - return; - } - - StringBuilder query = new StringBuilder(); - if (returnType.equals(RETURN_TYPE.ObjectRef)) { - query.append("SELECT obj.id "); - } else { - query.append("SELECT obj "); - } - setResponsePayload(queryResponse, registryObjectDao.executeHQLQuery( - QUERY_STRING, maxResults, "mimeTypes", ids)); - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.EXTRINSIC_OBJECT_QUERY; - } - - public void setBasicQuery(BasicQuery basicQuery) { - this.basicQuery = basicQuery; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAllMyObjects.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAllMyObjects.java deleted file mode 100644 index d235949c59..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAllMyObjects.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.Collections; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * Parameterized Query to find all objects belonging to caller. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ - -public class FindAllMyObjects extends CanonicalEbxmlQuery { - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - // TODO: Implement - } - - @Override - protected List getValidParameters() { - return Collections.emptyList(); - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.FIND_ALL_MY_OBJECTS; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAssociatedObjects.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAssociatedObjects.java deleted file mode 100644 index cfb0d47455..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAssociatedObjects.java +++ /dev/null @@ -1,211 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.AssociationType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationNodeType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectListType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.dao.ClassificationNodeDao; -import com.raytheon.uf.edex.registry.ebxml.dao.HqlQueryUtil; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * The canonical query FindAssociatedObjects allows clients to find - * RegistryObjects that are associated with the specified RegistryObject and - * match the specified criteria. - *

- * Parameter Summary:
- * associationType -- Matches associated RegistryObjects of - * Association's whose type attribute references a ClassificationNode where - * rim:ClassificationNode/@path matches specified value - *

- * matchOnAnyParameter -- If true then use logical OR between - * predicates for each parameter - *

- * sourceObjectId --Matches target RegistryObjects of Associations - * where the source RegistryObject's id matches - * rim:/RegistryObject[@xsi:type="rim:AssociationType"]/@sourceObject.
- * Allows use of % wildcard character to match multiple characters.
- * Allows use of ? wildcard character to match a single character.
- *

- * sourceObjectType -- Matches target RegistryObjects of - * Associations whose sourceObject attribute references a RegistryObject whose - * objectType attribute matches the id of the ClassificationNode where - * rim:ClassificationNode/@path matches specified value - *

- * targetObjectId -- - * - * Matches source RegistryObjects of Associations where the target - * RegistryObject's id matches - * rim:/RegistryObject[@xsi:type="rim:AssociationType"]/@targetObject.
- * Allows use of % wildcard character to match multiple characters.
- * Allows use of ? wildcard character to match a single character.
- *

- * targetObjectType -- - * - * Matches source RegistryObjects of Associations whose targetObject attribute - * references a RegistryObject whose objectType attribute matches the id of the - * ClassificationNode where rim:ClassificationNode/@path matches specified value - * - *

- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * 2/13/2012    #184       bphillip     Initial creation
- * 3/18/2013    1802       bphillip     Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * Apr 23, 2013 1910       djohnson     Don't allow NPE on registry object list, remove non ANSI Javadoc.
- * 5/21/2013    2022       bphillip     Set return type on call to findAssociations
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ -public class FindAssociatedObjects extends CanonicalEbxmlQuery { - - /** The valid query parameter for this query **/ - private static final List QUERY_PARAMETERS = new ArrayList(); - static { - QUERY_PARAMETERS.add(QueryConstants.ASSOCIATION_TYPE); - QUERY_PARAMETERS.add(QueryConstants.MATCH_ANY); - QUERY_PARAMETERS.add(QueryConstants.SOURCE_OBJECT_ID); - QUERY_PARAMETERS.add(QueryConstants.SOURCE_OBJECT_TYPE); - QUERY_PARAMETERS.add(QueryConstants.TARGET_OBJECT_ID); - QUERY_PARAMETERS.add(QueryConstants.TARGET_OBJECT_TYPE); - } - - private ClassificationNodeDao classificationNodeDao; - - private FindAssociations findAssociations; - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - QueryParameters parameters = this.getParameterMap(queryType.getSlot(), - queryResponse); - String associationType = parameters - .getFirstParameter(QueryConstants.ASSOCIATION_TYPE); - String sourceObjectId = parameters - .getFirstParameter(QueryConstants.SOURCE_OBJECT_ID); - String sourceObjectType = parameters - .getFirstParameter(QueryConstants.SOURCE_OBJECT_TYPE); - String targetObjectId = parameters - .getFirstParameter(QueryConstants.TARGET_OBJECT_ID); - String targetObjectType = parameters - .getFirstParameter(QueryConstants.TARGET_OBJECT_TYPE); - String conjunction = HqlQueryUtil.AND; - if (parameters.containsParameter(QueryConstants.MATCH_ANY)) { - if (((Boolean) parameters - .getFirstParameter(QueryConstants.MATCH_ANY)) - .booleanValue()) { - conjunction = HqlQueryUtil.OR; - } - } - - if (targetObjectId == null && sourceObjectId == null) { - throw new EbxmlRegistryException( - "Either sourceObjectId or targetObjectId MUST be specified. Neither were present in submitted query"); - } - - if (sourceObjectId != null && targetObjectId != null) { - throw new EbxmlRegistryException( - "Both sourceObjectId and targetObjectId MUST NOT be specified."); - } - - if (sourceObjectType != null && targetObjectType != null) { - throw new EbxmlRegistryException( - "Both sourceObjectType and targetObjectType MUST NOT be specified."); - } - QueryResponse findAssociationsResponse = new QueryResponse(); - findAssociations.setReturnType(returnType); - findAssociations.query(queryType, findAssociationsResponse, client); - List associations = findAssociationsResponse - .getRegistryObjectList().getRegistryObject(); - List ids = new ArrayList(); - for (RegistryObjectType association : associations) { - if (sourceObjectId == null) { - ids.add(((AssociationType) association).getSourceObject()); - } else { - ids.add(((AssociationType) association).getTargetObject()); - } - } - - RegistryObjectListType registryObjectList = queryResponse - .getRegistryObjectList(); - if (registryObjectList == null) { - registryObjectList = new RegistryObjectListType(); - queryResponse.setRegistryObjectList(registryObjectList); - } - registryObjectList.getRegistryObject().addAll( - registryObjectDao.getById(ids)); - - } - - private String getTypeClause(String associationType) - throws EbxmlRegistryException { - ClassificationNodeType node = classificationNodeDao - .getByPath(associationType); - if (node == null) { - throw new EbxmlRegistryException( - "Unknown association type specified in " - + this.getQueryDefinition()); - } - associationType = node.getId(); - return " (obj.id in (select association.sourceObject from AssociationType association where association.type = '" - + associationType - + "') or obj.in (select association.targetObject from AssociationType association where association.type = '" - + associationType + "'))"; - - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.FIND_ASSOCIATED_OBJECTS; - } - - public void setClassificationNodeDao( - ClassificationNodeDao classificationNodeDao) { - this.classificationNodeDao = classificationNodeDao; - } - - public void setFindAssociations(FindAssociations findAssociations) { - this.findAssociations = findAssociations; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAssociations.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAssociations.java deleted file mode 100644 index 1977194c91..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAssociations.java +++ /dev/null @@ -1,220 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationNodeType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.dao.ClassificationNodeDao; -import com.raytheon.uf.edex.registry.ebxml.dao.HqlQueryUtil; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * The canonical query FindAssociations query allows clients to find - * Associations that match the specified criteria. - *

- * Parameter Summary:
- * · associationType -- Matches Associations whose type attribute - * references a ClassificationNode where rim:ClassificationNode/@path matches - * specified value - *

- * · matchOnAnyParameter -- If true then use logical OR between - * predicates for each parameter - *

- * · sourceObjectId -- Matches - * rim:/RegistryObject[@xsi:type="rim:AssociationType"]/@sourceObject.
- * Allows use of “%” wildcard character to match multiple characters.
- * Allows use of “?” wildcard character to match a single character.
- *

- * · sourceObjectType -- Matches Associations whose sourceObject - * attribute references a RegistryObject whose objectType attribute matches the - * id of the ClassificationNode where rim:ClassificationNode/@path matches - * specified value - *

- * · targetObjectId -- Matches - * rim:/RegistryObject[@xsi:type="rim:AssociationType"]/@targetObject.
- * Allows use of “%” wildcard character to match multiple characters.
- * Allows use of “?” wildcard character to match a single character.
- *

- * · targetObjectType -- Matches Associations whose targetObject - * attribute references a RegistryObject whose objectType attribute matches the - * id of the ClassificationNode where rim:ClassificationNode/@path matches - * specified value - * - *

- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * 2/13/2012    #184       bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 8/1/2013     1693       bphilip     Fixed minor typo
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ -public class FindAssociations extends CanonicalEbxmlQuery { - - /** The valid query parameter for this query **/ - private static final List QUERY_PARAMETERS = new ArrayList(); - static { - QUERY_PARAMETERS.add(QueryConstants.ASSOCIATION_TYPE); - QUERY_PARAMETERS.add(QueryConstants.MATCH_ANY); - QUERY_PARAMETERS.add(QueryConstants.SOURCE_OBJECT_ID); - QUERY_PARAMETERS.add(QueryConstants.SOURCE_OBJECT_TYPE); - QUERY_PARAMETERS.add(QueryConstants.TARGET_OBJECT_ID); - QUERY_PARAMETERS.add(QueryConstants.TARGET_OBJECT_TYPE); - } - - private ClassificationNodeDao classificationNodeDao; - - private String getTypeClause(String associationType) - throws EbxmlRegistryException { - ClassificationNodeType node = classificationNodeDao - .getByPath(associationType); - if (node == null) { - throw new EbxmlRegistryException( - "Unknown association type specified in " - + this.getQueryDefinition()); - } - associationType = node.getId(); - return " association.type = '" + associationType + "' "; - - } - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - QueryParameters parameters = this.getParameterMap(queryType.getSlot(), - queryResponse); - String associationType = parameters - .getFirstParameter(QueryConstants.ASSOCIATION_TYPE); - String sourceObjectId = parameters - .getFirstParameter(QueryConstants.SOURCE_OBJECT_ID); - String sourceObjectType = parameters - .getFirstParameter(QueryConstants.SOURCE_OBJECT_TYPE); - String targetObjectId = parameters - .getFirstParameter(QueryConstants.TARGET_OBJECT_ID); - String targetObjectType = parameters - .getFirstParameter(QueryConstants.TARGET_OBJECT_TYPE); - String conjunction = HqlQueryUtil.AND; - if (parameters.containsParameter(QueryConstants.MATCH_ANY)) { - if (((Boolean) parameters - .getFirstParameter(QueryConstants.MATCH_ANY)) - .booleanValue()) { - conjunction = HqlQueryUtil.OR; - } - } - List clauses = new ArrayList(); - if (associationType != null) { - clauses.add(getTypeClause(associationType)); - } - if (sourceObjectId != null) { - clauses.add(" association.sourceObject like '" + sourceObjectId - + "'"); - } - if (targetObjectId != null) { - clauses.add(" association.targetObject like '" + targetObjectId - + "'"); - } - if (sourceObjectType != null) { - List ids = registryObjectDao - .executeHQLQuery("select id from RegistryObjectType obj where obj.objectType = '" - + sourceObjectType + "'"); - if (ids.isEmpty()) { - return; - } else { - StringBuilder clause = new StringBuilder(); - clause.append(" association.sourceObject in ("); - for (int i = 0; i < ids.size(); i++) { - clause.append("'" + ids.get(i) + "'"); - if (i != ids.size() - 1) { - clause.append(","); - } - } - clause.append(") "); - clauses.add(clause.toString()); - } - } - if (targetObjectType != null) { - List ids = registryObjectDao - .executeHQLQuery("select id from RegistryObjectType obj where obj.objectType = '" - + targetObjectType + "'"); - if (ids.isEmpty()) { - return; - } else { - StringBuilder clause = new StringBuilder(); - clause.append(" association.targetObject in ("); - for (int i = 0; i < ids.size(); i++) { - clause.append("'" + ids.get(i) + "'"); - if (i != ids.size() - 1) { - clause.append(","); - } - } - clause.append(") "); - clauses.add(clause.toString()); - } - } - - StringBuilder query = new StringBuilder(); - if (clauses.isEmpty()) { - query.append("from AssociationType"); - } else { - query.append("select association from AssociationType association where "); - for (int i = 0; i < clauses.size(); i++) { - query.append(clauses.get(i)); - if (i != clauses.size() - 1) { - query.append(conjunction); - } - } - } - setResponsePayload(queryResponse, - registryObjectDao.executeHQLQuery(query.toString())); - - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.FIND_ASSOCIATIONS; - } - - public void setClassificationNodeDao( - ClassificationNodeDao classificationNodeDao) { - this.classificationNodeDao = classificationNodeDao; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GarbageCollector.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GarbageCollector.java deleted file mode 100644 index 92b50ee5e0..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GarbageCollector.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.Collections; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * Garbage collector implementation to purge items from the registry - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ -public class GarbageCollector extends CanonicalEbxmlQuery { - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.GARBAGE_COLLECTOR; - } - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - } - - @Override - protected List getValidParameters() { - return Collections.emptyList(); - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailById.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailById.java deleted file mode 100644 index 7549e5fa9e..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailById.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.dao.AuditableEventTypeDao; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * The canonical query GetAuditTrailByLid allows clients to get the change - * history or audit trail for all RegistryObjects whose lid attribute value is - * the same as the value of the lid parameter. - * - *

- * Parameter Summary:
- * · endTime -- Specifies the end of the time interval (inclusive) - * for rim:/RegistryObject[@xsi:type="rim:AuditableEventType"]/@timestamp value - *

- * · lid -- Matches rim:/RegistryObject/@lid. - *

- * startTime -- Specifies the end of the time interval (inclusive) - * for rim:/RegistryObject[@xsi:type="rim:AuditableEventType"]/@timestamp value - *

- * - *

- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * 2/15/2012    #184       bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ -public class GetAuditTrailById extends CanonicalEbxmlQuery { - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.END_TIME); - QUERY_PARAMETERS.add(QueryConstants.ID); - QUERY_PARAMETERS.add(QueryConstants.START_TIME); - } - - private AuditableEventTypeDao auditableEventDao; - - @SuppressWarnings("unchecked") - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - QueryParameters parameters = getParameterMap(queryType.getSlot(), - queryResponse); - - String lid = parameters.getFirstParameter(QueryConstants.ID); - String endTime = parameters.getFirstParameter(QueryConstants.END_TIME); - String startTime = parameters - .getFirstParameter(QueryConstants.START_TIME); - if (lid == null) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" + QueryConstants.ID - + "]"); - } - - String query = "select obj from AuditableEventType obj inner join obj.action as Action " - + "inner join Action.affectedObjects as AffectedObjects " - + "inner join AffectedObjects.registryObject as regObj " - + "where regObj.id=':id' :endTimeClause :startTimeClause order by obj.timestamp desc"; - query = query.replace(":id", lid); - if (startTime == null) { - query = query.replace(":startTimeClause", ""); - } else { - query = query.replace(":startTimeClause", " and obj.timestamp >= '" - + startTime + "'"); - } - if (endTime == null) { - query = query.replace(":endTimeClause", ""); - } else { - query = query.replace(":endTimeClause", " and obj.timestamp <= '" - + endTime + "'"); - } - setResponsePayload(queryResponse, - auditableEventDao.executeHQLQuery(query)); - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_ID; - } - - public void setAuditableEventDao(AuditableEventTypeDao auditableEventDao) { - this.auditableEventDao = auditableEventDao; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByLid.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByLid.java deleted file mode 100644 index 06c5dd6437..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByLid.java +++ /dev/null @@ -1,131 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.dao.AuditableEventTypeDao; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * TODO Add Description - * - *

- * Parameter Summary:
- * · endTime -- Specifies the end of the time interval (inclusive) - * for rim:/RegistryObject[@xsi:type="rim:AuditableEventType"]/@timestamp value - *

- * · id -- Matches rim:/RegistryObject/@id. - *

- * startTime -- Specifies the end of the time interval (inclusive) - * for rim:/RegistryObject[@xsi:type="rim:AuditableEventType"]/@timestamp value - *

- * - * SOFTWARE HISTORY - * - * Date Ticket# Engineer Description ------------ ---------- ----------- - * -------------------------- Jan 18, 2012 bphillip Initial creation 3/18/2013 - * 1802 bphillip Modified to use transaction boundaries and spring dao injection - * 4/9/2013 1802 bphillip Changed abstract method signature, modified return - * processing, and changed static variables - * - * - * - * @author bphillip - * @version 1.0 - */ - -public class GetAuditTrailByLid extends CanonicalEbxmlQuery { - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.END_TIME); - QUERY_PARAMETERS.add(QueryConstants.LID); - QUERY_PARAMETERS.add(QueryConstants.START_TIME); - } - - private AuditableEventTypeDao auditableEventDao; - - @SuppressWarnings("unchecked") - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - QueryParameters parameters = getParameterMap(queryType.getSlot(), - queryResponse); - - String lid = parameters.getFirstParameter(QueryConstants.LID); - String endTime = parameters.getFirstParameter(QueryConstants.END_TIME); - String startTime = parameters - .getFirstParameter(QueryConstants.START_TIME); - if (lid == null) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" + QueryConstants.LID - + "]"); - } - - String query = "select obj from AuditableEventType obj inner join obj.action as Action " - + "inner join Action.affectedObjects as AffectedObjects " - + "inner join AffectedObjects.registryObject as regObj " - + "where regObj.lid=':lid' :endTimeClause :startTimeClause order by obj.timestamp desc"; - query = query.replace(":lid", lid); - if (startTime == null) { - query = query.replace(":startTimeClause", ""); - } else { - query = query.replace(":startTimeClause", " and obj.timestamp >= '" - + startTime + "'"); - } - if (endTime == null) { - query = query.replace(":endTimeClause", ""); - } else { - query = query.replace(":endTimeClause", " and obj.timestamp <= '" - + endTime + "'"); - } - setResponsePayload(queryResponse, - auditableEventDao.executeHQLQuery(query)); - - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_LID; - } - - public void setAuditableEventDao(AuditableEventTypeDao auditableEventDao) { - this.auditableEventDao = auditableEventDao; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByTimeInterval.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByTimeInterval.java deleted file mode 100644 index 0d0e89f5fe..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByTimeInterval.java +++ /dev/null @@ -1,115 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.edex.registry.ebxml.dao.AuditableEventTypeDao; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * TODO Add Description - * - *

- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ - -public class GetAuditTrailByTimeInterval extends CanonicalEbxmlQuery { - - /** The logger */ - protected static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(GetAuditTrailByTimeInterval.class); - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.END_TIME); - QUERY_PARAMETERS.add(QueryConstants.START_TIME); - } - - private AuditableEventTypeDao auditableEventDao; - - @SuppressWarnings("unchecked") - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - QueryParameters parameters = getParameterMap(queryType.getSlot(), - queryResponse); - String endTime = parameters.getFirstParameter(QueryConstants.END_TIME); - String startTime = parameters - .getFirstParameter(QueryConstants.START_TIME); - if (endTime == null) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" - + QueryConstants.END_TIME + "]"); - } - if (startTime == null) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" - + QueryConstants.START_TIME + "]"); - } - - String query = "select obj from AuditableEventType obj where obj.timestamp >='" - + startTime + "' and obj.timestamp <='" + endTime + "'"; - setResponsePayload(queryResponse, - auditableEventDao.executeHQLQuery(query)); - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_TIME_INTERVAL; - } - - public void setAuditableEventDao(AuditableEventTypeDao auditableEventDao) { - this.auditableEventDao = auditableEventDao; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetChildrenByParentId.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetChildrenByParentId.java deleted file mode 100644 index 057225cc3b..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetChildrenByParentId.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.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * TODO Add Description - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ - -public class GetChildrenByParentId extends CanonicalEbxmlQuery { - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.DEPTH); - QUERY_PARAMETERS.add(QueryConstants.EXCLUSIVE_CHILDREN_ONLY); - QUERY_PARAMETERS.add(QueryConstants.OBJECT_TYPE); - QUERY_PARAMETERS.add(QueryConstants.PARENT_ID); - } - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - // TODO: Implement - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.GET_CHILDREN_BY_PARENT_ID; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetClassificationSchemesById.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetClassificationSchemesById.java deleted file mode 100644 index fd712ece40..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetClassificationSchemesById.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationSchemeType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectTypeDao; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * The canonical query GetClassificationSchemesById allows clients to fetch - * specified ClassificationSchemes. - * - *

- * Parameter Summary:
- * · id -- Matches - * rim:/RegistryObject[@xsi:type="rim:ClassificationSchemeType"]/@id.
- * Allows use of “%” wildcard character to match multiple characters.
- * Allows use of “?” wildcard character to match a single character.
- *

- * - *

- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ - -public class GetClassificationSchemesById extends CanonicalEbxmlQuery { - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.ID); - } - - private RegistryObjectTypeDao classificationSchemeTypeDao; - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - QueryParameters parameters = getParameterMap(queryType.getSlot(), - queryResponse); - // The client did not specify the required parameter - if (parameters.isEmpty() - || !parameters.containsParameter(QueryConstants.ID)) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" - + QUERY_PARAMETERS.get(0) + "]"); - } - - String id = parameters.getFirstParameter(QueryConstants.ID); - List ids = new ArrayList(); - if (id.contains("_") || id.contains("%")) { - List matchingIds = classificationSchemeTypeDao - .getMatchingIds(id); - if (matchingIds.isEmpty()) { - return; - } - ids.addAll(matchingIds); - - } else { - ids.add(id); - } - - queryResponse.getRegistryObjectList().getRegistryObject() - .addAll(classificationSchemeTypeDao.getById(ids)); - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.GET_CLASSIFICATION_SCHEMES_BY_ID; - } - - public void setClassificationSchemeTypeDao( - RegistryObjectTypeDao classificationSchemeTypeDao) { - this.classificationSchemeTypeDao = classificationSchemeTypeDao; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetNotification.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetNotification.java deleted file mode 100644 index 251c1f2d68..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetNotification.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.datatype.XMLGregorianCalendar; - -import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.NotificationType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SubscriptionType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.dao.SubscriptionDao; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.notification.NotificationDestination; -import com.raytheon.uf.edex.registry.ebxml.services.notification.RegistrySubscriptionManager; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; -import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; - -/** - * TODO Add Description - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip    Changed abstract method signature, modified return processing, and changed static variables
- * Jun 24, 2013 2106       djohnson    Requires a transaction to be open, will not create one.
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ -public class GetNotification extends CanonicalEbxmlQuery { - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.SUBSCRIPTION_ID); - QUERY_PARAMETERS.add(QueryConstants.START_TIME); - } - - /** The subscription manager */ - private RegistrySubscriptionManager subscriptionManager; - - /** Data access object for accessing registry subscriptions */ - private SubscriptionDao subscriptionDao; - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - QueryParameters parameters = getParameterMap(queryType.getSlot(), - queryResponse); - // The client did not specify the required parameter - if (parameters.isEmpty() - || !parameters - .containsParameter(QueryConstants.SUBSCRIPTION_ID)) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" - + QUERY_PARAMETERS.get(0) + "]"); - } - - String subscriptionId = parameters - .getFirstParameter(QueryConstants.SUBSCRIPTION_ID); - XMLGregorianCalendar startTime = parameters - .getFirstParameter(QueryConstants.START_TIME); - - SubscriptionType subscription = subscriptionDao.getById(subscriptionId); - if (subscription == null) { - throw new EbxmlRegistryException("No subscription with id: " - + subscriptionId + " present in registry"); - } - - List destinations = subscriptionManager - .getNotificationDestinations(subscription); - if (destinations.isEmpty() && startTime == null) { - throw new EbxmlRegistryException( - "Subscription does not define any push delivery addresses. Start time must be defined."); - } - - if (startTime == null) { - startTime = subscription - .getSlotValue(EbxmlObjectUtil.SUBSCRIPTION_LAST_RUN_TIME_SLOT_NAME); - if (startTime == null) { - startTime = EbxmlObjectUtil.getTimeAsXMLGregorianCalendar(0); - - } - } - - try { - NotificationType notification = subscriptionManager - .getOnDemandNotification("http://" + client, - subscriptionId, startTime); - List retVal = new ArrayList(); - retVal.add(notification); - setResponsePayload(queryResponse, retVal); - } catch (MsgRegistryException e) { - throw new EbxmlRegistryException( - "Error getting on demand notification", e.getCause()); - } - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.GET_NOTIFICATION; - } - - public void setSubscriptionManager( - RegistrySubscriptionManager subscriptionManager) { - this.subscriptionManager = subscriptionManager; - } - - public void setSubscriptionDao(SubscriptionDao subscriptionDao) { - this.subscriptionDao = subscriptionDao; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetObjectById.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetObjectById.java deleted file mode 100644 index 59323cbdfe..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetObjectById.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectRefListType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectRefType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectListType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImpl.RETURN_TYPE; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * The canonical query GetObjectById allows clients to find RegistryObjects - * based upon the value of their id attribute. - * - * - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 4/19/2013    1931       bphillip    Fixed null pointer issue
- * 
- * - * @author bphillip - * @version 1.0 - */ - -public class GetObjectById extends CanonicalEbxmlQuery { - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.ID); - } - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - QueryParameters parameters = getParameterMap(queryType.getSlot(), - queryResponse); - // The client did not specify the required parameter - if (parameters.isEmpty() - || !parameters.containsParameter(QueryConstants.ID)) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" - + QUERY_PARAMETERS.get(0) + "]"); - } - - String id = parameters.getFirstParameter(QueryConstants.ID); - List ids = new ArrayList(); - if (id.contains("_") || id.contains("%")) { - List matchingIds = registryObjectDao.getMatchingIds(id); - if (matchingIds.isEmpty()) { - return; - } - ids.addAll(matchingIds); - } else { - ids.add(id); - } - - if (returnType.equals(RETURN_TYPE.ObjectRef)) { - ObjectRefListType objectRefList = new ObjectRefListType(); - for (String idValue : ids) { - ObjectRefType objectRef = new ObjectRefType(); - objectRef.setId(idValue); - objectRefList.getObjectRef().add(objectRef); - } - queryResponse.setObjectRefList(objectRefList); - } else { - List results = new ArrayList(); - if (ids.size() == 1) { - results.add(registryObjectDao.getById(ids.get(0))); - } else { - results.addAll(registryObjectDao.getById(ids)); - } - RegistryObjectListType objList = new RegistryObjectListType(); - objList.getRegistryObject().addAll(results); - queryResponse.setRegistryObjectList(objList); - } - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.GET_OBJECT_BY_ID; - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetObjectsByLid.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetObjectsByLid.java deleted file mode 100644 index d8131ac7fb..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetObjectsByLid.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.dao.HqlQueryUtil; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * TODO Add Description - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ - -public class GetObjectsByLid extends CanonicalEbxmlQuery { - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.LID); - } - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - - QueryParameters parameters = getParameterMap(queryType.getSlot(), - queryResponse); - // The client did not specify the required parameter - if (parameters.isEmpty() - || !parameters.containsParameter(QueryConstants.LID)) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" - + QUERY_PARAMETERS.get(0) + "]"); - } - - StringBuilder query = new StringBuilder(); - String lid = parameters.getFirstParameter(QueryConstants.LID); - List lids = new ArrayList(); - if (lid.contains("_") || lid.contains("%")) { - List matchingLids = registryObjectDao.getMatchingLids(lid); - if (matchingLids.isEmpty()) { - return; - } - lids.addAll(matchingLids); - - } else { - lids.add(lid); - } - HqlQueryUtil.assembleSingleParamQuery(query, RegistryObjectType.class, - QueryConstants.LID, HqlQueryUtil.IN, lids); - query.append(" order by obj.lid asc,obj.versionInfo.versionName desc"); - setResponsePayload(queryResponse, - registryObjectDao.executeHQLQuery(query.toString())); - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.GET_OBJECTS_BY_LID; - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetReferencedObject.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetReferencedObject.java deleted file mode 100644 index 97fd87bbe0..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetReferencedObject.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; -import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.QueryManager; -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.query.v4.ResponseOptionType; -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.SlotType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.common.registry.constants.QueryReturnTypes; -import com.raytheon.uf.common.registry.services.RegistrySOAPServices; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.lifecycle.ObjectReferenceResolver; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * - * EBXML Canonical query to get a referenced object - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#     Engineer    Description
- * ------------ ----------  ----------- --------------------------
- * 9/18/2013    1705        bphillip    Initial implementation
- * 
- * - * @author bphillip - * @version 1 - */ -public class GetReferencedObject extends CanonicalEbxmlQuery { - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /** Object used to resolve object references */ - private ObjectReferenceResolver referenceResolver; - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.OBJECT_REFERENCE); - } - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - RegistryObjectType referencedObject = null; - QueryParameters parameters = getParameterMap(queryType.getSlot(), - queryResponse); - if (parameters.containsParameter(QueryConstants.OBJECT_REFERENCE)) { - - String refValue = (String) parameters.getParameter( - QueryConstants.OBJECT_REFERENCE).get(0); - referencedObject = referenceResolver - .getStaticReferencedObject(refValue); - if (referencedObject == null) { - try { - referencedObject = referenceResolver - .getDynamicReferencedObject(refValue); - } catch (MsgRegistryException e) { - throw new EbxmlRegistryException("Error resolving object!", - e); - } - if (referencedObject == null) { - if (referenceResolver.isValidURL(refValue)) { - String objectId = refValue.substring(refValue - .lastIndexOf("/") + 1); - String remoteAddress = refValue.replace( - "/rest/registryObjects/" + objectId, ""); - QueryType queryObj = new QueryType(); - queryObj.setQueryDefinition(CanonicalQueryTypes.GET_REFERENCED_OBJECT); - SlotType slot = new SlotType( - QueryConstants.OBJECT_REFERENCE, - new StringValueType(objectId)); - queryObj.getSlot().add(slot); - QueryRequest query = new QueryRequest(); - query.setId("Resolve reference [" + refValue + "]"); - query.setQuery(queryObj); - query.setResponseOption(new ResponseOptionType( - QueryReturnTypes.REGISTRY_OBJECT, true)); - QueryManager remoteQueryManager = RegistrySOAPServices - .getQueryServiceForHost(remoteAddress); - try { - QueryResponse remoteResponse = remoteQueryManager - .executeQuery(query); - referencedObject = remoteResponse - .getRegistryObjects().get(0); - } catch (MsgRegistryException e) { - throw new EbxmlRegistryException( - "Error querying remote registry at [" - + remoteAddress - + "] to resolve reference to object " - + objectId, e); - } - } else { - throw new EbxmlRegistryException( - "Unable to resolve reference for value [" - + refValue + "]"); - } - } - } - - } else { - statusHandler.info("Query did not specify object reference"); - } - List values = new ArrayList(); - values.add(referencedObject); - this.setResponsePayload(queryResponse, values); - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.GET_REFERENCED_OBJECT; - } - - public void setReferenceResolver(ObjectReferenceResolver referenceResolver) { - this.referenceResolver = referenceResolver; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetRegistryPackagesByMemberId.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetRegistryPackagesByMemberId.java deleted file mode 100644 index bd3768675a..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetRegistryPackagesByMemberId.java +++ /dev/null @@ -1,127 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryPackageType; - -import org.hibernate.criterion.DetachedCriteria; -import org.hibernate.criterion.Property; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectTypeDao; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * TODO Add Description - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ - -public class GetRegistryPackagesByMemberId extends CanonicalEbxmlQuery { - - /** The logger */ - protected static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(GetAuditTrailByTimeInterval.class); - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.MEMBER_ID); - } - - private RegistryObjectTypeDao registryPackageDao; - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - QueryParameters parameters = getParameterMap(queryType.getSlot(), - queryResponse); - // The client did not specify the required parameter - if (parameters.isEmpty()) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" - + QUERY_PARAMETERS.get(0) + "]"); - } - - String id = parameters.getFirstParameter(QueryConstants.MEMBER_ID); - List ids = new ArrayList(); - if (id.contains("_") || id.contains("%")) { - List matchingIds = registryObjectDao.getMatchingIds(id); - if (matchingIds.isEmpty()) { - return; - } - ids.addAll(matchingIds); - - } else { - ids.add(id); - } - - DetachedCriteria theQuery = DetachedCriteria - .forClass(RegistryPackageType.class); - theQuery.createAlias("registryObjectList", "registryObjectList"); - theQuery.createAlias("registryObjectList.registryObject", "regObject"); - theQuery.add(Property.forName("regObject.id").in(ids)); - setResponsePayload(queryResponse, - registryPackageDao.executeCriteriaQuery(theQuery)); - - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.GET_REGISTRY_PACKAGES_BY_MEMBER_ID; - } - - public void setRegistryPackageDao( - RegistryObjectTypeDao registryPackageDao) { - this.registryPackageDao = registryPackageDao; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/KeywordSearch.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/KeywordSearch.java deleted file mode 100644 index c2c7348efc..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/KeywordSearch.java +++ /dev/null @@ -1,302 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.cataloger.IndexEntry; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * The canonical query KeyWordSearch allows clients to find RegistryObjects and - * RepositoryItems that contain text that matches keywords identified by - * specified search patterns. - *

- * Parameter Summary:
- * · keywords -- A space separated list of keywords to search for - *

- * The value of the keywords parameter may consist of multiple terms where each - * term is separated by one or more spaces
- * - * Example: ebxml regrep Semantics: Matches objects containing either “ebxml” or - * “regrep” - *

- * - * · A term may be enclosed in double-quotes to include white space characters - * as a literal value.
- * - * Example: “ebxml regrep” Semantics: Matches objects containing “ebxml regrep” - *

- * · Terms may be specified using wildcard characters where '*' matches one or - * more characters and “?” matches a single character.
- * - * Example: eb?ml reg* - *

- * · Terms may be combined using boolean operators “AND”, “OR” and “NOT”. - * Absence of a boolean operator between terms implies an implicit OR operator - * between them.
- * - * · Example: ebxml AND regrep Semantics: Matches objects containing “ebxml” and - * “regrep” - *

- * Example: ebxml NOT regrep Semantics: Matches objects containing “ebxml” and - * not containg “regrep”
- * - * Example: ebxml OR regrep Semantics: Matches objects containing “ebxml” or - * “regrep”
- * - * Example: ebxml regrep Semantics: Matches objects containing “ebxml” or - * “regrep” - *

- * · Terms may be grouped together using “(“ at the beginning and “)” at the end - * of the group. Grouping allowing boolean operators to be applied to a group of - * terms as a whole and enables more flexible searches.
- * - * Example: ebxml AND (registry OR regrep) Semantics: Matches objects containing - * both “ebxml” and either “registry” or “regrep” - *

- * - *

- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ - -public class KeywordSearch extends CanonicalEbxmlQuery { - - /** The logger */ - protected static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(KeywordSearch.class); - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.KEYWORDS); - } - - @Override - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - // TODO: Implement - } - - /** - * Generates the HQL query from the provided set of keywords. - * - * @param keywords - * The keywords provided by the client - * @return The corresponding HQL query derived from the set of keywords - * provided - */ - private String generateQuery(String keywords) { - keywords = keywords.replaceAll("\\(", " ( ").replaceAll("\\)", " ) ") - .replaceAll("\\*", "%"); - List tokenArray = splitString(keywords); - List tokens = new ArrayList(); - for (String str : tokenArray) { - if (!str.trim().isEmpty()) { - tokens.add(str.trim()); - } - } - - boolean modified = true; - String previous = null; - String current = null; - String next = null; - while (modified) { - modified = false; - for (int i = 0; i < tokens.size(); i++) { - if (i == 0) { - previous = null; - } else { - previous = tokens.get(i - 1); - } - current = tokens.get(i); - if (i == tokens.size() - 1) { - continue; - } else { - next = tokens.get(i + 1); - } - if (isTerm(current)) { - if (isOpenParen(next) || isTerm(next)) { - tokens.add(i + 1, "OR"); - modified = true; - break; - } - } else if (isClosingParen(current)) { - if (isTerm(next)) { - tokens.add(i + 1, "OR"); - modified = true; - break; - } - } else if (current.equalsIgnoreCase("NOT") && previous != null) { - if (!isJunction(previous)) { - tokens.add(i, "AND"); - modified = true; - break; - } - } - } - } - - StringBuilder hql = new StringBuilder(); - hql.append("from ").append(IndexEntry.class.getName()) - .append(" x where "); - for (String token : tokens) { - if (isJunction(token) || isParen(token)) { - hql.append(" ").append(token).append(" "); - } else { - hql.append(" x.value like '%").append(token).append("%'"); - } - } - return hql.toString(); - } - - /** - * Splits the string on spaces. Quoted substrings are not separated, but - * instead are treated as separate tokens - * - * @param source - * The string to split - * @return The string broken apart by spaces while maintaining quoted items - */ - private List splitString(String source) { - List tokens = new ArrayList(); - char delimiter = ' '; - char quote = '"'; - boolean quoted = false; - String currentWord = ""; - char currentChar = 0; - for (int i = 0; i < source.length(); i++) { - currentChar = source.charAt(i); - if (currentChar == quote) { - if (quoted) { - quoted = false; - tokens.add(currentWord); - currentWord = ""; - } else { - quoted = true; - } - } else if (quoted) { - currentWord += currentChar; - } else if (currentChar == delimiter) { - if (!currentWord.isEmpty()) { - tokens.add(currentWord); - } - currentWord = ""; - } else { - currentWord += currentChar; - } - } - if (!currentWord.isEmpty()) { - tokens.add(currentWord); - } - return tokens; - } - - /** - * Checks if the provided string is a closing parenthesis - * - * @param str - * The string to check - * @return True if this string is a closing parenthesis - */ - private boolean isClosingParen(String str) { - return str != null && str.equals(")"); - } - - /** - * Checks if the provided string is a open parenthesis - * - * @param str - * The string to check - * @return True if this string is a open parenthesis - */ - private boolean isOpenParen(String str) { - return str != null && str.equals("("); - } - - /** - * Checks if the provided string is a parenthesis - * - * @param str - * The string to check - * @return True if this string is a parenthesis - */ - private boolean isParen(String str) { - return isClosingParen(str) || isOpenParen(str); - } - - /** - * Checks if the provided string is a conjunction, i.e. AND, OR, NOT - * - * @param str - * The string to check - * @return True if this string is a conjunction - */ - private boolean isJunction(String str) { - return str != null - && (str.equalsIgnoreCase("and") || str.equalsIgnoreCase("or") || str - .equalsIgnoreCase("not")); - } - - /** - * The string is considered a 'term' if it is not a perenthesis and it is - * not a conjunction - * - * @param str - * The string to check - * @return True if this string is a 'term' - */ - private boolean isTerm(String str) { - return !isParen(str) && !isJunction(str); - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.KEYWORD_SEARCH; - } -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/RegistryPackageSelector.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/RegistryPackageSelector.java deleted file mode 100644 index 94681a5f76..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/RegistryPackageSelector.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - -import java.util.ArrayList; -import java.util.List; - -import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; -import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; - -import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; -import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectTypeDao; -import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryParameters; -import com.raytheon.uf.edex.registry.ebxml.services.query.types.CanonicalEbxmlQuery; - -/** - * Quey type allowing the client to select registry packages - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * Jan 18, 2012            bphillip     Initial creation
- * 3/18/2013    1802       bphillip    Modified to use transaction boundaries and spring dao injection
- * 4/9/2013     1802       bphillip     Changed abstract method signature, modified return processing, and changed static variables
- * 
- * 
- * - * @author bphillip - * @version 1.0 - */ - -public class RegistryPackageSelector extends CanonicalEbxmlQuery { - - /** The list of valid parameters for this query */ - private static final List QUERY_PARAMETERS = new ArrayList(); - - /* Initializes the list of parameters */ - static { - QUERY_PARAMETERS.add(QueryConstants.REGISTRY_PACKAGE_IDS); - QUERY_PARAMETERS.add(QueryConstants.DEPTH); - } - - private RegistryObjectTypeDao registryPackageDao; - - protected void query(QueryType queryType, QueryResponse queryResponse, - String client) throws EbxmlRegistryException { - QueryParameters parameters = getParameterMap(queryType.getSlot(), - queryResponse); - // The client did not specify the required parameter - if (parameters.isEmpty() - || !parameters - .containsParameter(QueryConstants.REGISTRY_PACKAGE_IDS)) { - throw new EbxmlRegistryException("Canonical query [" - + this.getQueryDefinition() - + "] is missing required parameter [" - + QUERY_PARAMETERS.get(0) + "]"); - } - - // TODO: Implement depth - - List packageIds = new ArrayList(); - for (Object obj : parameters - .getParameter(QueryConstants.REGISTRY_PACKAGE_IDS)) { - packageIds.add((String) obj); - } - queryResponse.getRegistryObjectList().getRegistryObject() - .addAll(registryPackageDao.getById(packageIds)); - } - - @Override - protected List getValidParameters() { - return QUERY_PARAMETERS; - } - - @Override - public String getQueryDefinition() { - return CanonicalQueryTypes.REGISTRY_PACKAGE_SELECTOR; - } - - public void setRegistryPackageDao(RegistryObjectTypeDao registryPackageDao) { - this.registryPackageDao = registryPackageDao; - } - -} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/package-info.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/package-info.java deleted file mode 100644 index c4a0567363..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This package contains concrete implementation of the canonical ebXML query types - */ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; - diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/ext/package-info.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/ext/package-info.java deleted file mode 100644 index a23e2b857e..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/ext/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * This package contains concrete implementations of any custom query types - */ -package com.raytheon.uf.edex.registry.ebxml.services.query.types.ext; - diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/package-info.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/package-info.java deleted file mode 100644 index fb6238cc96..0000000000 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/query/types/package-info.java +++ /dev/null @@ -1,5 +0,0 @@ -/** - * The package contains the concrete implementations of the ebXML query types - */ -package com.raytheon.uf.edex.registry.ebxml.services.query.types; - 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 ca958ed637..cb97c2c478 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 @@ -20,7 +20,6 @@ package com.raytheon.uf.edex.registry.ebxml.services.rest; import java.math.BigInteger; -import java.util.ArrayList; import java.util.List; import javax.ws.rs.GET; @@ -36,15 +35,22 @@ import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.QueryManager; import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryResponse; import oasis.names.tc.ebxml.regrep.xsd.query.v4.ResponseOptionType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ParameterType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType; +import org.apache.commons.beanutils.ConstructorUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; import com.raytheon.uf.common.registry.constants.Languages; import com.raytheon.uf.common.registry.constants.QueryReturnTypes; +import com.raytheon.uf.common.registry.ebxml.RegistryUtil; import com.raytheon.uf.common.registry.services.rest.IQueryProtocolRestService; import com.raytheon.uf.common.serialization.JAXBManager; +import com.raytheon.uf.edex.registry.ebxml.dao.QueryDefinitionDao; +import com.raytheon.uf.edex.registry.ebxml.services.query.RegistryQueryUtil; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlExceptionUtil; /** * @@ -59,6 +65,7 @@ import com.raytheon.uf.common.serialization.JAXBManager; * ------------ ---------- ----------- -------------------------- * 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 * * * @author bphillip @@ -69,29 +76,15 @@ import com.raytheon.uf.common.serialization.JAXBManager; @Transactional public class QueryProtocolRestService implements IQueryProtocolRestService { - /** Convenience list of all the canonical query parameter names */ - private static final List CANONICAL_QUERY_PARAMETERS; - - static { - CANONICAL_QUERY_PARAMETERS = new ArrayList(); - CANONICAL_QUERY_PARAMETERS.add(QueryRequest.QUERY_ID); - CANONICAL_QUERY_PARAMETERS.add(QueryRequest.DEPTH); - CANONICAL_QUERY_PARAMETERS.add(QueryRequest.FORMAT); - CANONICAL_QUERY_PARAMETERS.add(QueryRequest.FEDERATED); - CANONICAL_QUERY_PARAMETERS.add(QueryRequest.FEDERATION); - CANONICAL_QUERY_PARAMETERS.add(QueryRequest.MATCH_OLDER_VERSIONS); - CANONICAL_QUERY_PARAMETERS.add(QueryRequest.START_INDEX); - CANONICAL_QUERY_PARAMETERS.add(QueryRequest.LANG); - CANONICAL_QUERY_PARAMETERS.add(QueryRequest.MAX_RESULTS); - - } - /** The local query manager */ private QueryManager queryManager; /** Jaxb Manager for marshalling the response */ private JAXBManager responseJaxb; + /** Data access object for query definitions */ + private QueryDefinitionDao queryDefinitionDao; + /** * Creates a new QueryProtocolRestService instance * @@ -99,12 +92,7 @@ public class QueryProtocolRestService implements IQueryProtocolRestService { * If errors occur while initializing the JAXBManager */ public QueryProtocolRestService() throws JAXBException { - responseJaxb = new JAXBManager(QueryResponse.class); - } - - public String executeQuery() { - - return null; + responseJaxb = new JAXBManager(QueryRequest.class, QueryResponse.class); } @GET @@ -116,45 +104,40 @@ public class QueryProtocolRestService implements IQueryProtocolRestService { */ MultivaluedMap queryParameters = info .getQueryParameters(); - String queryId = queryParameters.getFirst(QueryRequest.QUERY_ID) == null ? "urn:oasis:names:tc:ebxml-regrep:query:GetObjectById" - : queryParameters.getFirst(QueryRequest.QUERY_ID); - BigInteger depth = queryParameters.getFirst(QueryRequest.DEPTH) == null ? null - : new BigInteger(queryParameters.getFirst(QueryRequest.DEPTH)); - - String format = queryParameters.getFirst(QueryRequest.FORMAT); - - boolean federated = queryParameters.getFirst(QueryRequest.FEDERATED) == null ? false - : Boolean.parseBoolean(queryParameters - .getFirst(QueryRequest.FEDERATED)); - - String federation = queryParameters.getFirst(QueryRequest.FEDERATION); - - boolean matchOlderVersions = queryParameters - .getFirst(QueryRequest.MATCH_OLDER_VERSIONS) == null ? true - : Boolean.parseBoolean(queryParameters - .getFirst(QueryRequest.MATCH_OLDER_VERSIONS)); - - BigInteger startIndex = queryParameters - .getFirst(QueryRequest.START_INDEX) == null ? new BigInteger( - "0") : new BigInteger( - queryParameters.getFirst(QueryRequest.START_INDEX)); - - String lang = queryParameters.getFirst(QueryRequest.LANG) == null ? Languages.EN_US - : queryParameters.getFirst(QueryRequest.LANG); - - BigInteger maxResults = queryParameters - .getFirst(QueryRequest.MAX_RESULTS) == null ? new BigInteger( - "0") : new BigInteger( - queryParameters.getFirst(QueryRequest.MAX_RESULTS)); + String queryId = getValue(queryParameters, QueryRequest.QUERY_ID, + CanonicalQueryTypes.GET_OBJECT_BY_ID); + BigInteger depth = getValue(queryParameters, QueryRequest.DEPTH, + QueryRequest.DEFAULT_DEPTH); + String format = getValue(queryParameters, QueryRequest.FORMAT, + QueryRequest.DEFAULT_RESPONSE_FORMAT); + Boolean federated = getValue(queryParameters, QueryRequest.FEDERATED, + Boolean.FALSE); + String federation = getValue(queryParameters, QueryRequest.FEDERATION, + ""); + Boolean matchOlderVersions = getValue(queryParameters, + QueryRequest.MATCH_OLDER_VERSIONS, Boolean.FALSE); + BigInteger startIndex = getValue(queryParameters, + QueryRequest.START_INDEX, QueryRequest.DEFAULT_START_INDEX); + String lang = getValue(queryParameters, QueryRequest.LANG, + Languages.EN_US); + BigInteger maxResults = getValue(queryParameters, + QueryRequest.MAX_RESULTS, QueryRequest.DEFAULT_MAX_RESULTS); + String responseOption = getValue(queryParameters, + QueryRequest.RESPONSE_OPTION, QueryReturnTypes.REGISTRY_OBJECT); + Boolean returnRequest = getValue(queryParameters, + QueryRequest.RETURN_REQUEST, Boolean.FALSE); /* * Create the query request object */ QueryRequest restQueryRequest = new QueryRequest(); - ResponseOptionType responseOption = new ResponseOptionType(); - responseOption.setReturnType(QueryReturnTypes.REGISTRY_OBJECT); - responseOption.setReturnComposedObjects(true); + restQueryRequest.setId(RegistryUtil.generateRegistryObjectId()); + restQueryRequest.setComment("Query received from REST Endpoint"); + ResponseOptionType responseOptionObj = new ResponseOptionType(); + responseOptionObj.setReturnType(responseOption); + responseOptionObj.setReturnComposedObjects(true); + QueryType queryType = new QueryType(); queryType.setQueryDefinition(queryId); @@ -167,23 +150,65 @@ public class QueryProtocolRestService implements IQueryProtocolRestService { restQueryRequest.setLang(lang); restQueryRequest.setMaxResults(maxResults); restQueryRequest.setQuery(queryType); - restQueryRequest.setResponseOption(responseOption); + restQueryRequest.setResponseOption(responseOptionObj); - /* - * Extract out any non-canonical query parameters and assign them as - * slots to be used as query specific arguments - */ - for (String key : queryParameters.keySet()) { - if (!CANONICAL_QUERY_PARAMETERS.contains(key)) { - queryType.addSlot(key, queryParameters.getFirst(key)); + List parameters = queryDefinitionDao + .getParametersForQuery(queryId); + + for (ParameterType param : parameters) { + String value = queryParameters.getFirst(param.getParameterName()); + if (isSpecified(value)) { + RegistryQueryUtil.addSlotToQuery(value, param, queryType); } } - return responseJaxb.marshalToXml(queryManager - .executeQuery(restQueryRequest)); + + if (returnRequest.booleanValue()) { + return responseJaxb.marshalToXml(restQueryRequest); + } else { + return responseJaxb.marshalToXml(queryManager + .executeQuery(restQueryRequest)); + } + } + + /** + * Gets the value of a given url argument + * + * @param queryParameters + * The parameters received for the query + * @param parameterName + * The paremeter name to get + * @param defaultValue + * The default value for this parameter to return if the + * parameter is not found in the query parameters + * @return The value of the parameter or default value if not found + * @throws MsgRegistryException + */ + @SuppressWarnings("unchecked") + private T getValue( + MultivaluedMap queryParameters, + String parameterName, T defaultValue) throws MsgRegistryException { + String value = queryParameters.getFirst(parameterName); + try { + return (T) (isSpecified(value) ? ConstructorUtils + .invokeConstructor(defaultValue.getClass(), value) + : defaultValue); + } catch (Exception e) { + throw EbxmlExceptionUtil.createMsgRegistryException( + "Error constructing Query!", e); + } + + } + + private boolean isSpecified(String value) { + return !(value == null || value.isEmpty()); } public void setQueryManager(QueryManager queryManager) { this.queryManager = queryManager; } + public void setQueryDefinitionDao(QueryDefinitionDao queryDefinitionDao) { + this.queryDefinitionDao = queryDefinitionDao; + } + } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RegistryDataAccessService.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RegistryDataAccessService.java index fc22c8068f..3c5b4067b8 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RegistryDataAccessService.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/rest/RegistryDataAccessService.java @@ -25,6 +25,7 @@ import java.util.List; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; +import javax.xml.bind.JAXB; import javax.xml.bind.JAXBException; import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.LifecycleManager; @@ -34,6 +35,7 @@ import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.RemoveObjectsRequest; import oasis.names.tc.ebxml.regrep.xsd.lcm.v4.SubmitObjectsRequest; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectRefListType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectRefType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ParameterType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectListType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SubscriptionType; @@ -43,10 +45,11 @@ import org.springframework.transaction.annotation.Transactional; import com.raytheon.uf.common.registry.RegistryException; import com.raytheon.uf.common.registry.services.rest.IRegistryDataAccessService; import com.raytheon.uf.common.registry.services.rest.response.RestCollectionResponse; -import com.raytheon.uf.common.serialization.JAXBManager; 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.registry.ebxml.dao.QueryDefinitionDao; import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; /** @@ -62,6 +65,7 @@ import com.raytheon.uf.edex.registry.ebxml.dao.RegistryObjectDao; * 7/29/2013 2191 bphillip Initial implementation * 9/20/2013 2385 bphillip Added subscription backup functions * 10/2/2013 2385 bphillip Fixed subscription backup queries + * 10/8/2013 1682 bphillip Added query queries * * * @author bphillip @@ -90,6 +94,9 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { /** Data access object for registry objects */ private RegistryObjectDao registryObjectDao; + /** Data access object for query definitions */ + private QueryDefinitionDao queryDefinitionDao; + /** Lifecyclemanager */ private LifecycleManager lcm; @@ -100,7 +107,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { */ @Override @GET - @Path("/rest/dataAccess/getRegistryObjectIds/{objectType}") + @Path(DATA_ACCESS_PATH_PREFIX + "getRegistryObjectIds/{objectType}") public RestCollectionResponse getRegistryObjectIdsOfType( @PathParam("objectType") String objectType) { statusHandler.info("Getting registry object ids of type [" + objectType @@ -111,6 +118,36 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { return response; } + @Override + @GET + @Path(DATA_ACCESS_PATH_PREFIX + "getQueries") + public String getValidQueries() { + statusHandler.debug("Getting valid queries..."); + List ids = queryDefinitionDao.getQueryIds(); + StringBuilder builder = new StringBuilder(); + for (String id : ids) { + builder.append(id).append(StringUtil.NEWLINE); + } + return builder.toString(); + } + + @Override + @GET + @Path(DATA_ACCESS_PATH_PREFIX + "getParametersForQuery/{queryId}") + public String getParametersForQuery(@PathParam("queryId") String queryId) { + statusHandler.debug("Getting query parameters for query: " + queryId + + "..."); + List parameters = queryDefinitionDao + .getParametersForQuery(queryId); + StringBuilder retVal = new StringBuilder(); + for (ParameterType param : parameters) { + retVal.append(param.getParameterName()).append(StringUtil.NEWLINE); + retVal.append(param.getDataType()).append(StringUtil.NEWLINE); + retVal.append(param.getDefaultValue()).append(StringUtil.NEWLINE); + } + return retVal.toString(); + } + /** * @see * com.raytheon.uf.common.registry.services.rest.IRegistryDataAccessService @@ -118,7 +155,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { */ @Override @GET - @Path("/rest/dataAccess/removeSubscriptionsFor/{siteId}") + @Path(DATA_ACCESS_PATH_PREFIX + "removeSubscriptionsFor/{siteId}") public void removeSubscriptionsForSite(@PathParam("siteId") String siteId) { statusHandler.info("Removing subscriptions for: " + siteId); List subscriptions = registryObjectDao @@ -155,7 +192,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { */ @Override @GET - @Path("/rest/dataAccess/getSubscriptions") + @Path(DATA_ACCESS_PATH_PREFIX + "getSubscriptions") public String getSubscriptions() { String[] slotNames = new String[] { "name", "owner", "dataSetName", "provider", "dataSetType", "route", "active", "groupName", @@ -195,7 +232,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { */ @Override @GET - @Path("/rest/dataAccess/backupSubscription/{subscriptionName}") + @Path(DATA_ACCESS_PATH_PREFIX + "backupSubscription/{subscriptionName}") public String backupSubscription( @PathParam("subscriptionName") String subscriptionName) throws JAXBException { @@ -211,7 +248,6 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { if (!SUBSCRIPTION_BACKUP_DIR.exists()) { SUBSCRIPTION_BACKUP_DIR.mkdirs(); } - JAXBManager jaxb = new JAXBManager(SubmitObjectsRequest.class); String subId = sub.getId(); File backupFile = new File(SUBSCRIPTION_BACKUP_DIR.getPath() + File.separator + subId); @@ -225,15 +261,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { .setRegistryObjectList(new RegistryObjectListType()); submitObjectsRequest.getRegistryObjects().add(sub); - try { - jaxb.getJaxbContext().createMarshaller() - .marshal(submitObjectsRequest, backupFile); - } catch (JAXBException e) { - statusHandler.error("Error backing up subscription [" + subId - + "]", e); - response.append("Error backing up subscription [") - .append(subId).append("]
"); - } + JAXB.marshal(submitObjectsRequest, backupFile); response.append("Subscription [").append(subId) .append("] successfully backed up to [") .append(backupFile.getPath()).append("]
"); @@ -248,7 +276,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { */ @Override @GET - @Path("/rest/dataAccess/backupAllSubscriptions/") + @Path(DATA_ACCESS_PATH_PREFIX + "backupAllSubscriptions/") public String backupAllSubscriptions() throws JAXBException { StringBuilder response = new StringBuilder(); List subs = registryObjectDao @@ -270,7 +298,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { */ @Override @GET - @Path("/rest/dataAccess/restoreSubscription/{subscriptionName}") + @Path(DATA_ACCESS_PATH_PREFIX + "restoreSubscription/{subscriptionName}") public String restoreSubscription( @PathParam("subscriptionName") String subscriptionName) throws JAXBException { @@ -278,10 +306,8 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { File subscriptionFile = new File(SUBSCRIPTION_BACKUP_DIR + File.separator + subscriptionName); if (subscriptionFile.exists()) { - JAXBManager jaxb = new JAXBManager(SubmitObjectsRequest.class); - SubmitObjectsRequest submitRequest = (SubmitObjectsRequest) jaxb - .getJaxbContext().createUnmarshaller() - .unmarshal(subscriptionFile); + SubmitObjectsRequest submitRequest = JAXB.unmarshal( + subscriptionFile, SubmitObjectsRequest.class); try { lcm.submitObjects(submitRequest); } catch (MsgRegistryException e) { @@ -310,7 +336,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { */ @Override @GET - @Path("/rest/dataAccess/restoreSubscriptions/") + @Path(DATA_ACCESS_PATH_PREFIX + "restoreSubscriptions/") public String restoreSubscriptions() { StringBuilder response = new StringBuilder(); if (SUBSCRIPTION_BACKUP_DIR.exists()) { @@ -345,7 +371,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { * .clearSubscriptionBackupFiles() */ @GET - @Path("/rest/dataAccess/clearSubscriptionBackupFiles/") + @Path(DATA_ACCESS_PATH_PREFIX + "clearSubscriptionBackupFiles/") public String clearSubscriptionBackupFiles() { StringBuilder response = new StringBuilder(); if (SUBSCRIPTION_BACKUP_DIR.exists()) { @@ -376,4 +402,7 @@ public class RegistryDataAccessService implements IRegistryDataAccessService { this.lcm = lcm; } + public void setQueryDefinitionDao(QueryDefinitionDao queryDefinitionDao) { + this.queryDefinitionDao = queryDefinitionDao; + } } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/validator/ValidatorImplWrapper.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/validator/ValidatorImplWrapper.java index e7ed316f23..e19246e0ce 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/validator/ValidatorImplWrapper.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/services/validator/ValidatorImplWrapper.java @@ -30,6 +30,8 @@ import oasis.names.tc.ebxml.regrep.xsd.spi.v4.ValidateObjectsResponse; import org.springframework.transaction.annotation.Transactional; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** * * Wrapper for the validator service to be used with the SOAP interface. @@ -60,10 +62,10 @@ public class ValidatorImplWrapper implements Validator { } @Override - @WebMethod(action = "urn:oasis:names:tc:ebxml-regrep:wsdl:spi:bindings:4.0:Validator#validateObjects") - @WebResult(name = "ValidateObjectsResponse", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:spi:4.0", partName = "partValidateObjectsResponse") + @WebMethod(action = VALIDATE_OBJECTS_ACTION) + @WebResult(name = "ValidateObjectsResponse", targetNamespace = EbxmlNamespaces.SPI_URI, partName = "partValidateObjectsResponse") public ValidateObjectsResponse validateObjects( - @WebParam(name = "ValidateObjectsRequest", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:xsd:spi:4.0", partName = "partValidateObjectsRequest") ValidateObjectsRequest partValidateObjectsRequest) + @WebParam(name = "ValidateObjectsRequest", targetNamespace = EbxmlNamespaces.SPI_URI, partName = "partValidateObjectsRequest") ValidateObjectsRequest partValidateObjectsRequest) throws MsgRegistryException { return validator.validateObjects(partValidateObjectsRequest); } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/util/EbxmlExceptionUtil.java b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/util/EbxmlExceptionUtil.java index bbf629fe9f..67d470cfb2 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/util/EbxmlExceptionUtil.java +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/src/com/raytheon/uf/edex/registry/ebxml/util/EbxmlExceptionUtil.java @@ -54,6 +54,7 @@ import com.raytheon.uf.common.status.UFStatus; * Jan 19, 2012 184 bphillip Initial creation * Apr 23, 2013 1910 djohnson Add createUnresolvedReferenceException(). * 8/1/2013 1693 bphillip Added methods to create exceptions + * 10/20/2013 1682 bphillip createMsgRegistryException changed to accept throwable * * * @@ -102,7 +103,7 @@ public class EbxmlExceptionUtil { * @return The MsgRegistryException */ public static MsgRegistryException createMsgRegistryException( - String message, String detail, Exception exception) { + String message, String detail, Throwable exception) { StringBuilder builder = new StringBuilder(); if (detail == null || detail.isEmpty()) { builder.append("Exception Encountered"); @@ -144,7 +145,7 @@ public class EbxmlExceptionUtil { * @return The MsgRegistryException */ public static MsgRegistryException createMsgRegistryException( - String message, Exception exception) { + String message, Throwable exception) { return createMsgRegistryException(message, null, exception); } diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/utility/edex_static/base/ebxml/minDB/SubmitObjectsRequest_Queries.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/utility/edex_static/base/ebxml/minDB/SubmitObjectsRequest_Queries.xml index 51840690c6..2bc27071a5 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/utility/edex_static/base/ebxml/minDB/SubmitObjectsRequest_Queries.xml +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/utility/edex_static/base/ebxml/minDB/SubmitObjectsRequest_Queries.xml @@ -172,35 +172,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -271,18 +242,6 @@ - - - - - - - - - - @@ -373,84 +332,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - urn:oasis:names:tc:ebxml-regrep:classificationScheme:StatusType - - - - - - - - - - - - - urn:oasis:names:tc:ebxml-regrep:classificationScheme:ObjectType - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/utility/edex_static/base/ebxml/minDB/SubmitObjectsRequest_QueryLangScheme.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/utility/edex_static/base/ebxml/minDB/SubmitObjectsRequest_QueryLangScheme.xml index 3dc9d28b98..7ad1cf7e55 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/utility/edex_static/base/ebxml/minDB/SubmitObjectsRequest_QueryLangScheme.xml +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/utility/edex_static/base/ebxml/minDB/SubmitObjectsRequest_QueryLangScheme.xml @@ -1,5 +1,4 @@ - @@ -9,31 +8,16 @@ - + - - - - - - - - - - - - - - - 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 7c7677d1c0..9c6bb8c14d 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/RegistrySubscriptionBackup.html +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/RegistrySubscriptionBackup.html @@ -21,7 +21,7 @@ -

BACKUP/RESTORE DATA DELIVERY SUBSCRIPTIONS

+

Backup/Restore Data Delivery Subscriptions

" + } + gen+="
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 3c1df590b9..8d6af6a551 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 @@ -76,6 +76,6 @@ - RegistryUserMenu.html + registry/RegistryInterface.html 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 new file mode 100644 index 0000000000..e5774bfc69 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/RegistryInterface.html @@ -0,0 +1,64 @@ + + + + + + + + + + + + EDEX EBXML Registry Interface + + + + + + + + + \ 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 new file mode 100644 index 0000000000..6037bbe008 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/navigation.html @@ -0,0 +1,62 @@ + + + + + + + + + + + NAVIGATION LINKS + + + + Query Interface +
+ Subscription Backup + + + + diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/services/query/Query.html b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/services/query/Query.html new file mode 100644 index 0000000000..849e4622f2 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/services/query/Query.html @@ -0,0 +1,60 @@ + + + + + + + + + + EDEX EBXML Registry Query Interface + + + + + + + + + diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/services/query/QueryInterface.html b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/services/query/QueryInterface.html new file mode 100644 index 0000000000..a5a4c33b5f --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/services/query/QueryInterface.html @@ -0,0 +1,156 @@ + + + + + + + + + + + Registry Query Interface + + + + +

Query Manager Interface

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Return Request + +
Response Option + +
Depth + +
Federated + +
Federation + +
Format + +
Language + +
Match Older Versions + +
Max Results + +
Start Index + +
+ + + + + + +
Query Type +
+ +
+ + + + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/services/query/queryUtil.js b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/services/query/queryUtil.js new file mode 100644 index 0000000000..890456d2b3 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/web/registry/services/query/queryUtil.js @@ -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. + **/ + +/** + * + * Utility methods for registry query web interface + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ + function getValidQueryTypes(){ + var tokens = callDataAccessService("getQueries","").split("\n") + var selectBox = document.getElementById("queryTypeInput") + for(var i=0;i

"; + if (paramType=="boolean"){ + if(paramDefault == "false"){ + gen+="" + }else if (paramDefault == "true"){ + gen+="" + }else{ + gen+="" + } + }else{ + + if(paramDefault=="null"){ + gen+= "" + }else{ + gen+= "" + } + } + gen+="

" + document.getElementById("querySpecificSpan").innerHTML = gen + } + + function callRestService(url,arg){ + var url = "http://"+url+"/"+arg; + var client = new XMLHttpRequest(); + client.open("GET", url, false); + client.setRequestHeader("Content-Type", "text/plain"); + client.send(); + return client.responseText + } + + function callDataAccessService(func,arg){ + var url = "http://"+window.location.host+"/rest/dataAccess/"+func+"/"+arg; + var client = new XMLHttpRequest(); + client.open("GET", url, false); + client.setRequestHeader("Content-Type", "text/plain"); + client.send(); + return client.responseText + } \ No newline at end of file diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/dao/AbstractRegistryTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/dao/AbstractRegistryTest.java index 8150e83ea2..49023ced3f 100644 --- a/tests/integration/com/raytheon/uf/edex/registry/ebxml/dao/AbstractRegistryTest.java +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/dao/AbstractRegistryTest.java @@ -28,6 +28,7 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; import java.math.BigInteger; +import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -54,6 +55,7 @@ import org.junit.BeforeClass; import org.junit.Ignore; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.transaction.TransactionConfiguration; @@ -64,7 +66,6 @@ import com.raytheon.uf.common.registry.ebxml.RegistryUtil; import com.raytheon.uf.common.util.SpringFiles; import com.raytheon.uf.common.util.TestUtil; import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; -import com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImpl.RETURN_TYPE; import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; /** @@ -80,6 +81,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; * Apr 18, 2013 1693 djohnson Consolidate reusable methods. * Apr 23, 2013 1910 djohnson Allow sub-classes to pass callables and monitor for fault exceptions. * Jun 05, 2013 2038 djohnson Use TestUtil constant for transactionManager. + * 10/8/2013 1682 bphillip Added submitRegistryObjectsToRegistry * * * @@ -115,6 +117,7 @@ public class AbstractRegistryTest { protected LifecycleManager lifecycleManager; @Autowired + @Qualifier("queryServiceImpl") protected QueryManager queryManager; @BeforeClass @@ -147,6 +150,22 @@ public class AbstractRegistryTest { assertSuccessfulResponse(submitResponse); } + /** + * Submits objects to the registry + * + * @param registryObjects + * The registry objects to submit + * @throws MsgRegistryException + * If errors occur during submission + */ + protected void submitRegistryObjectsToRegistry( + final Collection registryObjects) + throws MsgRegistryException { + for (RegistryObjectType registryObject : registryObjects) { + submitRegistryObjectToRegistry(registryObject); + } + } + /** * Create the submit objects request. * @@ -185,7 +204,9 @@ public class AbstractRegistryTest { String registryObjectId) { final ResponseOptionType responseOption = EbxmlObjectUtil.queryObjectFactory .createResponseOptionType(); - responseOption.setReturnType(RETURN_TYPE.RegistryObject.toString()); + responseOption + .setReturnType(ResponseOptionType.RETURN_TYPE.RegistryObject + .toString()); responseOption.setReturnComposedObjects(false); final QueryType queryType = new QueryType(); diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/dao/PluginSubscribedListener.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/dao/PluginSubscribedListener.java index be50e5f072..8dda4f8e6f 100644 --- a/tests/integration/com/raytheon/uf/edex/registry/ebxml/dao/PluginSubscribedListener.java +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/dao/PluginSubscribedListener.java @@ -19,11 +19,19 @@ **/ package com.raytheon.uf.edex.registry.ebxml.dao; +import javax.jws.WebMethod; +import javax.jws.WebParam; +import javax.jws.WebResult; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.NotificationListener; import oasis.names.tc.ebxml.regrep.xsd.rim.v4.NotificationType; +import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType; import org.junit.Ignore; +import com.raytheon.uf.common.registry.EbxmlNamespaces; + /** * A plugin subscribed listener. * @@ -34,6 +42,7 @@ import org.junit.Ignore; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 17, 2013 1672 djohnson Initial creation + * 10/20/2013 1682 bphillip Added synchronous notification delivery * * * @@ -53,6 +62,16 @@ public class PluginSubscribedListener implements NotificationListener { this.notified = true; } + @Override + @WebMethod(action = "SynchronousNotification") + @WebResult(name = "RegistryResponse", targetNamespace = EbxmlNamespaces.RS_URI, partName = "partRegistryResponse") + public RegistryResponseType synchronousNotification( + @WebParam(name = "Notification", targetNamespace = EbxmlNamespaces.RIM_URI, partName = "Notification") NotificationType notification) + throws MsgRegistryException { + this.notified = true; + return null; + } + /** * Check whether the listener was notified. * diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/dao/RegistryNotificationManagerTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/dao/RegistryNotificationManagerTest.java index 42be89b183..9ced780cf2 100644 --- a/tests/integration/com/raytheon/uf/edex/registry/ebxml/dao/RegistryNotificationManagerTest.java +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/dao/RegistryNotificationManagerTest.java @@ -57,9 +57,9 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import com.raytheon.uf.common.event.EventBusTest; +import com.raytheon.uf.common.registry.EbxmlNamespaces; import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; import com.raytheon.uf.common.registry.constants.DeliveryMethodTypes; -import com.raytheon.uf.common.registry.constants.Namespaces; import com.raytheon.uf.common.registry.constants.NotificationOptionTypes; import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; import com.raytheon.uf.common.registry.ebxml.RegistryUtil; @@ -217,11 +217,11 @@ public class RegistryNotificationManagerTest extends AbstractRegistryTest { ref.writeTo(dom); Document doc = (Document) dom.getNode(); NodeList nodes = doc.getElementsByTagNameNS( - Namespaces.ADDRESSING_NAMESPACE, "Address"); + EbxmlNamespaces.ADDRESSING_URI, "Address"); for (int i = 0; i < nodes.getLength(); i++) { Node addressNode = nodes.item(i); Attr endpointTypeAttr = doc.createAttributeNS( - Namespaces.EBXML_RIM_NAMESPACE_URI, "endpointType"); + EbxmlNamespaces.RIM_URI, "endpointType"); endpointTypeAttr.setValue(deliveryMethod); addressNode.getAttributes().setNamedItemNS(endpointTypeAttr); } diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/QueryTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/QueryTest.java new file mode 100644 index 0000000000..826e096bbb --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/QueryTest.java @@ -0,0 +1,88 @@ +/** + * 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.registry.ebxml.services.query.types; + +import java.util.List; + +import javax.xml.datatype.XMLGregorianCalendar; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.QueryManager; +import oasis.names.tc.ebxml.regrep.xsd.query.v4.QueryRequest; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.BooleanValueType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.DateTimeValueType; +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.SlotType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType; + +import org.junit.Ignore; + +import com.raytheon.uf.edex.registry.ebxml.dao.AbstractRegistryTest; + +/** + * + * Base test template for testing canonical registry queries + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +@Ignore +public class QueryTest extends AbstractRegistryTest { + + protected QueryRequest createQuery(String queryType, Object... params) { + QueryType query = new QueryType(); + query.setQueryDefinition(queryType); + for (int i = 0; i < params.length; i += 2) { + if (params[i + 1] instanceof String) { + query.getSlot().add( + new SlotType((String) params[i], new StringValueType( + (String) params[i + 1]))); + } else if (params[i + 1] instanceof Boolean) { + query.getSlot().add( + new SlotType((String) params[i], new BooleanValueType( + (Boolean) params[i + 1]))); + } else if (params[i + 1] instanceof XMLGregorianCalendar) { + query.getSlot().add( + new SlotType((String) params[i], new DateTimeValueType( + (XMLGregorianCalendar) params[i + 1]))); + } + } + + QueryRequest request = new QueryRequest(); + request.setId("Query Request ID"); + request.setQuery(query); + return request; + } + + protected List executeQuery(QueryManager queryPlugin, + QueryRequest request) throws MsgRegistryException { + return queryPlugin.executeQuery(request).getRegistryObjects(); + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/AdhocQueryTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/AdhocQueryTest.java new file mode 100644 index 0000000000..8a8527c4e4 --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/AdhocQueryTest.java @@ -0,0 +1,111 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.util.List; + +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.rim.v4.RegistryObjectType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.registry.constants.QueryLanguages; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.AdhocQuery; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical AdhocQuery defined by the EBXML 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class AdhocQueryTest extends QueryTest { + + /** The adhoc query object */ + @Autowired + private AdhocQuery adhocQuery; + + @Before + public void insertTestObjects() throws MsgRegistryException { + for (int i = 0; i < 11; i++) { + RegistryObjectType obj = new RegistryObjectType("Test Object " + i, + ""); + submitRegistryObjectToRegistry(obj); + } + } + + @Test + public void adhocQueryWithNoParameters() throws MsgRegistryException { + QueryRequest request = createQuery(CanonicalQueryTypes.ADHOC_QUERY, + QueryConstants.QUERY_LANGUAGE, QueryLanguages.HQL, + QueryConstants.QUERY_EXPRESSION, + "SELECT obj FROM RegistryObjectType obj WHERE obj.id like 'Test Object %'"); + List result = executeQuery(adhocQuery, request); + assertTrue(result.size() == 11); + } + + @Test + public void adhocQueryWithParameters() throws MsgRegistryException { + QueryRequest request = createQuery(CanonicalQueryTypes.ADHOC_QUERY, + QueryConstants.QUERY_LANGUAGE, QueryLanguages.HQL, + QueryConstants.QUERY_EXPRESSION, + "SELECT obj FROM RegistryObjectType obj WHERE obj.id like :id", + "id", "Test Object 5"); + List result = executeQuery(adhocQuery, request); + assertTrue(result.size() == 1); + } + + @Test + public void adhocQueryWithUnsupportedQueryLanguage() { + QueryRequest request = createQuery(CanonicalQueryTypes.ADHOC_QUERY, + QueryConstants.QUERY_LANGUAGE, "Unsupported Language", + QueryConstants.QUERY_EXPRESSION, + "SELECT obj FROM RegistryObjectType obj WHERE obj.id like 'Test Object %'"); + try { + executeQuery(adhocQuery, request); + } catch (MsgRegistryException e) { + assertTrue(e + .getMessage() + .startsWith( + "AdhocQuery does not support the following query language:")); + return; + } + fail(); + } + +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/BasicQueryTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/BasicQueryTest.java new file mode 100644 index 0000000000..61ccb9baad --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/BasicQueryTest.java @@ -0,0 +1,186 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.List; + +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.rim.v4.ClassificationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.InternationalStringType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.registry.constants.NodeTypes; +import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; +import com.raytheon.uf.common.registry.constants.StatusTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.BasicQuery; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical BasicQuery defined by the EBXML 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class BasicQueryTest extends QueryTest { + + private static final String TEST_ID = "Basic Query Test Object "; + + private static final String TEST_OBJECT_TYPE = RegistryObjectTypes.REGISTRY_OBJECT; + + private static final String TEST_OWNER = TEST_ID + " Owner"; + + private static final String TEST_STATUS = StatusTypes.REJECTED; + + @Autowired + private BasicQuery basicQuery; + + @Before + public void insertTestObjects() throws MsgRegistryException { + + ClassificationType testClassification1 = new ClassificationType(); + testClassification1.setId("Test Classification"); + testClassification1.setLid("Test Classification"); + testClassification1.setObjectType(RegistryObjectTypes.CLASSIFICATION); + testClassification1.setClassificationNode(TEST_OBJECT_TYPE); + + ClassificationType testClassification2 = new ClassificationType(); + testClassification2.setId("Test Classification 2"); + testClassification2.setLid("Test Classification 2"); + testClassification2.setObjectType(RegistryObjectTypes.CLASSIFICATION); + testClassification2.setClassificationNode(NodeTypes.UNIQUE_CODE); + + for (int i = 1; i <= 12; i++) { + RegistryObjectType obj = new RegistryObjectType(TEST_ID + i, + TEST_ID + i); + obj.setDescription(new InternationalStringType(TEST_ID + + " Description " + i)); + obj.setName(new InternationalStringType(TEST_ID + " Name " + i)); + obj.setObjectType(TEST_OBJECT_TYPE); + obj.setStatus(TEST_STATUS); + obj.setOwner(TEST_OWNER); + if (i % 2 == 0) { + obj.getClassification().add(testClassification1); + } + if (i % 3 == 0) { + obj.getClassification().add(testClassification2); + } + + submitRegistryObjectToRegistry(obj); + } + } + + @Test + public void queryOnDescription() throws MsgRegistryException { + QueryRequest query = createQuery(CanonicalQueryTypes.BASIC_QUERY, + "description", TEST_ID + " Description 1"); + List result = executeQuery(basicQuery, query); + assertTrue(result.size() == 1); + + } + + @Test + public void queryOnName() throws MsgRegistryException { + QueryRequest query = createQuery(CanonicalQueryTypes.BASIC_QUERY, + "name", TEST_ID + " Name 1"); + List result = executeQuery(basicQuery, query); + assertTrue(result.size() == 1); + } + + @Test + public void queryOnObjectType() throws MsgRegistryException { + QueryRequest query = createQuery( + CanonicalQueryTypes.BASIC_QUERY, + "objectType", + "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:ObjectType/RegistryObject"); + List result = executeQuery(basicQuery, query); + assertTrue(result.size() == 12); + } + + @Test + public void queryOnOwner() throws MsgRegistryException { + QueryRequest query = createQuery(CanonicalQueryTypes.BASIC_QUERY, + "owner", TEST_OWNER); + List result = executeQuery(basicQuery, query); + assertTrue(result.size() == 12); + } + + @Test + public void queryOnStatus() throws MsgRegistryException { + QueryRequest query = createQuery(CanonicalQueryTypes.BASIC_QUERY, + "status", "/Rejected"); + List result = executeQuery(basicQuery, query); + assertTrue(result.size() == 12); + } + + @Test + public void queryOnClassification() throws MsgRegistryException { + QueryRequest query = createQuery(CanonicalQueryTypes.BASIC_QUERY, + QueryConstants.CLASSIFICATIONS, + "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:NodeType/UniqueCode"); + List result = executeQuery(basicQuery, query); + assertTrue(result.size() == 4); + + QueryRequest query2 = createQuery( + CanonicalQueryTypes.BASIC_QUERY, + QueryConstants.CLASSIFICATIONS, + "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:NodeType/UniqueCode", + QueryConstants.CLASSIFICATIONS, + "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:ObjectType/RegistryObject"); + List result2 = executeQuery(basicQuery, query2); + assertEquals(2, result2.size()); + } + + @Test + public void queryUsingMatchOnAny() throws MsgRegistryException { + QueryRequest query = createQuery(CanonicalQueryTypes.BASIC_QUERY, + QueryConstants.DESCRIPTION, TEST_ID + " Description 1", + QueryConstants.NAME, TEST_ID + " Name 1", + QueryConstants.MATCH_ANY, false); + List result = executeQuery(basicQuery, query); + assertTrue(result.size() == 1); + + QueryRequest query2 = createQuery(CanonicalQueryTypes.BASIC_QUERY, + QueryConstants.DESCRIPTION, TEST_ID + " Description 1", + QueryConstants.NAME, TEST_ID + " Name 2", + QueryConstants.MATCH_ANY, true); + List result2 = executeQuery(basicQuery, query2); + assertTrue(result2.size() == 2); + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/ClassificationSchemeSelectorTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/ClassificationSchemeSelectorTest.java new file mode 100644 index 0000000000..92def0a6e2 --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/ClassificationSchemeSelectorTest.java @@ -0,0 +1,80 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertTrue; + +import java.util.List; + +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.rim.v4.ClassificationNodeType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ClassificationSchemeType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.ClassificationSchemeSelector; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical ClassiciationSchemeSelector query defined by the EBXML + * 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class ClassificationSchemeSelectorTest extends QueryTest { + + @Autowired + private ClassificationSchemeSelector selector; + + @Test + public void testQuery() throws MsgRegistryException { + QueryRequest request = createQuery( + CanonicalQueryTypes.CLASSIFICATION_SCHEME_SELECTOR, + QueryConstants.CLASSIFICATION_SCHEME_ID, + "urn:oasis:names:tc:ebxml-regrep:classificationScheme:ActionType"); + List result = executeQuery(selector, request); + + assertTrue(result.get(0) instanceof ClassificationSchemeType); + ClassificationSchemeType scheme = (ClassificationSchemeType) result + .get(0); + assertTrue(scheme.getClassificationNode().isEmpty()); + + for (int i = 1; i < result.size(); i++) { + assertTrue(result.get(i) instanceof ClassificationNodeType); + } + } + +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAssociatedObjectsTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAssociatedObjectsTest.java new file mode 100644 index 0000000000..f72b065b56 --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAssociatedObjectsTest.java @@ -0,0 +1,153 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; + +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.rim.v4.AssociationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.AssociationTypes; +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.FindAssociatedObjects; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical FindAssociatedObjects query defined by the EBXML 4.0 + * spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class FindAssociatedObjectsTest extends QueryTest { + + @Autowired + private FindAssociatedObjects findAssociatedObjects; + + private static final String REGISTRY_OBJECT_TYPE_1 = "urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject"; + + private static final String REGISTRY_OBJECT_TYPE_2 = "urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Service"; + + @Before + public void insertTestObjects() throws MsgRegistryException { + + List objsToSubmit = new ArrayList(); + for (int i = 0; i < 5; i++) { + RegistryObjectType obj = new RegistryObjectType("Source Object " + + i, "Source Object " + i); + + obj.setObjectType(REGISTRY_OBJECT_TYPE_1); + objsToSubmit.add(obj); + } + + for (int i = 1; i < 6; i++) { + RegistryObjectType obj = new RegistryObjectType("Target Object " + + i, "Target Object " + i); + obj.setObjectType(REGISTRY_OBJECT_TYPE_2); + objsToSubmit.add(obj); + } + + for (int i = 0; i < 5; i++) { + AssociationType association = new AssociationType(); + association.setId("Affiliated With Association " + i); + association.setLid(association.getId()); + association.setObjectType(RegistryObjectTypes.ASSOCIATION); + association.setType(AssociationTypes.AFFILIATED_WITH); + association.setSourceObject("Source Object " + i); + association.setTargetObject("Target Object " + (i + 1)); + objsToSubmit.add(association); + } + + for (int i = 0; i < 5; i++) { + AssociationType association = new AssociationType(); + association.setId("Described By Association " + i); + association.setLid(association.getId()); + association.setObjectType(RegistryObjectTypes.ASSOCIATION); + association.setType(AssociationTypes.DESCRIBED_BY); + association.setSourceObject("Source Object " + i); + association.setTargetObject("Target Object " + (i + 1)); + objsToSubmit.add(association); + } + submitRegistryObjectsToRegistry(objsToSubmit); + } + + @Test + public void getAssociatedTargetObjects() throws MsgRegistryException { + QueryRequest query = createQuery( + CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.ASSOCIATION_TYPE, + "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:AssociationType/AffiliatedWith", + QueryConstants.SOURCE_OBJECT_ID, "Source Object 0"); + List result = executeQuery(findAssociatedObjects, + query); + assertEquals(1, result.size()); + assertEquals("Target Object 1", result.get(0).getId()); + + query = createQuery( + CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.ASSOCIATION_TYPE, + "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:AssociationType/AffiliatedWith", + QueryConstants.SOURCE_OBJECT_ID, "Source Object ?"); + result = executeQuery(findAssociatedObjects, query); + assertEquals(5, result.size()); + } + + @Test + public void getAssociatedSourceObjects() throws MsgRegistryException { + QueryRequest query = createQuery( + CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.ASSOCIATION_TYPE, + "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:AssociationType/AffiliatedWith", + QueryConstants.TARGET_OBJECT_ID, "Target Object 1"); + List result = executeQuery(findAssociatedObjects, + query); + assertEquals(1, result.size()); + assertEquals("Source Object 0", result.get(0).getId()); + + query = createQuery( + CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.ASSOCIATION_TYPE, + "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:AssociationType/AffiliatedWith", + QueryConstants.TARGET_OBJECT_ID, "Target Object ?"); + result = executeQuery(findAssociatedObjects, query); + assertEquals(5, result.size()); + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAssociationsTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAssociationsTest.java new file mode 100644 index 0000000000..70ad06ac94 --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/FindAssociationsTest.java @@ -0,0 +1,201 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; + +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.rim.v4.AssociationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.AssociationTypes; +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.FindAssociations; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical FindAssociations query defined by the EBXML 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class FindAssociationsTest extends QueryTest { + + private static final String REGISTRY_OBJECT_TYPE_1 = "urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject"; + + private static final String REGISTRY_OBJECT_TYPE_1_PATH = "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:ObjectType/RegistryObject"; + + private static final String REGISTRY_OBJECT_TYPE_2 = "urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:Service"; + + private static final String REGISTRY_OBJECT_TYPE_2_PATH = "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:ObjectType/RegistryObject/Service"; + + @Autowired + private FindAssociations findAssociations; + + @Before + public void insertTestObjects() throws MsgRegistryException { + + List objsToSubmit = new ArrayList(); + for (int i = 0; i < 5; i++) { + RegistryObjectType obj = new RegistryObjectType("Source Object " + + i, "Source Object " + i); + if (i % 2 == 0) { + obj.setObjectType(REGISTRY_OBJECT_TYPE_1); + } else { + obj.setObjectType(REGISTRY_OBJECT_TYPE_2); + } + objsToSubmit.add(obj); + } + + for (int i = 0; i < 5; i++) { + RegistryObjectType obj = new RegistryObjectType("Target Object " + + i, "Target Object " + i); + if (i % 2 != 0) { + obj.setObjectType(REGISTRY_OBJECT_TYPE_1); + } else { + obj.setObjectType(REGISTRY_OBJECT_TYPE_2); + } + objsToSubmit.add(obj); + } + + for (int i = 0; i < 5; i++) { + AssociationType association = new AssociationType(); + association.setId("Affiliated With Association " + i); + association.setLid(association.getId()); + association.setObjectType(RegistryObjectTypes.ASSOCIATION); + association.setType(AssociationTypes.AFFILIATED_WITH); + association.setSourceObject("Source Object " + i); + association.setTargetObject("Target Object " + i); + objsToSubmit.add(association); + } + + for (int i = 0; i < 5; i++) { + AssociationType association = new AssociationType(); + association.setId("Described By Association " + i); + association.setLid(association.getId()); + association.setObjectType(RegistryObjectTypes.ASSOCIATION); + association.setType(AssociationTypes.DESCRIBED_BY); + association.setSourceObject("Source Object " + i); + association.setTargetObject("Target Object " + i); + objsToSubmit.add(association); + } + submitRegistryObjectsToRegistry(objsToSubmit); + } + + @Test + public void getAssociationsByAssociationType() throws MsgRegistryException { + QueryRequest query = createQuery( + CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.ASSOCIATION_TYPE, + "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:AssociationType/AffiliatedWith"); + List result = executeQuery(findAssociations, query); + assertEquals(5, result.size()); + + query = createQuery( + CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.ASSOCIATION_TYPE, + "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:AssociationType/DescribedBy"); + result = executeQuery(findAssociations, query); + assertEquals(5, result.size()); + } + + @Test + public void getAssociationsBySourceObjectId() throws MsgRegistryException { + QueryRequest query = createQuery(CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.SOURCE_OBJECT_ID, "Source Object 1"); + List result = executeQuery(findAssociations, query); + assertEquals(2, result.size()); + + query = createQuery( + CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.SOURCE_OBJECT_ID, + "Source Object 1", + QueryConstants.ASSOCIATION_TYPE, + "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:AssociationType/AffiliatedWith"); + result = executeQuery(findAssociations, query); + assertEquals(1, result.size()); + + } + + @Test + public void getAssociationsBySourceObjectType() throws MsgRegistryException { + QueryRequest query = createQuery(CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.SOURCE_OBJECT_TYPE, REGISTRY_OBJECT_TYPE_1_PATH); + List result = executeQuery(findAssociations, query); + assertEquals(6, result.size()); + + query = createQuery(CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.SOURCE_OBJECT_TYPE, REGISTRY_OBJECT_TYPE_2_PATH); + result = executeQuery(findAssociations, query); + assertEquals(4, result.size()); + } + + @Test + public void getAssociationsByTargetObjectId() throws MsgRegistryException { + QueryRequest query = createQuery(CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.TARGET_OBJECT_ID, "Target Object 1"); + List result = executeQuery(findAssociations, query); + assertEquals(2, result.size()); + + query = createQuery( + CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.TARGET_OBJECT_ID, + "Target Object 1", + QueryConstants.ASSOCIATION_TYPE, + "/urn:oasis:names:tc:ebxml-regrep:classificationScheme:AssociationType/AffiliatedWith"); + result = executeQuery(findAssociations, query); + assertEquals(1, result.size()); + } + + @Test + public void getAssociationsByTargetObjectType() throws MsgRegistryException { + + QueryRequest query = createQuery(CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.TARGET_OBJECT_TYPE, REGISTRY_OBJECT_TYPE_2_PATH); + List result = executeQuery(findAssociations, query); + assertEquals(6, result.size()); + + query = createQuery(CanonicalQueryTypes.FIND_ASSOCIATIONS, + QueryConstants.TARGET_OBJECT_TYPE, REGISTRY_OBJECT_TYPE_1_PATH); + result = executeQuery(findAssociations, query); + assertEquals(4, result.size()); + + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GarbageCollectorTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GarbageCollectorTest.java new file mode 100644 index 0000000000..9dad18c550 --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GarbageCollectorTest.java @@ -0,0 +1,101 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; + +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.rim.v4.AssociationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.AssociationTypes; +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.GarbageCollectorQueryPlugin; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical GarbageCollector query defined by the EBXML 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class GarbageCollectorTest extends QueryTest { + + @Autowired + private GarbageCollectorQueryPlugin garbageCollector; + + @Before + public void insertTestObjects() throws MsgRegistryException { + + List objsToSubmit = new ArrayList(); + for (int i = 0; i < 5; i++) { + RegistryObjectType obj = new RegistryObjectType("Source Object " + + i, "Source Object " + i); + objsToSubmit.add(obj); + } + + for (int i = 1; i < 4; i++) { + RegistryObjectType obj = new RegistryObjectType("Target Object " + + i, "Target Object " + i); + objsToSubmit.add(obj); + } + + for (int i = 0; i < 5; i++) { + AssociationType association = new AssociationType(); + association.setId("Affiliated With Association " + i); + association.setLid(association.getId()); + association.setObjectType(RegistryObjectTypes.ASSOCIATION); + association.setType(AssociationTypes.AFFILIATED_WITH); + association.setSourceObject("Source Object " + i); + association.setTargetObject("Target Object " + (i + 1)); + objsToSubmit.add(association); + } + submitRegistryObjectsToRegistry(objsToSubmit); + } + + @Test + public void testGarbageCollect() throws MsgRegistryException { + + QueryRequest query = createQuery(CanonicalQueryTypes.GARBAGE_COLLECTOR); + + List result = executeQuery(garbageCollector, query); + assertEquals(2, result.size()); + + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByIdTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByIdTest.java new file mode 100644 index 0000000000..3f11cb851d --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByIdTest.java @@ -0,0 +1,166 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.datatype.XMLGregorianCalendar; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.time.util.TimeUtil; +import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.GetAuditTrailById; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; + +/** + * + * Test for the Canonical GetAuditTrailById query defined by the EBXML 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class GetAuditTrailByIdTest extends QueryTest { + + @Autowired + private GetAuditTrailById getAuditTrail; + + @Before + public void insertTestObjects() throws MsgRegistryException { + + List objsToSubmit = new ArrayList(); + for (int i = 0; i < 5; i++) { + RegistryObjectType obj = new RegistryObjectType("Test Object " + i, + "Source Object " + i); + objsToSubmit.add(obj); + } + submitRegistryObjectsToRegistry(objsToSubmit); + } + + @Test + public void getById() throws MsgRegistryException { + + List result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_ID, + QueryConstants.ID, "Test Object 1")); + assertEquals(1, result.size()); + + } + + @Test + public void getByIdAndStartTime() throws MsgRegistryException, + EbxmlRegistryException { + + XMLGregorianCalendar currentTime = EbxmlObjectUtil + .getCurrentTimeAsXMLGregorianCalendar(); + XMLGregorianCalendar fiveMinsAgo = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(TimeUtil.currentTimeMillis() - 5 + * TimeUtil.MILLIS_PER_MINUTE); + List result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_ID, + QueryConstants.ID, "Test Object 1", + QueryConstants.START_TIME, currentTime)); + assertEquals(0, result.size()); + + result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_ID, + QueryConstants.ID, "Test Object 1", + QueryConstants.START_TIME, fiveMinsAgo)); + assertEquals(1, result.size()); + } + + @Test + public void getByIdAndEndTime() throws MsgRegistryException, + EbxmlRegistryException { + XMLGregorianCalendar currentTime = EbxmlObjectUtil + .getCurrentTimeAsXMLGregorianCalendar(); + XMLGregorianCalendar fiveMinsAgo = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(TimeUtil.currentTimeMillis() - 5 + * TimeUtil.MILLIS_PER_MINUTE); + List result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_ID, + QueryConstants.ID, "Test Object 1", + QueryConstants.END_TIME, currentTime)); + assertEquals(1, result.size()); + + result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_ID, + QueryConstants.ID, "Test Object 1", + QueryConstants.END_TIME, fiveMinsAgo)); + assertEquals(0, result.size()); + } + + @Test + public void getByIdAndStartEndTime() throws MsgRegistryException, + EbxmlRegistryException { + XMLGregorianCalendar fiveMinsFromNow = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(TimeUtil.currentTimeMillis() + 5 + * TimeUtil.MILLIS_PER_MINUTE); + XMLGregorianCalendar fiveMinsAgo = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(TimeUtil.currentTimeMillis() - 5 + * TimeUtil.MILLIS_PER_MINUTE); + XMLGregorianCalendar tenMinsAgo = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(TimeUtil.currentTimeMillis() - 5 + * TimeUtil.MILLIS_PER_MINUTE); + + List result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_ID, + QueryConstants.ID, "Test Object 1", + QueryConstants.START_TIME, fiveMinsAgo, + QueryConstants.END_TIME, fiveMinsFromNow)); + assertEquals(1, result.size()); + + result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_ID, + QueryConstants.ID, "Test Object 1", + QueryConstants.START_TIME, tenMinsAgo, + QueryConstants.END_TIME, fiveMinsAgo)); + assertEquals(0, result.size()); + + } + +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByLidTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByLidTest.java new file mode 100644 index 0000000000..5708a7912a --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByLidTest.java @@ -0,0 +1,166 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.datatype.XMLGregorianCalendar; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.time.util.TimeUtil; +import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.GetAuditTrailByLid; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; + +/** + * + * Test for the Canonical GetAuditTrailByLid query defined by the EBXML 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class GetAuditTrailByLidTest extends QueryTest { + + @Autowired + private GetAuditTrailByLid getAuditTrail; + + @Before + public void insertTestObjects() throws MsgRegistryException { + + List objsToSubmit = new ArrayList(); + for (int i = 0; i < 5; i++) { + RegistryObjectType obj = new RegistryObjectType("Test Object " + i, + "Test Object " + i); + objsToSubmit.add(obj); + } + submitRegistryObjectsToRegistry(objsToSubmit); + } + + @Test + public void getByLid() throws MsgRegistryException { + + List result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_LID, + QueryConstants.LID, "Test Object 1")); + assertEquals(1, result.size()); + + } + + @Test + public void getByLidAndStartTime() throws MsgRegistryException, + EbxmlRegistryException { + + XMLGregorianCalendar currentTime = EbxmlObjectUtil + .getCurrentTimeAsXMLGregorianCalendar(); + XMLGregorianCalendar fiveMinsAgo = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(TimeUtil.currentTimeMillis() - 5 + * TimeUtil.MILLIS_PER_MINUTE); + List result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_LID, + QueryConstants.LID, "Test Object 1", + QueryConstants.START_TIME, currentTime)); + assertEquals(0, result.size()); + + result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_LID, + QueryConstants.LID, "Test Object 1", + QueryConstants.START_TIME, fiveMinsAgo)); + assertEquals(1, result.size()); + } + + @Test + public void getByLidAndEndTime() throws MsgRegistryException, + EbxmlRegistryException { + XMLGregorianCalendar currentTime = EbxmlObjectUtil + .getCurrentTimeAsXMLGregorianCalendar(); + XMLGregorianCalendar fiveMinsAgo = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(TimeUtil.currentTimeMillis() - 5 + * TimeUtil.MILLIS_PER_MINUTE); + List result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_LID, + QueryConstants.LID, "Test Object 1", + QueryConstants.END_TIME, currentTime)); + assertEquals(1, result.size()); + + result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_LID, + QueryConstants.LID, "Test Object 1", + QueryConstants.END_TIME, fiveMinsAgo)); + assertEquals(0, result.size()); + } + + @Test + public void getByLidAndStartEndTime() throws MsgRegistryException, + EbxmlRegistryException { + XMLGregorianCalendar fiveMinsFromNow = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(TimeUtil.currentTimeMillis() + 5 + * TimeUtil.MILLIS_PER_MINUTE); + XMLGregorianCalendar fiveMinsAgo = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(TimeUtil.currentTimeMillis() - 5 + * TimeUtil.MILLIS_PER_MINUTE); + XMLGregorianCalendar tenMinsAgo = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(TimeUtil.currentTimeMillis() - 5 + * TimeUtil.MILLIS_PER_MINUTE); + + List result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_LID, + QueryConstants.LID, "Test Object 1", + QueryConstants.START_TIME, fiveMinsAgo, + QueryConstants.END_TIME, fiveMinsFromNow)); + assertEquals(1, result.size()); + + result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_LID, + QueryConstants.LID, "Test Object 1", + QueryConstants.START_TIME, tenMinsAgo, + QueryConstants.END_TIME, fiveMinsAgo)); + assertEquals(0, result.size()); + + } + +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByTimeIntervalTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByTimeIntervalTest.java new file mode 100644 index 0000000000..02370010b4 --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetAuditTrailByTimeIntervalTest.java @@ -0,0 +1,109 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.edex.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.datatype.XMLGregorianCalendar; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.time.util.TimeUtil; +import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.GetAuditTrailByTimeInterval; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; + +/** + * + * Test for the Canonical GetAuditTrailByTimeInterval defined by the EBXML 4.0 + * spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class GetAuditTrailByTimeIntervalTest extends QueryTest { + + private XMLGregorianCalendar currentTime; + + private XMLGregorianCalendar fiveMinsAgo; + + @Autowired + private GetAuditTrailByTimeInterval getAuditTrail; + + @Before + public void insertTestObjects() throws MsgRegistryException, + EbxmlRegistryException { + + List objsToSubmit = new ArrayList(); + for (int i = 0; i < 5; i++) { + RegistryObjectType obj = new RegistryObjectType("Test Object " + i, + "Test Object " + i); + objsToSubmit.add(obj); + } + submitRegistryObjectsToRegistry(objsToSubmit); + + long currentMillis = TimeUtil.currentTimeMillis(); + currentTime = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(currentMillis); + fiveMinsAgo = EbxmlObjectUtil + .getTimeAsXMLGregorianCalendar(currentMillis - 5 + * TimeUtil.MILLIS_PER_MINUTE); + } + + @Test + public void getByStartAndEndTime() throws MsgRegistryException { + + List result = executeQuery( + getAuditTrail, + createQuery( + CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_TIME_INTERVAL, + QueryConstants.START_TIME, fiveMinsAgo, + QueryConstants.END_TIME, currentTime)); + assertEquals(33, result.size()); + } + + @Test + public void getWhenStartAndEndAreNotSpecified() throws MsgRegistryException { + List result = executeQuery( + getAuditTrail, + createQuery(CanonicalQueryTypes.GET_AUDIT_TRAIL_BY_TIME_INTERVAL)); + assertEquals(0, result.size()); + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetChildrenByParentIdTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetChildrenByParentIdTest.java new file mode 100644 index 0000000000..610dbae815 --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetChildrenByParentIdTest.java @@ -0,0 +1,191 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; + +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.rim.v4.OrganizationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectListType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryPackageType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.GetChildrenByParentId; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical GetChildrenByParentId query defined by the EBXML 4.0 + * spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class GetChildrenByParentIdTest extends QueryTest { + + @Autowired + private GetChildrenByParentId getChildren; + + @Before + public void insertTestObjects() throws MsgRegistryException { + + List objsToSubmit = new ArrayList(); + List existingObjs = registryObjectDao + .executeHQLQuery( + "FROM RegistryObjectType obj where obj.objectType!=:theType", + "theType", RegistryObjectTypes.CLASSIFICATION_SCHEME); + for (RegistryObjectType obj : existingObjs) { + if (obj.getObjectType() + .equals(RegistryObjectTypes.REGISTRY_PACKAGE)) { + System.out.println("FOUND IT!!"); + } + } + RegistryPackageType pack = new RegistryPackageType(); + pack.setId("Existing Package"); + pack.setLid("Existing Package"); + pack.setObjectType(RegistryObjectTypes.REGISTRY_PACKAGE); + RegistryObjectListType objList = new RegistryObjectListType( + existingObjs); + pack.setRegistryObjectList(objList); + objsToSubmit.add(pack); + + RegistryObjectType unpackagedObject = new RegistryObjectType( + "Unpackaged Object", "Unpackaged Object"); + objsToSubmit.add(unpackagedObject); + + OrganizationType testOrg = new OrganizationType(); + testOrg.setId("Test Org"); + testOrg.setLid("Test Org"); + testOrg.setObjectType(RegistryObjectTypes.ORGANIZATION); + + OrganizationType subOrg = new OrganizationType(); + subOrg.setId("Sub Org"); + subOrg.setLid("Sub Org"); + subOrg.setObjectType(RegistryObjectTypes.ORGANIZATION); + objsToSubmit.add(subOrg); + + testOrg.getOrganization().add(subOrg); + objsToSubmit.add(testOrg); + + RegistryPackageType subPack = new RegistryPackageType(); + subPack.setId("Sub Pack"); + subPack.setLid("Sub Pack"); + subPack.setObjectType(RegistryObjectTypes.REGISTRY_PACKAGE); + RegistryObjectType subPackObj = new RegistryObjectType("FOo", "FOo"); + subPack.setRegistryObjectList(new RegistryObjectListType()); + subPack.getRegistryObjectList().getRegistryObject().add(subPackObj); + pack.getRegistryObjectList().getRegistryObject().add(subPack); + objsToSubmit.add(subPack); + + submitRegistryObjectsToRegistry(objsToSubmit); + + } + + @Test + public void getChildrenUsingDefaults() throws MsgRegistryException { + QueryRequest request = createQuery(CanonicalQueryTypes.GET_CHILDREN_BY_PARENT_ID); + List objs = executeQuery(getChildren, request); + // Expect 3 results. 1 Auditable event from the insert, the registry + // package and the unpackaged object + assertEquals(151, objs.size()); + } + + @Test + public void testObjectTypeIsNotNullClassification() + throws MsgRegistryException { + QueryRequest request = createQuery( + CanonicalQueryTypes.GET_CHILDREN_BY_PARENT_ID, + QueryConstants.OBJECT_TYPE, "ClassificationScheme"); + List objs = executeQuery(getChildren, request); + assertEquals(24, objs.size()); + } + + @Test + public void testObjectTypeIsNotNullOrganization() + throws MsgRegistryException { + QueryRequest request = createQuery( + CanonicalQueryTypes.GET_CHILDREN_BY_PARENT_ID, + QueryConstants.OBJECT_TYPE, "Organization"); + List objs = executeQuery(getChildren, request); + assertEquals(1, objs.size()); + } + + @Test + public void testObjectTypeIsNotNullRegistryPackage() + throws MsgRegistryException { + QueryRequest request = createQuery( + CanonicalQueryTypes.GET_CHILDREN_BY_PARENT_ID, + QueryConstants.OBJECT_TYPE, "RegistryPackage"); + List objs = executeQuery(getChildren, request); + assertEquals(2, objs.size()); + } + + @Test + public void testParentIdSpecifiedRegistryPackage() + throws MsgRegistryException { + QueryRequest request = createQuery( + CanonicalQueryTypes.GET_CHILDREN_BY_PARENT_ID, + QueryConstants.PARENT_ID, "Sub Pack"); + List objs = executeQuery(getChildren, request); + assertEquals(1, objs.size()); + } + + @Test + public void testParentIdSpecifiedOrganization() throws MsgRegistryException { + QueryRequest request = createQuery( + CanonicalQueryTypes.GET_CHILDREN_BY_PARENT_ID, + QueryConstants.OBJECT_TYPE, "Organization"); + List objs = executeQuery(getChildren, request); + assertEquals(1, objs.size()); + } + + @Test + public void testParentIdSpecifiedClassificationScheme() + throws MsgRegistryException { + QueryRequest request = createQuery( + CanonicalQueryTypes.GET_CHILDREN_BY_PARENT_ID, + QueryConstants.OBJECT_TYPE, "ClassificationScheme", + QueryConstants.PARENT_ID, + "urn:oasis:names:tc:ebxml-regrep:classificationScheme:ActionType"); + List objs = executeQuery(getChildren, request); + assertEquals(16, objs.size()); + } + +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetClassificationSchemesByIdTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetClassificationSchemesByIdTest.java new file mode 100644 index 0000000000..43b6f4aaef --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetClassificationSchemesByIdTest.java @@ -0,0 +1,75 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.List; + +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.rim.v4.ClassificationSchemeType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.GetClassificationSchemesById; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical GetClassificationSchemesById query defined by the + * EBXML 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class GetClassificationSchemesByIdTest extends QueryTest { + + private static final String CLASSIFICATION_SCHEME_ID = "urn:oasis:names:tc:ebxml-regrep:classificationScheme:ActionType"; + + @Autowired + private GetClassificationSchemesById getSchemes; + + @Test + public void getClassificationScheme() throws MsgRegistryException { + QueryRequest request = createQuery( + CanonicalQueryTypes.GET_CLASSIFICATION_SCHEMES_BY_ID, "id", + CLASSIFICATION_SCHEME_ID); + + List result = executeQuery(getSchemes, request); + + assertEquals(1, result.size()); + assertTrue(result.get(0) instanceof ClassificationSchemeType); + + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetNotificationTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetNotificationTest.java new file mode 100644 index 0000000000..1c63ab5475 --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetNotificationTest.java @@ -0,0 +1,151 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; + +import java.util.List; + +import javax.xml.datatype.DatatypeFactory; +import javax.xml.datatype.Duration; +import javax.xml.transform.dom.DOMResult; +import javax.xml.transform.dom.DOMSource; +import javax.xml.ws.wsaddressing.W3CEndpointReference; +import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder; + +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.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.SubscriptionType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.VersionInfoType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.w3c.dom.Attr; +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.CanonicalQueryTypes; +import com.raytheon.uf.common.registry.constants.DeliveryMethodTypes; +import com.raytheon.uf.common.registry.constants.NotificationOptionTypes; +import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; +import com.raytheon.uf.common.registry.constants.StatusTypes; +import com.raytheon.uf.common.registry.ebxml.RegistryUtil; +import com.raytheon.uf.common.registry.services.RegistrySOAPServices; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.GetNotification; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; +import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil; + +/** + * + * Test for the Canonical GetNotification query defined by the EBXML 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class GetNotificationTest extends QueryTest { + + private static final String SUBSCRIPTION_ID = "Test Subscription"; + + @Autowired + private GetNotification getNotification; + + @Before + public void createSubscription() throws Exception { + // Set normal registry object fields + SubscriptionType sub = new SubscriptionType(); + sub.setId(SUBSCRIPTION_ID); + sub.setLid(SUBSCRIPTION_ID); + sub.setObjectType(RegistryObjectTypes.SUBSCRIPTION); + sub.setName(RegistryUtil.getInternationalString(SUBSCRIPTION_ID)); + sub.setDescription(RegistryUtil.getInternationalString(SUBSCRIPTION_ID)); + VersionInfoType version = new VersionInfoType(); + version.setVersionName("1"); + version.setUserVersionName("1"); + sub.setVersionInfo(version); + sub.setOwner("TEST OWNER"); + sub.setStatus(StatusTypes.APPROVED); + + sub.setStartTime(EbxmlObjectUtil.getTimeAsXMLGregorianCalendar(0)); + + QueryType selectorQuery = createQuery( + CanonicalQueryTypes.GET_OBJECT_BY_ID, QueryConstants.ID, + "urn:oasis:names:tc:ebxml-regrep:classificationScheme:ActionType") + .getQuery(); + sub.setSelector(selectorQuery); + + Duration notificationInterval = DatatypeFactory.newInstance() + .newDuration(0); + sub.setNotificationInterval(notificationInterval); + + String endpointType = DeliveryMethodTypes.SOAP; + W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder(); + builder.address(RegistrySOAPServices.getNotificationListenerServiceUrl( + "http://someaddress.com").toString()); + W3CEndpointReference ref = builder.build(); + DOMResult dom = new DOMResult(); + ref.writeTo(dom); + Document doc = (Document) dom.getNode(); + NodeList nodes = doc.getElementsByTagNameNS( + EbxmlNamespaces.ADDRESSING_URI, "Address"); + for (int i = 0; i < nodes.getLength(); i++) { + Node addressNode = nodes.item(i); + Attr endpointTypeAttr = doc.createAttributeNS( + EbxmlNamespaces.RIM_URI, "endpointType"); + endpointTypeAttr.setValue(endpointType); + addressNode.getAttributes().setNamedItemNS(endpointTypeAttr); + } + ref = new W3CEndpointReference(new DOMSource(dom.getNode())); + + // Set subscription specific fields + DeliveryInfoType deliveryInfo = new DeliveryInfoType(); + deliveryInfo.setNotificationOption(NotificationOptionTypes.OBJECT_REFS); + deliveryInfo.setNotifyTo(ref); + sub.getDeliveryInfo().add(deliveryInfo); + + submitRegistryObjectToRegistry(sub); + } + + @Test + public void testGetNotification() throws MsgRegistryException { + + QueryRequest request = createQuery( + CanonicalQueryTypes.GET_NOTIFICATION, + QueryConstants.SUBSCRIPTION_ID, SUBSCRIPTION_ID); + List result = executeQuery(getNotification, request); + assertEquals(1, result.size()); + + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetObjectByIdTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetObjectByIdTest.java new file mode 100644 index 0000000000..e6c81af2da --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetObjectByIdTest.java @@ -0,0 +1,101 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertTrue; + +import java.util.List; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.GetObjectById; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical GetObjectById query defined by the EBXML 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class GetObjectByIdTest extends QueryTest { + + @Autowired + private GetObjectById getObjectById; + + @Before + public void insertTestObjects() throws MsgRegistryException { + for (int i = 0; i < 11; i++) { + RegistryObjectType obj = new RegistryObjectType("Test Object " + i, + ""); + submitRegistryObjectToRegistry(obj); + } + + } + + @Test + public void getObjectById() throws MsgRegistryException, + MsgRegistryException { + List result = executeQuery( + getObjectById, + createQuery(CanonicalQueryTypes.GET_OBJECT_BY_ID, "id", + "Test Object 1")); + assertTrue(result.size() == 1); + assertTrue(result.get(0).getId().equals("Test Object 1")); + } + + @Test + public void getObjectByIdUsingWildcards() throws MsgRegistryException { + List result = executeQuery( + getObjectById, + createQuery(CanonicalQueryTypes.GET_OBJECT_BY_ID, "id", + "Test Object %")); + assertTrue(result.size() == 11); + result = executeQuery( + getObjectById, + createQuery(CanonicalQueryTypes.GET_OBJECT_BY_ID, "id", + "Test Object ??")); + assertTrue(result.size() == 1); + } + + @Test + public void getObjectByIdObjectDoesntExist() throws MsgRegistryException { + List result = executeQuery( + getObjectById, + createQuery(CanonicalQueryTypes.GET_OBJECT_BY_ID, "id", + "Test Object 20")); + assertTrue(result.get(0) == null); + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetObjectByLidTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetObjectByLidTest.java new file mode 100644 index 0000000000..1b5cc686ac --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetObjectByLidTest.java @@ -0,0 +1,117 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.util.List; + +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.rim.v4.RegistryObjectType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.GetObjectsByLid; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical GetObjectByLid query defined by the EBXML 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class GetObjectByLidTest extends QueryTest { + + @Autowired + private GetObjectsByLid getObjectsByLid; + + @Before + public void insertTestObjects() throws MsgRegistryException { + for (int i = 0; i < 11; i++) { + RegistryObjectType obj = new RegistryObjectType( + "GetByLid Test Object " + i, "GetByLid Test Object " + i); + submitRegistryObjectToRegistry(obj); + } + + } + + @Test + public void getObjectByLid() throws MsgRegistryException, + MsgRegistryException { + List result = executeQuery( + getObjectsByLid, + createQuery(CanonicalQueryTypes.GET_OBJECTS_BY_LID, "lid", + "GetByLid Test Object 1")); + assertTrue(result.size() == 1); + assertTrue(result.get(0).getLid().equals("GetByLid Test Object 1")); + } + + @Test + public void getObjectByLidUsingWildcards() throws MsgRegistryException { + List result = executeQuery( + getObjectsByLid, + createQuery(CanonicalQueryTypes.GET_OBJECTS_BY_LID, "lid", + "GetByLid Test Object %")); + assertTrue(result.size() == 11); + result = executeQuery( + getObjectsByLid, + createQuery(CanonicalQueryTypes.GET_OBJECTS_BY_LID, "lid", + "GetByLid Test Object ??")); + assertTrue(result.size() == 1); + } + + @Test + public void getObjectByLidObjectDoesntExist() throws MsgRegistryException { + List result = executeQuery( + getObjectsByLid, + createQuery(CanonicalQueryTypes.GET_OBJECTS_BY_LID, "lid", + "GetByLid Test Object 20")); + assertTrue(result.isEmpty()); + } + + @Test + public void getObjectByLidWhenLidNotSpecified() { + QueryRequest request = createQuery( + CanonicalQueryTypes.GET_OBJECTS_BY_LID, "lid", + "GetByLid Test Object 20"); + request.getQuery().getSlot().clear(); + try { + executeQuery(getObjectsByLid, request); + } catch (MsgRegistryException e) { + return; + } + fail(); + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetReferencedObjectTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetReferencedObjectTest.java new file mode 100644 index 0000000000..125ce5e06d --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetReferencedObjectTest.java @@ -0,0 +1,69 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; + +import java.util.List; + +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.rim.v4.RegistryObjectType; + +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.GetReferencedObject; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical GetReferencedObject query defined by the EBXML 4.0 + * spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class GetReferencedObjectTest extends QueryTest { + + @Autowired + private GetReferencedObject getReferencedObject; + + @Test + public void testGetReferencedObject() throws MsgRegistryException { + QueryRequest request = createQuery( + CanonicalQueryTypes.GET_REFERENCED_OBJECT, "objectReference", + "urn:oasis:names:tc:ebxml-regrep:classificationScheme:ActionType"); + List result = executeQuery(getReferencedObject, + request); + assertEquals(1, result.size()); + + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetRegistryPackagesByMemberIdTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetRegistryPackagesByMemberIdTest.java new file mode 100644 index 0000000000..c38c50ff8e --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/GetRegistryPackagesByMemberIdTest.java @@ -0,0 +1,124 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; + +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.rim.v4.RegistryObjectListType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryPackageType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.GetRegistryPackagesByMemberId; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical GetRegistryPackagesByMemberId query defined by the + * EBXML 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class GetRegistryPackagesByMemberIdTest extends QueryTest { + + @Autowired + private GetRegistryPackagesByMemberId getPackages; + + @Before + public void insertTestObjects() throws MsgRegistryException { + + List objsToSubmit = new ArrayList(); + + RegistryObjectType testObj1 = new RegistryObjectType("Test OBJ 1", + "Test OBJ 1"); + RegistryObjectType testObj2 = new RegistryObjectType("Test OBJ 2", + "Test OBJ 2"); + + RegistryPackageType pack1 = new RegistryPackageType(); + pack1.setId("Package 1"); + pack1.setLid("Package 1"); + pack1.setObjectType(RegistryObjectTypes.REGISTRY_PACKAGE); + pack1.setRegistryObjectList(new RegistryObjectListType()); + + RegistryPackageType pack2 = new RegistryPackageType(); + pack2.setId("Package 2"); + pack2.setLid("Package 2"); + pack2.setObjectType(RegistryObjectTypes.REGISTRY_PACKAGE); + pack2.setRegistryObjectList(new RegistryObjectListType()); + + RegistryPackageType pack3 = new RegistryPackageType(); + pack3.setId("Package 3"); + pack3.setLid("Package 3"); + pack3.setObjectType(RegistryObjectTypes.REGISTRY_PACKAGE); + pack3.setRegistryObjectList(new RegistryObjectListType()); + + pack1.getRegistryObjectList().getRegistryObject().add(testObj1); + pack2.getRegistryObjectList().getRegistryObject().add(testObj1); + + pack2.getRegistryObjectList().getRegistryObject().add(testObj2); + pack3.getRegistryObjectList().getRegistryObject().add(testObj2); + + objsToSubmit.add(testObj1); + objsToSubmit.add(testObj2); + objsToSubmit.add(pack1); + objsToSubmit.add(pack2); + objsToSubmit.add(pack3); + + submitRegistryObjectsToRegistry(objsToSubmit); + + } + + @Test + public void getPackgesByMemberId() throws MsgRegistryException { + QueryRequest request = createQuery( + CanonicalQueryTypes.GET_REGISTRY_PACKAGES_BY_MEMBER_ID, + QueryConstants.MEMBER_ID, "Test OBJ 1"); + List result = executeQuery(getPackages, request); + assertEquals(2, result.size()); + + request = createQuery( + CanonicalQueryTypes.GET_REGISTRY_PACKAGES_BY_MEMBER_ID, + QueryConstants.MEMBER_ID, "Test OBJ 2"); + result = executeQuery(getPackages, request); + assertEquals(2, result.size()); + + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/KeywordSearchTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/KeywordSearchTest.java new file mode 100644 index 0000000000..1bc4644d66 --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/KeywordSearchTest.java @@ -0,0 +1,72 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; + +import java.util.List; + +import oasis.names.tc.ebxml.regrep.wsdl.registry.services.v4.MsgRegistryException; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; + +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.KeywordSearch; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical Keyword search query defined by the EBXML 4.0 spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class KeywordSearchTest extends QueryTest { + + @Autowired + private KeywordSearch search; + + @Test + public void searchWithSingleTerm() throws MsgRegistryException { + List result = search("domain"); + assertEquals(1, result.size()); + + } + + private List search(String keywords) + throws MsgRegistryException { + return executeQuery( + search, + createQuery(CanonicalQueryTypes.KEYWORD_SEARCH, + QueryConstants.KEYWORDS, keywords)); + } +} diff --git a/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/RegistryPackageSelectorTest.java b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/RegistryPackageSelectorTest.java new file mode 100644 index 0000000000..e75be431c9 --- /dev/null +++ b/tests/integration/com/raytheon/uf/edex/registry/ebxml/services/query/types/canonical/RegistryPackageSelectorTest.java @@ -0,0 +1,147 @@ +/** + * 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.registry.ebxml.services.query.types.canonical; + +import static org.junit.Assert.assertEquals; + +import java.util.ArrayList; +import java.util.List; + +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.rim.v4.AssociationType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectListType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryPackageType; + +import org.junit.Before; +import org.junit.Test; +import org.springframework.beans.factory.annotation.Autowired; + +import com.raytheon.uf.common.registry.constants.AssociationTypes; +import com.raytheon.uf.common.registry.constants.CanonicalQueryTypes; +import com.raytheon.uf.common.registry.constants.RegistryObjectTypes; +import com.raytheon.uf.edex.registry.ebxml.services.query.QueryConstants; +import com.raytheon.uf.edex.registry.ebxml.services.query.plugins.RegistryPackageSelector; +import com.raytheon.uf.edex.registry.ebxml.services.query.types.QueryTest; + +/** + * + * Test for the Canonical RegistryPackageSelector query defined by the EBXML 4.0 + * spec + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * 10/8/2013    1682        bphillip    Initial implementation
+ * 
+ * + * @author bphillip + * @version 1 + */ +public class RegistryPackageSelectorTest extends QueryTest { + + @Autowired + private RegistryPackageSelector packageSelector; + + @Before + public void insertTestObjects() throws MsgRegistryException { + + List objsToSubmit = new ArrayList(); + + RegistryObjectType testObj1 = new RegistryObjectType("Test OBJ 1", + "Test OBJ 1"); + RegistryObjectType testObj2 = new RegistryObjectType("Test OBJ 2", + "Test OBJ 2"); + + RegistryPackageType pack1 = new RegistryPackageType(); + pack1.setId("Package 1"); + pack1.setLid("Package 1"); + pack1.setObjectType(RegistryObjectTypes.REGISTRY_PACKAGE); + pack1.setRegistryObjectList(new RegistryObjectListType()); + + RegistryPackageType pack2 = new RegistryPackageType(); + pack2.setId("Package 2"); + pack2.setLid("Package 2"); + pack2.setObjectType(RegistryObjectTypes.REGISTRY_PACKAGE); + pack2.setRegistryObjectList(new RegistryObjectListType()); + + RegistryPackageType pack3 = new RegistryPackageType(); + pack3.setId("Package 3"); + pack3.setLid("Package 3"); + pack3.setObjectType(RegistryObjectTypes.REGISTRY_PACKAGE); + pack3.setRegistryObjectList(new RegistryObjectListType()); + + pack1.getRegistryObjectList().getRegistryObject().add(testObj1); + pack2.getRegistryObjectList().getRegistryObject().add(testObj1); + objsToSubmit.add(createAssociation(pack1.getId(), testObj1.getId())); + objsToSubmit.add(createAssociation(pack2.getId(), testObj1.getId())); + + pack2.getRegistryObjectList().getRegistryObject().add(testObj2); + pack3.getRegistryObjectList().getRegistryObject().add(testObj2); + objsToSubmit.add(createAssociation(pack2.getId(), testObj2.getId())); + objsToSubmit.add(createAssociation(pack3.getId(), testObj2.getId())); + + objsToSubmit.add(testObj1); + objsToSubmit.add(testObj2); + objsToSubmit.add(pack1); + objsToSubmit.add(pack2); + objsToSubmit.add(pack3); + + submitRegistryObjectsToRegistry(objsToSubmit); + + } + + @Test + public void testSelectingPackages() throws MsgRegistryException { + QueryRequest request = createQuery( + CanonicalQueryTypes.REGISTRY_PACKAGE_SELECTOR, + QueryConstants.REGISTRY_PACKAGE_IDS, "Package 1"); + List result = executeQuery(packageSelector, request); + assertEquals(3, result.size()); + + request = createQuery(CanonicalQueryTypes.REGISTRY_PACKAGE_SELECTOR, + QueryConstants.REGISTRY_PACKAGE_IDS, "Package 2"); + result = executeQuery(packageSelector, request); + assertEquals(5, result.size()); + + request = createQuery(CanonicalQueryTypes.REGISTRY_PACKAGE_SELECTOR, + QueryConstants.REGISTRY_PACKAGE_IDS, "Package 3"); + result = executeQuery(packageSelector, request); + assertEquals(3, result.size()); + + } + + private AssociationType createAssociation(String source, String target) { + AssociationType a = new AssociationType(); + a.setId("Association " + source + " -> " + target); + a.setLid(a.getId()); + a.setObjectType(RegistryObjectTypes.ASSOCIATION); + a.setOwner("Test Owner"); + + a.setSourceObject(source); + a.setTargetObject(target); + a.setType(AssociationTypes.HAS_MEMBER); + return a; + } +} diff --git a/tests/unit/com/raytheon/uf/edex/registry/ebxml/dao/HsqlEbxmlDbInit.java b/tests/unit/com/raytheon/uf/edex/registry/ebxml/dao/HsqlEbxmlDbInit.java index 54292ae135..0dcfd17756 100644 --- a/tests/unit/com/raytheon/uf/edex/registry/ebxml/dao/HsqlEbxmlDbInit.java +++ b/tests/unit/com/raytheon/uf/edex/registry/ebxml/dao/HsqlEbxmlDbInit.java @@ -19,6 +19,12 @@ **/ package com.raytheon.uf.edex.registry.ebxml.dao; +import java.sql.Connection; +import java.sql.SQLException; +import java.sql.Statement; + +import org.hibernate.cfg.AnnotationConfiguration; +import org.hibernate.jdbc.Work; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; @@ -32,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 29, 2013 1650 djohnson Initial creation + * 8/15/2013 1682 bphillip Added additional actions to initDb * * * @@ -46,7 +53,30 @@ public class HsqlEbxmlDbInit extends DbInit { @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public void initDb() throws Exception { + AnnotationConfiguration aConfig = this.getAnnotationConfiguration(); + try { + dropTables(aConfig); + } catch (Throwable t) { + t.printStackTrace(); + } + createSchema(); + createTables(aConfig); populateDB(); } + private void createSchema() { + final Work work = new Work() { + @Override + public void execute(Connection connection) throws SQLException { + Statement stmt = connection.createStatement(); + stmt.execute("create schema IF NOT EXISTS ebxml;"); + connection.commit(); + stmt.close(); + + } + }; + + executeWork(work); + } + }