Merge branch 'dd_pre_release_2.1' into development
Former-commit-id:e4e75ec268
[formerlyf1fc14ce90
] [formerlye4e75ec268
[formerlyf1fc14ce90
] [formerly329a40852c
[formerly 076dd7338edcf45a33f6485f190831acd344b954]]] Former-commit-id:329a40852c
Former-commit-id:2f3f1d88b4
[formerlyb0b51dbcb6
] Former-commit-id:1348b91f27
This commit is contained in:
commit
898e63c10e
84 changed files with 1605 additions and 721 deletions
|
@ -2,7 +2,7 @@
|
|||
<NotificationColumns>
|
||||
<column sortAsc="true" sortColumn="true" visible="true" name="User"/>
|
||||
<column sortAsc="true" sortColumn="false" visible="true" name="Message"/>
|
||||
<column sortAsc="true" sortColumn="false" visible="true" name="Time"/>
|
||||
<column sortAsc="false" sortColumn="false" visible="true" name="Time"/>
|
||||
<column sortAsc="true" sortColumn="false" visible="true" name="Priority"/>
|
||||
<column sortAsc="true" sortColumn="false" visible="true" name="Category"/>
|
||||
<messageLoad>
|
||||
|
|
|
@ -31,6 +31,7 @@ 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.viz.core.auth.UserController;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
||||
import com.raytheon.uf.viz.datadelivery.subscription.ISubscriptionManagerFilter;
|
||||
import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionManagerDlg;
|
||||
|
@ -49,6 +50,8 @@ import com.raytheon.uf.viz.datadelivery.subscription.SubscriptionManagerFilters;
|
|||
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
||||
* May 28, 2013 1650 djohnson Allow using filters for the Subscription Manager Dialog.
|
||||
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||
* Sep 04, 2013 2330 bgonzale execute now filters subscriptions by current site id.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -77,7 +80,8 @@ public class SubscriptionManagerAction extends AbstractHandler {
|
|||
|
||||
@Override
|
||||
public Object execute(ExecutionEvent arg0) {
|
||||
return loadSubscriptionManager(SubscriptionManagerFilters.getAll());
|
||||
return loadSubscriptionManager(SubscriptionManagerFilters
|
||||
.getBySiteId(LocalizationManager.getInstance().getCurrentSite()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,6 +43,7 @@ import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
|||
import com.raytheon.uf.viz.datadelivery.subscription.subset.SubsetFileManager;
|
||||
import com.raytheon.uf.viz.datadelivery.subscription.subset.SubsetManagerDlg;
|
||||
import com.raytheon.uf.viz.datadelivery.subscription.subset.xml.SubsetXML;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* Handler for launching the Subset Manager Dialog.
|
||||
|
@ -58,7 +59,8 @@ import com.raytheon.uf.viz.datadelivery.subscription.subset.xml.SubsetXML;
|
|||
* Aug 10, 2012 1022 djohnson Store provider name in {@link SubsetXml}, use GriddedDataSet.
|
||||
* Aug 21, 2012 0743 djohnson Change getMetaData to getDataSet.
|
||||
* Oct 03, 2012 1241 djohnson Use {@link DataDeliveryPermission}.
|
||||
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||
* Jul 26, 2013 2232 mpduff Refactored Data Delivery permissions.
|
||||
* Sep 04, 2013 2314 mpduff LoadSave dialog now non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -94,33 +96,38 @@ public class SubsetAction extends AbstractHandler {
|
|||
+ permission;
|
||||
if (DataDeliveryServices.getPermissionsService()
|
||||
.checkPermissions(user, msg, permission).isAuthorized()) {
|
||||
Shell shell = PlatformUI.getWorkbench()
|
||||
final Shell shell = PlatformUI.getWorkbench()
|
||||
.getActiveWorkbenchWindow().getShell();
|
||||
if (loadDlg == null || loadDlg.isDisposed()) {
|
||||
loadDlg = new LoadSaveConfigDlg(shell, DialogType.OPEN,
|
||||
SUBSET_PATH, "", true);
|
||||
loadDlg.setCloseCallback(new ICloseCallback() {
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof LocalizationFile) {
|
||||
LocalizationFile locFile = (LocalizationFile) returnValue;
|
||||
SubsetXML<?> subset = SubsetFileManager
|
||||
.getInstance().loadSubset(
|
||||
locFile.getFile().getName());
|
||||
|
||||
DataSet data = MetaDataManager.getInstance()
|
||||
.getDataSet(subset.getDatasetName(),
|
||||
subset.getProviderName());
|
||||
|
||||
if (dlg == null || dlg.isDisposed()) {
|
||||
dlg = SubsetManagerDlg.fromSubsetXML(shell,
|
||||
data, true, subset);
|
||||
dlg.open();
|
||||
} else {
|
||||
dlg.bringToTop();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
loadDlg.open();
|
||||
} else {
|
||||
loadDlg.bringToTop();
|
||||
}
|
||||
LocalizationFile locFile = (LocalizationFile) loadDlg
|
||||
.getReturnValue();
|
||||
if (locFile == null) {
|
||||
return null;
|
||||
}
|
||||
SubsetXML<?> subset = SubsetFileManager.getInstance()
|
||||
.loadSubset(locFile.getFile().getName());
|
||||
|
||||
DataSet data = MetaDataManager.getInstance().getDataSet(
|
||||
subset.getDatasetName(), subset.getProviderName());
|
||||
|
||||
if (dlg == null || dlg.isDisposed()) {
|
||||
dlg = SubsetManagerDlg.fromSubsetXML(shell, data, true,
|
||||
subset);
|
||||
dlg.open();
|
||||
} else {
|
||||
dlg.bringToTop();
|
||||
}
|
||||
}
|
||||
} catch (AuthException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||
|
|
|
@ -48,6 +48,7 @@ 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.FileUtil;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.core.notification.NotificationMessage;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.IDialogClosed;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.SortImages.SortDirection;
|
||||
|
@ -83,6 +84,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
|
|||
* Jan 10, 2013 1346 mpduff Add additional information to the dataset details output.
|
||||
* Feb 15, 2013 1638 mschenke Moved Util.EOL into FileUtil
|
||||
* Apr 10, 2013 1891 djohnson Declare variable as List.
|
||||
* Sep 11, 2013 2352 mpduff Add siteId to getSubscribedToDataSetNames method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -369,7 +371,8 @@ public class BrowserTableComp extends TableComp implements IDialogClosed {
|
|||
for (String param : paramList) {
|
||||
sb.append("--- ").append(param);
|
||||
sb.append(getSpacing(max + 1, param));
|
||||
sb.append(paramMap.get(param).getDefinition()).append(FileUtil.EOL);
|
||||
sb.append(paramMap.get(param).getDefinition()).append(
|
||||
FileUtil.EOL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -623,7 +626,8 @@ public class BrowserTableComp extends TableComp implements IDialogClosed {
|
|||
Set<String> datasetNames = Collections.emptySet();
|
||||
try {
|
||||
datasetNames = DataDeliveryHandlers.getSubscriptionHandler()
|
||||
.getSubscribedToDataSetNames();
|
||||
.getSubscribedToDataSetNames(
|
||||
LocalizationManager.getInstance().getCurrentSite());
|
||||
} catch (RegistryHandlerException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to retrieve subscription dataset names!", e);
|
||||
|
|
|
@ -81,8 +81,10 @@ import com.raytheon.uf.viz.datadelivery.help.HelpManager;
|
|||
import com.raytheon.uf.viz.datadelivery.services.DataDeliveryServices;
|
||||
import com.raytheon.uf.viz.datadelivery.subscription.subset.SubsetManagerDlg;
|
||||
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryGUIUtils;
|
||||
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
||||
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
|
@ -118,6 +120,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Jun 06, 2013 2030 mpduff Updates to help.
|
||||
* Jul 05, 2013 2137 mpduff Changed data type to a single select list, changed layout.
|
||||
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||
* Sep 04, 2013 2314 mpduff Load/save config dialog now non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -922,71 +925,79 @@ public class DataBrowserDlg extends CaveSWTDialog implements IDataTableUpdate,
|
|||
* @param type
|
||||
* Dialog type.
|
||||
*/
|
||||
private void displayLoadSaveConfigDlg(DialogType type) {
|
||||
private void displayLoadSaveConfigDlg(final DialogType type) {
|
||||
if (loadSaveDlg == null || loadSaveDlg.isDisposed()) {
|
||||
FilterManager fm = FilterManager.getInstance();
|
||||
|
||||
loadSaveDlg = new LoadSaveConfigDlg(shell, type, CONFIG_PATH,
|
||||
DEFAULT_CONFIG, true);
|
||||
loadSaveDlg.setCloseCallback(new ICloseCallback() {
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof LocalizationFile) {
|
||||
locFile = (LocalizationFile) returnValue;
|
||||
FilterManager fm = FilterManager.getInstance();
|
||||
if (type == DialogType.SAVE_AS) {
|
||||
xml = new FilterSettingsXML();
|
||||
if (datatypeList.getSelectionCount() > 0) {
|
||||
// Save data type
|
||||
String dataType = datatypeList
|
||||
.getItem(datatypeList
|
||||
.getSelectionIndex());
|
||||
|
||||
FilterTypeXML ftx = new FilterTypeXML();
|
||||
ftx.setFilterType("Data Type");
|
||||
ftx.addValue(dataType);
|
||||
|
||||
xml.addFilterType(ftx);
|
||||
|
||||
// Save area settings
|
||||
AreaXML area = new AreaXML();
|
||||
if (envelope != null) {
|
||||
area.setEnvelope(envelope);
|
||||
}
|
||||
xml.setArea(area);
|
||||
|
||||
setText(WINDOW_TITLE + " - ("
|
||||
+ locFile.getFile().getName() + ")");
|
||||
|
||||
// Save filter settings
|
||||
filterExpandBar.populateFilterSettingsXml(xml);
|
||||
|
||||
fm.setCurrentFile(locFile);
|
||||
fm.setXml(xml);
|
||||
fm.saveXml();
|
||||
setClean();
|
||||
} else {
|
||||
DataDeliveryUtils.showMessage(getShell(),
|
||||
SWT.ICON_INFORMATION,
|
||||
"Selection Required",
|
||||
"Must make a selection before saving.");
|
||||
}
|
||||
|
||||
} else if (type == DialogType.OPEN) {
|
||||
setText(WINDOW_TITLE + " - ("
|
||||
+ locFile.getFile().getName() + ")");
|
||||
fm.setCurrentFile(locFile);
|
||||
xml = fm.getXml();
|
||||
updateFilters();
|
||||
selectedFile = locFile.getFile().getName();
|
||||
|
||||
} else if (type == DialogType.DELETE) {
|
||||
try {
|
||||
if (locFile != null) {
|
||||
locFile.delete();
|
||||
}
|
||||
} catch (LocalizationOpFailedException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
e.getLocalizedMessage(), e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
loadSaveDlg = null;
|
||||
}
|
||||
});
|
||||
|
||||
loadSaveDlg.open();
|
||||
|
||||
if (type == DialogType.SAVE_AS) {
|
||||
this.locFile = (LocalizationFile) loadSaveDlg.getReturnValue();
|
||||
if (locFile != null) {
|
||||
xml = new FilterSettingsXML();
|
||||
|
||||
// Save data type
|
||||
String dataType = datatypeList.getItem(datatypeList
|
||||
.getSelectionIndex());
|
||||
|
||||
FilterTypeXML ftx = new FilterTypeXML();
|
||||
ftx.setFilterType("Data Type");
|
||||
ftx.addValue(dataType);
|
||||
|
||||
xml.addFilterType(ftx);
|
||||
|
||||
// Save area settings
|
||||
AreaXML area = new AreaXML();
|
||||
if (envelope != null) {
|
||||
area.setEnvelope(envelope);
|
||||
}
|
||||
xml.setArea(area);
|
||||
|
||||
setText(WINDOW_TITLE + " - (" + locFile.getFile().getName()
|
||||
+ ")");
|
||||
|
||||
// Save filter settings
|
||||
filterExpandBar.populateFilterSettingsXml(xml);
|
||||
|
||||
fm.setCurrentFile(locFile);
|
||||
fm.setXml(xml);
|
||||
fm.saveXml();
|
||||
}
|
||||
|
||||
setClean();
|
||||
} else if (type == DialogType.OPEN) {
|
||||
this.locFile = (LocalizationFile) loadSaveDlg.getReturnValue();
|
||||
if (locFile != null) {
|
||||
setText(WINDOW_TITLE + " - (" + locFile.getFile().getName()
|
||||
+ ")");
|
||||
fm.setCurrentFile(locFile);
|
||||
xml = fm.getXml();
|
||||
updateFilters();
|
||||
this.selectedFile = locFile.getFile().getName();
|
||||
}
|
||||
} else if (type == DialogType.DELETE) {
|
||||
this.locFile = (LocalizationFile) loadSaveDlg.getReturnValue();
|
||||
try {
|
||||
if (locFile != null) {
|
||||
locFile.delete();
|
||||
}
|
||||
} catch (LocalizationOpFailedException e) {
|
||||
// statusHandler.handle(Priority.PROBLEM,
|
||||
// e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
loadSaveDlg.bringToTop();
|
||||
}
|
||||
|
|
|
@ -86,6 +86,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Aug 22, 2012 0743 djohnson Add new TimeXML sub-classes.
|
||||
* Apr 25, 2013 1820 mpduff Implement deletion of config file.
|
||||
* Jun 04, 2013 223 mpduff Refactor method rename and add new class to JaxB context.
|
||||
* Sep 04, 2013 2314 mpduff Made non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -201,7 +202,7 @@ public class LoadSaveConfigDlg extends CaveSWTDialog {
|
|||
public LoadSaveConfigDlg(Shell parent, DialogType type,
|
||||
String fileNamePath, String excludedNameForSaving,
|
||||
boolean showPreview) {
|
||||
super(parent, SWT.TITLE);
|
||||
super(parent, SWT.TITLE | SWT.APPLICATION_MODAL, CAVE.DO_NOT_BLOCK);
|
||||
|
||||
if (type == DialogType.OPEN) {
|
||||
setText("Load Configuration");
|
||||
|
|
|
@ -47,6 +47,7 @@ import com.raytheon.uf.common.datadelivery.registry.Subscription.SubscriptionPri
|
|||
* Jan 04, 2013 1420 mpduff Add latency.
|
||||
* Jan 25, 2013 1528 djohnson Use priority enum instead of raw integers.
|
||||
* Jun 04, 2013 223 mpduff Changes for Point Data.
|
||||
* Aug 30, 2013 2288 bgonzale Added display of priority and latency rules.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -60,6 +61,15 @@ public class PriorityComp extends Composite {
|
|||
/** Latency Text field */
|
||||
private Text latencyText;
|
||||
|
||||
/** Should the rules for priority and latency be displayed. **/
|
||||
private final boolean hasRules;
|
||||
|
||||
/** The latency Rule */
|
||||
private final int latencyRule;
|
||||
|
||||
/** The priority Rule */
|
||||
private final SubscriptionPriority priorityRule;
|
||||
|
||||
/** The latency value */
|
||||
private final int latency;
|
||||
|
||||
|
@ -77,11 +87,43 @@ public class PriorityComp extends Composite {
|
|||
* Parent composite.
|
||||
* @param latency
|
||||
* @param priority
|
||||
* @param readOnlyLatency
|
||||
* is latency editable.
|
||||
*/
|
||||
public PriorityComp(Composite parent, int latency,
|
||||
SubscriptionPriority priority, boolean readOnlyLatency) {
|
||||
super(parent, SWT.NONE);
|
||||
this.hasRules = false;
|
||||
this.latencyRule = 0;
|
||||
this.latency = latency;
|
||||
this.priorityRule = null;
|
||||
this.priority = priority;
|
||||
this.readOnlyLatency = readOnlyLatency;
|
||||
init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param parent
|
||||
* Parent composite.
|
||||
* @param latencyRule
|
||||
* configured rule setting to display for latency
|
||||
* @param latency
|
||||
* @param priorityRule
|
||||
* configured rule setting to display for latency
|
||||
* @param priority
|
||||
* @param readOnlyLatency
|
||||
* is latency editable.
|
||||
*/
|
||||
public PriorityComp(Composite parent, int latencyRule, int latency,
|
||||
SubscriptionPriority priorityRule, SubscriptionPriority priority,
|
||||
boolean readOnlyLatency) {
|
||||
super(parent, SWT.NONE);
|
||||
this.hasRules = true;
|
||||
this.latencyRule = latencyRule;
|
||||
this.latency = latency;
|
||||
this.priorityRule = priorityRule;
|
||||
this.priority = priority;
|
||||
this.readOnlyLatency = readOnlyLatency;
|
||||
init();
|
||||
|
@ -126,7 +168,14 @@ public class PriorityComp extends Composite {
|
|||
priorityComp.setLayout(gl);
|
||||
|
||||
Label priorityLbl = new Label(priorityComp, SWT.NONE);
|
||||
priorityLbl.setText(" Priority: ");
|
||||
StringBuilder sb = new StringBuilder(" Priority");
|
||||
if (hasRules) {
|
||||
sb.append(" (Rule: ");
|
||||
sb.append(priorityRule.getPriorityName());
|
||||
sb.append(")");
|
||||
}
|
||||
sb.append(":");
|
||||
priorityLbl.setText(sb.toString());
|
||||
|
||||
SubscriptionPriority[] prioritiesArr = SubscriptionPriority.values();
|
||||
String[] priorities = new String[prioritiesArr.length];
|
||||
|
@ -155,7 +204,14 @@ public class PriorityComp extends Composite {
|
|||
latencyComp.setLayoutData(gd);
|
||||
|
||||
Label latencyLbl = new Label(latencyComp, SWT.NONE);
|
||||
latencyLbl.setText("Latency (Minutes):");
|
||||
sb = new StringBuilder("Latency in Minutes");
|
||||
if (hasRules) {
|
||||
sb.append(" (Rule: ");
|
||||
sb.append(latencyRule);
|
||||
sb.append(")");
|
||||
}
|
||||
sb.append(":");
|
||||
latencyLbl.setText(sb.toString());
|
||||
|
||||
if (readOnlyLatency) {
|
||||
latencyLabel = new Label(latencyComp, SWT.BORDER);
|
||||
|
@ -172,6 +228,7 @@ public class PriorityComp extends Composite {
|
|||
.setToolTipText("Time in minutes allotted for a subscription to download");
|
||||
latencyText.setText(String.valueOf(this.latency));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,10 +22,8 @@ package com.raytheon.uf.viz.datadelivery.notification;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.FocusAdapter;
|
||||
import org.eclipse.swt.events.FocusEvent;
|
||||
import org.eclipse.swt.events.KeyAdapter;
|
||||
import org.eclipse.swt.events.KeyEvent;
|
||||
import org.eclipse.swt.events.KeyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
|
@ -46,20 +44,21 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
|
||||
/**
|
||||
* Find dialog for the Notification Table.
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 01, 2012 452 jpiatt Initial creation.
|
||||
* Jun 1, 2012 645 jpiatt Added tooltips.
|
||||
* Jun 07, 2012 687 lvenable Table data refactor.
|
||||
* Dec 12. 2012 1418 mpduff Change label.
|
||||
*
|
||||
* Aug 30, 2013 2314 mpduff Fixed find, filter, and various other bugs.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author jpiatt
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -131,7 +130,7 @@ public class FindDlg extends CaveSWTDialog {
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
*
|
||||
* @param parent
|
||||
* The parent shell
|
||||
* @param filteredTableList
|
||||
|
@ -144,24 +143,24 @@ public class FindDlg extends CaveSWTDialog {
|
|||
* Selected table index
|
||||
* @param callback
|
||||
* ITableFind callback
|
||||
*
|
||||
*
|
||||
*/
|
||||
public FindDlg(Shell parent, TableDataManager<NotificationRowData> filteredTableList, int sIndex, int eIndex,
|
||||
int selected, ITableFind callback) {
|
||||
super(parent, SWT.DIALOG_TRIM, CAVE.NONE);
|
||||
public FindDlg(Shell parent,
|
||||
TableDataManager<NotificationRowData> filteredTableList,
|
||||
int sIndex, int eIndex, int selected, ITableFind callback) {
|
||||
super(parent, SWT.DIALOG_TRIM, CAVE.NONE | CAVE.DO_NOT_BLOCK);
|
||||
this.setText("Find");
|
||||
|
||||
this.filteredTableList = filteredTableList;
|
||||
sIndex = startIndex;
|
||||
eIndex = endIndex;
|
||||
selected = selectedIndex;
|
||||
selectedIndex = selected;
|
||||
this.callback = callback;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#constructShellLayout()
|
||||
*/
|
||||
@Override
|
||||
|
@ -176,24 +175,21 @@ public class FindDlg extends CaveSWTDialog {
|
|||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org
|
||||
* .eclipse.swt.widgets.Shell)
|
||||
*/
|
||||
@Override
|
||||
protected void initializeComponents(Shell shell) {
|
||||
|
||||
createFindLayout();
|
||||
createBottomButtons();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the Find Dialog pop up.
|
||||
*/
|
||||
private void createFindLayout() {
|
||||
|
||||
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
|
||||
gd.widthHint = 275;
|
||||
GridLayout gl = new GridLayout(2, false);
|
||||
|
@ -214,26 +210,11 @@ public class FindDlg extends CaveSWTDialog {
|
|||
findTxt.setLayoutData(gd);
|
||||
findTxt.selectAll();
|
||||
findTxt.setLayoutData(gd);
|
||||
|
||||
findTxt.addFocusListener(new FocusAdapter() {
|
||||
findTxt.addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
public void focusLost(FocusEvent e) {
|
||||
// handleFocusLost(e);
|
||||
}
|
||||
});
|
||||
findTxt.addKeyListener(new KeyListener() {
|
||||
@Override
|
||||
// change
|
||||
public void keyReleased(KeyEvent e) {
|
||||
|
||||
findText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
// Not Called
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
gl = new GridLayout(2, false);
|
||||
|
@ -275,7 +256,6 @@ public class FindDlg extends CaveSWTDialog {
|
|||
categoryBtn = new Button(columnComp, SWT.RADIO);
|
||||
categoryBtn.setText("Category");
|
||||
categoryBtn.setToolTipText("Search Category column");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -308,13 +288,13 @@ public class FindDlg extends CaveSWTDialog {
|
|||
highlightBtn = new Button(bottomComp, SWT.PUSH);
|
||||
highlightBtn.setText("Highlight All");
|
||||
highlightBtn.setLayoutData(btnData);
|
||||
highlightBtn.setToolTipText("Highlight all rows matching search criteria");
|
||||
highlightBtn
|
||||
.setToolTipText("Highlight all rows matching search criteria");
|
||||
highlightBtn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
handleHighlightBtn();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Close Button
|
||||
|
@ -328,11 +308,11 @@ public class FindDlg extends CaveSWTDialog {
|
|||
close();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Find text on key release. Check all pages of filtered list.
|
||||
* Find text on key release. Check all pages of filtered list. Stop when
|
||||
* match is found and don't move to the next.
|
||||
*/
|
||||
private void findText() {
|
||||
|
||||
|
@ -345,9 +325,6 @@ public class FindDlg extends CaveSWTDialog {
|
|||
caseFlag = caseBtn.getSelection();
|
||||
excludeFlag = exclusionBtn.getSelection();
|
||||
|
||||
// Set to true if item exists
|
||||
exists = false;
|
||||
|
||||
int itemCount = filteredTableList.getDataArray().size();
|
||||
tableIndex = 0;
|
||||
|
||||
|
@ -361,47 +338,47 @@ public class FindDlg extends CaveSWTDialog {
|
|||
sub = row.getCategory();
|
||||
|
||||
if (tableIndex <= itemCount) {
|
||||
|
||||
tableIndex++;
|
||||
|
||||
if (caseFlag) {
|
||||
if (excludeFlag) {
|
||||
// Select index if does not match message or
|
||||
// subscription
|
||||
if ((!msg.contains(text) && msgFlag) || (!sub.contains(text) && categoryFlag)) {
|
||||
if ((!msg.contains(text) && msgFlag)
|
||||
|| (!sub.contains(text) && categoryFlag)) {
|
||||
exists = true;
|
||||
callback.selectIndex(tableIndex);
|
||||
break;
|
||||
}
|
||||
// Select index if matches message or subscription
|
||||
}
|
||||
else if ((msg.contains(text) && msgFlag) || (sub.contains(text) && categoryFlag)) {
|
||||
} else if ((msg.contains(text) && msgFlag)
|
||||
|| (sub.contains(text) && categoryFlag)) {
|
||||
exists = true;
|
||||
callback.selectIndex(tableIndex);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (excludeFlag) {
|
||||
// Select index if matches non case sensitive
|
||||
// message or subscription
|
||||
if ((!msg.toUpperCase().contains(text.toUpperCase()) && msgFlag)
|
||||
|| (!sub.toLowerCase().contains(text.toLowerCase()) && categoryFlag)) {
|
||||
if ((!msg.toUpperCase()
|
||||
.contains(text.toUpperCase()) && msgFlag)
|
||||
|| (!sub.toLowerCase().contains(
|
||||
text.toLowerCase()) && categoryFlag)) {
|
||||
exists = true;
|
||||
callback.selectIndex(tableIndex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if ((msg.toUpperCase().contains(text.toUpperCase()) && msgFlag)
|
||||
|| (sub.toLowerCase().contains(text.toLowerCase()) && categoryFlag)) {
|
||||
} else if ((msg.toUpperCase().contains(
|
||||
text.toUpperCase()) && msgFlag)
|
||||
|| (sub.toLowerCase().contains(
|
||||
text.toLowerCase()) && categoryFlag)) {
|
||||
exists = true;
|
||||
callback.selectIndex(tableIndex);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -414,20 +391,8 @@ public class FindDlg extends CaveSWTDialog {
|
|||
// Text in the find text box
|
||||
String text = findTxt.getText();
|
||||
|
||||
// Get button selections
|
||||
msgFlag = msgBtn.getSelection();
|
||||
categoryFlag = categoryBtn.getSelection();
|
||||
caseFlag = caseBtn.getSelection();
|
||||
excludeFlag = exclusionBtn.getSelection();
|
||||
|
||||
int itemCount = filteredTableList.getDataArray().size();
|
||||
int findTextLength = findTxt.getText().length();
|
||||
|
||||
boolean search = false;
|
||||
selectedIndex = selectedIndex + 1;
|
||||
|
||||
// If no text is entered
|
||||
if (findTextLength == 0) {
|
||||
if (text.isEmpty()) {
|
||||
MessageBox mb = new MessageBox(shell, SWT.ICON_ERROR | SWT.OK);
|
||||
mb.setText("Find Warning");
|
||||
mb.setMessage("Please enter text in the 'Find' field.");
|
||||
|
@ -435,76 +400,87 @@ public class FindDlg extends CaveSWTDialog {
|
|||
return;
|
||||
}
|
||||
|
||||
while (search == false) {
|
||||
// Get button selections
|
||||
msgFlag = msgBtn.getSelection();
|
||||
categoryFlag = categoryBtn.getSelection();
|
||||
caseFlag = caseBtn.getSelection();
|
||||
excludeFlag = exclusionBtn.getSelection();
|
||||
|
||||
int itemCount = filteredTableList.getDataArray().size();
|
||||
boolean continueSearch = true;
|
||||
boolean exists = false;
|
||||
boolean hitEnd = false;
|
||||
selectedIndex = selectedIndex + 1;
|
||||
|
||||
while (continueSearch) {
|
||||
if (tableIndex < itemCount) {
|
||||
|
||||
// Get the row data starting at the currently highlighted row
|
||||
NotificationRowData row = filteredTableList.getDataArray().get(tableIndex);
|
||||
NotificationRowData row = filteredTableList.getDataArray().get(
|
||||
tableIndex);
|
||||
|
||||
// Column data
|
||||
msg = row.getMessage();
|
||||
sub = row.getCategory();
|
||||
|
||||
if (tableIndex < itemCount) {
|
||||
tableIndex++;
|
||||
}
|
||||
tableIndex++;
|
||||
|
||||
if (caseFlag) {
|
||||
if (excludeFlag) {
|
||||
// Select index if does not match message or
|
||||
// subscription
|
||||
if ((!msg.contains(text) && msgFlag) || (!sub.contains(text) && categoryFlag)) {
|
||||
search = true;
|
||||
if ((!msg.contains(text) && msgFlag)
|
||||
|| (!sub.contains(text) && categoryFlag)) {
|
||||
continueSearch = false;
|
||||
callback.selectIndex(tableIndex);
|
||||
}
|
||||
}
|
||||
else if ((msg.contains(text) && msgFlag) || (sub.contains(text) && categoryFlag)) {
|
||||
} else if ((msg.contains(text) && msgFlag)
|
||||
|| (sub.contains(text) && categoryFlag)) {
|
||||
// Select index if matches message or subscription
|
||||
search = true;
|
||||
continueSearch = false;
|
||||
callback.selectIndex(tableIndex);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (excludeFlag) {
|
||||
// Select index if matches non case sensitive message or
|
||||
// subscription
|
||||
if ((!msg.toUpperCase().contains(text.toUpperCase()) && msgFlag)
|
||||
|| (!sub.toLowerCase().contains(text.toLowerCase()) && categoryFlag)) {
|
||||
search = true;
|
||||
|| (!sub.toLowerCase().contains(
|
||||
text.toLowerCase()) && categoryFlag)) {
|
||||
continueSearch = false;
|
||||
callback.selectIndex(tableIndex);
|
||||
}
|
||||
}
|
||||
else if ((msg.toUpperCase().contains(text.toUpperCase()) && msgFlag)
|
||||
} else if ((msg.toUpperCase().contains(text.toUpperCase()) && msgFlag)
|
||||
|| (sub.toLowerCase().contains(text.toLowerCase()) && categoryFlag)) {
|
||||
search = true;
|
||||
continueSearch = false;
|
||||
callback.selectIndex(tableIndex);
|
||||
}
|
||||
}
|
||||
|
||||
// If the item was found set exists to true
|
||||
if (search) {
|
||||
if (!continueSearch) {
|
||||
exists = true;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
int answer = DataDeliveryUtils
|
||||
.showMessage(getShell(), SWT.YES | SWT.NO, "Search from Beginning",
|
||||
"The end of the table has been reached. Would you like to search from the beginning of the table?");
|
||||
if (answer == SWT.NO || (answer == SWT.YES && !exists)) {
|
||||
} else {
|
||||
if (!hitEnd) {
|
||||
int answer = DataDeliveryUtils
|
||||
.showMessage(
|
||||
getShell(),
|
||||
SWT.YES | SWT.NO,
|
||||
"Search from Beginning",
|
||||
"The end of the table has been reached. Would you like to search from the beginning of the table?");
|
||||
if (answer == SWT.NO) {
|
||||
exists = true;
|
||||
break;
|
||||
// Start search over at beginning of table
|
||||
} else if (answer == SWT.YES) {
|
||||
tableIndex = 0;
|
||||
continueSearch = true;
|
||||
}
|
||||
hitEnd = true;
|
||||
} else {
|
||||
break;
|
||||
// Start search over at beginning of table
|
||||
}
|
||||
else if (answer == SWT.YES && exists) {
|
||||
tableIndex = 0;
|
||||
search = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// No items matching search criteria
|
||||
|
@ -513,8 +489,8 @@ public class FindDlg extends CaveSWTDialog {
|
|||
mb.setText("Find Warning");
|
||||
mb.setMessage("No item matching your search was found.");
|
||||
mb.open();
|
||||
tableIndex = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -539,10 +515,9 @@ public class FindDlg extends CaveSWTDialog {
|
|||
tableIndex = 0;
|
||||
|
||||
if (filteredTableList != null) {
|
||||
|
||||
for (int i = 0; i < filteredTableList.getDataArray().size(); i++) {
|
||||
|
||||
NotificationRowData row = filteredTableList.getDataArray().get(i);
|
||||
NotificationRowData row = filteredTableList.getDataArray().get(
|
||||
i);
|
||||
// Message Column
|
||||
msg = row.getMessage();
|
||||
// Subscription Name column
|
||||
|
@ -552,22 +527,23 @@ public class FindDlg extends CaveSWTDialog {
|
|||
if (excludeFlag) {
|
||||
// Select index if does not match message or
|
||||
// subscription
|
||||
if ((!msg.contains(text) && msgFlag) || (!sub.contains(text) && categoryFlag)) {
|
||||
if ((!msg.contains(text) && msgFlag)
|
||||
|| (!sub.contains(text) && categoryFlag)) {
|
||||
items.add(i);
|
||||
}
|
||||
}
|
||||
else if ((msg.contains(text) && msgFlag) || (sub.contains(text) && categoryFlag)) {
|
||||
} else if ((msg.contains(text) && msgFlag)
|
||||
|| (sub.contains(text) && categoryFlag)) {
|
||||
// Select index if matches message or subscription
|
||||
items.add(i);
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (excludeFlag) {
|
||||
// Select index if matches non case sensitive message or
|
||||
// subscription
|
||||
if ((!msg.toUpperCase().contains(text.toUpperCase()) && msgFlag)
|
||||
|| (!sub.toLowerCase().contains(text.toLowerCase()) && categoryFlag)) {
|
||||
|| (!sub.toLowerCase().contains(
|
||||
text.toLowerCase()) && categoryFlag)) {
|
||||
items.add(i);
|
||||
}
|
||||
} else if ((msg.toUpperCase().contains(text.toUpperCase()) && msgFlag)
|
||||
|
@ -577,7 +553,6 @@ public class FindDlg extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
tableIndex++;
|
||||
|
||||
}
|
||||
|
||||
indices = new int[items.size()];
|
||||
|
@ -588,9 +563,6 @@ public class FindDlg extends CaveSWTDialog {
|
|||
}
|
||||
|
||||
callback.selectIndices(indices);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -49,11 +49,11 @@ import com.raytheon.viz.ui.widgets.duallist.IUpdate;
|
|||
|
||||
/**
|
||||
* Notification Configuration Dialog
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 2, 2012 mpduff Initial creation
|
||||
|
@ -64,9 +64,10 @@ import com.raytheon.viz.ui.widgets.duallist.IUpdate;
|
|||
* Aug 08, 2012 863 jpiatt Added new interface method.
|
||||
* Aug 13, 2012 430 jpiatt Modifications for sort asc & desc.
|
||||
* Oct 22, 2012 1284 mpduff Code Cleanup.
|
||||
*
|
||||
* Aug 30, 2013 2314 mpduff Fixed sorting ambiguity.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @author mpduff
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -129,7 +130,7 @@ public class NotificationConfigDlg extends CaveSWTDialog implements IUpdate {
|
|||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
*
|
||||
* @param parentShell
|
||||
* @param callback
|
||||
*/
|
||||
|
@ -170,7 +171,10 @@ public class NotificationConfigDlg extends CaveSWTDialog implements IUpdate {
|
|||
|
||||
if (col != null) {
|
||||
for (ColumnXML column : col) {
|
||||
sortAsc = column.isSortAsc();
|
||||
if (column.isSortColumn()) {
|
||||
sortAsc = column.isSortAsc();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -261,7 +265,7 @@ public class NotificationConfigDlg extends CaveSWTDialog implements IUpdate {
|
|||
sortComp.setLayoutData(gd);
|
||||
|
||||
Label label = new Label(sortComp, SWT.NONE);
|
||||
label.setText("Initial Sort Column:");
|
||||
label.setText("Sort Column:");
|
||||
|
||||
sortColumnCbo = new Combo(sortComp, SWT.READ_ONLY);
|
||||
sortColumnCbo.setLayoutData(new GridData(150, SWT.DEFAULT));
|
||||
|
@ -602,7 +606,7 @@ public class NotificationConfigDlg extends CaveSWTDialog implements IUpdate {
|
|||
|
||||
/**
|
||||
* Handle the combo box with data.
|
||||
*
|
||||
*
|
||||
* @param entries
|
||||
* true if data in the combo box.
|
||||
*/
|
||||
|
|
|
@ -53,6 +53,7 @@ import com.raytheon.uf.viz.datadelivery.notification.xml.NotificationFilterXML;
|
|||
* Aug 15, 2012 430 jpiatt Added reRead method.
|
||||
* Oct 22, 2012 1284 mpduff Code Cleanup.
|
||||
* Apr 25, 2013 1820 mpduff Add deleteXml method.
|
||||
* Aug 30, 2013 2314 mpduff Removed initial XML read, added null check.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -112,7 +113,6 @@ public class NotificationConfigManager {
|
|||
*/
|
||||
private NotificationConfigManager() {
|
||||
createContext();
|
||||
readXML();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -239,7 +239,7 @@ public class NotificationConfigManager {
|
|||
"Error deleting " + file.getName());
|
||||
}
|
||||
|
||||
if (currentConfigFile.equals(file)) {
|
||||
if (currentConfigFile == null) {
|
||||
setConfigFile(this.defaultConfigFile);
|
||||
}
|
||||
} catch (LocalizationOpFailedException e) {
|
||||
|
|
|
@ -74,6 +74,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
|
|||
import com.raytheon.uf.viz.datadelivery.utils.NotificationHandler;
|
||||
import com.raytheon.uf.viz.datadelivery.utils.NotificationHandler.INotificationArrivedListener;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
|
||||
/**
|
||||
* Notification Dialog.
|
||||
|
@ -99,6 +100,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
|||
* Jan 22, 2013 1520 mpduff Change delete menus to hide.
|
||||
* Apr 25, 2013 1820 mpduff Implemente delete config.
|
||||
* Jun 06, 2013 2030 mpduff Refactored help.
|
||||
* Aug 30, 2013 2314 mpduff Change the reading of the xml. Make load config dlg non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -182,6 +184,15 @@ public class NotificationDlg extends CaveSWTDialog implements ITableChange,
|
|||
private MenuItem tooltipMI;
|
||||
|
||||
private final Collection<MenuItem> lockableMenuItems = new ArrayList<MenuItem>();
|
||||
|
||||
/** Load config dialog */
|
||||
private LoadSaveConfigDlg loadDlg;
|
||||
|
||||
/** Delete config dialog */
|
||||
private LoadSaveConfigDlg deleteDlg;
|
||||
|
||||
/** SaveAs config dialog */
|
||||
private LoadSaveConfigDlg saveAsDlg;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
@ -324,7 +335,6 @@ public class NotificationDlg extends CaveSWTDialog implements ITableChange,
|
|||
lockableMenuItems.add(deleteConfigMI);
|
||||
deleteConfigMI.setText("Delete Configuration...");
|
||||
deleteConfigMI.addSelectionListener(new SelectionAdapter() {
|
||||
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
handleDeleteConfig();
|
||||
|
@ -616,30 +626,43 @@ public class NotificationDlg extends CaveSWTDialog implements ITableChange,
|
|||
* Load configuration action.
|
||||
*/
|
||||
private void handleLoadConfig() throws JAXBException {
|
||||
if (loadDlg == null || loadDlg.isDisposed()) {
|
||||
final NotificationConfigManager configMan = NotificationConfigManager
|
||||
.getInstance();
|
||||
loadDlg = new LoadSaveConfigDlg(shell, DialogType.OPEN,
|
||||
CONFIG_PATH, DEFAULT_CONFIG, true);
|
||||
loadDlg.setCloseCallback(new ICloseCallback() {
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof LocalizationFile) {
|
||||
try {
|
||||
NotificationConfigXML xml;
|
||||
LocalizationFile fileName = (LocalizationFile) returnValue;
|
||||
// Get the name of the selected file
|
||||
if (fileName != null && fileName.exists()) {
|
||||
File file = fileName.getFile();
|
||||
|
||||
NotificationConfigXML xml = new NotificationConfigXML();
|
||||
NotificationConfigManager configMan;
|
||||
configMan = NotificationConfigManager.getInstance();
|
||||
if (file != null) {
|
||||
xml = (NotificationConfigXML) unmarshaller
|
||||
.unmarshal(file);
|
||||
|
||||
LoadSaveConfigDlg loadDlg = new LoadSaveConfigDlg(shell,
|
||||
DialogType.OPEN, CONFIG_PATH, DEFAULT_CONFIG, true);
|
||||
configMan.setConfigXml(xml);
|
||||
|
||||
// open the Load Configuration
|
||||
LocalizationFile fileName = (LocalizationFile) loadDlg.open();
|
||||
tableComp.tableChangedAfterConfigLoad();
|
||||
}
|
||||
}
|
||||
} catch (JAXBException e) {
|
||||
statusHandler.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
}
|
||||
loadDlg = null;
|
||||
}
|
||||
});
|
||||
|
||||
// Get the name of the selected file
|
||||
File file = null;
|
||||
if (fileName != null) {
|
||||
file = fileName.getFile();
|
||||
loadDlg.open();
|
||||
} else {
|
||||
loadDlg.bringToTop();
|
||||
}
|
||||
|
||||
if (file != null) {
|
||||
xml = (NotificationConfigXML) unmarshaller.unmarshal(file);
|
||||
}
|
||||
|
||||
// set the configuration to the selected file
|
||||
configMan.setConfigXml(xml);
|
||||
tableComp.tableChangedAfterConfigLoad();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -682,30 +705,51 @@ public class NotificationDlg extends CaveSWTDialog implements ITableChange,
|
|||
* Save as configuration action.
|
||||
*/
|
||||
private void handleSaveAsConfig() {
|
||||
NotificationConfigManager configMan = NotificationConfigManager
|
||||
.getInstance();
|
||||
if (saveAsDlg == null || saveAsDlg.isDisposed()) {
|
||||
saveAsDlg = new LoadSaveConfigDlg(shell, DialogType.SAVE_AS,
|
||||
CONFIG_PATH, DEFAULT_CONFIG);
|
||||
saveAsDlg.setCloseCallback(new ICloseCallback() {
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof LocalizationFile) {
|
||||
NotificationConfigManager configMan = NotificationConfigManager
|
||||
.getInstance();
|
||||
|
||||
LoadSaveConfigDlg loadDlg = new LoadSaveConfigDlg(shell,
|
||||
DialogType.SAVE_AS, CONFIG_PATH, DEFAULT_CONFIG);
|
||||
|
||||
LocalizationFile fileName = (LocalizationFile) loadDlg.open();
|
||||
|
||||
configMan.setConfigFile(fileName);
|
||||
configMan.saveXml();
|
||||
LocalizationFile fileName = (LocalizationFile) returnValue;
|
||||
configMan.setConfigFile(fileName);
|
||||
configMan.saveXml();
|
||||
}
|
||||
}
|
||||
});
|
||||
saveAsDlg.open();
|
||||
} else {
|
||||
saveAsDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete configuration action.
|
||||
*/
|
||||
private void handleDeleteConfig() {
|
||||
LoadSaveConfigDlg dlg = new LoadSaveConfigDlg(shell, DialogType.DELETE,
|
||||
CONFIG_PATH, true);
|
||||
LocalizationFile fileName = (LocalizationFile) dlg.open();
|
||||
|
||||
NotificationConfigManager configMan = NotificationConfigManager
|
||||
.getInstance();
|
||||
configMan.deleteXml(fileName);
|
||||
tableComp.tableChangedAfterConfigLoad();
|
||||
if (deleteDlg == null || deleteDlg.isDisposed()) {
|
||||
deleteDlg = new LoadSaveConfigDlg(shell, DialogType.DELETE,
|
||||
CONFIG_PATH, true);
|
||||
deleteDlg.setCloseCallback(new ICloseCallback() {
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof LocalizationFile) {
|
||||
LocalizationFile fileName = (LocalizationFile) returnValue;
|
||||
NotificationConfigManager configMan = NotificationConfigManager
|
||||
.getInstance();
|
||||
configMan.deleteXml(fileName);
|
||||
tableComp.tableChangedAfterConfigLoad();
|
||||
}
|
||||
}
|
||||
});
|
||||
deleteDlg.open();
|
||||
} else {
|
||||
deleteDlg.bringToTop();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -38,6 +38,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 3, 2012 mpduff Initial creation
|
||||
* Jun 07, 2012 687 lvenable Table data refactor.
|
||||
* Aug 30, 2013 2314 mpduff Fix formatting.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -48,7 +49,8 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
|
|||
public class NotificationRowData implements ITableData<NotificationRowData> {
|
||||
|
||||
/** Column string array */
|
||||
private final String[] columns = DataDeliveryUtils.getColumnTitles(TABLE_TYPE.NOTIFICATION);
|
||||
private final String[] columns = DataDeliveryUtils
|
||||
.getColumnTitles(TABLE_TYPE.NOTIFICATION);
|
||||
|
||||
/** Notification Identification number */
|
||||
private int id;
|
||||
|
@ -86,6 +88,7 @@ public class NotificationRowData implements ITableData<NotificationRowData> {
|
|||
* @param sortCallback
|
||||
* The sort call back.
|
||||
*/
|
||||
@Override
|
||||
public void setSortCallback(ISortTable sortCallback) {
|
||||
this.sortCallback = sortCallback;
|
||||
}
|
||||
|
@ -224,19 +227,17 @@ public class NotificationRowData implements ITableData<NotificationRowData> {
|
|||
|
||||
if (columnName.equals("Time")) {
|
||||
returnValue = checkDate(this.getDate(), o.getDate());
|
||||
}
|
||||
else if (columnName.equals("Priority")) {
|
||||
} else if (columnName.equals("Priority")) {
|
||||
returnValue = 0;
|
||||
if (priority > o.getPriority()) {
|
||||
returnValue = 1;
|
||||
}
|
||||
else if (priority < o.getPriority()) {
|
||||
} else if (priority < o.getPriority()) {
|
||||
returnValue = -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (o.getSortValue(columnName) != null) {
|
||||
returnValue = sortValue.toUpperCase().compareTo(o.getSortValue(columnName).toUpperCase());
|
||||
returnValue = sortValue.toUpperCase().compareTo(
|
||||
o.getSortValue(columnName).toUpperCase());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -252,21 +253,17 @@ public class NotificationRowData implements ITableData<NotificationRowData> {
|
|||
// handle empty date cells
|
||||
if ((d1 == null) && (d2 == null)) {
|
||||
return 0;
|
||||
}
|
||||
else if (d1 == null) {
|
||||
} else if (d1 == null) {
|
||||
return -1;
|
||||
}
|
||||
else if (d2 == null) {
|
||||
} else if (d2 == null) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (d1.before(d2)) {
|
||||
return 1;
|
||||
}
|
||||
else if (d1.after(d2)) {
|
||||
} else if (d1.after(d2)) {
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -288,20 +285,15 @@ public class NotificationRowData implements ITableData<NotificationRowData> {
|
|||
|
||||
if (columnName.equals(columns[0])) {
|
||||
return String.valueOf(this.getDate());
|
||||
}
|
||||
else if (columnName.equals(columns[1])) {
|
||||
} else if (columnName.equals(columns[1])) {
|
||||
return String.valueOf(this.priority);
|
||||
}
|
||||
else if (columnName.equals(columns[2])) {
|
||||
} else if (columnName.equals(columns[2])) {
|
||||
return this.getCategory().toString();
|
||||
}
|
||||
else if (columnName.equals(columns[3])) {
|
||||
} else if (columnName.equals(columns[3])) {
|
||||
return this.getUser().toString();
|
||||
}
|
||||
else if (columnName.equals(columns[4])) {
|
||||
} else if (columnName.equals(columns[4])) {
|
||||
return this.getMessage().toString();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,6 +77,7 @@ import com.raytheon.uf.viz.datadelivery.utils.NotificationHandler;
|
|||
* Nov 29, 2012 1285 bgonzale Added a refresh pause button to the Notification Center Dialog.
|
||||
* Jan 22, 2013 1520 mpduff Update javadoc.
|
||||
* Apr 25, 2013 1820 mpduff Get the column list every time.
|
||||
* Aug 30, 2013 2314 mpduff Sort the table data on load.
|
||||
* </pre>
|
||||
*
|
||||
* @author lvenable
|
||||
|
@ -844,6 +845,7 @@ public class NotificationTableComp extends TableComp implements ITableFind {
|
|||
}
|
||||
|
||||
updateSortDirection(this.sortedColumn, filteredTableList, false);
|
||||
filteredTableList.sortData();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,6 +43,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jan 31, 2012 mpduff Initial creation.
|
||||
* Aug 29, 2012 1115 jpiatt Set default sort column.
|
||||
* Aug 30, 2013 2314 mpduff Set sort ascending to false.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -171,14 +172,17 @@ public class NotificationConfigXML implements ISerializableObject {
|
|||
}
|
||||
|
||||
private void createDefault() {
|
||||
String[] titles = DataDeliveryUtils.getColumnTitles(TABLE_TYPE.NOTIFICATION);
|
||||
String[] titles = DataDeliveryUtils
|
||||
.getColumnTitles(TABLE_TYPE.NOTIFICATION);
|
||||
for (String title : titles) {
|
||||
ColumnXML col = new ColumnXML(title, true);
|
||||
if (title.equals(DataDeliveryUtils.NotifColumnNames.TIME.getColumnName())) {
|
||||
if (title.equals(DataDeliveryUtils.NotifColumnNames.TIME
|
||||
.getColumnName())) {
|
||||
col.setSortColumn(true);
|
||||
col.setSortAsc(false);
|
||||
}
|
||||
this.addColumn(col);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.util.StringUtil;
|
||||
import com.raytheon.uf.viz.core.auth.UserController;
|
||||
import com.raytheon.uf.viz.core.localization.LocalizationManager;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.ActivePeriodComp;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.DurationComp;
|
||||
import com.raytheon.uf.viz.datadelivery.common.ui.GroupSelectComp;
|
||||
|
@ -103,6 +104,8 @@ import com.raytheon.viz.ui.presenter.components.CheckBoxConf;
|
|||
* Jun 12, 2013 2038 djohnson No longer modal.
|
||||
* Jul 26, 2013 2232 mpduff Refactored Data Delivery permissions.
|
||||
* Aug 21, 2013 1848 mpduff Check subscription.create and shared.subscription.create.
|
||||
* Aug 30, 2013 2288 bgonzale Added display of priority and latency rules.
|
||||
* Sep 04, 2013 2314 mpduff Pass in the office to Shared Subscription Dialog.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -227,18 +230,34 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
|||
int latency = 15;
|
||||
SubscriptionPriority priority = SubscriptionPriority.NORMAL;
|
||||
SystemRuleManager ruleManager = SystemRuleManager.getInstance();
|
||||
boolean isReadOnlyLatency = false;
|
||||
|
||||
// rule values
|
||||
SubscriptionPriority priorityRule = null;
|
||||
int latencyRule = 0;
|
||||
|
||||
if (this.subscription.getDataSetType() == DataType.GRID) {
|
||||
latency = ruleManager.getLatency(subscription, cycleTimes);
|
||||
priority = ruleManager.getPriority(subscription, cycleTimes);
|
||||
priorityComp = new PriorityComp(mainComp, latency, priority, false);
|
||||
latencyRule = ruleManager.getLatency(subscription, cycleTimes);
|
||||
priorityRule = ruleManager.getPriority(subscription, cycleTimes);
|
||||
isReadOnlyLatency = false;
|
||||
} else if (this.subscription.getDataSetType() == DataType.POINT) {
|
||||
// For point the latency is the retrieval interval
|
||||
latency = ((PointTime) subscription.getTime()).getInterval();
|
||||
priority = ruleManager.getPointDataPriority(subscription);
|
||||
priorityComp = new PriorityComp(mainComp, latency, priority, true);
|
||||
latencyRule = ((PointTime) subscription.getTime()).getInterval();
|
||||
priorityRule = ruleManager.getPointDataPriority(subscription);
|
||||
isReadOnlyLatency = true;
|
||||
}
|
||||
|
||||
if (isCreate()) {
|
||||
latency = latencyRule;
|
||||
priority = priorityRule;
|
||||
} else {
|
||||
latency = subscription.getLatencyInMinutes();
|
||||
priority = subscription.getPriority();
|
||||
}
|
||||
|
||||
priorityComp = new PriorityComp(mainComp, latencyRule, latency,
|
||||
priorityRule, priority, isReadOnlyLatency);
|
||||
|
||||
if (this.subscription.getDataSetType() == DataType.GRID) {
|
||||
this.createCycleGroup();
|
||||
}
|
||||
|
@ -382,7 +401,9 @@ public class CreateSubscriptionDlg extends CaveSWTDialog implements
|
|||
btn.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
SiteSelectionDlg dlg = new SiteSelectionDlg(shell, "OAX",
|
||||
String currentSite = LocalizationManager.getInstance()
|
||||
.getCurrentSite();
|
||||
SiteSelectionDlg dlg = new SiteSelectionDlg(shell, currentSite,
|
||||
sharedSites);
|
||||
dlg.setCloseCallback(new ICloseCallback() {
|
||||
@Override
|
||||
|
|
|
@ -49,6 +49,7 @@ import com.raytheon.uf.viz.datadelivery.common.xml.ColumnXML;
|
|||
import com.raytheon.uf.viz.datadelivery.subscription.xml.SubscriptionManagerConfigXML;
|
||||
import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||
import com.raytheon.viz.ui.widgets.duallist.DualList;
|
||||
import com.raytheon.viz.ui.widgets.duallist.DualListConfig;
|
||||
|
||||
|
@ -66,6 +67,7 @@ import com.raytheon.viz.ui.widgets.duallist.DualListConfig;
|
|||
* Jan 03, 2013 1437 bgonzale Removed xml attribute, use SubscriptionConfigurationManager
|
||||
* instead. Added configuration file management controls to
|
||||
* this dialog.
|
||||
* Sep 04, 2013 2314 mpduff Load/save config dialog now non-blocking.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -80,7 +82,7 @@ public class SubscriptionManagerConfigDlg extends CaveSWTDialog {
|
|||
.getHandler(SubscriptionManagerDlg.class);
|
||||
|
||||
/** Callback to SubscriptionManagerDialog */
|
||||
private ITableChange callback;
|
||||
private final ITableChange callback;
|
||||
|
||||
/** Dual List Config */
|
||||
private DualListConfig dualConfig;
|
||||
|
@ -101,7 +103,17 @@ public class SubscriptionManagerConfigDlg extends CaveSWTDialog {
|
|||
/**
|
||||
* Configuration manager.
|
||||
*/
|
||||
private SubscriptionConfigurationManager configManager;
|
||||
private final SubscriptionConfigurationManager configManager;
|
||||
|
||||
/**
|
||||
* Delete saved configuration file dialog.
|
||||
*/
|
||||
private LoadSaveConfigDlg deleteDialog;
|
||||
|
||||
/**
|
||||
* Load saved configuration file dialog.
|
||||
*/
|
||||
private LoadSaveConfigDlg loadDlg;
|
||||
|
||||
/**
|
||||
* Initialization Constructor.
|
||||
|
@ -304,38 +316,55 @@ public class SubscriptionManagerConfigDlg extends CaveSWTDialog {
|
|||
* Open dialog to remove a configuration.
|
||||
*/
|
||||
protected void handleDelete() {
|
||||
LoadSaveConfigDlg dialog = new LoadSaveConfigDlg(shell,
|
||||
DialogType.DELETE, configManager.getLocalizationPath(),
|
||||
configManager.getDefaultXMLConfig());
|
||||
LocalizationFile file = (LocalizationFile) dialog.open();
|
||||
|
||||
if (file == null) {
|
||||
return;
|
||||
if (deleteDialog == null || deleteDialog.isDisposed()) {
|
||||
deleteDialog = new LoadSaveConfigDlg(shell, DialogType.DELETE,
|
||||
configManager.getLocalizationPath(),
|
||||
configManager.getDefaultXMLConfig());
|
||||
deleteDialog.setCloseCallback(new ICloseCallback() {
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof LocalizationFile) {
|
||||
LocalizationFile file = (LocalizationFile) returnValue;
|
||||
try {
|
||||
file.delete();
|
||||
} catch (LocalizationOpFailedException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
e.getLocalizedMessage(), e);
|
||||
}
|
||||
updateFileCombo();
|
||||
handleApply();
|
||||
}
|
||||
}
|
||||
});
|
||||
deleteDialog.open();
|
||||
} else {
|
||||
deleteDialog.bringToTop();
|
||||
}
|
||||
try {
|
||||
file.delete();
|
||||
} catch (LocalizationOpFailedException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||
}
|
||||
updateFileCombo();
|
||||
handleApply();
|
||||
}
|
||||
|
||||
/**
|
||||
* Open dialog for a new configuration.
|
||||
*/
|
||||
protected void handleNew() {
|
||||
LoadSaveConfigDlg loadDlg = new LoadSaveConfigDlg(shell,
|
||||
DialogType.SAVE_AS, configManager.getLocalizationPath(),
|
||||
configManager.getDefaultXMLConfig(), true);
|
||||
LocalizationFile file = (LocalizationFile) loadDlg.open();
|
||||
|
||||
if (file == null) {
|
||||
return;
|
||||
if (loadDlg == null || loadDlg.isDisposed()) {
|
||||
loadDlg = new LoadSaveConfigDlg(shell, DialogType.SAVE_AS,
|
||||
configManager.getLocalizationPath(),
|
||||
configManager.getDefaultXMLConfig(), true);
|
||||
loadDlg.setCloseCallback(new ICloseCallback() {
|
||||
@Override
|
||||
public void dialogClosed(Object returnValue) {
|
||||
if (returnValue instanceof LocalizationFile) {
|
||||
LocalizationFile file = (LocalizationFile) returnValue;
|
||||
configManager.saveXml(file);
|
||||
handleApply();
|
||||
updateFileCombo();
|
||||
}
|
||||
}
|
||||
});
|
||||
loadDlg.open();
|
||||
} else {
|
||||
loadDlg.bringToTop();
|
||||
}
|
||||
configManager.saveXml(file);
|
||||
handleApply();
|
||||
updateFileCombo();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,6 +36,7 @@ import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 23, 2013 1650 djohnson Initial creation
|
||||
* Sep 04, 2013 2330 bgonzale Added get by site id.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -101,4 +102,15 @@ public final class SubscriptionManagerFilters {
|
|||
};
|
||||
}
|
||||
|
||||
public static ISubscriptionManagerFilter getBySiteId(final String siteId) {
|
||||
return new ISubscriptionManagerFilter() {
|
||||
@Override
|
||||
public List<Subscription> getSubscriptions(
|
||||
ISubscriptionHandler subscriptionHandler)
|
||||
throws RegistryHandlerException {
|
||||
return subscriptionHandler.getByFilters(null, siteId);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -92,7 +92,8 @@ import com.raytheon.viz.ui.presenter.IDisplay;
|
|||
* Mar 29, 2013 1841 djohnson Subscription is now UserSubscription.
|
||||
* Apr 05, 2013 1841 djohnson Add support for shared subscriptions.
|
||||
* Jun 06, 2013 2030 mpduff Refactored help.
|
||||
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||
* Jul 26, 2013 2232 mpduff Refactored Data Delivery permissions.
|
||||
* Sep 03, 2013 2315 mpduff Add subscription name to denied approval message.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -482,7 +483,8 @@ public class SubscriptionApprovalDlg extends CaveSWTDialog implements
|
|||
|
||||
subscriptionNotificationService
|
||||
.sendDeniedPendingSubscriptionNotification(
|
||||
sub, username, denyMessage);
|
||||
sub, username, sub.getName()
|
||||
+ ": " + denyMessage);
|
||||
} catch (RegistryHandlerException e) {
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM,
|
||||
|
|
|
@ -120,6 +120,7 @@ import com.raytheon.viz.ui.presenter.components.ComboBoxConf;
|
|||
* Jun 04, 2013 223 mpduff Add point data.
|
||||
* Jul 18, 2013 1653 mpduff Add SubscriptionStatusSummary and the display dialog.
|
||||
* Jul 26, 2031 2232 mpduff Refactored Data Delivery permissions.
|
||||
* Aug 30, 2013 2288 bgonzale Removed unneeded call to setPriority.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -384,10 +385,6 @@ public class CreateSubscriptionDlgPresenter {
|
|||
view.setActiveEndDateBtnEnabled(false);
|
||||
}
|
||||
|
||||
if (!create) {
|
||||
view.setPriority(subscription.getPriority());
|
||||
}
|
||||
|
||||
if (this.dataSet.getDataSetType() == DataType.GRID) {
|
||||
List<Integer> cycleTimes = subscription.getTime().getCycleTimes();
|
||||
if (cycleTimes != null) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
package com.raytheon.uf.viz.datadelivery.subscription.subset;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -42,6 +42,7 @@ import com.raytheon.uf.common.datadelivery.registry.PointTime;
|
|||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||
import com.raytheon.uf.common.datadelivery.retrieval.util.PointDataSizeUtils;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.common.util.SizeUtil;
|
||||
import com.raytheon.uf.viz.datadelivery.subscription.subset.presenter.PointTimeSubsetPresenter;
|
||||
import com.raytheon.uf.viz.datadelivery.subscription.subset.xml.PointTimeXML;
|
||||
|
@ -60,6 +61,8 @@ import com.raytheon.uf.viz.datadelivery.subscription.subset.xml.SubsetXML;
|
|||
* Jun 11, 2013 2064 mpduff Fix editing of subscriptions.
|
||||
* Jun 14, 2013 2108 mpduff Refactored DataSizeUtils and
|
||||
* implement subset size.
|
||||
* Sep 05, 2013 2335 mpduff Fix times for adhoc point queries.
|
||||
* Sep 10, 2013 2351 dhladky Finished adhoc queries
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -174,8 +177,20 @@ public class PointSubsetManagerDlg extends
|
|||
*/
|
||||
@Override
|
||||
protected Time setupDataSpecificTime(Time newTime, Subscription sub) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
PointTime newTimePoint = (PointTime) newTime;
|
||||
|
||||
// Format must be set before setting the dates.
|
||||
newTimePoint.setFormat(dataSet.getTime().getFormat());
|
||||
int interval = timingTabControls.getSaveInfo()
|
||||
.getDataRetrievalInterval();
|
||||
Calendar cal = TimeUtil.newGmtCalendar();
|
||||
newTimePoint.setInterval(interval);
|
||||
newTimePoint.setStartDate(cal.getTime());
|
||||
cal.add(Calendar.MINUTE, interval * -1);
|
||||
newTimePoint.setEndDate(cal.getTime());
|
||||
|
||||
sub.setLatencyInMinutes(interval);
|
||||
return newTimePoint;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -194,12 +209,8 @@ public class PointSubsetManagerDlg extends
|
|||
protected <T extends Subscription> T populateSubscription(T sub,
|
||||
boolean create) {
|
||||
|
||||
PointTime newTime = new PointTime();
|
||||
int interval = timingTabControls.getSaveInfo()
|
||||
.getDataRetrievalInterval();
|
||||
newTime.setInterval(interval);
|
||||
newTime.setStartDate(new Date());
|
||||
newTime.setEndDate(new Date());
|
||||
Time newTime = new PointTime();
|
||||
newTime = setupDataSpecificTime(newTime, sub);
|
||||
sub.setTime(newTime);
|
||||
|
||||
Coverage cov = new Coverage();
|
||||
|
|
|
@ -99,6 +99,9 @@ public class DataProviderPasswordComposite extends Composite implements
|
|||
/** Provider object */
|
||||
private Provider provider;
|
||||
|
||||
/** Remove credentials check box */
|
||||
private Button removeChk;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
@ -228,6 +231,22 @@ public class DataProviderPasswordComposite extends Composite implements
|
|||
}
|
||||
});
|
||||
|
||||
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
|
||||
gd.horizontalSpan = 3;
|
||||
Label sep = new Label(comp, SWT.SEPARATOR | SWT.SHADOW_IN
|
||||
| SWT.HORIZONTAL);
|
||||
sep.setLayoutData(gd);
|
||||
|
||||
removeChk = new Button(comp, SWT.CHECK);
|
||||
removeChk.setText("Remove Credentials");
|
||||
removeChk.setSelection(false);
|
||||
removeChk.addSelectionListener(new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
enableWidgets(!removeChk.getSelection());
|
||||
}
|
||||
});
|
||||
|
||||
// Buttons
|
||||
buttonComp = new ApplyCancelComposite(this, SWT.NONE, this);
|
||||
|
||||
|
@ -248,6 +267,12 @@ public class DataProviderPasswordComposite extends Composite implements
|
|||
for (Provider p : providerList) {
|
||||
providerCombo.add(p.getName());
|
||||
}
|
||||
|
||||
if (providerCombo.getItemCount() > 0) {
|
||||
providerCombo.select(0);
|
||||
handleProviderSelection();
|
||||
checkUserInput();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -286,17 +311,19 @@ public class DataProviderPasswordComposite extends Composite implements
|
|||
resp = (ProviderKeyRequest) RequestRouter.route(req,
|
||||
RegistryConstants.EBXML_REGISTRY_SERVICE);
|
||||
Connection conn = resp.getProvider().getConnection();
|
||||
String userName = conn.getUnencryptedUsername();
|
||||
String passwd = conn.getUnencryptedPassword();
|
||||
String key = conn.getProviderKey();
|
||||
if (userName != null) {
|
||||
userTxt.setText(userName);
|
||||
}
|
||||
if (passwd != null) {
|
||||
passTxt.setText(passwd);
|
||||
}
|
||||
if (key != null) {
|
||||
keyTxt.setText(key);
|
||||
if (conn != null) {
|
||||
String userName = conn.getUnencryptedUsername();
|
||||
String passwd = conn.getUnencryptedPassword();
|
||||
String key = conn.getProviderKey();
|
||||
if (userName != null) {
|
||||
userTxt.setText(userName);
|
||||
}
|
||||
if (passwd != null) {
|
||||
passTxt.setText(passwd);
|
||||
}
|
||||
if (key != null) {
|
||||
keyTxt.setText(key);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
|
@ -312,6 +339,7 @@ public class DataProviderPasswordComposite extends Composite implements
|
|||
@Override
|
||||
public boolean apply() {
|
||||
if (validation()) {
|
||||
|
||||
ProviderKeyRequest req = new ProviderKeyRequest();
|
||||
Connection conn = provider.getConnection();
|
||||
conn.setPassword(passTxt.getText());
|
||||
|
@ -320,7 +348,11 @@ public class DataProviderPasswordComposite extends Composite implements
|
|||
conn.setEncryption(getEncryption());
|
||||
provider.setConnection(conn);
|
||||
req.setProvider(provider);
|
||||
req.setRequestType(RequestType.SAVE);
|
||||
if (removeChk.getSelection()) {
|
||||
req.setRequestType(RequestType.DELETE);
|
||||
} else {
|
||||
req.setRequestType(RequestType.SAVE);
|
||||
}
|
||||
req.setProviderKey(keyTxt.getText());
|
||||
|
||||
ProviderKeyRequest resp;
|
||||
|
@ -342,6 +374,11 @@ public class DataProviderPasswordComposite extends Composite implements
|
|||
DataDeliveryUtils.showMessage(getShell(), SWT.OK,
|
||||
"Change Successful",
|
||||
"The username/password has been updated.");
|
||||
if (removeChk.getSelection()) {
|
||||
userTxt.setText("");
|
||||
passTxt.setText("");
|
||||
keyTxt.setText("");
|
||||
}
|
||||
}
|
||||
|
||||
return status == Status.SUCCESS;
|
||||
|
@ -351,6 +388,18 @@ public class DataProviderPasswordComposite extends Composite implements
|
|||
|
||||
}
|
||||
|
||||
private void enableWidgets(boolean enable) {
|
||||
userTxt.setEnabled(enable);
|
||||
passTxt.setEnabled(enable);
|
||||
keyTxt.setEnabled(enable);
|
||||
|
||||
if (!enable) {
|
||||
buttonComp.enableButtons(true);
|
||||
} else {
|
||||
checkUserInput();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the encryption object
|
||||
*
|
||||
|
|
|
@ -77,6 +77,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Jun 11, 2013 2064 mpduff Don't output Parameter header if none exist.
|
||||
* Jun 12, 2013 2064 mpduff Use SizeUtil to format data size output.
|
||||
* Jul 26, 2031 2232 mpduff Removed sendAuthorizationRequest method.
|
||||
* Aug 30, 2013 2288 bgonzale Added latency to details display.
|
||||
* </pre>
|
||||
*
|
||||
* @author mpduff
|
||||
|
@ -638,6 +639,8 @@ public class DataDeliveryUtils {
|
|||
fmtStr.append("Priority: ")
|
||||
.append(sub.getPriority().getPriorityValue()).append(newline);
|
||||
fmtStr.append("Network: ").append(sub.getRoute()).append(newline);
|
||||
fmtStr.append("Latency Minutes: ").append(sub.getLatencyInMinutes())
|
||||
.append(newline);
|
||||
|
||||
fmtStr.append("Coverage: ").append(newline);
|
||||
final Coverage coverage = sub.getCoverage();
|
||||
|
|
|
@ -30,6 +30,7 @@ import com.raytheon.uf.viz.datadelivery.notification.xml.MessageLoadXML;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 12, 2012 jsanchez Initial creation
|
||||
* Jan 22, 2013 1501 djohnson Route requests to datadelivery.
|
||||
* Sep 05, 2013 2314 mpduff support the load all messages option.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -86,9 +87,10 @@ public class NotificationHandler implements INotificationObserver {
|
|||
String username = null;
|
||||
Integer hours = null;
|
||||
Integer maxResults = null;
|
||||
|
||||
Boolean loadAll = false;
|
||||
// Retrieve the message load configuration
|
||||
if (messageLoad != null) {
|
||||
loadAll = messageLoad.isLoadAllMessages();
|
||||
loadAmount = messageLoad.getLoadLast();
|
||||
|
||||
if (messageLoad.isNumHours()) {
|
||||
|
@ -116,6 +118,7 @@ public class NotificationHandler implements INotificationObserver {
|
|||
request.setUsername(username);
|
||||
request.setHours(hours);
|
||||
request.setMaxResults(maxResults);
|
||||
request.setLoadAll(loadAll);
|
||||
ArrayList<NotificationRecord> response = (ArrayList<NotificationRecord>) RequestRouter
|
||||
.route(request, DataDeliveryConstants.DATA_DELIVERY_SERVER);
|
||||
return response;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>org.w3.XMLSchema</name>
|
||||
<name>org.w3.xmlschema</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
|
@ -1,8 +1,9 @@
|
|||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: XMLSchema
|
||||
Bundle-SymbolicName: org.w3.XMLSchema
|
||||
Bundle-SymbolicName: org.w3.xmlschema
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Bundle-ClassPath: org.w3.XMLSchema.jar
|
||||
Export-Package: org.w3.xmlschema
|
||||
Bundle-ClassPath: org.w3.XMLSchema.jar
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
org.w3.XMLSchema.jar
|
||||
|
|
@ -123,6 +123,9 @@
|
|||
<logger name="edu">
|
||||
<level value="WARN" />
|
||||
</logger>
|
||||
<logger name="org.apache.cxf">
|
||||
<level value="ERROR"/>
|
||||
</logger>
|
||||
|
||||
<logger name="com.raytheon.uf.common.datadelivery" additivity="false">
|
||||
<level value="INFO"/>
|
||||
|
|
|
@ -246,6 +246,7 @@
|
|||
<!-- exclude OGC services -->
|
||||
<exclude>.*ogc.*</exclude>
|
||||
<exclude>grid-metadata.xml</exclude>
|
||||
<exclude>wxsrv-dataset-urn.xml</exclude>
|
||||
</mode>
|
||||
|
||||
<!-- modes listed below are not supported in a production setting, they
|
||||
|
|
|
@ -14,7 +14,8 @@ import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 1, 2012 jsanchez Initial creation
|
||||
* Mar 1, 2012 jsanchez Initial creation.
|
||||
* Sep 05, 2013 2314 mpduff Add loadAll.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -33,6 +34,9 @@ public class GetNotificationRequest implements IServerRequest {
|
|||
@DynamicSerializeElement
|
||||
private Integer maxResults;
|
||||
|
||||
@DynamicSerializeElement
|
||||
private Boolean loadAll;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The username(s) of the records to be retrieved
|
||||
|
@ -92,4 +96,19 @@ public class GetNotificationRequest implements IServerRequest {
|
|||
this.maxResults = maxResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the loadAll
|
||||
*/
|
||||
public Boolean getLoadAll() {
|
||||
return loadAll;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param loadAll
|
||||
* the loadAll to set
|
||||
*/
|
||||
public void setLoadAll(Boolean loadAll) {
|
||||
this.loadAll = loadAll;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,7 +45,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Aug 21, 2012 754 dhladky Initial creation
|
||||
* Aug 21, 2012 754 dhladky Initial creation
|
||||
* Sept 11, 2013 2351 dhladky Added more point intervals
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -68,6 +69,11 @@ public class PointTime extends Time implements ISerializableObject,
|
|||
@XmlElements({ @XmlElement(name = "times", type = Date.class) })
|
||||
@DynamicSerializeElement
|
||||
private List<Date> times;
|
||||
|
||||
/**
|
||||
* Intervals for point request
|
||||
*/
|
||||
public static final SortedSet<Integer> INTERVALS = Sets.newTreeSet(Arrays.asList(5, 10, 15, 20, 30, 60));
|
||||
|
||||
/**
|
||||
* Default Constructor.
|
||||
|
@ -136,6 +142,6 @@ public class PointTime extends Time implements ISerializableObject,
|
|||
* @return the allowed refresh intervals
|
||||
*/
|
||||
public static SortedSet<Integer> getAllowedRefreshIntervals() {
|
||||
return Sets.newTreeSet(Arrays.asList(5, 10, 15, 30));
|
||||
return INTERVALS;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ public class Provider implements ISerializableObject {
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 16, 2012 dhladky Initial creation
|
||||
* Aug 16, 2012 1022 djohnson Add bytesPerParameterRequest.
|
||||
* Sept 10, 2013 2352 dhladky Changed default size for point overhead
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -65,7 +66,7 @@ public class Provider implements ISerializableObject {
|
|||
public enum ServiceType {
|
||||
|
||||
// TODO: Only OPENDAP and WFS have the correct amounts
|
||||
OPENDAP(5000, BYTES_IN_FLOAT), WCS(5000, BYTES_IN_FLOAT), WFS(1411724,
|
||||
OPENDAP(5000, BYTES_IN_FLOAT), WCS(5000, BYTES_IN_FLOAT), WFS(711724,
|
||||
OneByOneBox), WMS(5000, BYTES_IN_FLOAT), WXXM(5000,
|
||||
BYTES_IN_FLOAT);
|
||||
|
||||
|
@ -100,7 +101,8 @@ public class Provider implements ISerializableObject {
|
|||
public long getRequestBytesPerLatLonBoxAndTime(double latSpan,
|
||||
double lonSpan, int timeSpan) {
|
||||
// increments are in 5 minutes so 5/5 = 1
|
||||
return (long) (latSpan * lonSpan * timeSpan / 5 * requestOverheadInBytes);
|
||||
// 30 min increment would be 30/5 = 6 etc.
|
||||
return (long) (latSpan * lonSpan * (timeSpan/5) * requestOverheadInBytes);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -116,12 +116,15 @@ public class ProviderKeyRequest implements IServerRequest {
|
|||
public enum RequestType {
|
||||
@XmlEnumValue(RequestType.save)
|
||||
SAVE("SAVE"), @XmlEnumValue(RequestType.retrieve)
|
||||
RETRIEVE("RETRIEVE");
|
||||
RETRIEVE("RETRIEVE"), @XmlEnumValue(RequestType.delete)
|
||||
DELETE("DELETE");
|
||||
|
||||
private static final String save = "SAVE";
|
||||
|
||||
private static final String retrieve = "RETRIEVE";
|
||||
|
||||
private static final String delete = "DELETE";
|
||||
|
||||
private final String requestType;
|
||||
|
||||
private RequestType(String name) {
|
||||
|
|
|
@ -35,6 +35,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
|||
* Oct 10, 2012 0726 djohnson Add {@link #setActive(boolean)}.
|
||||
* Feb 20, 2013 1543 djohnson Add ability to filter on routes.
|
||||
* May 28, 2013 1650 djohnson More information when failing to schedule.
|
||||
* Sep 04, 2013 2330 bgonzale OfficeIds attribute is a collection.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -138,7 +139,11 @@ public abstract class SubscriptionFilterableQuery<T> extends
|
|||
* The value of the officeId attribute to search for.
|
||||
*/
|
||||
public void setOfficeId(String officeId) {
|
||||
setAttribute("officeID", new StringAttribute(officeId));
|
||||
List<String> officeIdList = new ArrayList<String>();
|
||||
officeIdList.add(officeId);
|
||||
StringAttribute stringAtt = new StringAttribute(officeIdList);
|
||||
stringAtt.setCollection(true);
|
||||
setAttribute("officeIDs", stringAtt);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -49,6 +49,7 @@ import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
|||
* May 28, 2013 1650 djohnson Add getByNames.
|
||||
* Jun 24, 2013 2106 djohnson Now composes a registryHandler.
|
||||
* Jul 18, 2013 2193 mpduff Changes for SubscriptionDataSetNameQuery.
|
||||
* Sep 11, 2013 2352 mpduff Add siteId to getSubscribedToDataSetNames method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -126,10 +127,11 @@ public abstract class BaseSubscriptionHandler<T extends Subscription, QUERY exte
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getSubscribedToDataSetNames()
|
||||
public Set<String> getSubscribedToDataSetNames(String siteId)
|
||||
throws RegistryHandlerException {
|
||||
SubscriptionDataSetNameQuery query = new SubscriptionDataSetNameQuery();
|
||||
query.setRegistryObjectClass(getRegistryObjectClass().getName());
|
||||
query.setOfficeId(siteId);
|
||||
RegistryQueryResponse<String> response = registryHandler
|
||||
.getObjects(query);
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
|||
* Oct 10, 2012 0726 djohnson Add {@link #getActive()}.
|
||||
* Feb 20, 2013 1543 djohnson Add ability to filter on routes.
|
||||
* May 28, 2013 1650 djohnson Add getByNames.
|
||||
* Sep 11, 2013 2352 mpduff Add siteId to getSubscribedToDataSetNames method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -108,13 +109,18 @@ public interface IBaseSubscriptionHandler<T extends Subscription> extends
|
|||
throws RegistryHandlerException;
|
||||
|
||||
/**
|
||||
* Get the {@link Set} of data set names that are subscribed to.
|
||||
* Get the {@link Set} of data set names that are subscribed to for the
|
||||
* provided site.
|
||||
*
|
||||
* @param siteId
|
||||
* The site id
|
||||
*
|
||||
* @return the {@link Set} of data set names
|
||||
* @throws RegistryHandlerException
|
||||
* on error
|
||||
*/
|
||||
Set<String> getSubscribedToDataSetNames() throws RegistryHandlerException;
|
||||
Set<String> getSubscribedToDataSetNames(String siteId)
|
||||
throws RegistryHandlerException;
|
||||
|
||||
/**
|
||||
* Retrieve all active subscriptions.
|
||||
|
|
|
@ -53,6 +53,7 @@ import com.raytheon.uf.common.util.CollectionUtil;
|
|||
* 4/9/2013 1802 bphillip Using constant values from constants package instead of RegistryUtil
|
||||
* May 28, 2013 1650 djohnson Add getByNames.
|
||||
* May 29, 2013 1650 djohnson Fix ability to delete multiple types of subscriptions at once.
|
||||
* Sep 11, 2013 2352 mpduff Add siteId to getSubscribedToDataSetNames method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -147,11 +148,13 @@ public class PendingSubscriptionHandler implements IPendingSubscriptionHandler {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getSubscribedToDataSetNames()
|
||||
public Set<String> getSubscribedToDataSetNames(String siteId)
|
||||
throws RegistryHandlerException {
|
||||
Set<String> names = Sets.newHashSet();
|
||||
names.addAll(siteSubscriptionHandler.getSubscribedToDataSetNames());
|
||||
names.addAll(sharedSubscriptionHandler.getSubscribedToDataSetNames());
|
||||
names.addAll(siteSubscriptionHandler
|
||||
.getSubscribedToDataSetNames(siteId));
|
||||
names.addAll(sharedSubscriptionHandler
|
||||
.getSubscribedToDataSetNames(siteId));
|
||||
return names;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ import com.raytheon.uf.common.util.CollectionUtil;
|
|||
* May 28, 2013 1650 djohnson Add getByNames.
|
||||
* May 29, 2013 1650 djohnson Fix ability to delete multiple types of subscriptions at once.
|
||||
* May 31, 2013 1650 djohnson Fix ability to get shared subscriptions by id.
|
||||
* Sep 11, 2013 2352 mpduff Add siteId to getSubscribedToDataSetNames method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -206,11 +207,12 @@ public class SubscriptionHandler implements ISubscriptionHandler {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getSubscribedToDataSetNames()
|
||||
public Set<String> getSubscribedToDataSetNames(String siteId)
|
||||
throws RegistryHandlerException {
|
||||
Set<String> set = Sets.newHashSet();
|
||||
set.addAll(siteSubscriptionHandler.getSubscribedToDataSetNames());
|
||||
set.addAll(sharedSubscriptionHandler.getSubscribedToDataSetNames());
|
||||
set.addAll(siteSubscriptionHandler.getSubscribedToDataSetNames(siteId));
|
||||
set.addAll(sharedSubscriptionHandler
|
||||
.getSubscribedToDataSetNames(siteId));
|
||||
|
||||
return set;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Dec 10, 2012 1259 bsteffen Switch Data Delivery from LatLon to referenced envelopes.
|
||||
* Jun 11, 2013 2021 dhladky WFS semi-scientific sizing.
|
||||
* Jun 14, 2013 2108 mpduff Abstracted the class.
|
||||
* Sept 09, 2013 2351 dhladky Fixed incorrect calculation for default pointdata overhead
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -115,7 +116,6 @@ public abstract class DataSizeUtils<DS extends DataSet> {
|
|||
PointTime time = (PointTime) ra.getTime();
|
||||
long l = st.getRequestBytesPerLatLonBoxAndTime(latSpan, lonSpan,
|
||||
time.getInterval());
|
||||
|
||||
return l;
|
||||
} else {
|
||||
throw new IllegalStateException(
|
||||
|
|
|
@ -30,6 +30,7 @@ package com.raytheon.uf.common.registry.constants;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 5/24/2013 2036 bphillip Initial implementation
|
||||
* 9/5/2013 1538 bphillip Changed status message
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -41,5 +42,5 @@ public class RegistryAvailability {
|
|||
public static final String AVAILABLE = "Registry services available.";
|
||||
|
||||
/** Registry not available since the database is not yet initialized */
|
||||
public static final String DB_NOT_INITIALIZED = "Registry services available, but database has not yet been initialized!";
|
||||
public static final String DB_NOT_INITIALIZED = "Registry database and services are currently initializing!";
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
**/
|
||||
package com.raytheon.uf.common.registry.services;
|
||||
|
||||
import java.lang.reflect.Proxy;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
@ -29,6 +30,8 @@ import javax.xml.bind.JAXBException;
|
|||
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.RegistryObjectType;
|
||||
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.cxf.jaxrs.client.Client;
|
||||
import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
|
||||
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
|
@ -38,6 +41,7 @@ import com.google.common.io.Resources;
|
|||
import com.raytheon.uf.common.registry.RegistryJaxbManager;
|
||||
import com.raytheon.uf.common.registry.RegistryNamespaceMapper;
|
||||
import com.raytheon.uf.common.registry.constants.RegistryAvailability;
|
||||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
import com.raytheon.uf.common.registry.services.rest.IRegistryAvailableRestService;
|
||||
import com.raytheon.uf.common.registry.services.rest.IRegistryDataAccessService;
|
||||
import com.raytheon.uf.common.registry.services.rest.IRegistryObjectsRestService;
|
||||
|
@ -58,6 +62,7 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
* 5/21/2013 2022 bphillip Initial implementation
|
||||
* 7/29/2013 2191 bphillip Implemented registry data access service
|
||||
* 8/1/2013 1693 bphillip Modified getregistry objects method to correctly handle response
|
||||
* 9/5/2013 1538 bphillip Changed cache expiration timeout and added http header
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -67,41 +72,37 @@ public class RegistryRESTServices {
|
|||
|
||||
/** Map of known registry object request services */
|
||||
private static LoadingCache<String, IRegistryObjectsRestService> registryObjectServiceMap = CacheBuilder
|
||||
.newBuilder().expireAfterAccess(1, TimeUnit.HOURS)
|
||||
.newBuilder().expireAfterAccess(5, TimeUnit.MINUTES)
|
||||
.build(new CacheLoader<String, IRegistryObjectsRestService>() {
|
||||
public IRegistryObjectsRestService load(String key) {
|
||||
return JAXRSClientFactory.create(key,
|
||||
IRegistryObjectsRestService.class);
|
||||
public IRegistryObjectsRestService load(String url) {
|
||||
return getPort(url, IRegistryObjectsRestService.class);
|
||||
}
|
||||
});
|
||||
|
||||
/** Map of known repository item request services */
|
||||
private static LoadingCache<String, IRepositoryItemsRestService> repositoryItemServiceMap = CacheBuilder
|
||||
.newBuilder().expireAfterAccess(1, TimeUnit.HOURS)
|
||||
.newBuilder().expireAfterAccess(5, TimeUnit.MINUTES)
|
||||
.build(new CacheLoader<String, IRepositoryItemsRestService>() {
|
||||
public IRepositoryItemsRestService load(String key) {
|
||||
return JAXRSClientFactory.create(key,
|
||||
IRepositoryItemsRestService.class);
|
||||
public IRepositoryItemsRestService load(String url) {
|
||||
return getPort(url, IRepositoryItemsRestService.class);
|
||||
}
|
||||
});
|
||||
|
||||
/** Map of known registry availability services */
|
||||
private static LoadingCache<String, IRegistryAvailableRestService> registryAvailabilityServiceMap = CacheBuilder
|
||||
.newBuilder().expireAfterAccess(1, TimeUnit.HOURS)
|
||||
.newBuilder().expireAfterAccess(5, TimeUnit.MINUTES)
|
||||
.build(new CacheLoader<String, IRegistryAvailableRestService>() {
|
||||
public IRegistryAvailableRestService load(String key) {
|
||||
return JAXRSClientFactory.create(key,
|
||||
IRegistryAvailableRestService.class);
|
||||
public IRegistryAvailableRestService load(String url) {
|
||||
return getPort(url, IRegistryAvailableRestService.class);
|
||||
}
|
||||
});
|
||||
|
||||
/** Map of known registry data access services */
|
||||
private static LoadingCache<String, IRegistryDataAccessService> registryDataAccessServiceMap = CacheBuilder
|
||||
.newBuilder().expireAfterAccess(1, TimeUnit.HOURS)
|
||||
.newBuilder().expireAfterAccess(5, TimeUnit.MINUTES)
|
||||
.build(new CacheLoader<String, IRegistryDataAccessService>() {
|
||||
public IRegistryDataAccessService load(String key) {
|
||||
return JAXRSClientFactory.create(key,
|
||||
IRegistryDataAccessService.class);
|
||||
public IRegistryDataAccessService load(String url) {
|
||||
return getPort(url, IRegistryDataAccessService.class);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -221,14 +222,23 @@ public class RegistryRESTServices {
|
|||
* @return True if the registry services are available
|
||||
*/
|
||||
public static boolean isRegistryAvailable(String baseURL) {
|
||||
String response = null;
|
||||
try {
|
||||
String response = getRegistryAvailableService(baseURL)
|
||||
response = getRegistryAvailableService(baseURL)
|
||||
.isRegistryAvailable();
|
||||
if (RegistryAvailability.AVAILABLE.equals(response)) {
|
||||
return true;
|
||||
} else {
|
||||
statusHandler.info("Registry at [" + baseURL
|
||||
+ "] not available: " + response);
|
||||
}
|
||||
return RegistryAvailability.AVAILABLE.equals(response);
|
||||
} catch (Throwable t) {
|
||||
statusHandler.error(
|
||||
"Registry at [" + baseURL + "] not available: ",
|
||||
t.getMessage());
|
||||
if (response == null) {
|
||||
response = ExceptionUtils.getRootCauseMessage(t);
|
||||
}
|
||||
statusHandler.error("Registry at [" + baseURL + "] not available: "
|
||||
+ response);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -275,4 +285,14 @@ public class RegistryRESTServices {
|
|||
+ url + "]");
|
||||
}
|
||||
}
|
||||
|
||||
private static <T extends Object> T getPort(String url,
|
||||
Class<T> serviceClass) {
|
||||
T service = JAXRSClientFactory.create(url, serviceClass);
|
||||
Client client = (Client) Proxy.getInvocationHandler((Proxy) service);
|
||||
// Create HTTP header containing the calling registry
|
||||
client.header(RegistryUtil.CALLING_REGISTRY_SOAP_HEADER_NAME,
|
||||
RegistryUtil.LOCAL_REGISTRY_ADDRESS);
|
||||
return service;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,12 +23,13 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.ws.BindingProvider;
|
||||
import javax.xml.ws.wsaddressing.W3CEndpointReference;
|
||||
import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
|
||||
|
||||
|
@ -43,20 +44,22 @@ import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryExceptionType;
|
|||
import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseStatus;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rs.v4.RegistryResponseType;
|
||||
|
||||
import org.apache.cxf.endpoint.Client;
|
||||
import org.apache.cxf.frontend.ClientProxy;
|
||||
import org.apache.cxf.headers.Header;
|
||||
import org.apache.cxf.jaxb.JAXBDataBinding;
|
||||
import org.apache.cxf.message.Message;
|
||||
import org.apache.cxf.transport.http.HTTPConduit;
|
||||
import org.apache.cxf.transports.http.configuration.ConnectionType;
|
||||
import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
|
||||
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.cache.CacheLoader;
|
||||
import com.google.common.cache.LoadingCache;
|
||||
import com.raytheon.uf.common.comm.ProxyConfiguration;
|
||||
import com.raytheon.uf.common.comm.ProxyUtil;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -71,6 +74,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
|
|||
* 4/9/2013 1802 bphillip Initial implementation
|
||||
* Apr 24, 2013 1910 djohnson RegistryResponseStatus is now an enum.
|
||||
* 8/28/2013 1538 bphillip Removed caches, add http client preferences
|
||||
* 9/5/2013 1538 bphillip Add HTTP header information
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -110,7 +114,7 @@ public class RegistrySOAPServices {
|
|||
static {
|
||||
proxyConfig = getProxyConfiguration();
|
||||
httpClientPolicy = new HTTPClientPolicy();
|
||||
httpClientPolicy.setReceiveTimeout(TimeUtil.MILLIS_PER_MINUTE * 2);
|
||||
httpClientPolicy.setReceiveTimeout(15000);
|
||||
httpClientPolicy.setConnectionTimeout(10000);
|
||||
httpClientPolicy.setConnection(ConnectionType.KEEP_ALIVE);
|
||||
httpClientPolicy.setMaxRetransmits(5);
|
||||
|
@ -121,6 +125,51 @@ public class RegistrySOAPServices {
|
|||
}
|
||||
}
|
||||
|
||||
/** Cache of known notification services */
|
||||
private static LoadingCache<String, NotificationListener> notificationManagerServices = CacheBuilder
|
||||
.newBuilder().expireAfterAccess(5, TimeUnit.MINUTES)
|
||||
.build(new CacheLoader<String, NotificationListener>() {
|
||||
public NotificationListener load(String key) {
|
||||
return getPort(key, NotificationListener.class);
|
||||
}
|
||||
});
|
||||
|
||||
/** Cache of known lifecycle manager services */
|
||||
private static LoadingCache<String, LifecycleManager> lifecycleManagerServices = CacheBuilder
|
||||
.newBuilder().expireAfterAccess(5, TimeUnit.MINUTES)
|
||||
.build(new CacheLoader<String, LifecycleManager>() {
|
||||
public LifecycleManager load(String key) {
|
||||
return getPort(key, LifecycleManager.class);
|
||||
}
|
||||
});
|
||||
|
||||
/** Cache of known cataloger services */
|
||||
private static LoadingCache<String, Cataloger> catalogerServices = CacheBuilder
|
||||
.newBuilder().expireAfterAccess(5, TimeUnit.MINUTES)
|
||||
.build(new CacheLoader<String, Cataloger>() {
|
||||
public Cataloger load(String key) {
|
||||
return getPort(key, Cataloger.class);
|
||||
}
|
||||
});
|
||||
|
||||
/** Cache of known query services */
|
||||
private static LoadingCache<String, QueryManager> queryServices = CacheBuilder
|
||||
.newBuilder().expireAfterAccess(5, TimeUnit.MINUTES)
|
||||
.build(new CacheLoader<String, QueryManager>() {
|
||||
public QueryManager load(String key) {
|
||||
return getPort(key, QueryManager.class);
|
||||
}
|
||||
});
|
||||
|
||||
/** Cache of known validator services */
|
||||
private static LoadingCache<String, Validator> validatorServices = CacheBuilder
|
||||
.newBuilder().expireAfterAccess(5, TimeUnit.MINUTES)
|
||||
.build(new CacheLoader<String, Validator>() {
|
||||
public Validator load(String key) {
|
||||
return getPort(key, Validator.class);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Gets the notification listener service URL for the given host
|
||||
*
|
||||
|
@ -162,7 +211,12 @@ public class RegistrySOAPServices {
|
|||
*/
|
||||
public static NotificationListener getNotificationListenerServiceForUrl(
|
||||
final String url) throws RegistryServiceException {
|
||||
return getPort(url, NotificationListener.class);
|
||||
try {
|
||||
return notificationManagerServices.get(url);
|
||||
} catch (ExecutionException e) {
|
||||
throw new RegistryServiceException(
|
||||
"Error getting notification service!", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -191,7 +245,12 @@ public class RegistrySOAPServices {
|
|||
*/
|
||||
public static LifecycleManager getLifecycleManagerServiceForUrl(
|
||||
final String url) throws RegistryServiceException {
|
||||
return getPort(url, LifecycleManager.class);
|
||||
try {
|
||||
return lifecycleManagerServices.get(url);
|
||||
} catch (ExecutionException e) {
|
||||
throw new RegistryServiceException(
|
||||
"Error getting lifecycleManager service", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -220,7 +279,12 @@ public class RegistrySOAPServices {
|
|||
*/
|
||||
public static Cataloger getCatalogerServiceForUrl(final String url)
|
||||
throws RegistryServiceException {
|
||||
return getPort(url, Cataloger.class);
|
||||
try {
|
||||
return catalogerServices.get(url);
|
||||
} catch (ExecutionException e) {
|
||||
throw new RegistryServiceException(
|
||||
"Error getting cataloger service!", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -248,7 +312,12 @@ public class RegistrySOAPServices {
|
|||
*/
|
||||
public static QueryManager getQueryServiceForUrl(final String url)
|
||||
throws RegistryServiceException {
|
||||
return getPort(url, QueryManager.class);
|
||||
try {
|
||||
return queryServices.get(url);
|
||||
} catch (ExecutionException e) {
|
||||
throw new RegistryServiceException(
|
||||
"Error gett queryManager service!", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -277,7 +346,12 @@ public class RegistrySOAPServices {
|
|||
*/
|
||||
public static Validator getValidatorServiceForUrl(final String url)
|
||||
throws RegistryServiceException {
|
||||
return getPort(url, Validator.class);
|
||||
try {
|
||||
return validatorServices.get(url);
|
||||
} catch (ExecutionException e) {
|
||||
throw new RegistryServiceException(
|
||||
"Error getting validator service!", e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -340,27 +414,13 @@ public class RegistrySOAPServices {
|
|||
W3CEndpointReference ref = endpointBuilder.build();
|
||||
T port = (T) ref.getPort(serviceInterface);
|
||||
|
||||
((HTTPConduit) ClientProxy.getClient(port).getConduit())
|
||||
.setClient(httpClientPolicy);
|
||||
|
||||
if (RegistryUtil.LOCAL_REGISTRY_ADDRESS != null) {
|
||||
List<Header> headerList = new ArrayList<Header>(1);
|
||||
Header header = null;
|
||||
try {
|
||||
header = new Header(new QName(
|
||||
RegistryUtil.CALLING_REGISTRY_SOAP_HEADER_NAME),
|
||||
RegistryUtil.LOCAL_REGISTRY_ADDRESS,
|
||||
new JAXBDataBinding(String.class));
|
||||
} catch (JAXBException e) {
|
||||
throw new RegistryServiceException(
|
||||
"Error creating header objects on service port", e);
|
||||
}
|
||||
headerList.add(header);
|
||||
BindingProvider bindingProvider = (BindingProvider) port;
|
||||
bindingProvider.getRequestContext().put(Header.HEADER_LIST,
|
||||
headerList);
|
||||
|
||||
}
|
||||
Client client = ClientProxy.getClient(port);
|
||||
((HTTPConduit) client.getConduit()).setClient(httpClientPolicy);
|
||||
// Create HTTP header containing the calling registry
|
||||
Map<String, List<String>> headers = new HashMap<String, List<String>>();
|
||||
headers.put(RegistryUtil.CALLING_REGISTRY_SOAP_HEADER_NAME,
|
||||
Arrays.asList(RegistryUtil.LOCAL_REGISTRY_ADDRESS));
|
||||
client.getRequestContext().put(Message.PROTOCOL_HEADERS, headers);
|
||||
return port;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ import org.apache.cxf.annotations.GZIP;
|
|||
*/
|
||||
@GZIP(threshold = 0)
|
||||
@WebService(name = "NotificationListener", targetNamespace = "urn:oasis:names:tc:ebxml-regrep:wsdl:NotificationListener:interfaces:4.0")
|
||||
@SOAPBinding(style = Style.RPC, parameterStyle = SOAPBinding.ParameterStyle.BARE)
|
||||
@SOAPBinding(style = Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
|
||||
@XmlSeeAlso({ oasis.names.tc.ebxml.regrep.xsd.rim.v4.ObjectFactory.class,
|
||||
oasis.names.tc.ebxml.regrep.xsd.spi.v4.ObjectFactory.class,
|
||||
oasis.names.tc.ebxml.regrep.xsd.lcm.v4.ObjectFactory.class,
|
||||
|
|
|
@ -34,7 +34,6 @@ import com.raytheon.uf.common.datadelivery.registry.Network;
|
|||
import com.raytheon.uf.common.datadelivery.registry.PointTime;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
|
||||
import com.raytheon.uf.common.event.EventBus;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
|
@ -115,6 +114,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
|||
* Jul 11, 2013 2106 djohnson Propose changing available bandwidth returns subscription names.
|
||||
* Jul 18, 2013 1653 mpduff Added case GET_SUBSCRIPTION_STATUS.
|
||||
* Aug 06, 2013 1654 bgonzale Added SubscriptionRequestEvents.
|
||||
* Sep 11, 2013 2351 dhladky Fixed adhoc requests for pointdata
|
||||
* </pre>
|
||||
*
|
||||
* @author dhladky
|
||||
|
@ -440,15 +440,13 @@ public abstract class BandwidthManager extends
|
|||
// Store the AdhocSubscription with a base time of now..
|
||||
subscriptions.add(bandwidthDao.newBandwidthSubscription(subscription,
|
||||
now));
|
||||
|
||||
// Check start time in Time, if it is blank, we need to add the most
|
||||
// recent MetaData for the DataSet subscribed to.
|
||||
final Time subTime = subscription.getTime();
|
||||
if (subTime.getStart() == null) {
|
||||
subscription = bandwidthDaoUtil.setAdhocMostRecentUrlAndTime(
|
||||
subscription, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* This check allows for retrieval of data older than current for grid.
|
||||
* This is not allowed for pointdata types, they must grab current URL
|
||||
* and time.
|
||||
*/
|
||||
subscription = bandwidthDaoUtil.setAdhocMostRecentUrlAndTime(
|
||||
subscription, true);
|
||||
// Use SimpleSubscriptionAggregator (i.e. no aggregation) to generate a
|
||||
// SubscriptionRetrieval for this AdhocSubscription
|
||||
SimpleSubscriptionAggregator a = new SimpleSubscriptionAggregator(
|
||||
|
|
|
@ -21,6 +21,7 @@ package com.raytheon.uf.edex.datadelivery.bandwidth;
|
|||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
@ -36,6 +37,7 @@ import com.google.common.collect.Lists;
|
|||
import com.raytheon.uf.common.datadelivery.registry.Network;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.dao.BandwidthBucket;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthBucketDao;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalPlan;
|
||||
|
@ -52,6 +54,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.util.BandwidthUtil;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 18, 2013 2106 djohnson Extracted from {@link RetrievalPlan}.
|
||||
* Spet 08, 2013 2351 dhladky Changed from ascending to descending bandwidth bucket selection
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -179,9 +182,13 @@ public class InMemoryBandwidthBucketDao implements IBandwidthBucketDao {
|
|||
public SortedSet<BandwidthBucket> getBucketsInWindow(Long startMillis,
|
||||
Long endMillis, Network network) {
|
||||
// Get the bucket for the startTime and endTime.
|
||||
Long startKey = ceilingKey(startMillis, network);
|
||||
Long endKey = floorBucket(endMillis, network);
|
||||
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||
statusHandler.debug("startMillis: " + new Date(startMillis) + "/n"
|
||||
+ "endMillis: " + new Date(endMillis));
|
||||
}
|
||||
|
||||
Long startKey = floorBucket(startMillis, network);
|
||||
Long endKey = ceilingKey(endMillis, network);
|
||||
// Handle the case where an invalid range was somehow specified
|
||||
// (shouldn't happen, so just throw an exception with as much
|
||||
// information as we have)
|
||||
|
@ -194,6 +201,14 @@ public class InMemoryBandwidthBucketDao implements IBandwidthBucketDao {
|
|||
|
||||
final NavigableMap<Long, BandwidthBucket> buckets = allBuckets
|
||||
.get(network);
|
||||
|
||||
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||
statusHandler.debug("startKey: " + new Date(startKey) + "\n"
|
||||
+ "endKey: " + new Date(endKey) + "\n" + "firstKey: "
|
||||
+ new Date(buckets.firstKey()) + "\n" + "lastKey: "
|
||||
+ new Date(buckets.lastKey()));
|
||||
}
|
||||
|
||||
NavigableMap<Long, BandwidthBucket> window = buckets.subMap(startKey,
|
||||
true, endKey, true);
|
||||
return new TreeSet<BandwidthBucket>(
|
||||
|
@ -210,7 +225,12 @@ public class InMemoryBandwidthBucketDao implements IBandwidthBucketDao {
|
|||
private Long floorBucket(long key, Network network) {
|
||||
final NavigableMap<Long, BandwidthBucket> buckets = allBuckets
|
||||
.get(network);
|
||||
return buckets.floorKey(key);
|
||||
Long firstKey = buckets.floorKey(key);
|
||||
if (firstKey == null) {
|
||||
firstKey = buckets.firstKey();
|
||||
}
|
||||
|
||||
return firstKey;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -223,7 +243,12 @@ public class InMemoryBandwidthBucketDao implements IBandwidthBucketDao {
|
|||
private Long ceilingKey(long key, Network network) {
|
||||
final NavigableMap<Long, BandwidthBucket> buckets = allBuckets
|
||||
.get(network);
|
||||
return buckets.ceilingKey(key);
|
||||
Long lastKey = buckets.ceilingKey(key);
|
||||
if (lastKey == null) {
|
||||
lastKey = buckets.lastKey();
|
||||
}
|
||||
|
||||
return lastKey;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
package com.raytheon.uf.edex.datadelivery.bandwidth.hibernate;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.raytheon.edex.site.SiteUtil;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SharedSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
|
@ -30,6 +32,8 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager;
|
|||
* Apr 16, 2013 1906 djohnson Implements RegistryInitializedListener.
|
||||
* Apr 30, 2013 1960 djohnson just call init rather than drop/create tables explicitly.
|
||||
* Jun 25, 2013 2106 djohnson init() now takes a {@link RetrievalManager} as well.
|
||||
* Sep 05, 2013 2330 bgonzale On WFO registry init, only subscribe to local site subscriptions.
|
||||
* Sep 06, 2013 2344 bgonzale Removed attempt to add to immutable empty set.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -80,11 +84,26 @@ public class HibernateBandwidthInitializer implements BandwidthInitializer {
|
|||
*/
|
||||
@Override
|
||||
public void executeAfterRegistryInit() {
|
||||
Set<Subscription> activeSubscriptions = Collections.emptySet();
|
||||
Set<Subscription> activeSubscriptions = new HashSet<Subscription>();
|
||||
try {
|
||||
// Load active subscriptions
|
||||
activeSubscriptions = findSubscriptionsStrategy
|
||||
.findSubscriptionsToSchedule();
|
||||
final String localOffice = SiteUtil.getSite();
|
||||
|
||||
// Load active subscriptions for the local office
|
||||
for (Subscription sub : findSubscriptionsStrategy
|
||||
.findSubscriptionsToSchedule()) {
|
||||
boolean isShared = (sub instanceof SharedSubscription);
|
||||
boolean isLocalOffice = sub.getOfficeIDs()
|
||||
.contains(localOffice);
|
||||
|
||||
if (!isShared && isLocalOffice) {
|
||||
activeSubscriptions.add(sub);
|
||||
statusHandler.info("Scheduling Subscription: " + sub);
|
||||
} else {
|
||||
statusHandler
|
||||
.info("Not Scheduling Non-local Subscription: "
|
||||
+ sub);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
statusHandler.error(
|
||||
"Failed to query for subscriptions to schedule", e);
|
||||
|
|
|
@ -29,8 +29,12 @@ import java.util.TreeSet;
|
|||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.raytheon.uf.common.datadelivery.registry.AdhocSubscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.DataSetMetaData;
|
||||
import com.raytheon.uf.common.datadelivery.registry.DataType;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Time;
|
||||
import com.raytheon.uf.common.datadelivery.registry.handlers.DataDeliveryHandlers;
|
||||
import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
@ -58,6 +62,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalStatus;
|
|||
* Feb 14, 2013 1595 djohnson Fix not using calendar copies, and backwards max/min operations.
|
||||
* Jun 03, 2013 2038 djohnson Add ability to schedule down to minute granularity.
|
||||
* Jun 04, 2013 223 mpduff Refactor changes.
|
||||
* Sept 10, 2013 2351 dhladky Made adhoc queries for pointdata work
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -308,46 +313,87 @@ public class BandwidthDaoUtil {
|
|||
AdhocSubscription adhoc, boolean mostRecent) {
|
||||
AdhocSubscription retVal = null;
|
||||
|
||||
List<BandwidthDataSetUpdate> dataSetMetaDataUpdates = bandwidthDao
|
||||
.getBandwidthDataSetUpdate(adhoc.getProvider(),
|
||||
adhoc.getDataSetName());
|
||||
if (!dataSetMetaDataUpdates.isEmpty()) {
|
||||
// getDataSetMetaData returns the dataset meta-data in descending
|
||||
// order of time, so walk the iterator finding the first subscribed
|
||||
// to cycle
|
||||
BandwidthDataSetUpdate daoToUse = null;
|
||||
Time adhocTime = adhoc.getTime();
|
||||
for (BandwidthDataSetUpdate current : dataSetMetaDataUpdates) {
|
||||
if (mostRecent
|
||||
|| adhocTime.getCycleTimes().contains(
|
||||
current.getDataSetBaseTime().get(
|
||||
Calendar.HOUR_OF_DAY))) {
|
||||
daoToUse = current;
|
||||
break;
|
||||
}
|
||||
if (adhoc.getDataSetType() == DataType.POINT) {
|
||||
|
||||
List<DataSetMetaData> dataSetMetaDatas = null;
|
||||
try {
|
||||
dataSetMetaDatas = DataDeliveryHandlers
|
||||
.getDataSetMetaDataHandler().getByDataSet(
|
||||
adhoc.getDataSetName(), adhoc.getProvider());
|
||||
} catch (RegistryHandlerException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"No DataSetMetaData matching query! DataSetName: "
|
||||
+ adhoc.getDataSetName() + " Provider: "
|
||||
+ adhoc.getProvider(), e);
|
||||
}
|
||||
|
||||
if (daoToUse == null) {
|
||||
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||
statusHandler
|
||||
.debug(String
|
||||
.format("There wasn't applicable most recent dataset metadata to use for the adhoc subscription [%s].",
|
||||
adhoc.getName()));
|
||||
}
|
||||
} else {
|
||||
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||
statusHandler
|
||||
.debug(String
|
||||
.format("Found most recent metadata for adhoc subscription [%s], using url [%s]",
|
||||
adhoc.getName(), daoToUse.getUrl()));
|
||||
}
|
||||
adhoc.setUrl(daoToUse.getUrl());
|
||||
adhocTime.setStartDate(daoToUse.getDataSetBaseTime().getTime());
|
||||
|
||||
|
||||
if (dataSetMetaDatas != null && !dataSetMetaDatas.isEmpty()) {
|
||||
// just grab the most recent one, all we need is the URL
|
||||
adhoc.setUrl(dataSetMetaDatas.get(0).getUrl());
|
||||
retVal = adhoc;
|
||||
}
|
||||
|
||||
} else if (adhoc.getDataSetType() == DataType.GRID) {
|
||||
|
||||
// if the start time is there, it already has it, skip
|
||||
if (adhoc.getTime().getStart() == null) {
|
||||
|
||||
List<BandwidthDataSetUpdate> dataSetMetaDataUpdates = bandwidthDao
|
||||
.getBandwidthDataSetUpdate(adhoc.getProvider(),
|
||||
adhoc.getDataSetName());
|
||||
|
||||
if (dataSetMetaDataUpdates != null
|
||||
&& !dataSetMetaDataUpdates.isEmpty()) {
|
||||
// getDataSetMetaData returns the dataset meta-data in
|
||||
// descending
|
||||
// order of time, so walk the iterator finding the first
|
||||
// subscribed
|
||||
// to cycle
|
||||
BandwidthDataSetUpdate daoToUse = null;
|
||||
Time adhocTime = adhoc.getTime();
|
||||
for (BandwidthDataSetUpdate current : dataSetMetaDataUpdates) {
|
||||
if (mostRecent
|
||||
|| adhocTime.getCycleTimes().contains(
|
||||
current.getDataSetBaseTime().get(
|
||||
Calendar.HOUR_OF_DAY))) {
|
||||
daoToUse = current;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (daoToUse == null) {
|
||||
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||
statusHandler
|
||||
.debug(String
|
||||
.format("There wasn't applicable most recent dataset metadata to use for the adhoc subscription [%s].",
|
||||
adhoc.getName()));
|
||||
}
|
||||
} else {
|
||||
if (statusHandler.isPriorityEnabled(Priority.DEBUG)) {
|
||||
statusHandler
|
||||
.debug(String
|
||||
.format("Found most recent metadata for adhoc subscription [%s], using url [%s]",
|
||||
adhoc.getName(),
|
||||
daoToUse.getUrl()));
|
||||
}
|
||||
|
||||
adhoc.setUrl(daoToUse.getUrl());
|
||||
adhocTime.setStartDate(daoToUse.getDataSetBaseTime()
|
||||
.getTime());
|
||||
|
||||
retVal = adhoc;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Just return the adhoc sub
|
||||
retVal = adhoc;
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("DataType: "
|
||||
+ adhoc.getDataSetType()
|
||||
+ " Not yet implemented for adhoc subscriptions");
|
||||
}
|
||||
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
unpack="false"/>
|
||||
|
||||
<plugin
|
||||
id="org.w3.XMLSchema"
|
||||
id="org.w3.xmlschema"
|
||||
download-size="0"
|
||||
install-size="0"
|
||||
version="0.0.0"/>
|
||||
|
|
|
@ -18,6 +18,7 @@ import com.raytheon.uf.common.serialization.comm.IRequestHandler;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 7, 2012 jsanchez Initial creation
|
||||
* 3/18/2013 1802 bphillip Modified to use transactional boundaries and spring injection of daos
|
||||
* 9/05/2013 2314 mpduff Handle Load All flag.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -39,7 +40,7 @@ public class GetNotificationHandler extends AbstractHandler implements
|
|||
throws Exception {
|
||||
List<NotificationRecord> notifications = notificationDao
|
||||
.lookupNotifications(request.getUsername(), request.getHours(),
|
||||
request.getMaxResults());
|
||||
request.getMaxResults(), request.getLoadAll());
|
||||
return notifications;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
package com.raytheon.uf.edex.datadelivery.event.notification;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.event.notification.NotificationRecord;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
|
@ -21,6 +23,7 @@ import com.raytheon.uf.edex.database.dao.SessionManagedDao;
|
|||
* Mar 1, 2012 jsanchez Initial creation
|
||||
* 3/18/2013 1802 bphillip Modified to use transactional boundaries and spring injection of daos
|
||||
* 4/9/2013 1802 bphillip Changed to use new query method signatures in SessionManagedDao
|
||||
* 09/05/2013 2314 mpduff Change query to an "in" query for user names.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -29,6 +32,7 @@ import com.raytheon.uf.edex.database.dao.SessionManagedDao;
|
|||
*/
|
||||
public class NotificationDao extends
|
||||
SessionManagedDao<Integer, NotificationRecord> {
|
||||
private static final Pattern SPLIT_PATTERN = Pattern.compile(",");
|
||||
|
||||
/**
|
||||
* Creates a new data access object
|
||||
|
@ -47,42 +51,56 @@ public class NotificationDao extends
|
|||
* can be to be retrieved
|
||||
* @param maxResults
|
||||
* The max result of records to retrieve
|
||||
* @return the Notificaion records based on passed contraints. The records
|
||||
* @param loadAll
|
||||
* Load all messages flag
|
||||
* @return the Notification records based on passed constraints. The records
|
||||
* are in descending order based on date
|
||||
*/
|
||||
public List<NotificationRecord> lookupNotifications(String username,
|
||||
Integer hours, Integer maxResults) {
|
||||
String hql = "from NotificationRecord rec";
|
||||
String nameClause = " rec.username=:userName ";
|
||||
Integer hours, Integer maxResults, Boolean loadAll) {
|
||||
StringBuilder hql = new StringBuilder("from NotificationRecord rec");
|
||||
String nameClause = " rec.username in (:userNames) ";
|
||||
String dateClause = " rec.date >= :date ";
|
||||
Calendar latestTime = null;
|
||||
List<String> userNames = null;
|
||||
|
||||
if (hours != null) {
|
||||
latestTime = Calendar.getInstance();
|
||||
latestTime.add(Calendar.HOUR, -hours);
|
||||
}
|
||||
|
||||
List<Object> params = new ArrayList<Object>();
|
||||
if (username == null && hours != null) {
|
||||
hql += " where " + dateClause;
|
||||
params.add("date");
|
||||
params.add(latestTime);
|
||||
} else if (username != null && hours == null) {
|
||||
hql += " where " + nameClause;
|
||||
params.add("userName");
|
||||
params.add(username);
|
||||
} else if (username != null && hours != null) {
|
||||
hql += " where " + nameClause + " and " + dateClause;
|
||||
params.add("date");
|
||||
params.add(latestTime);
|
||||
params.add("userName");
|
||||
params.add(username);
|
||||
if (username != null) {
|
||||
String[] users = SPLIT_PATTERN.split(username);
|
||||
userNames = Arrays.asList(users);
|
||||
}
|
||||
hql += " order by rec.date desc";
|
||||
List<Object> params = new ArrayList<Object>();
|
||||
if (userNames == null && hours != null) {
|
||||
if (!loadAll) {
|
||||
hql.append(" where ").append(dateClause);
|
||||
params.add("date");
|
||||
params.add(latestTime);
|
||||
}
|
||||
} else if (userNames != null && hours == null) {
|
||||
hql.append(" where ").append(nameClause);
|
||||
params.add("userNames");
|
||||
params.add(userNames);
|
||||
} else if (userNames != null && hours != null) {
|
||||
hql.append(" where ").append(nameClause);
|
||||
if (!loadAll) {
|
||||
hql.append(" and ").append(dateClause);
|
||||
params.add("date");
|
||||
params.add(latestTime);
|
||||
}
|
||||
params.add("userNames");
|
||||
params.add(userNames);
|
||||
}
|
||||
hql.append(" order by rec.date desc");
|
||||
|
||||
if (maxResults == null) {
|
||||
return this.query(hql, params.toArray(new Object[params.size()]));
|
||||
return this.query(hql.toString(),
|
||||
params.toArray(new Object[params.size()]));
|
||||
} else {
|
||||
return this.query(hql, maxResults,
|
||||
return this.query(hql.toString(), maxResults,
|
||||
params.toArray(new Object[params.size()]));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<serviceConfig name="WFS">
|
||||
<!-- Date format used by WFS providers -->
|
||||
<dateConfig>
|
||||
<format>yyyy-MM-dd'T'HH:mm:ss.SSSZ</format>
|
||||
<format>yyyy-MM-dd'T'HH:mm:ss.SSS</format>
|
||||
</dateConfig>
|
||||
|
||||
<constant name="BLANK" value=""/>
|
||||
|
@ -35,6 +35,6 @@
|
|||
<constant name="OUTPUTFORMAT" value="text/xml"/>
|
||||
<constant name="FORWARD_SLASH" value="/"/>
|
||||
<constant name="DEFAULT_CRS" value="crs:84"/>
|
||||
<constant name="MAX" value="maxfeatures=3000"/>
|
||||
<constant name="MAX" value="5000"/>
|
||||
|
||||
</serviceConfig>
|
|
@ -97,6 +97,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
|
|||
* 6/4/2013 1707 bphillip Changed to use new NotificationServer objects
|
||||
* 7/29/2013 2191 bphillip Implemented registry sync for registries that have been down for an extended period of time
|
||||
* 8/1/2013 1693 bphillip Switch to use rest service instead of query manager for federation synchronization
|
||||
* 9/5/2013 1538 bphillip Changed when the registry availability monitor is started
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -145,7 +146,7 @@ public class RegistryReplicationManager {
|
|||
* will be used for synchronization. Configurable in the
|
||||
* com.raytheon.uf.edex.registry.ebxml.properties file. Default is 25
|
||||
*/
|
||||
private int registrySyncThreads = 25;
|
||||
private int registrySyncThreads = 5;
|
||||
|
||||
private int maxSyncRetries = 3;
|
||||
|
||||
|
@ -249,12 +250,6 @@ public class RegistryReplicationManager {
|
|||
synchronizeRegistryWithFederation(registryToSyncFrom
|
||||
.getRegistryBaseURL());
|
||||
|
||||
statusHandler
|
||||
.info("Starting federated uptime monitor...");
|
||||
scheduler.scheduleAtFixedRate(
|
||||
federatedRegistryMonitor, 0, 1,
|
||||
TimeUnit.MINUTES);
|
||||
// Sync was successful, break out of retry loop
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -278,6 +273,9 @@ public class RegistryReplicationManager {
|
|||
}
|
||||
}
|
||||
}
|
||||
statusHandler.info("Starting federated uptime monitor...");
|
||||
scheduler.scheduleAtFixedRate(federatedRegistryMonitor, 0, 1,
|
||||
TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
private void synchronizeRegistryWithFederation(String remoteRegistryUrl)
|
||||
|
|
|
@ -23,7 +23,6 @@ Require-Bundle: com.raytheon.uf.common.datadelivery.retrieval;bundle-version="1.
|
|||
com.raytheon.uf.common.dataplugin.madis;bundle-version="1.0.0",
|
||||
com.raytheon.uf.edex.plugin.madis.ogc;bundle-version="1.0.0",
|
||||
com.raytheon.uf.edex.plugin.madis;bundle-version="1.0.0",
|
||||
com.raytheon.uf.edex.wfs;bundle-version="1.0.0",
|
||||
org.eclipse.xsd;bundle-version="2.8.1"
|
||||
com.raytheon.uf.edex.wfs;bundle-version="1.0.0"
|
||||
Export-Package: com.raytheon.uf.edex.datadelivery.retrieval.wfs,
|
||||
com.raytheon.uf.edex.datadelivery.retrieval.wfs.metadata
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.raytheon.uf.edex.datadelivery.retrieval.wfs;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import org.geotools.geometry.jts.ReferencedEnvelope;
|
||||
|
@ -33,6 +32,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Jun 11, 2013 1763 dhladky Made operational.
|
||||
* Jun 18, 2013 2120 dhladky Added times and max feature processing
|
||||
* Aug 07, 2013 2097 dhladky Revamped WFS to use POST (still 1.1.0 WFS)
|
||||
* Sept 11, 2013 2351 dhladky Fixed adhoc request times
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -69,6 +69,50 @@ public class WfsRequestBuilder extends RequestBuilder {
|
|||
|
||||
public static final String AMPERSAND = "&";
|
||||
|
||||
public static final String SPACE = " ";
|
||||
|
||||
public static final String NEW_LINE = "\n";
|
||||
|
||||
public static final String PROPERTTY_OPEN = "<ogc:PropertyName>";
|
||||
|
||||
public static final String PROPERTTY_CLOSE = "</ogc:PropertyName>";
|
||||
|
||||
public static final String PROPRERTYISGREATERTHAN_OPEN = "<ogc:PropertyIsGreaterThan>";
|
||||
|
||||
public static final String PROPRERTYISGREATERTHAN_CLOSE = "</ogc:PropertyIsGreaterThan>";
|
||||
|
||||
public static final String PROPRERTYISLESSTHAN_OPEN = "<ogc:PropertyIsLessThan>";
|
||||
|
||||
public static final String PROPRERTYISLESSTHAN_CLOSE = "</ogc:PropertyIsLessThan>";
|
||||
|
||||
public static final String ISLITERAL_OPEN = "<ogc:Literal>";
|
||||
|
||||
public static final String ISLITERAL_CLOSE = "</ogc:Literal>";
|
||||
|
||||
public static final String LOWER_CORNER_OPEN = "<gml:lowerCorner>";
|
||||
|
||||
public static final String LOWER_CORNER_CLOSE = "</gml:lowerCorner>";
|
||||
|
||||
public static final String UPPER_CORNER_OPEN = "<gml:upperCorner>";
|
||||
|
||||
public static final String UPPER_CORNER_CLOSE = "</gml:upperCorner>";
|
||||
|
||||
public static final String WITHIN_OPEN = "<ogc:Within>";
|
||||
|
||||
public static final String WITHIN_CLOSE = "</ogc:Within>";
|
||||
|
||||
public static final String AND_OPEN = "<ogc:And>";
|
||||
|
||||
public static final String AND_CLOSE = "</ogc:And>";
|
||||
|
||||
public static final String FILTER_OPEN = "<ogc:Filter>";
|
||||
|
||||
public static final String FILTER_CLOSE = "</ogc:Filter>";
|
||||
|
||||
public static final String ENVELOPE_OPEN = "<gml:Envelope";
|
||||
|
||||
public static final String ENVELOPE_CLOSE = "</gml:Envelope>";
|
||||
|
||||
private final String wfsURL;
|
||||
|
||||
private String typeName = null;
|
||||
|
@ -80,22 +124,19 @@ public class WfsRequestBuilder extends RequestBuilder {
|
|||
this.typeName = attXML.getPlugin();
|
||||
StringBuilder buffer = new StringBuilder(256);
|
||||
buffer.append(createHeader());
|
||||
buffer.append("<ogc:Filter>\n");
|
||||
buffer.append(FILTER_OPEN).append(NEW_LINE);
|
||||
|
||||
if (attXML.getCoverage() != null && attXML.getTime() != null) {
|
||||
buffer.append("<ogc:And>\n");
|
||||
buffer.append(AND_OPEN).append(NEW_LINE);
|
||||
}
|
||||
|
||||
buffer.append(processTime(attXML.getTime()));
|
||||
buffer.append(processCoverage());
|
||||
buffer.append(processTime(attXML.getTime())).append(processCoverage());
|
||||
|
||||
if (attXML.getCoverage() != null && attXML.getTime() != null) {
|
||||
buffer.append("</ogc:And>\n");
|
||||
buffer.append(AND_CLOSE).append(NEW_LINE);
|
||||
}
|
||||
|
||||
buffer.append("</ogc:Filter>\n");
|
||||
buffer.append(createFooter());
|
||||
|
||||
buffer.append(FILTER_CLOSE).append(NEW_LINE).append(createFooter());
|
||||
this.wfsURL = buffer.toString().trim();
|
||||
}
|
||||
|
||||
|
@ -146,28 +187,48 @@ public class WfsRequestBuilder extends RequestBuilder {
|
|||
public String processTime(Time inTime) {
|
||||
|
||||
try {
|
||||
if (inTime.getStartDate() != null) {
|
||||
|
||||
Date sDate = inTime.getStartDate();
|
||||
Date eDate = inTime.getEndDate();
|
||||
String endDateString = ogcDateFormat.get().format(eDate);
|
||||
String startDateString = ogcDateFormat.get().format(sDate);
|
||||
|
||||
StringBuilder sb = new StringBuilder(256);
|
||||
sb.append("<ogc:PropertyIsGreaterThan>\n");
|
||||
sb.append("<ogc:PropertyName>").append(typeName).append(":timeObs</ogc:PropertyName>\n");
|
||||
sb.append("<ogc:Literal>").append(startDateString).append("</ogc:Literal>\n");
|
||||
sb.append("</ogc:PropertyIsGreaterThan>\n");
|
||||
|
||||
if (endDateString != null) {
|
||||
sb.append("<ogc:PropertyIsLessThan>\n");
|
||||
sb.append("<ogc:PropertyName>").append(typeName).append(":timeObs</ogc:PropertyName>\n");
|
||||
sb.append("<ogc:Literal>").append(endDateString).append("</ogc:Literal>\n");
|
||||
sb.append("</ogc:PropertyIsLessThan>\n");
|
||||
}
|
||||
String endDateString = null;
|
||||
String startDateString = null;
|
||||
|
||||
return sb.toString();
|
||||
if (inTime.getStart() != null && inTime.getEnd() != null) {
|
||||
/**
|
||||
* THESE ARE ADHOC requests!!!!! They go backwards from normal
|
||||
* They are calculated (now - interval)
|
||||
* Hence the start time is before the end time.
|
||||
* TODO: We should look into this more. I think more problems exist in BWM
|
||||
*/
|
||||
startDateString = inTime.getEnd();
|
||||
endDateString = inTime.getStart();
|
||||
|
||||
} else if (inTime.getStartDate() != null
|
||||
&& inTime.getEndDate() != null) {
|
||||
/**
|
||||
* Normal recurring subscription requests
|
||||
*/
|
||||
endDateString = ogcDateFormat.get().format(inTime.getEndDate());
|
||||
startDateString = ogcDateFormat.get().format(inTime.getStartDate());
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder(256);
|
||||
sb.append(PROPRERTYISGREATERTHAN_OPEN).append(NEW_LINE);
|
||||
sb.append(PROPERTTY_OPEN).append(typeName).append(":timeObs")
|
||||
.append(PROPERTTY_CLOSE).append(NEW_LINE);
|
||||
sb.append(ISLITERAL_OPEN).append(startDateString)
|
||||
.append(ISLITERAL_CLOSE).append(NEW_LINE);
|
||||
sb.append(PROPRERTYISGREATERTHAN_CLOSE).append(NEW_LINE);
|
||||
|
||||
if (endDateString != null) {
|
||||
sb.append(PROPRERTYISLESSTHAN_OPEN).append(NEW_LINE);
|
||||
sb.append(PROPERTTY_OPEN).append(typeName).append(":timeObs")
|
||||
.append(PROPERTTY_CLOSE).append(NEW_LINE);
|
||||
sb.append(ISLITERAL_OPEN).append(endDateString)
|
||||
.append(ISLITERAL_CLOSE).append(NEW_LINE);
|
||||
sb.append(PROPRERTYISLESSTHAN_CLOSE).append(NEW_LINE);
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
|
||||
} catch (Exception e) {
|
||||
statusHandler.error("Couldn't parse Time object.", e);
|
||||
}
|
||||
|
@ -192,22 +253,23 @@ public class WfsRequestBuilder extends RequestBuilder {
|
|||
double upperLon = ur.x;
|
||||
double upperLat = ur.y;
|
||||
|
||||
sb.append("<ogc:Within>\n");
|
||||
sb.append("<ogc:PropertyName>location/location</ogc:PropertyName>\n");
|
||||
sb.append("<gml:Envelope srsName=\"").append(CRS)
|
||||
.append("\">\n");
|
||||
sb.append("<gml:lowerCorner>");
|
||||
sb.append(WITHIN_OPEN).append(NEW_LINE);
|
||||
sb.append(PROPERTTY_OPEN).append("location/location")
|
||||
.append(PROPERTTY_CLOSE).append(NEW_LINE);
|
||||
sb.append(ENVELOPE_OPEN).append(" srsName=\"").append(CRS)
|
||||
.append("\">").append(NEW_LINE);
|
||||
sb.append(LOWER_CORNER_OPEN);
|
||||
sb.append(lowerLon);
|
||||
sb.append(" ");
|
||||
sb.append(SPACE);
|
||||
sb.append(lowerLat);
|
||||
sb.append("</gml:lowerCorner>\n");
|
||||
sb.append("<gml:upperCorner>");
|
||||
sb.append(LOWER_CORNER_CLOSE).append(NEW_LINE);
|
||||
sb.append(UPPER_CORNER_OPEN);
|
||||
sb.append(upperLon);
|
||||
sb.append(" ");
|
||||
sb.append(SPACE);
|
||||
sb.append(upperLat);
|
||||
sb.append("</gml:upperCorner>\n");
|
||||
sb.append("</gml:Envelope>\n");
|
||||
sb.append("</ogc:Within>\n");
|
||||
sb.append(UPPER_CORNER_CLOSE).append(NEW_LINE);
|
||||
sb.append(ENVELOPE_CLOSE).append(NEW_LINE);
|
||||
sb.append(WITHIN_CLOSE).append(NEW_LINE);
|
||||
|
||||
return sb.toString();
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ import dods.dap.DConnect;
|
|||
* Jun 28, 2012 819 djohnson Initial creation
|
||||
* Apr 01, 2013 1786 mpduff Pulled proxy settings out to util class.
|
||||
* May 12, 2013 753 dhladky Expanded for use with other connection types
|
||||
*
|
||||
* Aug 30, 2013 2314 mpduff Added null checks.
|
||||
* </pre>
|
||||
*
|
||||
* @author djohnson
|
||||
|
@ -113,12 +113,17 @@ public class ConnectionUtil {
|
|||
ProxyConfiguration proxyInformation = instance.getProxyInformation();
|
||||
|
||||
if (proxyInformation != null) {
|
||||
System.setProperty(ProxyUtil.HTTP_PROXY_HOST,
|
||||
proxyInformation.getHost());
|
||||
System.setProperty(ProxyUtil.HTTP_PROXY_PORT,
|
||||
proxyInformation.getPortString());
|
||||
System.setProperty(ProxyUtil.HTTP_NON_PROXY_HOSTS,
|
||||
proxyInformation.getNonProxyHosts());
|
||||
if (proxyInformation.getHost() != null
|
||||
&& proxyInformation.getPortString() != null) {
|
||||
System.setProperty(ProxyUtil.HTTP_PROXY_HOST,
|
||||
proxyInformation.getHost());
|
||||
System.setProperty(ProxyUtil.HTTP_PROXY_PORT,
|
||||
proxyInformation.getPortString());
|
||||
}
|
||||
if (proxyInformation.getNonProxyHosts() != null) {
|
||||
System.setProperty(ProxyUtil.HTTP_NON_PROXY_HOSTS,
|
||||
proxyInformation.getNonProxyHosts());
|
||||
}
|
||||
}
|
||||
initialized = true;
|
||||
}
|
||||
|
|
|
@ -129,6 +129,43 @@ public class ProviderCredentialsUtil {
|
|||
return creds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes the connection for the provider.
|
||||
*
|
||||
* @param creds
|
||||
* ProviderCredentials object
|
||||
*
|
||||
* @return ProviderCredentials object with status and message set
|
||||
*/
|
||||
public static ProviderCredentials deleteCredentials(
|
||||
ProviderCredentials creds) {
|
||||
String providerName = creds.getProvider().getName();
|
||||
IPathManager pm = PathManagerFactory.getPathManager();
|
||||
LocalizationContext lc = pm.getContext(LocalizationType.COMMON_STATIC,
|
||||
LocalizationLevel.SITE);
|
||||
|
||||
String connectionFileName = CONNECTION_FILE_PREFIX + providerName
|
||||
+ CONNECTION_FILE_SUFFIX;
|
||||
try {
|
||||
LocalizationFile lf = pm
|
||||
.getLocalizationFile(lc, connectionFileName);
|
||||
lf.delete();
|
||||
|
||||
ProviderKeyDao pkd = new ProviderKeyDao();
|
||||
ProviderKeyRecord pkr = pkd.queryByProvider(providerName);
|
||||
if (pkr != null) {
|
||||
pkd.delete(pkr);
|
||||
}
|
||||
creds.setStatus(Status.SUCCESS);
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.ERROR,
|
||||
"Couldn't delete encrypted Connection!", e);
|
||||
creds.setStatus(Status.FAILURE);
|
||||
creds.setMessage("Error deleting encrypted connection. See server log for error details.");
|
||||
}
|
||||
return creds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ProviderCredentials object containing the encrytped credentials.
|
||||
*
|
||||
|
|
|
@ -88,6 +88,15 @@ public class ProviderKeyRequestHandler implements
|
|||
request.setProvider(provider);
|
||||
request.setStatus(Status.SUCCESS);
|
||||
}
|
||||
} else if (request.getRequestType() == RequestType.DELETE) {
|
||||
ProviderCredentials creds = new ProviderCredentials(
|
||||
request.getProvider(), request.getProviderKey());
|
||||
creds = ProviderCredentialsUtil.deleteCredentials(creds);
|
||||
|
||||
request.setStatus(creds.getStatus());
|
||||
if (creds.getStatus() == Status.FAILURE) {
|
||||
request.setMessage(creds.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
return request;
|
||||
|
|
|
@ -2,4 +2,6 @@
|
|||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -5,9 +5,3 @@ Bundle-SymbolicName: com.raytheon.uf.edex.dataprovideragent
|
|||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: RAYTHEON
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Require-Bundle: com.raytheon.uf.edex.purgesrv;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.edex.core;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.util;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.registry.ebxml;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.datadelivery.request;bundle-version="1.0.0"
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
//
|
||||
// Placeholder for src directory
|
||||
//
|
||||
|
||||
package com.raytheon.uf.edex.dataprovideragent;
|
|
@ -21,8 +21,10 @@ package com.raytheon.uf.edex.ogc.registry;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.common.datadelivery.harvester.Agent;
|
||||
import com.raytheon.uf.common.datadelivery.harvester.ConfigLayer;
|
||||
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
||||
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfigurationManager;
|
||||
import com.raytheon.uf.common.datadelivery.harvester.OGCAgent;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
|
@ -90,12 +92,16 @@ public class RegistryFeatureTypeModifier implements IFeatureTypeModifier {
|
|||
* @return
|
||||
*/
|
||||
public ConfigLayer getConfigLayer(String name) {
|
||||
ConfigLayer layer = null;
|
||||
if (config.getAgent() != null) {
|
||||
if (config.getAgent() instanceof OGCAgent) {
|
||||
layer = ((OGCAgent) config.getAgent()).getLayer(name);
|
||||
|
||||
if (layer == null) {
|
||||
Agent agent = getHarvesterConfig().getAgent();
|
||||
if (agent != null) {
|
||||
if (agent instanceof OGCAgent) {
|
||||
layer = ((OGCAgent) agent).getLayer(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return layer;
|
||||
}
|
||||
|
||||
|
@ -146,5 +152,18 @@ public class RegistryFeatureTypeModifier implements IFeatureTypeModifier {
|
|||
|
||||
return crs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Harvester Configuration
|
||||
* @return
|
||||
*/
|
||||
protected HarvesterConfig getHarvesterConfig() {
|
||||
|
||||
if (config == null) {
|
||||
config = HarvesterConfigurationManager.getOGCConfiguration();
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -66,6 +66,8 @@ import com.vividsolutions.jts.geom.Envelope;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 23, 2013 bclement Initial creation
|
||||
* Aug 08, 2013 2097 dhladky Made operational
|
||||
* Aug 30, 2013 2098 dhladky Improved
|
||||
* Spet 2, 2013 2098 dhladky Updated how times are managed.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -91,6 +93,8 @@ public class WfsRegistryCollectorAddon<D extends SimpleDimension, L extends Simp
|
|||
protected int roundCutoff = 45;
|
||||
|
||||
protected final String layerName;
|
||||
|
||||
protected Date previousTime = null;
|
||||
|
||||
/**
|
||||
* @param layerName
|
||||
|
@ -243,8 +247,14 @@ public class WfsRegistryCollectorAddon<D extends SimpleDimension, L extends Simp
|
|||
dateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
time.setFormat(dateFormat.toPattern());
|
||||
if (!times.isEmpty()) {
|
||||
time.setStart(dateFormat.format(times.get(0)));
|
||||
time.setEnd(dateFormat.format(times.size() - 1));
|
||||
if (previousTime == null) {
|
||||
time.setStart(dateFormat.format(times.get(0)));
|
||||
} else {
|
||||
time.setStart(dateFormat.format(previousTime));
|
||||
}
|
||||
Date lastTime = times.get(times.size() - 1);
|
||||
time.setEnd(dateFormat.format(lastTime));
|
||||
setPreviousTime(lastTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -402,14 +412,6 @@ public class WfsRegistryCollectorAddon<D extends SimpleDimension, L extends Simp
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param roundCutoff
|
||||
* the roundCutoff to set
|
||||
*/
|
||||
public void setRoundCutoff(int roundCutoff) {
|
||||
this.roundCutoff = roundCutoff;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -432,4 +434,21 @@ public class WfsRegistryCollectorAddon<D extends SimpleDimension, L extends Simp
|
|||
// TODO Auto-generated method stub
|
||||
}
|
||||
|
||||
/**
|
||||
* Marker time for sending back and requesting data
|
||||
* From this date to last will be the next query
|
||||
* @return
|
||||
*/
|
||||
public Date getPreviousTime() {
|
||||
return previousTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the marker time for previousDate
|
||||
* @param previousTime
|
||||
*/
|
||||
public void setPreviousTime(Date previousTime) {
|
||||
this.previousTime = previousTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,10 +3,6 @@
|
|||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<bean id="registerDataDeliveryHandlers" class="java.lang.String">
|
||||
<!-- required for depends-on -->
|
||||
</bean>
|
||||
|
||||
<bean id="madisDecoder" class="com.raytheon.uf.edex.plugin.madis.MadisDecoder">
|
||||
<constructor-arg ref="madisPluginName" />
|
||||
</bean>
|
||||
|
@ -42,12 +38,6 @@
|
|||
<constructor-arg ref="madis-camel" />
|
||||
</bean>
|
||||
|
||||
<bean id="madisLayerCollector"
|
||||
class="com.raytheon.uf.edex.plugin.madis.ogc.MadisLayerCollector"
|
||||
depends-on="registerDataDeliveryHandlers, registerRequestRegistryRouter, registerMadisPlugin">
|
||||
<constructor-arg ref="madisLayerTransformer" />
|
||||
</bean>
|
||||
|
||||
<bean id="madisSeparator" class="com.raytheon.uf.edex.plugin.madis.MadisSeparator"
|
||||
depends-on="jmsIngestMadisConfig, jms-madis, madisThreadPool">
|
||||
<constructor-arg
|
||||
|
@ -139,9 +129,10 @@
|
|||
<bean ref="madisDecoder" method="decode" />
|
||||
<bean ref="madisRegistryAddon" method="filter" />
|
||||
<bean ref="madisPointData" method="toPointData" />
|
||||
<bean ref="persist" method="persist"/>
|
||||
<bean ref="index" method="index"/>
|
||||
<bean ref="madisLayerCollector" method="add" />
|
||||
<!-- we don't need to alert on DPA, just save -->
|
||||
<to uri="direct-vm:persistIndex" />
|
||||
<bean ref="processUtil" method="log"/>
|
||||
</pipeline>
|
||||
<doCatch>
|
||||
<exception>java.lang.Throwable</exception>
|
||||
|
|
|
@ -26,7 +26,6 @@ import java.util.Date;
|
|||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.madis.MadisRecord;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.edex.ogc.common.db.LayerCollector;
|
||||
import com.raytheon.uf.edex.ogc.common.util.PluginIngestFilter;
|
||||
import com.raytheon.uf.edex.ogc.registry.WfsRegistryCollectorAddon;
|
||||
import com.raytheon.uf.edex.plugin.madis.ogc.MadisDimension;
|
||||
|
@ -44,6 +43,9 @@ import com.vividsolutions.jts.geom.Envelope;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 24, 2013 bclement Initial creation
|
||||
* Aug 18, 2013 #2097 dhladky Restored original functionality before renaming of this class
|
||||
* Aug 30, 2013 #2098 dhladky Incorrect time returned
|
||||
* Sept 2, 2013 #2098 dhladky Improved time management.
|
||||
* Sept 9, 2013 #2351 dhladky Speed improvements
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -73,7 +75,7 @@ public class MadisRegistryCollectorAddon extends
|
|||
@Override
|
||||
protected Date getTime(MadisRecord record) {
|
||||
Date time = record.getTimeObs();
|
||||
return LayerCollector.roundToHour(time, roundCutoff);
|
||||
return time;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -95,35 +97,36 @@ public class MadisRegistryCollectorAddon extends
|
|||
|
||||
Collection<MadisRecord> withInGeoConstraint = new ArrayList<MadisRecord>();
|
||||
PluginDataObject[] pdor = null;
|
||||
Envelope e = null;
|
||||
|
||||
if (getCoverage() != null) {
|
||||
|
||||
e = getCoverage().getEnvelope();
|
||||
|
||||
for (PluginDataObject record : pdos) {
|
||||
for (PluginDataObject record : pdos) {
|
||||
|
||||
MadisRecord rec = (MadisRecord) record;
|
||||
MadisRecord rec = (MadisRecord) record;
|
||||
|
||||
if (rec != null) {
|
||||
if (rec != null && rec.getLocation() != null) {
|
||||
|
||||
Envelope e = getCoverage().getEnvelope();
|
||||
Coordinate c = rec.getLocation().getLocation()
|
||||
.getCoordinate();
|
||||
|
||||
if (rec.getLocation() != null) {
|
||||
if (c != null) {
|
||||
|
||||
Coordinate c = rec.getLocation().getLocation()
|
||||
.getCoordinate();
|
||||
|
||||
if (c != null) {
|
||||
|
||||
if (e.contains(c)) {
|
||||
withInGeoConstraint.add(rec);
|
||||
} else {
|
||||
statusHandler.handle(
|
||||
Priority.DEBUG,
|
||||
"Madis record discarded: outside of range: "
|
||||
+ rec.getLatitude() + " "
|
||||
+ rec.getLongitude());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (e.contains(c)) {
|
||||
withInGeoConstraint.add(rec);
|
||||
} else {
|
||||
statusHandler.handle(
|
||||
Priority.DEBUG,
|
||||
"Madis record discarded: outside of range: "
|
||||
+ rec.getLatitude() + " "
|
||||
+ rec.getLongitude());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!withInGeoConstraint.isEmpty()) {
|
||||
int size = withInGeoConstraint.size();
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
com.raytheon.uf.edex.registry.ebxml.services.query.adhoc.AdhocQueryExpression
|
||||
com.raytheon.uf.edex.registry.ebxml.services.rest.RestResponse
|
||||
com.raytheon.uf.edex.registry.ebxml.services.query.adhoc.AdhocQueryExpression
|
|
@ -39,6 +39,7 @@ import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 3/13/2013 1082 bphillip Initial creation
|
||||
* 9/5/2013 1538 bphillip Added eagerLoadAll method
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -64,6 +65,34 @@ public class SubscriptionDao extends RegistryObjectTypeDao<SubscriptionType> {
|
|||
subscriptionJaxbManager = new JAXBManager(SubscriptionType.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Eagerly loads all the registry subscriptions
|
||||
*
|
||||
* @return All subscriptions in the registry
|
||||
* @throws EbxmlRegistryException
|
||||
* If errors occur while querying
|
||||
*/
|
||||
public List<SubscriptionType> eagerLoadAll() throws EbxmlRegistryException {
|
||||
List<SubscriptionType> subs = this.template
|
||||
.loadAll(SubscriptionType.class);
|
||||
for (SubscriptionType sub : subs) {
|
||||
try {
|
||||
/*
|
||||
* FIXME: This is just a quick and dirty way of fully
|
||||
* initializing all the fields of the subscription. Since this
|
||||
* query happens relatively infrequently, having this operation
|
||||
* here does not pose any sort of performance penalty.
|
||||
* Obviously, a better solution needs to be devised in the
|
||||
* future
|
||||
*/
|
||||
subscriptionJaxbManager.marshalToXml(sub);
|
||||
} catch (JAXBException e) {
|
||||
throw new EbxmlRegistryException("Error initializing bean!", e);
|
||||
}
|
||||
}
|
||||
return subs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the fully populated subscription object
|
||||
*
|
||||
|
|
|
@ -0,0 +1,91 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.edex.registry.ebxml.services;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.cxf.interceptor.Fault;
|
||||
import org.apache.cxf.message.Message;
|
||||
import org.apache.cxf.phase.AbstractPhaseInterceptor;
|
||||
import org.apache.cxf.phase.Phase;
|
||||
import org.apache.cxf.transport.http.AbstractHTTPDestination;
|
||||
|
||||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.util.CollectionUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
* Service interceptor for logging web service and rest calls
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 9/5/2013 1538 bphillip Initial implementation
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1
|
||||
*/
|
||||
public class RegistryServiceInInterceptor extends
|
||||
AbstractPhaseInterceptor<Message> {
|
||||
/** The logger */
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(RegistryServiceInInterceptor.class);
|
||||
|
||||
public RegistryServiceInInterceptor() {
|
||||
super(Phase.RECEIVE);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void handleMessage(Message message) throws Fault {
|
||||
StringBuilder logMessage = new StringBuilder();
|
||||
HttpServletRequest request = (HttpServletRequest) message
|
||||
.get(AbstractHTTPDestination.HTTP_REQUEST);
|
||||
Map<String, List<String>> headers = (Map<String, List<String>>) message
|
||||
.get(Message.PROTOCOL_HEADERS);
|
||||
List<String> callingRegistryList = headers
|
||||
.get(RegistryUtil.CALLING_REGISTRY_SOAP_HEADER_NAME);
|
||||
if (request.getRequestURI().startsWith("/rest")) {
|
||||
logMessage.append("REST: ");
|
||||
} else {
|
||||
logMessage.append("WS: ");
|
||||
}
|
||||
logMessage.append("Request from [");
|
||||
if (CollectionUtil.isNullOrEmpty(callingRegistryList)) {
|
||||
logMessage.append(request.getRemoteAddr()).append("]: ")
|
||||
.append(request.getMethod()).append(" ")
|
||||
.append(request.getRequestURI());
|
||||
} else {
|
||||
logMessage.append(callingRegistryList.get(0)).append("]: ")
|
||||
.append(request.getMethod()).append(" ")
|
||||
.append(request.getRequestURI());
|
||||
}
|
||||
statusHandler.info(logMessage.toString());
|
||||
}
|
||||
}
|
|
@ -112,6 +112,7 @@ public class NotificationListenerImpl implements NotificationListener {
|
|||
|
||||
@Override
|
||||
public void onNotification(NotificationType notification) {
|
||||
|
||||
String clientBaseURL = EbxmlObjectUtil.getClientHost(wsContext);
|
||||
RegistryType sourceRegistry = registryDao
|
||||
.getRegistryByBaseURL(clientBaseURL);
|
||||
|
|
|
@ -154,7 +154,7 @@ public class RegistryNotificationManager {
|
|||
SubscriptionNotificationListeners notificationListeners,
|
||||
final List<ObjectRefType> objectsOfInterest)
|
||||
throws EbxmlRegistryException {
|
||||
int SIZE_LIMIT = 100;
|
||||
int SIZE_LIMIT = 10;
|
||||
|
||||
final List<NotificationListenerWrapper> listeners = notificationListeners.listeners;
|
||||
final SubscriptionType subscription = notificationListeners.subscription;
|
||||
|
@ -167,6 +167,7 @@ public class RegistryNotificationManager {
|
|||
int subListCount = eventsOfInterest.size() / SIZE_LIMIT;
|
||||
int lastListSize = eventsOfInterest.size() % SIZE_LIMIT;
|
||||
for (int i = 0; i < subListCount; i++) {
|
||||
|
||||
NotificationType notification = getNotification(
|
||||
subscription,
|
||||
listener.address,
|
||||
|
|
|
@ -46,7 +46,11 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.QueryType;
|
|||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SubscriptionType;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Node;
|
||||
|
@ -66,6 +70,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
import com.raytheon.uf.common.time.util.TimeUtil;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.SubscriptionDao;
|
||||
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
||||
import com.raytheon.uf.edex.registry.ebxml.init.RegistryInitializedListener;
|
||||
import com.raytheon.uf.edex.registry.ebxml.services.IRegistrySubscriptionManager;
|
||||
import com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImpl;
|
||||
import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
|
||||
|
@ -85,6 +90,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
|
|||
* 5/21/2013 2022 bphillip Made logging less verbose. added running boolean so subscriptions are not process on every single
|
||||
* event.
|
||||
* 6/4/2013 2022 bphillip Changed slot type of subscription last run time. Longs were being truncated when casting to ints
|
||||
* 9/5/2013 1538 bphillip Changed processing of each subscription to be in their own transaction. Subscriptions are now loaded on startup
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -93,7 +99,8 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
|
|||
@Transactional
|
||||
@Component
|
||||
public class RegistrySubscriptionManager implements
|
||||
IRegistrySubscriptionManager {
|
||||
IRegistrySubscriptionManager, ApplicationContextAware,
|
||||
RegistryInitializedListener {
|
||||
|
||||
/** The logger instance */
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
|
@ -162,6 +169,8 @@ public class RegistrySubscriptionManager implements
|
|||
|
||||
private final ConcurrentMap<String, SubscriptionNotificationListeners> listeners = new ConcurrentHashMap<String, SubscriptionNotificationListeners>();
|
||||
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
public RegistrySubscriptionManager() {
|
||||
|
||||
}
|
||||
|
@ -171,6 +180,22 @@ public class RegistrySubscriptionManager implements
|
|||
this.subscriptionProcessingEnabled = subscriptionProcessingEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void executeAfterRegistryInit() throws EbxmlRegistryException {
|
||||
for (SubscriptionType subscription : subscriptionDao.eagerLoadAll()) {
|
||||
statusHandler.info("Adding Subscription: " + subscription.getId());
|
||||
addSubscriptionListener(subscription);
|
||||
}
|
||||
}
|
||||
|
||||
private void addSubscriptionListener(SubscriptionType subscription)
|
||||
throws EbxmlRegistryException {
|
||||
final List<NotificationListenerWrapper> subscriptionListeners = getNotificationListenersForSubscription(subscription);
|
||||
listeners.put(subscription.getId(),
|
||||
new SubscriptionNotificationListeners(subscription,
|
||||
subscriptionListeners));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds subscription notification listeners for any subscriptions.
|
||||
*/
|
||||
|
@ -183,9 +208,8 @@ public class RegistrySubscriptionManager implements
|
|||
try {
|
||||
final SubscriptionType subscription = subscriptionDao
|
||||
.eagerGetById(id);
|
||||
final List<NotificationListenerWrapper> subscriptionListeners = getNotificationListenersForSubscription(subscription);
|
||||
listeners.put(id, new SubscriptionNotificationListeners(
|
||||
subscription, subscriptionListeners));
|
||||
addSubscriptionListener(subscription);
|
||||
|
||||
} catch (EbxmlRegistryException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
||||
e);
|
||||
|
@ -305,28 +329,19 @@ public class RegistrySubscriptionManager implements
|
|||
.values();
|
||||
|
||||
for (SubscriptionNotificationListeners subNotificationListener : subs) {
|
||||
SubscriptionType sub = subscriptionDao
|
||||
.getById(subNotificationListener.subscription.getId());
|
||||
try {
|
||||
if (subscriptionShouldRun(sub)) {
|
||||
try {
|
||||
processSubscription(subNotificationListener);
|
||||
} catch (Throwable e) {
|
||||
statusHandler.error(
|
||||
"Errors occurred while processing subscription ["
|
||||
+ sub.getId() + "]", e);
|
||||
}
|
||||
} else {
|
||||
statusHandler
|
||||
.info("Skipping subscription ["
|
||||
+ sub.getId()
|
||||
+ "]. Required notification frequency interval has not elapsed.");
|
||||
}
|
||||
} catch (EbxmlRegistryException e) {
|
||||
statusHandler.error(
|
||||
"Error processing subscription [" + sub.getId()
|
||||
+ "]", e);
|
||||
if (subscriptionDao
|
||||
.getById(subNotificationListener.subscription.getId()) == null) {
|
||||
statusHandler
|
||||
.info("Registry subscription removed. Cancelling processing of subscription: "
|
||||
+ subNotificationListener.subscription
|
||||
.getId());
|
||||
continue;
|
||||
}
|
||||
RegistrySubscriptionManager myself = (RegistrySubscriptionManager) applicationContext
|
||||
.getBean("RegistrySubscriptionManager");
|
||||
myself.processSubscription(subNotificationListener.subscription
|
||||
.getId());
|
||||
|
||||
}
|
||||
if (!subs.isEmpty()) {
|
||||
statusHandler.info("Registry subscriptions processed in "
|
||||
|
@ -422,20 +437,36 @@ public class RegistrySubscriptionManager implements
|
|||
* @throws MsgRegistryException
|
||||
* @throws EbxmlRegistryException
|
||||
*/
|
||||
private void processSubscription(
|
||||
final SubscriptionNotificationListeners subscriptionNotificationsListeners)
|
||||
throws MsgRegistryException, EbxmlRegistryException {
|
||||
SubscriptionType subscription = subscriptionDao
|
||||
.getById(subscriptionNotificationsListeners.subscription
|
||||
.getId());
|
||||
updateLastRunTime(subscription, TimeUtil.currentTimeMillis());
|
||||
statusHandler.info("Processing subscription [" + subscription.getId()
|
||||
+ "]...");
|
||||
|
||||
List<ObjectRefType> objectsOfInterest = getObjectsOfInterest(subscription);
|
||||
if (!objectsOfInterest.isEmpty()) {
|
||||
notificationManager.sendNotifications(
|
||||
subscriptionNotificationsListeners, objectsOfInterest);
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void processSubscription(final String subscriptionName) {
|
||||
try {
|
||||
SubscriptionType subscription = subscriptionDao
|
||||
.getById(subscriptionName);
|
||||
if (subscription == null) {
|
||||
statusHandler
|
||||
.info("Registry subscription removed. Cancelling processing of subscription: "
|
||||
+ subscriptionName);
|
||||
return;
|
||||
}
|
||||
if (!subscriptionShouldRun(subscription)) {
|
||||
statusHandler
|
||||
.info("Skipping subscription ["
|
||||
+ subscription.getId()
|
||||
+ "]. Required notification frequency interval has not elapsed.");
|
||||
return;
|
||||
}
|
||||
statusHandler.info("Processing subscription [" + subscriptionName
|
||||
+ "]...");
|
||||
List<ObjectRefType> objectsOfInterest = getObjectsOfInterest(subscription);
|
||||
if (!objectsOfInterest.isEmpty()) {
|
||||
notificationManager.sendNotifications(
|
||||
listeners.get(subscriptionName), objectsOfInterest);
|
||||
}
|
||||
updateLastRunTime(subscription, TimeUtil.currentTimeMillis());
|
||||
} catch (Throwable e) {
|
||||
statusHandler.error(
|
||||
"Errors occurred while processing subscription ["
|
||||
+ subscriptionName + "]", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -496,4 +527,11 @@ public class RegistrySubscriptionManager implements
|
|||
INotificationListenerFactory notificationListenerFactory) {
|
||||
this.notificationListenerFactory = notificationListenerFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext)
|
||||
throws BeansException {
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -98,6 +98,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
|
|||
* 3/18/2013 1802 bphillip Modified to use transaction boundaries and spring injection
|
||||
* Apr 24, 2013 1910 djohnson RegistryResponseStatus is now an enum.
|
||||
* Jun 24, 2013 2106 djohnson Transaction must already be open.
|
||||
* 9/5/2013 1538 bphillip Removed log message
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -548,8 +549,6 @@ public class QueryManagerImpl implements QueryManager {
|
|||
public QueryResponse executeQuery(ResponseOptionType responseOption,
|
||||
QueryType queryType, int depth, boolean matchOlderVersions,
|
||||
int maxResults, int startIndex) throws MsgRegistryException {
|
||||
statusHandler
|
||||
.info("Received internal request for query using specified values");
|
||||
QueryRequest queryRequest = EbxmlObjectUtil.queryObjectFactory
|
||||
.createQueryRequest();
|
||||
queryRequest.setResponseOption(responseOption);
|
||||
|
|
|
@ -56,6 +56,7 @@ import com.raytheon.uf.edex.registry.ebxml.util.EbxmlObjectUtil;
|
|||
* 3/18/2013 1802 bphillip Modified to use transaction boundaries and spring dao injection
|
||||
* 4/9/2013 1802 bphillip Refactor of registry query handling
|
||||
* Jun 24, 2013 2106 djohnson Requires a transaction to be open, will not create one.
|
||||
* 9/5/2013 1538 bphillip Removed log message
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -108,7 +109,6 @@ public abstract class AbstractEbxmlQuery implements IRegistryQuery {
|
|||
}
|
||||
|
||||
query(queryRequest.getQuery(), queryResponse, client);
|
||||
statusHandler.info("Query completed.");
|
||||
}
|
||||
|
||||
protected QueryParameters getParameterMap(Collection<SlotType> slots,
|
||||
|
|
|
@ -28,8 +28,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import com.raytheon.uf.common.registry.constants.RegistryAvailability;
|
||||
import com.raytheon.uf.common.registry.services.rest.IRegistryAvailableRestService;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.edex.registry.ebxml.dao.DbInit;
|
||||
|
||||
/**
|
||||
|
@ -43,6 +41,7 @@ import com.raytheon.uf.edex.registry.ebxml.dao.DbInit;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 5/21/2013 2022 bphillip Initial implementation
|
||||
* 9/5/2013 1538 bphillip Removed log message
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
|
@ -54,10 +53,6 @@ import com.raytheon.uf.edex.registry.ebxml.dao.DbInit;
|
|||
public class RegistryAvailableRestService implements
|
||||
IRegistryAvailableRestService {
|
||||
|
||||
/** The logger */
|
||||
private static final IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(RegistryAvailableRestService.class);
|
||||
|
||||
/**
|
||||
* Creates a new RegistryAvailableRestService
|
||||
*/
|
||||
|
@ -68,7 +63,6 @@ public class RegistryAvailableRestService implements
|
|||
@GET
|
||||
@Produces("text/plain")
|
||||
public String isRegistryAvailable() {
|
||||
statusHandler.info("Received request checking registry availability");
|
||||
if (DbInit.isDbInitialized()) {
|
||||
return RegistryAvailability.AVAILABLE;
|
||||
} else {
|
||||
|
|
|
@ -28,6 +28,7 @@ import java.util.Collections;
|
|||
import java.util.Enumeration;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
@ -47,11 +48,8 @@ import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType;
|
|||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType;
|
||||
import oasis.names.tc.ebxml.regrep.xsd.rim.v4.ValueType;
|
||||
|
||||
import org.apache.cxf.headers.Header;
|
||||
import org.apache.cxf.helpers.CastUtils;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import com.raytheon.uf.common.registry.ebxml.RegistryUtil;
|
||||
import com.raytheon.uf.common.util.CollectionUtil;
|
||||
import com.raytheon.uf.edex.registry.ebxml.exception.EbxmlRegistryException;
|
||||
|
||||
/**
|
||||
|
@ -372,28 +370,29 @@ public class EbxmlObjectUtil {
|
|||
if (mc == null) {
|
||||
return "INTERNAL";
|
||||
}
|
||||
String ip = null;
|
||||
List<Header> headerList = CastUtils.cast((List<?>) mc
|
||||
.get(Header.HEADER_LIST));
|
||||
for (Header header : headerList) {
|
||||
if (header.getObject() instanceof Element) {
|
||||
if (header.getName().getLocalPart()
|
||||
.equals(RegistryUtil.CALLING_REGISTRY_SOAP_HEADER_NAME)) {
|
||||
return ((Element) header.getObject()).getTextContent();
|
||||
}
|
||||
String clientHost = null;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, List<String>> requestHeaders = (Map<String, List<String>>) mc
|
||||
.get(MessageContext.HTTP_REQUEST_HEADERS);
|
||||
List<String> callingRegistryHeader = requestHeaders
|
||||
.get(RegistryUtil.CALLING_REGISTRY_SOAP_HEADER_NAME);
|
||||
if (!CollectionUtil.isNullOrEmpty(callingRegistryHeader)) {
|
||||
clientHost = callingRegistryHeader.get(0);
|
||||
} else {
|
||||
HttpServletRequest request = (HttpServletRequest) mc
|
||||
.get(MessageContext.SERVLET_REQUEST);
|
||||
|
||||
for (int i = 0; (i < 5)
|
||||
&& (clientHost == null || clientHost.isEmpty() || "unknown"
|
||||
.equalsIgnoreCase(clientHost)); i++) {
|
||||
clientHost = request.getHeader(HTTP_HEADERS.get(i));
|
||||
}
|
||||
if (clientHost == null || clientHost.length() == 0
|
||||
|| "unknown".equalsIgnoreCase(clientHost)) {
|
||||
clientHost = request.getRemoteAddr();
|
||||
}
|
||||
}
|
||||
HttpServletRequest request = (HttpServletRequest) mc
|
||||
.get(MessageContext.SERVLET_REQUEST);
|
||||
|
||||
for (int i = 0; (i < 5)
|
||||
&& (ip == null || ip.isEmpty() || "unknown"
|
||||
.equalsIgnoreCase(ip)); i++) {
|
||||
ip = request.getHeader(HTTP_HEADERS.get(i));
|
||||
}
|
||||
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
|
||||
ip = request.getRemoteAddr();
|
||||
}
|
||||
return ip;
|
||||
return clientHost;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,30 +11,23 @@
|
|||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
<display-name>Data Delivery Web Services</display-name>
|
||||
|
||||
<context-param>
|
||||
<param-name>webAppRootKey</param-name>
|
||||
<param-value>registryEbxml</param-value>
|
||||
</context-param>
|
||||
|
||||
|
||||
<context-param>
|
||||
<param-name>webAppRootKey</param-name>
|
||||
<param-value>registryEbxml</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>/webServiceBeans.xml</param-value>
|
||||
</context-param>
|
||||
|
||||
<listener>
|
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||
<listener-class>
|
||||
org.springframework.web.context.ContextLoaderListener
|
||||
</listener-class>
|
||||
</listener>
|
||||
|
||||
<filter>
|
||||
<filter-name>QoSFilter</filter-name>
|
||||
<filter-class>org.eclipse.jetty.servlets.QoSFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>maxRequests</param-name>
|
||||
<param-value>100</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
<filter>
|
||||
<filter-name>hibernateFilter</filter-name>
|
||||
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
|
||||
|
@ -51,12 +44,6 @@
|
|||
<filter-name>hibernateFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>QoSFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
|
||||
<servlet>
|
||||
<servlet-name>RegistryWebServiceServlet</servlet-name>
|
||||
|
|
|
@ -24,6 +24,9 @@
|
|||
<import resource="classpath:META-INF/cxf/cxf.xml" />
|
||||
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
|
||||
|
||||
<bean id="webServiceInInterceptor"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.services.RegistryServiceInInterceptor" />
|
||||
|
||||
<bean id="QueryServiceWrapper"
|
||||
class="com.raytheon.uf.edex.registry.ebxml.services.query.QueryManagerImplWrapper">
|
||||
<constructor-arg ref="queryServiceImpl" />
|
||||
|
@ -48,6 +51,9 @@
|
|||
<jaxws:server id="RegistryRequest"
|
||||
serviceClass="com.raytheon.uf.common.registry.IRegistryRequestService"
|
||||
address="/registryRequest">
|
||||
<jaxws:inInterceptors>
|
||||
<ref bean="webServiceInInterceptor" />
|
||||
</jaxws:inInterceptors>
|
||||
<jaxws:serviceBean>
|
||||
<ref bean="routeWrapper" />
|
||||
</jaxws:serviceBean>
|
||||
|
@ -55,30 +61,45 @@
|
|||
|
||||
<!-- SOAP Service definitions -->
|
||||
<jaxws:server id="QueryService" address="/queryManager">
|
||||
<jaxws:inInterceptors>
|
||||
<ref bean="webServiceInInterceptor" />
|
||||
</jaxws:inInterceptors>
|
||||
<jaxws:serviceBean>
|
||||
<ref bean="QueryServiceWrapper" />
|
||||
</jaxws:serviceBean>
|
||||
</jaxws:server>
|
||||
|
||||
<jaxws:server id="NotificationListenerService" address="/notificationListener">
|
||||
<jaxws:inInterceptors>
|
||||
<ref bean="webServiceInInterceptor" />
|
||||
</jaxws:inInterceptors>
|
||||
<jaxws:serviceBean>
|
||||
<ref bean="NotificationListenerServiceWrapper" />
|
||||
</jaxws:serviceBean>
|
||||
</jaxws:server>
|
||||
|
||||
<jaxws:server id="LifecycleManagerService" address="/lifecycleManager">
|
||||
<jaxws:inInterceptors>
|
||||
<ref bean="webServiceInInterceptor" />
|
||||
</jaxws:inInterceptors>
|
||||
<jaxws:serviceBean>
|
||||
<ref bean="LifecycleManagerServiceWrapper" />
|
||||
</jaxws:serviceBean>
|
||||
</jaxws:server>
|
||||
|
||||
<jaxws:server id="ValidatorService" address="/validator">
|
||||
<jaxws:inInterceptors>
|
||||
<ref bean="webServiceInInterceptor" />
|
||||
</jaxws:inInterceptors>
|
||||
<jaxws:serviceBean>
|
||||
<ref bean="ValidatorServiceWrapper" />
|
||||
</jaxws:serviceBean>
|
||||
</jaxws:server>
|
||||
|
||||
<jaxws:server id="CatalogerService" address="/cataloger">
|
||||
<jaxws:inInterceptors>
|
||||
<ref bean="webServiceInInterceptor" />
|
||||
</jaxws:inInterceptors>
|
||||
<jaxws:serviceBean>
|
||||
<ref bean="catalogerServiceImpl" />
|
||||
</jaxws:serviceBean>
|
||||
|
@ -87,8 +108,11 @@
|
|||
|
||||
<!-- REST Service Definitions -->
|
||||
<jaxrs:server id="registryRestServices" address="/">
|
||||
<jaxrs:inInterceptors>
|
||||
<ref bean="webServiceInInterceptor" />
|
||||
</jaxrs:inInterceptors>
|
||||
<jaxrs:serviceBeans>
|
||||
<ref bean="registryDataAccessService"/>
|
||||
<ref bean="registryDataAccessService" />
|
||||
<ref bean="registryAvailabilityService" />
|
||||
<ref bean="registryObjectsRestService" />
|
||||
<ref bean="repositoryObjectsRestService" />
|
||||
|
|
|
@ -22,7 +22,7 @@ Require-Bundle: org.geotools;bundle-version="2.6.4",
|
|||
javax.measure;bundle-version="1.0.0",
|
||||
com.sun.xml.bind;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.spatial;bundle-version="1.0.0",
|
||||
org.w3.XMLSchema;bundle-version="1.0.0",
|
||||
org.w3.xmlschema;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.edex.plugin.dataset.urn;bundle-version="1.0.0",
|
||||
org.apache.commons.collections;bundle-version="3.2.0",
|
||||
|
|
|
@ -151,5 +151,6 @@
|
|||
<classpathentry kind="lib" path="lib/swt_gtk_linux_x86.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.common.wxmath"/>
|
||||
<classpathentry kind="lib" path="lib/org.eclipse.jface_3.8.0.v20120912-135020.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/org.apache.commons.configuration"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -21,6 +21,9 @@ package com.raytheon.uf.common.comm;
|
|||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -125,7 +128,10 @@ public class HttpProxiedValidClientCredentialsTest {
|
|||
|
||||
MockWfsRequestBuilder wrb = new MockWfsRequestBuilder(getRetrievalAttribute());
|
||||
String request = wrb.getRequest();
|
||||
//String request = getRequest("/home/dhladky/Desktop/good.xml");
|
||||
System.out.println(request);
|
||||
URI uri = new URI(conn.getUrl());
|
||||
//URI uri = new URI("http://stormy.oma.us.ray.com:8085/wfs");
|
||||
HttpPost post = new HttpPost(uri);
|
||||
System.out.println("HTTPS URL: "+conn.getUrl());
|
||||
|
||||
|
@ -235,8 +241,8 @@ public class HttpProxiedValidClientCredentialsTest {
|
|||
|
||||
private Time getTime() {
|
||||
|
||||
String startDateString = "2013-07-29T17:00:00.000";
|
||||
String endDateString = "2013-07-29T18:00:00.000";
|
||||
String startDateString = "2013-08-30T12:40:00.000";
|
||||
String endDateString = "2013-08-30T14:15:00.000";
|
||||
|
||||
Time time = new Time();
|
||||
time.setFormat("yyyy-MM-dd'T'HH:mm:ss.SSS");
|
||||
|
@ -247,4 +253,39 @@ public class HttpProxiedValidClientCredentialsTest {
|
|||
|
||||
return time;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Used in cases where you have XML you want to read in and test
|
||||
* @param path
|
||||
* @return
|
||||
*/
|
||||
private String getRequest(String path) {
|
||||
|
||||
StringBuffer fileData = new StringBuffer(1000);
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
|
||||
reader = new BufferedReader(new FileReader(path));
|
||||
char[] buf = new char[1024];
|
||||
int numRead = 0;
|
||||
while ((numRead = reader.read(buf)) != -1) {
|
||||
String readData = String.valueOf(buf, 0, numRead);
|
||||
fileData.append(readData);
|
||||
buf = new char[1024];
|
||||
}
|
||||
reader.close();
|
||||
} catch (Exception e) {
|
||||
System.out.println("Didn't read file correctly!" + e);
|
||||
} finally {
|
||||
if (reader != null) {
|
||||
try {
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return fileData.toString();
|
||||
}
|
||||
}
|
|
@ -42,6 +42,7 @@ import com.raytheon.uf.common.registry.handler.RegistryHandlerException;
|
|||
* Feb 20, 2013 1543 djohnson Implement route filtering.
|
||||
* May 15, 2013 1040 mpduff Office Id now a set.
|
||||
* May 28, 2013 1650 djohnson Add getByNames.
|
||||
* Sep 11, 2013 2352 mpduff Add siteId to getSubscribedToDataSetNames method.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -116,11 +117,13 @@ public class BaseMemorySubscriptionHandler<T extends Subscription> extends
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getSubscribedToDataSetNames()
|
||||
public Set<String> getSubscribedToDataSetNames(String siteId)
|
||||
throws RegistryHandlerException {
|
||||
Set<String> retVal = new HashSet<String>();
|
||||
for (T obj : getAll()) {
|
||||
retVal.add(obj.getDataSetName());
|
||||
if (matches(siteId, obj.getOfficeIDs())) {
|
||||
retVal.add(obj.getDataSetName());
|
||||
}
|
||||
}
|
||||
|
||||
return retVal;
|
||||
|
|
|
@ -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.edex.core.props;
|
||||
|
||||
import org.apache.commons.configuration.Configuration;
|
||||
|
||||
/**
|
||||
* Inject attribute names, attribute values, and property values into the
|
||||
* PropertiesFactory environment configuration.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Sep 06, 2013 2344 bgonzale Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bgonzale
|
||||
* @version 1.0
|
||||
*/
|
||||
public class EnvAttributePropertyInjector {
|
||||
|
||||
public static void injectAttributeProperty(String attributeName,
|
||||
String attributeValue, String propertyValue) {
|
||||
Configuration attrNamesConfig = PropertiesFactory.getInstance()
|
||||
.getEnvProperties().theAttrNamesConfiguration;
|
||||
Configuration envConfig = PropertiesFactory.getInstance()
|
||||
.getEnvProperties().theEnvConfiguration;
|
||||
|
||||
attrNamesConfig.setProperty(attributeName, attributeValue);
|
||||
envConfig.setProperty(attributeValue, propertyValue);
|
||||
}
|
||||
}
|
|
@ -23,11 +23,13 @@ import static org.mockito.Mockito.mock;
|
|||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.raytheon.uf.common.datadelivery.registry.SiteSubscriptionFixture;
|
||||
import com.raytheon.uf.common.datadelivery.registry.Subscription;
|
||||
import com.raytheon.uf.edex.core.props.EnvAttributePropertyInjector;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.IBandwidthManager;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.dao.IBandwidthDbInit;
|
||||
import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager;
|
||||
|
@ -44,6 +46,7 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager;
|
|||
* Feb 18, 2013 1543 djohnson Initial creation
|
||||
* Apr 18, 2013 1914 djohnson Fix broken test.
|
||||
* Jun 25, 2013 2106 djohnson init() now takes a {@link RetrievalManager}.
|
||||
* Sep 06, 2013 2344 bgonzale Added property injection of valid test value.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -52,11 +55,19 @@ import com.raytheon.uf.edex.datadelivery.bandwidth.retrieval.RetrievalManager;
|
|||
*/
|
||||
public class HibernateBandwidthInitializerTest {
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
System.setProperty("edex.home", "../edexOsgi/build.edex/esb/");
|
||||
EnvAttributePropertyInjector.injectAttributeProperty("SITENAME",
|
||||
"sitename", "OAX");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSchedulesAllSubscriptionReturnedFromIFindSubscriptions()
|
||||
throws Exception {
|
||||
final Subscription subscription = SiteSubscriptionFixture.INSTANCE.get();
|
||||
|
||||
subscription.addOfficeID("OAX");
|
||||
IFindSubscriptionsForScheduling strategy = mock(IFindSubscriptionsForScheduling.class);
|
||||
when(strategy.findSubscriptionsToSchedule()).thenReturn(
|
||||
Sets.newHashSet(subscription));
|
||||
|
|
Loading…
Add table
Reference in a new issue