+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Feb 13, 2012 mpduff Initial creation
+ * Feb 14, 2012 lvenable Update code.
+ * Aug 08, 2012 863 jpiatt Added checks for selection changes.
+ * Aug 10, 2012 1002 mpduff Fixed sorting of numeric data on move left.
+ * Sep 07, 2012 684 mpduff Deselect selection prior to selecting new items.
+ *
+ *
+ *
+ * @author mpduff
+ * @version 1.0
+ */
+
+public class DualList extends Composite {
+
+ /**
+ * Available List widget
+ */
+ private List availableList;
+
+ /**
+ * Selected List Widget
+ */
+ private List selectedList;
+
+ /**
+ * Dual List data/configuration object
+ */
+ private DualListConfig config = new DualListConfig();
+
+ /**
+ * Button to move an item from the left list to the right list.
+ */
+ private Button moveRightBtn;
+
+ /**
+ * Button to move all items from the left list to the right list.
+ */
+ private Button moveAllRightBtn;
+
+ /**
+ * Button to move an item from the right list to the left list.
+ */
+ private Button moveLeftBtn;
+
+ /**
+ * Button to move all items from the right list to the left list.
+ */
+ private Button moveAllLeftBtn;
+
+ /**
+ * Move a selected item in the selected list up in the list.
+ */
+ private Button moveUpBtn;
+
+ /**
+ * Move a selected item in the selected list down in the list.
+ */
+ private Button moveDownBtn;
+
+ /**
+ * Callback when data has been selected or unselected.
+ */
+ private IUpdate updateCallback = null;
+
+ /**
+ * Number of columns.
+ */
+ private int numberOfColumns = 3;
+
+ /**
+ * Button Images.
+ */
+ private ButtonImages btnImg;
+
+ /**
+ * Button Height.
+ */
+ private int buttonHeight = SWT.DEFAULT;
+
+ /**
+ * Button Width.
+ */
+ private final int buttonWidth = 45;
+
+ /**
+ * Move left flag.
+ */
+ boolean moveLeft = false;
+
+ /**
+ * Move All flag.
+ */
+ boolean moveAllLeft = false;
+
+ /**
+ * Constructor
+ *
+ * @param parent
+ * Parent container
+ * @param style
+ * SWT Style
+ * @param config
+ * Data/Configuration object
+ */
+ public DualList(Composite parent, int style, DualListConfig config) {
+ this(parent, style, config, null);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param parent
+ * Parent container
+ * @param style
+ * SWT Style
+ * @param config
+ * Data/Configuration object
+ * @param cb
+ * Update Callback
+ *
+ */
+ public DualList(Composite parent, int style, DualListConfig config,
+ IUpdate cb) {
+ super(parent, style);
+ this.config = config;
+ this.updateCallback = cb;
+ init();
+ }
+
+ /**
+ * Initialize the controls.
+ */
+ private void init() {
+ // Create the button image class
+ btnImg = new ButtonImages(this);
+
+ if (config.getListHeight() <= 90) {
+ buttonHeight = 20;
+ }
+
+ // Determine how many columns need to be on the layout.
+ // The default is three.
+ if (config.isShowUpDownBtns()) {
+ numberOfColumns = 4;
+ }
+
+ GridLayout gl = new GridLayout(numberOfColumns, false);
+ gl.marginWidth = 2;
+ gl.marginHeight = 2;
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
+ this.setLayout(gl);
+ this.setLayoutData(gd);
+
+ createListLabels();
+ createAvailableListControl();
+ createAddRemoveControls();
+ createSelectedListControl();
+
+ if (config.isShowUpDownBtns()) {
+ createMoveUpDownControls();
+ }
+
+ populateLists();
+ }
+
+ /**
+ * Create the labels that will appear above the list controls.
+ */
+ private void createListLabels() {
+ // Available label
+ GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, false, false);
+ gd.horizontalIndent = 3;
+
+ Label availableLbl = new Label(this, SWT.NONE);
+ availableLbl.setText(config.getAvailableListText());
+ availableLbl.setLayoutData(gd);
+
+ new Label(this, SWT.NONE);
+
+ // Selected label
+ gd = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
+ gd.horizontalIndent = 3;
+
+ Label selectedLbl = new Label(this, SWT.NONE);
+ selectedLbl.setText(config.getSelectedListText());
+ selectedLbl.setLayoutData(gd);
+
+ if (numberOfColumns == 4) {
+ new Label(this, SWT.NONE);
+ }
+
+ }
+
+ /**
+ * Create the available list control.
+ */
+ private void createAvailableListControl() {
+
+ GridData listData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ listData.widthHint = config.getListWidth();
+ listData.heightHint = config.getListHeight();
+ availableList = new List(this, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL
+ | SWT.H_SCROLL);
+ availableList.setLayoutData(listData);
+ availableList.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (availableList.getSelectionCount() > 0) {
+ moveRightBtn.setEnabled(true);
+ } else {
+ moveRightBtn.setEnabled(false);
+ }
+ }
+ });
+
+ availableList.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseDown(MouseEvent arg0) {
+ if (arg0.button == 3) {
+ if (config.getMenuData() != null
+ && config.getMenuData().isShowMenu()) {
+ showAvailableListMenu();
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Create the add and remove controls.
+ */
+ private void createAddRemoveControls() {
+ /*
+ * Add and Remove Buttons
+ */
+ GridData selectData = new GridData(SWT.DEFAULT, SWT.CENTER, false, true);
+ GridLayout selectLayout = new GridLayout(1, false);
+ selectLayout.verticalSpacing = 2;
+
+ Composite selectComp = new Composite(this, SWT.NONE);
+ selectComp.setLayout(selectLayout);
+ selectComp.setLayoutData(selectData);
+
+ // Left/Right buttons
+ GridData btnData = new GridData(buttonWidth, buttonHeight);
+
+ moveAllRightBtn = new Button(selectComp, SWT.PUSH);
+ moveAllRightBtn.setImage(btnImg.getImage(ButtonImage.AddAll));
+ moveAllRightBtn.setLayoutData(btnData);
+ moveAllRightBtn.setEnabled(false);
+ moveAllRightBtn.setToolTipText("Move all items right");
+ moveAllRightBtn.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ handleMoveAllRight();
+ if (updateCallback != null) {
+ updateCallback.selectionChanged();
+ }
+ }
+ });
+
+ btnData = new GridData(buttonWidth, buttonHeight);
+ moveRightBtn = new Button(selectComp, SWT.PUSH);
+ moveRightBtn.setImage(btnImg.getImage(ButtonImage.Add));
+ moveRightBtn.setLayoutData(btnData);
+ moveRightBtn.setEnabled(false);
+ moveRightBtn.setToolTipText("Move selected item(s) right");
+ moveRightBtn.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ handleMoveRight();
+ if (updateCallback != null) {
+ updateCallback.selectionChanged();
+ }
+ }
+ });
+
+ btnData = new GridData(buttonWidth, buttonHeight);
+ moveLeftBtn = new Button(selectComp, SWT.PUSH);
+ moveLeftBtn.setImage(btnImg.getImage(ButtonImage.Remove));
+ moveLeftBtn.setLayoutData(btnData);
+ moveLeftBtn.setEnabled(false);
+ moveLeftBtn.setToolTipText("Move selected item(s) left");
+ moveLeftBtn.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ handleMoveLeft();
+ if (updateCallback != null) {
+ updateCallback.selectionChanged();
+ }
+ }
+ });
+
+ btnData = new GridData(buttonWidth, buttonHeight);
+ moveAllLeftBtn = new Button(selectComp, SWT.PUSH);
+ moveAllLeftBtn.setImage(btnImg.getImage(ButtonImage.RemoveAll));
+ moveAllLeftBtn.setLayoutData(btnData);
+ moveAllLeftBtn.setEnabled(false);
+ moveAllLeftBtn.setToolTipText("Move all items left");
+ moveAllLeftBtn.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ handleMoveAllLeft(true);
+ if (updateCallback != null) {
+ updateCallback.selectionChanged();
+ }
+ }
+ });
+ }
+
+ /**
+ * Create the selected list control.
+ */
+ private void createSelectedListControl() {
+ GridData listData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ listData.widthHint = config.getListWidth();
+ listData.heightHint = config.getListHeight();
+
+ selectedList = new List(this, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL
+ | SWT.H_SCROLL);
+ selectedList.setLayoutData(listData);
+ selectedList.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (selectedList.getSelectionCount() > 0) {
+ moveLeftBtn.setEnabled(true);
+ } else {
+ moveLeftBtn.setEnabled(false);
+ }
+
+ enableDisableUpDownButtons();
+ }
+ });
+
+ selectedList.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mouseDown(MouseEvent arg0) {
+ if (arg0.button == 3) {
+ if (config.getMenuData() != null
+ && config.getMenuData().isShowMenu()) {
+ showSelectedListMenu();
+ }
+ }
+ }
+ });
+
+ }
+
+ /**
+ * Create the move up/down controls
+ */
+ private void createMoveUpDownControls() {
+
+ GridData actionData = new GridData(SWT.DEFAULT, SWT.CENTER, false, true);
+ GridLayout actionLayout = new GridLayout(1, false);
+ Composite actionComp = new Composite(this, SWT.NONE);
+ actionComp.setLayout(actionLayout);
+ actionComp.setLayoutData(actionData);
+
+ GridData btnData = new GridData(buttonWidth, buttonHeight);
+
+ moveUpBtn = new Button(actionComp, SWT.PUSH);
+ moveUpBtn.setImage(btnImg.getImage(ButtonImage.Up));
+ moveUpBtn.setLayoutData(btnData);
+ moveUpBtn.setEnabled(false);
+ moveUpBtn.setToolTipText("Move item up in the list");
+ moveUpBtn.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ handleMoveUp();
+ }
+ });
+
+ btnData = new GridData(buttonWidth, buttonHeight);
+ moveDownBtn = new Button(actionComp, SWT.PUSH);
+ moveDownBtn.setImage(btnImg.getImage(ButtonImage.Down));
+ moveDownBtn.setLayoutData(btnData);
+ moveDownBtn.setEnabled(false);
+ moveDownBtn.setToolTipText("Move item down in the list");
+ moveDownBtn.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ handleMoveDown();
+ }
+ });
+ }
+
+ /**
+ * Set FullList.
+ *
+ * @param fullList
+ * all users listed in notification table
+ */
+ public void setFullList(ArrayList fullList) {
+ config.setFullList(fullList);
+ populateLists();
+ }
+
+ /**
+ * Populate the available and selected list controls.
+ */
+ private void populateLists() {
+ availableList.removeAll();
+ selectedList.removeAll();
+
+ if (config.getFullList().size() == 0) {
+ return;
+ }
+
+ if (config.getFullList() != null) {
+ for (String s : config.getFullList()) {
+ if (s == null) {
+ continue;
+ }
+ if (config.getSelectedList().contains(s) == false) {
+ availableList.add(s);
+ }
+ }
+ }
+ if (config.getSelectedList() != null) {
+ for (String s : config.getSelectedList()) {
+ selectedList.add(s);
+ }
+ }
+
+ if (availableList.getItemCount() > 0) {
+ moveAllRightBtn.setEnabled(true);
+ }
+
+ if (selectedList.getItemCount() > 0) {
+ moveAllLeftBtn.setEnabled(true);
+ }
+
+ entriesUpdated();
+ }
+
+ /**
+ * Move down event handler
+ */
+ private void handleMoveDown() {
+ if (selectedList.getSelectionCount() == 1
+ && selectedList.getItemCount() > 1) {
+ int selectedIdx = selectedList.getSelectionIndex();
+ String item = selectedList.getItem(selectedIdx);
+
+ if (selectedIdx < selectedList.getItemCount() - 2) {
+ selectedList.remove(selectedIdx);
+ selectedList.add(item, selectedIdx + 1);
+ selectedList.select(selectedIdx + 1);
+ } else if (selectedIdx < selectedList.getItemCount() - 1) {
+ selectedList.remove(selectedIdx);
+ selectedList.add(item);
+ selectedList.select(selectedList.getItemCount() - 1);
+ }
+ enableDisableUpDownButtons();
+ }
+ }
+
+ /**
+ * Move left event handler
+ */
+ private void handleMoveLeft() {
+ int[] selectionIndices = selectedList.getSelectionIndices();
+
+ moveLeft = true;
+
+ if (selectionIndices.length == 0) {
+ return;
+ }
+
+ int firstIndex = selectionIndices[0];
+
+ HashSet list = config.getIncludeList();
+
+ if (list.contains(selectedList.getItem(firstIndex))) {
+
+ return;
+ }
+
+ reloadAvailableList();
+
+ selectedList.remove(selectionIndices);
+
+ if (selectedList.getItemCount() > 0) {
+ if (firstIndex < selectedList.getItemCount()) {
+ selectedList.setSelection(firstIndex);
+ } else {
+ selectedList.setSelection(selectedList.getItemCount() - 1);
+ }
+ } else {
+ moveLeftBtn.setEnabled(false);
+ }
+
+ moveAllRightBtn.setEnabled(true);
+
+ entriesUpdated();
+ enableDisableUpDownButtons();
+ }
+
+ /**
+ * Move all left event handler
+ */
+ private void handleMoveAllLeft(boolean callEntriesUpdated) {
+
+ HashSet list = config.getIncludeList();
+ moveAllLeft = true;
+
+ for (String sl : selectedList.getItems()) {
+
+ if (!list.contains(sl)) {
+ selectedList.remove(sl);
+ }
+
+ }
+
+ reloadAvailableList();
+ moveLeftBtn.setEnabled(false);
+ moveAllLeftBtn.setEnabled(false);
+ moveAllRightBtn.setEnabled(true);
+
+ if (callEntriesUpdated == true) {
+ entriesUpdated();
+ }
+
+ enableDisableUpDownButtons();
+ }
+
+ /**
+ * Move up event handler
+ */
+ private void handleMoveUp() {
+ if (selectedList.getSelectionCount() == 1) {
+ int selectedIdx = selectedList.getSelectionIndex();
+ String col = selectedList.getItem(selectedIdx);
+
+ if (selectedIdx > 0) {
+ selectedList.remove(selectedIdx);
+ selectedList.add(col, selectedIdx - 1);
+ selectedList.select(selectedIdx - 1);
+ }
+ enableDisableUpDownButtons();
+ }
+ }
+
+ /**
+ * Move all right event handler
+ */
+ private void handleMoveAllRight() {
+ String[] items = availableList.getItems();
+
+ if (items.length == 0) {
+ return;
+ }
+
+ for (String item : items) {
+ selectedList.add(item);
+ }
+
+ availableList.removeAll();
+ moveRightBtn.setEnabled(false);
+ moveAllRightBtn.setEnabled(false);
+ moveAllLeftBtn.setEnabled(true);
+
+ entriesUpdated();
+ enableDisableUpDownButtons();
+ }
+
+ /**
+ * Move right event handler
+ */
+ private void handleMoveRight() {
+ String[] items = availableList.getSelection();
+
+ if (items.length == 0) {
+ return;
+ }
+
+ int firstIdxSelected = availableList.indexOf(items[0]);
+
+ for (String item : items) {
+ selectedList.add(item);
+ }
+
+ availableList.remove(availableList.getSelectionIndices());
+
+ if (availableList.getItemCount() == 0) {
+ moveRightBtn.setEnabled(false);
+ } else {
+ if (firstIdxSelected > availableList.getItemCount() - 1) {
+ availableList.select(availableList.getItemCount() - 1);
+ } else {
+ availableList.select(firstIdxSelected);
+ }
+ }
+
+ moveAllLeftBtn.setEnabled(true);
+
+ entriesUpdated();
+ enableDisableUpDownButtons();
+ }
+
+ /**
+ * Convenience method to handle the enabling/disabling of the up and down
+ * buttons. This depends on how many items are in the list, how many items
+ * are selected, where the selected it is in the list.
+ */
+ private void enableDisableUpDownButtons() {
+ // Return if the buttons are now even visible.
+ if (config.isShowUpDownBtns() == false) {
+ return;
+ }
+
+ if (selectedList.getSelectionCount() > 1
+ || selectedList.getSelectionCount() == 0) {
+ moveUpBtn.setEnabled(false);
+ moveDownBtn.setEnabled(false);
+ } else {
+ if (selectedList.getSelectionIndex() == 0
+ || selectedList.getItemCount() == 0) {
+ moveUpBtn.setEnabled(false);
+ } else {
+ moveUpBtn.setEnabled(true);
+ }
+
+ if (selectedList.getSelectionIndex() == selectedList.getItemCount() - 1
+ || selectedList.getItemCount() == 0) {
+ moveDownBtn.setEnabled(false);
+ } else {
+ moveDownBtn.setEnabled(true);
+ }
+ }
+ }
+
+ /**
+ * Reload the availableList data preserving the original order of the list.
+ */
+ private void reloadAvailableList() {
+
+ String[] selectedStrings = availableList.getSelection();
+ ArrayList availableListNew = new ArrayList();
+ String search = config.getSearchField();
+
+ String[] selectedItemArray = selectedList.getItems();
+ ArrayList selectedItemList = new ArrayList();
+
+ for (String selectedItem : selectedItemArray) {
+ selectedItemList.add(selectedItem);
+ }
+
+ // Check if search field text present
+ if (config.getSearchField() == null) {
+
+ // If no search field text
+ if (moveAllLeft) {
+
+ availableList.removeAll();
+
+ for (String s : config.getFullList()) {
+ if (!selectedItemList.contains(s)) {
+ availableList.add(s);
+ }
+ }
+ } else if (moveLeft) {
+ // Add selected item matching search field text to available
+ // list
+ for (String s : selectedList.getSelection()) {
+ availableList.add(s);
+ }
+
+ // Sort the list();
+ availableListNew = sortAvailable(availableList);
+
+ availableList.removeAll();
+
+ for (String b : availableListNew) {
+ availableList.add(b);
+ }
+
+ }
+ } else {
+
+ if (moveAllLeft) {
+
+ availableList.removeAll();
+
+ // Add all matching search field text to available list
+ for (String s : config.getFullList()) {
+ if (s.contains(search)) {
+ availableList.add(s);
+ }
+ }
+
+ } else if (moveLeft) {
+
+ // Add selected item matching search field text to available
+ // list
+ for (String s : selectedList.getSelection()) {
+ availableList.add(s);
+ }
+
+ // Sort the list
+ availableListNew = sortAvailable(availableList);
+
+ availableList.removeAll();
+
+ for (String b : availableListNew) {
+ availableList.add(b);
+ }
+ }
+ }
+
+ moveAllLeft = false;
+ moveLeft = false;
+
+ availableList.setSelection(selectedStrings);
+ }
+
+ private void showAvailableListMenu() {
+ IMenuData menuData = config.getMenuData();
+ if (menuData.isShowMenu() && availableList.getSelectionCount() > 0) {
+ menuData.setListSelection(availableList.getSelection()[0]);
+ menuData.showListMenu(getShell(), config.getMenuData()
+ .getMenuText());
+ }
+ }
+
+ private void showSelectedListMenu() {
+ IMenuData menuData = config.getMenuData();
+ if (menuData.isShowMenu() && selectedList.getSelectionCount() > 0) {
+ menuData.setListSelection(selectedList.getSelection()[0]);
+ menuData.showListMenu(getShell(), config.getMenuData()
+ .getMenuText());
+ }
+ }
+
+ private ArrayList sortAvailable(List oldAvailableList) {
+
+ ArrayList availableListsorted = new ArrayList();
+ String[] arr = oldAvailableList.getItems();
+
+ // Put available list in order
+ if (config.isNumericData()) {
+ // If data are numeric then must sort on the numeric value
+ try {
+ Map map = new TreeMap();
+ for (String a : arr) {
+ map.put(Integer.parseInt(a), a);
+ }
+
+ for (Integer i : map.keySet()) {
+ availableListsorted.add(map.get(i));
+ }
+ } catch (NumberFormatException e) {
+ // numeric data not all numeric, string sorting
+ availableListsorted = (ArrayList) Arrays.asList(arr);
+ Collections.sort(availableListsorted);
+ }
+ } else {
+ for (String a : arr) {
+ availableListsorted.add(a);
+ }
+
+ Collections.sort(availableListsorted);
+ }
+
+ return availableListsorted;
+ }
+
+ /**
+ * Calls the callback method to notify something has changed.
+ */
+ private void entriesUpdated() {
+ if (updateCallback != null) {
+ if (selectedList.getItemCount() == 0) {
+ updateCallback.hasEntries(false);
+ } else {
+ updateCallback.hasEntries(true);
+ }
+ }
+ }
+
+ /**
+ * Clear all users.
+ */
+ public void clearSelection() {
+ handleMoveAllLeft(false);
+ }
+
+ /**
+ * Clear Available Users list.
+ *
+ * @param clearSelectionList
+ */
+ public void clearAvailableList(boolean clearSelectionList) {
+ this.availableList.removeAll();
+
+ if (clearSelectionList == true) {
+ clearSelection();
+ }
+ }
+
+ /**
+ * Set the Available List items.
+ *
+ * @param items
+ * the list items.
+ */
+ public void setAvailableItems(java.util.List items) {
+ this.availableList.setItems(items.toArray(new String[items.size()]));
+ }
+
+ /**
+ * Get the number of items in the list.
+ *
+ * @return the number of items.
+ */
+ public int getItemCount() {
+ return selectedList.getItemCount();
+ }
+
+ /**
+ * Get the Selected List items.
+ *
+ * @return the items in the selected list.
+ */
+ public String[] getSelectedListItems() {
+ return selectedList.getItems();
+ }
+
+ /**
+ * Get the selection.
+ *
+ * @return the selections.
+ */
+ public String[] getSelectedSelection() {
+ return selectedList.getSelection();
+ }
+
+ /**
+ * Get the configuration.
+ *
+ * @return items in available list.
+ */
+ public String[] getAvailableListItems() {
+ return availableList.getItems();
+ }
+
+ /**
+ * Set the Selected List items.
+ *
+ * @param items
+ * the list items.
+ */
+ public void setSelectedItems(String[] items) {
+ selectedList.setItems(items);
+ reloadAvailableList();
+ }
+
+ /**
+ * Selected User items.
+ *
+ * @param selection
+ * selected user items
+ */
+ public void selectItems(String[] selection) {
+ availableList.deselectAll();
+ int[] selectedIndices = new int[selection.length];
+ for (int i = 0; i < selection.length; i++) {
+ selectedIndices[i] = availableList.indexOf(selection[i]);
+ }
+
+ availableList.select(selectedIndices);
+ handleMoveRight();
+ }
+
+ /**
+ * Get the configuration.
+ *
+ * @return the configuration.
+ */
+ public DualListConfig getConfig() {
+ return config;
+ }
+
+ /**
+ * Set the configuration.
+ *
+ * @param config
+ * the configuration.
+ */
+ public void setConfig(DualListConfig config) {
+ this.config = config;
+ }
+}
\ No newline at end of file
diff --git a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/widgets/duallist/DualListConfig.java b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/widgets/duallist/DualListConfig.java
new file mode 100644
index 0000000000..9f07b12469
--- /dev/null
+++ b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/widgets/duallist/DualListConfig.java
@@ -0,0 +1,297 @@
+/**
+ * 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.viz.ui.widgets.duallist;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+
+
+/**
+ * Config file for DualList class. Reused from Data Delivery.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * May 31, 2012 mpduff Initial creation.
+ * Aug 10, 2012 1002 mpduff Added numeric flag for sorting.
+ *
+ *
+ *
+ * @author mpduff
+ * @version 1.0
+ */
+
+public class DualListConfig {
+
+ /**
+ * Available list text set to a default.
+ */
+ private String availableListText = "Available:";
+
+ /**
+ * Selected list text set to a default.
+ */
+ private String selectedListText = "Selected:";
+
+ /**
+ * Width of the list controls.
+ */
+ private int listWidth = 100;
+
+ /**
+ * Height of the list controls.
+ */
+ private int listHeight = 125;
+
+ /**
+ * Flag to determine if the up/down buttons should be shown.
+ */
+ private boolean showUpDownBtns = false;
+
+ /**
+ * List of items that should initially appear in the selected item list.
+ */
+ private List selectedList = new ArrayList();
+
+ /**
+ * Full list of available items.
+ */
+ private List fullList = new ArrayList();
+
+ /**
+ * The list to include.
+ */
+ private HashSet includeList = new HashSet();
+
+ /**
+ * The search field.
+ */
+ private String searchField = null;
+
+ private IMenuData menuData;
+
+ /** Flag for numeric data */
+ private boolean numericData = false;
+
+ /**
+ * Constructor.
+ */
+ public DualListConfig() {
+
+ }
+
+ /**
+ * Get the include list.
+ *
+ * @return the include list.
+ */
+ public HashSet getIncludeList() {
+ return includeList;
+ }
+
+ /**
+ * Set the include list.
+ *
+ * @param includeList
+ * List to always include.
+ */
+ public void setIncludeList(HashSet includeList) {
+ this.includeList = includeList;
+ }
+
+ /**
+ * Get the available list header text.
+ *
+ * @return Available list header text.
+ */
+ public String getAvailableListText() {
+ return availableListText;
+ }
+
+ /**
+ * Set the available list header text.
+ *
+ * @param availableListLabel
+ * Available list header text.
+ */
+ public void setAvailableListLabel(String availableListLabel) {
+ this.availableListText = availableListLabel;
+ }
+
+ /**
+ * Get the selected list header text.
+ *
+ * @return Selected list header text.
+ */
+ public String getSelectedListText() {
+ return selectedListText;
+ }
+
+ /**
+ * Set the selected list header text.
+ *
+ * @param selectedListLabel
+ * Selected list header text.
+ */
+ public void setSelectedListLabel(String selectedListLabel) {
+ this.selectedListText = selectedListLabel;
+ }
+
+ /**
+ * Get the list control width.
+ *
+ * @return The list width.
+ */
+ public int getListWidth() {
+ return listWidth;
+ }
+
+ /**
+ * Set the width of the list control.
+ *
+ * @param listWidth
+ * Width of the list control.
+ */
+ public void setListWidth(int listWidth) {
+ this.listWidth = listWidth;
+ }
+
+ /**
+ * Get the height of the list control.
+ *
+ * @return The height of the list control.
+ */
+ public int getListHeight() {
+ return listHeight;
+ }
+
+ /**
+ * Set the height of the list control.
+ *
+ * @param listHeight
+ * The height of the list control.
+ */
+ public void setListHeight(int listHeight) {
+ this.listHeight = listHeight;
+ }
+
+ /**
+ * Check if the up/down buttons should be shown.
+ *
+ * @return True if the buttons are shown, false if hidden.
+ */
+ public boolean isShowUpDownBtns() {
+ return showUpDownBtns;
+ }
+
+ /**
+ * Set the show up/down button flag.
+ *
+ * @param showUpDownBtns
+ * True to show the buttons, false to not show the buttons.
+ */
+ public void setShowUpDownBtns(boolean showUpDownBtns) {
+ this.showUpDownBtns = showUpDownBtns;
+ }
+
+ /**
+ * Get an array of selected items.
+ *
+ * @return An array of selected items.
+ */
+ public List getSelectedList() {
+ return selectedList;
+ }
+
+ /**
+ * Set the array of selected items.
+ *
+ * @param selectedList
+ * Array of selected items.
+ */
+ public void setSelectedList(List selectedList) {
+ this.selectedList = selectedList;
+ }
+
+ /**
+ * Get an array of all of the available items.
+ *
+ * @return The array of all available items.
+ */
+ public List getFullList() {
+ return fullList;
+ }
+
+ /**
+ * Set the array of all of the available items.
+ *
+ * @param fullList
+ * The array of all available items.
+ */
+ public void setFullList(List fullList) {
+ this.fullList = fullList;
+ }
+
+ /**
+ * Get the search field text.
+ *
+ * @return the String
+ * the search field text.
+ */
+ public String getSearchField() {
+ return searchField;
+ }
+
+ /**
+ * Set the search field text.
+ *
+ * @param searchField
+ * the search field text.
+ */
+ public void setSearchField(String searchField) {
+ this.searchField = searchField;
+ }
+
+ public IMenuData getMenuData() {
+ return menuData;
+ }
+
+ public void setMenuData(IMenuData menuData) {
+ this.menuData = menuData;
+ }
+
+ /**
+ * @param numericData the numericData to set
+ */
+ public void setNumericData(boolean numericData) {
+ this.numericData = numericData;
+ }
+
+ /**
+ * @return the numericData
+ */
+ public boolean isNumericData() {
+ return numericData;
+ }
+}
diff --git a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/widgets/duallist/IMenuData.java b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/widgets/duallist/IMenuData.java
new file mode 100644
index 0000000000..0776cc1c8f
--- /dev/null
+++ b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/widgets/duallist/IMenuData.java
@@ -0,0 +1,71 @@
+/**
+ * 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.viz.ui.widgets.duallist;
+
+
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * @author mpduff
+ * @version 1.0
+ */
+
+public interface IMenuData {
+ /**
+ * Show a popup menu on the list right click
+ *
+ * @param shell The shell
+ * @param menuText The menu text
+ */
+ public void showListMenu(Shell shell, String menuText);
+
+ /**
+ * Show a popup menu.
+ *
+ * @return true to show menu, false to not show a menu
+ */
+ public boolean isShowMenu();
+
+ /**
+ * Get the list menu text.
+ *
+ * @return the menu text
+ */
+ public String getMenuText();
+
+ /**
+ * Set the list selection.
+ *
+ * @param string The selection
+ */
+ public void setListSelection(String string);
+}
diff --git a/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/widgets/duallist/IUpdate.java b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/widgets/duallist/IUpdate.java
new file mode 100644
index 0000000000..0c8916d9de
--- /dev/null
+++ b/cave/com.raytheon.viz.ui/src/com/raytheon/viz/ui/widgets/duallist/IUpdate.java
@@ -0,0 +1,54 @@
+/**
+ * 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.viz.ui.widgets.duallist;
+
+/**
+ * TODO Add Description
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * May 31, 2012 mpduff Initial creation.
+ * Aug 08, 2012 863 jpiatt Added selectedChange method for clean & dirty checks.
+ *
+ *
+ *
+ * @author mpduff
+ * @version 1.0
+ */
+
+public interface IUpdate {
+ /**
+ * Method called when a control has items or when the control becomes empty.
+ *
+ * @param entries
+ * Entries flag. True if there are entries, false if there are no
+ * entries.
+ */
+ void hasEntries(boolean entries);
+
+ /**
+ * Method called when a change in selection occurs.
+ */
+ public void selectionChanged();
+}
diff --git a/cave/ohd.hseb.common/.classpath b/cave/ohd.hseb.common/.classpath
index 78fc66cee2..3385703d78 100644
--- a/cave/ohd.hseb.common/.classpath
+++ b/cave/ohd.hseb.common/.classpath
@@ -7,7 +7,6 @@
-
diff --git a/cave/ohd.hseb.common/META-INF/MANIFEST.MF b/cave/ohd.hseb.common/META-INF/MANIFEST.MF
index 0498cf6569..29524e817f 100644
--- a/cave/ohd.hseb.common/META-INF/MANIFEST.MF
+++ b/cave/ohd.hseb.common/META-INF/MANIFEST.MF
@@ -120,13 +120,6 @@ Export-Package: ChartDirector,
org.apache.bsf.util.event.generator,
org.apache.bsf.util.type,
org.apache.taglibs.bsf,
- org.jdom,
- org.jdom.adapters,
- org.jdom.filter,
- org.jdom.input,
- org.jdom.output,
- org.jdom.transform,
- org.jdom.xpath,
org.postgresql,
org.postgresql.core,
org.postgresql.core.types,
@@ -243,7 +236,6 @@ Bundle-ClassPath: externaljars/bsf.jar,
externaljars/fldat.jar,
externaljars/ihfsdb.jar,
externaljars/jcchart.jar,
- externaljars/jdom.jar,
externaljars/junit.jar,
externaljars/netcdfUI-2.2.22.jar,
externaljars/nlog4j-1.2.21.jar,
diff --git a/cave/ohd.hseb.common/externaljars/jdom.jar b/cave/ohd.hseb.common/externaljars/jdom.jar
deleted file mode 100755
index 6d04bac92f..0000000000
Binary files a/cave/ohd.hseb.common/externaljars/jdom.jar and /dev/null differ
diff --git a/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SacXMLDecoder.java b/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SacXMLDecoder.java
index 3b53a81afc..e556764351 100644
--- a/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SacXMLDecoder.java
+++ b/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SacXMLDecoder.java
@@ -33,6 +33,7 @@ import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
+import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;
@@ -539,14 +540,13 @@ public class SacXMLDecoder
public String toString()
{
StringWriter stringWriter = new StringWriter();
- XMLOutputter outputter = new XMLOutputter();
+ Format format = Format.getPrettyFormat();
+ format = format.setIndent(" ");
+ XMLOutputter outputter = new XMLOutputter(format);
String returnValue = null;
try
{
- outputter.setTextTrim( true );
- outputter.setIndent( " " );
- outputter.setNewlines( true );
outputter.output( _doc, stringWriter );
returnValue = stringWriter.toString();
}
diff --git a/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SacXMLEncoder.java b/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SacXMLEncoder.java
index 412dc41973..329605160f 100644
--- a/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SacXMLEncoder.java
+++ b/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SacXMLEncoder.java
@@ -30,6 +30,7 @@ import ohd.hseb.util.StringParser;
import org.jdom.Document;
import org.jdom.Element;
+import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;
public class SacXMLEncoder
@@ -552,7 +553,9 @@ public class SacXMLEncoder
private void writeXmlToFile(Document outputXmlDoc, String xmlFileName)
{
- XMLOutputter _xmlOutputter = new XMLOutputter(" ", true);
+ Format format = Format.getRawFormat();
+ format.setIndent(" ");
+ XMLOutputter _xmlOutputter = new XMLOutputter(format);
try
{
diff --git a/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SacXMLTester.java b/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SacXMLTester.java
index 62994deaca..ae2616b90b 100644
--- a/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SacXMLTester.java
+++ b/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SacXMLTester.java
@@ -33,8 +33,9 @@ import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
+import org.jdom.output.Format.TextMode;
import org.jdom.output.XMLOutputter;
-
+import org.jdom.output.Format;
public class SacXMLTester
{
@@ -473,14 +474,13 @@ public class SacXMLTester
public String toString()
{
StringWriter stringWriter = new StringWriter();
- XMLOutputter outputter = new XMLOutputter();
+ Format format = Format.getPrettyFormat();
+ format = format.setIndent(" ");
+ XMLOutputter outputter = new XMLOutputter(format);
String returnValue = null;
try
{
- outputter.setTextTrim( true );
- outputter.setIndent( " " );
- outputter.setNewlines( true );
outputter.output( _inputXMLDoc, stringWriter );
returnValue = stringWriter.toString();
}
@@ -494,7 +494,9 @@ public class SacXMLTester
private void writeXmlToFile(Document outputXmlDoc, String xmlFileName)
{
- XMLOutputter _xmlOutputter = new XMLOutputter(" ", true);
+ Format format = Format.getRawFormat();
+ format.setIndent(" ");
+ XMLOutputter _xmlOutputter = new XMLOutputter(format);
try
{
diff --git a/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SshpDataTransferMgr.java b/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SshpDataTransferMgr.java
index 87257d166b..3c8505738f 100644
--- a/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SshpDataTransferMgr.java
+++ b/cave/ohd.hseb.sshp/src/ohd/hseb/sshp/messaging/SshpDataTransferMgr.java
@@ -20,6 +20,7 @@ import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
+import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;
/**
@@ -37,7 +38,7 @@ public class SshpDataTransferMgr
private Document _controlDoc = null;
private SAXBuilder _builder = new SAXBuilder();
- private XMLOutputter _xmlOutputter = new XMLOutputter(" ", true);
+ private XMLOutputter _xmlOutputter = null;
private FileLogger _logger = null;
private String _logFilePath = null;
@@ -59,6 +60,10 @@ public class SshpDataTransferMgr
_logger = new FileLogger(_logFilePath);
+ Format format = Format.getRawFormat();
+ format.setIndent(" ");
+ this._xmlOutputter = new XMLOutputter(format);
+
loadControlFile();
return;
diff --git a/cots/com.google.guava/.settings/org.eclipse.jdt.core.prefs b/cots/com.google.guava/.settings/org.eclipse.jdt.core.prefs
index 1386d17f43..9ea81993e4 100644
--- a/cots/com.google.guava/.settings/org.eclipse.jdt.core.prefs
+++ b/cots/com.google.guava/.settings/org.eclipse.jdt.core.prefs
@@ -1,5 +1,11 @@
+<<<<<<< HEAD
+#Wed Feb 15 11:40:52 CST 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+=======
#Thu Mar 26 11:28:33 CDT 2009
eclipse.preferences.version=1
+>>>>>>> development
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
diff --git a/cots/net.jcip/.classpath b/cots/net.jcip/.classpath
new file mode 100644
index 0000000000..10f492202b
--- /dev/null
+++ b/cots/net.jcip/.classpath
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/cots/net.jcip/.project b/cots/net.jcip/.project
new file mode 100644
index 0000000000..47f6994d3d
--- /dev/null
+++ b/cots/net.jcip/.project
@@ -0,0 +1,28 @@
+
+
+ net.jcip
+
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.pde.ManifestBuilder
+
+
+
+
+ org.eclipse.pde.SchemaBuilder
+
+
+
+
+
+ org.eclipse.pde.PluginNature
+ org.eclipse.jdt.core.javanature
+
+
diff --git a/cots/net.jcip/.settings/org.eclipse.jdt.core.prefs b/cots/net.jcip/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..503d44edbb
--- /dev/null
+++ b/cots/net.jcip/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Wed Jul 25 12:18:05 CDT 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/cots/net.jcip/META-INF/MANIFEST.MF b/cots/net.jcip/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..2aa0f158d4
--- /dev/null
+++ b/cots/net.jcip/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Jcip Plugin
+Bundle-SymbolicName: net.jcip
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-ClassPath: jcip-annotations.jar,
+ .
+Export-Package: net.jcip.annotations
diff --git a/cots/net.jcip/build.properties b/cots/net.jcip/build.properties
new file mode 100644
index 0000000000..61cb16eb3f
--- /dev/null
+++ b/cots/net.jcip/build.properties
@@ -0,0 +1,4 @@
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ jcip-annotations.jar
diff --git a/cots/net.jcip/jcip-annotations-src.jar b/cots/net.jcip/jcip-annotations-src.jar
new file mode 100644
index 0000000000..bf52a507df
Binary files /dev/null and b/cots/net.jcip/jcip-annotations-src.jar differ
diff --git a/cots/net.jcip/jcip-annotations.jar b/cots/net.jcip/jcip-annotations.jar
new file mode 100644
index 0000000000..ea263af054
Binary files /dev/null and b/cots/net.jcip/jcip-annotations.jar differ
diff --git a/cots/org.geotools/.classpath b/cots/org.geotools/.classpath
index 023e775466..bb04b154d2 100644
--- a/cots/org.geotools/.classpath
+++ b/cots/org.geotools/.classpath
@@ -2,7 +2,6 @@
-
@@ -10,23 +9,51 @@
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cots/org.geotools/.settings/org.eclipse.jdt.core.prefs b/cots/org.geotools/.settings/org.eclipse.jdt.core.prefs
index edef664082..1ffe2d7934 100644
--- a/cots/org.geotools/.settings/org.eclipse.jdt.core.prefs
+++ b/cots/org.geotools/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,8 @@
-#Thu Mar 26 11:29:04 CDT 2009
+#Fri Jun 08 11:49:31 CDT 2012
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/cots/org.geotools/META-INF/MANIFEST.MF b/cots/org.geotools/META-INF/MANIFEST.MF
index 03b4ddf7c5..19df7a6c76 100644
--- a/cots/org.geotools/META-INF/MANIFEST.MF
+++ b/cots/org.geotools/META-INF/MANIFEST.MF
@@ -3,36 +3,61 @@ Bundle-ManifestVersion: 2
Bundle-Name: Geotools Plug-in
Bundle-SymbolicName: org.geotools
Bundle-Version: 2.6.4
-Bundle-Vendor: Raytheon-bundled OSS
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Eclipse-BuddyPolicy: registered, ext, global
-Bundle-ClassPath: geoapi-2.3-M1.jar,
- geoapi-pending-2.3-M1.jar,
- gt-api-2.6.4.jar,
- gt-coverage-2.6.4.jar,
- gt-epsg-wkt-2.6.4.jar,
- gt-geotiff-2.6.4.jar,
- gt-graph-2.6.4.jar,
- gt-gtopo30-2.6.4.jar,
- gt-image-2.6.4.jar,
- gt-main-2.6.4.jar,
- gt-metadata-2.6.4.jar,
- gt-referencing-2.6.4.jar,
- gt-referencing3D-2.6.4.jar,
- gt-shapefile-2.6.4.jar,
- gt-postgis-2.6.4.jar,
- jts-1.10.jar,
+Bundle-ClassPath: common-2.2.1.jar,
commons-beanutils-1.7.0.jar,
commons-codec-1.2.jar,
commons-collections-3.1.jar,
commons-dbcp-1.2.2.jar,
commons-jxpath-1.2.jar,
commons-lang-2.3.jar,
- commons-logging-1.1.1.jar,
commons-pool-1.5.3.jar,
- common-2.2.1.jar,
- jdom-1.0.jar
-Export-Package: com.vividsolutions.jts,
+ ecore-2.2.2.jar,
+ geoapi-2.3-M1.jar,
+ geoapi-pending-2.3-M1.jar,
+ gt-api-2.6.4-sources.jar,
+ gt-api-2.6.4.jar,
+ gt-coverage-2.6.4-sources.jar,
+ gt-coverage-2.6.4.jar,
+ gt-cql-2.6.4.jar,
+ gt-epsg-wkt-2.6.4-sources.jar,
+ gt-epsg-wkt-2.6.4.jar,
+ gt-geotiff-2.6.4-sources.jar,
+ gt-geotiff-2.6.4.jar,
+ gt-graph-2.6.4-sources.jar,
+ gt-graph-2.6.4.jar,
+ gt-gtopo30-2.6.4-sources.jar,
+ gt-gtopo30-2.6.4.jar,
+ gt-image-2.6.4-sources.jar,
+ gt-image-2.6.4.jar,
+ gt-main-2.6.4-sources.jar,
+ gt-main-2.6.4.jar,
+ gt-metadata-2.6.4-sources.jar,
+ gt-metadata-2.6.4.jar,
+ gt-referencing-2.6.4-sources.jar,
+ gt-referencing-2.6.4.jar,
+ gt-referencing3D-2.6.4-sources.jar,
+ gt-referencing3D-2.6.4.jar,
+ gt-render-2.6.4.jar,
+ gt-shapefile-2.6.4-sources.jar,
+ gt-shapefile-2.6.4.jar,
+ gt-xml-2.6.4.jar,
+ gt-xsd-core-2.6.4.jar,
+ gt-xsd-filter-2.6.4.jar,
+ gt-xsd-gml2-2.6.4.jar,
+ gt-xsd-gml3-2.6.4.jar,
+ gt-xsd-kml-2.6.4.jar,
+ gt-xsd-sld-2.6.4.jar,
+ jdom-1.0.jar,
+ gt-postgis-2.6.4.jar,
+ jts-1.10.jar,
+ picocontainer-1.2.jar,
+ xercesImpl-2.7.1.jar,
+ xml-apis-1.0.b2.jar,
+ xml-apis-xerces-2.7.1.jar,
+ xsd-2.2.2.jar
+Bundle-Vendor: Raytheon-bundled OSS
+Export-Package: .,
+ com.vividsolutions.jts,
com.vividsolutions.jts.algorithm,
com.vividsolutions.jts.algorithm.locate,
com.vividsolutions.jts.geom,
@@ -70,6 +95,17 @@ Export-Package: com.vividsolutions.jts,
com.vividsolutions.jts.precision,
com.vividsolutions.jts.simplify,
com.vividsolutions.jts.util,
+ org.eclipse.emf.common,
+ org.eclipse.emf.common.archive,
+ org.eclipse.emf.common.command,
+ org.eclipse.emf.common.notify,
+ org.eclipse.emf.common.notify.impl,
+ org.eclipse.emf.common.util,
+ org.eclipse.xsd,
+ org.eclipse.xsd.ecore,
+ org.eclipse.xsd.impl,
+ org.eclipse.xsd.impl.type,
+ org.eclipse.xsd.util,
org.geotools.console,
org.geotools.coverage,
org.geotools.coverage.grid,
@@ -80,54 +116,228 @@ Export-Package: com.vividsolutions.jts,
org.geotools.coverage.processing,
org.geotools.coverage.processing.operation,
org.geotools.data,
+ org.geotools.data.collection,
org.geotools.data.crs,
+ org.geotools.data.memory,
+ org.geotools.data.ows,
org.geotools.data.postgis,
org.geotools.data.shapefile,
org.geotools.data.shapefile.dbf,
org.geotools.data.shapefile.indexed,
+ org.geotools.data.shapefile.indexed.attribute,
+ org.geotools.data.shapefile.prj,
+ org.geotools.data.shapefile.shp,
+ org.geotools.data.shapefile.shp.xml,
+ org.geotools.data.store,
+ org.geotools.data.view,
org.geotools.factory,
org.geotools.feature,
+ org.geotools.feature.collection,
org.geotools.feature.simple,
org.geotools.feature.type,
+ org.geotools.feature.visitor,
org.geotools.filter,
+ org.geotools.filter.capability,
+ org.geotools.filter.expression,
+ org.geotools.filter.function,
+ org.geotools.filter.function.math,
+ org.geotools.filter.function.string,
+ org.geotools.filter.identity,
+ org.geotools.filter.spatial,
+ org.geotools.filter.v1_0,
+ org.geotools.filter.v1_0.capabilities,
+ org.geotools.filter.v1_1,
+ org.geotools.filter.v1_1.capabilities,
+ org.geotools.filter.visitor,
org.geotools.gce.geotiff,
+ org.geotools.gce.geotiff.adapters,
+ org.geotools.gce.geotiff.codes,
+ org.geotools.gce.gtopo30,
+ org.geotools.gce.image,
org.geotools.geometry,
+ org.geotools.geometry.coordinatesequence,
org.geotools.geometry.jts,
+ org.geotools.geometry.jts.coordinatesequence,
+ org.geotools.geometry.text,
+ org.geotools.gml,
+ org.geotools.gml.producer,
+ org.geotools.gml2,
+ org.geotools.gml2.bindings,
+ org.geotools.gml3,
+ org.geotools.gml3.bindings,
+ org.geotools.gml3.bindings.smil,
+ org.geotools.gml3.smil,
+ org.geotools.gml3.v3_2,
+ org.geotools.gml3.v3_2.gco,
+ org.geotools.gml3.v3_2.gmd,
+ org.geotools.gml3.v3_2.gmx,
+ org.geotools.gml3.v3_2.gsr,
+ org.geotools.gml3.v3_2.gss,
+ org.geotools.gml3.v3_2.gts,
+ org.geotools.graph.build,
+ org.geotools.graph.build.basic,
+ org.geotools.graph.build.feature,
+ org.geotools.graph.build.line,
+ org.geotools.graph.build.opt,
+ org.geotools.graph.build.polygon,
+ org.geotools.graph.io,
+ org.geotools.graph.io.standard,
+ org.geotools.graph.path,
+ org.geotools.graph.structure,
+ org.geotools.graph.structure.basic,
+ org.geotools.graph.structure.line,
+ org.geotools.graph.structure.opt,
+ org.geotools.graph.traverse,
+ org.geotools.graph.traverse.basic,
+ org.geotools.graph.traverse.standard,
+ org.geotools.graph.util,
+ org.geotools.graph.util.delaunay,
+ org.geotools.graph.util.geom,
+ org.geotools.graph.util.graph,
+ org.geotools.image,
+ org.geotools.image.io,
+ org.geotools.image.jai,
+ org.geotools.image.palette,
+ org.geotools.index,
+ org.geotools.index.quadtree,
+ org.geotools.index.quadtree.fs,
+ org.geotools.io,
+ org.geotools.kml,
+ org.geotools.kml.bindings,
+ org.geotools.legend,
+ org.geotools.map,
+ org.geotools.map.event,
org.geotools.math,
+ org.geotools.measure,
+ org.geotools.metadata,
+ org.geotools.metadata.iso,
+ org.geotools.metadata.iso.citation,
+ org.geotools.metadata.iso.constraint,
+ org.geotools.metadata.iso.content,
+ org.geotools.metadata.iso.distribution,
+ org.geotools.metadata.iso.extent,
+ org.geotools.metadata.iso.identification,
+ org.geotools.metadata.iso.lineage,
+ org.geotools.metadata.iso.maintenance,
+ org.geotools.metadata.iso.quality,
+ org.geotools.metadata.iso.spatial,
+ org.geotools.metadata.sql,
+ org.geotools.nature,
+ org.geotools.ows,
org.geotools.parameter,
org.geotools.referencing,
org.geotools.referencing.crs,
org.geotools.referencing.cs,
org.geotools.referencing.datum,
+ org.geotools.referencing.factory,
+ org.geotools.referencing.factory.epsg,
+ org.geotools.referencing.factory.wms,
org.geotools.referencing.operation,
org.geotools.referencing.operation.builder,
org.geotools.referencing.operation.matrix,
org.geotools.referencing.operation.projection,
org.geotools.referencing.operation.transform,
+ org.geotools.referencing.piecewise,
org.geotools.referencing.wkt,
+ org.geotools.renderer,
+ org.geotools.renderer.crs,
+ org.geotools.renderer.i18n,
+ org.geotools.renderer.label,
+ org.geotools.renderer.lite,
+ org.geotools.renderer.lite.gridcoverage2d,
+ org.geotools.renderer.style,
+ org.geotools.renderer.style.shape,
+ org.geotools.resources,
+ org.geotools.resources.coverage,
+ org.geotools.resources.geometry,
+ org.geotools.resources.i18n,
+ org.geotools.resources.image,
+ org.geotools.sld,
+ org.geotools.sld.bindings,
+ org.geotools.styling,
+ org.geotools.styling.visitor,
+ org.geotools.util,
org.geotools.util.logging,
+ org.geotools.xlink,
+ org.geotools.xml,
+ org.geotools.xml.filter,
+ org.geotools.xml.gml,
+ org.geotools.xml.handlers,
+ org.geotools.xml.handlers.xsi,
+ org.geotools.xml.impl,
+ org.geotools.xml.impl.jxpath,
+ org.geotools.xml.schema,
+ org.geotools.xml.schema.impl,
+ org.geotools.xml.styling,
+ org.geotools.xml.test,
+ org.geotools.xml.transform,
+ org.geotools.xml.xLink,
+ org.geotools.xml.xsi,
+ org.geotools.xs,
+ org.geotools.xs.bindings,
+ org.geotools.xs.facets,
+ org.jdom,
+ org.jdom.adapters,
+ org.jdom.filter,
+ org.jdom.input,
+ org.jdom.output,
+ org.jdom.transform,
+ org.jdom.xpath,
+ org.opengis.annotation,
org.opengis.coverage,
org.opengis.coverage.grid,
+ org.opengis.coverage.grid.quadrilateral,
org.opengis.coverage.processing,
+ org.opengis.display.canvas,
+ org.opengis.display.container,
+ org.opengis.display.primitive,
org.opengis.feature,
org.opengis.feature.simple,
org.opengis.feature.type,
org.opengis.filter,
+ org.opengis.filter.capability,
org.opengis.filter.expression,
+ org.opengis.filter.identity,
+ org.opengis.filter.sort,
+ org.opengis.filter.spatial,
org.opengis.geometry,
+ org.opengis.geometry.aggregate,
+ org.opengis.geometry.complex,
org.opengis.geometry.coordinate,
+ org.opengis.geometry.primitive,
org.opengis.metadata,
+ org.opengis.metadata.citation,
+ org.opengis.metadata.constraint,
+ org.opengis.metadata.content,
+ org.opengis.metadata.distribution,
+ org.opengis.metadata.extent,
+ org.opengis.metadata.identification,
+ org.opengis.metadata.lineage,
+ org.opengis.metadata.maintenance,
+ org.opengis.metadata.quality,
org.opengis.metadata.spatial,
+ org.opengis.observation,
+ org.opengis.observation.coverage,
+ org.opengis.observation.sampling,
org.opengis.parameter,
org.opengis.referencing,
org.opengis.referencing.crs,
org.opengis.referencing.cs,
org.opengis.referencing.datum,
org.opengis.referencing.operation,
- org.opengis.util
-Bundle-ActivationPolicy: lazy
+ org.opengis.sld,
+ org.opengis.style,
+ org.opengis.style.portrayal,
+ org.opengis.temporal,
+ org.opengis.util,
+ org.opengis.webservice,
+ org.opengis.webservice.capability,
+ org.opengis.webservice.feature
Require-Bundle: javax.vecmath;bundle-version="1.3.1",
javax.measure;bundle-version="1.0.0",
org.apache.commons.logging,
org.apache.log4j,
org.postgres;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Eclipse-BuddyPolicy: registered, ext, global
+Bundle-ActivationPolicy: lazy
diff --git a/cots/org.geotools/build.properties b/cots/org.geotools/build.properties
index c720c23ace..f43f7c58a3 100644
--- a/cots/org.geotools/build.properties
+++ b/cots/org.geotools/build.properties
@@ -1,19 +1,50 @@
bin.includes = META-INF/,\
.,\
+ common-2.2.1.jar,\
+ commons-beanutils-1.7.0.jar,\
+ commons-codec-1.2.jar,\
+ commons-collections-3.1.jar,\
+ commons-dbcp-1.2.2.jar,\
+ commons-jxpath-1.2.jar,\
+ commons-lang-2.3.jar,\
+ commons-pool-1.5.3.jar,\
+ ecore-2.2.2.jar,\
geoapi-2.3-M1.jar,\
geoapi-pending-2.3-M1.jar,\
+ gt-api-2.6.4-sources.jar,\
gt-api-2.6.4.jar,\
+ gt-coverage-2.6.4-sources.jar,\
gt-coverage-2.6.4.jar,\
+ gt-cql-2.6.4.jar,\
+ gt-epsg-wkt-2.6.4-sources.jar,\
gt-epsg-wkt-2.6.4.jar,\
+ gt-geotiff-2.6.4-sources.jar,\
gt-geotiff-2.6.4.jar,\
+ gt-graph-2.6.4-sources.jar,\
gt-graph-2.6.4.jar,\
+ gt-gtopo30-2.6.4-sources.jar,\
gt-gtopo30-2.6.4.jar,\
+ gt-image-2.6.4-sources.jar,\
gt-image-2.6.4.jar,\
+ gt-main-2.6.4-sources.jar,\
gt-main-2.6.4.jar,\
+ gt-metadata-2.6.4-sources.jar,\
gt-metadata-2.6.4.jar,\
+ gt-referencing-2.6.4-sources.jar,\
gt-referencing-2.6.4.jar,\
+ gt-referencing3D-2.6.4-sources.jar,\
gt-referencing3D-2.6.4.jar,\
+ gt-render-2.6.4.jar,\
+ gt-shapefile-2.6.4-sources.jar,\
gt-shapefile-2.6.4.jar,\
+ gt-xml-2.6.4.jar,\
+ gt-xsd-core-2.6.4.jar,\
+ gt-xsd-filter-2.6.4.jar,\
+ gt-xsd-gml2-2.6.4.jar,\
+ gt-xsd-gml3-2.6.4.jar,\
+ gt-xsd-kml-2.6.4.jar,\
+ gt-xsd-sld-2.6.4.jar,\
+ jdom-1.0.jar,\
jts-1.10.jar,\
commons-beanutils-1.7.0.jar,\
commons-codec-1.2.jar,\
@@ -26,4 +57,9 @@ bin.includes = META-INF/,\
jdom-1.0.jar,\
gt-postgis-2.6.4.jar,\
gt-jdbc-2.6.4.jar,\
- gt-jdbc-postgis-2.6.4.jar
+ gt-jdbc-postgis-2.6.4.jar,\
+ picocontainer-1.2.jar,\
+ xercesImpl-2.7.1.jar,\
+ xml-apis-1.0.b2.jar,\
+ xml-apis-xerces-2.7.1.jar,\
+ xsd-2.2.2.jar
\ No newline at end of file
diff --git a/cots/org.geotools/ecore-2.2.2.jar b/cots/org.geotools/ecore-2.2.2.jar
new file mode 100644
index 0000000000..d472c76b77
Binary files /dev/null and b/cots/org.geotools/ecore-2.2.2.jar differ
diff --git a/cots/org.geotools/gt-cql-2.6.4.jar b/cots/org.geotools/gt-cql-2.6.4.jar
new file mode 100644
index 0000000000..50cb35cb7f
Binary files /dev/null and b/cots/org.geotools/gt-cql-2.6.4.jar differ
diff --git a/cots/org.geotools/gt-render-2.6.4.jar b/cots/org.geotools/gt-render-2.6.4.jar
new file mode 100644
index 0000000000..c6e0feb793
Binary files /dev/null and b/cots/org.geotools/gt-render-2.6.4.jar differ
diff --git a/cots/org.geotools/gt-xml-2.6.4.jar b/cots/org.geotools/gt-xml-2.6.4.jar
new file mode 100644
index 0000000000..4a089f7b0b
Binary files /dev/null and b/cots/org.geotools/gt-xml-2.6.4.jar differ
diff --git a/cots/org.geotools/gt-xsd-core-2.6.4.jar b/cots/org.geotools/gt-xsd-core-2.6.4.jar
new file mode 100644
index 0000000000..a765c8c8af
Binary files /dev/null and b/cots/org.geotools/gt-xsd-core-2.6.4.jar differ
diff --git a/cots/org.geotools/gt-xsd-filter-2.6.4.jar b/cots/org.geotools/gt-xsd-filter-2.6.4.jar
new file mode 100644
index 0000000000..5e0785b99f
Binary files /dev/null and b/cots/org.geotools/gt-xsd-filter-2.6.4.jar differ
diff --git a/cots/org.geotools/gt-xsd-gml2-2.6.4.jar b/cots/org.geotools/gt-xsd-gml2-2.6.4.jar
new file mode 100644
index 0000000000..d76751cd40
Binary files /dev/null and b/cots/org.geotools/gt-xsd-gml2-2.6.4.jar differ
diff --git a/cots/org.geotools/gt-xsd-gml3-2.6.4.jar b/cots/org.geotools/gt-xsd-gml3-2.6.4.jar
new file mode 100644
index 0000000000..7a60845970
Binary files /dev/null and b/cots/org.geotools/gt-xsd-gml3-2.6.4.jar differ
diff --git a/cots/org.geotools/gt-xsd-kml-2.6.4.jar b/cots/org.geotools/gt-xsd-kml-2.6.4.jar
new file mode 100644
index 0000000000..8dcf45eea8
Binary files /dev/null and b/cots/org.geotools/gt-xsd-kml-2.6.4.jar differ
diff --git a/cots/org.geotools/gt-xsd-sld-2.6.4.jar b/cots/org.geotools/gt-xsd-sld-2.6.4.jar
new file mode 100644
index 0000000000..22cf6802b1
Binary files /dev/null and b/cots/org.geotools/gt-xsd-sld-2.6.4.jar differ
diff --git a/cots/org.geotools/picocontainer-1.2.jar b/cots/org.geotools/picocontainer-1.2.jar
new file mode 100644
index 0000000000..fbb1c925b8
Binary files /dev/null and b/cots/org.geotools/picocontainer-1.2.jar differ
diff --git a/cots/org.geotools/xercesImpl-2.7.1.jar b/cots/org.geotools/xercesImpl-2.7.1.jar
new file mode 100644
index 0000000000..0b100e14b8
Binary files /dev/null and b/cots/org.geotools/xercesImpl-2.7.1.jar differ
diff --git a/cots/org.geotools/xml-apis-1.0.b2.jar b/cots/org.geotools/xml-apis-1.0.b2.jar
new file mode 100644
index 0000000000..ad33a5afa6
Binary files /dev/null and b/cots/org.geotools/xml-apis-1.0.b2.jar differ
diff --git a/cots/org.geotools/xml-apis-xerces-2.7.1.jar b/cots/org.geotools/xml-apis-xerces-2.7.1.jar
new file mode 100644
index 0000000000..243eaeaeb2
Binary files /dev/null and b/cots/org.geotools/xml-apis-xerces-2.7.1.jar differ
diff --git a/cots/org.geotools/xsd-2.2.2.jar b/cots/org.geotools/xsd-2.2.2.jar
new file mode 100644
index 0000000000..23487367f3
Binary files /dev/null and b/cots/org.geotools/xsd-2.2.2.jar differ
diff --git a/cots/org.hibernate/.classpath b/cots/org.hibernate/.classpath
index d4f85314f6..a49aca05d1 100644
--- a/cots/org.hibernate/.classpath
+++ b/cots/org.hibernate/.classpath
@@ -1,9 +1,11 @@
+
+
-
+
diff --git a/cots/org.hibernate/.settings/org.eclipse.jdt.core.prefs b/cots/org.hibernate/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..4443c832ba
--- /dev/null
+++ b/cots/org.hibernate/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Fri Jun 08 11:53:01 CDT 2012
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/cots/org.hibernate/META-INF/MANIFEST.MF b/cots/org.hibernate/META-INF/MANIFEST.MF
index 8e39131001..fa6dd0f32e 100644
--- a/cots/org.hibernate/META-INF/MANIFEST.MF
+++ b/cots/org.hibernate/META-INF/MANIFEST.MF
@@ -3,10 +3,13 @@ Bundle-ManifestVersion: 2
Bundle-Name: Hibernate Plug-in
Bundle-SymbolicName: org.hibernate
Bundle-Version: 1.0.0.qualifier
+Bundle-ClassPath: hibernate-spatial-1.0.jar,
+ hibernate-spatial-postgis-1.0.jar,
+ hibernate3.5.0-Final.jar,
+ javassist-3.9.0.GA.jar,
+ jta-1.1.jar
Bundle-Vendor: Hibernate
-Require-Bundle: org.slf4j
-Export-Package:
- org.hibernate,
+Export-Package: org.hibernate,
org.hibernate.action,
org.hibernate.annotations,
org.hibernate.annotations.common,
@@ -171,7 +174,14 @@ Export-Package:
org.hibernate.tuple.entity,
org.hibernate.type,
org.hibernate.usertype,
- org.hibernate.util
-Bundle-ClassPath: hibernate3.5.0-Final.jar,
- javassist-3.9.0.GA.jar,
- jta-1.1.jar
+ org.hibernate.util,
+ org.hibernatespatial,
+ org.hibernatespatial.cfg,
+ org.hibernatespatial.criterion,
+ org.hibernatespatial.helper,
+ org.hibernatespatial.mgeom,
+ org.hibernatespatial.pojo,
+ org.hibernatespatial.postgis,
+ org.hibernatespatial.readers,
+ org.hibernatespatial.spi
+Require-Bundle: org.slf4j
diff --git a/cots/org.hibernate/build.properties b/cots/org.hibernate/build.properties
index 3fada6b622..802fa8462a 100644
--- a/cots/org.hibernate/build.properties
+++ b/cots/org.hibernate/build.properties
@@ -1,4 +1,6 @@
bin.includes = META-INF/,\
+ hibernate-spatial-1.0.jar,\
+ hibernate-spatial-postgis-1.0.jar,\
hibernate3.5.0-Final.jar,\
javassist-3.9.0.GA.jar,\
jta-1.1.jar
diff --git a/cots/org.hibernate/hibernate-spatial-1.0.jar b/cots/org.hibernate/hibernate-spatial-1.0.jar
new file mode 100644
index 0000000000..8d410502cb
Binary files /dev/null and b/cots/org.hibernate/hibernate-spatial-1.0.jar differ
diff --git a/cots/org.hibernate/hibernate-spatial-postgis-1.0.jar b/cots/org.hibernate/hibernate-spatial-postgis-1.0.jar
new file mode 100644
index 0000000000..930f1e49c2
Binary files /dev/null and b/cots/org.hibernate/hibernate-spatial-postgis-1.0.jar differ
diff --git a/cots/org.junit/.classpath b/cots/org.junit/.classpath
index bd39c93d4e..7363c566f4 100644
--- a/cots/org.junit/.classpath
+++ b/cots/org.junit/.classpath
@@ -2,11 +2,14 @@
-
-
-
+
+
+
+
+
+
diff --git a/cots/org.junit/META-INF/MANIFEST.MF b/cots/org.junit/META-INF/MANIFEST.MF
index c448390ddc..7f2d8e6aba 100644
--- a/cots/org.junit/META-INF/MANIFEST.MF
+++ b/cots/org.junit/META-INF/MANIFEST.MF
@@ -3,25 +3,48 @@ Bundle-ManifestVersion: 2
Bundle-Name: Junit Plug-in
Bundle-SymbolicName: org.junit
Bundle-Version: 1.0.0.qualifier
-Bundle-ClassPath: junit-4.3.1.jar,
- hamcrest-api-1.0.jar,
- hamcrest-library-1.0.jar,
- jmock-2.0.0.jar,
+Bundle-ClassPath: jmock-2.0.0.jar,
jmock-junit3-2.0.0.jar,
- jmock-junit4-2.0.0.jar
-Export-Package: junit.extensions,
+ jmock-junit4-2.0.0.jar,
+ cglib-nodep-2.2.jar,
+ javassist-3.16.1-GA.jar,
+ mockito-all-1.9.0.jar,
+ objenesis-1.2.jar,
+ powermock-mockito-1.4.12-full.jar,
+ junit-4.10.jar
+Export-Package: javassist,
+ javassist.bytecode,
+ javassist.bytecode.analysis,
+ javassist.bytecode.annotation,
+ javassist.bytecode.stackmap,
+ javassist.compiler,
+ javassist.compiler.ast,
+ javassist.convert,
+ javassist.expr,
+ javassist.runtime,
+ javassist.scopedpool,
+ javassist.tools,
+ javassist.tools.reflect,
+ javassist.tools.rmi,
+ javassist.tools.web,
+ javassist.util,
+ javassist.util.proxy,
+ junit.extensions,
junit.framework,
junit.runner,
junit.textui,
+ net.sf.cglib.asm,
+ net.sf.cglib.asm.signature,
+ net.sf.cglib.beans,
+ net.sf.cglib.core,
+ net.sf.cglib.proxy,
+ net.sf.cglib.reflect,
+ net.sf.cglib.transform,
+ net.sf.cglib.transform.impl,
+ net.sf.cglib.util,
org.hamcrest,
- org.hamcrest.beans,
- org.hamcrest.collection,
org.hamcrest.core,
org.hamcrest.internal,
- org.hamcrest.number,
- org.hamcrest.object,
- org.hamcrest.text,
- org.hamcrest.xml,
org.jmock,
org.jmock.api,
org.jmock.example.qcon,
@@ -35,11 +58,147 @@ Export-Package: junit.extensions,
org.jmock.lib.action,
org.jmock.syntax,
org.junit,
+ org.junit.experimental,
+ org.junit.experimental.categories,
+ org.junit.experimental.max,
+ org.junit.experimental.results,
+ org.junit.experimental.runners,
+ org.junit.experimental.theories,
+ org.junit.experimental.theories.internal,
+ org.junit.experimental.theories.suppliers,
org.junit.internal,
+ org.junit.internal.builders,
+ org.junit.internal.matchers,
org.junit.internal.requests,
org.junit.internal.runners,
+ org.junit.internal.runners.model,
+ org.junit.internal.runners.rules,
+ org.junit.internal.runners.statements,
+ org.junit.matchers,
+ org.junit.rules,
org.junit.runner,
org.junit.runner.manipulation,
org.junit.runner.notification,
- org.junit.runners
+ org.junit.runners,
+ org.junit.runners.model,
+ org.mockito,
+ org.mockito.asm,
+ org.mockito.asm.signature,
+ org.mockito.asm.tree,
+ org.mockito.asm.tree.analysis,
+ org.mockito.asm.util,
+ org.mockito.cglib.beans,
+ org.mockito.cglib.core,
+ org.mockito.cglib.proxy,
+ org.mockito.cglib.reflect,
+ org.mockito.cglib.transform,
+ org.mockito.cglib.transform.impl,
+ org.mockito.cglib.util,
+ org.mockito.configuration,
+ org.mockito.exceptions,
+ org.mockito.exceptions.base,
+ org.mockito.exceptions.misusing,
+ org.mockito.exceptions.verification,
+ org.mockito.exceptions.verification.junit,
+ org.mockito.internal,
+ org.mockito.internal.configuration,
+ org.mockito.internal.configuration.injection,
+ org.mockito.internal.configuration.injection.filter,
+ org.mockito.internal.creation,
+ org.mockito.internal.creation.cglib,
+ org.mockito.internal.creation.jmock,
+ org.mockito.internal.debugging,
+ org.mockito.internal.exceptions,
+ org.mockito.internal.exceptions.base,
+ org.mockito.internal.exceptions.util,
+ org.mockito.internal.invocation,
+ org.mockito.internal.invocation.finder,
+ org.mockito.internal.invocation.realmethod,
+ org.mockito.internal.listeners,
+ org.mockito.internal.matchers,
+ org.mockito.internal.matchers.apachecommons,
+ org.mockito.internal.progress,
+ org.mockito.internal.reporting,
+ org.mockito.internal.runners,
+ org.mockito.internal.runners.util,
+ org.mockito.internal.stubbing,
+ org.mockito.internal.stubbing.answers,
+ org.mockito.internal.stubbing.defaultanswers,
+ org.mockito.internal.util,
+ org.mockito.internal.util.junit,
+ org.mockito.internal.util.reflection,
+ org.mockito.internal.verification,
+ org.mockito.internal.verification.api,
+ org.mockito.internal.verification.argumentmatching,
+ org.mockito.internal.verification.checkers,
+ org.mockito.invocation,
+ org.mockito.listeners,
+ org.mockito.runners,
+ org.mockito.stubbing,
+ org.mockito.stubbing.answers,
+ org.mockito.verification,
+ org.objenesis,
+ org.objenesis.instantiator,
+ org.objenesis.instantiator.basic,
+ org.objenesis.instantiator.gcj,
+ org.objenesis.instantiator.jrockit,
+ org.objenesis.instantiator.perc,
+ org.objenesis.instantiator.sun,
+ org.objenesis.strategy,
+ org.powermock.api.extension.listener,
+ org.powermock.api.extension.proxyframework,
+ org.powermock.api.mockito,
+ org.powermock.api.mockito.expectation,
+ org.powermock.api.mockito.internal,
+ org.powermock.api.mockito.internal.configuration,
+ org.powermock.api.mockito.internal.expectation,
+ org.powermock.api.mockito.internal.invocationcontrol,
+ org.powermock.api.mockito.internal.mockcreation,
+ org.powermock.api.mockito.internal.verification,
+ org.powermock.api.mockito.mockpolicies,
+ org.powermock.api.mockito.powermocklistener,
+ org.powermock.api.mockito.verification,
+ org.powermock.api.support,
+ org.powermock.api.support.membermodification,
+ org.powermock.api.support.membermodification.strategy,
+ org.powermock.api.support.membermodification.strategy.impl,
+ org.powermock.classloading,
+ org.powermock.classloading.spi,
+ org.powermock.core,
+ org.powermock.core.classloader,
+ org.powermock.core.classloader.annotations,
+ org.powermock.core.spi,
+ org.powermock.core.spi.listener,
+ org.powermock.core.spi.support,
+ org.powermock.core.spi.testresult,
+ org.powermock.core.spi.testresult.impl,
+ org.powermock.core.testlisteners,
+ org.powermock.core.transformers,
+ org.powermock.core.transformers.impl,
+ org.powermock.mockpolicies,
+ org.powermock.mockpolicies.impl,
+ org.powermock.mockpolicies.support,
+ org.powermock.modules.junit3,
+ org.powermock.modules.junit3.internal,
+ org.powermock.modules.junit3.internal.impl,
+ org.powermock.modules.junit4,
+ org.powermock.modules.junit4.common.internal,
+ org.powermock.modules.junit4.common.internal.impl,
+ org.powermock.modules.junit4.internal.impl,
+ org.powermock.modules.junit4.internal.impl.testcaseworkaround,
+ org.powermock.modules.junit4.legacy,
+ org.powermock.modules.junit4.legacy.internal.impl,
+ org.powermock.modules.junit4.legacy.internal.impl.testcaseworkaround,
+ org.powermock.modules.testng,
+ org.powermock.modules.testng.internal,
+ org.powermock.reflect,
+ org.powermock.reflect.exceptions,
+ org.powermock.reflect.internal,
+ org.powermock.reflect.internal.matcherstrategies,
+ org.powermock.reflect.internal.primitivesupport,
+ org.powermock.reflect.matching,
+ org.powermock.reflect.proxyframework,
+ org.powermock.reflect.spi,
+ org.powermock.tests.utils,
+ org.powermock.tests.utils.impl
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/cots/org.junit/build.properties b/cots/org.junit/build.properties
index 93e6e60d4c..da97b1e7e3 100644
--- a/cots/org.junit/build.properties
+++ b/cots/org.junit/build.properties
@@ -1,7 +1,11 @@
bin.includes = META-INF/,\
- junit-4.3.1.jar,\
- hamcrest-api-1.0.jar,\
- hamcrest-library-1.0.jar,\
jmock-2.0.0.jar,\
jmock-junit3-2.0.0.jar,\
- jmock-junit4-2.0.0.jar
+ jmock-junit4-2.0.0.jar,\
+ cglib-nodep-2.2.jar,\
+ javassist-3.16.1-GA.jar,\
+ junit-4.8.2.jar,\
+ mockito-all-1.9.0.jar,\
+ objenesis-1.2.jar,\
+ powermock-mockito-1.4.12-full.jar,\
+ junit-4.10.jar
diff --git a/cots/org.junit/cglib-nodep-2.2.jar b/cots/org.junit/cglib-nodep-2.2.jar
new file mode 100644
index 0000000000..ed07cb507f
Binary files /dev/null and b/cots/org.junit/cglib-nodep-2.2.jar differ
diff --git a/cots/org.junit/hamcrest-api-1.0.jar b/cots/org.junit/hamcrest-api-1.0.jar
deleted file mode 100644
index 5df3f19d92..0000000000
Binary files a/cots/org.junit/hamcrest-api-1.0.jar and /dev/null differ
diff --git a/cots/org.junit/hamcrest-library-1.0.jar b/cots/org.junit/hamcrest-library-1.0.jar
deleted file mode 100644
index e0b275f049..0000000000
Binary files a/cots/org.junit/hamcrest-library-1.0.jar and /dev/null differ
diff --git a/cots/org.junit/javassist-3.16.1-GA.jar b/cots/org.junit/javassist-3.16.1-GA.jar
new file mode 100644
index 0000000000..c29da0fae0
Binary files /dev/null and b/cots/org.junit/javassist-3.16.1-GA.jar differ
diff --git a/cots/org.junit/junit-4.10-src.jar b/cots/org.junit/junit-4.10-src.jar
new file mode 100644
index 0000000000..1449d28b5b
Binary files /dev/null and b/cots/org.junit/junit-4.10-src.jar differ
diff --git a/cots/org.junit/junit-4.10.jar b/cots/org.junit/junit-4.10.jar
new file mode 100644
index 0000000000..bf5c0b9c6a
Binary files /dev/null and b/cots/org.junit/junit-4.10.jar differ
diff --git a/cots/org.junit/junit-4.3.1.jar b/cots/org.junit/junit-4.3.1.jar
deleted file mode 100644
index ff5d1888fc..0000000000
Binary files a/cots/org.junit/junit-4.3.1.jar and /dev/null differ
diff --git a/cots/org.junit/mockito-all-1.9.0.jar b/cots/org.junit/mockito-all-1.9.0.jar
new file mode 100644
index 0000000000..273fd50feb
Binary files /dev/null and b/cots/org.junit/mockito-all-1.9.0.jar differ
diff --git a/cots/org.junit/objenesis-1.2.jar b/cots/org.junit/objenesis-1.2.jar
new file mode 100644
index 0000000000..fb04d7fa64
Binary files /dev/null and b/cots/org.junit/objenesis-1.2.jar differ
diff --git a/cots/org.junit/powermock-mockito-1.4.12-full.jar b/cots/org.junit/powermock-mockito-1.4.12-full.jar
new file mode 100644
index 0000000000..b70358d164
Binary files /dev/null and b/cots/org.junit/powermock-mockito-1.4.12-full.jar differ
diff --git a/edexOsgi/build.edex/basebuilds/component_deploy_base.xml b/edexOsgi/build.edex/basebuilds/component_deploy_base.xml
index f3c63463fb..cb10f40ded 100644
--- a/edexOsgi/build.edex/basebuilds/component_deploy_base.xml
+++ b/edexOsgi/build.edex/basebuilds/component_deploy_base.xml
@@ -34,9 +34,10 @@
-
-
-
+
+
+
+
-
+
@@ -113,6 +113,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
&substitute-targets;
diff --git a/edexOsgi/build.edex/build.xml b/edexOsgi/build.edex/build.xml
index 67890ae773..c2778ad940 100644
--- a/edexOsgi/build.edex/build.xml
+++ b/edexOsgi/build.edex/build.xml
@@ -74,10 +74,14 @@
-
-
-
+
+
+
+
+
+
diff --git a/edexOsgi/build.edex/deploy-common/deploy-esb-configuration.xml b/edexOsgi/build.edex/deploy-common/deploy-esb-configuration.xml
index 6eb7c9897c..b4e273d6fa 100644
--- a/edexOsgi/build.edex/deploy-common/deploy-esb-configuration.xml
+++ b/edexOsgi/build.edex/deploy-common/deploy-esb-configuration.xml
@@ -7,5 +7,6 @@
overwrite="${esb.overwrite}">
+
\ No newline at end of file
diff --git a/edexOsgi/build.edex/deploy-common/deploy-esb.xml b/edexOsgi/build.edex/deploy-common/deploy-esb.xml
index 9be780fe87..d72aa33d4b 100644
--- a/edexOsgi/build.edex/deploy-common/deploy-esb.xml
+++ b/edexOsgi/build.edex/deploy-common/deploy-esb.xml
@@ -1,7 +1,7 @@
-
-
+
+
-
+
@@ -124,6 +124,9 @@
+
-
\ No newline at end of file
+
diff --git a/edexOsgi/build.edex/deploy-common/plugin-methods.xml b/edexOsgi/build.edex/deploy-common/plugin-methods.xml
index 2c6e2aaed9..cb78f8c732 100644
--- a/edexOsgi/build.edex/deploy-common/plugin-methods.xml
+++ b/edexOsgi/build.edex/deploy-common/plugin-methods.xml
@@ -115,35 +115,21 @@
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
@@ -301,4 +287,4 @@
-
\ No newline at end of file
+
diff --git a/edexOsgi/build.edex/edex/customAssembly.xml b/edexOsgi/build.edex/edex/customAssembly.xml
index c98e962f8c..e7f98600ab 100755
--- a/edexOsgi/build.edex/edex/customAssembly.xml
+++ b/edexOsgi/build.edex/edex/customAssembly.xml
@@ -20,15 +20,15 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/edexOsgi/build.edex/edex/customTargets.xml b/edexOsgi/build.edex/edex/customTargets.xml
index b6b66a6e18..af024f7a62 100644
--- a/edexOsgi/build.edex/edex/customTargets.xml
+++ b/edexOsgi/build.edex/edex/customTargets.xml
@@ -149,13 +149,13 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/edexOsgi/build.edex/esb/bin/linux-x86-32/wrapper.conf b/edexOsgi/build.edex/esb/bin/linux-x86-32/wrapper.conf
index 5edfea661d..8a72330191 100644
--- a/edexOsgi/build.edex/esb/bin/linux-x86-32/wrapper.conf
+++ b/edexOsgi/build.edex/esb/bin/linux-x86-32/wrapper.conf
@@ -21,6 +21,7 @@
# Wrapper Properties
#********************************************************************
+wrapper.java.classpath.6=%EDEX_HOME%/conf/resources/
# Java Library Path (location of Wrapper.DLL or libwrapper.so)
wrapper.java.library.path.1=%EDEX_HOME%/bin/linux-x86-32/
wrapper.java.library.path.4=%EDEX_HOME%/lib/dependencies/org.jep.linux32/
diff --git a/edexOsgi/build.edex/esb/bin/setup.env b/edexOsgi/build.edex/esb/bin/setup.env
index 35f7a55d63..5c23461186 100644
--- a/edexOsgi/build.edex/esb/bin/setup.env
+++ b/edexOsgi/build.edex/esb/bin/setup.env
@@ -22,12 +22,20 @@ export BROKER_ADDR=localhost
# setup hdf5 connection if pypies is enabled
export PYPIES_SERVER=http://localhost:9582
+# data delivery specific variables, used below in the localization section
+export DATADELIVERY_HOST=localhost
+export DATADELIVERY_PORT=9588
+export DATADELIVERY_SOAP_PORT=10144
+
# moved here from environment.xml
# these values are returned to clients that contact the localization service
export HTTP_PORT=9581
export HTTP_SERVER=http://localhost:${HTTP_PORT}/services
export JMS_SERVER=tcp://localhost:5672
export RADAR_SERVER=tcp://localhost:8813
+export DATADELIVERY_SERVER=http://${DATADELIVERY_HOST}:${DATADELIVERY_PORT}/services/thrift
+export DATADELIVERY_LCM_SERVER=http://${DATADELIVERY_HOST}:${DATADELIVERY_SOAP_PORT}/lcm?WSDL
+export DATADELIVERY_QUERY_SERVER=http://${DATADELIVERY_HOST}:${DATADELIVERY_SOAP_PORT}/query?WSDL
# set the AWIPS II shared directory
export SHARE_DIR=/awips2/edex/data/share
@@ -42,4 +50,4 @@ export SITE_IDENTIFIER=${AW_SITE_IDENTIFIER}
# set Fax environment variables pointing to ldad@ls1
export LDAD_EXTERNAL_HOME=/ldad
-export LDAD_EXTERNAL_PUBLIC=/data/ldad/public
\ No newline at end of file
+export LDAD_EXTERNAL_PUBLIC=/data/ldad/public
diff --git a/edexOsgi/build.edex/esb/bin/wrapper.conf b/edexOsgi/build.edex/esb/bin/wrapper.conf
index 125d07fa05..2a62a5102f 100644
--- a/edexOsgi/build.edex/esb/bin/wrapper.conf
+++ b/edexOsgi/build.edex/esb/bin/wrapper.conf
@@ -46,6 +46,7 @@ wrapper.java.classpath.2=%EDEX_HOME%/lib/plugins/com.raytheon.uf.edex.esb.camel.
wrapper.java.classpath.3=%EDEX_HOME%/conf/
wrapper.java.classpath.4=%EDEX_HOME%/conf/cache/
wrapper.java.classpath.5=%EDEX_HOME%/conf/spring/
+wrapper.java.classpath.6=%EDEX_HOME%/conf/resources/
# set the umask for file/directory creation by the Java process
wrapper.java.umask=0002
@@ -114,16 +115,20 @@ wrapper.java.additional.36=-Dlog4j.configuration=%LOG4J_CONF%
# moved these from environment.xml to setup.env
wrapper.java.additional.37=-Dhttp.server=%HTTP_SERVER%
wrapper.java.additional.38=-Djms.server=%JMS_SERVER%
+wrapper.java.additional.39=-Ddatadelivery.server=%DATADELIVERY_SERVER%
+wrapper.java.additional.40=-Ddatadelivery.lcm.server=%DATADELIVERY_LCM_SERVER%
+wrapper.java.additional.41=-Ddatadelivery.query.server=%DATADELIVERY_QUERY_SERVER%
-wrapper.java.additional.39=-DHighMem=%HIGH_MEM_FLAG%
-wrapper.java.additional.40=-Dmanagement.port=%MGMT_PORT%
+wrapper.java.additional.42=-DHighMem=%HIGH_MEM_FLAG%
+wrapper.java.additional.43=-Dmanagement.port=%MGMT_PORT%
-wrapper.java.additional.41=-Dqpid.dest_syntax=BURL
-wrapper.java.additional.42=-Dweb.port=8080
-wrapper.java.additional.43=-Dconfidential.port=8443
-wrapper.java.additional.44=-Dhttp.port=%HTTP_PORT%
-wrapper.java.additional.45=-Dedex.arch=%EDEX_ARCH%
-wrapper.java.additional.46=-Dedex.tmp=%TEMP_DIR%
+wrapper.java.additional.44=-Dqpid.dest_syntax=BURL
+wrapper.java.additional.45=-Dweb.port=8080
+wrapper.java.additional.46=-Dconfidential.port=8443
+wrapper.java.additional.47=-Dhttp.port=%HTTP_PORT%
+wrapper.java.additional.48=-Dedex.arch=%EDEX_ARCH%
+wrapper.java.additional.49=-Dedex.tmp=%TEMP_DIR%
+wrapper.java.additional.50=-Dawips.registrymanager.debug=%AWIPS_REGISTRYMANAGER_DEBUG%
# Initial Java Heap Size (in MB)
wrapper.java.initmemory=%INIT_MEM%
diff --git a/edexOsgi/build.edex/esb/conf/cache/ehcache.xml b/edexOsgi/build.edex/esb/conf/cache/ehcache.xml
new file mode 100644
index 0000000000..8a614278af
--- /dev/null
+++ b/edexOsgi/build.edex/esb/conf/cache/ehcache.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/edexOsgi/build.edex/esb/conf/db/hibernateConfig/ebxml/hibernate.cfg.xml b/edexOsgi/build.edex/esb/conf/db/hibernateConfig/ebxml/hibernate.cfg.xml
new file mode 100644
index 0000000000..cc625521ca
--- /dev/null
+++ b/edexOsgi/build.edex/esb/conf/db/hibernateConfig/ebxml/hibernate.cfg.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+ org.postgresql.Driver
+
+
+ org.hibernate.dialect.PostgreSQLDialect
+
+
+ jdbc:postgresql://${db.addr}:${db.port}/ebxml
+
+ awips
+ awips
+
+ after_transaction
+
+ 100
+
+
+
+
+ false
+
+
+ false
+
+
+ false
+
+
+ org.hibernate.connection.C3P0ConnectionProvider
+
+
+
+ 60
+ 1800
+ 10
+ 5
+ ${db.metadata.pool.min}
+ ${db.metadata.pool.max}
+
+ true
+ org.hibernate.transaction.JDBCTransactionFactory
+ thread
+
+ net.sf.ehcache.hibernate.EhCacheProvider
+ true
+ true
+ true
+
+
+
\ No newline at end of file
diff --git a/edexOsgi/build.edex/esb/conf/db/hibernateConfig/metadata/hibernate.cfg.xml b/edexOsgi/build.edex/esb/conf/db/hibernateConfig/metadata/hibernate.cfg.xml
index 3ba6bcbfc9..1c918cfac5 100644
--- a/edexOsgi/build.edex/esb/conf/db/hibernateConfig/metadata/hibernate.cfg.xml
+++ b/edexOsgi/build.edex/esb/conf/db/hibernateConfig/metadata/hibernate.cfg.xml
@@ -69,6 +69,7 @@
falsefalse
+ falsefalse
diff --git a/edexOsgi/build.edex/esb/conf/log4j-datadelivery.xml b/edexOsgi/build.edex/esb/conf/log4j-datadelivery.xml
new file mode 100644
index 0000000000..526ea6dcb6
--- /dev/null
+++ b/edexOsgi/build.edex/esb/conf/log4j-datadelivery.xml
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/edexOsgi/build.edex/esb/conf/log4j-dataprovideragent.xml b/edexOsgi/build.edex/esb/conf/log4j-dataprovideragent.xml
new file mode 100644
index 0000000000..d716071732
--- /dev/null
+++ b/edexOsgi/build.edex/esb/conf/log4j-dataprovideragent.xml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/edexOsgi/build.edex/esb/conf/log4j-registry.xml b/edexOsgi/build.edex/esb/conf/log4j-registry.xml
new file mode 100644
index 0000000000..57a9087cf7
--- /dev/null
+++ b/edexOsgi/build.edex/esb/conf/log4j-registry.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/edexOsgi/build.edex/esb/conf/modes.xml b/edexOsgi/build.edex/esb/conf/modes.xml
index 38b3028de9..ab9be0a2a7 100644
--- a/edexOsgi/build.edex/esb/conf/modes.xml
+++ b/edexOsgi/build.edex/esb/conf/modes.xml
@@ -32,33 +32,114 @@
are compatible with Java's Pattern class. If you provide no
tag for a particular mode, the include defaults to .*.
-->
+
.*request.*.*common.*
-
+ excludeDpaAndOgc
+
purgeutil-request.xml
-
+
+ ebxml.*\.xml
+ event-ingest.xml
+
+
+ registry
+ datadeliverytemplate
+
+ .*datadelivery-registry.*
+
+ .*datadelivery-standalone.*
+
+
+ manualIngest*
+ time-common.xml
+ distribution-spring.xml
+ persist-ingest.xml
+ auth-common.xml
+
+ grib-common.xml
+ grib-distribution.xml
+ grib-datadelivery.xml
+ level-common.xml
+
+ pointdata-common.xml
+ obs-common.xml
+ obs-datadelivery.xml
+
+ .*dpa.*
+
+ .*ogc.*
+
+ fssobs-common
+
+
+ ebxml.*\.xml.*request.*
- grib-ingest.xml
- ncgrib-ingest.xml
-
- aww-ingest.xml
- ncairep-ingest.xml
- ncccfp-ingest.xml
- ncgrib-distribution.xml
- ncep-util-on-edex-ingest
- ncep-util-on-edex-ingestGrib
- ncscd-ingest.xml
- ncpafm-ingest.xml
- ncpirep-ingest.xml
- nctaf-ingest.xml
- nctext-ingest.xml
- ncuair-ingest.xml
-
+ grib-ingest.xml
+ ncgrib-ingest.xml
+ .*datadelivery.*
+ .*bandwidth.*
+ excludeDpaAndOgc
+
+ aww-ingest.xml
+ ncairep-ingest.xml
+ ncccfp-ingest.xml
+ ncgrib-distribution.xml
+ ncep-util-on-edex-ingest
+ ncep-util-on-edex-ingestGrib
+ ncscd-ingest.xml
+ ncpafm-ingest.xml
+ ncpirep-ingest.xml
+ nctaf-ingest.xml
+ nctext-ingest.xml
+ ncuair-ingest.xml
+
+
ffmp-ingest.xmlscan-ingest.xmlcwat-ingest.xml
@@ -68,31 +149,33 @@
qpf-ingest.xmlfssobs-ingest.xmlcpgsrv-spring.xml
+ stats-ingest.xml
- time-common.xml
- grib-common.xml
- grib-ingest.xml
- level-common.xml
+ time-common.xml
+ grib-common.xml
+ grib-ingest.xml
+ level-common.xmlgrid-common.xmlgridcoverage-common.xmlparameter-common.xml
- persist-ingest.xml
- management-common.xml
+ persist-ingest.xml
+ management-common.xmldatabase-common.xml
- auth-common.xml
-
- ncgrib-common.xml
- ncgrib-ingest.xml
- ncep-util-on-edex-ingestGrib
- h5uair-ingest.xml
- h5uair-common.xml
- h5scd-ingest.xml
-
+ auth-common.xml
+
+ ncgrib-common.xml
+ ncgrib-ingest.xml
+ ncep-util-on-edex-ingestGrib
+ h5uair-ingest.xml
+ h5uair-common.xml
+ h5scd-ingest.xml
+
+ excludeDpaAndOgc
- time-common.xml
+ time-common.xmlffmp-ingest.xmlffmp-common.xmlscan-ingest.xml
@@ -108,7 +191,7 @@
qpf-ingest.xmlqpf-common.xmlcpgsrv-spring.xml
- persist-ingest.xml
+ persist-ingest.xmlbinlightning-common.xmlparameter-common.xmlgridcoverage-common.xml
@@ -126,30 +209,32 @@
obs-common.xmlfssobs-ingest.xmlfssobs-common.xml
- ldadmesonet-common.xml
+ ldadmesonet-common.xmlncgrib-common.xml
- nctext-common.xml
+ nctext-common.xml
+ excludeDpaAndOgc
-
-
- grib-common.xml
- grib-ingest.xml
+
+
+
+ grib-common.xml
+ grib-ingest.xmlgrib-distribution.xml
- level-common.xml
- persist-ingest.xml
+ level-common.xml
+ persist-ingest.xmldistribution-spring.xmlmanualIngest-spring.xml
-
-
- text-.*
- textdb-.*
- textdbsrv-.*
+
+
+ text-.*
+ textdb-.*
+ textdbsrv-.*uengine-request.xml
- auth-request.xml
- distribution-spring.xml
+ auth-request.xml
+ distribution-spring.xmlmanualIngest-spring.xml
-
+ .*gfe.*serialize-request.xml
@@ -159,14 +244,15 @@
manualIngest-spring.xml
+ ebxml.*\.xmlalarmWhfs-spring.xmlarealffgGenerator-spring.xml
- dpaDecoder-spring.xml
+ DPADecoder-spring.xmldqcPreprocessor-spring.xmlfloodArchiver-spring.xmlhpeDHRDecoder-spring.xmlohd.*.xml
- ihfsDbPurge-spring.xml
+ ihfsDbPurge-spring.xmllogFilePurger-spring.xmlmpeFieldgen-spring.xmlmpeHpeFilePurge-spring.xml
@@ -174,10 +260,39 @@
ohdSetupService-spring.xmlpointDataRetrievel-spring.xmlq2FileProcessor-spring.xml
- satpre-spring.xml
+ satpre-spring.xmlauth-request.xmlutility-request.xml
-
\ No newline at end of file
+
+ .*datadelivery-standalone.*
+ .*datadelivery-registry.*
+ datadeliverytemplate
+
+
+ .*datadelivery.*
+ .*bandwidth.*
+ time-common.xml
+ grib-common.xml
+ grid-common.xml
+ gridcoverage-common.xml
+ parameter-common.xml
+ pointdata-common.xml
+ obs-common.xml
+ level-common.xml
+ persist-ingest.xml
+ management-common.xml
+ database-common.xml
+ auth-common.xml
+ stats-common.xml
+ event-ingest.xml
+
+
+
+ .*dpa.*
+
+ .*ogc.*
+
+
diff --git a/edexOsgi/build.edex/esb/etc/datadelivery.sh b/edexOsgi/build.edex/esb/etc/datadelivery.sh
new file mode 100644
index 0000000000..9259fd5029
--- /dev/null
+++ b/edexOsgi/build.edex/esb/etc/datadelivery.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+##
+# 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.
+##
+
+export INIT_MEM=512 # in Meg
+
+if [ $HIGH_MEM_FLAG == "on" ]; then
+ export MAX_MEM=1536 # in Meg
+else
+ export MAX_MEM=896 # in Meg
+fi
+
+export METADATA_POOL_MIN=10
+export EDEX_DEBUG_PORT=5009
+export EDEX_JMX_PORT=1620
+export LOG4J_CONF=log4j-datadelivery.xml
+export MGMT_PORT=9605
diff --git a/edexOsgi/build.edex/esb/etc/datadeliveryonly.sh b/edexOsgi/build.edex/esb/etc/datadeliveryonly.sh
new file mode 100644
index 0000000000..9259fd5029
--- /dev/null
+++ b/edexOsgi/build.edex/esb/etc/datadeliveryonly.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+##
+# 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.
+##
+
+export INIT_MEM=512 # in Meg
+
+if [ $HIGH_MEM_FLAG == "on" ]; then
+ export MAX_MEM=1536 # in Meg
+else
+ export MAX_MEM=896 # in Meg
+fi
+
+export METADATA_POOL_MIN=10
+export EDEX_DEBUG_PORT=5009
+export EDEX_JMX_PORT=1620
+export LOG4J_CONF=log4j-datadelivery.xml
+export MGMT_PORT=9605
diff --git a/edexOsgi/build.edex/esb/etc/dataprovideragent.sh b/edexOsgi/build.edex/esb/etc/dataprovideragent.sh
new file mode 100644
index 0000000000..5f1627d854
--- /dev/null
+++ b/edexOsgi/build.edex/esb/etc/dataprovideragent.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+##
+# 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.
+##
+
+export INIT_MEM=512 # in Meg
+
+if [ $HIGH_MEM_FLAG == "on" ]; then
+ export MAX_MEM=1536 # in Meg
+else
+ export MAX_MEM=896 # in Meg
+fi
+export METADATA_POOL_MIN=10
+export EDEX_DEBUG_PORT=5010
+export EDEX_JMX_PORT=1621
+export LOG4J_CONF=log4j-dataprovideragent.xml
+export MGMT_PORT=9606
+
diff --git a/edexOsgi/build.edex/esb/etc/registry.sh b/edexOsgi/build.edex/esb/etc/registry.sh
new file mode 100644
index 0000000000..1f3a9a7d2a
--- /dev/null
+++ b/edexOsgi/build.edex/esb/etc/registry.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+##
+# 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.
+##
+
+export INIT_MEM=512 # in Meg
+
+if [ $HIGH_MEM_FLAG == "on" ]; then
+ export MAX_MEM=1536 # in Meg
+else
+ export MAX_MEM=896 # in Meg
+fi
+export METADATA_POOL_MIN=10
+export EDEX_DEBUG_PORT=5011
+export EDEX_JMX_PORT=1622
+export LOG4J_CONF=log4j-registry.xml
+export MGMT_PORT=9607
+
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/WebConsoleStarter.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/WebConsoleStarter.class
deleted file mode 100644
index 607b30e0e7..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/WebConsoleStarter.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/CopyMessage.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/CopyMessage.class
deleted file mode 100644
index cecd3d5461..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/CopyMessage.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/CreateDestination.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/CreateDestination.class
deleted file mode 100644
index dc8d92abeb..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/CreateDestination.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/CreateSubscriber.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/CreateSubscriber.class
deleted file mode 100644
index d6d03f6c9d..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/CreateSubscriber.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteDestination.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteDestination.class
deleted file mode 100644
index a0c9a3c219..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteDestination.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteMessage.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteMessage.class
deleted file mode 100644
index 17cc728253..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteMessage.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteSubscriber.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteSubscriber.class
deleted file mode 100644
index 686b49dc20..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/DeleteSubscriber.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/MoveMessage.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/MoveMessage.class
deleted file mode 100644
index bc60a24659..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/MoveMessage.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/PurgeDestination.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/PurgeDestination.class
deleted file mode 100644
index 525f442ed6..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/PurgeDestination.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/SendMessage.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/SendMessage.class
deleted file mode 100644
index feca1ffadc..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/controller/SendMessage.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/filter/ApplicationContextFilter$1.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/filter/ApplicationContextFilter$1.class
deleted file mode 100644
index 7d4cbe9219..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/filter/ApplicationContextFilter$1.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/filter/ApplicationContextFilter$2.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/filter/ApplicationContextFilter$2.class
deleted file mode 100644
index 3cc7c96226..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/filter/ApplicationContextFilter$2.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/filter/ApplicationContextFilter.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/filter/ApplicationContextFilter.class
deleted file mode 100644
index 6f9f1d10f4..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/filter/ApplicationContextFilter.class and /dev/null differ
diff --git a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/handler/BindingBeanNameUrlHandlerMapping.class b/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/handler/BindingBeanNameUrlHandlerMapping.class
deleted file mode 100644
index bde8039ac2..0000000000
Binary files a/edexOsgi/build.edex/esb/webapps/admin/WEB-INF/classes/org/apache/activemq/web/handler/BindingBeanNameUrlHandlerMapping.class and /dev/null differ
diff --git a/edexOsgi/build.edex/opt/db/ddl/ebxml/createEbxml.sql b/edexOsgi/build.edex/opt/db/ddl/ebxml/createEbxml.sql
new file mode 100644
index 0000000000..e0f673869b
--- /dev/null
+++ b/edexOsgi/build.edex/opt/db/ddl/ebxml/createEbxml.sql
@@ -0,0 +1,25 @@
+/**
+ * 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.
+ **/
+\set ON_ERROR_STOP 1
+DROP DATABASE IF EXISTS ebxml;
+DROP TABLESPACE IF EXISTS ebxml_data;
+CREATE TABLESPACE ebxml_data OWNER awips LOCATION '%{database_files_home}%/ebxml';
+COMMENT ON TABLESPACE ebxml_data IS 'EBXML Registry Database tablespace';
+CREATE DATABASE ebxml OWNER awips TABLESPACE ebxml_data;
diff --git a/edexOsgi/build.edex/opt/db/ddl/events/createEventsSchema.sql b/edexOsgi/build.edex/opt/db/ddl/events/createEventsSchema.sql
new file mode 100644
index 0000000000..750b1d3499
--- /dev/null
+++ b/edexOsgi/build.edex/opt/db/ddl/events/createEventsSchema.sql
@@ -0,0 +1,22 @@
+/**
+ * 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.
+ **/
+\set ON_ERROR_STOP 1
+\connect metadata;
+CREATE SCHEMA events AUTHORIZATION awips;
diff --git a/edexOsgi/build.edex/opt/db/ddl/setup/pg_hba.conf b/edexOsgi/build.edex/opt/db/ddl/setup/pg_hba.conf
index 73e509c222..84b7146f88 100644
--- a/edexOsgi/build.edex/opt/db/ddl/setup/pg_hba.conf
+++ b/edexOsgi/build.edex/opt/db/ddl/setup/pg_hba.conf
@@ -72,6 +72,7 @@ local maps all trust
local hmdb all trust
local postgres all trust
local ncep all trust
+local ebxml all trust
# IPv4 local connections:
host fxatext all 127.0.0.1/32 trust
host fxatext all 147.18.136.0/24 trust
@@ -105,5 +106,9 @@ host ncep all 127.0.0.1/32 md5
host ncep all 147.18.136.0/24 md5
host ncep all 147.18.139.0/24 md5
host ncep all 162.0.0.0/8 md5
+host ebxml all 127.0.0.1/32 trust
+host ebxml all 147.18.136.0/24 trust
+host ebxml all 147.18.139.0/24 trust
+host ebxml all 162.0.0.0/8 trust
# IPv6 local connections:
host all all ::1/128 md5
diff --git a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/ScriptRunner.java b/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/ScriptRunner.java
index 3ac8ef7566..078b137764 100644
--- a/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/ScriptRunner.java
+++ b/edexOsgi/com.raytheon.edex.autobldsrv/src/com/raytheon/edex/services/ScriptRunner.java
@@ -45,6 +45,7 @@ import com.raytheon.uf.common.message.Header;
import com.raytheon.uf.common.message.Message;
import com.raytheon.uf.common.message.Property;
import com.raytheon.uf.common.serialization.SerializationUtil;
+import com.raytheon.uf.common.util.ReflectionUtil;
import com.raytheon.uf.edex.core.EdexException;
/**
@@ -182,8 +183,9 @@ public class ScriptRunner {
PluginDataObject[] pdos = (PluginDataObject[]) event;
for (PluginDataObject pdo : pdos) {
try {
- String prodID = (String) Util.getFieldValue(pdo,
- pdo.getClass(), "productId");
+ String prodID = ReflectionUtil.getter(String.class,
+ pdo,
+ "productId");
if (logger.isDebugEnabled()) {
logger.debug("Processing trigger: " + prodID
+ ", class = "
@@ -198,8 +200,8 @@ public class ScriptRunner {
} else if (event instanceof PluginDataObject) {
PluginDataObject pdo = (PluginDataObject) event;
try {
- String prodID = (String) Util.getFieldValue(pdo,
- pdo.getClass(), "productId");
+ String prodID = ReflectionUtil.getter(String.class,
+ pdo, "productId");
if (logger.isDebugEnabled()) {
logger.debug("Processing trigger: " + prodID
+ ", class = "
diff --git a/edexOsgi/com.raytheon.edex.common/res/ehcache.xml b/edexOsgi/com.raytheon.edex.common/res/ehcache.xml
index fcb3dc0e84..8a614278af 100644
--- a/edexOsgi/com.raytheon.edex.common/res/ehcache.xml
+++ b/edexOsgi/com.raytheon.edex.common/res/ehcache.xml
@@ -1,54 +1,6 @@
-
-
-
-
-
-
-
-
-
+
-
-
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/util/Util.java b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/util/Util.java
index ad9b10f493..f6c4e96371 100644
--- a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/util/Util.java
+++ b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/util/Util.java
@@ -161,35 +161,6 @@ public final class Util {
return "[" + (obj == null ? "null" : obj.toString()) + "]";
}
- /**
- * Obtains the value of the specified field from the object.
- *
- * @param object
- * the object containing the field
- * @param classObj
- * the class of the object
- * @param name
- * the name of the field
- *
- * @return the value of the field
- *
- * @throws NoSuchMethodException
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- */
- @SuppressWarnings("unchecked")
- public static Object getFieldValue(Object object, Class classObj,
- String name) throws NoSuchMethodException,
- InvocationTargetException, IllegalAccessException {
- Object obj = null;
- StringBuffer getter = new StringBuffer("get").append(
- name.substring(0, 1).toUpperCase()).append(name.substring(1));
- Method worker = classObj.getMethod(getter.toString(), (Class[]) null);
- obj = worker.invoke(object, (Object[]) null);
- return obj;
-
- }
-
/**
* Invokes the setter for the specified field on an object.
*
@@ -971,8 +942,7 @@ public final class Util {
*
* @return the converted object
*/
- @SuppressWarnings("unchecked")
- public static Object getObjForStr(String string, Class aClass) {
+ public static Object getObjForStr(String string, Class> aClass) {
Object retValue = null;
diff --git a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/utility/EDEXLocalizationAdapter.java b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/utility/EDEXLocalizationAdapter.java
index 75684652dd..50eb0cc65a 100644
--- a/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/utility/EDEXLocalizationAdapter.java
+++ b/edexOsgi/com.raytheon.edex.common/src/com/raytheon/edex/utility/EDEXLocalizationAdapter.java
@@ -119,7 +119,7 @@ public class EDEXLocalizationAdapter implements ILocalizationAdapter {
}
}
- private String getSiteName() {
+ protected String getSiteName() {
String site = PropertiesFactory.getInstance().getEnvProperties()
.getEnvValue("SITENAME");
@@ -176,12 +176,7 @@ public class EDEXLocalizationAdapter implements ILocalizationAdapter {
@Override
public File getPath(LocalizationContext context, String fileName) {
- String baseDir = null;
-
- EnvProperties env = PropertiesFactory.getInstance().getEnvProperties();
-
- String utilityDir = new File(env.getEnvValue("UTILITYDIR"))
- .getAbsolutePath();
+ File utilityDir = getUtilityDir();
if (context.getLocalizationLevel() == LocalizationLevel.UNKNOWN) {
throw new IllegalArgumentException(
@@ -191,11 +186,11 @@ public class EDEXLocalizationAdapter implements ILocalizationAdapter {
// TODO: Check for invalid type / level combinations
// Change the above condition and add invalid type / level checking
// if needed
- } else {
- baseDir = utilityDir + File.separator + context.toPath();
}
- return new File(baseDir + File.separator + fileName);
+ File baseDir = new File(utilityDir, context.toPath());
+
+ return new File(baseDir, fileName);
}
/*
@@ -212,6 +207,17 @@ public class EDEXLocalizationAdapter implements ILocalizationAdapter {
return type;
}
+ /**
+ * Get the file reference to the utility directory.
+ *
+ * @return the file reference to the utility directory
+ */
+ protected File getUtilityDir() {
+ EnvProperties env = PropertiesFactory.getInstance().getEnvProperties();
+
+ return new File(env.getEnvValue("UTILITYDIR"));
+ }
+
/**
* Create ListResponse metadata
*
diff --git a/edexOsgi/com.raytheon.edex.common/unit-test/com/raytheon/edex/subscription/TestSubscriptionManager.java b/edexOsgi/com.raytheon.edex.common/unit-test/com/raytheon/edex/subscription/TestSubscriptionManager.java
deleted file mode 100644
index 030daa352d..0000000000
--- a/edexOsgi/com.raytheon.edex.common/unit-test/com/raytheon/edex/subscription/TestSubscriptionManager.java
+++ /dev/null
@@ -1,157 +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.edex.subscription;
-
-import static com.raytheon.edex.subscription.AddScriptAction.addScript;
-import static com.raytheon.edex.subscription.DeleteScriptAction.deleteScript;
-import static org.hamcrest.Matchers.instanceOf;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-
-import org.jmock.Expectations;
-import org.jmock.Mockery;
-import org.jmock.integration.junit4.JMock;
-import org.jmock.integration.junit4.JUnit4Mockery;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import com.raytheon.edex.db.dao.ISubscriber;
-import com.raytheon.edex.exception.SubscriptionException;
-import com.raytheon.uf.edex.database.DataAccessLayerException;
-
-
-
-/**
- *
- *
+ *
+ * @author bgonzale
+ * @version 1.0
+ */
+
+public class AuthorizationException extends Exception {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ *
+ */
+ public AuthorizationException() {
+ }
+
+ /**
+ * @param message
+ */
+ public AuthorizationException(String message) {
+ super(message);
+ }
+
+ /**
+ * @param cause
+ */
+ public AuthorizationException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public AuthorizationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
diff --git a/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/exception/RoleApplicationNotFoundException.java b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/exception/RoleApplicationNotFoundException.java
new file mode 100644
index 0000000000..4c317cb05a
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/exception/RoleApplicationNotFoundException.java
@@ -0,0 +1,71 @@
+/**
+ * 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.plugin.nwsauth.exception;
+
+/**
+ * Exception when the application id for a role is not found.
+ *
+ *
+ *
+ * @author bgonzale
+ * @version 1.0
+ */
+
+public class RoleApplicationNotFoundException extends AuthorizationException {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ *
+ */
+ public RoleApplicationNotFoundException() {
+ }
+
+ /**
+ * @param message
+ */
+ public RoleApplicationNotFoundException(String message) {
+ super(message);
+ }
+
+ /**
+ * @param cause
+ */
+ public RoleApplicationNotFoundException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * @param message
+ * @param cause
+ */
+ public RoleApplicationNotFoundException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
diff --git a/edexOsgi/com.raytheon.uf.edex.auth/src/com/raytheon/uf/edex/auth/roles/IRole.java b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/roles/IRole.java
similarity index 96%
rename from edexOsgi/com.raytheon.uf.edex.auth/src/com/raytheon/uf/edex/auth/roles/IRole.java
rename to edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/roles/IRole.java
index 2246d4bcf0..e8cb749336 100644
--- a/edexOsgi/com.raytheon.uf.edex.auth/src/com/raytheon/uf/edex/auth/roles/IRole.java
+++ b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/roles/IRole.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.edex.auth.roles;
+package com.raytheon.uf.common.plugin.nwsauth.roles;
import com.raytheon.uf.common.auth.user.IUser;
diff --git a/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/roles/IRoleStorage.java b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/roles/IRoleStorage.java
new file mode 100644
index 0000000000..e479bf4573
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/roles/IRoleStorage.java
@@ -0,0 +1,71 @@
+/**
+ * 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.plugin.nwsauth.roles;
+
+import com.raytheon.uf.common.plugin.nwsauth.exception.AuthorizationException;
+
+/**
+ * Storage class for roles. NOTE, ALL ROLES IDS SHOULD BE TREATED AS
+ * CASE-INSENSITIVE
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * May 18, 2010 mschenke Initial creation
+ *
+ *
+ *
+ * @author mschenke
+ * @version 1.0
+ */
+
+public interface IRoleStorage {
+
+ /**
+ * Determine if the permission is valid for the user in the application.
+ *
+ * @param permission
+ * The permissions id
+ * @param user
+ * The user id
+ * @param application
+ * The application
+ *
+ * @return true if the permission is authorized for the user in the
+ * specified application
+ * @throws AuthorizationException
+ */
+ public boolean isAuthorized(String permission, String user,
+ String application) throws AuthorizationException;
+
+ /**
+ * Get all the defined permissions for this application.
+ *
+ * @param application
+ * The application
+ *
+ * @return String[] of permissions
+ * @throws AuthorizationException
+ */
+ public String[] getAllDefinedPermissions(String application)
+ throws AuthorizationException;
+}
diff --git a/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/xml/NwsRoleData.java b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/xml/NwsRoleData.java
new file mode 100644
index 0000000000..6dd1df05b6
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/xml/NwsRoleData.java
@@ -0,0 +1,305 @@
+package com.raytheon.uf.common.plugin.nwsauth.xml;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import com.raytheon.uf.common.serialization.ISerializableObject;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
+
+@XmlRootElement(name = "nwsRoleData")
+@XmlAccessorType(XmlAccessType.NONE)
+@DynamicSerialize
+public class NwsRoleData implements ISerializableObject {
+ @DynamicSerializeElement
+ @XmlElement(name = "application")
+ private String application;
+
+ @DynamicSerializeElement
+ @XmlElements({ @XmlElement(name = "permission", type = PermissionXML.class) })
+ private List permissionList = new ArrayList();
+
+ @DynamicSerializeElement
+ @XmlElements({ @XmlElement(name = "role", type = RoleXML.class) })
+ private List roleList = new ArrayList();
+
+ @DynamicSerializeElement
+ @XmlElements({ @XmlElement(name = "user", type = UserXML.class) })
+ private List userList = new ArrayList();
+
+ /** Map of user to all permissions */
+ private transient Map> permissionMap = new HashMap>();
+
+ /**
+ * @return the permissionList
+ */
+ public List getPermissionList() {
+ return permissionList;
+ }
+
+ /**
+ * @param permissionList
+ * the permissionList to set
+ */
+ public void setPermissionList(List permissionList) {
+ this.permissionList = permissionList;
+ }
+
+ /**
+ * @return the roleList
+ */
+ public List getRoleList() {
+ return roleList;
+ }
+
+ /**
+ * @param roleList
+ * the roleList to set
+ */
+ public void setRoleList(List roleList) {
+ this.roleList = roleList;
+ }
+
+ /**
+ * @return the userList
+ */
+ public List getUserList() {
+ return userList;
+ }
+
+ /**
+ * @param userList
+ * the userList to set
+ */
+ public void setUserList(List userList) {
+ this.userList = userList;
+ }
+
+ /**
+ * @return the application
+ */
+ public String getApplication() {
+ return application;
+ }
+
+ /**
+ * @param application
+ * the application to set
+ */
+ public void setApplication(String application) {
+ this.application = application;
+ }
+
+ public String[] getPermissions() {
+ ArrayList perms = new ArrayList();
+ for (PermissionXML p : this.permissionList) {
+ perms.add(p.getId());
+ }
+ Collections.sort(perms);
+
+ return perms.toArray(new String[perms.size()]);
+ }
+
+ public String[] getRoles() {
+ ArrayList roles = new ArrayList();
+ for (RoleXML r : this.roleList) {
+ roles.add(r.getRoleId());
+ }
+ Collections.sort(roles);
+
+ return roles.toArray(new String[roles.size()]);
+ }
+
+ public String[] getUsers() {
+ ArrayList users = new ArrayList();
+ for (UserXML r : this.userList) {
+ users.add(r.getUserId());
+ }
+ Collections.sort(users);
+
+ return users.toArray(new String[users.size()]);
+ }
+
+ public void addUser(String user) {
+ if (user != null && user.length() > 0) {
+ UserXML userXml = new UserXML();
+ userXml.setUserId(user);
+ this.userList.add(userXml);
+ }
+ }
+
+ public void addRole(String role, String description) {
+ if (role != null && description != null && role.length() > 0 && description.length() > 0) {
+ RoleXML roleXml = new RoleXML();
+ roleXml.setRoleDescription(description);
+ roleXml.setRoleId(role);
+ this.roleList.add(roleXml);
+ }
+ }
+
+ /**
+ * Add a permission. This should only be used for
+ * Localization permissions, which are directory access
+ * permissions.
+ *
+ * @param permission
+ */
+ public void addPermission(String permission) {
+ if (permission != null && permission.length() > 0) {
+ PermissionXML pXml = new PermissionXML();
+ pXml.setId(permission);
+ this.permissionList.add(pXml);
+ }
+ }
+
+ /**
+ * Get the user's permissions
+ *
+ * @param userId id of the user
+ * @return String[] of permissions
+ */
+ public String[] getUserPermissions(String userId) {
+ ArrayList userPermissions = new ArrayList();
+
+ for (UserXML userXml : this.userList) {
+ if (userXml.getUserId().equals(userId)) {
+ for (String permission : userXml.getPermissionList()) {
+ userPermissions.add(permission);
+ }
+ break;
+ }
+ }
+ Collections.sort(userPermissions);
+
+ return userPermissions.toArray(new String[userPermissions.size()]);
+ }
+
+ /**
+ * Get an array of all defined permissions
+ *
+ * @return String[] of all defined permissions
+ */
+ public String[] getAllDefinedPermissions() {
+ ArrayList permissions = new ArrayList();
+ for (PermissionXML p: this.permissionList) {
+ permissions.add(p.getId());
+ }
+
+ return permissions.toArray(new String[permissions.size()]);
+ }
+
+ public String[] getRolePermissions(String roleId) {
+ ArrayList rolePermissions = new ArrayList();
+
+ for (RoleXML roleXml : this.roleList) {
+ if (roleXml.getRoleId().equals(roleId)) {
+ for (String permission : roleXml.getPermissionList()) {
+ rolePermissions.add(permission);
+ }
+ break;
+ }
+ }
+ Collections.sort(rolePermissions);
+
+ return rolePermissions.toArray(new String[rolePermissions.size()]);
+ }
+
+ public String[] getUserRoles(String userId) {
+ ArrayList userRoles = new ArrayList();
+
+ for (UserXML userXml : this.userList) {
+ if (userXml.getUserId().equals(userId)) {
+ for (String role : userXml.getRoleList()) {
+ userRoles.add(role);
+ }
+ break;
+ }
+ }
+ Collections.sort(userRoles);
+
+ return userRoles.toArray(new String[userRoles.size()]);
+ }
+
+ public String[] getRoleIdList() {
+ ArrayList roleIdList = new ArrayList();
+ for (RoleXML rx : this.roleList) {
+ roleIdList.add(rx.getRoleId());
+ }
+ Collections.sort(roleIdList);
+
+ return roleIdList.toArray(new String[roleIdList.size()]);
+ }
+
+ /**
+ * Get a list of all permissions for this user.
+ *
+ * @param user
+ * The user
+ *
+ * @return Set of all permissions
+ */
+ private Set getAuthorizedPermissions(String user) {
+ if (!permissionMap.containsKey(user)) {
+ Set permSet = new HashSet();
+
+ for (String p : this.getUserPermissions(user)) {
+ permSet.add(p);
+ }
+
+ String[] roles = this.getUserRoles(user);
+
+ for (RoleXML roleXml : roleList) {
+ for (String role : roles) {
+ if (roleXml.getRoleId().equals(role)) {
+ for (String p: roleXml.getPermissionList()) {
+ permSet.add(p);
+ }
+ }
+ }
+ }
+
+ permissionMap.put(user, permSet);
+ }
+
+ return permissionMap.get(user);
+ }
+
+ /**
+ * If the user has the permission then the user is authorized.
+ *
+ * @param permission
+ * the permission id
+ * @param user
+ * the user id
+ * @return true if the user has the permission
+ */
+ public boolean isAuthorized(String permission, String user) {
+ Set authorizedPermissions = this.getAuthorizedPermissions(user);
+ Set allAuthorizedPermissions = this.getAuthorizedPermissions("ALL");
+
+ for (String perm: authorizedPermissions) {
+ if (perm.equalsIgnoreCase(permission)) {
+ return true;
+ }
+ }
+
+ for (String perm: allAuthorizedPermissions) {
+ if (perm.equalsIgnoreCase(permission)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/xml/NwsRoleStorage.java b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/xml/NwsRoleStorage.java
new file mode 100644
index 0000000000..776f137d7e
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/xml/NwsRoleStorage.java
@@ -0,0 +1,139 @@
+package com.raytheon.uf.common.plugin.nwsauth.xml;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.raytheon.uf.common.localization.IPathManager;
+import com.raytheon.uf.common.localization.LocalizationContext;
+import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
+import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
+import com.raytheon.uf.common.localization.LocalizationFile;
+import com.raytheon.uf.common.localization.PathManagerFactory;
+import com.raytheon.uf.common.plugin.nwsauth.exception.AuthorizationException;
+import com.raytheon.uf.common.plugin.nwsauth.exception.RoleApplicationNotFoundException;
+import com.raytheon.uf.common.plugin.nwsauth.roles.IRoleStorage;
+import com.raytheon.uf.common.serialization.SerializationUtil;
+import com.raytheon.uf.common.status.UFStatus;
+import com.raytheon.uf.common.status.UFStatus.Priority;
+
+/**
+ * Implementation of IRoleStorage
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * May 25, 2010 rgeorge Initial creation
+ *
+ *
+ *
+ * @author rgeorge
+ * @version 1.0
+ */
+public class NwsRoleStorage implements IRoleStorage {
+ private static NwsRoleStorage instance = null;
+
+ private Map lastUsedFileMap = new HashMap();
+
+ private Map lastModificationTimeMap = new HashMap();
+
+ private Map applicationRoleMap = new HashMap();
+
+ /**
+ * This is called from the CAVE side for the User Administration dialogs. Do
+ * not call this from EDEX, use AuthManager instead
+ *
+ * @return Instance of NwsRoleStorage
+ */
+ public static NwsRoleStorage getInstance() {
+ if (instance == null) {
+ instance = new NwsRoleStorage();
+ }
+
+ return instance;
+ }
+
+ private NwsRoleStorage() {
+ getRoleDataFiles();
+ }
+
+ private synchronized void getRoleDataFiles() {
+ IPathManager pm = PathManagerFactory.getPathManager();
+
+ // Check COMMON_STATIC base and site levels
+ LocalizationContext[] contexts = new LocalizationContext[2];
+ contexts[0] = pm.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.BASE);
+ contexts[1] = pm.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
+
+ String[] extensions = new String[] { ".xml" };
+ LocalizationFile[] localizationFiles =
+ PathManagerFactory.getPathManager().listFiles(contexts, "roles", extensions, true, true);
+
+ File file = null;
+ for (LocalizationFile locFile : localizationFiles) {
+ NwsRoleData roleData = new NwsRoleData();
+ if (locFile.exists()) {
+ file = locFile.getFile();
+
+ if (lastUsedFileMap.get(locFile.getName()) == null
+ || (file != null && (file.equals(lastUsedFileMap.get(locFile.getName())) == false || file
+ .lastModified() > lastModificationTimeMap.get(locFile.getName())))) {
+ // First time we found a role file, or we have a different
+ // file to
+ // use or we were modified since our last check
+ lastUsedFileMap.put(locFile.getName(), file);
+ try {
+ roleData = (NwsRoleData) SerializationUtil.jaxbUnmarshalFromXmlFile(file.getAbsolutePath());
+ applicationRoleMap.put(roleData.getApplication(), roleData);
+ } catch (Exception e) {
+ UFStatus.getHandler().handle(Priority.PROBLEM, "Error loading file: " + file.getName(), e);
+ }
+
+ lastModificationTimeMap.put(locFile.getName(), file.lastModified());
+ }
+ }
+ }
+ }
+
+ /**
+ * Get the role/permission data for the application specified.
+ *
+ * @param application
+ * The application
+ *
+ * @return the NWSRoleData object for that application.
+ */
+ public NwsRoleData getRoleData(String application)
+ throws AuthorizationException {
+ getRoleDataFiles();
+ NwsRoleData roleData = applicationRoleMap.get(application);
+ if (roleData == null) {
+ throw new RoleApplicationNotFoundException("Application name, \""
+ + application
+ + "\", was not found in the authorization configuration.");
+ }
+ return roleData;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.raytheon.uf.common.plugin.nwsauth.roles.IRoleStorage#isAuthorized
+ * (java.lang.String, java.lang.String, java.lang.String)
+ */
+ @Override
+ public boolean isAuthorized(String permission, String user,
+ String application) throws AuthorizationException {
+ NwsRoleData roleData = getRoleData(application);
+ return roleData.isAuthorized(permission, user);
+ }
+
+ @Override
+ public String[] getAllDefinedPermissions(String application)
+ throws AuthorizationException {
+ return getRoleData(application).getAllDefinedPermissions();
+ }
+}
diff --git a/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/xml/PermissionXML.java b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/xml/PermissionXML.java
new file mode 100644
index 0000000000..824f9af8de
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/xml/PermissionXML.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.common.plugin.nwsauth.xml;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
+import com.raytheon.uf.common.serialization.ISerializableObject;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
+
+/**
+ * Permission Element
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * May 18, 2012 mpduff Initial creation.
+ * Oct 2, 2012 1237 jpiatt Allow for null description.
+ *
+ *
+ *
+ * @author mpduff
+ * @version 1.0
+ */
+@XmlAccessorType(XmlAccessType.NONE)
+@DynamicSerialize
+public class PermissionXML implements ISerializableObject {
+
+ @DynamicSerializeElement
+ @XmlAttribute(name = "id")
+ private String id;
+
+ @DynamicSerializeElement
+ @XmlElement(name = "description", type = String.class)
+ private String description;
+
+ /**
+ * Get the permission id.
+ *
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * Set the permission id.
+ *
+ * @param id
+ * the id to set
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * Get the permission description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Set the permission description.
+ *
+ * @param description
+ * the description to set
+ */
+ public void setDescription(String description) {
+ this.description = (description == null) ? null : description.trim();
+ }
+}
diff --git a/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/xml/RoleXML.java b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/xml/RoleXML.java
new file mode 100644
index 0000000000..e7837915a3
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.plugin.nwsauth/src/com/raytheon/uf/common/plugin/nwsauth/xml/RoleXML.java
@@ -0,0 +1,120 @@
+/**
+ * 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.plugin.nwsauth.xml;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+
+import com.raytheon.uf.common.serialization.ISerializableObject;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
+
+/**
+ * Role element
+ *
+ *
* SOFTWARE HISTORY
- * Date Ticket# Engineer Description
- * ------------ ---------- ----------- --------------------------
- * Aug 13, 2008 #1448 chammack Initial creation
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Aug 13, 2008 #1448 chammack Initial creation
+ * Mar 27, 2012 #428 dgilling Add support for built-in
+ * classes used by data delivery's
+ * registry service.
+ * Sep 28, 2012 #1195 djohnson Add ability to specify adapter at field level.
* Oct 08, 2012 #1251 dgilling Ensure type registered with
* serialization adapter is encoded
* in serialization stream.
@@ -113,6 +125,7 @@ public class DynamicSerializationManager {
// TODO: Can the registration of adapters that require dependencies be
// moved to a separate plugin somehow?
registerAdapter(GregorianCalendar.class, new CalendarSerializer());
+ registerAdapter(XMLGregorianCalendarImpl.class, new BuiltInTypeSupport.XMLGregorianCalendarSerializer());
registerAdapter(Date.class, new DateSerializer());
registerAdapter(Timestamp.class, new TimestampSerializer());
registerAdapter(java.sql.Date.class,
@@ -121,12 +134,20 @@ public class DynamicSerializationManager {
registerAdapter(Coordinate.class, new CoordAdapter());
registerAdapter(BigDecimal.class,
new BuiltInTypeSupport.BigDecimalSerializer());
+ registerAdapter(BigInteger.class,
+ new BuiltInTypeSupport.BigIntegerSerializer());
registerAdapter(Geometry.class, new GeometryTypeAdapter());
+ registerAdapter(Polygon.class, new GeometryTypeAdapter());
+ registerAdapter(MultiPolygon.class, new GeometryTypeAdapter());
+ registerAdapter(Point.class, new GeometryTypeAdapter());
registerAdapter(Envelope.class, new JTSEnvelopeAdapter());
registerAdapter(GridGeometry2D.class, new GridGeometry2DAdapter());
registerAdapter(GeneralGridGeometry.class, new GridGeometryAdapter());
registerAdapter(EnumSet.class, new EnumSetAdapter());
registerAdapter(StackTraceElement.class, new StackTraceElementAdapter());
+ registerAdapter(Duration.class, new BuiltInTypeSupport.DurationSerializer());
+ registerAdapter(QName.class, new BuiltInTypeSupport.QNameSerializer());
+ registerAdapter(Throwable.class, new BuiltInTypeSupport.ThrowableSerializer());
// These two are OBE by BufferAdapter and should be deleted sometime
registerAdapter(ByteBuffer.class, new ByteBufferAdapter());
registerAdapter(FloatBuffer.class, new FloatBufferAdapter());
@@ -256,7 +277,7 @@ public class DynamicSerializationManager {
throws SerializationException {
return ((ThriftSerializationContext) ctx).deserializeMessage();
}
-
+
public static void registerAdapter(Class extends T> clazz,
ISerializationTypeAdapter adapter) {
SerializationMetadata md = new SerializationMetadata();
@@ -269,7 +290,7 @@ public class DynamicSerializationManager {
}
serializedAttributes.put(md.adapterStructName, md);
}
-
+
/**
* Inspect a class and return the metadata for the object
*
@@ -281,6 +302,7 @@ public class DynamicSerializationManager {
* the class
* @return the metadata
*/
+ @SuppressWarnings("rawtypes")
public static SerializationMetadata inspect(Class> c) {
// Check for base types
@@ -370,17 +392,30 @@ public class DynamicSerializationManager {
if (annotation != null) {
String fieldName = field.getName();
- attribs.serializedAttributes.add(field.getName());
+ attribs.serializedAttributes.add(fieldName);
+
+ // Can be specified at field or class level
+ Class extends ISerializationTypeAdapter> fieldAdapter = null;
if (serializeAdapterTag == null) {
- serializeAdapterTag = field.getType()
+ // Adapter specified at field level
+ if (annotation.value() != ISerializationTypeAdapter.class) {
+ fieldAdapter = annotation.value();
+ } else {
+ // Adapter specified at class level
+ serializeAdapterTag = field
+ .getType()
.getAnnotation(
DynamicSerializeTypeAdapter.class);
+ if (serializeAdapterTag != null) {
+ fieldAdapter = serializeAdapterTag
+ .factory();
+ }
+ }
}
- if (serializeAdapterTag != null) {
+ if (fieldAdapter != null) {
try {
attribs.attributesWithFactories.put(fieldName,
- serializeAdapterTag.factory()
- .newInstance());
+ fieldAdapter.newInstance());
} catch (Exception e) {
throw new RuntimeException(
"Factory could not be instantiated", e);
diff --git a/edexOsgi/com.raytheon.uf.common.serialization.comm/src/com/raytheon/uf/common/serialization/comm/util/ExceptionWrapper.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/ExceptionWrapper.java
similarity index 94%
rename from edexOsgi/com.raytheon.uf.common.serialization.comm/src/com/raytheon/uf/common/serialization/comm/util/ExceptionWrapper.java
rename to edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/ExceptionWrapper.java
index 6b460f8c6b..da8527f8bb 100644
--- a/edexOsgi/com.raytheon.uf.common.serialization.comm/src/com/raytheon/uf/common/serialization/comm/util/ExceptionWrapper.java
+++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/ExceptionWrapper.java
@@ -17,9 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.serialization.comm.util;
-
-import com.raytheon.uf.common.serialization.SerializableExceptionWrapper;
+package com.raytheon.uf.common.serialization;
/**
* Class used to wrap/unwrap throwables in a serializable form to be transported
@@ -31,6 +29,7 @@ import com.raytheon.uf.common.serialization.SerializableExceptionWrapper;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 10, 2009 mschenke Initial creation
+ * Sep 14, 2012 1169 djohnson Moved to com.raytheon.uf.common.serialization
*
*
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+
+@XmlAccessorType(XmlAccessType.NONE)
+public class MapEntryType {
+
+ @XmlElement
+ private K key;
+
+ @XmlElement
+ private V value;
+
+ public MapEntryType() {
+ }
+
+ public MapEntryType(Map.Entry e) {
+ key = e.getKey();
+ value = e.getValue();
+ }
+
+ public K getKey() {
+ return key;
+ }
+
+ public void setKey(K key) {
+ this.key = key;
+ }
+
+ public V getValue() {
+ return value;
+ }
+
+ public void setValue(V value) {
+ this.value = value;
+ }
+}
diff --git a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/MapType.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/MapType.java
new file mode 100644
index 0000000000..f70e7fb1fb
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/MapType.java
@@ -0,0 +1,62 @@
+/**
+ * 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.serialization;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Used by Jaxb to represent a {@link Map}.
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+
+public class MapType {
+ private List> entry = new ArrayList>();
+
+ public MapType() {
+ }
+
+ public MapType(Map map) {
+ for (Map.Entry mapEntry : map.entrySet()) {
+ entry.add(new MapEntryType(mapEntry));
+ }
+ }
+
+ public List> getEntry() {
+ return entry;
+ }
+
+ public void setEntry(List> entry) {
+ this.entry = entry;
+ }
+}
diff --git a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializableExceptionWrapper.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializableExceptionWrapper.java
index 2cf2293699..4463489d51 100644
--- a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializableExceptionWrapper.java
+++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializableExceptionWrapper.java
@@ -32,6 +32,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 10, 2009 mschenke Initial creation
+ * Sep 14, 2012 1169 djohnson Moved to com.raytheon.uf.common.serialization
*
*
*
diff --git a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializableManager.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializableManager.java
index 8e66da2368..fd973cd298 100644
--- a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializableManager.java
+++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializableManager.java
@@ -37,6 +37,7 @@ import java.util.Set;
import javax.persistence.Embeddable;
import javax.persistence.Entity;
import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRegistry;
import com.raytheon.uf.common.serialization.jaxb.JaxbDummyObject;
@@ -298,7 +299,8 @@ public class SerializableManager {
Class c = (Class) Class
.forName(clazz, true, cl);
boolean added = false;
- if (c.getAnnotation(XmlAccessorType.class) != null) {
+ if (c.getAnnotation(XmlAccessorType.class) != null
+ || c.getAnnotation(XmlRegistry.class) != null) {
addToClazzSet(c);
added = true;
}
diff --git a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializationUtil.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializationUtil.java
index 2cd17e7efd..c853ad84e1 100644
--- a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializationUtil.java
+++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/SerializationUtil.java
@@ -40,6 +40,9 @@ import com.raytheon.uf.common.serialization.DynamicSerializationManager.Serializ
* ------------ ---------- ----------- --------------------------
* Sep 24, 2008 chammack Initial creation
* Nov 13, 2008 njensen Added thrift methods
+ * Sep 07, 2012 1102 djohnson Overload jaxbUnmarshall and transformFromThrift methods
+ * to accept class parameter, deprecate old versions. Improve performance
+ * of getJaxbManager().
*
*
*
@@ -47,43 +50,79 @@ import com.raytheon.uf.common.serialization.DynamicSerializationManager.Serializ
* @version 1.0
*/
-public class SerializationUtil {
+public final class SerializationUtil {
- private static JAXBManager jaxbManager = null;
+ // @VisibleForTesting
+ static volatile JAXBManager jaxbManager;
private SerializationUtil() {
}
- public static synchronized JAXBManager getJaxbManager()
- throws JAXBException {
- if (jaxbManager == null) {
- List> jaxbClasses = SerializableManager
- .getInstance().getJaxbables();
- jaxbManager = new JAXBManager(
- jaxbClasses.toArray(new Class[jaxbClasses.size()]));
- }
- return jaxbManager;
- }
+ /**
+ * Retrieve the {@link JAXBManager} instance. Lazily-initialized using
+ * proper double-checked locking. This version performs better than
+ * synchronizing the entire method.
+ *
+ * @return the {@link JAXBManager}
+ * @see http://en.wikipedia.org/wiki/Double-checked_locking
+ * @throws JAXBException
+ */
+ public static JAXBManager getJaxbManager() throws JAXBException {
+ JAXBManager result = jaxbManager;
+ if (result == null) {
+ synchronized (SerializationUtil.class) {
+ result = jaxbManager;
+ if (result == null) {
+ List> jaxbClasses = SerializableManager
+ .getInstance().getJaxbables();
+ jaxbManager = result = new JAXBManager(
+ jaxbClasses.toArray(new Class[jaxbClasses.size()]));
+
+ }
+ }
+ }
+ return result;
+ }
public static JAXBContext getJaxbContext() throws JAXBException {
return getJaxbManager().getJaxbContext();
}
- /**
- * Instantiates an object from the XML representation in a string. Uses
- * JAXB.
- *
- * @param xml
- * The XML representation
- * @return A new instance from the XML representation
- * @throws JAXBException
- */
+ /**
+ * Instantiates an object from the XML representation in a string. Uses
+ * JAXB.
+ *
+ * @param xml
+ * The XML representation
+ * @return A new instance from the XML representation
+ * @throws JAXBException
+ * @deprecated Use {@link #unmarshalFromXml(Class, String)} which performs
+ * the cast for you, and wraps any {@link ClassCastException}s
+ * in a serialization exception
+ */
+ @Deprecated
public static Object unmarshalFromXml(String xml) throws JAXBException {
- return getJaxbManager().unmarshalFromXml(xml);
+ return unmarshalFromXml(Object.class, xml);
}
+ /**
+ * Instantiates an object from the XML representation in a string. Uses
+ * JAXB.
+ *
+ * @param clazz
+ * the class object of the result type
+ * @param xml
+ * The XML representation
+ * @return A new instance from the XML representation
+ * @throws JAXBException
+ */
+ public static T unmarshalFromXml(Class clazz, String xml)
+ throws JAXBException {
+ return clazz.cast(getJaxbManager().unmarshalFromXml(xml));
+ }
+
/**
* Convert an instance of a class to an XML representation in a string. Uses
* JAXB.
@@ -117,58 +156,123 @@ public class SerializationUtil {
}
- /**
- * Instantiates an object from the XML representation in a File. Uses JAXB.
- *
- * @param filePath
- * The path to the XML file
- * @return A new instance from the XML representation
- * @throws SerializationException
- */
+ /**
+ * Instantiates an object from the XML representation in a File. Uses JAXB.
+ *
+ * @param filePath
+ * The path to the XML file
+ * @return A new instance from the XML representation
+ * @throws SerializationException
+ * @deprecated Use {@link #jaxbUnmarshalFromXmlFile(Class, String)} which
+ * performs the cast for you, and wraps any
+ * {@link ClassCastException}s in a serialization exception
+ */
+ @Deprecated
public static Object jaxbUnmarshalFromXmlFile(String filePath)
throws SerializationException {
- try {
- return getJaxbManager().jaxbUnmarshalFromXmlFile(filePath);
- } catch (JAXBException e) {
- throw new SerializationException(e);
- }
+ return jaxbUnmarshalFromXmlFile(Object.class, filePath);
}
- /**
- * Instantiates an object from the XML representation in a File. Uses JAXB.
- *
- * @param filePath
- * The XML file
- * @return A new instance from the XML representation
- * @throws SerializationException
- */
+ /**
+ * Instantiates an object from the XML representation in a File. Uses JAXB.
+ *
+ * @param clazz
+ * the result type class
+ * @param filePath
+ * The path to the XML file
+ * @return A new instance from the XML representation
+ * @throws SerializationException
+ *
+ */
+ public static T jaxbUnmarshalFromXmlFile(Class clazz, String filePath)
+ throws SerializationException {
+ try {
+ return clazz.cast(getJaxbManager().jaxbUnmarshalFromXmlFile(
+ filePath));
+ } catch (JAXBException e) {
+ throw new SerializationException(e);
+ }
+ }
+
+ /**
+ * Instantiates an object from the XML representation in a File. Uses JAXB.
+ *
+ * @param filePath
+ * The XML file
+ * @return A new instance from the XML representation
+ * @throws SerializationException
+ * @deprecated Use {@link #jaxbUnmarshalFromXmlFile(Class, File)} which
+ * performs the cast for you, and wraps any
+ * {@link ClassCastException}s in a serialization exception
+ */
+ @Deprecated
public static Object jaxbUnmarshalFromXmlFile(File file)
throws SerializationException {
- try {
- return getJaxbManager().jaxbUnmarshalFromXmlFile(file);
- } catch (Exception e) {
- throw new SerializationException(e.getLocalizedMessage(), e);
- }
+ return jaxbUnmarshalFromXmlFile(Object.class, file);
}
- /**
- * Instantiates an object from the XML representation in a stream. Uses
- * JAXB.
- *
- * @param is
- * The input stream. The stream will be closed by this operation.
- * @return A new instance from the XML representation
- * @throws SerializationException
- */
+ /**
+ * Instantiates an object from the XML representation in a File. Uses JAXB.
+ *
+ * @param clazz
+ * the clazz object used to dynamically cast the result
+ * @param filePath
+ * The XML file
+ * @return A new instance from the XML representation
+ * @throws SerializationException
+ * if JAXB encounters an exception, or a
+ * {@link ClassCastException} occurs
+ */
+ public static T jaxbUnmarshalFromXmlFile(Class clazz, File file)
+ throws SerializationException {
+ try {
+ return clazz.cast(getJaxbManager().jaxbUnmarshalFromXmlFile(file));
+ } catch (Exception e) {
+ throw new SerializationException(e.getLocalizedMessage(), e);
+ }
+ }
+
+ /**
+ * Instantiates an object from the XML representation in a stream. Uses
+ * JAXB.
+ *
+ * @param is
+ * The input stream. The stream will be closed by this operation.
+ * @return A new instance from the XML representation
+ * @throws SerializationException
+ * @deprecated Use {@link #jaxbUnmarshalFromInputStream(Class, InputStream)}
+ * which performs the cast for you, and wraps any
+ * {@link ClassCastException}s in a serialization exception
+ */
+ @Deprecated
public static Object jaxbUnmarshalFromInputStream(InputStream is)
throws SerializationException {
- try {
- return getJaxbManager().jaxbUnmarshalFromInputStream(is);
- } catch (Exception e) {
- throw new SerializationException(e.getLocalizedMessage(), e);
- }
+ return jaxbUnmarshalFromInputStream(Object.class, is);
}
+ /**
+ * Instantiates an object from the XML representation in a stream. Uses
+ * JAXB.
+ *
+ * @param clazz
+ * the class object of the result type
+ * @param is
+ * The input stream. The stream will be closed by this operation.
+ * @return A new instance from the XML representation
+ * @throws SerializationException
+ *
+ */
+ public static T jaxbUnmarshalFromInputStream(Class clazz,
+ InputStream is)
+ throws SerializationException {
+ try {
+ return clazz
+ .cast(getJaxbManager().jaxbUnmarshalFromInputStream(is));
+ } catch (Exception e) {
+ throw new SerializationException(e.getLocalizedMessage(), e);
+ }
+ }
+
/**
* Transforms an object to the thrift protocol using DynamicSerialize. The
* object will exist in memory 3 times during this process: once in its
@@ -207,32 +311,52 @@ public class SerializationUtil {
dsm.serialize(obj, os);
}
- /**
- * Transforms a byte array from the thrift protocol to an object using
- * DynamicSerialize
- *
- * @param bytes
- * the object as bytes
- * @return the Java object
- * @throws SerializationException
- */
- public static Object transformFromThrift(byte[] bytes)
+ /**
+ * Transforms a byte array from the thrift protocol to an object using
+ * DynamicSerialize
+ *
+ * @param bytes
+ * the object as bytes
+ * @return the Java object
+ * @throws SerializationException
+ * @deprecated Use {@link #transformFromThrift(Class, byte[]) which performs
+ * the cast for you, and wraps any {@link ClassCastException}s
+ * in a serialization exception
+ */
+ @Deprecated
+ public static Object transformFromThrift(byte[] bytes)
throws SerializationException {
- DynamicSerializationManager dsm = DynamicSerializationManager
- .getManager(SerializationType.Thrift);
- ByteArrayInputStream bais = null;
- try {
- bais = new ByteArrayInputStream(bytes);
- return dsm.deserialize(bais);
- } finally {
- if (bais != null) {
- try {
- bais.close();
- } catch (IOException e) {
- // ignore
- }
- }
- }
+ return transformFromThrift(Object.class, bytes);
}
+ /**
+ * Transforms a byte array from the thrift protocol to an object using
+ * DynamicSerialize
+ *
+ * @param bytes
+ * the object as bytes
+ * @return the Java object
+ * @throws SerializationException
+ * if a serialization or class cast exception occurs
+ */
+ public static T transformFromThrift(Class clazz, byte[] bytes)
+ throws SerializationException {
+ DynamicSerializationManager dsm = DynamicSerializationManager
+ .getManager(SerializationType.Thrift);
+ ByteArrayInputStream bais = null;
+ try {
+ bais = new ByteArrayInputStream(bytes);
+ return clazz.cast(dsm.deserialize(bais));
+ } catch (ClassCastException cce) {
+ throw new SerializationException(cce);
+ } finally {
+ if (bais != null) {
+ try {
+ bais.close();
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+ }
}
diff --git a/edexOsgi/com.raytheon.uf.common.serialization.comm/src/com/raytheon/uf/common/serialization/comm/util/WrappedException.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/WrappedException.java
similarity index 88%
rename from edexOsgi/com.raytheon.uf.common.serialization.comm/src/com/raytheon/uf/common/serialization/comm/util/WrappedException.java
rename to edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/WrappedException.java
index 14dc344932..21d09ef066 100644
--- a/edexOsgi/com.raytheon.uf.common.serialization.comm/src/com/raytheon/uf/common/serialization/comm/util/WrappedException.java
+++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/WrappedException.java
@@ -17,7 +17,7 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.common.serialization.comm.util;
+package com.raytheon.uf.common.serialization;
/**
* Wrapped exception, prints the original exception
@@ -27,7 +27,8 @@ package com.raytheon.uf.common.serialization.comm.util;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- * Jul 9, 2010 mschenke Initial creation
+ * Jul 09, 2010 mschenke Initial creation
+ * Sep 14, 2012 1169 djohnson Moved to com.raytheon.uf.common.serialization
*
*
*
@@ -39,7 +40,7 @@ public class WrappedException extends Exception {
private static final long serialVersionUID = 1L;
- private String exceptionClass;
+ private final String exceptionClass;
/**
* @param message
diff --git a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/XmlGenericMapAdapter.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/XmlGenericMapAdapter.java
new file mode 100644
index 0000000000..d124696c39
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/XmlGenericMapAdapter.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.common.serialization;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+/**
+ * Handles the conversion between Java {@link Map} classes to Jaxb usable
+ * {@link MapType} classes.
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+public class XmlGenericMapAdapter extends
+ XmlAdapter, Map> {
+
+ @Override
+ public Map unmarshal(MapType serialized) throws Exception {
+ HashMap map = new HashMap();
+
+ for (MapEntryType mapEntryType : serialized.getEntry()) {
+ map.put(mapEntryType.getKey(), mapEntryType.getValue());
+ }
+ return map;
+ }
+
+ @Override
+ public MapType marshal(Map unserialized) throws Exception {
+ MapType mapType = new MapType();
+
+ for (Map.Entry entry : unserialized.entrySet()) {
+ MapEntryType mapEntryType = new MapEntryType();
+ mapEntryType.setKey(entry.getKey());
+ mapEntryType.setValue(entry.getValue());
+ mapType.getEntry().add(mapEntryType);
+ }
+ return mapType;
+ }
+}
diff --git a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/annotations/DynamicSerializeElement.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/annotations/DynamicSerializeElement.java
index e6c3845e51..37012bcc31 100644
--- a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/annotations/DynamicSerializeElement.java
+++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/annotations/DynamicSerializeElement.java
@@ -25,6 +25,8 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+import com.raytheon.uf.common.serialization.ISerializationTypeAdapter;
+
/**
* An annotation that indicates that a class should have this element
* serialized.
@@ -32,11 +34,15 @@ import java.lang.annotation.Target;
* The annotation should be added to the field itself. The assumption is made
* that setters and getters are available for this property.
*
+ * If the {@link #value()} specifies an {@link ISerializationTypeAdapter}, the
+ * factory will be used to serialize/deserialize the value.
+ *
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- * Aug 7, 2008 chammack Initial creation
+ * Aug 07, 2008 chammack Initial creation
+ * Sep 28, 2012 1195 djohnson Add value() to specify a type adapter.
*
*
*
@@ -48,4 +54,6 @@ import java.lang.annotation.Target;
@Target(ElementType.FIELD)
@Documented
public @interface DynamicSerializeElement {
+ @SuppressWarnings("rawtypes")
+ Class extends ISerializationTypeAdapter> value() default ISerializationTypeAdapter.class;
}
diff --git a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/thrift/ThriftSerializationContext.java b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/thrift/ThriftSerializationContext.java
index 6a96c50acc..c1458a4661 100644
--- a/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/thrift/ThriftSerializationContext.java
+++ b/edexOsgi/com.raytheon.uf.common.serialization/src/com/raytheon/uf/common/serialization/thrift/ThriftSerializationContext.java
@@ -42,11 +42,10 @@ import com.facebook.thrift.protocol.TMessage;
import com.facebook.thrift.protocol.TSet;
import com.facebook.thrift.protocol.TStruct;
import com.facebook.thrift.protocol.TType;
+import com.raytheon.uf.common.serialization.BaseSerializationContext;
import com.raytheon.uf.common.serialization.DynamicSerializationManager;
import com.raytheon.uf.common.serialization.DynamicSerializationManager.EnclosureType;
import com.raytheon.uf.common.serialization.DynamicSerializationManager.SerializationMetadata;
-import com.raytheon.uf.common.serialization.IDeserializationContext;
-import com.raytheon.uf.common.serialization.ISerializationContext;
import com.raytheon.uf.common.serialization.ISerializationTypeAdapter;
import com.raytheon.uf.common.serialization.SerializationCache;
import com.raytheon.uf.common.serialization.SerializationException;
@@ -62,8 +61,10 @@ import com.raytheon.uf.common.serialization.SerializationException;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 12, 2008 #1448 chammack Initial creation
- * Jun 17, 2010 #5091 njensen Optimized primitive arrays
- * Mar 1, 2011 njensen Restructured deserializeArray()
+ * Jun 17, 2010 #5091 njensen Optimized primitive arrays
+ * Mar 01, 2011 njensen Restructured deserializeArray()
+ * Sep 14, 2012 #1169 djohnson Add ability to write another object into the stream directly.
+ * Sep 28, 2012 #1195 djohnson Add ability to specify adapter at field level.
*
*
*
@@ -72,17 +73,14 @@ import com.raytheon.uf.common.serialization.SerializationException;
*/
// Warnings are suppressed in this class because generics cause issues with the
// extensive use of reflection. The erased objects are used instead.
-@SuppressWarnings("unchecked")
-public class ThriftSerializationContext implements ISerializationContext,
- IDeserializationContext {
+@SuppressWarnings({ "unchecked", "rawtypes" })
+public class ThriftSerializationContext extends BaseSerializationContext {
/** The tag that is used to indicate the value of an enumeration */
private static final String ENUM_VALUE_TAG = "__enumValue__";
private final SelfDescribingBinaryProtocol protocol;
- private final DynamicSerializationManager serializationManager;
-
private static Map, Byte> types;
private static Map> fieldClass = new ConcurrentHashMap>();
@@ -115,8 +113,9 @@ public class ThriftSerializationContext implements ISerializationContext,
*/
public ThriftSerializationContext(SelfDescribingBinaryProtocol protocol,
DynamicSerializationManager serializationManager) {
+ super(serializationManager);
+
this.protocol = protocol;
- this.serializationManager = serializationManager;
}
/*
@@ -718,11 +717,10 @@ public class ThriftSerializationContext implements ISerializationContext,
field.name = keyStr;
protocol.writeFieldBegin(field);
- // if (adapter != null) {
- // // If there is an adapter, use it to serialize
- // adapter.serialize(this, val);
- // } else
- if (type != TType.VOID) {
+ if (adapter != null) {
+ // If there is an adapter, use it to serialize
+ adapter.serialize(this, val);
+ } else if (type != TType.VOID) {
// Otherwise, as long as it's not void, use basic type serialization
serializeType(val, valClass, type);
}
@@ -852,8 +850,8 @@ public class ThriftSerializationContext implements ISerializationContext,
TField field = protocol.readFieldBegin();
// System.out.println(field.type);
- // ISerializationTypeAdapter factory = md.attributesWithFactories
- // .get(field.name);
+ ISerializationTypeAdapter factory = md.attributesWithFactories
+ .get(field.name);
Object obj = null;
if (field.type == TType.STOP) {
@@ -861,12 +859,12 @@ public class ThriftSerializationContext implements ISerializationContext,
}
if (field.type != TType.VOID) {
- // if (factory != null) {
- // obj = factory.deserialize(this);
- // } else {
- obj = deserializeType(field.type, o.getClass(), fc, field.name,
+ if (factory != null) {
+ obj = factory.deserialize(this);
+ } else {
+ obj = deserializeType(field.type, o.getClass(), fc, field.name,
EnclosureType.FIELD);
- // }
+ }
if (field.type == TType.STRING) {
Class> fieldClass = findFieldClass(o.getClass(), field.name);
if (fieldClass != null && fieldClass.isEnum()) {
@@ -895,7 +893,6 @@ public class ThriftSerializationContext implements ISerializationContext,
* @return
* @throws SerializationException
*/
- @SuppressWarnings("rawtypes")
private Object deserializeType(byte type, Class clazz, FastClass fclazz,
String fieldName, EnclosureType enclosureType)
throws SerializationException {
@@ -1102,7 +1099,6 @@ public class ThriftSerializationContext implements ISerializationContext,
* @return
* @throws SerializationException
*/
- @SuppressWarnings("rawtypes")
private Object deserializeArray(FastClass fclazz, String fieldName)
throws SerializationException {
try {
@@ -1363,5 +1359,4 @@ public class ThriftSerializationContext implements ISerializationContext,
throw new SerializationException(e);
}
}
-
}
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.common.site/src/com/raytheon/uf/common/site/notify/ClusterActivationNotification.java b/edexOsgi/com.raytheon.uf.common.site/src/com/raytheon/uf/common/site/notify/ClusterActivationNotification.java
index cb3f933d4a..038c03c5e0 100644
--- a/edexOsgi/com.raytheon.uf.common.site/src/com/raytheon/uf/common/site/notify/ClusterActivationNotification.java
+++ b/edexOsgi/com.raytheon.uf.common.site/src/com/raytheon/uf/common/site/notify/ClusterActivationNotification.java
@@ -71,23 +71,23 @@ public class ClusterActivationNotification extends SiteActivationNotification {
}
public String toString() {
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
if (isActivation()) {
if (isFailure()) {
- buffer.append(this.getModifiedSite()
- + " has failed to activate on some or all cluster memebers. See logs for details");
+ buffer.append(this.getModifiedSite());
+ buffer.append(" has failed to activate on some or all cluster members. See logs for details");
} else {
- buffer.append(this.getModifiedSite()
- + " has been successfully activated on all cluster members");
+ buffer.append(this.getModifiedSite());
+ buffer.append(" has been successfully activated on all cluster members");
}
} else{
if (isFailure()) {
- buffer.append(this.getModifiedSite()
- + " has failed to deactivate on some or all cluster memebers. See logs for details");
+ buffer.append(this.getModifiedSite());
+ buffer.append(" has failed to deactivate on some or all cluster members. See logs for details");
} else {
- buffer.append(this.getModifiedSite()
- + " has been successfully deactivated on all cluster members");
+ buffer.append(this.getModifiedSite());
+ buffer.append(" has been successfully deactivated on all cluster members");
}
}
return buffer.toString();
diff --git a/edexOsgi/com.raytheon.uf.common.time/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.common.time/META-INF/MANIFEST.MF
index 96e2aa7ccb..1d8d912e33 100644
--- a/edexOsgi/com.raytheon.uf.common.time/META-INF/MANIFEST.MF
+++ b/edexOsgi/com.raytheon.uf.common.time/META-INF/MANIFEST.MF
@@ -5,7 +5,9 @@ Bundle-SymbolicName: com.raytheon.uf.common.time
Bundle-Version: 1.12.1174.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: net.sf.cglib
+Require-Bundle: net.sf.cglib,
+ net.jcip;bundle-version="1.0.0",
+ com.raytheon.uf.common.status;bundle-version="1.12.1174"
Import-Package: com.raytheon.uf.common.serialization,
com.raytheon.uf.common.serialization.adapters,
com.raytheon.uf.common.serialization.annotations,
diff --git a/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/SimulatedTime.java b/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/SimulatedTime.java
index 32c1cc5306..fd0fc26a70 100644
--- a/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/SimulatedTime.java
+++ b/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/SimulatedTime.java
@@ -32,9 +32,11 @@ import java.util.TimeZone;
*
*
* SOFTWARE HISTORY
- * Date Ticket# Engineer Description
- * ------------ ---------- ----------- --------------------------
- * Jul 16, 2008 randerso Initial creation
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 16, 2008 randerso Initial creation
+ * Aug 24, 2012 0743 djohnson Add option to use milliseconds for operations, change to singleton.
*
*
*
@@ -42,7 +44,7 @@ import java.util.TimeZone;
* @version 1.0
*/
-public class SimulatedTime {
+public final class SimulatedTime {
/**
* The system global simulated time instance
*/
@@ -95,7 +97,7 @@ public class SimulatedTime {
* Creates a simulated time that matches real time.
*
*/
- public SimulatedTime() {
+ private SimulatedTime() {
setRealTime();
}
@@ -111,8 +113,24 @@ public class SimulatedTime {
* @param isFrozen
* true to freeze time
*/
- public SimulatedTime(Date date, double scale, boolean isFrozen) {
- setTime(date);
+ private SimulatedTime(Date date, double scale, boolean isFrozen) {
+ this(date.getTime(), scale, isFrozen);
+ }
+
+ /**
+ * Creates a simulated time starting at the specified time with
+ * acceleration/deceleration, optionally frozen.
+ *
+ * @param millis
+ * starting time in milliseconds
+ * @param scale
+ * 1.0 for normal time rate, >1.0 for accelerated time < 1.0 for
+ * decelerated time. If negative time will run backward.
+ * @param isFrozen
+ * true to freeze time
+ */
+ public SimulatedTime(long millis, double scale, boolean isFrozen) {
+ setTime(millis);
this.scale = scale;
this.isFrozen = isFrozen;
}
@@ -142,11 +160,14 @@ public class SimulatedTime {
* @return current simulated time
*/
public Date getTime() {
+ return new Date(getMillis());
+ }
+
+ public long getMillis() {
if (isFrozen) {
- return new Date(frozenTime);
+ return frozenTime;
} else {
- return new Date(Math.round((now() - baseTime) * scale) + baseTime
- + offset);
+ return Math.round((now() - baseTime) * scale) + baseTime + offset;
}
}
@@ -156,11 +177,20 @@ public class SimulatedTime {
* @param date
*/
public void setTime(Date date) {
+ setTime(date.getTime());
+ }
+
+ /**
+ * Set the current simulated time
+ *
+ * @param millis
+ */
+ public void setTime(long millis) {
if (isFrozen) {
- frozenTime = date.getTime();
+ frozenTime = millis;
} else {
baseTime = now();
- offset = date.getTime() - baseTime;
+ offset = millis - baseTime;
}
}
@@ -206,7 +236,7 @@ public class SimulatedTime {
}
if (isFrozen) {
- frozenTime = getTime().getTime();
+ frozenTime = getMillis();
} else {
baseTime = now();
offset = frozenTime - baseTime;
diff --git a/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/AbstractTimer.java b/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/AbstractTimer.java
new file mode 100644
index 0000000000..284831f894
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/AbstractTimer.java
@@ -0,0 +1,108 @@
+package com.raytheon.uf.common.time.util;
+
+import net.jcip.annotations.NotThreadSafe;
+
+/**
+ *
+ * Provides the basic {@link ITimer} implementation, such as the state machine
+ * functionality.
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+interface ITimeStrategy {
+
+ /**
+ * Retrieves the current time in milliseconds.
+ *
+ * @return the current time in milliseconds
+ */
+ long currentTimeMillis();
+}
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/ITimer.java b/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/ITimer.java
new file mode 100644
index 0000000000..0a028176ad
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/ITimer.java
@@ -0,0 +1,50 @@
+package com.raytheon.uf.common.time.util;
+
+/**
+ *
+ * Defines a timer that can be started and stopped.
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+public interface ITimer {
+
+ /**
+ * Start the time on the timer.
+ *
+ * @throws IllegalStateException
+ * if the timer is already running, or has been stopped and not
+ * reset
+ */
+ void start() throws IllegalStateException;
+
+ /**
+ * Stop the time on the timer.
+ *
+ * @throws IllegalStateException
+ * if the timer hasn't been started
+ */
+ void stop() throws IllegalStateException;
+
+ /**
+ * Get the elapsed time, in milliseconds.
+ *
+ * @return the elapsed time in milliseconds
+ */
+ long getElapsedTime();
+
+ /**
+ * Reset the timer.
+ */
+ void reset();
+}
diff --git a/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/ImmutableDate.java b/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/ImmutableDate.java
new file mode 100644
index 0000000000..eb18ca0520
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/ImmutableDate.java
@@ -0,0 +1,203 @@
+/**
+ * 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.time.util;
+
+import java.util.Date;
+
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import net.jcip.annotations.Immutable;
+
+import com.raytheon.uf.common.serialization.IDeserializationContext;
+import com.raytheon.uf.common.serialization.ISerializationContext;
+import com.raytheon.uf.common.serialization.ISerializationTypeAdapter;
+import com.raytheon.uf.common.serialization.SerializationException;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
+import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdapter;
+import com.raytheon.uf.common.time.SimulatedTime;
+
+/**
+ * An {@link Immutable} version of {@link Date}.
+ *
+ *
+ *
+ * @version 1.0
+ */
+public class ImmutableDateAdapter extends XmlAdapter {
+
+ @Override
+ public ImmutableDate unmarshal(Date date) throws Exception {
+ return new ImmutableDate(date);
+ }
+
+ /**
+ *
+ * @return
+ */
+ @Override
+ public Date marshal(ImmutableDate immutableDate) throws Exception {
+ return immutableDate;
+ }
+}
diff --git a/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/TimeUtil.java b/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/TimeUtil.java
index f137f1813f..45edd79a05 100644
--- a/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/TimeUtil.java
+++ b/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/TimeUtil.java
@@ -25,6 +25,10 @@ import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
+import com.raytheon.uf.common.status.IUFStatusHandler;
+import com.raytheon.uf.common.status.UFStatus.Priority;
+import com.raytheon.uf.common.time.SimulatedTime;
+
/**
* Utilities for time, some extracted from Util.
*
@@ -33,7 +37,8 @@ import java.util.TimeZone;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- * Feb 2, 2009 njensen Initial creation
+ * Feb 02, 2009 njensen Initial creation
+ * Sep 11, 2012 1154 djohnson Add MILLIS constants and isNewerDay().
*
*
*
@@ -43,8 +48,54 @@ import java.util.TimeZone;
public class TimeUtil {
+ /**
+ * A clock that does not really return the current time. Useful when you
+ * only want to keep track of times in a conditional sense, such as if a
+ * logging priority is enabled. This is an example of the Null Object
+ * pattern.
+ *
+ * @see http://en.wikipedia.org/wiki/Null_Object_pattern
+ *
+ * @author djohnson
+ *
+ */
+ private static class NullClock extends AbstractTimer {
+ @Override
+ protected long getCurrentTime() {
+ return 1;
+ }
+ }
+
+ /**
+ * Delegates the retrieval of the current time to the system clock.
+ * Production code will always use this.
+ *
+ * @author djohnson
+ *
+ */
+ private static class SystemTimeStrategy implements ITimeStrategy {
+ @Override
+ public long currentTimeMillis() {
+ return System.currentTimeMillis();
+ }
+ }
+
public static final String DATE_STRING = "(\\d{4})-(\\d{2})-(\\d{2})[ _](\\d{2}):(\\d{2}):(\\d{2})\\.(\\d{1,3})";
+ // Util.java has a few of these constants, but that is located in an EDEX
+ // plugin and this is a more appropriate place for them anyways
+ public static final long MILLIS_PER_SECOND = 1000;
+
+ public static final long MILLIS_PER_MINUTE = MILLIS_PER_SECOND * 60;
+
+ public static final long MILLIS_PER_HOUR = MILLIS_PER_MINUTE * 60;
+
+ public static final long MILLIS_PER_DAY = MILLIS_PER_HOUR * 24;
+
+ public static final long MILLIS_PER_WEEK = MILLIS_PER_DAY * 7;
+
+ public static final long MILLIS_PER_YEAR = 3600 * 24 * 1000 * 365;
+
// create instance of simple date format on class load, as instantiating it
// is expensive the SimpleDateFormat class is not thread-safe,
// so calling methods use synchronized
@@ -58,6 +109,73 @@ public class TimeUtil {
sqlSdf.setTimeZone(TimeZone.getTimeZone("GMT"));
}
+ static final ITimeStrategy SYSTEM_TIME_STRATEGY = new SystemTimeStrategy();
+
+ static final ITimer NULL_CLOCK = new NullClock();
+
+ /**
+ * The strategy to retrieve the "current time" value from.
+ */
+ static ITimeStrategy timeStrategy = SYSTEM_TIME_STRATEGY;
+
+ /**
+ * Converts a Calendar in the local time zone to a GMT date
+ *
+ * @param cal
+ * A Calendar object in the local time zone
+ * @return The GMT date
+ */
+ public static Date calendarToGMT(Calendar cal) {
+ Date dt = null;
+ synchronized (sdf) {
+ sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
+ String str = formatCalendar(cal);
+ sdf.setTimeZone(TimeZone.getDefault());
+ try {
+ dt = sdf.parse(str);
+ } catch (ParseException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ return dt;
+ }
+
+ /**
+ * Retrieve the current time in milliseconds. This method should be used
+ * instead of {@link System#currentTimeMillis()}. This method DOES NOT use
+ * {@link SimulatedTime} and therefore should be isolated to duration
+ * checks, and logging type statements. If the desired result is the
+ * currently configured system time, e.g. CAVE sessions where the user has
+ * configured the system to a specific time. Those purposes are handled by
+ * the {@link SimulatedTime} class. The {@link Date} and {@link Calendar}
+ * returning methods in this class will delegate to {@link SimulatedTime}.
+ *
+ * @see {@link SimulatedTime}
+ * @return the current time in milliseconds
+ */
+ public static long currentTimeMillis() {
+ return timeStrategy.currentTimeMillis();
+ }
+
+ /**
+ * Formats a calendar object into the following format yyyy-MM-dd_HH:mm:ss.S
+ *
+ * @param cal
+ * The calendar to format
+ * @return The formatted result
+ */
+ public static String formatCalendar(Calendar cal) {
+ String format = null;
+
+ synchronized (sdf) {
+ sdf.setTimeZone(cal.getTimeZone());
+ format = sdf.format(cal.getTime());
+ }
+ return format;
+ }
+
/**
* Retrieve date as a string in the index standard format: yyyy-MM-dd
* kk:mm:ss.SSS
@@ -84,47 +202,6 @@ public class TimeUtil {
return formatCalendar(cal);
}
- /**
- * Formats a calendar object into the following format yyyy-MM-dd_HH:mm:ss.S
- *
- * @param cal
- * The calendar to format
- * @return The formatted result
- */
- public static String formatCalendar(Calendar cal) {
- String format = null;
-
- synchronized (sdf) {
- sdf.setTimeZone(cal.getTimeZone());
- format = sdf.format(cal.getTime());
- }
- return format;
- }
-
- /**
- * Converts a Calendar in the local time zone to a GMT date
- *
- * @param cal
- * A Calendar object in the local time zone
- * @return The GMT date
- */
- public static Date calendarToGMT(Calendar cal) {
- Date dt = null;
- synchronized (sdf) {
- sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
- String str = formatCalendar(cal);
- sdf.setTimeZone(TimeZone.getDefault());
- try {
- dt = sdf.parse(str);
- } catch (ParseException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- return dt;
- }
-
public static long formattedDateToLong(String formattedDate) {
long retVal = 0;
try {
@@ -141,4 +218,109 @@ public class TimeUtil {
}
}
+ /**
+ * Retrieve a {@link ITimer} instance that will only actually keep track of
+ * time if the specified priority level is enabled. This allows efficient
+ * use of system resources, while calling code need not change.
+ *
+ * @param handler
+ * the handler to use to check for a priority level being enabled
+ * @param priority
+ * the priority level
+ * @return the {@link ITimer} instance
+ */
+ public static ITimer getPriorityEnabledTimer(IUFStatusHandler handler,
+ Priority priority) {
+ return handler.isPriorityEnabled(priority) ? getTimer() : NULL_CLOCK;
+ }
+
+ /**
+ * Retrieve a {@link ITimer} that allows the demarcation of arbitrary start
+ * and stop times.
+ *
+ * @return a {@link ITimer}
+ */
+ public static ITimer getTimer() {
+ return new TimerImpl();
+ }
+
+ /**
+ * Check whether the time represented by a {@link Date} is a new day
+ * compared to another {@link Date} object.
+ *
+ * @param earlierDate
+ * the earlier date
+ * @param laterDate
+ * the later date
+ * @param timeZone
+ * the timeZone to use when determining what date it is for the
+ * specified time
+ * @return true if the laterDate is a new day compared to earlierDate
+ */
+ public static boolean isNewerDay(Date earlierDate, Date laterDate,
+ TimeZone timeZone) {
+ Calendar earlierCal = TimeUtil.newCalendar(timeZone);
+ earlierCal.setTime(earlierDate);
+
+ Calendar laterCal = TimeUtil.newCalendar(timeZone);
+ laterCal.setTime(laterDate);
+
+ return laterCal.get(Calendar.DAY_OF_YEAR) > earlierCal
+ .get(Calendar.DAY_OF_YEAR)
+ || laterCal.get(Calendar.YEAR) > earlierCal.get(Calendar.YEAR);
+ }
+
+ /**
+ * Return a new {@link Calendar} instance. This method delegates to the
+ * {@link SimulatedTime} class to determine the currently configured system
+ * time.
+ *
+ * @see {@link SimulatedTime}
+ * @return the calendar
+ */
+ public static Calendar newCalendar() {
+ Calendar cal = Calendar.getInstance();
+ cal.setTimeInMillis(SimulatedTime.getSystemTime().getMillis());
+ return cal;
+ }
+
+ /**
+ * Return a new {@link Calendar} instance for the specified {@link TimeZone}
+ * . This method delegates to the {@link SimulatedTime} class to determine
+ * the currently configured system time.
+ *
+ * @param timeZone
+ * the time zone
+ * @see {@link SimulatedTime}
+ * @return the calendar
+ */
+ public static Calendar newCalendar(TimeZone timeZone) {
+ Calendar cal = Calendar.getInstance(timeZone);
+ cal.setTimeInMillis(SimulatedTime.getSystemTime().getMillis());
+ return cal;
+ }
+
+ /**
+ * Return a new {@link Date} instance. This method delegates to the
+ * {@link SimulatedTime} class to determine the currently configured system
+ * time.
+ *
+ * @see {@link SimulatedTime}
+ * @return the current {@link Date}
+ */
+ public static Date newDate() {
+ return SimulatedTime.getSystemTime().getTime();
+ }
+
+ /**
+ * Return a new ImmutableDate. This method delegates to the
+ * {@link SimulatedTime} class to determine the currently configured system
+ * time.
+ *
+ * @see {@link SimulatedTime}
+ * @return an immutable date for the current time
+ */
+ public static ImmutableDate newImmutableDate() {
+ return new ImmutableDate(SimulatedTime.getSystemTime().getMillis());
+ }
}
diff --git a/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/TimerImpl.java b/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/TimerImpl.java
new file mode 100644
index 0000000000..6614625b3c
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.time/src/com/raytheon/uf/common/time/util/TimerImpl.java
@@ -0,0 +1,34 @@
+package com.raytheon.uf.common.time.util;
+
+import net.jcip.annotations.NotThreadSafe;
+
+/**
+ *
+ * A default {@link ITimer} implementation that will use
+ * {@link TimeUtil#currentTimeMillis()} to keep track of time. It is good for
+ * use inside both production code and tests.
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+
+public final class CollectionUtil {
+
+ private CollectionUtil() {
+
+ }
+
+ /**
+ * Check whether an array is null or empty.
+ *
+ * @param array
+ * the array
+ * @return true if the array is null or empty
+ */
+ public static boolean isNullOrEmpty(T[] array) {
+ return array == null || array.length == 0;
+ }
+
+ /**
+ * Check whether a collection is null or empty.
+ *
+ * @param coll
+ * the collection
+ * @return true if the collection is null or empty
+ */
+ public static boolean isNullOrEmpty(Collection> coll) {
+ return coll == null || coll.isEmpty();
+ }
+
+ /**
+ * Create a set from the specified items. Assumes the items can be stored in
+ * a {@link HashSet}.
+ *
+ * @param items
+ * the items
+ * @return the set
+ */
+ public static Set asSet(T... items) {
+ return new HashSet(Arrays.asList(items));
+ }
+}
diff --git a/edexOsgi/com.raytheon.uf.edex.auth/src/com/raytheon/uf/edex/auth/roles/IRoleStorage.java b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/ExceptionUtil.java
similarity index 59%
rename from edexOsgi/com.raytheon.uf.edex.auth/src/com/raytheon/uf/edex/auth/roles/IRoleStorage.java
rename to edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/ExceptionUtil.java
index 783c32b7b0..9deebf6dca 100644
--- a/edexOsgi/com.raytheon.uf.edex.auth/src/com/raytheon/uf/edex/auth/roles/IRoleStorage.java
+++ b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/ExceptionUtil.java
@@ -17,42 +17,45 @@
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
-package com.raytheon.uf.edex.auth.roles;
+package com.raytheon.uf.common.util;
/**
- * Storage class for roles. Should have a concept of a default role which all
- * users get by default and the ability to lookup a role given an id. NOTE, ALL
- * ROLES IDS SHOULD BE TREATED AS CASE-INSENSITIVE
+ * Utilities for working with {@link Exception}s.
*
*
*
- * @author mschenke
+ * @author djohnson
* @version 1.0
*/
-public interface IRoleStorage {
+public final class ExceptionUtil {
+
+ private ExceptionUtil() {
+ }
/**
- * Given the (case insensitive) role id, return the role object
+ * Retrieve the root cause of a {@link Throwable} chain.
*
- * @param roleId
- * @return
+ * @param t
+ * the throwable
+ * @return the root cause
*/
- public IRole lookupRole(String roleId);
+ public static Throwable getRootCause(Throwable t) {
+ Throwable result = t;
- /**
- * Given the role, determine if it is the default role
- *
- * @param role
- * @return
- */
- public boolean isDefaultRole(IRole role);
+ while (result.getCause() != null) {
+ result = result.getCause();
+ }
+
+ return result;
+ }
}
diff --git a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/FileUtil.java b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/FileUtil.java
index d96e390326..1c606eb9e8 100644
--- a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/FileUtil.java
+++ b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/FileUtil.java
@@ -49,7 +49,7 @@ import java.util.zip.GZIPOutputStream;
* return false when unable to
* obtain directory listing.
* Sep 16, 2008 1250 jelkins Added join function
- * - AWIPS2 Baseline Repository --------
+ * Jun 28, 2012 0819 djohnson Add write method.
* Jul 06, 2012 798 jkorman Added more robust {@link #copyFile}. Added methods
* to create temporary directories and files.
*
@@ -619,6 +619,24 @@ public class FileUtil {
public static boolean isValidFilename(String fileName) {
return VALID_FILENAME.matcher(fileName).matches();
}
+
+ /**
+ * Write the contents of an input stream to a file.
+ *
+ * @param is
+ * the input stream to read from
+ * @param file
+ * the file to write to
+ * @throws IOException
+ */
+ public static void write(InputStream is, File file) throws IOException {
+ ByteArrayOutputStream os = new ByteArrayOutputStream();
+
+ int read = 0;
+ while ((read = is.read()) != -1) {
+ os.write(read);
+ }
+ }
/**
* Copy a file from one location to another. The file copy may begin at some
diff --git a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/PropertiesUtil.java b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/PropertiesUtil.java
new file mode 100644
index 0000000000..3f2dc3db28
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/PropertiesUtil.java
@@ -0,0 +1,107 @@
+/**
+ * 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.util;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.util.Properties;
+
+/**
+ * Utility class to work with {@link Properties}.
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+public final class ReflectionUtil {
+
+ private static ConcurrentMap, List> classFields = new ConcurrentHashMap, List>();
+
+ private ReflectionUtil() {
+ // Utility class
+ }
+
+ public static T newInstanceOfAssignableType(Class assignableClass,
+ String className) {
+ try {
+ @SuppressWarnings("unchecked")
+ Class extends T> clazz = (Class extends T>) Class
+ .forName(className);
+ return newInstanceOfAssignableType(assignableClass, clazz);
+ } catch (ClassCastException cce) {
+ throw new ReflectionException(String.format(
+ "%s is not assignable to a field of type %s", className,
+ assignableClass.getName()), cce);
+ } catch (ClassNotFoundException e) {
+ throw new ReflectionException(e);
+ }
+ }
+
+ public static T newInstanceOfAssignableType(Class assignableClass,
+ Class extends T> clazz) {
+ try {
+ return assignableClass.cast(newInstance(clazz));
+ } catch (ClassCastException cce) {
+ throw new ReflectionException(String.format(
+ "%s is not assignable to a field of type %s",
+ clazz.getName(), assignableClass.getName()), cce);
+ }
+ }
+
+ public static Object getter(Object object, String name)
+ throws ReflectionException {
+ // Assume camel cased names - capitalize first letter...
+ String method = Character.toUpperCase(name.charAt(0))
+ + name.substring(1);
+ try {
+ Method m;
+ try {
+ // Try common 'get' first...
+ m = object.getClass().getMethod("get" + method);
+ } catch (NoSuchMethodException e) {
+ // Try 'is' as a prefix
+ m = object.getClass().getMethod("is" + method);
+ }
+
+ return m.invoke(object, (Object[]) null);
+ } catch (Exception e) {
+ throw new ReflectionException(e);
+ }
+ }
+
+ public static T getter(Class resultType, Object obj, String name) {
+ Object result = null;
+ try {
+ result = getter(obj, name);
+ return resultType.cast(result);
+ } catch (ClassCastException cce) {
+ throw new ReflectionException(String.format(
+ "%s is not assignable to a field of type %s", result
+ .getClass().getName(), resultType.getName()), cce);
+ }
+ }
+
+ public static void setter(Object object, String name, Object... parameters)
+ throws ReflectionException {
+ try {
+ String method = "set" + Character.toUpperCase(name.charAt(0))
+ + name.substring(1);
+
+ Class>[] parameterTypes = new Class>[parameters.length];
+ for (int i = 0; i < parameters.length; i++) {
+ parameterTypes[i] = parameters[i].getClass();
+ }
+
+ Method m = object.getClass().getMethod(method, parameterTypes);
+ m.invoke(object, parameters);
+ } catch (Exception e) {
+ throw new ReflectionException(e);
+ }
+ }
+
+ /**
+ * Constructs a new instance of the specified class.
+ *
+ * @param clazz
+ * the class to construct
+ * @return the constructed instance
+ * @throws ReflectionException
+ * on error constructing the instance
+ */
+ public static Object newInstance(Class> clazz) throws ReflectionException {
+ try {
+ return clazz.newInstance();
+ } catch (Exception e) {
+ throw new ReflectionException(String.format(
+ "Unable to construct an object of type %s!",
+ clazz.getName()), e);
+ }
+ }
+
+ /**
+ * Gets all fields for a given class. Fields from the superclass are also
+ * included
+ *
+ * @param fields
+ * The list used to hold the fields
+ * @param type
+ * The class type to look at
+ * @return The complete list of all fields including inherited fields
+ */
+ public static List getAllFields(Class> type) {
+ List storedFields = classFields.get(type);
+ if (storedFields != null) {
+ return storedFields;
+ }
+ List fields = new ArrayList();
+ for (Field field : type.getDeclaredFields()) {
+ fields.add(field);
+ }
+ if (type.getSuperclass() != null) {
+ fields.addAll(getAllFields(type.getSuperclass()));
+ }
+ classFields.putIfAbsent(type, fields);
+ return fields;
+ }
+
+ /**
+ * Checks the fields of a class to see if the desired annotation is present
+ * on any fields. If the annotation is found, the value of the field is
+ * returned
+ *
+ * @param obj
+ * The object to check
+ * @param annotation
+ * The annotation class to look for
+ * @return The value of the annotated field
+ * @throws ReflectionException
+ * If reflection errors occur
+ */
+ public static String getAnnotatedField(Object obj,
+ Class extends Annotation> annotation) throws ReflectionException {
+ List fields = getAllFields(obj.getClass());
+
+ for (Field field : fields) {
+ Annotation ann = field.getAnnotation(annotation);
+ if (ann != null) {
+ try {
+ return PropertyUtils.getProperty(obj, field.getName())
+ .toString();
+ } catch (Exception e) {
+ throw new ReflectionException(
+ "Error getting annotated field value", e);
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Create a class instance from its name.
+ *
+ * @param className
+ * the class name
+ * @return the class
+ */
+ public static Class> forName(String className) {
+ try {
+ return Class.forName(className);
+ } catch (ClassNotFoundException e) {
+ throw new ReflectionException(e);
+ }
+ }
+}
diff --git a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/StringUtil.java b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/StringUtil.java
index 4895600367..f5c66575ed 100644
--- a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/StringUtil.java
+++ b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/StringUtil.java
@@ -20,6 +20,7 @@
package com.raytheon.uf.common.util;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import org.apache.commons.lang.StringUtils;
@@ -34,13 +35,18 @@ import org.apache.commons.lang.StringUtils;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 20, 2011 rferrel Initial creation
+ * Jul 13, 2012 740 djohnson Add join.
*
*
*
* @author rferrel
* @version 1.0
*/
-public class StringUtil {
+public final class StringUtil {
+
+ private StringUtil() {
+
+ }
/**
* Splits a string using given separator characters; strings are trimmed and
@@ -75,4 +81,56 @@ public class StringUtil {
}
return result;
}
+
+ /**
+ * Concatenate an array of object into a single string with each array
+ * element's toString() value separated by the joinCharacter.
+ *
+ * @param portions
+ * the array of objects
+ * @param joinCharacter
+ * the character to join them with
+ * @return the concatenated string
+ */
+ public static String join(final T[] portions, final char joinCharacter) {
+ StringBuilder stringBuilder = new StringBuilder();
+
+ if (CollectionUtil.isNullOrEmpty(portions)) {
+ return null;
+ }
+
+ for (T portion : portions) {
+ stringBuilder.append(portion);
+ stringBuilder.append(joinCharacter);
+ }
+ stringBuilder.deleteCharAt(stringBuilder.length() - 1);
+
+ return stringBuilder.toString();
+ }
+
+ /**
+ * Concatenate a collection of objects into a single string with each
+ * object's toString() value separated by the joinCharacter.
+ *
+ * @param portions
+ * the collections of objects
+ * @param joinCharacter
+ * the character to join them with
+ * @return the concatenated string
+ */
+ public static String join(final Collection portions, final char joinCharacter) {
+ StringBuilder stringBuilder = new StringBuilder();
+
+ if (CollectionUtil.isNullOrEmpty(portions)) {
+ return null;
+ }
+
+ for (T portion : portions) {
+ stringBuilder.append(portion);
+ stringBuilder.append(joinCharacter);
+ }
+ stringBuilder.deleteCharAt(stringBuilder.length() - 1);
+
+ return stringBuilder.toString();
+ }
}
diff --git a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/session/SessionContext.java b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/session/SessionContext.java
new file mode 100644
index 0000000000..bb06d78335
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/session/SessionContext.java
@@ -0,0 +1,53 @@
+/**
+ * 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.util.session;
+
+/**
+ * This interface should be implemented for each session management type. For
+ * example, in a persistence session the extension class could hold the
+ * transaction. Each thread is given a single {@link SessionContext}, therefore
+ * the implementors do not need to be thread-safe.
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+public interface SessionContext {
+ /**
+ * Open the context, called by {@link SessionManager} when the context is
+ * initially created for a thread.
+ */
+ void open();
+
+ /**
+ * Close the context, called by {@link SessionManager} when the context is
+ * destroyed for a thread.
+ */
+ void close();
+}
diff --git a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/session/SessionManager.java b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/session/SessionManager.java
new file mode 100644
index 0000000000..556b9f81e2
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/session/SessionManager.java
@@ -0,0 +1,182 @@
+/**
+ * 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.util.session;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.raytheon.uf.common.status.IUFStatusHandler;
+import com.raytheon.uf.common.status.UFStatus;
+import com.raytheon.uf.common.status.UFStatus.Priority;
+import com.raytheon.uf.common.util.ReflectionUtil;
+
+/**
+ * Provides the functionality to manage a 'session'. Each thread has its own
+ * instance of the context. 1..N open requests can be made, and once the Nth
+ * close request comes in the session is closed. All data related to the session
+ * is stored in the sub-class of {@link SessionContext}.
+ *
+ *
* Data types which must be persisted to the database must have an associated
* dao which extends this class. Each class needing a dao must also extend the
- * PersistableDataObject class.
+ * PersistableDataObject class.
*
* NOTE: Direct instantiation of this class is discouraged. Use
* DaoPool.getInstance().borrowObject() for retrieving all data access objects
@@ -96,6 +95,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
* ------------ ---------- ----------- --------------------------
* 7/24/07 353 bphillip Initial Check in
* 5/14/08 1076 brockwoo Fix for distinct with multiple properties
+ * Oct 10, 2012 1261 djohnson Incorporate changes to DaoConfig, add generic to {@link IPersistableDataObject}.
*
*
*
@@ -103,7 +103,9 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
* @version 1
*/
public class CoreDao extends HibernateDaoSupport {
- protected static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(CoreDao.class);
+ protected static final IUFStatusHandler statusHandler = UFStatus
+ .getHandler(CoreDao.class);
+
/**
* The Hibernate transaction manager. Methods do not directly use this
* class. Instead, use the Transaction template
@@ -113,11 +115,6 @@ public class CoreDao extends HibernateDaoSupport {
/** The convenience wrapper for the Hibernate transaction manager */
protected final TransactionTemplate txTemplate;
- /**
- * The cache region to store query
- */
- private final String QUERY_CACHE_REGION = "Queries";
-
/** The class associated with this dao */
protected Class> daoClass;
@@ -132,16 +129,11 @@ public class CoreDao extends HibernateDaoSupport {
* has been assigned
*/
public CoreDao(DaoConfig config) {
- txManager = (HibernateTransactionManager) EDEXUtil
- .getESBComponent(config.getTxManagerName());
+ this.txManager = config.getTxManager();
txTemplate = new TransactionTemplate(txManager);
- // SessionFactory sf = ((DatabaseSessionFactoryBean)
- // EDEXUtil.getESBComponent("&" + config
- // .getSessionFactoryName())).getMoreBetterSessionFactory();
- setSessionFactory((SessionFactory) EDEXUtil.getESBComponent(config
- .getSessionFactoryName()));
+ setSessionFactory(config.getSessionFactory());
- daoClass = config.getDaoClassName();
+ this.daoClass = config.getDaoClass();
getHibernateTemplate().setCacheQueries(true);
}
@@ -192,7 +184,7 @@ public class CoreDao extends HibernateDaoSupport {
* @param obj
* The object to be persisted to the database
*/
- public void saveOrUpdate(final PersistableDataObject obj) {
+ public void saveOrUpdate(final PersistableDataObject obj) {
txTemplate.execute(new TransactionCallbackWithoutResult() {
@Override
public void doInTransactionWithoutResult(TransactionStatus status) {
@@ -223,7 +215,7 @@ public class CoreDao extends HibernateDaoSupport {
* @param obj
* The object to be persisted to the database
*/
- public void update(final PersistableDataObject obj) {
+ public void update(final PersistableDataObject obj) {
txTemplate.execute(new TransactionCallbackWithoutResult() {
@Override
public void doInTransactionWithoutResult(TransactionStatus status) {
@@ -265,15 +257,15 @@ public class CoreDao extends HibernateDaoSupport {
private static final String mergeSqlFormat = "select id from awips.%s where dataURI=:dataURI";
- public List mergeAll(
- final List obj) {
- List duplicates = new ArrayList();
+ public List> mergeAll(
+ final List> obj) {
+ List> duplicates = new ArrayList>();
Session s = this.getHibernateTemplate().getSessionFactory()
.openSession();
Transaction tx = s.beginTransaction();
try {
Map pluginQueryMap = new HashMap();
- for (PersistableDataObject pdo : obj) {
+ for (PersistableDataObject pdo : obj) {
if (pdo == null) {
logger.error("Attempted to insert null PersistableDataObject");
continue;
@@ -291,11 +283,8 @@ public class CoreDao extends HibernateDaoSupport {
if (!pdo.isOverwriteAllowed()) {
duplicates.add(pdo);
} else {
- statusHandler.handle(
- Priority.DEBUG,
- "Overwriting "
- + ((PersistableDataObject) pdo)
- .getIdentifier());
+ statusHandler.handle(Priority.DEBUG, "Overwriting "
+ + pdo.getIdentifier());
}
}
}
@@ -310,43 +299,6 @@ public class CoreDao extends HibernateDaoSupport {
}
}
return duplicates;
-
- // return (List) txTemplate
- // .execute(new TransactionCallback() {
- // @Override
- // public List doInTransaction(
- // TransactionStatus arg0) {
- // Session s = getHibernateTemplate().getSessionFactory()
- // .getCurrentSession();
- // List duplicates = new
- // ArrayList();
- // Map pluginQueryMap = new HashMap();
- // for (PersistableDataObject pdo : obj) {
- // if (pdo == null) {
- // logger
- // .error("Attempted to insert null PersistableDataObject");
- // continue;
- // }
- // String plugin = ((PluginDataObject) pdo)
- // .getPluginName();
- // Query q = pluginQueryMap.get(plugin);
- // if (q == null) {
- // q = s.createSQLQuery(String.format(
- // mergeSqlFormat, plugin));
- // pluginQueryMap.put(plugin, q);
- // }
- // q
- // .setString("dataURI", (String) pdo
- // .getIdentifier());
- // if (q.list().size() == 0) {
- // s.persist(pdo);
- // } else {
- // duplicates.add(pdo);
- // }
- // }
- // return duplicates;
- // }
- // });
}
/**
@@ -355,7 +307,7 @@ public class CoreDao extends HibernateDaoSupport {
* @param obj
* The object to delete
*/
- public void delete(final PersistableDataObject obj) {
+ public void delete(final PersistableDataObject obj) {
txTemplate.execute(new TransactionCallbackWithoutResult() {
@Override
public void doInTransactionWithoutResult(TransactionStatus status) {
@@ -373,12 +325,14 @@ public class CoreDao extends HibernateDaoSupport {
* @return The object with the matching id.
* Null if not found
*/
- public PersistableDataObject queryById(final Serializable id) {
- PersistableDataObject retVal = (PersistableDataObject) txTemplate
+ public PersistableDataObject queryById(final Serializable id) {
+ @SuppressWarnings("unchecked")
+ PersistableDataObject retVal = (PersistableDataObject) txTemplate
.execute(new TransactionCallback() {
- public PersistableDataObject doInTransaction(
+ @Override
+ public PersistableDataObject doInTransaction(
TransactionStatus status) {
- return (PersistableDataObject) getHibernateTemplate()
+ return (PersistableDataObject) getHibernateTemplate()
.get(daoClass, id);
}
});
@@ -392,10 +346,12 @@ public class CoreDao extends HibernateDaoSupport {
* The id
* @return The object
*/
- public PersistableDataObject queryById(final PluginDataObject id) {
- PersistableDataObject retVal = (PersistableDataObject) txTemplate
+ public PersistableDataObject queryById(final PluginDataObject id) {
+ @SuppressWarnings("unchecked")
+ PersistableDataObject retVal = (PersistableDataObject) txTemplate
.execute(new TransactionCallback() {
- public PersistableDataObject doInTransaction(
+ @Override
+ public PersistableDataObject doInTransaction(
TransactionStatus status) {
DetachedCriteria criteria = DetachedCriteria.forClass(
id.getClass())
@@ -425,11 +381,12 @@ public class CoreDao extends HibernateDaoSupport {
* @return A list of similar objects
*/
@SuppressWarnings("unchecked")
- public List queryByExample(
- final PersistableDataObject obj, final int maxResults) {
- List retVal = (List) txTemplate
+ public List> queryByExample(
+ final PersistableDataObject obj, final int maxResults) {
+ List> retVal = (List>) txTemplate
.execute(new TransactionCallback() {
- public List doInTransaction(
+ @Override
+ public List> doInTransaction(
TransactionStatus status) {
return getHibernateTemplate().findByExample(obj, 0,
maxResults);
@@ -448,7 +405,8 @@ public class CoreDao extends HibernateDaoSupport {
* The partially populated object
* @return A list of similar objects
*/
- public List queryByExample(PersistableDataObject obj) {
+ public List> queryByExample(
+ PersistableDataObject obj) {
return queryByExample(obj, -1);
}
@@ -468,6 +426,7 @@ public class CoreDao extends HibernateDaoSupport {
// Get a session and create a new criteria instance
rowsDeleted = (Integer) txTemplate
.execute(new TransactionCallback() {
+ @Override
public Integer doInTransaction(TransactionStatus status) {
String queryString = query.createHQLDelete();
Query hibQuery = getSession(false).createQuery(
@@ -504,6 +463,7 @@ public class CoreDao extends HibernateDaoSupport {
// Get a session and create a new criteria instance
queryResult = (List>) txTemplate
.execute(new TransactionCallback() {
+ @Override
public List> doInTransaction(TransactionStatus status) {
String queryString = query.createHQLQuery();
Query hibQuery = getSession(false).createQuery(
@@ -531,6 +491,15 @@ public class CoreDao extends HibernateDaoSupport {
return queryResult;
}
+ public void deleteAll(final List> objs) {
+ txTemplate.execute(new TransactionCallbackWithoutResult() {
+ @Override
+ public void doInTransactionWithoutResult(TransactionStatus status) {
+ getHibernateTemplate().deleteAll(objs);
+ }
+ });
+ }
+
/**
*
* @param fields
@@ -723,6 +692,7 @@ public class CoreDao extends HibernateDaoSupport {
QueryResult result = (QueryResult) txTemplate
.execute(new TransactionCallback() {
+ @Override
public QueryResult doInTransaction(TransactionStatus status) {
Query hibQuery = getSession(false)
.createQuery(hqlQuery);
@@ -776,6 +746,7 @@ public class CoreDao extends HibernateDaoSupport {
int queryResult = (Integer) txTemplate
.execute(new TransactionCallback() {
+ @Override
public Integer doInTransaction(TransactionStatus status) {
Query hibQuery = getSession(false).createQuery(hqlStmt);
// hibQuery.setCacheMode(CacheMode.NORMAL);
@@ -800,6 +771,7 @@ public class CoreDao extends HibernateDaoSupport {
long start = System.currentTimeMillis();
List> queryResult = (List>) txTemplate
.execute(new TransactionCallback() {
+ @Override
public List> doInTransaction(TransactionStatus status) {
return getSession(false).createSQLQuery(sql).list();
}
@@ -814,6 +786,7 @@ public class CoreDao extends HibernateDaoSupport {
long start = System.currentTimeMillis();
List> queryResult = (List>) txTemplate
.execute(new TransactionCallback() {
+ @Override
public List> doInTransaction(TransactionStatus status) {
Criteria crit = getSession(false).createCriteria(
@@ -848,6 +821,7 @@ public class CoreDao extends HibernateDaoSupport {
long start = System.currentTimeMillis();
int updateResult = (Integer) txTemplate
.execute(new TransactionCallback() {
+ @Override
public Integer doInTransaction(TransactionStatus status) {
return getSession(false).createSQLQuery(sql)
.executeUpdate();
@@ -1143,13 +1117,4 @@ public class CoreDao extends HibernateDaoSupport {
return getSessionFactory().getClassMetadata(daoClass);
}
}
-
- public void deleteAll(final List> objs) {
- txTemplate.execute(new TransactionCallbackWithoutResult() {
- @Override
- public void doInTransactionWithoutResult(TransactionStatus status) {
- getHibernateTemplate().deleteAll(objs);
- }
- });
- }
}
diff --git a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/dao/DaoConfig.java b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/dao/DaoConfig.java
index 98486c5b91..a02bdaed73 100644
--- a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/dao/DaoConfig.java
+++ b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/dao/DaoConfig.java
@@ -20,6 +20,11 @@
package com.raytheon.uf.edex.database.dao;
+import org.hibernate.SessionFactory;
+import org.springframework.orm.hibernate3.HibernateTransactionManager;
+
+import com.raytheon.uf.edex.core.EDEXUtil;
+
/**
* Configuration settings for a data access object.
* This object contains the required information to correctly instantiate a
@@ -31,14 +36,15 @@ package com.raytheon.uf.edex.database.dao;
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
- * 12/11/07 600 bphillip Initial Check in
- *
+ * 12/11/07 600 bphillip Initial Check in
+ * Oct 10, 2012 1261 djohnson Add ability for test overriding of bean lookups.
+ *
*
*
* @author bphillip
* @version 1
*/
-public class DaoConfig {
+public abstract class DaoConfig {
/** The default database name */
public static final String DEFAULT_DB_NAME = "metadata";
@@ -49,6 +55,21 @@ public class DaoConfig {
/** The transaction manager suffix */
private static final String TX_MANAGER = "TxManager";
+ // @VisibleForTesting
+ static SpringBeanLocator DEFAULT_LOCATOR = new SpringBeanLocator() {
+ @Override
+ public T lookupBean(Class resultClass, String beanName) {
+ return resultClass.cast(EDEXUtil.getESBComponent(beanName));
+ }
+ };
+
+ /**
+ * Used to locate Spring beans. By default, uses EDEXUtil to look them up.
+ * Package-level access for testing purposes.
+ */
+ // @VisibleForTesting
+ static SpringBeanLocator locator = DEFAULT_LOCATOR;
+
/**
* The default data access object configuration. This configuration
* specifies the metadata database
@@ -56,69 +77,27 @@ public class DaoConfig {
public static final DaoConfig DEFAULT = DaoConfig
.forDatabase(DEFAULT_DB_NAME);
- /** The database to connect to */
- private String dbName;
-
- /** The class for which the desired data access object is to be used for */
- private Class> daoClassName;
-
- /** The name of the Hibernate session factory to use */
- private String sessionFactoryName;
-
- /** The name of the Hibernate transaction manager to use */
- private String txManagerName;
-
/**
- * Default constructor.
- */
- private DaoConfig() {
- this.dbName = DEFAULT_DB_NAME;
- this.sessionFactoryName = DEFAULT_DB_NAME + SESSION_FACTORY;
- this.txManagerName = DEFAULT_DB_NAME + TX_MANAGER;
- }
-
- /**
- * Constructs a DaoConfig object using the specified class name, default
- * session factory, and the default transaction manager
+ * Retrieve the transaction manager.
*
- * @param className
- * The class object
+ * @return the transaction manager
*/
- private DaoConfig(Class> className) {
- this.daoClassName = className;
- this.dbName = DEFAULT_DB_NAME;
- this.sessionFactoryName = DEFAULT_DB_NAME + SESSION_FACTORY;
- this.txManagerName = DEFAULT_DB_NAME + TX_MANAGER;
- }
+ public abstract HibernateTransactionManager getTxManager();
/**
- * Constructs a DaoConfig object for the specified database using the
- * specified class name. The appropriate session factory and transaction
- * manager will be determined from the database name.
+ * Retrieve the session factory.
*
- * @param dbName
- * The database name
- * @param className
- * The class object
+ * @return the session factory
*/
- private DaoConfig(String dbName, Class> className) {
- this.daoClassName = className;
- this.dbName = dbName;
- this.sessionFactoryName = dbName + SESSION_FACTORY;
- this.txManagerName = dbName + TX_MANAGER;
- }
+ public abstract SessionFactory getSessionFactory();
/**
- * Constructs a DaoConfig object for the specified database.
+ * Retrieve the class type this DAO manages.
*
- * @param dbName
- * The database name
+ * @return the class type
*/
- private DaoConfig(String dbName) {
- this.dbName = dbName;
- this.sessionFactoryName = dbName + SESSION_FACTORY;
- this.txManagerName = dbName + TX_MANAGER;
- }
+ public abstract Class> getDaoClass();
+
/**
* Gets a DaoConfig object for the specified class using the default session
@@ -130,7 +109,7 @@ public class DaoConfig {
* factory and default transaction manager.
*/
public static DaoConfig forClass(Class> className) {
- return new DaoConfig(className);
+ return new SpringLookupDaoConfig(className);
}
/**
@@ -146,8 +125,8 @@ public class DaoConfig {
*/
public static DaoConfig forClass(String className)
throws ClassNotFoundException {
- return new DaoConfig(DaoConfig.class.getClassLoader().loadClass(
- ((String) className).trim()));
+ return new SpringLookupDaoConfig(DaoConfig.class.getClassLoader().loadClass(
+ (className).trim()));
}
/**
@@ -161,7 +140,7 @@ public class DaoConfig {
* name
*/
public static DaoConfig forClass(String dbName, Class> className) {
- return new DaoConfig(dbName, className);
+ return new SpringLookupDaoConfig(dbName, className);
}
/**
@@ -178,8 +157,8 @@ public class DaoConfig {
*/
public static DaoConfig forClass(String dbName, String className)
throws ClassNotFoundException {
- return new DaoConfig(dbName, DaoConfig.class.getClassLoader()
- .loadClass(((String) className).trim()));
+ return new SpringLookupDaoConfig(dbName, DaoConfig.class.getClassLoader()
+ .loadClass((className).trim()));
}
/**
@@ -188,39 +167,87 @@ public class DaoConfig {
* @return
*/
public static DaoConfig forDatabase(String dbName) {
- return new DaoConfig(dbName);
+ return new SpringLookupDaoConfig(dbName);
}
- /**
- * Gets the database name
- * @return The database name
- */
- public String getDbName() {
- return dbName;
- }
+ private static class SpringLookupDaoConfig extends DaoConfig {
- /**
- * Gets the dao class name
- * @return The dao class name
- */
- public Class> getDaoClassName() {
- return daoClassName;
- }
+ /** The class for which the desired data access object is to be used for */
+ private final Class> daoClass;
- /**
- * Gets the session factory name
- * @return The session factory name
- */
- public String getSessionFactoryName() {
- return sessionFactoryName;
- }
+ /** The name of the Hibernate session factory to use */
+ private final String sessionFactoryName;
- /**
- * Gets the transaction manager name
- * @return The transaction manager name
- */
- public String getTxManagerName() {
- return txManagerName;
- }
+ /** The name of the Hibernate transaction manager to use */
+ private final String txManagerName;
+ /**
+ * Default constructor.
+ */
+ private SpringLookupDaoConfig() {
+ this((Class>) null);
+ }
+
+ /**
+ * Constructs a DaoConfig object using the specified class name, default
+ * session factory, and the default transaction manager
+ *
+ * @param className
+ * The class object
+ */
+ private SpringLookupDaoConfig(Class> className) {
+ this(DEFAULT_DB_NAME, className);
+ }
+
+ /**
+ * Constructs a DaoConfig object for the specified database.
+ *
+ * @param dbName
+ * The database name
+ */
+ private SpringLookupDaoConfig(String dbName) {
+ this(dbName, null);
+ }
+
+ /**
+ * Constructs a DaoConfig object for the specified database using the
+ * specified class name. The appropriate session factory and transaction
+ * manager will be determined from the database name.
+ *
+ * @param dbName
+ * The database name
+ * @param daoClass
+ * The class object
+ */
+ private SpringLookupDaoConfig(String dbName, Class> daoClass) {
+ this.daoClass = daoClass;
+ this.sessionFactoryName = dbName + SESSION_FACTORY;
+ this.txManagerName = dbName + TX_MANAGER;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public HibernateTransactionManager getTxManager() {
+ return locator.lookupBean(HibernateTransactionManager.class,
+ txManagerName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public SessionFactory getSessionFactory() {
+ return locator.lookupBean(SessionFactory.class, sessionFactoryName);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Class> getDaoClass() {
+ return daoClass;
+ }
+ }
}
diff --git a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/dao/SpringBeanLocator.java b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/dao/SpringBeanLocator.java
new file mode 100644
index 0000000000..bd3fc6e0fe
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/dao/SpringBeanLocator.java
@@ -0,0 +1,52 @@
+/**
+ * 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.database.dao;
+
+/**
+ * Defines a strategy for looking up Spring beans.
+ *
+ *
+ *
+ * @author djohnson
+ * @version 1.0
+ */
+public interface SpringBeanLocator {
+
+ /**
+ * Lookup a Spring bean by its name.
+ *
+ * @param
+ * the result type
+ * @param resultClass
+ * the result class type
+ * @param beanName
+ * the bean name
+ * @return the looked up bean, or null, if not found
+ */
+ T lookupBean(Class resultClass, String beanName);
+}
diff --git a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/plugin/PluginDao.java b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/plugin/PluginDao.java
index dfe4f3618f..3ae6d3c559 100644
--- a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/plugin/PluginDao.java
+++ b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/plugin/PluginDao.java
@@ -34,6 +34,10 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.geotools.coverage.grid.GridCoverage2D;
+import org.geotools.geometry.jts.ReferencedEnvelope;
+import org.opengis.referencing.FactoryException;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
import org.springframework.transaction.TransactionStatus;
import org.springframework.transaction.support.TransactionCallbackWithoutResult;
@@ -50,7 +54,13 @@ import com.raytheon.uf.common.datastorage.IDataStore.StoreOp;
import com.raytheon.uf.common.datastorage.Request;
import com.raytheon.uf.common.datastorage.StorageException;
import com.raytheon.uf.common.datastorage.StorageStatus;
+import com.raytheon.uf.common.datastorage.records.ByteDataRecord;
+import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.datastorage.records.IDataRecord;
+import com.raytheon.uf.common.datastorage.records.IntegerDataRecord;
+import com.raytheon.uf.common.geospatial.ISpatialEnabled;
+import com.raytheon.uf.common.geospatial.ISpatialObject;
+import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.localization.IPathManager;
import com.raytheon.uf.common.localization.LocalizationContext;
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
@@ -70,6 +80,12 @@ import com.raytheon.uf.edex.database.purge.PurgeLogger;
import com.raytheon.uf.edex.database.purge.PurgeRule;
import com.raytheon.uf.edex.database.purge.PurgeRuleSet;
import com.raytheon.uf.edex.database.query.DatabaseQuery;
+import com.raytheon.uf.edex.database.spatial.DataReprojector;
+import com.raytheon.uf.edex.database.spatial.ReferencedDataRecord;
+import com.vividsolutions.jts.geom.Coordinate;
+import com.vividsolutions.jts.geom.Envelope;
+import com.vividsolutions.jts.geom.Geometry;
+import com.vividsolutions.jts.geom.Polygon;
/**
* Abstract implementation of a Plugin data access object
@@ -85,6 +101,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery;
* 2/6/09 1990 bphillip Initial creation
* 6/29/12 #828 dgilling Force getPurgeRulesForPlugin()
* to search only COMMON_STATIC.
+ * Oct 10, 2012 1261 djohnson Add some generics wildcarding.
*
*
* @author bphillip
@@ -173,13 +190,14 @@ public abstract class PluginDao extends CoreDao {
persistToDatabase(records);
}
+ @SuppressWarnings("unchecked")
public PluginDataObject[] persistToDatabase(PluginDataObject... records) {
- List toPersist = new ArrayList();
+ List> toPersist = new ArrayList>();
for (PluginDataObject record : records) {
toPersist.add(record);
}
- List duplicates = mergeAll(toPersist);
- for (PersistableDataObject pdo : duplicates) {
+ List> duplicates = mergeAll(toPersist);
+ for (PersistableDataObject
diff --git a/ncep/gov.noaa.nws.ncep.ui.pgen/src/gov/noaa/nws/ncep/ui/pgen/display/SymbolSetElement.java b/ncep/gov.noaa.nws.ncep.ui.pgen/src/gov/noaa/nws/ncep/ui/pgen/display/SymbolSetElement.java
index 8748d08528..649230371d 100644
--- a/ncep/gov.noaa.nws.ncep.ui.pgen/src/gov/noaa/nws/ncep/ui/pgen/display/SymbolSetElement.java
+++ b/ncep/gov.noaa.nws.ncep.ui.pgen/src/gov/noaa/nws/ncep/ui/pgen/display/SymbolSetElement.java
@@ -7,126 +7,117 @@
*/
package gov.noaa.nws.ncep.ui.pgen.display;
-import com.raytheon.uf.viz.core.IExtent;
+import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.PixelCoverage;
import com.raytheon.uf.viz.core.drawables.IImage;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
-import com.raytheon.uf.viz.core.exception.VizException;
import com.vividsolutions.jts.geom.Coordinate;
-
+import com.raytheon.viz.core.gl.images.GLImage;
/**
- * Contains a raster image and information needed to readily display that image
- * on a graphics target at one or more locations.
+ * Contains a raster image and information needed to readily display that image on a graphics target
+ * at one or more locations.
*
- * Objects of this class are typically created from Symbol or SymbolLocationSet
- * elements using the DisplayElementFactory class.
- *
+ * Objects of this class are typically created from Symbol or SymbolLocationSet elements using the
+ * DisplayElementFactory class.
* @author sgilbert
- *
+ *
*/
public class SymbolSetElement implements IDisplayable {
- /*
- * The raster image to be displayed
- */
- private IImage raster;
+ /*
+ * The raster image to be displayed
+ */
+ private IImage raster;
+
+ /*
+ * targets properties used for zoom and extent info
+ */
+ private PaintProperties paintProps;
+
+ /*
+ * Array of plot locations in pixel coordinates
+ */
+ private double[][] locations;
+ private Coordinate ul = new Coordinate(), ur= new Coordinate(), lr= new Coordinate(), ll= new Coordinate();
+
+ /**
+ * Constructor used to set an image and its associated locations
+ * @param raster Rater image to display
+ * @param paintProps paint properties for the target
+ * @param locations pixel coordinate locations to display the image
+ */
+ public SymbolSetElement(IImage raster, PaintProperties paintProps,
+ double[][] locations ) {
+ this.raster = raster;
+ this.paintProps = paintProps;
+ this.locations = locations;
+ }
- /*
- * targets properties used for zoom and extent info
- */
- private PaintProperties paintProps;
+ /**
+ * disposes the resources held by the raster image
+ * @see gov.noaa.nws.ncep.ui.pgen.display.IDisplayable#dispose()
+ */
+ @Override
+ public void dispose() {
- /*
- * Array of plot locations in pixel coordinates
- */
- private double[][] locations;
+ raster.dispose();
- private Coordinate ul = new Coordinate(), ur = new Coordinate(),
- lr = new Coordinate(), ll = new Coordinate();
+ }
- /**
- * Constructor used to set an image and its associated locations
- *
- * @param raster
- * Rater image to display
- * @param paintProps
- * paint properties for the target
- * @param locations
- * pixel coordinate locations to display the image
- */
- public SymbolSetElement(IImage raster, PaintProperties paintProps,
- double[][] locations) {
- this.raster = raster;
- this.paintProps = paintProps;
- this.locations = locations;
- }
+ /**
+ * Plots the image to the specified graphics target at the various locations
+ * @see gov.noaa.nws.ncep.ui.pgen.display.IDisplayable#draw(com.raytheon.viz.core.IGraphicsTarget)
+ */
+ @Override
+ public void draw(IGraphicsTarget target) {
- /**
- * disposes the resources held by the raster image
- *
- * @see gov.noaa.nws.ncep.ui.pgen.display.IDisplayable#dispose()
- */
- @Override
- public void dispose() {
+ double[] loc = new double[3];
- raster.dispose();
+ /*
+ * Scale image
+ */
+ double halfWidth;
+ double halfHeight;
+ double screenToWorldRatio = paintProps.getCanvasBounds().width
+ / paintProps.getView().getExtent().getWidth();
+ double scale = 0.5 / screenToWorldRatio ;
+ if ( raster instanceof GLImage ) {
+ halfWidth = ((GLImage)raster).getImage().getWidth() * scale;
+ halfHeight = ((GLImage)raster).getImage().getHeight() * scale;
+ }
+ else {
+ halfWidth = raster.getWidth() * scale;
+ halfHeight = raster.getHeight() * scale;
+ }
- }
-
- /**
- * Plots the image to the specified graphics target at the various locations
- *
- * @see gov.noaa.nws.ncep.ui.pgen.display.IDisplayable#draw(com.raytheon.viz.core.IGraphicsTarget)
- */
- @Override
- public void draw(IGraphicsTarget target) {
-
- double[] loc = new double[3];
-
- /*
- * Scale image
- */
- double halfWidth;
- double halfHeight;
-
- IExtent screenExtentInPixels = paintProps.getView().getExtent();
-
- double screenToWorldRatio = paintProps.getCanvasBounds().width
- / paintProps.getView().getExtent().getWidth();
- double scale = 0.5 / screenToWorldRatio;
- halfWidth = raster.getWidth() * scale;
- halfHeight = raster.getHeight() * scale;
-
- /*
- * draw raster image at each location
- */
- for (int j = 0; j < locations.length; j++) {
- loc = locations[j];
- if (loc == null || !screenExtentInPixels.contains(loc))
- continue;
- ul.x = loc[0] - halfWidth;
- ul.y = loc[1] - halfHeight;
- ur.x = loc[0] + halfWidth;
- ur.y = loc[1] - halfHeight;
- lr.x = loc[0] + halfWidth;
- lr.y = loc[1] + halfHeight;
- ll.x = loc[0] - halfWidth;
- ll.y = loc[1] + halfHeight;
- PixelCoverage extent = new PixelCoverage(ul, ur, lr, ll);
- /*
- * PixelCoverage extent = new PixelCoverage(new
- * Coordinate(loc[0]-halfWidth,loc[1]-halfHeight), new
- * Coordinate(loc[0]+halfWidth,loc[1]-halfHeight), new
- * Coordinate(loc[0]+halfWidth,loc[1]+halfHeight), new
- * Coordinate(loc[0]-halfWidth,loc[1]+halfHeight));
- */
- try {
- target.drawRaster(raster, extent, paintProps);
- } catch (VizException ve) {
- ve.printStackTrace();
- }
- }
- }
+ /*
+ * draw raster image at each location
+ */
+ for (int j=0; j < locations.length; j++) {
+ loc = locations[j];
+ ul.x = loc[0]-halfWidth;
+ ul.y = loc[1]-halfHeight;
+ ur.x = loc[0]+halfWidth;
+ ur.y = loc[1]-halfHeight;
+ lr.x = loc[0]+halfWidth;
+ lr.y = loc[1]+halfHeight;
+ ll.x = loc[0]-halfWidth;
+ ll.y = loc[1]+halfHeight;
+ PixelCoverage extent = new PixelCoverage(ul, ur, lr, ll);
+ /*
+ PixelCoverage extent = new PixelCoverage(new Coordinate(loc[0]-halfWidth,loc[1]-halfHeight),
+ new Coordinate(loc[0]+halfWidth,loc[1]-halfHeight),
+ new Coordinate(loc[0]+halfWidth,loc[1]+halfHeight),
+ new Coordinate(loc[0]-halfWidth,loc[1]+halfHeight));
+ */
+ try {
+ target.drawRaster(raster, extent, paintProps);
+ }
+ catch (VizException ve) {
+ ve.printStackTrace();
+ }
+ }
+ }
}
diff --git a/rpms/awips2.core/Installer.database/component.spec b/rpms/awips2.core/Installer.database/component.spec
index bc733f9f17..6b2e1b461d 100644
--- a/rpms/awips2.core/Installer.database/component.spec
+++ b/rpms/awips2.core/Installer.database/component.spec
@@ -66,7 +66,7 @@ cp -r %{_baseline_workspace}/${EXPECTED_PATH_TO_CONFIG}/${CONFIG_FILE_TO_INCLUDE
# Copy The SQL Scripts That The Database RPM Will Need To The
# Temporary Directory.
-DIRS_TO_COPY=('damcat' 'hmdb' 'migrated' 'setup' 'SHEF' 'vtec')
+DIRS_TO_COPY=('damcat' 'hmdb' 'migrated' 'setup' 'SHEF' 'vtec' 'ebxml' 'events')
for dir in ${DIRS_TO_COPY[*]};
do
cp -r %{_baseline_workspace}/${PATH_TO_DDL}/${dir}/* \
@@ -166,6 +166,7 @@ IFHS=${AWIPS2_DATA_DIRECTORY}/pgdata_ihfs
MAPS=${AWIPS2_DATA_DIRECTORY}/maps
DAMCAT=${AWIPS2_DATA_DIRECTORY}/damcat
HMDB=${AWIPS2_DATA_DIRECTORY}/hmdb
+EBXML=${AWIPS2_DATA_DIRECTORY}/ebxml
# Add The PostgreSQL Libraries And The PSQL Libraries To LD_LIBRARY_PATH.
export LD_LIBRARY_PATH=${POSTGRESQL_INSTALL}/lib:$LD_LIBRARY_PATH
@@ -271,6 +272,15 @@ function update_createDamcat()
${SQL_SHARE_DIR}/createDamcat.sql
}
+function update_createEbxml()
+{
+ echo ${AWIPS2_DATA_DIRECTORY} | sed 's/\//\\\//g' > .awips2_escape.tmp
+ AWIPS2_DATA_DIRECTORY_ESCAPED=`cat .awips2_escape.tmp`
+ rm -f .awips2_escape.tmp
+ perl -p -i -e "s/%{database_files_home}%/${AWIPS2_DATA_DIRECTORY_ESCAPED}/g" \
+ ${SQL_SHARE_DIR}/createEbxml.sql
+}
+
function update_createHMDB()
{
echo ${AWIPS2_DATA_DIRECTORY} | sed 's/\//\\\//g' > .awips2_escape.tmp
@@ -334,6 +344,10 @@ echo "--------------------------------------------------------------------------
echo "\| Creating a Directory for the hmdb Tablespace..."
echo "--------------------------------------------------------------------------------"
create_sql_element ${HMDB}
+echo "--------------------------------------------------------------------------------"
+echo "\| Creating a Directory for the ebxml Tablespace..."
+echo "--------------------------------------------------------------------------------"
+create_sql_element ${EBXML}
echo ""
echo "--------------------------------------------------------------------------------"
echo "\| Starting PostgreSQL..."
@@ -371,6 +385,9 @@ execute_psql_sql_script ${SQL_SHARE_DIR}/bit_table.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/collective.sql metadata
execute_psql_sql_script ${SQL_SHARE_DIR}/national_category.sql metadata
+# create the events schema
+execute_psql_sql_script ${SQL_SHARE_DIR}/createEventsSchema.sql metadata
+
echo "--------------------------------------------------------------------------------"
echo "\| Creating shef Tables..."
echo "--------------------------------------------------------------------------------"
@@ -387,6 +404,12 @@ execute_psql_sql_script ${SQL_SHARE_DIR}/populateDamcatDatabase.sql dc_ob7oax
update_createHMDB
su ${AWIPS_DEFAULT_USER} -c \
"${SQL_SHARE_DIR}/createHMDB.sh ${PSQL_INSTALL} ${AWIPS_DEFAULT_PORT} ${AWIPS_DEFAULT_USER} ${SQL_SHARE_DIR} ${SQL_LOG}"
+
+update_createEbxml
+echo "--------------------------------------------------------------------------------"
+echo "\| Creating ebxml Tables..."
+echo "--------------------------------------------------------------------------------"
+execute_psql_sql_script ${SQL_SHARE_DIR}/createEbxml.sql postgres
echo "--------------------------------------------------------------------------------"
echo "\| Creating VTEC Tables..."
echo "--------------------------------------------------------------------------------"
diff --git a/rpms/awips2.core/Installer.ldm/patch/etc/pqact.conf.template b/rpms/awips2.core/Installer.ldm/patch/etc/pqact.conf.template
old mode 100644
new mode 100755
diff --git a/rpms/awips2.edex/Installer.edex-base/scripts/init.d/edex_camel b/rpms/awips2.edex/Installer.edex-base/scripts/init.d/edex_camel
index 7ac4db2294..6df26fe72d 100644
--- a/rpms/awips2.edex/Installer.edex-base/scripts/init.d/edex_camel
+++ b/rpms/awips2.edex/Installer.edex-base/scripts/init.d/edex_camel
@@ -30,10 +30,10 @@ if [ $TOTAL_MEM -gt 4 ]; then
fi
# Default Services to start
-SERVICES=('ingest' 'ingestGrib' 'request')
+SERVICES=('ingest' 'ingestGrib' 'request' 'datadelivery')
if [ $HIGH_MEM == "on" ]; then
- SERVICES=('ingest' 'ingestGrib' 'ingestDat' 'request')
+ SERVICES=('ingest' 'ingestGrib' 'ingestDat' 'request' 'datadelivery')
fi
# Who to run EDEX server as, usually "awips". (NOT "root")
diff --git a/rpms/awips2.edex/Installer.edex-configuration/component.spec b/rpms/awips2.edex/Installer.edex-configuration/component.spec
index 614a158d47..079fc1e4b6 100644
--- a/rpms/awips2.edex/Installer.edex-configuration/component.spec
+++ b/rpms/awips2.edex/Installer.edex-configuration/component.spec
@@ -126,4 +126,4 @@ rm -rf ${RPM_BUILD_ROOT}
%dir /awips2
%dir /awips2/edex
%dir /awips2/edex/bin
-%config(noreplace) /awips2/edex/bin/setup.env
+%config(noreplace) /awips2/edex/bin/setup.env
\ No newline at end of file
diff --git a/rpms/awips2.edex/Installer.edex-datadelivery/component.spec b/rpms/awips2.edex/Installer.edex-datadelivery/component.spec
new file mode 100644
index 0000000000..d1b47fe04c
--- /dev/null
+++ b/rpms/awips2.edex/Installer.edex-datadelivery/component.spec
@@ -0,0 +1,70 @@
+# Turn off the brp-python-bytecompile script
+%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
+# Turn off the java jar repack
+%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-java-repack-jars[[:space:]].*$!!g')
+
+%define _component_name awips2-edex-datadelivery
+%define _component_project_dir awips2.edex/Installer.edex-datadelivery
+#
+# AWIPS II Edex Datadelivery Spec File
+#
+Name: %{_component_name}
+Summary: AWIPS II Edex Dat
+Version: %{_component_version}
+Release: %{_component_release}
+Group: AWIPSII
+BuildRoot: /tmp
+Prefix: %{_component_default_prefix}
+URL: N/A
+License: N/A
+Distribution: N/A
+Vendor: Raytheon
+Packager: Bryan Kowal
+
+AutoReq: no
+provides: %{_component_name}
+requires: awips2
+requires: awips2-edex-base
+requires: awips2-python
+requires: awips2-java
+requires: awips2-psql
+
+%description
+AWIPS II Edex Installation - Installs The AWIPS II Edex Datadelivery Plugins.
+
+%prep
+# Verify That The User Has Specified A BuildRoot.
+if [ "${RPM_BUILD_ROOT}" = "/tmp" ]
+then
+ echo "An Actual BuildRoot Must Be Specified. Use The --buildroot Parameter."
+ echo "Unable To Continue ... Terminating"
+ exit 1
+fi
+
+mkdir -p ${RPM_BUILD_ROOT}/awips2/edex
+
+%install
+DEPLOY_SCRIPT="build.edex/deploy-install.xml"
+
+# Deploy Edex To Our Temporary Build Directory.
+/awips2/ant/bin/ant -file ${WORKSPACE_DIR}/${DEPLOY_SCRIPT} \
+ -Dinstall.dir=${RPM_BUILD_ROOT}/awips2/edex \
+ -Dinstaller=true -Dlocal.build=false \
+ -Dcomponent.to.deploy=edex-datadelivery
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+
+%pre
+%post
+%preun
+%postun
+
+%clean
+rm -rf ${RPM_BUILD_ROOT}
+
+%files
+%defattr(644,awips,fxalpha,755)
+%dir /awips2
+%dir /awips2/edex
+/awips2/edex/*
\ No newline at end of file
diff --git a/rpms/awips2.qpid/SOURCES/queueCreator.sh b/rpms/awips2.qpid/SOURCES/queueCreator.sh
index c8ccf29261..7dda8e76a6 100644
--- a/rpms/awips2.qpid/SOURCES/queueCreator.sh
+++ b/rpms/awips2.qpid/SOURCES/queueCreator.sh
@@ -52,4 +52,12 @@ do
qpid-config add queue $queue --durable --file-count 16 --file-size 24
done
+#define 24 Meg persistence queues for HPE ingest
+QUEUES=('Ingest.dhr' 'dhrProcess')
+for queue in ${QUEUES[*]};
+do
+ echo "Creating queue $queue"
+ qpid-config add queue $queue --durable --file-count 16 --file-size 24
+done
+
diff --git a/rpms/common/yum/arch.x86/comps.xml b/rpms/common/yum/arch.x86/comps.xml
index 51501f4677..168bad9fc9 100644
--- a/rpms/common/yum/arch.x86/comps.xml
+++ b/rpms/common/yum/arch.x86/comps.xml
@@ -35,6 +35,7 @@
awips2-edex-configurationawips2-edex-nppawips2-edex-ncep
+ awips2-edex-datadeliveryawips2-gfesuite-serverawips2-httpd-pypies
@@ -186,6 +187,8 @@
awips2-cave-viz-nppawips2-cave-viz-kml-exportawips2-cave-viz-collaboration
+ awips2-cave-viz-kml-export
+ awips2-cave-viz-datadeliveryawips2-gfesuite-clientawips2-alertviz
@@ -247,6 +250,7 @@
awips2-edex-textawips2-edex-ncepawips2-edex-npp
+ awips2-edex-datadeliveryawips2-gfesuite-serverawips2-hydroapps-shared
@@ -507,6 +511,8 @@
awips2-cave-viz-thinclientawips2-cave-viz-nppawips2-cave-viz-collaboration
+ awips2-cave-viz-kml-export
+ awips2-cave-viz-datadeliveryawips2-localapps-environment
diff --git a/rpms/common/yum/arch.x86_64/comps.xml b/rpms/common/yum/arch.x86_64/comps.xml
index 3229a222d7..f6b4f6c05c 100644
--- a/rpms/common/yum/arch.x86_64/comps.xml
+++ b/rpms/common/yum/arch.x86_64/comps.xml
@@ -125,6 +125,7 @@
awips2-cave-viz-nppawips2-cave-viz-kml-exportawips2-cave-viz-collaboration
+ awips2-cave-viz-datadeliveryawips2-gfesuite-clientawips2-alertviz