diff --git a/cave/com.raytheon.uf.viz.archive.feature/feature.xml b/cave/com.raytheon.uf.viz.archive.feature/feature.xml index 9705fea76d..37b1cd68f2 100644 --- a/cave/com.raytheon.uf.viz.archive.feature/feature.xml +++ b/cave/com.raytheon.uf.viz.archive.feature/feature.xml @@ -37,14 +37,13 @@ unpack="false"/> + version="0.0.0"/> * @@ -25,8 +53,14 @@ import com.raytheon.uf.viz.archive.ui.CaseCreationDlg; * @version 1.0 */ public class ArchiveCaseCreationDialogAction extends AbstractHandler { + private final IUFStatusHandler statusHandler = UFStatus + .getHandler(ArchiveCaseCreationDialogAction.class); + private CaseCreationDlg dialog; + /** Case Administration permission */ + private final String PERMISSION = "archive.casecreation"; + /* * (non-Javadoc) * @@ -36,16 +70,44 @@ public class ArchiveCaseCreationDialogAction extends AbstractHandler { */ @Override public Object execute(ExecutionEvent event) throws ExecutionException { - if (dialog == null || dialog.isDisposed()) { - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() - .getShell(); - dialog = new CaseCreationDlg(shell); - dialog.open(); - } else { - dialog.bringToTop(); + if (isAuthorized()) { + if (dialog == null || dialog.isDisposed()) { + Shell shell = PlatformUI.getWorkbench() + .getActiveWorkbenchWindow().getShell(); + dialog = new CaseCreationDlg(shell); + dialog.open(); + } else { + dialog.bringToTop(); + } } return null; } + /** + * Is user authorized? + * + * @return true if authorized + */ + private boolean isAuthorized() { + IUser user = UserController.getUserObject(); + String msg = user.uniqueId() + + " does not have permission to access archive case creation dialog."; + ArchiveAdminAuthRequest request = new ArchiveAdminAuthRequest(); + request.setRoleId(PERMISSION); + request.setNotAuthorizedMessage(msg); + request.setUser(user); + + try { + Object o = ThriftClient.sendPrivilegedRequest(request); + if (o instanceof ArchiveAdminAuthRequest) { + ArchiveAdminAuthRequest r = (ArchiveAdminAuthRequest) o; + return r.isAuthorized(); + } + } catch (VizException e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); + } + + return false; + } } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ArchiveRetentionDialogAction.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ArchiveRetentionDialogAction.java index d9a6fa1d60..67d3da0d53 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ArchiveRetentionDialogAction.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ArchiveRetentionDialogAction.java @@ -1,3 +1,22 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ package com.raytheon.uf.viz.archive; import org.eclipse.core.commands.AbstractHandler; @@ -6,7 +25,15 @@ import org.eclipse.core.commands.ExecutionException; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.PlatformUI; +import com.raytheon.uf.common.archive.request.ArchiveAdminAuthRequest; +import com.raytheon.uf.common.auth.user.IUser; +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.archive.ui.ArchiveRetentionDlg; +import com.raytheon.uf.viz.core.auth.UserController; +import com.raytheon.uf.viz.core.exception.VizException; +import com.raytheon.uf.viz.core.requests.ThriftClient; /** * Action to display the Archive Retention dialog. @@ -18,6 +45,7 @@ import com.raytheon.uf.viz.archive.ui.ArchiveRetentionDlg; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 16, 2013 1966 rferrel Initial creation + * Oct 02, 2013 2326 rferrel Check for administration authorization. * * * @@ -25,8 +53,14 @@ import com.raytheon.uf.viz.archive.ui.ArchiveRetentionDlg; * @version 1.0 */ public class ArchiveRetentionDialogAction extends AbstractHandler { + private final IUFStatusHandler statusHandler = UFStatus + .getHandler(ArchiveRetentionDialogAction.class); + private ArchiveRetentionDlg dialog; + /** Retention Administration permission */ + private final String PERMISSION = "archive.retention"; + /* * (non-Javadoc) * @@ -36,15 +70,44 @@ public class ArchiveRetentionDialogAction extends AbstractHandler { */ @Override public Object execute(ExecutionEvent event) throws ExecutionException { - if (dialog == null || dialog.isDisposed()) { - Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow() - .getShell(); - dialog = new ArchiveRetentionDlg(shell); - dialog.open(); - } else { - dialog.bringToTop(); + if (isAuthorized()) { + if (dialog == null || dialog.isDisposed()) { + Shell shell = PlatformUI.getWorkbench() + .getActiveWorkbenchWindow().getShell(); + dialog = new ArchiveRetentionDlg(shell); + dialog.open(); + } else { + dialog.bringToTop(); + } } return null; } + + /** + * Is user authorized? + * + * @return true if authorized + */ + private boolean isAuthorized() { + IUser user = UserController.getUserObject(); + String msg = user.uniqueId() + + " does not have permission to access archive retention dialog."; + ArchiveAdminAuthRequest request = new ArchiveAdminAuthRequest(); + request.setRoleId(PERMISSION); + request.setNotAuthorizedMessage(msg); + request.setUser(user); + + try { + Object o = ThriftClient.sendPrivilegedRequest(request); + if (o instanceof ArchiveAdminAuthRequest) { + ArchiveAdminAuthRequest r = (ArchiveAdminAuthRequest) o; + return r.isAuthorized(); + } + } catch (VizException e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); + } + + return false; + } } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/ArchiveInfo.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/ArchiveInfo.java index 6391f7a2d9..78eae24d98 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/ArchiveInfo.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/ArchiveInfo.java @@ -19,9 +19,9 @@ **/ package com.raytheon.uf.viz.archive.data; -import java.util.HashMap; import java.util.Map; import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; /** * This class maintains the state of the archive selection so it can be restored @@ -42,7 +42,7 @@ import java.util.Set; */ public class ArchiveInfo { - private final Map categoryInfoMap = new HashMap(); + private final Map categoryInfoMap = new ConcurrentHashMap(); public void add(CategoryInfo categoryInfo) { categoryInfoMap.put(categoryInfo.getCategoryName(), categoryInfo); diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/CategoryInfo.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/CategoryInfo.java index cc9b64735b..2a9ffc05ec 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/CategoryInfo.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/CategoryInfo.java @@ -19,6 +19,8 @@ **/ package com.raytheon.uf.viz.archive.data; +import java.util.ArrayList; +import java.util.Collections; import java.util.List; import com.raytheon.uf.common.archive.config.DisplayData; @@ -34,6 +36,7 @@ import com.raytheon.uf.common.archive.config.DisplayData; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 24, 2013 1966 rferrel Initial creation + * Aug 14, 2013 2220 rferrel Make sure displayDataList is never null. * * * @@ -49,31 +52,57 @@ public class CategoryInfo { private final String categoryName; /** List of display items for the category. */ - private final List displayDataList; + private List displayDataList; /** - * Contructor. + * Constructor. * * @param archiveName * @param categoryName * @param displayInfoList */ public CategoryInfo(String archiveName, String categoryName, - List displayInfoList) { + List displayDataList) { this.archiveName = archiveName; this.categoryName = categoryName; - this.displayDataList = displayInfoList; + if (displayDataList == null) { + this.displayDataList = new ArrayList(0); + } else { + setDisplayDataList(displayDataList); + } } + /** + * Change the display data list. + * + * @param displayDataList + */ + public void setDisplayDataList(List displayDataList) { + this.displayDataList = new ArrayList( + displayDataList.size()); + this.displayDataList.addAll(displayDataList); + } + + /** + * @return archiveName + */ public String getArchiveName() { return archiveName; } + /** + * @return categoryName + */ public String getCategoryName() { return categoryName; } + /** + * Get unmodifiable display data list. + * + * @return displayDataList + */ public List getDisplayDataList() { - return displayDataList; + return Collections.unmodifiableList(displayDataList); } } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/IRetentionHour.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/IRetentionHour.java new file mode 100644 index 0000000000..a393f5a335 --- /dev/null +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/IRetentionHour.java @@ -0,0 +1,47 @@ +/** + * 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.viz.archive.data; + +/** + * Interface to adjusting values based on the retention hour value found in a + * selection configuration. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Aug 13, 2013 2220       rferrel     Initial creation
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ + +public interface IRetentionHour { + /** + * Adjust start/end based on the value found in selection configuration. + * + * @param startRetentionHours + */ + public void setRetentionTimes(long startRetentionHours); +} diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/IUpdateListener.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/IUpdateListener.java index 1916b3c928..29e0cdaa0b 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/IUpdateListener.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/IUpdateListener.java @@ -21,6 +21,8 @@ package com.raytheon.uf.viz.archive.data; import java.util.List; +import com.raytheon.uf.common.archive.config.DisplayData; + /** * A listener to update file/directory information. * @@ -31,6 +33,7 @@ import java.util.List; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 16, 2013 1966 rferrel Initial creation + * Jul 29, 2012 #2220 rferrel Change to get all data sizes only one time. * * * @@ -43,5 +46,5 @@ public interface IUpdateListener { * * @param dirInfos */ - public void update(List request); + public void update(List request); } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJob.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJob.java index 3e4b249ead..c4c6bfdb87 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJob.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJob.java @@ -3,8 +3,18 @@ package com.raytheon.uf.viz.archive.data; import java.io.File; import java.util.ArrayList; import java.util.Calendar; +import java.util.Comparator; +import java.util.Iterator; +import java.util.LinkedList; import java.util.List; -import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.Map; +import java.util.PriorityQueue; +import java.util.Set; +import java.util.Timer; +import java.util.TimerTask; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.PriorityBlockingQueue; import java.util.concurrent.atomic.AtomicBoolean; import org.eclipse.core.runtime.IProgressMonitor; @@ -13,8 +23,16 @@ import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; import com.raytheon.uf.common.archive.config.ArchiveConfigManager; +import com.raytheon.uf.common.archive.config.ArchiveConstants; +import com.raytheon.uf.common.archive.config.ArchiveConstants.Type; import com.raytheon.uf.common.archive.config.DisplayData; -import com.raytheon.uf.common.util.FileUtil; +import com.raytheon.uf.common.archive.config.SelectConfig; +import com.raytheon.uf.common.archive.config.select.ArchiveSelect; +import com.raytheon.uf.common.archive.config.select.CategorySelect; +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.time.util.TimeUtil; /** * Job to determine the size for a directory and its contents on a non-UI @@ -27,6 +45,9 @@ import com.raytheon.uf.common.util.FileUtil; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jun 13, 2013 rferrel Initial creation + * Jul 24, 2013 #2220 rferrel Change to get all data sizes only one time. + * Aug 02, 2013 #2224 rferrel Changes for new configuration files. + * Aug 06, 2013 #2222 rferrel Changes to display all selected data. * * * @@ -34,26 +55,139 @@ import com.raytheon.uf.common.util.FileUtil; * @version 1.0 */ public class SizeJob extends Job { - - /** The queue for requested sizes. */ - private final ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue(); + private final IUFStatusHandler statusHandler = UFStatus + .getHandler(SizeJob.class); /** - * Pending selected entries that still need to have the sizes determined. + * The private variable from PriorityQueue. */ - private final ConcurrentLinkedQueue selectedQueue = new ConcurrentLinkedQueue(); + private final int DEFAULT_INITIAL_CAPACITY = 11; /** - * Indicates the job should stop computing the size of the current - * non-selected entry. + * Mapping of display data by archive and category names. */ - private final AtomicBoolean stopComputeSize = new AtomicBoolean(false); + private final Map archiveInfoMap = new ConcurrentHashMap(); /** - * The listeners to inform when job is done with an entry. + * Current archive name needing sizes. + */ + private String displayArchive; + + /** + * Current category name needing sizes. + */ + private String displayCategory; + + /** + * Set to true when all sizes are computed for the current display + * archive/category list. + */ + private final AtomicBoolean displaySizesComputed = new AtomicBoolean(false); + + /** + * Queue of display data needing sizes. + */ + private final PriorityBlockingQueue sizeQueue = new PriorityBlockingQueue( + DEFAULT_INITIAL_CAPACITY, DisplayData.PRIORITY_ORDER); + + /** + * Data to send to listeners. + */ + private final LinkedBlockingQueue displayQueue = new LinkedBlockingQueue(); + + /** + * Current list of visible data. + */ + private List visibleList = new ArrayList(0); + + /** + * Set to true when running job should stop and never be rescheduled. + */ + private final AtomicBoolean shutdown = new AtomicBoolean(false); + + /** + * The listeners to inform when job is done with a request. */ private final List listeners = new ArrayList(); + /** + * The display data whose size is being computed. + */ + private DisplayData currentDisplayData; + + /** + * Method to call when loading a new selection for retention/case creation + * to update times. + */ + private IRetentionHour iRetentionHour; + + /** + * Current start time. + */ + private Calendar startCal; + + /** + * Current end time. + */ + private Calendar endCal; + + /** + * Timer to periodically update the GUI display computed sizes. + */ + private Timer displayTimer; + + /** + * Flag to shutdown the display timer. + */ + private final AtomicBoolean shutdownDisplayTimer = new AtomicBoolean(false); + + /** + * Frequency for performing peek while computing sizes. + */ + private final int peekFrequency = 50; + + /** + * Counter to reduce the number of times a peek is performed while computing + * sizes. + */ + private int peekCnt; + + /** + * Flag to stop computing sizes; only accessed by a single thread. + */ + private boolean stopComputeSize; + + /** + * Priority queue for getting display data for an archive/category. + */ + // Do not use a PriorityBlockingQueue since the load select and change + // display methods need to be notified when the display data is available. + private final PriorityQueue missingDataQueue = new PriorityQueue( + DEFAULT_INITIAL_CAPACITY, new Comparator() { + + @Override + public int compare(MissingData o1, MissingData o2) { + if (o1.visiable != o2.visiable) { + return o1.visiable ? -1 : +1; + } + if (o1.isSelected() != o2.isSelected()) { + return o1.isSelected() ? -1 : +1; + } + + int result = o1.archive.compareToIgnoreCase(o2.archive); + + if (result == 0) { + result = o1.category.compareToIgnoreCase(o2.category); + } + return result; + } + }); + + /** + * Job for processing the missing data queue. + */ + private final MissingDataJob missingDataJob = new MissingDataJob(); + /** * Constructor. */ @@ -81,13 +215,39 @@ public class SizeJob extends Job { } /** - * Add entry to queue and if pending selected entries add them to the queue - * with same start/end times. + * Start and/or end time has changed so all sizes need to be recomputed. * - * @param fileInfo + * @param startCal + * @param endCal */ - public void queue(SizeJobRequest fileInfo) { - queue.add(fileInfo); + public void resetTime(Calendar startCal, Calendar endCal) { + this.startCal = startCal; + this.endCal = endCal; + recomputeSize(); + } + + /** + * Force getting the sizes for all data in the archive Information map. + */ + public void recomputeSize() { + clearQueue(); + for (ArchiveInfo archiveInfo : archiveInfoMap.values()) { + for (String categoryName : archiveInfo.getCategoryNames()) { + CategoryInfo categoryInfo = archiveInfo.get(categoryName); + for (DisplayData displayData : categoryInfo + .getDisplayDataList()) { + displayData.setSize(DisplayData.UNKNOWN_SIZE); + sizeQueue.add(displayData); + + if (shutdown.get()) { + return; + } + } + } + } + + // Forces update of current display. + displaySizesComputed.set(false); if (getState() == Job.NONE) { schedule(); @@ -95,43 +255,384 @@ public class SizeJob extends Job { } /** - * Clear queue but save selected entries still needing sizes. + * Add entry to the archive information map. + * + * @param archiveName + * @param archiveInfo */ - public void clearQueue() { - List pending = new ArrayList(); + public void put(String archiveName, ArchiveInfo archiveInfo) { + archiveInfoMap.put(archiveName, archiveInfo); + } - // Drain queue queue.removeAll() doesn't work. - while (!queue.isEmpty()) { - pending.add(queue.remove()); + /** + * Get an entry from the archive information map. + * + * @param archiveName + * @return + */ + public ArchiveInfo get(String archiveName) { + return archiveInfoMap.get(archiveName); + } + + /** + * @return archiveNames + */ + public Set getArchiveNames() { + return archiveInfoMap.keySet(); + } + + /** + * Check all displayData selection state so only the data in selections are + * set. + * + * @param selections + */ + public void loadSelect(String selectName, ArchiveConstants.Type type) { + ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); + String fileName = ArchiveConstants.selectFileName(type, selectName); + SelectConfig selections = manager.loadSelection(fileName); + if (selections == null) { + selections = new SelectConfig(); + selections.setName(ArchiveConstants.defaultSelectName); } + iRetentionHour.setRetentionTimes(selections.getStarRetentionHours()); - if (getState() != NONE) { - cancel(); - } - - // Save selected items that do not have sizes. - for (SizeJobRequest dirInfo : pending) { - DisplayData displayData = dirInfo.getDisplayData(); - - if (displayData.isSelected() && displayData.getSize() < 0L) { - if (!selectedQueue.contains(displayData)) { - selectedQueue.add(displayData); + for (String archiveName : getArchiveNames()) { + ArchiveInfo archiveInfo = get(archiveName); + for (String categoryName : archiveInfo.getCategoryNames()) { + List selectionsList = selections.getSelectedList( + archiveName, categoryName); + MissingData missingData = removeMissingData(archiveName, + categoryName); + if (missingData != null) { + missingData.setSelectedList(selectionsList); + addMissingData(missingData); + } else { + CategoryInfo categoryInfo = archiveInfo.get(categoryName); + for (DisplayData displayData : categoryInfo + .getDisplayDataList()) { + String displayLabel = displayData.getDisplayLabel(); + boolean selected = selectionsList + .contains(displayLabel); + if (selected != displayData.isSelected()) { + setSelect(displayData, selected); + } + } } } } } /** - * Requeue pending entries. + * Get list of all selected data. * - * @param startCal - * @param endCal + * @return selected */ - public void requeueSelected(Calendar startCal, Calendar endCal) { - if (!selectedQueue.isEmpty()) { - DisplayData displayData = selectedQueue.remove(); - queue(new SizeJobRequest(displayData, startCal, endCal)); + public List getSelectAll() { + synchronized (missingDataQueue) { + while (!missingDataQueue.isEmpty()) { + if (missingDataJob.currentMissingData == null + || missingDataJob.currentMissingData.isSelected()) { + missingDataQueueWait(); + } else { + break; + } + } } + List selected = new LinkedList(); + for (ArchiveInfo archiveInfo : archiveInfoMap.values()) { + for (String categoryName : archiveInfo.getCategoryNames()) { + CategoryInfo categoryInfo = archiveInfo.get(categoryName); + for (DisplayData displayData : categoryInfo + .getDisplayDataList()) { + if (displayData.isSelected()) { + selected.add(displayData); + } + } + } + } + return selected; + } + + /** + * Save selections to the desired file. + * + * @param selectName + * @param type + * @param startRetentionMS + * @return + */ + public String saveSelect(String selectName, ArchiveConstants.Type type, + long startRetentionMS) { + String errorMsg = null; + SelectConfig selections = new SelectConfig(); + selections.setName(selectName); + if (type == Type.Case) { + long startRetentionHours = startRetentionMS + / TimeUtil.MILLIS_PER_HOUR; + selections.setStarRetentionHours(startRetentionHours); + } + for (String archiveName : getArchiveNames()) { + ArchiveInfo archiveInfo = get(archiveName); + ArchiveSelect archiveSelect = new ArchiveSelect(); + archiveSelect.setName(archiveName); + for (String categoryName : archiveInfo.getCategoryNames()) { + CategoryInfo categoryInfo = archiveInfo.get(categoryName); + CategorySelect categorySelect = new CategorySelect(); + categorySelect.setName(categoryName); + for (DisplayData displayData : categoryInfo + .getDisplayDataList()) { + if (displayData.isSelected()) { + categorySelect.add(displayData.getDisplayLabel()); + } + } + + if (!categorySelect.isEmpty()) { + archiveSelect.add(categorySelect); + } + } + if (!archiveSelect.isEmpty()) { + selections.add(archiveSelect); + } + } + String fileName = ArchiveConstants.selectFileName(type, selectName); + + try { + ArchiveConfigManager.getInstance().saveSelections(selections, + fileName); + } catch (Exception e) { + errorMsg = "Unable to save file: " + fileName; + statusHandler.handle(Priority.ERROR, errorMsg, e); + } + return errorMsg; + } + + /** + * Change the selection state and reset priority. + * + * @param displayData + * @param state + */ + public void setSelect(DisplayData displayData, boolean state) { + if (displayData.isSelected() != state) { + if (sizeQueue.remove(displayData)) { + displayData.setSelected(state); + sizeQueue.add(displayData); + } else { + displayData.setSelected(state); + } + } + } + + /** + * Change visibility state and reset priority. + * + * @param displayData + * @param state + */ + private void setVisible(DisplayData displayData, boolean state) { + if (displayData.isVisible() != state) { + if (sizeQueue.remove(displayData)) { + displayData.setVisible(state); + sizeQueue.add(displayData); + } else { + displayData.setVisible(state); + } + } + } + + /** + * Change the archive/category display. + * + * @param archiveName + * @param categoryName + * @return displayData when display needs to change otherwise null + */ + public List changeDisplay(String archiveName, + String categoryName) { + List displayDatas = null; + if (!archiveName.equals(displayArchive) + || !categoryName.equals(displayCategory)) { + MissingData missingData = removeMissingData(archiveName, + categoryName); + if (missingData != null) { + missingData.setVisiable(true); + synchronized (missingDataQueue) { + addMissingData(missingData); + while (missingDataQueue.contains(missingData)) { + missingDataQueueWait(); + } + } + } + displayDatas = archiveInfoMap.get(archiveName).get(categoryName) + .getDisplayDataList(); + displayArchive = archiveName; + displayCategory = categoryName; + changeDisplay(displayDatas); + } + return displayDatas; + } + + /** + * Change to display all selected data.. + * + * @return displayhData when display needs to change otherwise null. + */ + public List changeDisplayAll() { + List selectedData = null; + if (displayArchive != null) { + displayArchive = null; + displayCategory = null; + selectedData = getSelectAll(); + changeDisplay(selectedData); + } + return selectedData; + } + + public String initData(ArchiveConstants.Type type, String selectName, + String displayArchive, String displayCategory, + IRetentionHour iRetentionHour) { + this.iRetentionHour = iRetentionHour; + ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); + String fileName = ArchiveConstants.selectFileName(type, selectName); + SelectConfig selections = manager.loadSelection(fileName); + if (selections == null) { + selections = new SelectConfig(); + selections.setName(ArchiveConstants.defaultSelectName); + } + iRetentionHour.setRetentionTimes(selections.getStarRetentionHours()); + + missingDataQueue.clear(); + + visibleList = manager.getDisplayData(displayArchive, displayCategory, + false); + List selectedList = selections.getSelectedList(displayArchive, + displayCategory); + for (DisplayData displayData : visibleList) { + displayData.setSelected(selectedList.contains(displayData + .getDisplayLabel())); + } + + for (String archiveName : manager.getArchiveDataNamesList()) { + ArchiveInfo archiveInfo = new ArchiveInfo(); + String[] categoryNames = manager.getCategoryNames(manager + .getArchive(archiveName)); + for (String categoryName : categoryNames) { + CategoryInfo categoryInfo = new CategoryInfo(archiveName, + categoryName, null); + archiveInfo.add(categoryInfo); + if (archiveName.equals(displayArchive) + && categoryName.equals(displayCategory)) { + categoryInfo.setDisplayDataList(visibleList); + if (!visibleList.isEmpty()) { + schedule(); + } + } else { + selectedList = selections.getSelectedList(archiveName, + categoryName); + MissingData missingData = new MissingData(archiveName, + categoryName, selectedList); + missingDataQueue.add(missingData); + } + } + put(archiveName, archiveInfo); + } + + missingDataJob.schedule(); + + return selections.getName(); + } + + /** + * Find and remove the missing data from the missing data queue. + * + * @param archiveName + * @param categoryName + * @return missingData or null if not on the missing data queue + */ + private MissingData removeMissingData(String archiveName, + String categoryName) { + MissingData missingData = null; + synchronized (missingDataQueue) { + if (missingDataJob.currentMissingData != null + && archiveName + .equals(missingDataJob.currentMissingData.archive) + && categoryName + .equals(missingDataJob.currentMissingData.category)) { + // Finish the process of getting the data. + missingDataQueueWait(); + } else if (!missingDataQueue.isEmpty()) { + Iterator iterator = missingDataQueue.iterator(); + while (iterator.hasNext()) { + MissingData md = iterator.next(); + if (md.archive.equals(archiveName) + && md.category.equals(categoryName)) { + iterator.remove(); + missingData = md; + break; + } + } + } + } + return missingData; + } + + /** + * Wait for notification that current missing data is finished processing. + * + * @return false when interrupted exception + */ + private boolean missingDataQueueWait() { + boolean state = true; + try { + missingDataQueue.wait(); + } catch (InterruptedException e) { + state = false; + statusHandler.handle(Priority.INFO, e.getLocalizedMessage(), e); + } + return state; + } + + /** + * + * @param missingData + */ + private void addMissingData(MissingData missingData) { + synchronized (missingDataQueue) { + missingDataQueue.add(missingData); + if (missingDataJob.getState() == Job.NONE) { + missingDataJob.schedule(); + } + } + } + + /** + * Change update visible to the new list. + * + * @param newDisplays + */ + private void changeDisplay(List newDisplays) { + List oldDisplays = visibleList; + visibleList = newDisplays; + List visibleList = new ArrayList(newDisplays); + + for (DisplayData displayData : oldDisplays) { + if (!visibleList.remove(displayData)) { + setVisible(displayData, false); + } + } + + for (DisplayData displayData : visibleList) { + setVisible(displayData, true); + } + } + + /** + * Clear request queues and stop current request. + */ + public void clearQueue() { + sizeQueue.clear(); + displayQueue.clear(); } /* @@ -148,51 +649,123 @@ public class SizeJob extends Job { ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); - mainLoop: while (!queue.isEmpty()) { - SizeJobRequest dirInfo = queue.remove(); + updateDisplayTimer(); - stopComputeSize.set(false); - DisplayData displayData = dirInfo.displayData; - Calendar startCal = dirInfo.startCal; - Calendar endCal = dirInfo.endCal; + mainLoop: while (!shutdown.get()) { - List files = manager.getDisplayFiles(displayData, startCal, - endCal); - - // Size no longer needed. - if (!displayData.isSelected() && stopComputeSize.get()) { - continue; + currentDisplayData = sizeQueue.peek(); + if (currentDisplayData == null) { + break mainLoop; + } + + // System.out.println("+++SizeJob: " + currentDisplayData); + + List files = manager.getDisplayFiles(currentDisplayData, + startCal, endCal); + + // Size no longer needed. + if (currentDisplayData != sizeQueue.peek()) { + // System.out.println("---SizeJob: " + currentDisplayData); + continue mainLoop; } - dirInfo.files.clear(); - dirInfo.files.addAll(files); long size = 0L; - for (File file : dirInfo.files) { - - // Skip when size no longer needed. - if (!displayData.isSelected() && stopComputeSize.get()) { - continue mainLoop; - } + peekCnt = peekFrequency; + stopComputeSize = false; + for (File file : files) { if (file.isDirectory()) { - size += FileUtil.sizeOfDirectory(file); + size += sizeOfDirectory(file); } else { size += file.length(); } + + // Skip when size no longer needed. + if (stopComputeSize) { + // System.out.println("---SizeJob: " + currentDisplayData); + continue mainLoop; + } } - displayData.setSize(size); - - List list = new ArrayList(1); - list.add(dirInfo); - for (IUpdateListener listener : listeners) { - listener.update(list); - } + sizeQueue.remove(currentDisplayData); + currentDisplayData.setSize(size); + displayQueue.add(currentDisplayData); } + // System.out.println("xxxSizeJob: OK_STATUS"); + shutdownDisplayTimer.set(true); return Status.OK_STATUS; } + /** + * Determine the total size of a directory; unless stop flag is set then + * result is unknown. + * + * @param directory + * @return size + */ + private long sizeOfDirectory(File directory) { + long size = 0; + for (File file : directory.listFiles()) { + if (stopComputeSize) { + break; + } + if (--peekCnt == 0) { + if (currentDisplayData != sizeQueue.peek()) { + // Forces break out of recursion. + stopComputeSize = true; + break; + } + peekCnt = peekFrequency; + } + + if (file.isDirectory()) { + size += sizeOfDirectory(file); + } else { + size += file.length(); + } + } + return size; + } + + /** + * Start timer to update GUI's display form data on the display Queue. + */ + private void updateDisplayTimer() { + if (displayTimer != null) { + displayTimer.cancel(); + } + + shutdownDisplayTimer.set(false); + + displayTimer = new Timer(); + + TimerTask updateDisplayTask = new TimerTask() { + @Override + public void run() { + if (!displayQueue.isEmpty()) { + List list = new ArrayList( + displayQueue.size()); + displayQueue.drainTo(list); + + // for (DisplayData displayData : list) { + // System.out.println("== " + displayData); + // } + // + for (IUpdateListener listener : listeners) { + listener.update(list); + } + } else if (shutdownDisplayTimer.get()) { + // System.out.println("xxx updateDisplayTimer canceled"); + displayTimer.cancel(); + displayTimer = null; + } + } + }; + + displayTimer.schedule(updateDisplayTask, 1000, 2000); + } + /* * (non-Javadoc) * @@ -200,7 +773,125 @@ public class SizeJob extends Job { */ @Override protected void canceling() { - queue.clear(); - stopComputeSize.set(true); + // System.err.println("canceling SizeJob"); + clearQueue(); + missingDataQueue.clear(); + missingDataJob.cancel(); + shutdown.set(true); } + + /** + * Class used by the missing data job to obtain display data for given + * archive/category off the UI thread. + */ + private static class MissingData { + protected final String archive; + + protected final String category; + + protected final List selectedList; + + protected boolean visiable = false; + + public MissingData(String archive, String category, + List selectedList) { + this.archive = archive; + this.category = category; + this.selectedList = new ArrayList(selectedList); + } + + public boolean isSelected() { + return !selectedList.isEmpty(); + } + + public void setVisiable(boolean state) { + this.visiable = state; + } + + public void setSelectedList(List selectedList) { + this.selectedList.clear(); + this.selectedList.addAll(selectedList); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("MissingData["); + sb.append("archive: ").append(archive); + sb.append(", category: ").append(category); + sb.append(", visible: ").append(visiable); + sb.append(", isSelected: ").append(isSelected()); + sb.append("]"); + return sb.toString(); + } + } + + /** + * This handles getting the display data in the missing data queue and + * queuing the results for the size job. + */ + private class MissingDataJob extends Job { + + private final AtomicBoolean shutdown = new AtomicBoolean(false); + + protected MissingData currentMissingData = null; + + public MissingDataJob() { + super("MissingData"); + } + + @Override + protected IStatus run(IProgressMonitor monitor) { + if (monitor.isCanceled()) { + return Status.OK_STATUS; + } + + ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); + + while (!shutdown.get()) { + synchronized (missingDataQueue) { + if (currentMissingData != null) { + missingDataQueue.notifyAll(); + } + currentMissingData = missingDataQueue.poll(); + } + + if (currentMissingData == null) { + break; + } + + String archiveName = currentMissingData.archive; + String categoryName = currentMissingData.category; + // System.out.println("== missingData: " + currentMissingData); + List selectedList = currentMissingData.selectedList; + List displayDatas = manager.getDisplayData( + archiveName, categoryName, false); + if (shutdown.get()) { + break; + } + + for (DisplayData displayData : displayDatas) { + displayData.setSelected(selectedList.contains(displayData + .getDisplayLabel())); + sizeQueue.add(displayData); + } + + archiveInfoMap.get(archiveName).get(categoryName) + .setDisplayDataList(displayDatas); + + if (SizeJob.this.getState() == Job.NONE) { + SizeJob.this.schedule(); + } + } + + // System.out.println("xxx missingData"); + return Status.OK_STATUS; + } + + @Override + protected void canceling() { + // System.err.println("canceling MissingDataJob"); + shutdown.set(true); + } + } + } \ No newline at end of file diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java index 14fa076a9c..4f6e103485 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/AbstractArchiveDlg.java @@ -21,37 +21,37 @@ package com.raytheon.uf.viz.archive.ui; import java.util.ArrayList; import java.util.Calendar; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.ShellAdapter; +import org.eclipse.swt.events.ShellEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; import com.raytheon.uf.common.archive.config.ArchiveConfig; import com.raytheon.uf.common.archive.config.ArchiveConfigManager; +import com.raytheon.uf.common.archive.config.ArchiveConstants; import com.raytheon.uf.common.archive.config.CategoryConfig; import com.raytheon.uf.common.archive.config.DisplayData; +import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.util.SizeUtil; import com.raytheon.uf.viz.archive.data.ArchiveInfo; import com.raytheon.uf.viz.archive.data.CategoryInfo; import com.raytheon.uf.viz.archive.data.IArchiveTotals; +import com.raytheon.uf.viz.archive.data.IRetentionHour; import com.raytheon.uf.viz.archive.data.IUpdateListener; import com.raytheon.uf.viz.archive.data.SizeJob; -import com.raytheon.uf.viz.archive.data.SizeJobRequest; -import com.raytheon.uf.viz.archive.ui.ArchiveTableComp.TableType; import com.raytheon.uf.viz.core.VizApp; import com.raytheon.viz.ui.dialogs.CaveSWTDialog; @@ -68,7 +68,9 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * ------------ ---------- ----------- -------------------------- * May 30, 2013 1965 bgonzale Initial creation * Jun 10, 2013 1966 rferrel Change to allow Case Creation to extend. - * + * Jul 24, 2013 2220 rferrel Changes to queue size request for all data. + * Aug 01, 2013 2221 rferrel Changes for select configuration. + * Aug 06, 2013 2222 rferrel Changes to display all selected data. * * * @author bgonzale @@ -76,7 +78,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; */ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements - IArchiveTotals, IUpdateListener { + IArchiveTotals, IUpdateListener, IModifyListener, IRetentionHour { /** Table composite that holds the table controls. */ private ArchiveTableComp tableComp; @@ -87,8 +89,8 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements /** Category combo box. */ private Combo categoryCbo; - /** Information for populating the various table displays. */ - protected final Map archiveInfoMap = new HashMap(); + /** Data manager. */ + protected ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); /** * Boolean to indicate when DisplayData is created should its selection be @@ -99,7 +101,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements /** * Must be set by sub-class prior to creating table. */ - protected TableType tableType; + protected ArchiveConstants.Type type; /** * Job that computes sizes of table row entries off the UI thread. @@ -109,6 +111,21 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements /** Keeps track of when it is safe to clear the busy cursor. */ protected final AtomicInteger busyCnt = new AtomicInteger(0); + /** Performs save action button. */ + protected Button saveBtn; + + /** Optional button to toggle displaying all selected or category */ + protected Button showSelectedBtn; + + /** Flag set when user wants to close with unsaved modifications. */ + protected boolean closeFlag = false; + + /** Current select (case/retention) loaded into the dialog. */ + protected String selectName = ArchiveConstants.defaultSelectName; + + /** Which table is being displayed. */ + private boolean showingSelected = true; + /** * @param parentShell */ @@ -133,23 +150,6 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements super(parentShell, style, caveStyle); } - public List getAllSelected() { - List allSelected = new ArrayList(); - for (String archiveName : archiveInfoMap.keySet()) { - ArchiveInfo archiveInfo = archiveInfoMap.get(archiveName); - for (String categoryName : archiveInfo.getCategoryNames()) { - CategoryInfo categoryInfo = archiveInfo.get(categoryName); - for (DisplayData displayData : categoryInfo - .getDisplayDataList()) { - if (displayData.isSelected()) { - allSelected.add(displayData); - } - } - } - } - return allSelected; - } - /** * @return the name of the currently selected archive in the dialog; null if * none found @@ -203,6 +203,11 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements */ protected abstract void setTotalSizeText(String sizeStringText); + /** + * This method is called by the AbstractArchiveDlg to set total Size. + * + * @param totalSize + */ protected abstract void setTotalSelectedItems(int totalSize); /** @@ -265,6 +270,18 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements return comboComp; } + /* + * (non-Javadoc) + * + * @see + * com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org + * .eclipse.swt.widgets.Shell) + */ + @Override + protected void initializeComponents(Shell shell) { + ArchiveConfigManager.getInstance().reset(); + } + /* * (non-Javadoc) * @@ -274,42 +291,55 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements protected void preOpened() { super.preOpened(); setCursorBusy(true); + populateComboBoxes(); + String titleName = initDisplayData(); + setSelectName(titleName); + populateTableComp(); + setCursorBusy(false); + + addModifiedListener(this); + shell.addShellListener(new ShellAdapter() { - // Setup to display blank dialog with busy cursor while getting data. - Job job = new Job("setup") { @Override - protected IStatus run(IProgressMonitor monitor) { - if (!shell.isDisposed()) { - VizApp.runAsync(new Runnable() { - - @Override - public void run() { - populateComboBoxes(); - setCursorBusy(false); - } - }); + public void shellClosed(ShellEvent e) { + if (closeFlag || !isModified()) { + return; } - initDisplayData(); - if (!shell.isDisposed()) { - VizApp.runAsync(new Runnable() { - @Override - public void run() { - updateTableComp(); + e.doit = false; + VizApp.runAsync(new Runnable() { + + @Override + public void run() { + if (verifyClose()) { + close(); } - }); - } - return Status.OK_STATUS; + } + }); } - }; - job.schedule(); + }); + } + + /** + * Change the select name and update the dialog's title. Assumes the + * sub-classes places a hyphen at the end of the string when setting the + * dialog's title. + * + * @param selectName + */ + protected void setSelectName(String selectName) { + this.selectName = selectName; + StringBuilder sb = new StringBuilder(getText()); + sb.setLength(sb.indexOf("-") + 1); + sb.append(" ").append(selectName); + setText(sb.toString()); } /** * Create the table control. */ protected void createTable() { - tableComp = new ArchiveTableComp(shell, tableType, this); + tableComp = new ArchiveTableComp(shell, type, this, sizeJob); sizeJob.addUpdateListener(this); } @@ -335,7 +365,6 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements * Initial population up of the combo boxes. */ private void populateComboBoxes() { - ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); boolean doSelect = false; for (String archiveName : manager.getArchiveDataNamesList()) { archCfgCbo.add(archiveName); @@ -344,7 +373,7 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements if (doSelect) { archCfgCbo.select(0); - archiveComboSelection(); + initCategoryCbo(); } } @@ -358,10 +387,13 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements /** * Populate the category combo based on the archive name and populate the * table. - * - * @param archiveName */ private void populateCategoryCbo() { + initCategoryCbo(); + categoryComboSelection(); + } + + private void initCategoryCbo() { String archiveName = getSelectedArchiveName(); ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); categoryCbo.removeAll(); @@ -369,7 +401,6 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements categoryCbo.add(categoryName); } categoryCbo.select(0); - categoryComboSelection(); } /** @@ -383,32 +414,39 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements * Set up all display data and queue getting sizes for any that are * selected. */ - private void initDisplayData() { - ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); - Calendar startCal = getStart(); - Calendar endCal = getEnd(); - String[] archiveNames = manager.getArchiveDataNamesList(); - for (String archiveName : archiveNames) { - ArchiveInfo archiveInfo = new ArchiveInfo(); - archiveInfoMap.put(archiveName, archiveInfo); - String[] categoryNames = manager.getCategoryNames(manager - .getArchive(archiveName)); - for (String categoryName : categoryNames) { - List displayDatas = manager.getDisplayData( - archiveName, categoryName, setSelect); - CategoryInfo categoryInfo = new CategoryInfo(archiveName, - categoryName, displayDatas); - archiveInfo.add(categoryInfo); - for (DisplayData displayData : displayDatas) { - if (displayData.isSelected()) { - sizeJob.queue(new SizeJobRequest(displayData, startCal, - endCal)); - } - } - } + protected String initDisplayData() { + String displayArchive = getSelectedArchiveName(); + String displayCategory = getSelectedCategoryName(); + String selectedName = sizeJob.initData(type, null, displayArchive, + displayCategory, this); + sizeJob.resetTime(getStart(), getEnd()); + return selectedName; + } + + /** + * Delete a select configuration file. + * + * @param selectName + */ + protected void deleteSelect(String selectName) { + String fileName = ArchiveConstants.selectFileName(type, selectName); + try { + manager.deleteSelection(fileName); + } catch (LocalizationOpFailedException e) { + MessageDialog.openError(shell, "Case Error", + "Unable to delete file: " + fileName); } } + /** + * Load a select configuration file. + * + * @param selectName + */ + protected void loadSelect(String selectName) { + sizeJob.loadSelect(selectName, type); + } + /** * Populate the table based on the currently selected archive, category and * adjust sizes on the display table. @@ -416,33 +454,20 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements protected void populateTableComp() { String archiveName = getSelectedArchiveName(); String categoryName = getSelectedCategoryName(); - Calendar startCal = getStart(); - Calendar endCal = getEnd(); setCursorBusy(true); try { - sizeJob.clearQueue(); + setShowingSelected(false); - ArchiveInfo archiveInfo = archiveInfoMap.get(archiveName); - - // Not yet populated by background job. - if (archiveInfo == null) { - return; + List displayDatas = sizeJob.changeDisplay(archiveName, + categoryName); + if (displayDatas != null) { + tableComp + .populateTable(archiveName, categoryName, displayDatas); + } else { + tableComp.refresh(); } - - // Not yet populated by background job. - CategoryInfo categoryInfo = archiveInfo.get(categoryName); - if (categoryInfo == null) { - return; - } - - for (DisplayData displayData : categoryInfo.getDisplayDataList()) { - sizeJob.queue(new SizeJobRequest(displayData, startCal, endCal)); - } - sizeJob.requeueSelected(startCal, endCal); - - tableComp.populateTable(categoryInfo.getDisplayDataList()); } finally { setCursorBusy(false); } @@ -474,8 +499,8 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements long totalSize = 0; int totalSelected = 0; - for (String archiveName : archiveInfoMap.keySet()) { - ArchiveInfo archiveInfo = archiveInfoMap.get(archiveName); + for (String archiveName : sizeJob.getArchiveNames()) { + ArchiveInfo archiveInfo = sizeJob.get(archiveName); for (String categoryName : archiveInfo.getCategoryNames()) { CategoryInfo categoryInfo = archiveInfo.get(categoryName); for (DisplayData displayData : categoryInfo @@ -506,6 +531,75 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements setTotalSelectedItems(totalSelected); } + /** + * Creates the showSelectedBtn for sub-classes. + * + * @param actionControlComp + */ + protected void createShowingSelectedBtn(Composite actionControlComp) { + showSelectedBtn = new Button(actionControlComp, SWT.PUSH); + setShowingSelected(false); + showSelectedBtn.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + handelShowSelectAll(); + } + }); + } + + /** + * Populate the table with the desired display. + */ + protected void handelShowSelectAll() { + if (showingSelected) { + populateTableComp(); + } else { + populateSelectAllTable(); + } + } + + /** + * Sets the state for the showing selected flag and updates the label for + * the show selected button. + * + * @param state + */ + private void setShowingSelected(boolean state) { + if (showSelectedBtn != null && !showSelectedBtn.isDisposed()) { + if (showingSelected != state) { + showingSelected = state; + if (showingSelected) { + showSelectedBtn.setText(" Category "); + showSelectedBtn + .setToolTipText("Change display to show category."); + } else { + showSelectedBtn.setText(" Selected "); + showSelectedBtn + .setToolTipText("Change display to show all case selections"); + } + } + } + } + + /** + * Up date the table to display all selected data. + */ + private void populateSelectAllTable() { + setCursorBusy(true); + + try { + setShowingSelected(true); + List selectedData = sizeJob.changeDisplayAll(); + + if (selectedData != null) { + tableComp.populateSelectAll(selectedData); + } + } finally { + setCursorBusy(false); + } + } + /* * (non-Javadoc) * @@ -513,18 +607,26 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements * com.raytheon.uf.viz.archive.data.IUpdateListener#update(java.util.List) */ @Override - public void update(List dirInfos) { - final List displayDatas = new ArrayList( - dirInfos.size()); - for (SizeJobRequest request : dirInfos) { - displayDatas.add(request.getDisplayData()); + public void update(final List displayDatas) { + final List myDisplayDatas = new ArrayList( + displayDatas.size()); + for (DisplayData data : displayDatas) { + String label = data.getDisplayLabel(); + for (DisplayData displayData : sizeJob.get(data.getArchiveName()) + .get(data.getCategoryName()).getDisplayDataList()) { + if (label.equals(displayData.getDisplayLabel())) { + displayData.setSize(data.getSize()); + myDisplayDatas.add(displayData); + break; + } + } } VizApp.runAsync(new Runnable() { @Override public void run() { - tableComp.updateSize(displayDatas); + tableComp.updateSize(myDisplayDatas); updateTotals(null); } }); @@ -546,6 +648,16 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements tableComp.addModifiedListener(iModifyListener); } + /** + * Get the data information on all selected items; not just the currently + * displayed table. + * + * @return selectedDatas + */ + protected List getSelectedData() { + return sizeJob.getSelectAll(); + } + /** * Remove modification listener. * @@ -555,15 +667,70 @@ public abstract class AbstractArchiveDlg extends CaveSWTDialog implements tableComp.removeModifiedListener(iModifyListener); } - /* - * (non-Javadoc) - * - * @see - * com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org - * .eclipse.swt.widgets.Shell) + /** + * Reset all data to unknown size, and queue request for sizes. */ - @Override - protected void initializeComponents(Shell shell) { - ArchiveConfigManager.getInstance().reset(); + protected void resetSizes() { + sizeJob.recomputeSize(); + populateTableComp(); + } + + /** + * Allows a sub-class to set the start and end times based on the off set. + * + * @param startTimeOffset + */ + public void setRetentionTimes(long startTimeOffset) { + // do nothing override by sub-classes + } + + /** + * Indicate unsaved user changes. + * + * @return modified + */ + protected boolean isModified() { + return (saveBtn != null) && !saveBtn.isDisposed() + && saveBtn.isEnabled(); + } + + /** + * Save current selections of the select configuration file. + * + * @param selectName + * @return true when save is successful + */ + protected boolean saveSelection(String selectName) { + Calendar start = getStart(); + Calendar end = getEnd(); + long startRetentionMS = 0L; + if (start != null && end != null) { + startRetentionMS = end.getTimeInMillis() - start.getTimeInMillis(); + } + String errorMsg = sizeJob + .saveSelect(selectName, type, startRetentionMS); + if (errorMsg != null) { + MessageDialog.openError(shell, type + " Selection Error", errorMsg); + } + + return errorMsg == null; + } + + /** + * When unsaved modifications this asks the user to verify the close. + * + * @return true when okay to close. + */ + protected boolean verifyClose() { + boolean state = true; + if (isModified()) { + MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK + | SWT.CANCEL); + box.setText("Close " + type); + box.setMessage("Unsave changes.\nSelect OK to discard changes."); + state = box.open() == SWT.OK; + } + closeFlag = state; + return state; } } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java index da330f8028..6072a5e10c 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveRetentionDlg.java @@ -25,8 +25,6 @@ import java.util.List; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.ShellAdapter; -import org.eclipse.swt.events.ShellEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -34,15 +32,12 @@ import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Layout; -import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Spinner; -import com.raytheon.uf.common.archive.config.ArchiveConfigManager; +import com.raytheon.uf.common.archive.config.ArchiveConstants.Type; import com.raytheon.uf.common.archive.config.DisplayData; -import com.raytheon.uf.viz.archive.data.IArchiveTotals; -import com.raytheon.uf.viz.archive.ui.ArchiveTableComp.TableType; -import com.raytheon.uf.viz.core.VizApp; +import com.raytheon.uf.common.time.util.TimeUtil; /** * Archive retention dialog. @@ -56,14 +51,18 @@ import com.raytheon.uf.viz.core.VizApp; * May 23, 2013 #1964 lvenable Initial creation * May 31, 2013 #1965 bgonzale Initial work for updating retention configurations. * Jun 10, 2013 #1966 rferrel Implemented hooks to get display and save to work. + * Jul 24, 2013 #2220 rferrel Add recompute size button. + * Jul 24, 2013 #2221 rferrel Changes for select configuration. + * Aug 26, 2013 #2225 rferrel Make dialog perspective independent. + * Oct 01, 2013 #2147 rferrel Change getEnd() to pick up files with future time stamps. + * Oct 07, 2013 #2438 rferrel Properly save and load retention times. * * * * @author lvenable * @version 1.0 */ -public class ArchiveRetentionDlg extends AbstractArchiveDlg implements - IArchiveTotals, IModifyListener { +public class ArchiveRetentionDlg extends AbstractArchiveDlg { /** Current Archive/Category selection's minimum retention hours. */ private RetentionHours minRetention; @@ -77,11 +76,18 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg implements /** Displays the total size of selected items. */ private Label totalSizeLbl; - /** Performs save action button. */ - private Button saveBtn; + /** Flag to indicate when retention hours are modified. */ + private boolean retentionHoursAreModified = false; - /** Flag set when user wants to close with unsaved modifications. */ - boolean closeFlag = false; + /** Modification listener for the retention hours components. */ + private final IModifyListener retentionHoursModifyListener = new IModifyListener() { + + @Override + public void modified() { + saveBtn.setEnabled(true); + retentionHoursAreModified = true; + } + }; /** * Constructor. @@ -91,9 +97,9 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg implements */ public ArchiveRetentionDlg(Shell parentShell) { super(parentShell, SWT.DIALOG_TRIM | SWT.MIN, CAVE.DO_NOT_BLOCK - | CAVE.MODE_INDEPENDENT | CAVE.INDEPENDENT_SHELL); - this.setSelect = true; - this.tableType = TableType.Retention; + | CAVE.MODE_INDEPENDENT | CAVE.INDEPENDENT_SHELL + | CAVE.PERSPECTIVE_INDEPENDENT); + this.type = Type.Retention; } /* @@ -120,7 +126,7 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg implements @Override protected void initializeComponents(Shell shell) { super.initializeComponents(shell); - setText("Archive Retention"); + setText("Archive Retention -"); Composite mainComp = new Composite(shell, SWT.NONE); GridLayout gl = new GridLayout(1, false); gl.marginHeight = 0; @@ -186,7 +192,7 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg implements return state; } }; - minRetention.addModifyListener(this); + minRetention.addModifyListener(retentionHoursModifyListener); /* * Bottom row of controls. @@ -216,7 +222,7 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg implements return state; } }; - extRetention.addModifyListener(this); + extRetention.addModifyListener(retentionHoursModifyListener); } /** @@ -225,37 +231,31 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg implements private void createBottomActionButtons() { Composite actionControlComp = new Composite(shell, SWT.NONE); - GridLayout gl = new GridLayout(2, false); + GridLayout gl = new GridLayout(3, false); GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false); actionControlComp.setLayout(gl); actionControlComp.setLayoutData(gd); - // TODO - For the future ? - // Button calcSizeBtn = new Button(actionControlComp, SWT.PUSH); - // calcSizeBtn.setText(" Calculate Sizes "); - // calcSizeBtn.addSelectionListener(new SelectionAdapter() { - // @Override - // public void widgetSelected(SelectionEvent e) { - // // TODO : add calculate size functionality - // // With Roger's automated size calculation code, this doesn't - // // seem relevant unless it is for calculating compressed size - // } - // }); - saveBtn = new Button(actionControlComp, SWT.PUSH); saveBtn.setText(" Save "); saveBtn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent selectionEvent) { - ArchiveConfigManager manager = ArchiveConfigManager - .getInstance(); - manager.save(); - saveBtn.setEnabled(false); - clearModified(); + saveAction(); } }); saveBtn.setEnabled(false); + Button sizeBtn = new Button(actionControlComp, SWT.PUSH); + sizeBtn.setText(" Recompute Sizes "); + sizeBtn.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + resetSizes(); + } + }); + gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false); Button closeBtn = new Button(actionControlComp, SWT.PUSH); closeBtn.setText(" Close "); @@ -273,21 +273,15 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg implements } /** - * When unsaved modifications this asks the user to verify the close. - * - * @return true when okay to close. + * Save button action. */ - private boolean verifyClose() { - boolean state = true; - if (isModified()) { - MessageBox box = new MessageBox(shell, SWT.ICON_WARNING | SWT.OK - | SWT.CANCEL); - box.setText("Close Retention"); - box.setMessage("Unsave changes.\nSelect OK to continue."); - state = box.open() == SWT.OK; + private void saveAction() { + saveSelection(selectName); + saveBtn.setEnabled(false); + if (retentionHoursAreModified) { + manager.save(); } - closeFlag = state; - return state; + clearModified(); } /* @@ -337,7 +331,10 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg implements @Override protected Calendar getEnd() { // display all elements so no end bound - return null; + Calendar endCal = TimeUtil.newCalendar(); + // Back off an hour so latter rounding doesn't cause overflow. + endCal.setTimeInMillis(Long.MAX_VALUE - TimeUtil.MILLIS_PER_HOUR); + return endCal; } /* @@ -402,6 +399,20 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg implements super.clearModified(); minRetention.clearModified(); extRetention.clearModified(); + retentionHoursAreModified = false; + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.archive.ui.AbstractArchiveDlg#disposed() + */ + @Override + protected void disposed() { + minRetention.removeModifyListener(retentionHoursModifyListener); + extRetention.removeModifyListener(retentionHoursModifyListener); + removeModifiedListener(this); + super.disposed(); } /* @@ -412,49 +423,7 @@ public class ArchiveRetentionDlg extends AbstractArchiveDlg implements @Override protected void preOpened() { super.preOpened(); - addModifiedListener(this); - shell.addShellListener(new ShellAdapter() { - - @Override - public void shellClosed(ShellEvent e) { - if (closeFlag || !isModified()) { - return; - } - - e.doit = false; - VizApp.runAsync(new Runnable() { - - @Override - public void run() { - if (verifyClose()) { - close(); - } - } - }); - } - }); - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.viz.archive.ui.AbstractArchiveDlg#disposed() - */ - @Override - protected void disposed() { - minRetention.removeModifyListener(this); - extRetention.removeModifyListener(this); - removeModifiedListener(this); - super.disposed(); - } - - /** - * Indicate unsaved user changes. - * - * @return modified - */ - private boolean isModified() { - return (saveBtn != null) && !saveBtn.isDisposed() - && saveBtn.isEnabled(); + archiveComboSelection(); + categoryComboSelection(); } } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveTableComp.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveTableComp.java index 740642beae..fab9434476 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveTableComp.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ArchiveTableComp.java @@ -42,9 +42,12 @@ import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableItem; +import com.raytheon.uf.common.archive.config.ArchiveConstants; +import com.raytheon.uf.common.archive.config.ArchiveConstants.Type; import com.raytheon.uf.common.archive.config.DisplayData; import com.raytheon.uf.common.util.SizeUtil; import com.raytheon.uf.viz.archive.data.IArchiveTotals; +import com.raytheon.uf.viz.archive.data.SizeJob; /** * Archive table composite that contains the SWT table. @@ -56,6 +59,10 @@ import com.raytheon.uf.viz.archive.data.IArchiveTotals; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 23, 2013 #1964 lvenable Initial creation + * Jul 24, 2013 #2221 rferrel Changes for select configuration. + * Aug 06, 2013 #2222 rferrel Changes to display all selected data. + * Aug 14, 2013 #2220 rferrel Add refresh method. + * Aug 26, 2013 #2225 rferrel Add missing updates. * * * @@ -70,6 +77,14 @@ public class ArchiveTableComp extends Composite { /** Column to display size information,. */ private final int SIZE_COL_INDEX = 1; + private boolean showSelectAll = false; + + /** Name of table's archive. */ + String archiveName; + + /** Name of table's category. */ + String categoryName; + /** Table control. */ private Table table; @@ -82,13 +97,11 @@ public class ArchiveTableComp extends Composite { /** Size label. */ private Label sizeLbl; - /** Table type enumeration. */ - public enum TableType { - Retention, Case - }; + /** Composite for holding the table */ + Composite tblComp; - /** Current table type. */ - private final TableType type; + /** The dialog's type. */ + private final ArchiveConstants.Type type; /** Allows the parent dialog log to update other total displays. */ private final IArchiveTotals iArchiveTotals; @@ -106,6 +119,11 @@ public class ArchiveTableComp extends Composite { */ private final List modifiedListeners = new CopyOnWriteArrayList(); + /** + * Use to update the selections for size job queues. + */ + private final SizeJob sizeJob; + /** * Constructor. * @@ -114,12 +132,13 @@ public class ArchiveTableComp extends Composite { * @param type * Table type. */ - public ArchiveTableComp(Composite parent, TableType type, - IArchiveTotals iTotalSelectedSize) { + public ArchiveTableComp(Composite parent, Type type, + IArchiveTotals iTotalSelectedSize, SizeJob sizeJob) { super(parent, 0); this.type = type; this.iArchiveTotals = iTotalSelectedSize; + this.sizeJob = sizeJob; init(); } @@ -137,7 +156,7 @@ public class ArchiveTableComp extends Composite { createTable(); - if (type != TableType.Retention) { + if (type != Type.Retention) { createTableLabels(); } } @@ -148,11 +167,20 @@ public class ArchiveTableComp extends Composite { private void createTable() { GridData gd = null; - table = new Table(this, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL - | SWT.H_SCROLL | SWT.MULTI | SWT.VIRTUAL); + tblComp = new Composite(this, SWT.NONE); + GridLayout gl = new GridLayout(1, false); + gl.marginHeight = 0; + gl.marginWidth = 0; + gl.horizontalSpacing = 0; + tblComp.setLayout(gl); gd = new GridData(SWT.FILL, SWT.DEFAULT, true, true); gd.widthHint = 730; gd.heightHint = 270; + tblComp.setLayoutData(gd); + + table = new Table(tblComp, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL + | SWT.H_SCROLL | SWT.MULTI | SWT.VIRTUAL); + gd = new GridData(SWT.FILL, SWT.FILL, true, true); table.setLayoutData(gd); table.setHeaderVisible(true); table.setLinesVisible(true); @@ -163,8 +191,15 @@ public class ArchiveTableComp extends Composite { TableItem item = (TableItem) event.item; int index = table.indexOf(item); DisplayData displayData = tableData[index]; - item.setText(new String[] { displayData.getDisplayLabel(), - displayData.getSizeLabel() }); + String label = null; + if (showSelectAll) { + label = displayData.getArchiveName() + " | " + + displayData.getCategoryName() + " | " + + displayData.getDisplayLabel(); + } else { + label = displayData.getDisplayLabel(); + } + item.setText(new String[] { label, displayData.getSizeLabel() }); item.setChecked(displayData.isSelected()); } }); @@ -173,9 +208,9 @@ public class ArchiveTableComp extends Composite { pathColumn.setText("Label"); TableColumn sizeColumn = new TableColumn(table, SWT.CENTER); - if (type == TableType.Retention) { + if (type == Type.Retention) { sizeColumn.setText("Current Size"); - } else if (type == TableType.Case) { + } else if (type == Type.Case) { sizeColumn.setText("Size"); } @@ -285,7 +320,7 @@ public class ArchiveTableComp extends Composite { TableItem item = table.getItem(index); if (item.getChecked()) { ++count; - displayData.setSelected(true); + sizeJob.setSelect(displayData, true); if (tableTotalSize >= 0) { long diSize = displayData.getSize(); if (diSize < 0) { @@ -295,7 +330,7 @@ public class ArchiveTableComp extends Composite { } } } else { - displayData.setSelected(false); + sizeJob.setSelect(displayData, false); } } List displayDatas = Arrays.asList(tableData); @@ -422,12 +457,31 @@ public class ArchiveTableComp extends Composite { } /** - * Set up table with values in the list. + * Update table display to show data for the desired category. * * @param displayDatas */ - protected void populateTable(List displayDatas) { + protected void populateTable(String archiveName, String categoryName, + List displayDatas) { + showSelectAll = false; + table.getColumn(0).setText("Label"); + populateTable(displayDatas); + } + + /** + * Flag table as showing all selected data and update display. + * + * @param displayDatas + */ + protected void populateSelectAll(List displayDatas) { + showSelectAll = true; + table.getColumn(0).setText("Archive | Category | Label"); + populateTable(displayDatas); + } + + private void populateTable(List displayDatas) { tableData = displayDatas.toArray(new DisplayData[0]); + Arrays.sort(tableData, DisplayData.LABEL_ORDER); table.removeAll(); table.setItemCount(tableData.length); @@ -440,6 +494,15 @@ public class ArchiveTableComp extends Composite { table.setSortColumn(table.getColumn(LABEL_COL_INDEX)); table.setSortDirection(SWT.UP); table.clearAll(); + updateSelectionLabels(); + } + + /** + * Update the current tables display. + */ + public void refresh() { + table.clearAll(); + updateSelectionLabels(); } /** diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreateException.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreateException.java new file mode 100644 index 0000000000..65fae23052 --- /dev/null +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreateException.java @@ -0,0 +1,69 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.viz.archive.ui; + +/** + * Exception to use when problem creating a case. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Aug 22, 2013 2225       rferrel     Initial creation
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ + +public class CaseCreateException extends Exception { + static final long serialVersionUID = 0L; + + /** + * + */ + public CaseCreateException() { + } + + /** + * @param message + */ + public CaseCreateException(String message) { + super(message); + } + + /** + * @param cause + */ + public CaseCreateException(Throwable cause) { + super(cause); + } + + /** + * @param message + * @param cause + */ + public CaseCreateException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java index 76a6c8b316..2f7ccf2f82 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseCreationDlg.java @@ -21,11 +21,11 @@ package com.raytheon.uf.viz.archive.ui; import java.io.File; import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.List; +import org.apache.commons.io.FileUtils; import org.eclipse.core.runtime.jobs.IJobChangeEvent; import org.eclipse.core.runtime.jobs.JobChangeAdapter; import org.eclipse.jface.dialogs.MessageDialog; @@ -38,7 +38,6 @@ import org.eclipse.swt.graphics.Point; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.Display; @@ -46,17 +45,11 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Layout; import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Spinner; +import com.raytheon.uf.common.archive.config.ArchiveConstants.Type; import com.raytheon.uf.common.archive.config.DisplayData; import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.util.SizeUtil; -import com.raytheon.uf.viz.archive.data.ArchiveInfo; -import com.raytheon.uf.viz.archive.data.CategoryInfo; -import com.raytheon.uf.viz.archive.data.IArchiveTotals; -import com.raytheon.uf.viz.archive.data.IUpdateListener; -import com.raytheon.uf.viz.archive.data.SizeJobRequest; -import com.raytheon.uf.viz.archive.ui.ArchiveTableComp.TableType; import com.raytheon.uf.viz.core.VizApp; import com.raytheon.viz.ui.dialogs.AwipsCalendar; import com.raytheon.viz.ui.dialogs.ICloseCallback; @@ -74,14 +67,17 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback; * May 23, 2013 #1964 lvenable Initial creation * Jun 10, 2013 #1966 rferrel Implemented back in hooks for display * and generation of cases. + * Jul 24, 2013 #2220 rferrel Add recompute size button. + * Jul 24, 2013 #2221 rferrel Changes for select configuration. + * Aug 06, 2013 #2222 rferrel Changes to display all selected data. + * Aug 26, 2013 #2225 rferrel Make perspective independent and no longer modal. * * * * @author lvenable * @version 1.0 */ -public class CaseCreationDlg extends AbstractArchiveDlg implements - IArchiveTotals, IUpdateListener { +public class CaseCreationDlg extends AbstractArchiveDlg { /** Start time label. */ private Label startTimeLbl; @@ -104,17 +100,30 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements /** Compression check box. */ private Button compressChk; - /** Break files check box. */ - private Button breakFilesChk; + // TODO restore when Multi-file implemented. + // /** Break files check box. */ + // private Button breakFilesChk; - /** File size spinner control. */ - private Spinner fileSizeSpnr; + /** Button to save new select case configuration. */ + private Button saveAsBtn; - /** File size combo box. */ - private Combo fileSizeCbo; + /** Button to load select case configuration. */ + private Button loadBtn; - /** Maximum file size label. */ - private Label maxFileSizeLbl; + /** Button to delete select case configuration. */ + private Button deleteBtn; + + // TODO restore when Multi-file implemented. + // /** File size spinner control. */ + // private Spinner fileSizeSpnr; + + // TODO restore when Multi-file implemented. + // /** File size combo box. */ + // private Combo fileSizeCbo; + + // TODO restore when Multi-file implemented. + // /** Maximum file size label. */ + // private Label maxFileSizeLbl; /** Directory location label. */ private Label locationLbl; @@ -138,6 +147,21 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements /** Number of selected items. */ private int selectedItemsSize = 0; + /** Dialog to create new select case. */ + private CaseLoadSaveDeleteDlg saveAsDlg; + + /** Dialog to load a select case. */ + private CaseLoadSaveDeleteDlg loadDlg; + + /** Dialog to delete a select case. */ + private CaseLoadSaveDeleteDlg deleteDlg; + + /** Allow only single instance of dialog. */ + private CaseNameDialog caseNameDlg; + + /** Allow only single instance of dialog. */ + private GenerateCaseDlg generateCaseDlg; + /** * Constructor. * @@ -146,9 +170,11 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements */ public CaseCreationDlg(Shell parentShell) { super(parentShell, SWT.DIALOG_TRIM | SWT.MIN, CAVE.DO_NOT_BLOCK - | CAVE.MODE_INDEPENDENT | CAVE.INDEPENDENT_SHELL); + | CAVE.PERSPECTIVE_INDEPENDENT | CAVE.MODE_INDEPENDENT + | CAVE.INDEPENDENT_SHELL); + this.type = Type.Case; this.setSelect = false; - this.tableType = TableType.Case; + this.type = Type.Case; } /* @@ -176,7 +202,7 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements @Override protected void initializeComponents(Shell shell) { super.initializeComponents(shell); - setText("Archive Case Creation"); + setText("Archive Case Creation -"); Composite mainComp = new Composite(shell, SWT.NONE); GridLayout gl = new GridLayout(1, false); gl.marginHeight = 0; @@ -238,13 +264,29 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements gd = new GridData(220, SWT.DEFAULT); endTimeLbl = new Label(timeComp, SWT.BORDER); endTimeLbl.setLayoutData(gd); + } + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.viz.archive.ui.AbstractArchiveDlg#setRetentionTimes(long) + */ + @Override + public void setRetentionTimes(long startRetentionHours) { + long startTimeOffset = startRetentionHours * TimeUtil.MILLIS_PER_HOUR; endDate = TimeUtil.newDate(); long time = endDate.getTime(); - time -= TimeUtil.MILLIS_PER_DAY; + time -= startTimeOffset; startDate = new Date(time); - startTimeLbl.setText(dateFmt.format(startDate)); - endTimeLbl.setText(dateFmt.format(endDate)); + VizApp.runAsync(new Runnable() { + + @Override + public void run() { + startTimeLbl.setText(dateFmt.format(startDate)); + endTimeLbl.setText(dateFmt.format(endDate)); + } + }); } /** @@ -330,58 +372,60 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements */ compressChk = new Button(compressionComp, SWT.CHECK); compressChk.setText("Compress Files"); - compressChk.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - handleCompressSelection(); - } - }); + // TODO restore when Multi-file implemented. + // compressChk.addSelectionListener(new SelectionAdapter() { + // @Override + // public void widgetSelected(SelectionEvent e) { + // handleCompressSelection(); + // } + // }); - gd = new GridData(); - gd.horizontalIndent = 20; - breakFilesChk = new Button(compressionComp, SWT.CHECK); - breakFilesChk.setText("Break into multiple files"); - breakFilesChk.setLayoutData(gd); - breakFilesChk.setEnabled(false); - breakFilesChk.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - handleBreakFilesSelection(breakFilesChk.getSelection()); - } - }); + // TODO restore when Multi-file implemented. + // gd = new GridData(); + // gd.horizontalIndent = 20; + // breakFilesChk = new Button(compressionComp, SWT.CHECK); + // breakFilesChk.setText("Break into multiple files"); + // breakFilesChk.setLayoutData(gd); + // breakFilesChk.setEnabled(false); + // breakFilesChk.addSelectionListener(new SelectionAdapter() { + // @Override + // public void widgetSelected(SelectionEvent e) { + // handleBreakFilesSelection(breakFilesChk.getSelection()); + // } + // }); - Composite maxFileSizeComp = new Composite(compressionComp, SWT.NONE); - gl = new GridLayout(3, false); - gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false); - gd.horizontalIndent = 20; - maxFileSizeComp.setLayout(gl); - maxFileSizeComp.setLayoutData(gd); - - maxFileSizeLbl = new Label(maxFileSizeComp, SWT.NONE); - maxFileSizeLbl.setText("Max File Size: "); - maxFileSizeLbl.setEnabled(false); - - gd = new GridData(60, SWT.DEFAULT); - fileSizeSpnr = new Spinner(maxFileSizeComp, SWT.BORDER); - fileSizeSpnr.setIncrement(1); - fileSizeSpnr.setPageIncrement(50); - fileSizeSpnr.setMaximum(2000); - fileSizeSpnr.setMinimum(500); - fileSizeSpnr.setLayoutData(gd); - fileSizeSpnr.setEnabled(false); - - fileSizeCbo = new Combo(maxFileSizeComp, SWT.VERTICAL | SWT.DROP_DOWN - | SWT.BORDER | SWT.READ_ONLY); - fileSizeCbo.setEnabled(false); - fileSizeCbo.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(SelectionEvent e) { - handleFileSizeChangeSelection(); - } - }); - fileSizeCbo.add("MB"); - fileSizeCbo.add("GB"); - fileSizeCbo.select(0); + // Composite maxFileSizeComp = new Composite(compressionComp, SWT.NONE); + // gl = new GridLayout(3, false); + // gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false); + // gd.horizontalIndent = 20; + // maxFileSizeComp.setLayout(gl); + // maxFileSizeComp.setLayoutData(gd); + // + // maxFileSizeLbl = new Label(maxFileSizeComp, SWT.NONE); + // maxFileSizeLbl.setText("Max File Size: "); + // maxFileSizeLbl.setEnabled(false); + // + // gd = new GridData(60, SWT.DEFAULT); + // fileSizeSpnr = new Spinner(maxFileSizeComp, SWT.BORDER); + // fileSizeSpnr.setIncrement(1); + // fileSizeSpnr.setPageIncrement(50); + // fileSizeSpnr.setMaximum(2000); + // fileSizeSpnr.setMinimum(500); + // fileSizeSpnr.setLayoutData(gd); + // fileSizeSpnr.setEnabled(false); + // + // fileSizeCbo = new Combo(maxFileSizeComp, SWT.VERTICAL | SWT.DROP_DOWN + // | SWT.BORDER | SWT.READ_ONLY); + // fileSizeCbo.setEnabled(false); + // fileSizeCbo.addSelectionListener(new SelectionAdapter() { + // @Override + // public void widgetSelected(SelectionEvent e) { + // handleFileSizeChangeSelection(); + // } + // }); + // fileSizeCbo.add("MB"); + // fileSizeCbo.add("GB"); + // fileSizeCbo.select(0); } /** @@ -425,7 +469,7 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements private void createBottomActionButtons() { Composite actionControlComp = new Composite(shell, SWT.NONE); - GridLayout gl = new GridLayout(3, false); + GridLayout gl = new GridLayout(8, false); GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false); actionControlComp.setLayout(gl); actionControlComp.setLayoutData(gd); @@ -441,6 +485,44 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements // } // }); + saveBtn = new Button(actionControlComp, SWT.PUSH); + saveBtn.setText(" Save "); + saveBtn.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent selectionEvent) { + saveSelection(selectName); + clearModified(); + } + }); + saveBtn.setEnabled(false); + + saveAsBtn = new Button(actionControlComp, SWT.PUSH); + saveAsBtn.setText(" Save As... "); + saveAsBtn.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent selectionEvent) { + handleSaveAsCase(); + } + }); + + loadBtn = new Button(actionControlComp, SWT.PUSH); + loadBtn.setText(" Load... "); + loadBtn.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent selectionEvent) { + handleLoadCase(); + } + }); + + deleteBtn = new Button(actionControlComp, SWT.PUSH); + deleteBtn.setText(" Delete... "); + deleteBtn.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent selectionEvent) { + handleDeleteCase(); + } + }); + generateBtn = new Button(actionControlComp, SWT.PUSH); generateBtn.setText(" Generate "); generateBtn.setEnabled(false); @@ -451,6 +533,18 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements } }); + createShowingSelectedBtn(actionControlComp); + + Button sizeBtn = new Button(actionControlComp, SWT.PUSH); + sizeBtn.setText(" Recompute Sizes "); + sizeBtn.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + resetSizes(); + } + }); + gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false); Button closeBtn = new Button(actionControlComp, SWT.PUSH); closeBtn.setText(" Close "); @@ -458,13 +552,91 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements closeBtn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { - close(); + if (verifyClose()) { + close(); + } else { + e.doit = false; + } } }); } + private void handleSaveAsCase() { + if (saveAsDlg == null || saveAsDlg.isDisposed()) { + saveAsDlg = new CaseLoadSaveDeleteDlg(shell, + CaseLoadSaveDeleteDlg.Type.SaveAs); + saveAsDlg.setCloseCallback(new ICloseCallback() { + + @Override + public void dialogClosed(Object returnValue) { + if (returnValue instanceof String) { + String name = returnValue.toString(); + if (saveSelection(name)) { + clearModified(); + loadSelect(name); + setSelectName(name); + } + } + } + }); + saveAsDlg.open(); + } else { + saveAsDlg.bringToTop(); + } + } + + private void handleLoadCase() { + if (isModified() + && !MessageDialog.openConfirm(shell, "Case Confirmation", + "Unsave changes will be lost.\nPress OK to continue.")) { + return; + + } + if (loadDlg == null || loadDlg.isDisposed()) { + loadDlg = new CaseLoadSaveDeleteDlg(shell, + CaseLoadSaveDeleteDlg.Type.Load); + loadDlg.setCloseCallback(new ICloseCallback() { + + @Override + public void dialogClosed(Object returnValue) { + if (returnValue instanceof String) { + String name = returnValue.toString(); + loadSelect(name); + populateTableComp(); + updateTotals(null); + setSelectName(name); + clearModified(); + } + } + }); + loadDlg.open(); + } else { + loadDlg.bringToTop(); + } + } + + private void handleDeleteCase() { + if (deleteDlg == null || deleteDlg.isDisposed()) { + deleteDlg = new CaseLoadSaveDeleteDlg(shell, + CaseLoadSaveDeleteDlg.Type.Delete); + deleteDlg.setCloseCallback(new ICloseCallback() { + + @Override + public void dialogClosed(Object returnValue) { + if (returnValue instanceof String) { + String selectName = returnValue.toString(); + deleteSelect(selectName); + } + } + }); + deleteDlg.open(); + } else { + deleteDlg.bringToTop(); + } + } + /** - * Display modal dialog that performs the Generation of the case. + * Display dialog that performs the Generation of the case. */ private void generateCase() { setCursorBusy(true); @@ -475,50 +647,71 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements List displayDatas = getSelectedData(); boolean doCompress = compressChk.getSelection(); - boolean doMultiFiles = breakFilesChk.getSelection(); - int compressSize = fileSizeSpnr.getSelection(); - String sizeType = fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex()); - // Assume Model dialog. - GenerateCaseDlg dialog = new GenerateCaseDlg(shell, targetDir, caseDir, - startCal, endCal, displayDatas, doCompress, doMultiFiles, - compressSize, sizeType); - dialog.addJobChangeListener(new JobChangeAdapter() { + // TODO restore once Multi-file implemented. + // boolean doMultiFiles = breakFilesChk.getSelection(); + // int compressSize = fileSizeSpnr.getSelection(); + // String sizeType = + // fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex()); + boolean doMultiFiles = false; + int compressSize = 500; + String sizeType = "MB"; - @Override - public void done(IJobChangeEvent event) { - VizApp.runAsync(new Runnable() { - @Override - public void run() { - updateLocationState(); - } - }); + setCursorBusy(true); + if (generateCaseDlg == null || generateCaseDlg.isDisposed()) { + long splitSize = 0L; + if (doCompress && doMultiFiles) { + if (sizeType.equals("MB")) { + splitSize = compressSize * FileUtils.ONE_MB; + } else { + splitSize = compressSize * FileUtils.ONE_GB; + } } - }); - dialog.setCloseCallback(new ICloseCallback() { + generateCaseDlg = new GenerateCaseDlg(shell, targetDir, caseDir, + startCal, endCal, displayDatas, doCompress, doMultiFiles, + splitSize); + generateCaseDlg.addJobChangeListener(new JobChangeAdapter() { - @Override - public void dialogClosed(Object returnValue) { - setCursorBusy(false); - } - }); - dialog.open(); + @Override + public void done(IJobChangeEvent event) { + VizApp.runAsync(new Runnable() { + @Override + public void run() { + updateLocationState(); + setCursorBusy(false); + generateCaseDlg = null; + } + }); + } + }); + generateCaseDlg.setCloseCallback(new ICloseCallback() { - } - - /** - * Enable/Disable controls based on the compression check box. - */ - private void handleCompressSelection() { - if (compressChk.getSelection()) { - handleBreakFilesSelection(breakFilesChk.getSelection()); + @Override + public void dialogClosed(Object returnValue) { + setCursorBusy(false); + } + }); + generateCaseDlg.open(); } else { - handleBreakFilesSelection(false); + generateCaseDlg.bringToTop(); } - breakFilesChk.setEnabled(compressChk.getSelection()); } + // TODO restore when Multi-file implemented. + // /** + // * Enable/Disable controls based on the compression check box. + // */ + // private void handleCompressSelection() { + // if (compressChk.getSelection()) { + // handleBreakFilesSelection(breakFilesChk.getSelection()); + // } else { + // handleBreakFilesSelection(false); + // } + // + // breakFilesChk.setEnabled(compressChk.getSelection()); + // } + /** * Bring up modal dialog to get the case's directory name. */ @@ -531,35 +724,43 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements } File targetDir = (File) o; - // Assume modal dialog. - CaseNameDialog dialog = new CaseNameDialog(shell, targetDir); - dialog.setCloseCallback(new ICloseCallback() { - @Override - public void dialogClosed(Object returnValue) { - if (returnValue instanceof File) { - File caseDir = (File) returnValue; - String caseName = caseDir.getAbsolutePath(); - caseNameLbl.setText(caseName); - caseNameLbl.setData(caseDir); - checkGenerateButton(); + setCursorBusy(true); + if (caseNameDlg == null || caseNameDlg.isDisposed()) { + caseNameDlg = new CaseNameDialog(shell, targetDir); + caseNameDlg.setCloseCallback(new ICloseCallback() { + + @Override + public void dialogClosed(Object returnValue) { + if (returnValue instanceof File) { + File caseDir = (File) returnValue; + String caseName = caseDir.getAbsolutePath(); + caseNameLbl.setText(caseName); + caseNameLbl.setData(caseDir); + checkGenerateButton(); + } + caseNameDlg = null; + setCursorBusy(false); } - } - }); - dialog.open(); + }); + caseNameDlg.open(); + } else { + caseNameDlg.bringToTop(); + } } - /** - * Enable/Disable file size controls. - * - * @param enabled - * Enabled flag. - */ - private void handleBreakFilesSelection(boolean enabled) { - maxFileSizeLbl.setEnabled(enabled); - fileSizeSpnr.setEnabled(enabled); - fileSizeCbo.setEnabled(enabled); - } + // TODO restore when Multi-file implemented. + // /** + // * Enable/Disable file size controls. + // * + // * @param enabled + // * Enabled flag. + // */ + // private void handleBreakFilesSelection(boolean enabled) { + // maxFileSizeLbl.setEnabled(enabled); + // fileSizeSpnr.setEnabled(enabled); + // fileSizeCbo.setEnabled(enabled); + // } /** * Enables the generate button will user has entered all needed elements. @@ -571,35 +772,36 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements } } - /** - * Action performed when the file size has changed. - */ - private void handleFileSizeChangeSelection() { - /* - * If the same item was selected just return. - */ - if (fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex()).equals( - (String) fileSizeCbo.getData())) { - return; - } - - if (fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex()).equals("MB")) { - fileSizeSpnr.setIncrement(1); - fileSizeSpnr.setPageIncrement(50); - fileSizeSpnr.setMaximum(2000); - fileSizeSpnr.setMinimum(500); - fileSizeSpnr.setSelection(500); - } else { - fileSizeSpnr.setIncrement(1); - fileSizeSpnr.setPageIncrement(5); - fileSizeSpnr.setMinimum(1); - fileSizeSpnr.setMaximum(10); - fileSizeSpnr.setSelection(1); - } - - fileSizeCbo - .setData(fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex())); - } + // TODO restore when Multi-file implemented. + // /** + // * Action performed when the file size has changed. + // */ + // private void handleFileSizeChangeSelection() { + // /* + // * If the same item was selected just return. + // */ + // if (fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex()).equals( + // (String) fileSizeCbo.getData())) { + // return; + // } + // + // if (fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex()).equals("MB")) { + // fileSizeSpnr.setIncrement(1); + // fileSizeSpnr.setPageIncrement(50); + // fileSizeSpnr.setMaximum(2000); + // fileSizeSpnr.setMinimum(500); + // fileSizeSpnr.setSelection(500); + // } else { + // fileSizeSpnr.setIncrement(1); + // fileSizeSpnr.setPageIncrement(5); + // fileSizeSpnr.setMinimum(1); + // fileSizeSpnr.setMaximum(10); + // fileSizeSpnr.setSelection(1); + // } + // + // fileSizeCbo + // .setData(fileSizeCbo.getItem(fileSizeCbo.getSelectionIndex())); + // } /** * Display the directory browser dialog. @@ -624,6 +826,9 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements * Update location's state. */ private void updateLocationState() { + if (isDisposed()) { + return; + } File dir = (File) locationLbl.getData(); long totSpace = dir.getTotalSpace(); long freeSpace = dir.getUsableSpace(); @@ -665,49 +870,57 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements * True for start time, false for end time. */ private void displayDateTimeControls(boolean startTimeFlag) { + setCursorBusy(true); + try { + Date acDate = startTimeFlag ? startDate : endDate; + AwipsCalendar ac = new AwipsCalendar(shell, acDate, 1); + ac.setTimeZone(TimeUtil.newCalendar().getTimeZone()); + ac.setText((startTimeFlag ? "Start" : "End") + " Time Calendar"); - Date acDate = startTimeFlag ? startDate : endDate; - AwipsCalendar ac = new AwipsCalendar(shell, acDate, 1); - ac.setTimeZone(TimeUtil.newCalendar().getTimeZone()); - Date date = (Date) ac.open(); + Date date = (Date) ac.open(); - if (date == null) { - return; - } - - if (startTimeFlag) { - if (date.after(endDate)) { - MessageBox mb = new MessageBox(shell, SWT.ICON_QUESTION - | SWT.OK); - mb.setText("Date Error"); - mb.setMessage("The selected start date is after the end date. Resetting."); - mb.open(); + if (date == null) { return; } - if (!startDate.equals(date)) { - startDate = date; - resetSizes(); - } - } else { - if (date.before(startDate)) { - MessageBox mb = new MessageBox(shell, SWT.ICON_QUESTION - | SWT.OK); - mb.setText("Date Error"); - mb.setMessage("The selected end date is before the start date. Resetting."); - mb.open(); - return; - } - if (!endDate.equals(date)) { - endDate = date; - resetSizes(); - } - } + if (startTimeFlag) { + if (date.after(endDate)) { + MessageBox mb = new MessageBox(shell, SWT.ICON_QUESTION + | SWT.OK); + mb.setText("Date Error"); + mb.setMessage("The selected start date is after the end date. Resetting."); + mb.open(); + return; + } - if (startTimeFlag) { - startTimeLbl.setText(dateFmt.format(date)); - } else { - endTimeLbl.setText(dateFmt.format(date)); + if (!startDate.equals(date)) { + startDate = date; + sizeJob.resetTime(getStart(), getEnd()); + modified(); + } + } else { + if (date.before(startDate)) { + MessageBox mb = new MessageBox(shell, SWT.ICON_QUESTION + | SWT.OK); + mb.setText("Date Error"); + mb.setMessage("The selected end date is before the start date. Resetting."); + mb.open(); + return; + } + if (!endDate.equals(date)) { + endDate = date; + sizeJob.resetTime(getStart(), getEnd()); + modified(); + } + } + + if (startTimeFlag) { + startTimeLbl.setText(dateFmt.format(date)); + } else { + endTimeLbl.setText(dateFmt.format(date)); + } + } finally { + setCursorBusy(false); } } @@ -752,73 +965,12 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements checkGenerateButton(); } - /** - * Reset all entries to unknown size, recompute the sizes for the current - * display table and and other selected entries. - */ - private void resetSizes() { - List selectedDatas = new ArrayList(); - for (String archiveName : archiveInfoMap.keySet()) { - ArchiveInfo archiveInfo = archiveInfoMap.get(archiveName); - for (String categoryName : archiveInfo.getCategoryNames()) { - CategoryInfo categoryInfo = archiveInfo.get(categoryName); - for (DisplayData displayData : categoryInfo - .getDisplayDataList()) { - displayData.setSize(DisplayData.UNKNOWN_SIZE); - if (displayData.isSelected()) { - selectedDatas.add(displayData); - } - } - } - } - - populateTableComp(); - - if (selectedDatas.size() > 0) { - String archiveName = getSelectedArchiveName(); - String categoryName = getSelectedCategoryName(); - Calendar startCal = getStart(); - Calendar endCal = getEnd(); - - for (DisplayData displayData : selectedDatas) { - if (!displayData.isArchive(archiveName) - || !displayData.isCategory(categoryName)) { - sizeJob.queue(new SizeJobRequest(displayData, startCal, - endCal)); - } - } - } - } - - /** - * Get the data information on all selected items; not just the currently - * displayed table. - * - * @return selectedDatas - */ - private List getSelectedData() { - List selectedDatas = new ArrayList(); - for (String archiveName : archiveInfoMap.keySet()) { - ArchiveInfo archiveInfo = archiveInfoMap.get(archiveName); - for (String categoryName : archiveInfo.getCategoryNames()) { - CategoryInfo categoryInfo = archiveInfo.get(categoryName); - for (DisplayData displayData : categoryInfo - .getDisplayDataList()) { - if (displayData.isSelected()) { - selectedDatas.add(displayData); - } - } - } - } - return selectedDatas; - } - /* * (non-Javadoc) * * @see com.raytheon.uf.viz.archive.ui.AbstractArchiveDlg#getStart() */ - // @Override + @Override protected Calendar getStart() { Calendar startCal = TimeUtil.newCalendar(); startCal.setTimeInMillis(startDate.getTime()); @@ -830,10 +982,31 @@ public class CaseCreationDlg extends AbstractArchiveDlg implements * * @see com.raytheon.uf.viz.archive.ui.AbstractArchiveDlg#getEnd() */ - // @Override + @Override protected Calendar getEnd() { Calendar endCal = TimeUtil.newCalendar(); endCal.setTimeInMillis(endDate.getTime()); return endCal; } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.archive.ui.IModifyListener#modified() + */ + @Override + public void modified() { + saveBtn.setEnabled(true); + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.viz.archive.ui.AbstractArchiveDlg#clearModified() + */ + @Override + public void clearModified() { + super.clearModified(); + saveBtn.setEnabled(false); + } } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseLoadSaveDeleteDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseLoadSaveDeleteDlg.java new file mode 100644 index 0000000000..3dd68b9058 --- /dev/null +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseLoadSaveDeleteDlg.java @@ -0,0 +1,261 @@ +/** + * 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.viz.archive.ui; + +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.List; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Text; + +import com.raytheon.uf.common.archive.config.ArchiveConfigManager; +import com.raytheon.uf.common.archive.config.ArchiveConstants; +import com.raytheon.viz.ui.dialogs.CaveSWTDialog; + +/** + * Dialog to display a list of select files for Load, Save As or Delete. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 31, 2013 2221       rferrel     Initial creation
+ * Aug 26, 2013 2225       rferrel     Make perspective independent.
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ + +public class CaseLoadSaveDeleteDlg extends CaveSWTDialog { + public static enum Type { + SaveAs("Save As", " Save "), Load("Load", " Load "), Delete("Delete", + " Delete "); + private String title; + + private String btnLabel; + + private Type(String title, String btnLabel) { + this.title = title; + this.btnLabel = btnLabel; + } + + public String getTitle() { + return title; + } + + public String getBtnLabel() { + return btnLabel; + } + } + + private Type type; + + private List caseList; + + private Text fileNameText; + + private Button okBtn; + + private Button cancelBtn; + + protected CaseLoadSaveDeleteDlg(Shell parentShell, Type type) { + super(parentShell, SWT.DIALOG_TRIM | SWT.RESIZE, CAVE.DO_NOT_BLOCK + | CAVE.PERSPECTIVE_INDEPENDENT); + this.type = type; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.viz.ui.dialogs.CaveSWTDialogBase#initializeComponents(org + * .eclipse.swt.widgets.Shell) + */ + @Override + protected void initializeComponents(Shell shell) { + setText(type.getTitle() + " Case"); + Composite mainComp = new Composite(shell, SWT.NONE); + GridLayout gl = new GridLayout(1, false); + gl.marginHeight = 0; + gl.marginWidth = 0; + gl.horizontalSpacing = 0; + mainComp.setLayout(gl); + init(); + } + + /** + * Set up dialog layout. + */ + private void init() { + createCaseControls(); + GuiUtil.addSeparator(shell, SWT.HORIZONTAL); + createBottomAcitonButtons(); + } + + /** + * Main body of the dialog. + */ + private void createCaseControls() { + Composite caseComp = new Composite(shell, SWT.NONE); + GridLayout gl = new GridLayout(1, false); + GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); + caseComp.setLayout(gl); + caseComp.setLayoutData(gd); + + caseList = new List(caseComp, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); + gd = new GridData(SWT.FILL, SWT.FILL, true, true); + gd.minimumHeight = 300; + caseList.setLayoutData(gd); + + caseList.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + fileNameText.setText(caseList.getSelection()[0]); + } + }); + + fileNameText = new Text(caseComp, SWT.BORDER | SWT.SINGLE); + gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false); + fileNameText.setLayoutData(gd); + fileNameText.setEditable(type == Type.SaveAs); + } + + /** + * Button layout at the bottom of the dialog. + */ + private void createBottomAcitonButtons() { + Composite actionControlComp = new Composite(shell, SWT.NONE); + GridLayout gl = new GridLayout(2, false); + GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false); + actionControlComp.setLayout(gl); + actionControlComp.setLayoutData(gd); + okBtn = new Button(actionControlComp, SWT.PUSH); + okBtn.setText(type.getBtnLabel()); + okBtn.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + String name = verifyAction(); + if (name != null) { + setReturnValue(name); + close(); + } + } + }); + + cancelBtn = new Button(actionControlComp, SWT.PUSH); + cancelBtn.setText(" Cancel "); + gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false); + cancelBtn.setLayoutData(gd); + cancelBtn.addSelectionListener(new SelectionAdapter() { + + @Override + public void widgetSelected(SelectionEvent e) { + close(); + } + }); + } + + /** + * Verify pending action and return select case name to continue the action. + * + * @return name when ok to perform action otherwise null + */ + private String verifyAction() { + String name = fileNameText.getText().trim(); + + if (name.isEmpty()) { + MessageDialog.openError(shell, "Case Error", "Invalid case name."); + name = null; + } else { + switch (type) { + case Load: + // No need to check since text is not editable. + break; + case SaveAs: + for (String cName : caseList.getItems()) { + if (name.equals(cName)) { + boolean response = MessageDialog + .openConfirm( + shell, + "Case Confirmation", + "Case \"" + + name + + "\" exists.\nSelect OK to overwrite."); + if (!response) { + name = null; + fileNameText.selectAll(); + fileNameText.forceFocus(); + } + break; + } + } + break; + case Delete: + if (!MessageDialog.openConfirm(shell, "Case Confirmation", + "Press OK to delete \"" + name + "\".")) { + name = null; + } + break; + default: + name = null; + } + } + return name; + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.viz.ui.dialogs.CaveSWTDialog#preOpened() + */ + @Override + protected void preOpened() { + super.preOpened(); + populateList(); + } + + /** + * Populate case names in the list. + */ + private void populateList() { + caseList.add(ArchiveConstants.defaultSelectName); + String[] names = ArchiveConfigManager.getInstance().getSelectionNames( + ArchiveConstants.Type.Case); + for (String name : names) { + if (!ArchiveConstants.defaultSelectName.equals(name)) { + caseList.add(name); + } + } + caseList.select(0); + fileNameText.setText(caseList.getItem(0)); + } +} diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseNameDialog.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseNameDialog.java index 60a5e16b54..b147c1a4c7 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseNameDialog.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/CaseNameDialog.java @@ -47,6 +47,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jun 5, 2013 1966 rferrel Initial creation + * Aug 26, 2013 2225 rferrel Make perspective independent. * * * @@ -65,7 +66,7 @@ public class CaseNameDialog extends CaveSWTDialog { /** Non-blocking modal constructor. */ protected CaseNameDialog(Shell parent, File locationDir) { super(parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL, - CAVE.DO_NOT_BLOCK); + CAVE.DO_NOT_BLOCK | CAVE.PERSPECTIVE_INDEPENDENT); this.locationDir = locationDir; } @@ -98,7 +99,7 @@ public class CaseNameDialog extends CaveSWTDialog { } /** - * The xomposite with case name text field. + * The composite with case name text field. */ private void createFieldsComp() { Composite fieldComp = new Composite(shell, SWT.NONE); diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/GenerateCaseDlg.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/GenerateCaseDlg.java index 5ec5cfa75a..dc398ba589 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/GenerateCaseDlg.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/GenerateCaseDlg.java @@ -19,12 +19,24 @@ **/ package com.raytheon.uf.viz.archive.ui; +import java.io.Closeable; import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Calendar; +import java.util.HashSet; import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.zip.GZIPOutputStream; +import org.apache.commons.compress.archivers.ArchiveOutputStream; +import org.apache.commons.compress.archivers.ArchiveStreamFactory; +import org.apache.commons.compress.archivers.tar.TarArchiveEntry; +import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; +import org.apache.commons.io.FileUtils; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; @@ -45,6 +57,7 @@ import org.eclipse.swt.widgets.ProgressBar; import org.eclipse.swt.widgets.Shell; import com.raytheon.uf.common.archive.config.ArchiveConfigManager; +import com.raytheon.uf.common.archive.config.ArchiveConstants; import com.raytheon.uf.common.archive.config.DisplayData; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -54,7 +67,8 @@ import com.raytheon.uf.viz.core.VizApp; import com.raytheon.viz.ui.dialogs.CaveSWTDialog; /** - * Class to show progress of creating a case. + * This class performs the desired type of case creation and display a + * progress/status message dialog. * *
  * 
@@ -63,10 +77,14 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Jun 3, 2013  1966       rferrel     Initial creation
+ * Aug 16, 2013 2225       rferrel     Change structure of copy to include
+ *                                     archive and category directory and 
+ *                                     implementation of compression.
+ * Oct 08, 2013 2442       rferrel     Remove category directory.
  * 
  * 
* - * @author rferrelGenerateJob + * @author rferrel * @version 1.0 */ @@ -86,9 +104,6 @@ public class GenerateCaseDlg extends CaveSWTDialog { /** Active have generation is finish or has an error. */ private Button closeBtn; - /** The main destination directory. */ - private final File targetDir; - /** * The case's destination directory. Assumed to be a sub-directory of * targetDir. @@ -102,19 +117,17 @@ public class GenerateCaseDlg extends CaveSWTDialog { private final Calendar endCal; /** Data list for the case. */ - private final List sourceDataList; + private final DisplayData[] sourceDataList; /** When true compress the case directory. */ private final boolean doCompress; - /** When true break the compress file into multliple files. */ + /** When true break the compress file into multiple files. */ private final boolean doMultiFiles; - /** The compress size for muliple files. */ - private final int compressSize; - - /** Assumed to be MG or GB to indicate scaling factor for compressSize. */ - private final String sizeType; + // Needed when compress and split implemented + // /** The compress size for multiple files. */ + // private final long splitSize; /** Job to perform the case generation off of the UI thread. */ private GenerateJob generateJob; @@ -140,24 +153,24 @@ public class GenerateCaseDlg extends CaveSWTDialog { * @param sourceList * @param doCompress * @param doMultiFiles - * @param compressSize - * @param sizeType + * @param splitSize */ protected GenerateCaseDlg(Shell parentShell, File targetDir, File caseDir, Calendar startCal, Calendar endCal, List sourceList, - boolean doCompress, boolean doMultiFiles, int compressSize, - String sizeType) { - super(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL, - CAVE.DO_NOT_BLOCK); - this.targetDir = targetDir; + boolean doCompress, boolean doMultiFiles, long splitSize) { + super(parentShell, SWT.DIALOG_TRIM, CAVE.DO_NOT_BLOCK + | CAVE.PERSPECTIVE_INDEPENDENT); this.caseDir = caseDir; this.startCal = startCal; this.endCal = endCal; - this.sourceDataList = new ArrayList(sourceList); + this.sourceDataList = sourceList.toArray(new DisplayData[sourceList + .size()]); + Arrays.sort(this.sourceDataList, DisplayData.LABEL_ORDER); this.doCompress = doCompress; this.doMultiFiles = doMultiFiles; - this.compressSize = compressSize; - this.sizeType = sizeType; + + // Needed when compress and split implemented. + // this.splitSize = splitSize; this.caseName = caseDir.getAbsolutePath().substring( targetDir.getAbsolutePath().length() + 1); setText("Generating - " + caseName); @@ -173,7 +186,7 @@ public class GenerateCaseDlg extends CaveSWTDialog { } /** - * Remve a job listener. + * Remove a job listener. * * @param listener */ @@ -357,10 +370,10 @@ public class GenerateCaseDlg extends CaveSWTDialog { * The performs the work of generating the case on a non-UI thread. */ private class GenerateJob extends Job { - boolean shutdown = false; + private final AtomicBoolean shutdown = new AtomicBoolean(false); public GenerateJob() { - super("Generate Job"); + super("Generate Case"); } @Override @@ -371,81 +384,100 @@ public class GenerateCaseDlg extends CaveSWTDialog { setStateLbl("Creating: " + caseDir.getName(), caseDir.getAbsolutePath()); + ICaseCopy caseCopy = null; + + String errorMessage = null; if (caseDir.exists()) { - setStateLbl("Case exists: " + caseName, - caseDir.getAbsolutePath()); + errorMessage = "Case exists: " + caseDir.getName(); + } else if (!caseDir.mkdirs()) { + errorMessage = "Unable to create case: " + caseDir.getName(); + } + + if (errorMessage != null) { + setStateLbl(errorMessage, caseDir.getAbsolutePath()); setProgressBar(100, SWT.ERROR); return Status.OK_STATUS; } - if (!caseDir.mkdirs()) { - setStateLbl("Unable to create case: " + caseName, - caseDir.getAbsolutePath()); - setProgressBar(100, SWT.ERROR); + if (shutdown.get()) { return Status.OK_STATUS; } - if (shutdown) { - return Status.OK_STATUS; - } + String currentArchive = null; + String currentCategory = null; + boolean updateDestDir = false; - for (DisplayData displayData : sourceDataList) { - if (shutdown) { - return Status.OK_STATUS; - } - - setStateLbl( - "Copying \"" + displayData.getDisplayLabel() + "\"", - null); - String rootDir = displayData.getRootDir(); - int beginIndex = rootDir.length(); - - List files = archiveManager.getDisplayFiles(displayData, - startCal, endCal); - for (File source : files) { - if (shutdown) { + try { + for (DisplayData displayData : sourceDataList) { + if (shutdown.get()) { return Status.OK_STATUS; } - String name = source.getAbsolutePath(); - String relativePath = name.substring(beginIndex); + if (!displayData.getArchiveName().equals(currentArchive)) { + updateDestDir = true; + currentArchive = displayData.getArchiveName(); + currentCategory = displayData.getCategoryName(); + } else if (!displayData.getCategoryName().equals( + currentCategory)) { + updateDestDir = true; + currentCategory = displayData.getCategoryName(); + } - setStateLbl("Copy: " + relativePath, name); - File destination = new File(caseDir, relativePath); - try { - if (source.isDirectory()) { - destination.mkdirs(); - FileUtil.copyDirectory(source, destination); + if (updateDestDir) { + updateDestDir = false; + if (caseCopy != null) { + caseCopy.finishCase(); } else { - File destParent = destination.getParentFile(); - destParent.mkdirs(); - FileUtil.copyFile(source, destination); + if (!doCompress) { + caseCopy = new CopyMove(); + } else if (doMultiFiles) { + caseCopy = new CompressAndSplitCopy(); + } else { + caseCopy = new CompressCopy(); + } } - } catch (IOException e) { - statusHandler.handle(Priority.PROBLEM, - e.getLocalizedMessage(), e); + caseCopy.startCase(caseDir, displayData, shutdown); + setStateLbl(currentArchive + " | " + currentCategory, + caseDir.getAbsolutePath() + "\n" + + currentArchive + "\n" + + currentCategory); + } + + List files = archiveManager.getDisplayFiles( + displayData, startCal, endCal); + for (File source : files) { + if (shutdown.get()) { + return Status.OK_STATUS; + } + + caseCopy.copy(source); } } - } + if (caseCopy != null) { + caseCopy.finishCase(); + } + caseCopy = null; - if (!doCompress) { - setProgressBar(100, SWT.NORMAL); setStateLbl("Created: " + caseName, caseDir.getAbsolutePath()); - return Status.OK_STATUS; - } - - if (shutdown) { - return Status.OK_STATUS; - } - - if (doMultiFiles) { setProgressBar(100, SWT.NORMAL); - String message = "Compress into multifiles NYI."; - setStateLbl(message, null); - } else { - setProgressBar(100, SWT.NORMAL); - String message = "Compress into one file NYI"; - setStateLbl(message, null); + + } catch (CaseCreateException e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), + e); + setStateLbl( + "Failed to Create: " + caseName, + caseDir.getAbsolutePath() + "\n" + + e.getLocalizedMessage()); + setProgressBar(100, SWT.ERROR); + } finally { + if (caseCopy != null) { + try { + caseCopy.finishCase(); + } catch (CaseCreateException ex) { + // Ignore + } + caseCopy = null; + } } return Status.OK_STATUS; @@ -458,8 +490,588 @@ public class GenerateCaseDlg extends CaveSWTDialog { */ @Override protected void canceling() { - shutdown = true; + shutdown.set(true); generateJob = null; } } + + /** + * This class copies selected files/directories to a case-directory/archive. + */ + private static class CopyMove implements ICaseCopy { + /** + * Flag to indicate user canceled the case generation. + */ + private AtomicBoolean shutdown; + + /** + * Top destination directory to move files/dirctories to. + */ + private File destDir; + + /** + * Index on source Files where relative path starts. + */ + private int startRelativePath; + + /** + * Copy source File to desired destination. + * + * @param source + * @param destination + * @throws IOException + */ + private void copyFile(File source, File destination) throws IOException { + if (shutdown.get()) { + return; + } + + if (source.isDirectory()) { + + if (!destination.exists()) { + destination.mkdir(); + } + + String[] files = source.list(); + + for (String file : files) { + copyFile(new File(source, file), + new File(destination, file)); + } + } else { + FileUtil.copyFile(source, destination); + destination.setLastModified(source.lastModified()); + } + } + + @Override + public void copy(File source) throws CaseCreateException { + String relativePath = source.getAbsolutePath().substring( + startRelativePath); + File destination = new File(destDir, relativePath); + try { + destination.getParentFile().mkdirs(); + copyFile(source, destination); + } catch (IOException ex) { + throw new CaseCreateException("CopyMove.copy: ", ex); + } + } + + @Override + public void startCase(File caseDir, DisplayData displayData, + AtomicBoolean shutdown) { + this.shutdown = shutdown; + String archiveDirName = ArchiveConstants + .convertToFileName(displayData.getArchiveName()); + destDir = new File(caseDir, archiveDirName); + destDir.mkdirs(); + startRelativePath = displayData.getRootDir().length(); + } + + @Override + public void finishCase() { + // Nothing to do. + } + } + + /** + * This class takes selected directories/files to + * case-directory/archive/compress-category-file. The compress-category-file + * is a tar gzip file containing the categorie's data. + */ + private static class CompressCopy implements ICaseCopy { + /** + * Flag to indicate user canceled case generation. + */ + private AtomicBoolean shutdown; + + /** + * Top Level destination directory. + */ + private File destDir; + + /** + * Stream to the file being created. + */ + private FileOutputStream fileStream; + + /** + * Stream to perform the compression. + */ + private GZIPOutputStream zipStream; + + /** + * Stream to create the tar image. + */ + private ArchiveOutputStream tarStream; + + /** + * Index to start of relative path in source File. + */ + private int startRelativePath; + + /** + * Directories already created in the tar image. + */ + private final HashSet tarDirFile = new HashSet(); + + /** + * Buffer to use for reading in a file. + */ + private final byte[] buffer = new byte[(int) (32 * FileUtils.ONE_KB)]; + + @Override + public void copy(File source) throws CaseCreateException { + try { + addParentDir(source); + addTarFiles(new File[] { source }); + } catch (IOException e) { + throw new CaseCreateException("Compress Copy failed: ", e); + } + } + + /** + * Add list of Files to the tar image. + * + * @param files + * @throws IOException + */ + private void addTarFiles(File[] files) throws IOException { + for (File file : files) { + if (shutdown.get()) { + return; + } + String name = file.getAbsolutePath().substring( + startRelativePath); + if (file.isDirectory()) { + if (!tarDirFile.contains(file)) { + TarArchiveEntry entry = new TarArchiveEntry(file, name); + tarStream.putArchiveEntry(entry); + tarStream.closeArchiveEntry(); + tarDirFile.add(file); + addTarFiles(file.listFiles()); + } + } else { + TarArchiveEntry entry = new TarArchiveEntry(file, name); + entry.setSize(file.length()); + FileInputStream fileStream = null; + tarStream.putArchiveEntry(entry); + try { + fileStream = new FileInputStream(file); + int len; + while ((len = fileStream.read(buffer)) != -1) { + tarStream.write(buffer, 0, len); + } + } finally { + if (fileStream != null) { + closeStream(fileStream); + } + } + + tarStream.closeArchiveEntry(); + } + } + } + + /** + * Convince method to close a steam and ignore any IOException. + * + * @param stream + */ + private void closeStream(Closeable stream) { + try { + stream.close(); + } catch (IOException ex) { + // Ignore + } + } + + /** + * If needed add parent directories to the tar image. + * + * @param file + * @throws IOException + */ + private void addParentDir(File file) throws IOException { + File parent = file.getParentFile(); + if (parent != null && !tarDirFile.contains(parent) + && (parent.getAbsolutePath().length() > startRelativePath)) { + addParentDir(parent); + String name = parent.getAbsolutePath().substring( + startRelativePath); + TarArchiveEntry entry = new TarArchiveEntry(parent, name); + tarStream.putArchiveEntry(entry); + tarStream.closeArchiveEntry(); + tarDirFile.add(parent); + } + } + + @Override + public void startCase(File caseDir, DisplayData displayData, + AtomicBoolean shutdown) throws CaseCreateException { + try { + this.shutdown = shutdown; + String archiveDirName = ArchiveConstants + .convertToFileName(displayData.getArchiveName()); + String categoryDirName = ArchiveConstants + .convertToFileName(displayData.getCategoryName()); + destDir = new File(caseDir, archiveDirName); + destDir.mkdirs(); + tarDirFile.clear(); + startRelativePath = displayData.getRootDir().length(); + File tarFile = new File(destDir, categoryDirName + + ArchiveConstants.TAR_EXTENSION); + fileStream = new FileOutputStream(tarFile); + zipStream = new GZIPOutputStream(fileStream); + ArchiveStreamFactory factory = new ArchiveStreamFactory(); + tarStream = factory.createArchiveOutputStream( + ArchiveStreamFactory.TAR, zipStream); + if (tarStream instanceof TarArchiveOutputStream) { + ((TarArchiveOutputStream) tarStream) + .setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); + } + } catch (Exception e) { + throw new CaseCreateException("CompressCopy.startCase: ", e); + } + } + + @Override + public void finishCase() throws CaseCreateException { + try { + if (tarStream != null) { + tarStream.finish(); + } + if (zipStream != null) { + zipStream.finish(); + } + } catch (IOException e) { + throw new CaseCreateException("CaseCopy.finish: ", e); + } finally { + if (tarStream != null) { + closeStream(tarStream); + } else if (zipStream != null) { + closeStream(zipStream); + } else if (fileStream != null) { + closeStream(fileStream); + } + tarStream = null; + zipStream = null; + fileStream = null; + } + } + } + + /* + * This class intended for making "image" files read for burning to a CD or + * DVD. Need to resolve issues on how this should be done. + */ + private static class CompressAndSplitCopy implements ICaseCopy { + + public void startCase(File caseDir, DisplayData displayData, + AtomicBoolean shutdown) throws CaseCreateException { + throw new CaseCreateException( + "Compress and split not yet implemented."); + } + + @Override + public void copy(File source) throws CaseCreateException { + // TODO Auto-generated method stub + + } + + @Override + public void finishCase() { + // TODO Auto-generated method stub + } + + // TODO Example code for future implementation of this class. + // Will need to break up into the starCase, copy and finishCase will + // need close and join. + + // private void compressAndSplitCase() { + // ArchiveOutputStream tarStream = null; + // GZIPOutputStream zipStream = null; + // try { + // Pipe pipe = Pipe.open(); + // OutputStream poStream = Channels.newOutputStream(pipe.sink()); + // zipStream = new GZIPOutputStream(poStream); + // ArchiveStreamFactory factory = new ArchiveStreamFactory(); + // + // tarStream = factory.createArchiveOutputStream( + // ArchiveStreamFactory.TAR, zipStream); + // + // if (tarStream instanceof TarArchiveOutputStream) { + // ((TarArchiveOutputStream) tarStream) + // .setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); + // } + // + // final InputStream piStream = Channels.newInputStream(pipe + // .source()); + // splitDone.set(false); + // + // Job splitJob = new Job("Split") { + // + // @Override + // protected IStatus run(IProgressMonitor monitor) { + // OutputStream splitStream = null; + // long totSize = 0; + // try { + // byte[] buffer = new byte[12 * 1024]; + // + // int bufCnt = 0; + // long splitCnt = 0L; + // while ((bufCnt = piStream.read(buffer)) != -1) { + // totSize += bufCnt; + // if (splitStream == null) { + // splitStream = openSplitFile(++numSplitFiles); + // } + // long fileSize = splitCnt + bufCnt; + // if (fileSize < splitSize) { + // splitStream.write(buffer, 0, bufCnt); + // splitCnt = fileSize; + // } else if (fileSize == splitSize) { + // splitStream.write(buffer, 0, bufCnt); + // splitStream.close(); + // splitStream = null; + // splitCnt = 0L; + // } else { + // int cnt = (int) (splitSize - splitCnt); + // splitStream.write(buffer, 0, cnt); + // splitStream.close(); + // splitStream = openSplitFile(++numSplitFiles); + // int remainder = bufCnt - cnt; + // splitStream.write(buffer, cnt, remainder); + // splitCnt = remainder; + // } + // } + // } catch (IOException e) { + // statusHandler.handle(Priority.PROBLEM, + // e.getLocalizedMessage(), e); + // } finally { + // if (splitStream != null) { + // try { + // splitStream.close(); + // } catch (IOException e) { + // // Ignore + // } + // } + // splitDone.set(true); + // System.out.println("totalSize: " + totSize + // + ", splitSize: " + splitSize + // + ", numSplitFiles: " + numSplitFiles); + // } + // + // return Status.OK_STATUS; + // } + // }; + // splitJob.schedule(); + // + // createTarFile(tarStream, caseDir.listFiles()); + // tarStream.finish(); + // zipStream.finish(); + // try { + // tarStream.close(); + // } catch (IOException ex) { + // // Ignore + // } + // tarStream = null; + // + // try { + // zipStream.close(); + // } catch (IOException ex) { + // // Ignore + // } + // zipStream = null; + // + // while (!splitDone.get()) { + // if (splitJob.getState() == Job.RUNNING) { + // try { + // System.out.println("splitJob.join()"); + // splitJob.join(); + // } catch (InterruptedException e) { + // statusHandler.handle(Priority.INFO, + // e.getLocalizedMessage(), e); + // } + // } else { + // try { + // private void compressAndSplitCase() { + // ArchiveOutputStream tarStream = null; + // GZIPOutputStream zipStream = null; + // try { + // Pipe pipe = Pipe.open(); + // OutputStream poStream = Channels.newOutputStream(pipe.sink()); + // zipStream = new GZIPOutputStream(poStream); + // ArchiveStreamFactory factory = new ArchiveStreamFactory(); + // + // tarStream = factory.createArchiveOutputStream( + // ArchiveStreamFactory.TAR, zipStream); + // + // if (tarStream instanceof TarArchiveOutputStream) { + // ((TarArchiveOutputStream) tarStream) + // .setLongFileMode(TarArchiveOutputStream.LONGFILE_GNU); + // } + // + // final InputStream piStream = Channels.newInputStream(pipe + // .source()); + // splitDone.set(false); + // + // Job splitJob = new Job("Split") { + // + // @Override + // protected IStatus run(IProgressMonitor monitor) { + // OutputStream splitStream = null; + // long totSize = 0; + // try { + // byte[] buffer = new byte[12 * 1024]; + // + // int bufCnt = 0; + // long splitCnt = 0L; + // while ((bufCnt = piStream.read(buffer)) != -1) { + // totSize += bufCnt; + // if (splitStream == null) { + // splitStream = openSplitFile(++numSplitFiles); + // } + // long fileSize = splitCnt + bufCnt; + // if (fileSize < splitSize) { + // splitStream.write(buffer, 0, bufCnt); + // splitCnt = fileSize; + // } else if (fileSize == splitSize) { + // splitStream.write(buffer, 0, bufCnt); + // splitStream.close(); + // splitStream = null; + // splitCnt = 0L; + // } else { + // int cnt = (int) (splitSize - splitCnt); + // splitStream.write(buffer, 0, cnt); + // splitStream.close(); + // splitStream = openSplitFile(++numSplitFiles); + // int remainder = bufCnt - cnt; + // splitStream.write(buffer, cnt, remainder); + // splitCnt = remainder; + // } + // } + // } catch (IOException e) { + // statusHandler.handle(Priority.PROBLEM, + // e.getLocalizedMessage(), e); + // } finally { + // if (splitStream != null) { + // try { + // splitStream.close(); + // } catch (IOException e) { + // // Ignore + // } + // } + // splitDone.set(true); + // System.out.println("totalSize: " + totSize + // + ", splitSize: " + splitSize + // + ", numSplitFiles: " + numSplitFiles); + // } + // + // return Status.OK_STATUS; + // } + // }; + // splitJob.schedule(); + // + // createTarFile(tarStream, caseDir.listFiles()); + // tarStream.finish(); + // zipStream.finish(); + // try { + // tarStream.close(); + // } catch (IOException ex) { + // // Ignore + // } + // tarStream = null; + // + // try { + // zipStream.close(); + // } catch (IOException ex) { + // // Ignore + // } + // zipStream = null; + // + // while (!splitDone.get()) { + // if (splitJob.getState() == Job.RUNNING) { + // try { + // System.out.println("splitJob.join()"); + // splitJob.join(); + // } catch (InterruptedException e) { + // statusHandler.handle(Priority.INFO, + // e.getLocalizedMessage(), e); + // } + // } else { + // try { + // Thread.sleep(200L); + // } catch (InterruptedException e) { + // statusHandler.handle(Priority.INFO, + // e.getLocalizedMessage(), e); + // } + // } + // } + // } catch (IOException e) { + // statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), + // e); + // } catch (ArchiveException e1) { + // statusHandler.handle(Priority.PROBLEM, + // e1.getLocalizedMessage(), e1); + // } finally { + // if (tarStream != null) { + // try { + // tarStream.close(); + // } catch (IOException e) { + // // Ignore + // } + // } + // + // if (zipStream != null) { + // try { + // zipStream.close(); + // } catch (IOException e) { + // // Ignore + // } + // } + // } + // setProgressBar(100, SWT.NORMAL); + // deleteCaseDir(); + // String message = caseDir.getName() + "split into " + numSplitFiles + // + " file(s)."; + // setStateLbl(message, null); + // } + // Thread.sleep(200L); + // } catch (InterruptedException e) { + // statusHandler.handle(Priority.INFO, + // e.getLocalizedMessage(), e); + // } + // } + // } + // } catch (IOException e) { + // statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), + // e); + // } catch (ArchiveException e1) { + // statusHandler.handle(Priority.PROBLEM, + // e1.getLocalizedMessage(), e1); + // } finally { + // if (tarStream != null) { + // try { + // tarStream.close(); + // } catch (IOException e) { + // // Ignore + // } + // } + // + // if (zipStream != null) { + // try { + // zipStream.close(); + // } catch (IOException e) { + // // Ignore + // } + // } + // } + // setProgressBar(100, SWT.NORMAL); + // deleteCaseDir(); + // String message = caseDir.getName() + "split into " + numSplitFiles + // + " file(s)."; + // setStateLbl(message, null); + // } + + } } diff --git a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJobRequest.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ICaseCopy.java similarity index 52% rename from cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJobRequest.java rename to cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ICaseCopy.java index 0de53cd1e8..5c948250fd 100644 --- a/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/data/SizeJobRequest.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/ICaseCopy.java @@ -17,18 +17,17 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ -package com.raytheon.uf.viz.archive.data; +package com.raytheon.uf.viz.archive.ui; import java.io.File; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; +import java.io.IOException; +import java.util.concurrent.atomic.AtomicBoolean; import com.raytheon.uf.common.archive.config.DisplayData; /** - * This class obtains information on a File in a Job in order to remove it from - * the UI thread. + * Interface for copying source files/directories to the desired type of + * destination. * *
  * 
@@ -36,7 +35,7 @@ import com.raytheon.uf.common.archive.config.DisplayData;
  * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * May 15, 2013 1966       rferrel     Initial creation
+ * Aug 21, 2013 2225       rferrel     Initial creation
  * 
  * 
* @@ -44,39 +43,34 @@ import com.raytheon.uf.common.archive.config.DisplayData; * @version 1.0 */ -public class SizeJobRequest { - - /** Information from archive configuration manager. */ - final DisplayData displayData; - - /** Files or directories to obtain information on. */ - final List files = new ArrayList(); - - /** Start time inclusive. */ - final Calendar startCal; - - /** End time exclusive. */ - final Calendar endCal; +public interface ICaseCopy { /** - * Create and entry and place it on the queue. + * Prepare copier for sending display data's archive and category + * selections. * + * @param caseDir + * - top level case directory file * @param displayData - * @param startCal - * @param endCal + * - data preparing to move + * @param shutdown + * - Flag to check for orderly shudown + * @throws CaseCreateException */ - public SizeJobRequest(DisplayData displayData, Calendar startCal, - Calendar endCal) { - this.displayData = displayData; - this.startCal = startCal; - this.endCal = endCal; - } + public void startCase(File caseDir, DisplayData displayData, + AtomicBoolean shutdown) throws CaseCreateException; /** + * A source to copy. * - * @return displayData + * @param source + * @throws IOException */ - public DisplayData getDisplayData() { - return displayData; - } + public void copy(File source) throws CaseCreateException; + + /** + * Finish the move process for the current archive and category. + * + */ + public void finishCase() throws CaseCreateException; } diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/util/package-info.java b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/IRetentionHour.java similarity index 54% rename from edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/util/package-info.java rename to cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/IRetentionHour.java index db65de0edd..444b9b4ce7 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/util/package-info.java +++ b/cave/com.raytheon.uf.viz.archive/src/com/raytheon/uf/viz/archive/ui/IRetentionHour.java @@ -17,7 +17,31 @@ * See the AWIPS II Master Rights File ("Master Rights File.pdf") for * further licensing information. **/ +package com.raytheon.uf.viz.archive.ui; + /** - * Contains utility classes for mesowest plugin + * Interface to adjusting values based on the retention hour value found in a + * selection configuration. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Aug 13, 2013 2220       rferrel     Initial creation
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 */ -package com.raytheon.edex.plugin.obs.mesowest.util; \ No newline at end of file + +public interface IRetentionHour { + /** + * Adjust start/end based on the value found in selection configuration. + * + * @param startRetentionHours + */ + public void setRetentionTimes(long startRetentionHours); +} diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/VizApp.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/VizApp.java index 642e0ea3bf..13b2ac02c9 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/VizApp.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/VizApp.java @@ -50,6 +50,8 @@ import com.raytheon.uf.viz.core.localization.LocalizationManager; * 7/1/06 chammack Initial Creation. * Sep 12, 2012 1167 djohnson Add datadelivery servers. * Jan 14, 2013 1469 bkowal Removed the hdf5 data directory. + * Aug 27, 2013 2295 bkowal Removed the jms server property; added + * jms connection string * * * @@ -70,16 +72,10 @@ public final class VizApp { private static String httpServer; - private static String jmsServer; + private static String jmsConnectionString; private static String pypiesServer; - private static String dataDeliveryServer; - - private static String dataDeliveryLcmServer; - - private static String dataDeliveryQueryServer; - static { ManagementFactory.getRuntimeMXBean().getName(); } @@ -240,12 +236,12 @@ public final class VizApp { VizApp.httpServer = System.getProperty("awips.httpServer", httpServer); } - public static String getJmsServer() { - return jmsServer; + public static String getJmsConnectionString() { + return jmsConnectionString; } - public static void setJmsServer(String jmsServer) { - VizApp.jmsServer = jmsServer; + public static void setJmsConnectionString(String jmsConnectionString) { + VizApp.jmsConnectionString = jmsConnectionString; } public static String getPypiesServer() { diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/comm/JMSConnection.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/comm/JMSConnection.java index 7d06157abf..51c771d22d 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/comm/JMSConnection.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/comm/JMSConnection.java @@ -20,14 +20,13 @@ package com.raytheon.uf.viz.core.comm; -import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import javax.jms.ConnectionFactory; - import org.apache.qpid.client.AMQConnectionFactory; -import org.apache.qpid.url.URLSyntaxException; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.viz.core.VizApp; /** @@ -43,16 +42,23 @@ import com.raytheon.uf.viz.core.VizApp; * Nov 2, 2011 #7391 bkowal Ensure that the generated WsId is properly formatted to be * included in a url. * May 09, 2013 1814 rjpeter Updated prefetch to 10. + * Aug 27, 2013 2295 bkowal The entire connection string is now provided by EDEX; so, it + * no longer needs to be constructed. Replaced stacktrace + * printing with UFStatus. * * * @author chammack * @version 1.0 */ public class JMSConnection { + private static final IUFStatusHandler statusHandler = UFStatus + .getHandler(JMSConnection.class); + + private static final String WSID_PLACEHOLDER = "__WSID__"; private static JMSConnection instance; - private final String jndiProviderUrl; + private final String connectionUrl; private AMQConnectionFactory factory; @@ -65,38 +71,27 @@ public class JMSConnection { } public JMSConnection() { - this(VizApp.getJmsServer()); + this(VizApp.getJmsConnectionString()); } - public JMSConnection(String jndiProviderUrl) { - this.jndiProviderUrl = jndiProviderUrl; + public JMSConnection(String connectionUrl) { + this.connectionUrl = connectionUrl; try { - // do not enable retry/connectdelay connection and factory will - // silently reconnect and user will never be notified qpid is down - // and cave/text workstation will just act like they are hung - // up to each individual component that opens a connection to handle - // reconnect - this.factory = new AMQConnectionFactory( - "amqp://guest:guest@" - + URLEncoder.encode(VizApp.getWsId().toString(), - "UTF-8") - + "/edex?brokerlist='" - + this.jndiProviderUrl - + "?connecttimeout='5000'&heartbeat='0''&maxprefetch='10'&sync_publish='all'&failover='nofailover'"); - } catch (URLSyntaxException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (UnsupportedEncodingException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); + String wsid = URLEncoder.encode(VizApp.getWsId().toString(), + "UTF-8"); + this.factory = new AMQConnectionFactory(this.connectionUrl.replace( + WSID_PLACEHOLDER, wsid)); + } catch (Exception e) { + statusHandler.fatal("Failed to connect to the JMS Server!", e); } } /** - * @return the jndiProviderUrl + * + * @return the jms connection url */ - public String getJndiProviderUrl() { - return jndiProviderUrl; + public String getConnectionUrl() { + return connectionUrl; } /** diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/LocalizationInitializer.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/LocalizationInitializer.java index 0cd5778453..cde646daa6 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/LocalizationInitializer.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/LocalizationInitializer.java @@ -50,6 +50,8 @@ import com.raytheon.uf.viz.core.requests.ThriftClient; * Nov 5, 2009 mschenke Initial creation * Sep 12, 2012 1167 djohnson Add datadelivery servers. * Jan 14, 2013 1469 bkowal Removed the hdf5 data directory. + * Aug 27, 2013 2295 bkowal The entire jms connection string is now + * provided by EDEX. * * * @@ -125,7 +127,7 @@ public class LocalizationInitializer { GetServersResponse resp = (GetServersResponse) ThriftClient .sendLocalizationRequest(req); VizApp.setHttpServer(resp.getHttpServer()); - VizApp.setJmsServer(resp.getJmsServer()); + VizApp.setJmsConnectionString(resp.getJmsConnectionString()); VizApp.setPypiesServer(resp.getPypiesServer()); VizServers.getInstance().setServerLocations(resp.getServerLocations()); } diff --git a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/LocalizationManager.java b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/LocalizationManager.java index 2534b782c4..4160bf2086 100644 --- a/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/LocalizationManager.java +++ b/cave/com.raytheon.uf.viz.core/src/com/raytheon/uf/viz/core/localization/LocalizationManager.java @@ -92,6 +92,8 @@ import com.raytheon.uf.viz.core.requests.ThriftClient; * May 19, 2007 #1127 randerso Implemented error handling * Sep 12, 2012 1167 djohnson Add datadelivery servers. * Jan 14, 2013 1469 bkowal Removed the hdf5 data directory. + * Aug 27, 2013 2295 bkowal The entire jms connection string is now + * provided by EDEX. * * * @@ -147,8 +149,8 @@ public class LocalizationManager implements IPropertyChangeListener { this.overrideServer = false; this.overrideSite = false; try { - localizationStore = new ScopedPreferenceStore(new InstanceScope(), - "localization"); + localizationStore = new ScopedPreferenceStore( + InstanceScope.INSTANCE, "localization"); localizationStore.addPropertyChangeListener(this); loadHttpServer(); loadAlertServer(); @@ -222,7 +224,7 @@ public class LocalizationManager implements IPropertyChangeListener { GetServersResponse resp = (GetServersResponse) ThriftClient .sendLocalizationRequest(req); VizApp.setHttpServer(resp.getHttpServer()); - VizApp.setJmsServer(resp.getJmsServer()); + VizApp.setJmsConnectionString(resp.getJmsConnectionString()); VizApp.setPypiesServer(resp.getPypiesServer()); VizServers.getInstance().setServerLocations( resp.getServerLocations()); @@ -910,40 +912,6 @@ public class LocalizationManager implements IPropertyChangeListener { return responses; } - /** - * Makes a request to the UtilitySrv - * - * @param request - * the request to make - * @return the responses from the request - * @throws VizException - */ - private AbstractUtilityResponse[] makeRequest( - PrivilegedUtilityRequestMessage request) - throws LocalizationOpFailedException { - - AbstractUtilityResponse[] responseList = null; - - UtilityResponseMessage localizationResponse = null; - try { - localizationResponse = (UtilityResponseMessage) ThriftClient - .sendLocalizationRequest(request); - } catch (VizException e) { - throw new LocalizationOpFailedException("Localization error", e); - } - if (localizationResponse != null) { - responseList = localizationResponse.getResponses(); - - for (AbstractUtilityResponse response : responseList) { - if (!response.successful()) { - throw new LocalizationOpFailedException( - response.getFormattedErrorMessage()); - } - } - } - return responseList; - } - public boolean isOverrideServer() { return overrideServer; } diff --git a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/D2DNSharpDataObject.java b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/D2DNSharpDataObject.java index 659bfae96b..dd7015b2f2 100644 --- a/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/D2DNSharpDataObject.java +++ b/cave/com.raytheon.uf.viz.d2d.nsharp/src/com/raytheon/uf/viz/d2d/nsharp/rsc/D2DNSharpDataObject.java @@ -32,15 +32,16 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject; * TODO Add Description * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Jul 26, 2011            bsteffen     Initial creation
- *
+ * Jul 26, 2011            bsteffen    Initial creation
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
+ * 
  * 
- * + * * @author bsteffen * @version 1.0 */ @@ -79,4 +80,8 @@ public class D2DNSharpDataObject extends PluginDataObject { this.layers = layers; } + @Override + public String getPluginName() { + return "d2dnsharpdataobject"; + } } diff --git a/cave/com.raytheon.uf.viz.d2d.ui/localization/styleRules/d2dContourStyleRules.xml b/cave/com.raytheon.uf.viz.d2d.ui/localization/styleRules/d2dContourStyleRules.xml index 8b18e14e74..610fc1f63c 100644 --- a/cave/com.raytheon.uf.viz.d2d.ui/localization/styleRules/d2dContourStyleRules.xml +++ b/cave/com.raytheon.uf.viz.d2d.ui/localization/styleRules/d2dContourStyleRules.xml @@ -1028,7 +1028,10 @@ in|.0394|.0| 4 | |f5.2|@.|8000F0FF| |13|\ TP24hr - TP36hr + TP36hr + TP6hr_std + TP6hr_avg + TP24hr_avg in diff --git a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/resource/ScanResourceData.java b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/resource/ScanResourceData.java index b79ed605c4..c718004216 100644 --- a/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/resource/ScanResourceData.java +++ b/cave/com.raytheon.uf.viz.monitor.scan/src/com/raytheon/uf/viz/monitor/scan/resource/ScanResourceData.java @@ -61,7 +61,8 @@ import com.raytheon.uf.viz.monitor.scan.ScanMonitor; * ------------ ---------- ----------- -------------------------- * Oct 13, 2009 dhladky Initial creation * Feb 28, 2013 1731 bsteffen Optimize construction of scan resource. - * Apr 18, 2013 1926 njensen Reuse URIs in construction of resource + * Apr 18, 2013 1926 njensen Reuse URIs in construction of resource + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -203,7 +204,6 @@ public class ScanResourceData extends AbstractRequestableResourceData { public void populateRecords(ScanRecord[] records) throws VizException { Map> fileMap = new HashMap>(); for (ScanRecord record : records) { - record.setPluginName("scan"); File loc = HDF5Util.findHDF5Location(record); Set recordSet = fileMap.get(loc); if (recordSet == null) { @@ -260,12 +260,12 @@ public class ScanResourceData extends AbstractRequestableResourceData { List dataList = new ArrayList(); long[] times = monitor.getDMDMaxAngleTimes(icao); - int index = times.length - 1 < 0 ? 0 : times.length - 1; + int index = (times.length - 1) < 0 ? 0 : times.length - 1; if ((times != null) && (times.length != 0)) { - for (int i = 0; i < allTimes.length; i++) { - if (allTimes[i].getRefTime() != null) { - if (allTimes[i].getRefTime().getTime() == times[index]) { - dataList.add(allTimes[i]); + for (DataTime allTime : allTimes) { + if (allTime.getRefTime() != null) { + if (allTime.getRefTime().getTime() == times[index]) { + dataList.add(allTime); index--; if (index == -1) { break; diff --git a/cave/com.raytheon.uf.viz.radarapps.fsi/src/com/raytheon/uf/viz/radarapps/fsi/FSILauncherLayer.java b/cave/com.raytheon.uf.viz.radarapps.fsi/src/com/raytheon/uf/viz/radarapps/fsi/FSILauncherLayer.java index 33c05f9ddb..fb9647b41c 100644 --- a/cave/com.raytheon.uf.viz.radarapps.fsi/src/com/raytheon/uf/viz/radarapps/fsi/FSILauncherLayer.java +++ b/cave/com.raytheon.uf.viz.radarapps.fsi/src/com/raytheon/uf/viz/radarapps/fsi/FSILauncherLayer.java @@ -84,11 +84,11 @@ public class FSILauncherLayer extends private MouseHandler mouseHandler; - private MenuManager quickMenuManager; + private final MenuManager quickMenuManager; - private MenuManager fullMenuManager; + private final MenuManager fullMenuManager; - private Shell shell; + private final Shell shell; public FSILauncherLayer(FSILauncherResourceData fsiLauncherResourceData, LoadProperties loadProperties) { @@ -201,14 +201,16 @@ public class FSILauncherLayer extends } else { try { for (Object o : (ArrayList) ((ResponseMessageGeneric) response) - .getContents()) + .getContents()) { result.add((String) o); + } } catch (RuntimeException e) { throw new VizException("Unexpected server response", e); } } - } else + } else { throw new VizException("Could not load getFsiRadars.py"); + } } catch (VizException e) { statusHandler.handle(Priority.PROBLEM, "Could not retrieve FSI radar list", e); @@ -229,15 +231,16 @@ public class FSILauncherLayer extends geoClickedPoint = getResourceContainer().translateClick(x, y); if (isEditable()) { // panelClickPoint = new Point(x, y); - if (mouseButton == MOUSE_BUTTON_TO_USE) + if (mouseButton == MOUSE_BUTTON_TO_USE) { clicked = true; + } } return false; } @Override public boolean handleMouseUp(int x, int y, int mouseButton) { - if (clicked && mouseButton == MOUSE_BUTTON_TO_USE) { + if (clicked && (mouseButton == MOUSE_BUTTON_TO_USE)) { clicked = false; /* @@ -295,8 +298,9 @@ public class FSILauncherLayer extends throw new VizException("Unexpected server response", e); } } - } else + } else { throw new VizException("Could not retrieve FSI environment"); + } } catch (VizException e) { statusHandler.handle(Priority.PROBLEM, "Could not retrieve FSI radar list", e); @@ -307,7 +311,7 @@ public class FSILauncherLayer extends public class LaunchFSIAction extends Action { - private String radarName; + private final String radarName; private class StormVector { public boolean useSTI = true; @@ -393,7 +397,8 @@ public class FSILauncherLayer extends RadarRecord radarRecord = null; try { List obs = query.performQuery(); - if (obs != null && !obs.isEmpty() && obs.get(0).length > 0) { + if ((obs != null) && !obs.isEmpty() + && (obs.get(0).length > 0)) { radarRecord = (RadarRecord) obs.get(0)[0]; } else { // default to 0.5 for non-terminal radars, test if @@ -409,7 +414,6 @@ public class FSILauncherLayer extends } catch (RuntimeException e) { throw new VizException("Unexpected response format", e); } - radarRecord.setPluginName("radar"); // TODO: huh? File loc = HDF5Util.findHDF5Location(radarRecord); IDataStore dataStore = DataStoreFactory.getDataStore(loc); try { @@ -439,8 +443,9 @@ public class FSILauncherLayer extends private String createControlMessage() { FSIEnvironment env = getFSIEnvironment(); - if (env == null) + if (env == null) { return null; + } // According to FSI_GUI, this must have the format ##.## String subTypeStr = String.format("%04.2f", @@ -540,13 +545,14 @@ public class FSILauncherLayer extends @Override public void run() { String controlMessage = createControlMessage(); - if (controlMessage == null) + if (controlMessage == null) { return; + } File f = PathManagerFactory.getPathManager().getStaticFile( "fsi" + File.separator + FSI_START_SCRIPT_NAME); - if (f == null || !f.exists()) { + if ((f == null) || !f.exists()) { statusHandler.handle(Priority.PROBLEM, "Could not find the FSI start script."); return; @@ -604,12 +610,14 @@ public class FSILauncherLayer extends int nLines = 0; while (true) { String s = br.readLine(); - if (s == null) + if (s == null) { break; + } sb.append(s); sb.append('\n'); - if (++nLines >= MAX_LINES) + if (++nLines >= MAX_LINES) { break; + } } } catch (IOException e) { e.printStackTrace(System.err); @@ -628,7 +636,7 @@ public class FSILauncherLayer extends statusHandler .handle(Priority.PROBLEM, "FSI failed to start: " - + sb.toString()); + + sb.toString()); return; } } catch (InterruptedException e) { diff --git a/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/ThinClientNotificationManagerJob.java b/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/ThinClientNotificationManagerJob.java index 71dc290fd2..7e058551c6 100644 --- a/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/ThinClientNotificationManagerJob.java +++ b/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/ThinClientNotificationManagerJob.java @@ -35,7 +35,9 @@ import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants; /** - * TODO Add Description + * Listens to changes to the "Disable JMS" option in the Thin Client + * Preferences. Will automatically connect to and disconnect from the + * JMS Server as the option is updated. * *
  * 
@@ -44,6 +46,8 @@ import com.raytheon.uf.viz.thinclient.preferences.ThinClientPreferenceConstants;
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Nov 29, 2011            bsteffen     Initial creation
+ * Aug 27, 2013 2295       bkowal       The entire jms connection string is now
+ *                                      provided by EDEX.
  * 
  * 
* @@ -96,13 +100,14 @@ public class ThinClientNotificationManagerJob extends NotificationManagerJob if (disableJMS) { disconnect(true); } else { - if (VizApp.getJmsServer() == null) { + if (VizApp.getJmsConnectionString() == null) { GetServersRequest req = new GetServersRequest(); GetServersResponse resp; try { resp = (GetServersResponse) ThriftClient .sendLocalizationRequest(req); - VizApp.setJmsServer(resp.getJmsServer()); + VizApp.setJmsConnectionString(resp + .getJmsConnectionString()); } catch (VizException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e); diff --git a/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/localization/ThinClientLocalizationInitializer.java b/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/localization/ThinClientLocalizationInitializer.java index e7c4116e77..c36a201899 100644 --- a/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/localization/ThinClientLocalizationInitializer.java +++ b/cave/com.raytheon.uf.viz.thinclient/src/com/raytheon/uf/viz/thinclient/localization/ThinClientLocalizationInitializer.java @@ -48,8 +48,10 @@ import com.raytheon.uf.viz.thinclient.ui.ThinClientConnectivityDialog; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Nov 23, 2011 bsteffen Initial creation - * Dec 06, 2012 1396 njensen Added setting VizServers + * Dec 06, 2012 1396 njensen Added setting VizServers * Jan 14, 2013 1469 bkowal Removed setting the hdf5 data directory + * Aug 27, 2013 2295 bkowal The entire jms connection string is + * now provided by EDEX. * * * @@ -92,7 +94,7 @@ public class ThinClientLocalizationInitializer extends LocalizationInitializer { GetServersResponse resp = (GetServersResponse) ThriftClient .sendLocalizationRequest(req); if (!disableJMS) { - VizApp.setJmsServer(resp.getJmsServer()); + VizApp.setJmsConnectionString(resp.getJmsConnectionString()); } } VizApp.setHttpServer(servicesProxy); @@ -103,12 +105,13 @@ public class ThinClientLocalizationInitializer extends LocalizationInitializer { HttpClient.getInstance().setCompressRequests(compressRequests); // use the proxy for all servers in VizServers + @SuppressWarnings("unchecked") Map serversMap = new DefaultedMap(servicesProxy); VizServers.getInstance().setServerLocations(serversMap); } else { processGetServers(); if (disableJMS) { - VizApp.setJmsServer(null); + VizApp.setJmsConnectionString(null); } } } diff --git a/cave/com.raytheon.viz.grid/localization/styleRules/gridImageryStyleRules.xml b/cave/com.raytheon.viz.grid/localization/styleRules/gridImageryStyleRules.xml index 441bc15cc6..38ebe8914b 100644 --- a/cave/com.raytheon.viz.grid/localization/styleRules/gridImageryStyleRules.xml +++ b/cave/com.raytheon.viz.grid/localization/styleRules/gridImageryStyleRules.xml @@ -1227,6 +1227,9 @@ TP48hr TPrun TP120hr + TP6hr_std + TP6hr_avg + TP24hr_avg diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/RadarRequestableData.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/RadarRequestableData.java index be8f1a1d20..0f0e3bc2f3 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/RadarRequestableData.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/data/RadarRequestableData.java @@ -27,7 +27,6 @@ import javax.measure.unit.Unit; import com.raytheon.uf.common.colormap.prefs.ColorMapParameters; import com.raytheon.uf.common.comm.CommunicationException; -import com.raytheon.uf.common.dataplugin.grid.GridConstants; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.dataplugin.level.LevelFactory; import com.raytheon.uf.common.dataplugin.radar.RadarRecord; @@ -57,7 +56,8 @@ import com.raytheon.viz.grid.util.SliceUtil; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Mar 18, 2010 #4473 rjpeter Initial creation + * Mar 18, 2010 4473 rjpeter Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -69,9 +69,9 @@ public class RadarRequestableData extends GridRequestableData { private static final transient IUFStatusHandler statusHandler = UFStatus .getHandler(RadarRequestableData.class); - private RadarRecord radarSource; + private final RadarRecord radarSource; - private RadarMapper tiler; + private final RadarMapper tiler; private WeakReference cache = null; @@ -107,7 +107,6 @@ public class RadarRequestableData extends GridRequestableData { Parameter parameter = new Parameter(parameterAbbrev, this.parameterName, unit); record.setParameter(parameter); - record.setPluginName(GridConstants.GRID); record.setDataTime(source.getDataTime()); record.constructDataURI(); setGridSource(record); diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridUpdater.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridUpdater.java index 367873f2e3..2b169677c9 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridUpdater.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/GridUpdater.java @@ -58,7 +58,8 @@ import com.raytheon.viz.grid.util.RadarAdapter; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Mar 25, 2010 bsteffen Initial creation + * Mar 25, 2010 bsteffen Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -88,9 +89,9 @@ public class GridUpdater implements IAlertObserver { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + getOuterType().hashCode(); - result = prime * result + ((node == null) ? 0 : node.hashCode()); - result = prime * result + timeOffset; + result = (prime * result) + getOuterType().hashCode(); + result = (prime * result) + ((node == null) ? 0 : node.hashCode()); + result = (prime * result) + timeOffset; return result; } @@ -101,22 +102,29 @@ public class GridUpdater implements IAlertObserver { */ @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } UpdateValue other = (UpdateValue) obj; - if (!getOuterType().equals(other.getOuterType())) + if (!getOuterType().equals(other.getOuterType())) { return false; + } if (node == null) { - if (other.node != null) + if (other.node != null) { return false; - } else if (!node.equals(other.node)) + } + } else if (!node.equals(other.node)) { return false; - if (timeOffset != other.timeOffset) + } + if (timeOffset != other.timeOffset) { return false; + } return true; } @@ -126,11 +134,11 @@ public class GridUpdater implements IAlertObserver { } - private Set myUpdates = new HashSet(); + private final Set myUpdates = new HashSet(); - private GridInventory inventory; + private final GridInventory inventory; - private Map> updateMap = new HashMap>(); + private final Map> updateMap = new HashMap>(); public GridUpdater(GridInventory inventory) { this.inventory = inventory; @@ -147,7 +155,7 @@ public class GridUpdater implements IAlertObserver { public synchronized void addNode(AbstractDerivedDataNode node) throws VizException { List dependencies = node.getDependencies(); - if (dependencies == null || dependencies.isEmpty()) { + if ((dependencies == null) || dependencies.isEmpty()) { return; } List dep = new ArrayList(dependencies); @@ -238,7 +246,7 @@ public class GridUpdater implements IAlertObserver { // Null means it is an alias model and supplement means // there exists a true GribNode buried under the or // node - if (method == null + if ((method == null) || !method.getName().equals("Supplement")) { inventory.reinitTree(); // System.out.println(((AbstractDerivedLevelNode) lNode) @@ -256,7 +264,6 @@ public class GridUpdater implements IAlertObserver { } for (UpdateValue value : set) { GridRecord fakeRec = new GridRecord(); - fakeRec.setPluginName(GridInventory.PLUGIN_NAME); Object obj = alert.decodedAlert.get("dataTime"); if (!(obj instanceof DataTime)) { throw new IllegalArgumentException( diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/RadarUpdater.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/RadarUpdater.java index 8dc2089ab6..f74e5ce966 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/RadarUpdater.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/inv/RadarUpdater.java @@ -38,7 +38,8 @@ import com.raytheon.viz.grid.util.RadarProductCodeMapping; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Sep 20, 2012 bsteffen Initial creation + * Sep 20, 2012 bsteffen Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -77,33 +78,39 @@ public class RadarUpdater implements IAlertObserver { public int hashCode() { final int prime = 31; int result = 1; - result = prime - * result + result = (prime * result) + ((elevationAngle == null) ? 0 : elevationAngle.hashCode()); - result = prime * result + result = (prime * result) + ((productCode == null) ? 0 : productCode.hashCode()); return result; } @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } CacheKey other = (CacheKey) obj; if (elevationAngle == null) { - if (other.elevationAngle != null) + if (other.elevationAngle != null) { return false; - } else if (!elevationAngle.equals(other.elevationAngle)) + } + } else if (!elevationAngle.equals(other.elevationAngle)) { return false; + } if (productCode == null) { - if (other.productCode != null) + if (other.productCode != null) { return false; - } else if (!productCode.equals(other.productCode)) + } + } else if (!productCode.equals(other.productCode)) { return false; + } return true; } @@ -122,7 +129,7 @@ public class RadarUpdater implements IAlertObserver { } - private Map cache = new LinkedHashMap( + private final Map cache = new LinkedHashMap( 100, .75f, true) { private static final long serialVersionUID = 2022670836957170184L; @@ -152,14 +159,14 @@ public class RadarUpdater implements IAlertObserver { for (AlertMessage alertMessage : alertMessages) { String icao = alertMessage.decodedAlert .get(RadarAdapter.ICAO_QUERY).toString(); - if (icao == null + if ((icao == null) || !icao.equalsIgnoreCase(configuredRadar.getRdaId())) { continue; } globalTimes = null; Object obj = alertMessage.decodedAlert .get(RadarAdapter.PRODUCT_CODE_QUERY); - if (obj == null || !(obj instanceof Integer)) { + if ((obj == null) || !(obj instanceof Integer)) { continue; } Integer productCode = (Integer) obj; @@ -169,12 +176,12 @@ public class RadarUpdater implements IAlertObserver { continue; } obj = alertMessage.decodedAlert.get("dataTime"); - if (obj == null || !(obj instanceof DataTime)) { + if ((obj == null) || !(obj instanceof DataTime)) { continue; } DataTime time = (DataTime) obj; obj = alertMessage.decodedAlert.get(RadarAdapter.TILT_QUERY); - if (obj == null || !(obj instanceof Double)) { + if ((obj == null) || !(obj instanceof Double)) { continue; } Double elevationAngle = (Double) obj; @@ -188,7 +195,6 @@ public class RadarUpdater implements IAlertObserver { e1.getLocalizedMessage(), e1); } GridRecord fakeRec = new GridRecord(); - fakeRec.setPluginName(GridInventory.PLUGIN_NAME); fakeRec.setDataTime(time); fakeRec.setDatasetId(RadarAdapter.RADAR_SOURCE); @@ -209,12 +215,12 @@ public class RadarUpdater implements IAlertObserver { private CacheKey getCacheKey(RadarRequestableLevelNode rNode) { Map rcMap = rNode.getRequestConstraintMap(); RequestConstraint rc = rcMap.get(RadarAdapter.PRODUCT_CODE_QUERY); - if (rc == null || rc.getConstraintType() != ConstraintType.EQUALS) { + if ((rc == null) || (rc.getConstraintType() != ConstraintType.EQUALS)) { return null; } Integer productCode = Integer.parseInt(rc.getConstraintValue()); rc = rcMap.get(RadarAdapter.TILT_QUERY); - if (rc == null || rc.getConstraintType() != ConstraintType.EQUALS) { + if ((rc == null) || (rc.getConstraintType() != ConstraintType.EQUALS)) { return null; } Double elevationAngle = Double.parseDouble(rc.getConstraintValue()); @@ -232,7 +238,7 @@ public class RadarUpdater implements IAlertObserver { if (entry == null) { return null; } - if (entry.insertTime + CACHE_TIME < System.currentTimeMillis()) { + if ((entry.insertTime + CACHE_TIME) < System.currentTimeMillis()) { cache.remove(cacheKey); return null; } @@ -248,7 +254,7 @@ public class RadarUpdater implements IAlertObserver { if (globalTimes == null) { return null; } - if (globalInsertTime + CACHE_TIME < System.currentTimeMillis()) { + if ((globalInsertTime + CACHE_TIME) < System.currentTimeMillis()) { globalTimes = null; return null; } diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/record/RequestableDataRecord.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/record/RequestableDataRecord.java index e064b79af2..aef53d86d3 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/record/RequestableDataRecord.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/record/RequestableDataRecord.java @@ -24,7 +24,6 @@ import java.util.Collection; import java.util.List; import com.raytheon.uf.common.dataplugin.PluginException; -import com.raytheon.uf.common.dataplugin.grid.GridConstants; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.datastorage.Request; import com.raytheon.uf.common.datastorage.records.FloatDataRecord; @@ -40,17 +39,18 @@ import com.raytheon.viz.grid.util.TiltRequest; /** * A PDO that extends GridRecord and wraps a AbstractRequestableData to allow * derived parameters to be used anywhere GridRecords can be used. - * + * *
- *
+ * 
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Mar 18, 2010            bsteffen     Initial creation
+ * Mar 18, 2010            bsteffen    Initial creation
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
+ * 
  * 
- *
  * 
- * + * * @author bsteffen * @version 1.0 */ @@ -67,9 +67,10 @@ public class RequestableDataRecord extends GridRecord { GridCoverage coverage = null; if (requester.getSpace() instanceof GridCoverage) { coverage = (GridCoverage) requester.getSpace(); - if (requester instanceof GridRequestableData) { - setSecondaryId(((GridRequestableData) requester).getGridSource().getSecondaryId()); - } + if (requester instanceof GridRequestableData) { + setSecondaryId(((GridRequestableData) requester) + .getGridSource().getSecondaryId()); + } } setDatasetId(requester.getSource()); setLocation(coverage); @@ -78,7 +79,6 @@ public class RequestableDataRecord extends GridRecord { requester.getParameterName(), requester.getUnit()); setParameter(parameter); - setPluginName(GridConstants.GRID); setDataTime(requester.getDataTime()); try { constructDataURI(); @@ -142,7 +142,7 @@ public class RequestableDataRecord extends GridRecord { } } float[] data = new float[nx * ny]; - for (int i = 0; i < nx * ny; i++) { + for (int i = 0; i < (nx * ny); i++) { data[i] = ((Number) obj).floatValue(); } FloatDataRecord rec = new FloatDataRecord(this.getParameter() diff --git a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java index f933aa7674..f2ec58d204 100644 --- a/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java +++ b/cave/com.raytheon.viz.texteditor/src/com/raytheon/viz/texteditor/dialogs/TextEditorDialog.java @@ -136,7 +136,7 @@ import com.raytheon.uf.common.site.SiteMap; 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.time.SimulatedTime; +import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.edex.decodertools.time.TimeTools; import com.raytheon.uf.edex.services.textdbsrv.IQueryTransport; import com.raytheon.uf.edex.wmo.message.WMOHeader; @@ -187,8 +187,6 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; import com.raytheon.viz.ui.dialogs.ICloseCallback; import com.raytheon.viz.ui.dialogs.SWTMessageBox; -// import com.raytheon.uf.viz.core.RGBColors; - /** * Main Text Editor dialog. * @@ -322,15 +320,17 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox; * 31JAN2013 1568 rferrel Spell checker now tied to this dialog instead of parent. * 26Apr2013 16123 snaples Removed setFocus to TextEditor in postExecute method. * 07Jun2013 1981 mpduff Add user id to OUPRequest as it is now protected. - * 20Jun2013 15733 XHuang Add functionalities that get Font size, Text colors from - * *.xml files in localization; - * add selection listener to catch the highlight words and - * set the highlight colors. + * 20Jun2013 15733 XHuang Add functionalities that get Font size, Text colors from + * *.xml files in localization; + * add selection listener to catch the highlight words and + * set the highlight colors. * 23Jul2013 2176 jsanchez Added a new confirmation message for emergency warnings. * 25July2013 15733 GHull Read font and color prefs from TextEditorCfg. * 23Aug2013 DR 16514 D. Friedman Fix handling of completed product requests. Do not change * command history or close browser window for "update obs". * 04Sep2013 2176 jsanchez Changed the order of the QC check dialogs. + * 12Sep2013 DR 2249 rferrel Change Time stamp in file name created by warngen to use + * simulated time. * * * @author lvenable @@ -378,8 +378,6 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, */ private static final int UPDATE_FG = SWT.COLOR_WHITE; - private final int HIGHLIGHT_BG = SWT.COLOR_RED; - /** * The length of BEGIN_ELEMENT_TAG. */ @@ -1087,11 +1085,6 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, */ private SearchReplaceDlg searchReplaceDlg; - /** - * Flag to indicate if the document being edited has been modified. - */ - private boolean dirty = false; - /** * Flag to indicate if the document being edited has been saved. */ @@ -1504,7 +1497,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, return; } - if (afosBrowser != null + if ((afosBrowser != null) && afosBrowser.isAfosBrowserActive()) { afosBrowser.hide(); displayAfosBrowser = true; @@ -1629,7 +1622,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, @Override public void widgetSelected(SelectionEvent event) { - if (faxAllMsgDlg == null || faxAllMsgDlg.isDisposed()) { + if ((faxAllMsgDlg == null) || faxAllMsgDlg.isDisposed()) { faxAllMsgDlg = new FaxMessageDlg(shell); faxAllMsgDlg.setInitialText(textEditor.getText()); faxAllMsgDlg.open(); @@ -1644,7 +1637,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, faxSelectionItem.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { - if (faxMsgDlg == null || faxMsgDlg.isDisposed()) { + if ((faxMsgDlg == null) || faxMsgDlg.isDisposed()) { faxMsgDlg = new FaxMessageDlg(shell); faxMsgDlg.setInitialText(textEditor.getSelectionText()); faxMsgDlg.open(); @@ -1659,7 +1652,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, configAutoFaxItem.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { - if (ldadFaxSitesDlg == null || ldadFaxSitesDlg.isDisposed()) { + if ((ldadFaxSitesDlg == null) || ldadFaxSitesDlg.isDisposed()) { ldadFaxSitesDlg = new LdadFaxSitesDlg(shell); ldadFaxSitesDlg.open(); } else { @@ -1947,7 +1940,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, searchItem.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { - if (searchReplaceDlg == null || searchReplaceDlg.isDisposed()) { + if ((searchReplaceDlg == null) || searchReplaceDlg.isDisposed()) { searchReplaceDlg = new SearchReplaceDlg(shell, textEditor, inEditMode); searchReplaceDlg.open(); @@ -2449,7 +2442,6 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, } } } - } /** @@ -2475,7 +2467,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, } // skip any spaces at cursor - while (text.charAt(searchOffset) == ' ' && searchOffset > 0) { + while ((text.charAt(searchOffset) == ' ') && (searchOffset > 0)) { searchOffset--; } @@ -2506,8 +2498,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, } // skip any spaces at cursor - while (text.charAt(searchOffset) == ' ' - && searchOffset < text.length()) { + while ((text.charAt(searchOffset) == ' ') + && (searchOffset < text.length())) { searchOffset++; } @@ -2516,7 +2508,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, // set missing to end of text if (index == -1) { index = text.length() - 1; - } else if (index < text.length() - 1) { + } else if (index < (text.length() - 1)) { // skip the space index++; } @@ -2677,7 +2669,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, int line = textEditor.getLineAtOffset(caretOffset); int finish; - if (line + 1 < textEditor.getLineCount()) { + if ((line + 1) < textEditor.getLineCount()) { finish = textEditor.getOffsetAtLine(line + 1) - 1; } else { // Guard against over-indexing in getText() @@ -2833,7 +2825,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, } } - if (selectionCnt == 0 && autoWrapCfg.getButtons().size() > 0) { + if ((selectionCnt == 0) && (autoWrapCfg.getButtons().size() > 0)) { WrapButtonCfg buttonCfg = autoWrapCfg.getButtons().get(0); message.append("No button selected. Selecting top item \"") .append(buttonCfg.getLabelName()).append("\"\n"); @@ -2922,7 +2914,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, private void createTextCharWrapDialog(final int rangeStart, final int rangeEnd) { // Create the text character wrap dialog. - if (textCharWrapDlg == null || textCharWrapDlg.isDisposed()) { + if ((textCharWrapDlg == null) || textCharWrapDlg.isDisposed()) { textCharWrapDlg = new TextCharWrapDlg(shell, this, otherCharWrapCol, rangeStart, rangeEnd); @@ -2954,8 +2946,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, FontSizeCfg fontSizeCfg = TextEditorCfg.getTextEditorCfg() .getFontSizeCfg(); - SizeButtonCfg seldFontBtn = TextEditorCfg.getTextEditorCfg() - .getSelectedFontButton(); + SizeButtonCfg seldFontBtn = TextEditorCfg.getSelectedFontButton(); for (SizeButtonCfg buttonCfg : fontSizeCfg.getButtons()) { MenuItem item = new MenuItem(fontSizeSubMenu, SWT.RADIO); @@ -3399,7 +3390,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, public void widgetDefaultSelected(SelectionEvent event) { awipsIdTF.setText(awipsIdTF.getText().trim().toUpperCase()); int charCount = awipsIdTF.getCharCount(); - if (charCount < 4 || charCount > 6) { + if ((charCount < 4) || (charCount > 6)) { userInformation("Must enter a 4 to 6 character AWIPS ID"); awipsIdTF.setFocus(); return; @@ -3502,7 +3493,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, */ private void clearUpdateFlag(int offset) { for (StyleRange range : textEditor.getStyleRanges()) { - if (range.start <= offset && offset < (range.start + range.length)) { + if ((range.start <= offset) + && (offset < (range.start + range.length))) { StyleRange lock = (StyleRange) range.clone(); lock.background = null; lock.foreground = null; @@ -3702,13 +3694,13 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, editorInsertCmb.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { - if (editorInsertCmb.getSelectionIndex() == INSERT_TEXT - && overwriteMode == true) { + if ((editorInsertCmb.getSelectionIndex() == INSERT_TEXT) + && (overwriteMode == true)) { textEditor.invokeAction(ST.TOGGLE_OVERWRITE); overwriteMode = false; overStrikeItem.setSelection(false); - } else if (editorInsertCmb.getSelectionIndex() == OVERWRITE_TEXT - && overwriteMode == false) { + } else if ((editorInsertCmb.getSelectionIndex() == OVERWRITE_TEXT) + && (overwriteMode == false)) { textEditor.invokeAction(ST.TOGGLE_OVERWRITE); overwriteMode = true; overStrikeItem.setSelection(true); @@ -3778,7 +3770,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, textEditor.addKeyListener(new KeyAdapter() { @Override public void keyPressed(KeyEvent e) { - if (e.keyCode == SWT.ARROW_LEFT && !textEditor.getEditable()) { + if ((e.keyCode == SWT.ARROW_LEFT) && !textEditor.getEditable()) { commandHistory.resetIndex(CommandType.AFOS); ICommand command = commandHistory .getPreviousCommand(CommandType.AFOS); @@ -3789,7 +3781,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, executeCommand(cmd); } } - } else if (e.keyCode == SWT.ARROW_RIGHT + } else if ((e.keyCode == SWT.ARROW_RIGHT) && !textEditor.getEditable()) { commandHistory.resetIndex(CommandType.AFOS); ICommand command = commandHistory @@ -3841,13 +3833,13 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, if (textEditor.getEditable() == false) { return; } - if (event.keyCode == SWT.DEL || event.keyCode == SWT.BS - || event.keyCode == SWT.SHIFT) { + if ((event.keyCode == SWT.DEL) || (event.keyCode == SWT.BS) + || (event.keyCode == SWT.SHIFT)) { // Do nothing... // We need to capture the Delete, Backspace and Shift // keystrokes... - } else if (event.keyCode == SWT.HOME - || event.keyCode == SWT.END) { + } else if ((event.keyCode == SWT.HOME) + || (event.keyCode == SWT.END)) { if (!textEditor.getEditable()) { int offset = 0; @@ -3859,17 +3851,17 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, textEditor.showSelection(); event.doit = false; } - } else if (event.keyCode == SWT.PAGE_UP - && event.stateMask == SWT.CTRL) { + } else if ((event.keyCode == SWT.PAGE_UP) + && (event.stateMask == SWT.CTRL)) { event.doit = false; // Ingnore Ctrl + PageUp - } else if (event.keyCode == SWT.PAGE_DOWN - && event.stateMask == SWT.CTRL) { + } else if ((event.keyCode == SWT.PAGE_DOWN) + && (event.stateMask == SWT.CTRL)) { event.doit = false; // Ignore Ctrl + PageDown - } else if (event.keyCode == SWT.PAGE_UP - && event.stateMask == (SWT.CTRL | SWT.SHIFT)) { + } else if ((event.keyCode == SWT.PAGE_UP) + && (event.stateMask == (SWT.CTRL | SWT.SHIFT))) { event.doit = false; // Ignore Ctrl+Shift+PageUp - } else if (event.keyCode == SWT.PAGE_DOWN - && event.stateMask == (SWT.CTRL | SWT.SHIFT)) { + } else if ((event.keyCode == SWT.PAGE_DOWN) + && (event.stateMask == (SWT.CTRL | SWT.SHIFT))) { event.doit = false; // Ignore Ctrl+Shift+PageDown } else if (event.keyCode == SWT.INSERT) { // Ins key on the keypad @@ -3891,20 +3883,13 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, // if some event is going to happen and the key was not enter // then set userKeyPressed to true - if (event.doit && event.character != 0 - && event.character != '\r' && event.character != '\n') { + if (event.doit && (event.character != 0) + && (event.character != '\r') + && (event.character != '\n')) { userKeyPressed = true; } } }); - textEditor.addModifyListener(new ModifyListener() { - - @Override - public void modifyText(ModifyEvent e) { - // when we modify the text, we want to set the 'dirty' flag. - dirty = true; - } - }); textEditor.addMouseListener(new MouseListener() { @Override @@ -3952,38 +3937,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, }); } - // private TextColorsCfg getTextColorCfg() { - // TextColorsCfg textColorsCfg = - // TextEditorCfg.getTextEditorCfg().getTextColorsCfg(); - // - // // Perform Sanity Checks on configuration. - // StringBuilder message = new StringBuilder(); - // - // for (TextColorElement textElm : textColorsCfg.getTextColorElements()) { - // String prmtName = textElm.getParamName(); - // if (prmtName == null) { - // message.append("Item \"paramName\" problem!\n"); - // - // } - // - // if( textElm.getColor() == null ) { - // message.append("Item \"color\" data enter problem!\n"); - // } - // - // if (message.length() > 0) { - // message.insert(0, "TextColorsCfg broblem(s): "); - // IUFStatusHandler statusHandler = UFStatus - // .getHandler(TextEditorDialog.class); - // statusHandler.handle(Priority.PROBLEM, message.toString()); - // } - // - // } - // - // return textColorsCfg; - // } - private void setDefaultTextColor(TextEditorCfg txtClrCfg) { - textBackground = new Color(shell.getDisplay(), txtClrCfg.getTextBackgroundColor()); textForeground = new Color(shell.getDisplay(), @@ -4120,7 +4074,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, private void enterEditor() { StdTextProduct product = TextDisplayModel.getInstance() .getStdTextProduct(token); - if (product != null + if ((product != null) && gfeForbidden(product.getCccid(), product.getNnnid())) { // Pop up forbidden window. inEditMode = false; @@ -4130,7 +4084,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, // Set the edit mode flag to true. inEditMode = true; int ranges[] = textEditor.getRanges(); - if (ranges == null || ranges.length == 0) { + if ((ranges == null) || (ranges.length == 0)) { originalText = removeSoftReturns(textEditor.getText()); } else { textEditor.setText(originalText); @@ -4221,7 +4175,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, stopAutoSave(); - if (warnGenFlag && queuedProduct != null) { + if (warnGenFlag && (queuedProduct != null)) { // Display the WarnGen in the queue, perform the popup and stop the // cancel. showWarngenProduct(queuedProduct, queuedNotify); @@ -4275,9 +4229,6 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, originalText = combineOriginalMessage(); } - // update editor status flags - dirty = false; - if (originalText != null) { textEditor.setText(originalText); } @@ -4317,8 +4268,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, * false otherwise. */ private void editHeader(String warning, boolean closeEditorOnCancel) { - if (headerEditSession != null) + if (headerEditSession != null) { return; + } // Create and display the AWIPS header block dialog. AWIPSHeaderBlockDlg awipsHeaderBlockDlg = new AWIPSHeaderBlockDlg( @@ -4377,16 +4329,18 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, editing = true; } else { - if (lastSession == HeaderEditSession.CLOSE_ON_EXIT) + if (lastSession == HeaderEditSession.CLOSE_ON_EXIT) { editing = !cancelEditor(false); + } } - if (lastSession == HeaderEditSession.CLOSE_ON_EXIT) + if (lastSession == HeaderEditSession.CLOSE_ON_EXIT) { if (editing) { StdTextProduct product = TextDisplayModel.getInstance() .getStdTextProduct(token); - if (product == null) + if (product == null) { return; + } if (autoSave == null) { // user can cancel the edit immediately when the header is // displayed, verify it was not cancelled before starting @@ -4398,6 +4352,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, } else { stopAutoSave(); } + } } /** @@ -4436,8 +4391,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, // Disabled when in editor mode // --------------------------------- resendWarningProductnItem.setEnabled(!inEditMode - && textEditor.getText() != null - && textEditor.getText().length() > 0); + && (textEditor.getText() != null) + && (textEditor.getText().length() > 0)); // --------------------------------- // File Menu menu items @@ -4658,7 +4613,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, dlg.setText("Attach File"); dlg.setFilterNames(FILTER_NAMES); dlg.setFilterExtensions(FILTER_EXTS); - if (attachedFilename != null && attachedFilename.trim().length() > 0) { + if ((attachedFilename != null) + && (attachedFilename.trim().length() > 0)) { int startIndex = statusBarLabel.getText().indexOf(":") + 1; int endIndex = statusBarLabel.getText().lastIndexOf(File.separator) + 1; String filterPath = statusBarLabel.getText().substring(startIndex, @@ -4676,9 +4632,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, byte[] bytes = new byte[(int) file.length()]; int offset = 0; int numRead = 0; - while (offset < bytes.length - && (numRead = in.read(bytes, offset, bytes.length - - offset)) >= 0) { + while ((offset < bytes.length) + && ((numRead = in.read(bytes, offset, bytes.length + - offset)) >= 0)) { offset += numRead; } in.close(); @@ -4734,7 +4690,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, s.append(removeSoftReturns(textEditor.getText())); int eolIndex = s.indexOf("\n"); int ddhhmmIndex = s.indexOf("DDHHMM"); - if (ddhhmmIndex > 0 && ddhhmmIndex < eolIndex) { + if ((ddhhmmIndex > 0) && (ddhhmmIndex < eolIndex)) { s.replace(ddhhmmIndex, ddhhmmIndex + 6, "000000"); } out.append(s); @@ -5011,10 +4967,16 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, oup.setSource("TextWS"); oup.setWmoType(fixNOR(prod.getBbbid())); oup.setUserDateTimeStamp(prod.getHdrtime()); - oup.setFilename(awipsID + ".wan" - + (System.currentTimeMillis() / 1000)); + StringBuilder fileName = new StringBuilder(); + + // The .wan extension followed by the 10 digit epoch seconds + // of simulated time is used in EDEX's WarningDecoder to + // determine the base time. + fileName.append(awipsID).append(".wan") + .append(TimeUtil.getUnixTime(TimeUtil.newDate())); + oup.setFilename(fileName.toString()); oup.setAddress(addressee); - if (attachedFile != null && attachedFilename != null) { + if ((attachedFile != null) && (attachedFilename != null)) { oup.setAttachedFile(attachedFile); oup.setAttachedFilename(attachedFilename); } @@ -5050,7 +5012,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, } } - if (inEditMode == false && resend == false) { + if ((inEditMode == false) && (resend == false)) { saved = true; StdTextProductId finalProduct = this.getStdTextProduct() .getProdId(); @@ -5110,7 +5072,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, synchronized private void saveProduct() { StdTextProduct product = TextDisplayModel.getInstance() .getStdTextProduct(token); - if (product != null + if ((product != null) && gfeForbidden(product.getCccid(), product.getNnnid())) { // Pop up forbidden window. inEditMode = false; @@ -5120,7 +5082,6 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, boolean successful = saveEditedProduct(false, false, false); if (successful) { // reset the editor status flags - dirty = false; saved = true; replaceWorkProductId(); originalText = combineOriginalMessage(); @@ -5144,7 +5105,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, boolean resend, boolean isOperationalSend) { StdTextProduct product = TextDisplayModel.getInstance() .getStdTextProduct(token); - if (product != null + if ((product != null) && gfeForbidden(product.getCccid(), product.getNnnid())) { // Pop up forbidden window. inEditMode = false; @@ -5157,7 +5118,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, * DR14613 - string currectDate is derived from Date now ensuring the * same time in WMO heading and in the MND heading. */ - Date now = SimulatedTime.getSystemTime().getTime(); + Date now = TimeUtil.newDate(); String currentDate = getCurrentDate(now); TextDisplayModel tdmInst = TextDisplayModel.getInstance(); @@ -5186,7 +5147,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, String productText = resend ? resendMessage() : combineOriginalMessage(); - if (warnGenFlag == true && resend == false) { + if ((warnGenFlag == true) && (resend == false)) { productText = removeSoftReturns(productText); } @@ -5291,16 +5252,18 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, String[] parts = productText.split("\n", 2); if (parts.length > 0) { String[] headerParts = parts[0].split("\\s+", 0); - if (headerParts.length >= 3) + if (headerParts.length >= 3) { headerParts[2] = ddhhmm; + } // TODO: else raise error? StringBuilder sb = new StringBuilder(productText.length()); boolean first = true; for (String s : headerParts) { - if (first) + if (first) { first = false; - else + } else { sb.append(' '); + } sb.append(s); } if (parts.length > 1) { @@ -5342,8 +5305,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, textEditor.addVerifyListener(TextEditorDialog.this); for (StyleRange lock : locks) { - if (0 <= lock.start - && lock.start + lock.length <= textEditor.getCharCount()) { + if ((0 <= lock.start) + && ((lock.start + lock.length) <= textEditor.getCharCount())) { textEditor.setStyleRange(lock); } } @@ -5408,7 +5371,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, private boolean saveStoredTextProduct(StdTextProduct storedProduct) { StdTextProduct product = TextDisplayModel.getInstance() .getStdTextProduct(token); - if (product != null + if ((product != null) && gfeForbidden(product.getCccid(), product.getNnnid())) { // Pop up forbidden window. inEditMode = false; @@ -5478,13 +5441,13 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, do { startIndex = sb.indexOf(BEGIN_ELEMENT_TAG, currentIndex); endIndex = sb.indexOf(END_ELEMENT_TAG, currentIndex); - } while (startIndex > 0 - && endIndex > 0 - && (currentIndex = sb.indexOf(BEGIN_ELEMENT_TAG, - startIndex + BEGIN_ELEMENT_TAG_LEN)) > 0 - && currentIndex < endIndex); + } while ((startIndex > 0) + && (endIndex > 0) + && ((currentIndex = sb.indexOf(BEGIN_ELEMENT_TAG, + startIndex + BEGIN_ELEMENT_TAG_LEN)) > 0) + && (currentIndex < endIndex)); - if (currentIndex > 0 && currentIndex < endIndex) { + if ((currentIndex > 0) && (currentIndex < endIndex)) { startIndex = currentIndex; } @@ -5537,14 +5500,15 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, int length = event.end - event.start; try { if (length == 0) { - if (event.start != 0 - && event.start != textEditor.getCharCount()) { + if ((event.start != 0) + && (event.start != textEditor.getCharCount())) { int ranges[] = textEditor.getRanges(event.start - 1, length + 2); for (int i = 0; i < ranges.length; i += 2) { int rangeStart = ranges[i]; int rangeEnd = rangeStart + ranges[i + 1]; - if (event.start > rangeStart && event.start < rangeEnd) { + if ((event.start > rangeStart) + && (event.start < rangeEnd)) { event.doit = false; /* * DR15704 - this needs to be set so the rewrap is @@ -5557,7 +5521,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, } } else { int ranges[] = textEditor.getRanges(event.start, length); - if (inEditMode && ranges != null && ranges.length != 0) { + if (inEditMode && (ranges != null) && (ranges.length != 0)) { event.doit = false; /* * DR15704 - this needs to be set so the rewrap is not @@ -5698,7 +5662,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, numberOfBlankLines++; line = textEditor.getLine(thisLine + numberOfLinesOfHeaderText + numberOfBlankLines); - } while (line.length() == 0 || line.equals("")); + } while ((line.length() == 0) || line.equals("")); // Note: 'st' is a reference to 'textEditor'... // delelete the header from the text in 'textEditor' finish = textEditor.getOffsetAtLine(thisLine @@ -5712,8 +5676,6 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, textEditor.setText(""); } } - // set editor status flags - dirty = false; } /** @@ -5763,7 +5725,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, */ private String updateVtecTimes(String product, VtecObject vtecObj, Date now) { - if (vtecObj == null || vtecObj.getAction().equals("COR")) { + if ((vtecObj == null) || vtecObj.getAction().equals("COR")) { return product; } // Update the vtec start time @@ -5945,7 +5907,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, boolean validExecuteCommand = command != null; if (validExecuteCommand) { - if (prodList != null && prodList.size() > 0) { + if ((prodList != null) && (prodList.size() > 0)) { if (prodList.size() > 1) { if (CommandType.WMO.equals(command.getType())) { final boolean hasAtt = hasAttachment; @@ -6433,7 +6395,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, public void manageScriptOutputWindow(boolean visible) { if (visible) { // need to set state of menu item to true - if (scriptsShowOutputItem != null + if ((scriptsShowOutputItem != null) && !scriptsShowOutputItem.isDisposed()) { scriptsShowOutputItem.setSelection(true); } @@ -6444,7 +6406,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, } // create the script output window - if (scriptOutput == null || !scriptOutput.isDisposed()) { + if ((scriptOutput == null) || !scriptOutput.isDisposed()) { scriptOutput = new ScriptOutputDlg(shell, token); // open the script output window scriptOutput.setCloseCallback(new ICloseCallback() { @@ -6452,7 +6414,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, @Override public void dialogClosed(Object returnValue) { // update the menu following close - if (scriptsShowOutputItem != null + if ((scriptsShowOutputItem != null) && !scriptsShowOutputItem.isDisposed()) { scriptsShowOutputItem.setSelection(false); } @@ -6471,7 +6433,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, if (scriptOutput != null) { scriptOutput.close(); } else { - if (scriptsShowOutputItem != null + if ((scriptsShowOutputItem != null) && !scriptsShowOutputItem.isDisposed()) { scriptsShowOutputItem.setSelection(false); } @@ -7062,7 +7024,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, String body = textEditor.getText(); StdTextProduct stdTextProduct = TextDisplayModel.getInstance() .getStdTextProduct(token); - if (body == null || body.length() == 0) { + if ((body == null) || (body.length() == 0)) { userInformation("Resend Warning Product Error", "There is no product to send. \n Action aborted!"); resend = false; @@ -7113,7 +7075,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, String text = textEditor.getText(); int startIndex = text.indexOf("!--"); int endIndex = text.indexOf("--!", startIndex); - while (startIndex >= 0 && endIndex >= startIndex) { + while ((startIndex >= 0) && (endIndex >= startIndex)) { String part1 = text.substring(0, startIndex).trim(); String part2 = text.substring(endIndex + 3).trim(); text = part1 + "\n\n" + part2; @@ -7176,7 +7138,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, // delete and write new file, rename didn't always work // rename would end up writing a new file every time and // kept the original in sync - if (file != null && file.exists()) { + if ((file != null) && file.exists()) { file.delete(); } @@ -7221,8 +7183,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, xml = new String(b); } - rval = (StdTextProduct) SerializationUtil - .unmarshalFromXml(xml); + rval = SerializationUtil.unmarshalFromXml( + StdTextProduct.class, xml); } catch (Exception e) { statusHandler.handle(Priority.PROBLEM, "Retrieval of product failed", e); @@ -7264,13 +7226,6 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, return success; } - public void stopTimer() { - if (timer != null) { - timer.cancel(); - timer = null; - } - } - private void setupTimer() { if (timer != null) { timer.cancel(); @@ -7508,7 +7463,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, int x = rect.width / 4; // account for dual monitor - if (rect.width > rect.height * 2) { + if (rect.width > (rect.height * 2)) { x /= 2; } @@ -7517,7 +7472,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, .intValue(); int offset = (editorIndex - 1) * 25; - getShell().setLocation(x + offset, rect.height / 4 + offset); + getShell().setLocation(x + offset, (rect.height / 4) + offset); } inEditMode = false; @@ -7656,8 +7611,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, if (hasLockAtOffset(offset)) { StyleRange[] ranges = textEditor.getStyleRanges(); for (StyleRange range : ranges) { - if (offset >= range.start - && offset <= range.start + range.length) { + if ((offset >= range.start) + && (offset <= (range.start + range.length))) { rval = range.start; break; } @@ -7677,8 +7632,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, if (hasLockAtOffset(offset)) { StyleRange[] ranges = textEditor.getStyleRanges(); for (StyleRange range : ranges) { - if (offset >= range.start - && offset <= range.start + range.length) { + if ((offset >= range.start) + && (offset <= (range.start + range.length))) { rval = range.length; break; } @@ -7700,7 +7655,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, int lineLength = textEditor.getLine(lineNumber).length(); StyleRange[] ranges = textEditor.getStyleRanges(lineStart, lineLength); - if (ranges != null && ranges.length > 0) { + if ((ranges != null) && (ranges.length > 0)) { rval = true; } return rval; @@ -7783,7 +7738,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, padding = " "; } - if (inLocations && paragraphStartLineNumber == lineNumber) { + if (inLocations && (paragraphStartLineNumber == lineNumber)) { // Keep LOCATIONS first line short & don't paste more to it. if (line.indexOf("...") == line.lastIndexOf("...")) { return; @@ -7815,7 +7770,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, if (lineNumber < endWrapLine) { // May have more lines to wrap. int nextLine = lineNumber + 1; - while (nextLine <= endWrapLine + while ((nextLine <= endWrapLine) && textEditor.getLine(nextLine).trim().isEmpty()) { ++nextLine; } @@ -7848,7 +7803,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, // If the next line is part of the same paragraph and not empty make it // part of the current line. - if (lineNumber + 1 < textEditor.getLineCount()) { + if ((lineNumber + 1) < textEditor.getLineCount()) { // if the next line does not start a new paragraph if (!isParagraphStart(lineNumber + 1)) { // if the next line is not empty @@ -7860,8 +7815,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, String allText = textEditor.getText(); int eol = textEditor.getOffsetAtLine(lineNumber) + line.length(); - if (allText.charAt(eol) == '\r' - && allText.charAt(eol + 1) == '\n') { + if ((allText.charAt(eol) == '\r') + && (allText.charAt(eol + 1) == '\n')) { deleteLen = 2; } else if (allText.charAt(eol) == '\n') { deleteLen = 1; @@ -7876,7 +7831,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, // if the line does not start with a lock int lineStart = textEditor .getOffsetAtLine(lineNumber + 1); - if (padding.length() > 0 + if ((padding.length() > 0) && textEditor.getLine(lineNumber + 1) .startsWith(padding)) { // add two to skip over padding if it exists and @@ -7889,7 +7844,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, // if the lock is too long to fit on this line do // not bring up the next line int lockLength = getLengthOfLockAtOffset(lockStart); - if (line.length() + lockLength > charWrapCol) { + if ((line.length() + lockLength) > charWrapCol) { // lock is too long, do not bring up next // line return; @@ -7900,7 +7855,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, int lineStartOffset = textEditor .getOffsetAtLine(lineNumber); int newlinePosition = lineStartOffset + line.length(); - if (padding.length() > 0 + if ((padding.length() > 0) && textEditor.getLine(lineNumber + 1).startsWith( " ")) { deleteLen += padding.length(); @@ -7999,7 +7954,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, int padLen = padding.length(); if (padLen > 0) { int cnt = 0; - while (cnt < padLen + while ((cnt < padLen) && textEditor.getText(position + cnt, position + cnt) .equals(" ")) { ++cnt; @@ -8021,7 +7976,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, */ private void checkAndWrapNextLine(int line) { // if there is a next line - if (line + 1 < textEditor.getLineCount()) { + if ((line + 1) < textEditor.getLineCount()) { // if the next line does not start a new paragraph if (!isParagraphStart(line + 1)) { // if the next line is not empty ( marks the end of a paragraph @@ -8029,10 +7984,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, if (!textEditor.getLine(line + 1).trim().isEmpty()) { // rewrap the next line rewrapInternal(line + 1); - } else if (line + 1 < endWrapLine) { + } else if ((line + 1) < endWrapLine) { // See if another paragraph needs to be wrapped. int nextLine = line + 1; - while (nextLine <= endWrapLine + while ((nextLine <= endWrapLine) && textEditor.getLine(nextLine).trim().isEmpty()) { ++nextLine; } @@ -8040,7 +7995,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, rewrapInternal(nextLine); } } - } else if (line + 1 <= endWrapLine) { + } else if ((line + 1) <= endWrapLine) { rewrapInternal(line + 1); } } @@ -8083,7 +8038,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, if (isPreviousLineWrapped) { return; } - if (line - 1 > 0) { + if ((line - 1) > 0) { // if the previous line does not start a new paragraph if (!isParagraphStart(line - 1)) { // if the previous line is not empty ( marks the end of a @@ -8093,10 +8048,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, // rewrap the previous line isPreviousLineWrapped = true; rewrapInternal(line - 1); - } else if (line - 1 < endWrapLine) { + } else if ((line - 1) < endWrapLine) { // See if another paragraph needs to be wrapped. int nextLine = line - 1; - while (nextLine <= endWrapLine + while ((nextLine <= endWrapLine) && textEditor.getLine(nextLine).trim().isEmpty()) { --nextLine; } @@ -8105,7 +8060,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, rewrapInternal(nextLine); } } - } else if (line - 1 <= endWrapLine) { + } else if ((line - 1) <= endWrapLine) { isPreviousLineWrapped = true; rewrapInternal(line - 1); } @@ -8122,7 +8077,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, */ private boolean checkParagraphPadding(String firstLine) { boolean rval = false; - if (firstLine.length() > 0 + if ((firstLine.length() > 0) && PADDED_PARAGRAPH_DELIMITERS.contains(firstLine.substring(0, 1))) { rval = true; @@ -8168,7 +8123,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, rval = true; } else if (PARAGRAPH_DELIMITERS.contains(lineText.substring(0, 1))) { rval = true; - } else if (isSaoMetarFlag && lineText.startsWith(" ") == false) { + } else if (isSaoMetarFlag && (lineText.startsWith(" ") == false)) { rval = true; } return rval; @@ -8276,8 +8231,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, if (lineOffset > 0) { boolean goBack = true; - while (goBack && lineIndex > 0) { - if (lineText.startsWith(" ") || lineText.length() == 0) { + while (goBack && (lineIndex > 0)) { + if (lineText.startsWith(" ") || (lineText.length() == 0)) { lineIndex--; } else { String tempLine = st.getLine(lineIndex); @@ -8306,10 +8261,9 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, boolean result = false; byte[] bytesFromFile = getBytesFromFile(file); - for (int i = 0; i < bytesFromFile.length; i++) { - byte b = bytesFromFile[i]; - if (b == 0x09 || b == 0x0A || b == 0x0C || b == 0x0D - || (b >= 0x20 && b <= 0x7E)) { + for (byte b : bytesFromFile) { + if ((b == 0x09) || (b == 0x0A) || (b == 0x0C) || (b == 0x0D) + || ((b >= 0x20) && (b <= 0x7E))) { result = true; break; } @@ -8322,38 +8276,47 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, * Get the contents of file as a byte array. * * @param file - * @return + * @return bytes * @throws IOException */ private static byte[] getBytesFromFile(File file) throws IOException { - InputStream is = new FileInputStream(file); + InputStream is = null; + byte[] bytes = null; - // Get the size of the file - long length = file.length(); + try { + is = new FileInputStream(file); - if (length > Integer.MAX_VALUE) { - // File is too large + // Get the size of the file + long length = file.length(); + + if (length > Integer.MAX_VALUE) { + // File is too large + } + + // Create the byte array to hold the data + bytes = new byte[(int) length]; + + // Read in the bytes + int offset = 0; + int numRead = 0; + while ((offset < bytes.length) + && ((numRead = is + .read(bytes, offset, bytes.length - offset)) >= 0)) { + offset += numRead; + } + + // Ensure all the bytes have been read in + if (offset < bytes.length) { + throw new IOException("Could not completely read file " + + file.getName()); + } + } finally { + + // Close the input stream and return bytes + if (is != null) { + is.close(); + } } - - // Create the byte array to hold the data - byte[] bytes = new byte[(int) length]; - - // Read in the bytes - int offset = 0; - int numRead = 0; - while (offset < bytes.length - && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) { - offset += numRead; - } - - // Ensure all the bytes have been read in - if (offset < bytes.length) { - throw new IOException("Could not completely read file " - + file.getName()); - } - - // Close the input stream and return bytes - is.close(); return bytes; } @@ -8395,7 +8358,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, */ private boolean gfeForbidden(String ccc, String nnn) { boolean retval = false; - if (ccc != null && nnn != null) { + if ((ccc != null) && (nnn != null)) { if (gfePils.contains(nnn) && !exceptionCCCs.contains(ccc)) { retval = true; } @@ -8436,9 +8399,10 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener, * @return */ private static String fixNOR(String bbb) { - if ("NOR".equals(bbb)) + if ("NOR".equals(bbb)) { return ""; - else + } else { return bbb; + } } } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/FollowupData.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/FollowupData.java index ef06609c0c..76729458ce 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/FollowupData.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/FollowupData.java @@ -53,7 +53,7 @@ public class FollowupData extends AbstractWarningRecord { /** * String displayed in the drop down update list. */ - private String displayString; + private final String displayString; /** * String used to test if this object is equivalent to one of the updated @@ -64,7 +64,7 @@ public class FollowupData extends AbstractWarningRecord { /** * Information string used when the follow up is no longer valid or allowed. */ - private String expirationString; + private final String expirationString; public FollowupData(WarningAction action, AbstractWarningRecord record) { super(record); @@ -194,4 +194,13 @@ public class FollowupData extends AbstractWarningRecord { return expirationString; } + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.common.dataplugin.PluginDataObject#getPluginName() + */ + @Override + public String getPluginName() { + return "followUpWarning"; + } } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java index 22fcb375ee..a9f7e18629 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/gui/WarngenLayer.java @@ -190,6 +190,7 @@ import com.vividsolutions.jts.io.WKTReader; * 08/19/2013 2177 jsanchez Set a GeneralGridGeometry object in the GeospatialDataList. * 09/17/2013 DR 16496 D. Friedman Make editable state more consistent. * 10/01/2013 DR 16632 Qinglu Lin Catch exceptions thrown while doing areaPercent computation and union(). + * 10/15/2013 2463 jsanchez Create a square polygon when time matched with a resource with no data. * 10/21/2013 DR 16632 D. Friedman Modify areaPercent exception handling. Fix an NPE. * Use A1 hatching behavior when no county passes the inclusion filter. * 10/29/2013 DR 16734 D. Friedman If redraw-from-hatched-area fails, don't allow the pollygon the be used. @@ -839,12 +840,8 @@ public class WarngenLayer extends AbstractStormTrackResource { int frameCount = trackUtil.getFrameCount(paintProps.getFramesInfo()); // TODO: Issues with frameCount == 1? Could happen if we update on all - // tilts where we had multiple frames then they went away - if ((displayState.mode == Mode.TRACK && lastMode == Mode.DRAG_ME) - || (frameCount == 1 && displayState.geomChanged)) { - if (frameCount == 1 && displayState.geomChanged) { - displayState.geomChanged = false; - } + // tilts where we had multiple frames then they went away. + if (displayState.mode == Mode.TRACK && lastMode == Mode.DRAG_ME) { if (warningAction == null || warningAction == WarningAction.NEW) { // Initialize box redrawBoxFromTrack(); @@ -2046,6 +2043,9 @@ public class WarngenLayer extends AbstractStormTrackResource { && this.displayState.displayType != DisplayType.POLY) { createSquare(); return; + } else if (descriptor.getFramesInfo().getFrameCount() == 1) { + createSquare(); + return; } } diff --git a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/CurrentWarnings.java b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/CurrentWarnings.java index 611154a8c5..264f20eb60 100644 --- a/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/CurrentWarnings.java +++ b/cave/com.raytheon.viz.warngen/src/com/raytheon/viz/warngen/util/CurrentWarnings.java @@ -44,6 +44,7 @@ import com.raytheon.uf.common.site.SiteMap; 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.time.ISimulatedTimeChangeListener; import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.time.TimeRange; import com.raytheon.uf.common.time.util.TimeUtil; @@ -76,6 +77,7 @@ import com.vividsolutions.jts.geom.Geometry; * Jul 22, 2013 2176 jsanchez Set the raw message for an EXT. * Aug 14, 2013 DR 16483 Qinglu Lin Fixed no option issue in WarnGen dropdown menu after * issuance of an CANCON and restart of CAVE. + * Oct 16, 2013 2439 rferrel Restrict retrieval of warnings to prevent getting future warnings. * * * @author mschenke @@ -130,9 +132,9 @@ public class CurrentWarnings { } - private static Map instanceMap = new HashMap(); + private static final Map instanceMap = new HashMap(); - private static Set listeners = Collections + private static final Set listeners = Collections .synchronizedSet(new HashSet()); static { @@ -208,9 +210,25 @@ public class CurrentWarnings { } }; + /** + * Singleton constructor. + * + * @param officeId + */ private CurrentWarnings(String officeId) { this.officeId = officeId; initializeData(); + + // This assumes the instances stays around for the life of the JVM. + ISimulatedTimeChangeListener changeListener = new ISimulatedTimeChangeListener() { + + @Override + public void timechanged() { + initializeData(); + } + }; + SimulatedTime.getSystemTime().addSimulatedTimeChangeListener( + changeListener); } /** @@ -219,6 +237,10 @@ public class CurrentWarnings { private void initializeData() { Map constraints = new HashMap(); constraints.put("officeid", new RequestConstraint(officeId)); + Calendar time = TimeUtil.newCalendar(); + constraints.put("issueTime", + new RequestConstraint(TimeUtil.formatDate(time), + ConstraintType.LESS_THAN_EQUALS)); long t0 = System.currentTimeMillis(); List warnings = requestRecords(constraints); diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WWAResourceData.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WWAResourceData.java index 36d956dc14..76c3d33e99 100644 --- a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WWAResourceData.java +++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WWAResourceData.java @@ -20,8 +20,8 @@ import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.responses.DbQueryResponse; import com.raytheon.uf.common.time.BinOffset; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.time.TimeRange; +import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData; @@ -40,6 +40,7 @@ import com.raytheon.viz.core.mode.CAVEMode; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 3, 2011 jsanchez Initial creation + * Oct 25, 2013 2249 rferrel getAvailableTimes always returns a non-empty list. * * * @@ -143,11 +144,19 @@ public class WWAResourceData extends AbstractRequestableResourceData { && phenSig.getConstraintValue().contains(".A") ? getWatchStartTimes(warnings) : getWarningStartTimes(warnings); - if (SimulatedTime.getSystemTime().isRealTime()) { - // Add the current time to the end of the array. - startTimes - .add(new DataTime(SimulatedTime.getSystemTime().getTime())); - } + // DR2249 + // When not in real time the commented code allows availableTimes to be + // empty. This causes Null pointer exceptions when getting frames. If + // always placing non-realtime causes other problems may want to add + // only when startTimes is empty: + // if (SimulatedTime.getSystemTime().isRealTime()) { + // // Add the current time to the end of the array. + // startTimes.add(new + // DataTime(SimulatedTime.getSystemTime().getTime())); + // } + + // Add current configured system time. + startTimes.add(new DataTime(TimeUtil.newDate())); DataTime[] availableTimes = startTimes.toArray(new DataTime[startTimes .size()]); diff --git a/cots/edu.uci.ics.crawler4j/.classpath b/cots/edu.uci.ics.crawler4j/.classpath index 91d52dc1ea..ec2246d7b4 100644 --- a/cots/edu.uci.ics.crawler4j/.classpath +++ b/cots/edu.uci.ics.crawler4j/.classpath @@ -5,7 +5,6 @@ - diff --git a/cots/edu.uci.ics.crawler4j/META-INF/MANIFEST.MF b/cots/edu.uci.ics.crawler4j/META-INF/MANIFEST.MF index ac53aef703..4532dbcd7c 100644 --- a/cots/edu.uci.ics.crawler4j/META-INF/MANIFEST.MF +++ b/cots/edu.uci.ics.crawler4j/META-INF/MANIFEST.MF @@ -10,7 +10,6 @@ Bundle-ClassPath: apache-mime4j-core-0.7.jar, asm-3.1.jar, boilerpipe-1.1.0.jar, commons-codec-1.5.jar, - commons-compress-1.3.jar, commons-logging-1.1.1.jar, geronimo-stax-api_1.0_spec-1.0.1.jar, httpclient-4.1.2.jar, @@ -22,7 +21,8 @@ Bundle-ClassPath: apache-mime4j-core-0.7.jar, tika-parsers-1.0.jar, . Require-Bundle: org.eclipse.core.runtime, - org.apache.log4j + org.apache.log4j, + org.apache.commons.compress;bundle-version="1.5.0" Export-Package: com.drew.imaging, com.drew.imaging.jpeg, com.drew.imaging.tiff, @@ -100,19 +100,6 @@ Export-Package: com.drew.imaging, org.apache.commons.codec.digest, org.apache.commons.codec.language, org.apache.commons.codec.net, - org.apache.commons.compress.archivers, - org.apache.commons.compress.archivers.ar, - org.apache.commons.compress.archivers.cpio, - org.apache.commons.compress.archivers.dump, - org.apache.commons.compress.archivers.jar, - org.apache.commons.compress.archivers.tar, - org.apache.commons.compress.archivers.zip, - org.apache.commons.compress.changes, - org.apache.commons.compress.compressors, - org.apache.commons.compress.compressors.bzip2, - org.apache.commons.compress.compressors.gzip, - org.apache.commons.compress.compressors.pack200, - org.apache.commons.compress.utils, org.apache.commons.logging, org.apache.commons.logging.impl, org.apache.http, diff --git a/cots/edu.uci.ics.crawler4j/build.properties b/cots/edu.uci.ics.crawler4j/build.properties index 6ca59fa407..d727627a38 100644 --- a/cots/edu.uci.ics.crawler4j/build.properties +++ b/cots/edu.uci.ics.crawler4j/build.properties @@ -6,7 +6,6 @@ bin.includes = META-INF/,\ apache-mime4j-dom-0.7.jar,\ asm-3.1.jar,\ boilerpipe-1.1.0.jar,\ - commons-compress-1.3.jar,\ commons-logging-1.1.1.jar,\ commons-codec-1.5.jar,\ geronimo-stax-api_1.0_spec-1.0.1.jar,\ diff --git a/cots/edu.uci.ics.crawler4j/commons-compress-1.3.jar b/cots/edu.uci.ics.crawler4j/commons-compress-1.3.jar deleted file mode 100644 index 6c826c528b..0000000000 Binary files a/cots/edu.uci.ics.crawler4j/commons-compress-1.3.jar and /dev/null differ diff --git a/cots/org.apache.commons.compress/.classpath b/cots/org.apache.commons.compress/.classpath new file mode 100644 index 0000000000..bc3b6a0fdf --- /dev/null +++ b/cots/org.apache.commons.compress/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/cots/org.apache.commons.compress/.project b/cots/org.apache.commons.compress/.project new file mode 100644 index 0000000000..c8210e6da1 --- /dev/null +++ b/cots/org.apache.commons.compress/.project @@ -0,0 +1,28 @@ + + + org.apache.commons.compress + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/cots/org.apache.commons.compress/.settings/org.eclipse.jdt.core.prefs b/cots/org.apache.commons.compress/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000..c537b63063 --- /dev/null +++ b/cots/org.apache.commons.compress/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/cots/org.apache.commons.compress/META-INF/MANIFEST.MF b/cots/org.apache.commons.compress/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..ee9c2e3e09 --- /dev/null +++ b/cots/org.apache.commons.compress/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Compress +Bundle-SymbolicName: org.apache.commons.compress +Bundle-Version: 1.5 +Bundle-Vendor: Apache +Export-Package: org.apache.commons.compress.archivers, + org.apache.commons.compress.archivers.ar, + org.apache.commons.compress.archivers.cpio, + org.apache.commons.compress.archivers.dump, + org.apache.commons.compress.archivers.jar, + org.apache.commons.compress.archivers.tar, + org.apache.commons.compress.archivers.zip, + org.apache.commons.compress.changes, + org.apache.commons.compress.compressors, + org.apache.commons.compress.compressors.bzip2, + org.apache.commons.compress.compressors.gzip, + org.apache.commons.compress.compressors.pack200, + org.apache.commons.compress.compressors.xz, + org.apache.commons.compress.utils +Bundle-ClassPath: commons-compress-1.5.jar diff --git a/cots/org.apache.commons.compress/build.properties b/cots/org.apache.commons.compress/build.properties new file mode 100644 index 0000000000..f869b070d6 --- /dev/null +++ b/cots/org.apache.commons.compress/build.properties @@ -0,0 +1,2 @@ +bin.includes = META-INF/,\ + commons-compress-1.5.jar diff --git a/cots/org.apache.commons.compress/commons-compress-1.5-javadoc.jar b/cots/org.apache.commons.compress/commons-compress-1.5-javadoc.jar new file mode 100644 index 0000000000..7e6d42c223 Binary files /dev/null and b/cots/org.apache.commons.compress/commons-compress-1.5-javadoc.jar differ diff --git a/cots/org.apache.commons.compress/commons-compress-1.5-sources.jar b/cots/org.apache.commons.compress/commons-compress-1.5-sources.jar new file mode 100644 index 0000000000..f9931e58cf Binary files /dev/null and b/cots/org.apache.commons.compress/commons-compress-1.5-sources.jar differ diff --git a/cots/org.apache.commons.compress/commons-compress-1.5.jar b/cots/org.apache.commons.compress/commons-compress-1.5.jar new file mode 100644 index 0000000000..0239414e84 Binary files /dev/null and b/cots/org.apache.commons.compress/commons-compress-1.5.jar differ diff --git a/edexOsgi/build.edex/esb/bin/setup.env b/edexOsgi/build.edex/esb/bin/setup.env index 3661f632b4..d8ed5468ae 100644 --- a/edexOsgi/build.edex/esb/bin/setup.env +++ b/edexOsgi/build.edex/esb/bin/setup.env @@ -47,6 +47,7 @@ export EBXML_REGISTRY_FEDERATION_ENABLED=false export HTTP_PORT=9581 export HTTP_SERVER=http://localhost:${HTTP_PORT}/services export JMS_SERVER=tcp://localhost:5672 +export JMS_VIRTUALHOST=edex export RADAR_SERVER=tcp://localhost:8813 export DATADELIVERY_SERVER=http://${DATADELIVERY_HOST}:${DATADELIVERY_PORT}/services export EBXML_REGISTRY_SERVICE=http://${EBXML_REGISTRY_HOST}:${EBXML_REGISTRY_PORT}/services diff --git a/edexOsgi/build.edex/esb/conf/modes.xml b/edexOsgi/build.edex/esb/conf/modes.xml index 09c3b0ad4c..86d13b4bcd 100644 --- a/edexOsgi/build.edex/esb/conf/modes.xml +++ b/edexOsgi/build.edex/esb/conf/modes.xml @@ -113,6 +113,58 @@ cpgsrv-spring.xml .*sbn-simulator.* + + distribution-spring.xml + manualIngest-common.xml + manualIngest-spring.xml + shef-ingest.xml + shef-common.xml + ohd-common.xml + alarmWhfs-spring.xml + arealffgGenerator-spring.xml + arealQpeGen-spring.xml + DPADecoder-spring.xml + dqcPreprocessor-spring.xml + floodArchiver-spring.xml + freezingLevel-spring.xml + hpeDHRDecoder-spring.xml + ihfsDbPurge-spring.xml + logFilePurger-spring.xml + mpeFieldgen-spring.xml + mpeHpeFilePurge-spring.xml + mpeLightningSrv-ingest.xml + mpeProcessGrib-spring.xml + ohdSetupService-spring.xml + pointDataRetrievel-spring.xml + q2FileProcessor-spring.xml + satpre-spring.xml + purge-logs.xml + + + ohd-common.xml + database-common.xml + ohd-request.xml + alertviz-request.xml + auth-common.xml + auth-request.xml + menus-request.xml + utility-request.xml + management-common.xml + management-request.xml + manualIngest-common.xml + manualIngest-request.xml + nwsauth-request.xml + persist-request.xml + site-common.xml + site-request.xml + time-common.xml + units-common.xml + useradmin-common.xml + useradmin-request.xml + event-common.xml + eventbus-common.xml + edex-request.xml + time-common.xml auth-common.xml @@ -225,7 +277,6 @@ time-common.xml auth-common.xml nwsauth-request.xml - grid-staticdata-process.xml grid-common.xml gridcoverage-.*.xml parameter-common.xml @@ -351,7 +402,6 @@ obs-ogc.xml--> - + diff --git a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/geospatialConfig_ZONE.xml b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/geospatialConfig_ZONE.xml index 8f531db6bc..f7665c33b8 100644 --- a/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/geospatialConfig_ZONE.xml +++ b/edexOsgi/build.edex/esb/data/utility/common_static/base/warngen/geospatialConfig_ZONE.xml @@ -198,10 +198,4 @@ - - - - - + diff --git a/edexOsgi/build.edex/esb/etc/ingestHydro.sh b/edexOsgi/build.edex/esb/etc/ingestHydro.sh new file mode 100644 index 0000000000..3ef1b62953 --- /dev/null +++ b/edexOsgi/build.edex/esb/etc/ingestHydro.sh @@ -0,0 +1,29 @@ +#!/bin/bash +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## + +export INIT_MEM=412 # in Meg +export MAX_MEM=796 # in Meg + +export METADATA_POOL_MIN=4 +export EDEX_DEBUG_PORT=5006 +export EDEX_JMX_PORT=1617 +export LOG4J_CONF=log4j-ingest.xml +export MGMT_PORT=9602 diff --git a/edexOsgi/build.edex/esb/etc/requestHydro.sh b/edexOsgi/build.edex/esb/etc/requestHydro.sh new file mode 100644 index 0000000000..4d07d95073 --- /dev/null +++ b/edexOsgi/build.edex/esb/etc/requestHydro.sh @@ -0,0 +1,36 @@ +#!/bin/bash +## +# This software was developed and / or modified by Raytheon Company, +# pursuant to Contract DG133W-05-CQ-1067 with the US Government. +# +# U.S. EXPORT CONTROLLED TECHNICAL DATA +# This software product contains export-restricted data whose +# export/transfer/disclosure is restricted by U.S. law. Dissemination +# to non-U.S. persons whether in the United States or abroad requires +# an export license or other authorization. +# +# Contractor Name: Raytheon Company +# Contractor Address: 6825 Pine Street, Suite 340 +# Mail Stop B8 +# Omaha, NE 68106 +# 402.291.0100 +# +# See the AWIPS II Master Rights File ("Master Rights File.pdf") for +# further licensing information. +## +export INIT_MEM=128 # in Meg +if [ "$EDEX_ARCH" == "64-bit" ]; then + export MAX_MEM=1648 # in Meg +else + export MAX_MEM=880 # in Meg +fi +export SERIALIZE_POOL_MAX_SIZE=24 +export SERIALIZE_STREAM_INIT_SIZE_MB=2 +export SERIALIZE_STREAM_MAX_SIZE_MB=8 + + +export JMS_POOL_MIN=8 +export JMS_POOL_MAX=24 +export EDEX_DEBUG_PORT=5005 +export EDEX_JMX_PORT=1616 +export MGMT_PORT=9601 diff --git a/edexOsgi/com.raytheon.edex.plugin.airep/src/com/raytheon/edex/plugin/airep/AirepDecoder.java b/edexOsgi/com.raytheon.edex.plugin.airep/src/com/raytheon/edex/plugin/airep/AirepDecoder.java index a3e0b510ba..d9dbd0556c 100644 --- a/edexOsgi/com.raytheon.edex.plugin.airep/src/com/raytheon/edex/plugin/airep/AirepDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.airep/src/com/raytheon/edex/plugin/airep/AirepDecoder.java @@ -47,19 +47,18 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * } * * - * + * *
  * 
  * SOFTWARE HISTORY
  * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * 20080103            384 jkorman     Initial Coding.
- * 20080408           1039 jkorman     Added traceId for tracing data.
- * 11/11/08           1684 chammack    Camel Refactor
- * ======================================
- * AWIPS2 DR Work
- * 20120911           1011 jkorman     Added decode of AIREP turbulence.
+ * Jan 03, 2008 384        jkorman     Initial Coding.
+ * Apr 08, 2008 1039       jkorman     Added traceId for tracing data.
+ * Nov 11, 2008 1684       chammack    Camel Refactor
+ * Sep 11, 2012 1011       jkorman     Added decode of AIREP turbulence.
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
  * 
* * @author jkorman @@ -103,19 +102,19 @@ public class AirepDecoder extends AbstractDecoder { try { WMOHeader wmoHeader = input.wmoHeader; - if(wmoHeader != null) { + if (wmoHeader != null) { traceId = wmoHeader.getWmoHeader().replace(" ", "_"); logger.info(traceId + "- AirepDecoder.decode()"); Calendar refTime = TimeTools.findDataTime( wmoHeader.getYYGGgg(), header); - if(refTime != null) { - report = populateRecord(new AirepParser(input.report, refTime)); + if (refTime != null) { + report = populateRecord(new AirepParser(input.report, + refTime)); } } if (report != null) { report.setTraceId(traceId); - report.setPluginName(PLUGIN_NAME); try { report.constructDataURI(); } catch (PluginException e) { @@ -182,17 +181,17 @@ public class AirepDecoder extends AbstractDecoder { } AirepParser.Turbulence turb = parser.getTurbulence(); int t = -1; - if(turb != null) { + if (turb != null) { t = turb.getTurbulence() << 4; } - if(flightConditions > -1) { - if(t > -1) { + if (flightConditions > -1) { + if (t > -1) { record.setFlightConditions(flightConditions | t); } else { record.setFlightConditions(flightConditions); } } else { - if(t > -1) { + if (t > -1) { record.setFlightConditions(t); } } diff --git a/edexOsgi/com.raytheon.edex.plugin.binlightning/src/com/raytheon/edex/plugin/binlightning/BinLightningDecoder.java b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/com/raytheon/edex/plugin/binlightning/BinLightningDecoder.java index 40a557f8ec..9d1894ecfb 100644 --- a/edexOsgi/com.raytheon.edex.plugin.binlightning/src/com/raytheon/edex/plugin/binlightning/BinLightningDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.binlightning/src/com/raytheon/edex/plugin/binlightning/BinLightningDecoder.java @@ -64,18 +64,21 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20070810 379 jkorman Initial Coding from prototype. - * 20070817 379 jkorman Changed log info to debug in decode(). - * 20070821 379 jkorman Added SFPA41 lightning data pattern. - * 20070912 379 jkorman Code review cleanup. - * 20070920 379 jkorman Check for null persistence time. - * 20070924 379 jkorman Removed HDFGroup code. Set insert_time + * Aug 10, 2007 379 jkorman Initial Coding from prototype. + * Aug 17, 2007 379 jkorman Changed log info to debug in decode(). + * Aug 21, 2007 379 jkorman Added SFPA41 lightning data pattern. + * Sep 12, 2007 379 jkorman Code review cleanup. + * Sep 20, 2007 379 jkorman Check for null persistence time. + * Sep 24, 2007 379 jkorman Removed HDFGroup code. Set insert_time * directly in decode. - * 20070926 379 jkorman Updated to set DataTime. - * 20080318 1026 jkorman Added debug strike info. - * 20080408 1039 jkorman Added traceId for tracing data. - * 11/11/08 1684 chammack Refactored for camel integration - * 20130503 DCS 112 Wufeng Zhou Modified to be able to handle both the new encrypted data and legacy bit-shifted data + * Sep 26, 2007 379 jkorman Updated to set DataTime. + * Mar 18, 2008 1026 jkorman Added debug strike info. + * Apr 08, 2008 1039 jkorman Added traceId for tracing data. + * Nov 11, 2008 1684 chammack Refactored for camel integration + * May 03, 2013 DCS 112 Wufeng Zhou Modified to be able to handle both the + * new encrypted data and legacy bit-shifted + * data + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -90,9 +93,9 @@ public class BinLightningDecoder extends AbstractDecoder { // Allow ingest up to 10 minutes into the future. private static final long TEN_MINUTES = 10 * 60 * 1000L; - private SimpleDateFormat SDF; + private final SimpleDateFormat SDF; - private Log logger = LogFactory.getLog(getClass()); + private final Log logger = LogFactory.getLog(getClass()); /** * Default lightning strike type for FLASH messages. RT_FLASH documents @@ -101,7 +104,7 @@ public class BinLightningDecoder extends AbstractDecoder { public LtgStrikeType DEFAULT_FLASH_TYPE = LtgStrikeType.STRIKE_CG; private String traceId = null; - + /** * Construct a BinLightning decoder. Calling hasNext() after construction * will return false, decode() will return a null. @@ -118,9 +121,10 @@ public class BinLightningDecoder extends AbstractDecoder { * @throws DecoderException * Thrown if no data is available. */ - public PluginDataObject[] decode(byte[] data, Headers headers) throws DecoderException { + public PluginDataObject[] decode(byte[] data, Headers headers) + throws DecoderException { - //String traceId = null; + // String traceId = null; PluginDataObject[] reports = new PluginDataObject[0]; if (data != null) { @@ -131,43 +135,56 @@ public class BinLightningDecoder extends AbstractDecoder { Calendar baseTime = TimeTools.findDataTime(wmoHdr.getYYGGgg(), headers); - - // Because binary nature of the encrypted data, the string created with its byte[] array may not have the same length of the byte[] array length - // So when DecoderTools.stripWMOHeader() assumes byte[] length == String length in it logic, it is observed that it may return a shorter byte[] than - // the real data array. (Looks like a bug???) -// byte[] pdata = DecoderTools.stripWMOHeader(data, SFUS_PATTERN); -// if (pdata == null) { -// pdata = DecoderTools.stripWMOHeader(data, SFPA_PATTERN); -// } - // instead the following is used to strip WMO header a little more safely. + + // Because binary nature of the encrypted data, the string + // created with its byte[] array may not have the same length of + // the byte[] array length + // So when DecoderTools.stripWMOHeader() assumes byte[] length + // == String length in it logic, it is observed that it may + // return a shorter byte[] than + // the real data array. (Looks like a bug???) + // byte[] pdata = DecoderTools.stripWMOHeader(data, + // SFUS_PATTERN); + // if (pdata == null) { + // pdata = DecoderTools.stripWMOHeader(data, SFPA_PATTERN); + // } + // instead the following is used to strip WMO header a little + // more safely. byte[] pdata = null; - if (wmoHdr.isValid() && wmoHdr.getMessageDataStart() > 0) { - pdata = new byte[data.length - wmoHdr.getMessageDataStart()]; - System.arraycopy(data, wmoHdr.getMessageDataStart(), pdata, 0, data.length - wmoHdr.getMessageDataStart()); - } - + if (wmoHdr.isValid() && (wmoHdr.getMessageDataStart() > 0)) { + pdata = new byte[data.length - wmoHdr.getMessageDataStart()]; + System.arraycopy(data, wmoHdr.getMessageDataStart(), pdata, + 0, data.length - wmoHdr.getMessageDataStart()); + } + if ((pdata == null) || (pdata.length == 0)) { return new PluginDataObject[0]; } - + // - // Modified by Wufeng Zhou to handle both legacy bit-shifted and new encryted data + // Modified by Wufeng Zhou to handle both legacy bit-shifted and + // new encryted data // - // Preserved the legacy decoding in BinLigntningDecoderUtil.decodeBitShiftedBinLightningData(), and added logic to process - // both encrypted data and legacy data - // - - List strikes = BinLigntningDecoderUtil.decodeBinLightningData(data, pdata, traceId, baseTime.getTime()); + // Preserved the legacy decoding in + // BinLigntningDecoderUtil.decodeBitShiftedBinLightningData(), + // and added logic to process + // both encrypted data and legacy data + // + + List strikes = BinLigntningDecoderUtil + .decodeBinLightningData(data, pdata, traceId, + baseTime.getTime()); if (strikes == null) { // keep-alive record, log and return - logger.info(traceId + " - found keep-alive record. ignore for now."); - return reports; + logger.info(traceId + + " - found keep-alive record. ignore for now."); + return reports; } // // Done MOD by Wufeng Zhou // - + // post processing data - if not keep-alive record BinLightningRecord report = null; if (strikes.size() > 0) { @@ -182,22 +199,22 @@ public class BinLightningDecoder extends AbstractDecoder { Calendar c = TimeTools.copy(baseTime); if (c == null) { - throw new DecoderException(traceId + " - Error decoding times"); + throw new DecoderException(traceId + + " - Error decoding times"); } - //report.setInsertTime(c); // OB13.4 source code does not have this line anymore, WZ 05/03/2013 + // report.setInsertTime(c); // OB13.4 source code does not have + // this line anymore, WZ 05/03/2013 Calendar cStart = report.getStartTime(); - if (cStart.getTimeInMillis() > c.getTimeInMillis() - + TEN_MINUTES) { - synchronized (SDF) { - logger.info("Discarding future data for " + traceId - + " at " + SDF.format(cStart.getTime())); - } + if (cStart.getTimeInMillis() > (c.getTimeInMillis() + TEN_MINUTES)) { + synchronized (SDF) { + logger.info("Discarding future data for " + traceId + + " at " + SDF.format(cStart.getTime())); + } } else { Calendar cStop = report.getStopTime(); - TimeRange range = new TimeRange( - cStart.getTimeInMillis(), + TimeRange range = new TimeRange(cStart.getTimeInMillis(), cStop.getTimeInMillis()); DataTime dataTime = new DataTime(cStart, range); @@ -205,19 +222,19 @@ public class BinLightningDecoder extends AbstractDecoder { if (report != null) { report.setTraceId(traceId); - report.setPluginName("binlightning"); try { report.constructDataURI(); reports = new PluginDataObject[] { report }; } catch (PluginException e) { - logger.error("Error constructing datauri", e); - throw new DecoderException("Error constructing datauri", e); + logger.error("Error constructing datauri", e); + throw new DecoderException( + "Error constructing datauri", e); } } } } } else { - logger.error("No WMOHeader found in data"); + logger.error("No WMOHeader found in data"); } return reports; } diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosData.java b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosData.java index 4e3febcf4b..d5d8c9ca18 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosData.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrmos/src/com/raytheon/edex/plugin/bufrmos/common/BufrMosData.java @@ -59,6 +59,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * May 02, 2013 1970 bgonzale Removed Table annotation, changed from * Entity annotation to MappedSuperClass. * May 14, 2013 1869 bsteffen Remove DataURI column from bufrmos. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -75,123 +76,126 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; public abstract class BufrMosData extends PersistablePluginDataObject implements IPersistable, IPointData { - public static enum MOSType { - ETA, GFS, AVN, LAMP, HPC, MRF, NGM - }; + public static enum MOSType { + ETA, GFS, AVN, LAMP, HPC, MRF, NGM + }; - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - public static final String MOS_DATA = "Data"; + public static final String MOS_DATA = "Data"; - // Text of the WMO header - @Transient - @XmlAttribute - @DynamicSerializeElement - private String wmoHeader; + // Text of the WMO header + @Transient + @XmlAttribute + @DynamicSerializeElement + private String wmoHeader; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView = null; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView = null; - @ManyToOne(cascade = { CascadeType.REFRESH }) - @PrimaryKeyJoinColumn - @DataURI(position = 1, embedded = true) - @XmlElement - @DynamicSerializeElement - private BufrMosDataLocation location; + @ManyToOne(cascade = { CascadeType.REFRESH }) + @PrimaryKeyJoinColumn + @DataURI(position = 1, embedded = true) + @XmlElement + @DynamicSerializeElement + private BufrMosDataLocation location; - /** - * Create an empty MOSData object. - */ - public BufrMosData() { - this.pluginName = "bufrmos" + getType(); - } + /** + * Create an empty MOSData object. + */ + public BufrMosData() { + } - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public BufrMosData(String uri) { - super(uri); - } + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public BufrMosData(String uri) { + super(uri); + } - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } - /** - * @return the type - */ - public abstract MOSType getType(); + /** + * @return the type + */ + public abstract MOSType getType(); - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * - * @param dataURI - */ - @Override - public void setDataURI(String dataURI) { - identifier = dataURI; - } + /** + * + * @param dataURI + */ + @Override + public void setDataURI(String dataURI) { + identifier = dataURI; + } - public BufrMosDataLocation getLocation() { - return location; - } + public BufrMosDataLocation getLocation() { + return location; + } - public void setLocation(BufrMosDataLocation mosLocation) { - this.location = mosLocation; - } + public void setLocation(BufrMosDataLocation mosLocation) { + this.location = mosLocation; + } - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } - } + @Override + public String getPluginName() { + return "bufrmos" + getType(); + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/decoder/AbstractBUFRUAAdapter.java b/edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/decoder/AbstractBUFRUAAdapter.java index 33a15728a1..fae74720fd 100644 --- a/edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/decoder/AbstractBUFRUAAdapter.java +++ b/edexOsgi/com.raytheon.edex.plugin.bufrua/src/com/raytheon/edex/plugin/bufrua/decoder/AbstractBUFRUAAdapter.java @@ -51,6 +51,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * Mar 03, 2008 969 jkorman Initial implementation. * May 09, 2013 1869 bsteffen Modified D2D time series of point data to * work without dataURI. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -110,7 +111,6 @@ public abstract class AbstractBUFRUAAdapter extends BUFRPointDataAdapter if ((obsData != null) && (wmoStaId != null)) { // pickup the data. - obsData.setPluginName(getPluginName()); obsData.setWmoHeader(wmoHeader.getWmoHeader()); Calendar validTime = obsData.getValidTime(); diff --git a/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpDecoder.java b/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpDecoder.java index 494b368d88..7dd70eccd7 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpDecoder.java @@ -43,11 +43,12 @@ import com.vividsolutions.jts.io.WKTReader; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 03/03/2007 908 bwoodle initial creation - * 12/03/2008 chammack Camel refactor - * 09/15/2009 3027 njensen Patterns constants - * 09/21/2009 3072 bsteffen Fixed Decoding of Line Records - * 01/02/2013 DCS 135 tk handle coverage value Line records + * Mar 03, 2007 908 bwoodle initial creation + * Dec 03, 2008 chammack Camel refactor + * Sep 15, 2009 3027 njensen Patterns constants + * Sep 21, 2009 3072 bsteffen Fixed Decoding of Line Records + * Jan 02, 2013 DCS 135 tk handle coverage value Line records + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -86,7 +87,8 @@ public class CcfpDecoder extends AbstractDecoder { private static final String SPACE = " "; - private static final PluginDataObject [] EMPTY_PDO = new PluginDataObject [0]; + private static final PluginDataObject[] EMPTY_PDO = new PluginDataObject[0]; + /** * Constructor * @@ -95,10 +97,11 @@ public class CcfpDecoder extends AbstractDecoder { public CcfpDecoder() throws DecoderException { } - public PluginDataObject[] decode(String msg, Headers headers) throws PluginException { + public PluginDataObject[] decode(String msg, Headers headers) + throws PluginException { + + PluginDataObject[] data = null; - PluginDataObject [] data = null; - Calendar baseTime = null; WMOHeader wmoHdr = new WMOHeader(msg.getBytes()); if (wmoHdr.isValid()) { @@ -106,7 +109,7 @@ public class CcfpDecoder extends AbstractDecoder { } else { baseTime = TimeTools.getSystemCalendar(); } - + CcfpRecord record = new CcfpRecord(); record.setMessageData(msg); CcfpLocation location = new CcfpLocation(); @@ -116,18 +119,20 @@ public class CcfpDecoder extends AbstractDecoder { try { WKTReader wktReader = new WKTReader(); if (matcher.find()) { - Calendar start = TimeTools.getBaseCalendar(Integer - .parseInt(matcher.group(1)), Integer.parseInt(matcher - .group(2)), Integer.parseInt(matcher.group(3))); - start.set(Calendar.HOUR_OF_DAY, Integer.parseInt(matcher - .group(4))); - Calendar valid = TimeTools.getBaseCalendar(Integer - .parseInt(matcher.group(5)), Integer.parseInt(matcher - .group(6)), Integer.parseInt(matcher.group(7))); - valid.set(Calendar.HOUR_OF_DAY, Integer.parseInt(matcher - .group(8))); - TimeRange range = new TimeRange(start.getTime(), valid - .getTime()); + Calendar start = TimeTools.getBaseCalendar( + Integer.parseInt(matcher.group(1)), + Integer.parseInt(matcher.group(2)), + Integer.parseInt(matcher.group(3))); + start.set(Calendar.HOUR_OF_DAY, + Integer.parseInt(matcher.group(4))); + Calendar valid = TimeTools.getBaseCalendar( + Integer.parseInt(matcher.group(5)), + Integer.parseInt(matcher.group(6)), + Integer.parseInt(matcher.group(7))); + valid.set(Calendar.HOUR_OF_DAY, + Integer.parseInt(matcher.group(8))); + TimeRange range = new TimeRange(start.getTime(), + valid.getTime()); record.setDataTime(new DataTime(start.getTime().getTime(), range)); record.setProducttype(matcher.group(9)); @@ -147,8 +152,7 @@ public class CcfpDecoder extends AbstractDecoder { record.setTops(Integer.parseInt(matcher.group(4))); record.setSpeed(Integer.parseInt(matcher.group(5))); record.setDirection(Integer.parseInt(matcher.group(6))); - location - .setBoxLat(Double.parseDouble(matcher.group(8)) * 0.1); + location.setBoxLat(Double.parseDouble(matcher.group(8)) * 0.1); location.setBoxLong(Double.parseDouble(matcher.group(9)) * -0.1); String templatlonpairs = matcher.group(7); @@ -157,8 +161,7 @@ public class CcfpDecoder extends AbstractDecoder { wtk.append("POLYGON(("); if (matcher.find()) { wtk.append(Double.toString(Integer.parseInt(matcher - .group(2)) - * -0.1)); + .group(2)) * -0.1)); wtk.append(SPACE); wtk.append(Double.toString(Integer.parseInt(matcher .group(1)) * 0.1)); @@ -167,8 +170,7 @@ public class CcfpDecoder extends AbstractDecoder { wtk.append(COMMA); wtk.append(SPACE); wtk.append(Double.toString(Integer.parseInt(matcher - .group(2)) - * -0.1)); + .group(2)) * -0.1)); wtk.append(SPACE); wtk.append(Double.toString(Integer.parseInt(matcher .group(1)) * 0.1)); @@ -180,30 +182,30 @@ public class CcfpDecoder extends AbstractDecoder { } else if (record.getProducttype().equals("LINE")) { matcher = LINE_PATTERN.matcher(msg); if (matcher.find()) { - record.setCoverage(Integer.parseInt(matcher.group(1))); // change to group 1 + // change to group 1 + record.setCoverage(Integer.parseInt(matcher.group(1))); record.setConf(null); record.setGrowth(null); record.setTops(null); record.setSpeed(null); record.setDirection(null); - String templatlonpairs = matcher.group(2); // change to group 2 + // change to group 2 + String templatlonpairs = matcher.group(2); matcher = PAIR_PATTERN.matcher(templatlonpairs); StringBuffer wtk = new StringBuffer(); wtk.append("LINESTRING("); if (matcher.find()) { - - Double lon = Integer.parseInt(matcher - .group(2)) * -0.1; + + Double lon = Integer.parseInt(matcher.group(2)) * -0.1; String lonStr = Double.toString(lon); - Double lat = Integer.parseInt(matcher - .group(1)) * 0.1; + Double lat = Integer.parseInt(matcher.group(1)) * 0.1; String latStr = Double.toString(lat); location.setBoxLong(lon); location.setBoxLat(lat); - + wtk.append(lonStr); wtk.append(SPACE); wtk.append(latStr); @@ -212,8 +214,7 @@ public class CcfpDecoder extends AbstractDecoder { wtk.append(COMMA); wtk.append(SPACE); wtk.append(Double.toString(Integer.parseInt(matcher - .group(2)) - * -0.1)); + .group(2)) * -0.1)); wtk.append(SPACE); wtk.append(Double.toString(Integer.parseInt(matcher .group(1)) * 0.1)); @@ -228,8 +229,7 @@ public class CcfpDecoder extends AbstractDecoder { logger.error("Unable to decode CCFP", e); } data = EMPTY_PDO; - if(record != null) { - record.setPluginName(PLUGIN_NAME); + if (record != null) { try { record.constructDataURI(); record.setInsertTime(baseTime); diff --git a/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpRecord.java b/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpRecord.java index a88e9ffa48..340a2922a7 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpRecord.java +++ b/edexOsgi/com.raytheon.edex.plugin.ccfp/src/com/raytheon/edex/plugin/ccfp/CcfpRecord.java @@ -51,13 +51,16 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 03/03/2007 908 bwoodle initial creation - * 09/15/2009 3027 njensen Use dates for times - * 09/21/2009 3072 bsteffen Removed times because they are stored in DataTime - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime + * Mar 03, 2007 908 bwoodle initial creation + * Sep 15, 2009 3027 njensen Use dates for times + * Sep 21, 2009 3072 bsteffen Removed times because they are stored in + * DataTime + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -72,12 +75,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ccfp", - indexes = { - @Index(name = "ccfp_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ccfp", indexes = { @Index(name = "ccfp_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -299,4 +298,9 @@ public class CcfpRecord extends PluginDataObject implements ISpatialEnabled { public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "ccfp"; + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFED2DDao.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFED2DDao.java index be7fe5a742..e68d4a8a47 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFED2DDao.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFED2DDao.java @@ -48,14 +48,17 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 03/20/13 #1774 randerso Refactored out of GFEDao - * 04/04/13 #1787 randerso Fixed to support changes to D2D grid location - * Additional cleanup to move the D2D to GFE translation - * logic into D2DGridDatabase. - * 05/03/13 #1974 randerso Changed queryByParmId to look for parm with duration - * suffix first. - * 05/22/13 #1974 randerso Fix bug introduced by the previous fix where query for - * T (T%hr) returned TP6hr + * Mar 20, 2013 1774 randerso Refactored out of GFEDao + * Apr 04, 2013 1787 randerso Fixed to support changes to D2D grid + * location Additional cleanup to move the + * D2D to GFE translation logic into + * D2DGridDatabase. + * May 03, 2013 1974 randerso Changed queryByParmId to look for parm + * with duration suffix first. + * May 22, 2013 1974 randerso Fix bug introduced by the previous fix + * where query for T (T%hr) returned TP6hr + * Jun 13, 2013 2044 randerso Cleaned up JavaDoc + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -135,7 +138,6 @@ public class GFED2DDao extends GridDao { GridRecord retVal = (GridRecord) s.get(GridRecord.class, rawTimes.get(forecastTime)); - retVal.setPluginName(GridConstants.GRID); return retVal; } finally { diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java index 5ea9c066f0..619a4f31ff 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEDao.java @@ -95,6 +95,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery; * 05/20/13 #2127 rjpeter Set session's to read only and switched to stateless where possible. * 08/08/13 DR16485 ryu Remove call to getDatabaseId() from getMaxInsertTimeByDbId() * so new GFE databases aren't accidentally created. + * 09/30/2013 #2147 rferrel Changes to archive hdf5 files. * * * @author bphillip @@ -106,6 +107,7 @@ public class GFEDao extends DefaultPluginDao { public GFEDao() throws PluginException { super("gfe"); + this.pathProvider = new GFEPathProvider(); } /** @@ -115,6 +117,7 @@ public class GFEDao extends DefaultPluginDao { */ public GFEDao(String pluginName) throws PluginException { super(pluginName); + this.pathProvider = new GFEPathProvider(); } /** diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEPathProvider.java b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEPathProvider.java new file mode 100644 index 0000000000..9a0d37c4e5 --- /dev/null +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/src/com/raytheon/edex/plugin/gfe/db/dao/GFEPathProvider.java @@ -0,0 +1,97 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.edex.plugin.gfe.db.dao; + +import java.io.File; + +import com.raytheon.edex.plugin.gfe.server.database.GridDatabase; +import com.raytheon.uf.common.dataplugin.gfe.db.objects.GFERecord; +import com.raytheon.uf.common.dataplugin.gfe.util.GfeUtil; +import com.raytheon.uf.common.dataplugin.persist.DefaultPathProvider; +import com.raytheon.uf.common.dataplugin.persist.IPersistable; + +/** + * Provider for GFE that uses the GfeUtil to get the HDF5 path and file names. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Sep 23, 2013            rferrel     Initial creation
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ + +public class GFEPathProvider extends DefaultPathProvider { + + /** + * Constructor. + */ + public GFEPathProvider() { + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.dataplugin.persist.DefaultPathProvider#getHDFFileName + * (java.lang.String, + * com.raytheon.uf.common.dataplugin.persist.IPersistable) + */ + @Override + public String getHDFFileName(String pluginName, IPersistable persistable) { + String name = null; + if (persistable instanceof GFERecord) { + GFERecord gfeRecord = (GFERecord) persistable; + File hdf5File = GfeUtil.getHdf5File(GridDatabase.gfeBaseDataDir, + gfeRecord.getParmId(), gfeRecord.getTimeRange()); + name = hdf5File.toString(); + name = name.substring(name.lastIndexOf(File.separator) + 1); + } + return name; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.dataplugin.persist.DefaultPathProvider#getHDFPath + * (java.lang.String, + * com.raytheon.uf.common.dataplugin.persist.IPersistable) + */ + @Override + public String getHDFPath(String pluginName, IPersistable persistable) { + String path = null; + path = super.getHDFPath(pluginName, persistable); + if (persistable instanceof GFERecord) { + GFERecord gfeRecord = (GFERecord) persistable; + File pathDir = GfeUtil.getHdf5Dir(GridDatabase.gfeBaseDataDir, + gfeRecord.getDbId()); + path = pathDir.toString(); + path = path.substring(pluginName.length() + 1); + } + return path; + } +} diff --git a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/ifpnetCDF.py b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/ifpnetCDF.py index 76331c40bd..25ad53fbdf 100644 --- a/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/ifpnetCDF.py +++ b/edexOsgi/com.raytheon.edex.plugin.gfe/utility/edex_static/base/gfe/isc/ifpnetCDF.py @@ -67,6 +67,7 @@ from com.raytheon.uf.common.localization import LocalizationContext_Localization # 05/23/13 1759 dgilling Remove unnecessary imports. # 07/25/13 2233 randerso Improved memory utilization and performance # 09/20/13 2405 dgilling Clip grids before inserting into cache. +# 10/22/13 2405 rjpeter Remove WECache and store directly to cube. # # @@ -97,65 +98,98 @@ def logDebug(*msg): logVerbose(iscUtil.tupleToString(*msg)) -class WECache(object): - def __init__(self, we, inv, clipArea): - self._we = we - self._clipArea = clipArea - self._inv = OrderedDict() - lst = list(inv) - while len(lst): - i = lst[:BATCH_WRITE_COUNT] - javaTRs = ArrayList() - for tr in i: - javaTRs.add(iscUtil.toJavaTimeRange(tr)) - gridsAndHist = self._we.get(javaTRs, True) - for idx, tr in enumerate(i): - pair = gridsAndHist.get(idx) - g = self.__encodeGridSlice(pair.getFirst(), clipArea) - h = self.__encodeGridHistory(pair.getSecond()) - self._inv[tr] = (g, h) - lst = lst[BATCH_WRITE_COUNT:] - time.sleep(BATCH_DELAY) +def retrieveData(we, inv, clipArea): + lst = list(inv) + trs=[] + histDict = OrderedDict() + cube = None + keyList = None + gridType = str(we.getGpi().getGridType()) - def keys(self): - return tuple(self._inv.keys()) - - def __getitem__(self, key): - try: - return self._inv[key] - except KeyError: - logEvent("Cache miss for key:", str(key)) - grid = self._we.getItem(iscUtil.toJavaTimeRange(key)) - pyGrid = self.__encodeGridSlice(grid, self._clipArea) - history = grid.getGridDataHistory() - pyHist = self.__encodeGridHistory(history) - return (pyGrid, pyHist) + # clipped size + clipSize = (clipArea[1] - clipArea[0] + 1, clipArea[3] - clipArea[2] + 1) + gridCount = len(inv) - def __encodeGridSlice(self, grid, clipArea): - gridType = grid.getGridInfo().getGridType().toString() + if gridType == "SCALAR": + cube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]), dtype=numpy.float32) + elif gridType == "VECTOR": + magCube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]),dtype=numpy.float32) + dirCube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]),dtype=numpy.float32) + cube = (magCube, dirCube) + elif gridType == "WEATHER" or gridType == "DISCRETE": + cube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]), dtype=numpy.int8) + keyList = [] + + cubeIdx = 0 + while len(lst): + i = lst[:BATCH_WRITE_COUNT] + javaTRs = ArrayList() + for tr in i: + javaTRs.add(iscUtil.toJavaTimeRange(tr)) + gridsAndHist = we.get(javaTRs, True) + size = gridsAndHist.size() + for idx in xrange(size): + pair = gridsAndHist.get(idx) + grid = pair.getFirst() + tr = iscUtil.transformTime(grid.getValidTime()) + encodeGridSlice(grid, gridType, clipArea, cube, cubeIdx, keyList) + cubeIdx += 1 + histDict[tr] = encodeGridHistory(pair.getSecond()) + lst = lst[BATCH_WRITE_COUNT:] + time.sleep(BATCH_DELAY) + + if len(histDict) != gridCount: + # retrieved less grids than originally expected, purge ran? + gridCount = len(histDict) + if gridType == "SCALAR": - return clipToExtrema(grid.__numpy__[0], clipArea) + oldCube = cube + cube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]), dtype=numpy.float32) + for idx in xrange(gridCount): + cube[idx] = oldCube[idx] elif gridType == "VECTOR": - vecGrids = grid.__numpy__ - return (clipToExtrema(vecGrids[0], clipArea), clipToExtrema(vecGrids[1], clipArea)) - elif gridType == "WEATHER": - keys = grid.getKeys() - keyList = [] - for theKey in keys: - keyList.append(theKey.toString()) - return (clipToExtrema(grid.__numpy__[0], clipArea), keyList) - elif gridType =="DISCRETE": - keys = grid.getKey() - keyList = [] - for theKey in keys: - keyList.append(theKey.toString()) - return (clipToExtrema(grid.__numpy__[0], clipArea), keyList) - - def __encodeGridHistory(self, histories): - retVal = [] - for i in xrange(histories.size()): - retVal.append(histories.get(i).getCodedString()) - return tuple(retVal) + oldMagCube = magCube + magCube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]),dtype=numpy.float32) + oldDirCube = dirCube + dirCube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]),dtype=numpy.float32) + cube = (magCube, dirCube) + for idx in xrange(gridCount): + magCube[idx] = oldMagCube[idx] + dirCube[idx] = oldDirCube[idx] + elif gridType == "WEATHER" or gridType == "DISCRETE": + oldCube = cube + cube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]), dtype=numpy.int8) + for idx in xrange(gridCount): + cube[idx] = oldCube[idx] + return (cube, histDict, keyList) + +###-------------------------------------------------------------------------### +### cube and keyList are out parameters to be filled by this method, idx is the index into cube to use +def encodeGridSlice(grid, gridType, clipArea, cube, idx, keyList): + if gridType == "SCALAR": + cube[idx] = clipToExtrema(grid.__numpy__[0], clipArea) + elif gridType == "VECTOR": + vecGrids = grid.__numpy__ + cube[0][idx] = clipToExtrema(vecGrids[0], clipArea) + cube[1][idx] = clipToExtrema(vecGrids[1], clipArea) + elif gridType == "WEATHER" or gridType == "DISCRETE": + if gridType == "DISCRETE": + keys = grid.getKey() + else: + keys = grid.getKeys() + gridKeys = [] + + for theKey in keys: + gridKeys.append(theKey.toString()) + + keyList.append(gridKeys) + cube[idx]= clipToExtrema(grid.__numpy__[0], clipArea) + +def encodeGridHistory(histories): + retVal = [] + for i in xrange(histories.size()): + retVal.append(histories.get(i).getCodedString()) + return tuple(retVal) ###-------------------------------------------------------------------------### @@ -529,19 +563,18 @@ def storeTopoGrid(client, file, databaseID, invMask, clipArea): ###-------------------------------------------------------------------------### ### -def storeGridDataHistory(file, we, wec, trList): +def storeGridDataHistory(file, we, histDict): "Stores the Grid Data history string for each grid in we." # get the maximum size of the history string maxHistSize = 0 histList = [] - for tr in trList: - his = wec[tr][1] + for (tr, his) in histDict.items(): hisString = '' for i,h in enumerate(his): hisString = hisString + str(h) if i != len(his) - 1: - hisString = hisString + " ^" + hisString = hisString + " ^" histList.append(hisString) maxHistSize = max(maxHistSize,len(hisString)) @@ -727,21 +760,17 @@ def storeScalarWE(we, trList, file, timeRange, databaseID, # get the data and store it in a Numeric array. timeList, overlappingTimes = findOverlappingTimes(trList, timeRange) - # clipped size - clipSize = (clipArea[1] - clipArea[0] + 1, clipArea[3] - clipArea[2] + 1) - gridCount = len(overlappingTimes) + (cube, histDict, keyList) = retrieveData(we, overlappingTimes, clipArea) + gridCount = len(cube) + for i in xrange(len(overlappingTimes) -1, -1, -1): + ot = overlappingTimes[i] + if not ot in histDict: + del overlappingTime[i] + del timeList[i] + elif we.getGpi().isRateParm(): + durRatio = (float(timeList[i][1]-timeList[i][0]))/float((ot[1]-ot[0])) + cube[i] *= durRatio - cube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]), dtype=numpy.float32) - - wec = WECache(we, overlappingTimes, clipArea) - for i,t in enumerate(overlappingTimes): - grid = wec[t][0] - #adjust for time changes - if we.getGpi().isRateParm(): - durRatio = (float(timeList[i][1]-timeList[i][0]))/float((t[1]-t[0])) - grid *= durRatio - cube[i]= grid - ### Make sure we found some grids # make the variable name varName = we.getParmid().getParmName() + "_" + we.getParmid().getParmLevel() @@ -795,8 +824,8 @@ def storeScalarWE(we, trList, file, timeRange, databaseID, setattr(var, "fillValue", fillValue) ## Extract the GridDataHistory info and save it - storeGridDataHistory(file, we, wec, overlappingTimes) - + storeGridDataHistory(file, we, histDict) + logEvent("Saved", gridCount, varName, " grids") return gridCount @@ -811,23 +840,16 @@ def storeVectorWE(we, trList, file, timeRange, # get the data and store it in a Numeric array. timeList, overlappingTimes = findOverlappingTimes(trList, timeRange) - # clipped size - clipSize = (clipArea[1] - clipArea[0] + 1, clipArea[3] - clipArea[2] + 1) - gridCount = len(overlappingTimes) - - magCube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]),dtype=numpy.float32) - dirCube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]),dtype=numpy.float32) - - wec = WECache(we, overlappingTimes, clipArea) - for i,t in enumerate(overlappingTimes): - vecData = wec[t][0] - mag = vecData[0] - dir = vecData[1] - if we.getGpi().isRateParm(): - durRatio = (float(timeList[i][1]-timeList[i][0]))/float((t[1]-t[0])) - mag *= durRatio - magCube[i] = mag - dirCube[i] = dir + ((magCube, dirCube), histDict, keyList) = retrieveData(we, overlappingTimes, clipArea) + gridCount = len(magCube) + for i in xrange(len(overlappingTimes) -1, -1, -1): + ot = overlappingTimes[i] + if not ot in histDict: + del overlappingTime[i] + del timeList[i] + elif we.getGpi().isRateParm(): + durRatio = (float(timeList[i][1]-timeList[i][0]))/float((ot[1]-ot[0])) + magCube[i] *= durRatio varName = we.getParmid().getParmName() + "_" + we.getParmid().getParmLevel() @@ -924,8 +946,8 @@ def storeVectorWE(we, trList, file, timeRange, setattr(dirVar, "fillValue", dfillValue) ## Extract the GridDataHistory info and save it - storeGridDataHistory(file, we, wec, overlappingTimes) - + storeGridDataHistory(file, we, histDict) + logEvent("Saved", gridCount, varName, "grids") return gridCount * 2 #vector has two grids @@ -970,19 +992,14 @@ def storeWeatherWE(we, trList, file, timeRange, databaseID, invMask, clipArea): # get the data and store it in a Numeric array. timeList, overlappingTimes = findOverlappingTimes(trList, timeRange) - - # clipped size - clipSize = (clipArea[1] - clipArea[0] + 1, clipArea[3] - clipArea[2] + 1) - gridCount = len(overlappingTimes) - byteCube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]), dtype=numpy.int8) - - keyList = [] - wec = WECache(we, overlappingTimes, clipArea) - for i,t in enumerate(overlappingTimes): - wx = wec[t][0] - byteCube[i] = wx[0] - keyList.append(wx[1]) + (byteCube, histDict, keyList) = retrieveData(we, overlappingTimes, clipArea) + gridCount = len(histDict) + for i in xrange(len(overlappingTimes) -1, -1, -1): + ot = overlappingTimes[i] + if not ot in histDict: + del overlappingTime[i] + del timeList[i] # make the variable name varName = we.getParmid().getParmName() + "_" + we.getParmid().getParmLevel() @@ -1046,7 +1063,7 @@ def storeWeatherWE(we, trList, file, timeRange, databaseID, invMask, clipArea): setattr(var, "fillValue", fillValue) ## Extract the GridDataHistory info and save it - storeGridDataHistory(file, we, wec, overlappingTimes) + storeGridDataHistory(file, we, histDict) logEvent("Saved", gridCount, varName, "grids") @@ -1061,19 +1078,13 @@ def storeDiscreteWE(we, trList, file, timeRange, databaseID, invMask, clipArea): # get the data and store it in a Numeric array. timeList, overlappingTimes = findOverlappingTimes(trList, timeRange) - # clipped size - clipSize = (clipArea[1] - clipArea[0] + 1, clipArea[3] - clipArea[2] + 1) - gridCount = len(overlappingTimes) - - byteCube = numpy.empty(shape=(gridCount, clipSize[1], clipSize[0]), dtype=numpy.int8) - - keyList = [] - wec = WECache(we, overlappingTimes, clipArea) - for i,t in enumerate(overlappingTimes): - dis = wec[t][0] - byteCube[i] = dis[0] - keyList.append(dis[1]) - + (byteCube, histDict, keyList) = retrieveData(we, overlappingTimes, clipArea) + gridCount = len(histDict) + for i in xrange(len(overlappingTimes) -1, -1, -1): + ot = overlappingTimes[i] + if not ot in histDict: + del overlappingTime[i] + del timeList[i] # make the variable name varName = we.getParmid().getParmName() + "_" + we.getParmid().getParmLevel() @@ -1135,7 +1146,7 @@ def storeDiscreteWE(we, trList, file, timeRange, databaseID, invMask, clipArea): setattr(var, "fillValue", fillValue) ## Extract the GridDataHistory info and save it - storeGridDataHistory(file, we, wec, overlappingTimes) + storeGridDataHistory(file, we, histDict) logEvent("Saved", gridCount, varName, "grids") @@ -1325,7 +1336,7 @@ def main(outputFilename, parmList, databaseID, startTime, clipArea = extremaOfSetBits(maskGrid) maskGrid = clipToExtrema(maskGrid, clipArea) clippedGridSize = maskGrid.shape - validPointCount = numpy.add.reduce(numpy.add.reduce(maskGrid)) + validPointCount = float(numpy.add.reduce(numpy.add.reduce(maskGrid))) #invert the mask grid invMask = numpy.logical_not(maskGrid) diff --git a/edexOsgi/com.raytheon.edex.plugin.goessounding/src/com/raytheon/edex/plugin/goessounding/GOESSoundingDecoder.java b/edexOsgi/com.raytheon.edex.plugin.goessounding/src/com/raytheon/edex/plugin/goessounding/GOESSoundingDecoder.java index dc928a2ffb..58719652ca 100644 --- a/edexOsgi/com.raytheon.edex.plugin.goessounding/src/com/raytheon/edex/plugin/goessounding/GOESSoundingDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.goessounding/src/com/raytheon/edex/plugin/goessounding/GOESSoundingDecoder.java @@ -61,6 +61,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * Apr 14, 2008 1077 jkorman Initial implementation. * Nov 25, 2008 1684 chammack Camel Refactor * May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -74,7 +75,7 @@ public class GOESSoundingDecoder extends AbstractDecoder implements public static final String PLUGIN_NAME = "goessounding"; /** The logger */ - private Log logger = LogFactory.getLog(getClass()); + private final Log logger = LogFactory.getLog(getClass()); private PointDataDescription pdd; @@ -131,7 +132,7 @@ public class GOESSoundingDecoder extends AbstractDecoder implements PluginDataObject[] decodedData = null; - if (input != null && input.getDocumentData().length > 0) { + if ((input != null) && (input.getDocumentData().length > 0)) { WMOHeader wmoHeader = input.getWmoHeader(); @@ -153,7 +154,6 @@ public class GOESSoundingDecoder extends AbstractDecoder implements container, this.pdd, dao); if (soundingData != null) { soundingData.setTraceId(traceId); - soundingData.setPluginName(PLUGIN_NAME); PointDataView pdv = soundingData.getPointDataView(); pdv.setString("wmoHeader", soundingData.getWmoHeader()); diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/GribDecoder.py b/edexOsgi/com.raytheon.edex.plugin.grib/GribDecoder.py index 4b8f61f5f2..d5a0190ae4 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/GribDecoder.py +++ b/edexOsgi/com.raytheon.edex.plugin.grib/GribDecoder.py @@ -70,8 +70,6 @@ from com.raytheon.uf.common.parameter import Parameter; from com.raytheon.uf.common.parameter.mapping import ParameterMapper; -PLUGIN_NAME = "grid" - # Static values for accessing parameter lookup tables PARAMETER_TABLE = "4.2" GENPROCESS_TABLE = "A" @@ -131,7 +129,7 @@ THINNED_GRID_VALUES = THINNED_GRID_PT_MAP.values() # 04/7/09 #1994 bphillip Initial Creation. # Mar 25, 2013 1821 bsteffen Reshape grib data arrays in # place to improve performance. -# +# Sep 04, 2013 2298 rjpeter Removed setPluginName call class GribDecoder(): ## @@ -403,7 +401,6 @@ class GribDecoder(): # Construct the GribRecord record = GridRecord() - record.setPluginName(PLUGIN_NAME) record.setDataTime(dataTime) record.setMessageData(numpyDataArray) record.setLocation(gdsSectionValues['coverage']) diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/Grib1Decoder.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/Grib1Decoder.java index 928f65818c..bfcba2b243 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/Grib1Decoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/Grib1Decoder.java @@ -92,8 +92,10 @@ import com.raytheon.uf.common.util.mapping.MultipleMappingException; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 3/11/10 4758 bphillip Initial Creation - * Feb 15, 2013 1638 mschenke Moved array based utilities from Util into ArraysUtil + * Mar 11, 2010 4758 bphillip Initial Creation + * Feb 15, 2013 1638 mschenke Moved array based utilities from Util + * into ArraysUtil + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -236,7 +238,7 @@ public class Grib1Decoder extends AbstractDecoder { .getGrib2Parameter(centerAlias, subcenterAlias, tableAlias, pdsVars.getParameterNumber()); - if (parameter == null || parameter.getName().equals(MISSING)) { + if ((parameter == null) || parameter.getName().equals(MISSING)) { try { logger.warn("Unable to map Grib 1 parameter to equivalent Grib 2 parameter for center [" + centerid @@ -294,7 +296,7 @@ public class Grib1Decoder extends AbstractDecoder { // unidata does not handle isEnsemble call when // octet size is less than 40. - if (pdsVars.getLength() > 40 && pdsVars.isEnsemble()) { + if ((pdsVars.getLength() > 40) && pdsVars.isEnsemble()) { // rcg: added code to get perturbation int pos42 = pdsVars.getOctet(42); int pos43 = pdsVars.getOctet(43); @@ -363,13 +365,13 @@ public class Grib1Decoder extends AbstractDecoder { int timeRange = pdsVars.getTimeRangeIndicator(); // Check for initialization of average or accumulation parameters - if ((AVG_ACCUM_LIST.contains(timeRange) && dataTime - .getValidPeriod().getDuration() == 0)) { + if ((AVG_ACCUM_LIST.contains(timeRange) && (dataTime + .getValidPeriod().getDuration() == 0))) { statusHandler.handle(Priority.EVENTA, "Discarding empty accumulation grid"); return null; - } else if ((gdsVars != null && gdsVars.isThin()) - || (gdsVars == null && (gridCoverage instanceof LatLonGridCoverage && ((LatLonGridCoverage) gridCoverage) + } else if (((gdsVars != null) && gdsVars.isThin()) + || ((gdsVars == null) && ((gridCoverage instanceof LatLonGridCoverage) && ((LatLonGridCoverage) gridCoverage) .isThin()))) { // Unfortunately the UCAR Decoder does Cubic Spline // interpolation, however we want to do simpler linear @@ -468,7 +470,7 @@ public class Grib1Decoder extends AbstractDecoder { if (newAbbr == null) { if (!parameterName.equals(MISSING) - && dataTime.getValidPeriod().getDuration() > 0) { + && (dataTime.getValidPeriod().getDuration() > 0)) { parameterAbbreviation = parameterAbbreviation + String.valueOf(dataTime.getValidPeriod() .getDuration() / 3600000) + "hr"; @@ -485,7 +487,6 @@ public class Grib1Decoder extends AbstractDecoder { parameterAbbreviation = e.getArbitraryMapping(); } - retVal.setPluginName("grid"); Parameter param = new Parameter(parameterAbbreviation, parameterName, parameterUnit); GribParamTranslator.getInstance().getParameterNameAlias(modelName, @@ -530,7 +531,7 @@ public class Grib1Decoder extends AbstractDecoder { for (int row = 0; row < rowCount; row++) { for (int column = 0; column < columnCount; column++) { - newGrid[row][column] = data[row * columnCount + column]; + newGrid[row][column] = data[(row * columnCount) + column]; } } @@ -569,8 +570,8 @@ public class Grib1Decoder extends AbstractDecoder { total -= 1; trail = inData[inIndex++]; } - outData[outIndex++] = inData[inIndex] * total + trail - * (1 - total); + outData[outIndex++] = (inData[inIndex] * total) + + (trail * (1 - total)); total += dx; } outData[outIndex++] = inData[inIndex++]; @@ -594,7 +595,7 @@ public class Grib1Decoder extends AbstractDecoder { for (int row = 0; row < rowCount; row++) { for (int column = 0; column < columnCount; column++) { - newGrid[row * columnCount + column] = data[row][column]; + newGrid[(row * columnCount) + column] = data[row][column]; } } return newGrid; @@ -663,7 +664,7 @@ public class Grib1Decoder extends AbstractDecoder { private void correctForScanMode(float[] data, int nx, int ny, boolean bmsExists, int scanMode) { for (int i = 0; i < data.length; i++) { - if (bmsExists && data[i] == -9999) { + if (bmsExists && (data[i] == -9999)) { data[i] = -999999; } } @@ -884,7 +885,7 @@ public class Grib1Decoder extends AbstractDecoder { GridCoverage grid = GribSpatialCache.getInstance().getGrid(coverage); - if (grid == null && gridNumber != 255) { + if ((grid == null) && (gridNumber != 255)) { // 255 is specifically reserved to non-defined grids and should not // use the gridNumber as a lookup value @@ -929,7 +930,7 @@ public class Grib1Decoder extends AbstractDecoder { int subcenterId, int process, GridCoverage grid) { GridModel gridModel = GribModelLookup.getInstance().getModel(centerId, subcenterId, grid, process); - if (gridModel != null && gridModel.getAnalysisOnly()) { + if ((gridModel != null) && gridModel.getAnalysisOnly()) { time.getUtilityFlags().remove(FLAG.FCST_USED); } } @@ -1175,7 +1176,7 @@ public class Grib1Decoder extends AbstractDecoder { level1Value = lval1; break; default: - if (ltype1 > 99 && ltype1 < 200) { + if ((ltype1 > 99) && (ltype1 < 200)) { level1Type = 255; logger.warn("GRIB1 level " + ltype1 + " not recognized"); } @@ -1234,7 +1235,7 @@ public class Grib1Decoder extends AbstractDecoder { } // Scale the level one value if necessary - if (scaleFactor1 == 0 || value1 == 0) { + if ((scaleFactor1 == 0) || (value1 == 0)) { levelOneValue = value1; } else { levelOneValue = new Double((float) (value1 * Math.pow(10, @@ -1249,13 +1250,13 @@ public class Grib1Decoder extends AbstractDecoder { } else if (levelTwoNumber == 1) { levelTwoValue = Level.getInvalidLevelValue(); } else { - if (scaleFactor2 == 0 || value2 == 0) { + if ((scaleFactor2 == 0) || (value2 == 0)) { levelTwoValue = value2; } else { levelTwoValue = (value2 * Math.pow(10, scaleFactor2 * -1)); } } - if (levelName.equals("SFC") && levelOneValue != 0) { + if (levelName.equals("SFC") && (levelOneValue != 0)) { levelOneValue = 0.0; } if (levelName.equals("EATM")) { @@ -1289,7 +1290,7 @@ public class Grib1Decoder extends AbstractDecoder { } if (lon >= 180) { - lon = (180 - lon % 180) * -1; + lon = (180 - (lon % 180)) * -1; } else if (lon < -180) { lon = (180 - (-lon % 180)); } @@ -1313,7 +1314,7 @@ public class Grib1Decoder extends AbstractDecoder { } if (lat > 90) { - lat = 90 - lat % 90; + lat = 90 - (lat % 90); } else if (lat < -90) { lat = (90 - (-lat % 90)) * -1; } diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GridToGribConverter.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GridToGribConverter.java index f5a6dcad2e..96c02d3394 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GridToGribConverter.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/GridToGribConverter.java @@ -35,7 +35,8 @@ import com.raytheon.uf.edex.database.DataAccessLayerException; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * May 4, 2012 bsteffen Initial creation + * May 04, 2012 bsteffen Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -62,10 +63,9 @@ public class GridToGribConverter { GridRecord grid = records[i]; GribRecord grib = new GribRecord(); GribModel model = new GribModel(); - grib.setPluginName("grib"); grib.setDataTime(grid.getDataTime()); model.setModelName(grid.getDatasetId()); - if (grid.getSecondaryId() != null + if ((grid.getSecondaryId() != null) && grid.getSecondaryId().startsWith("Version")) { grib.setGridVersion(Integer.parseInt(grid.getSecondaryId() .replace("Version", ""))); @@ -108,31 +108,31 @@ public class GridToGribConverter { model.setTypeEnsemble(3); } Object centerid = grid.getExtraAttribute("centerid"); - if (centerid != null && centerid instanceof Integer) { + if ((centerid != null) && (centerid instanceof Integer)) { model.setCenterid((Integer) centerid); } Object subcenterid = grid.getExtraAttribute("subcenterid"); - if (subcenterid != null && subcenterid instanceof Integer) { + if ((subcenterid != null) && (subcenterid instanceof Integer)) { model.setSubcenterid((Integer) subcenterid); } Object genprocess = grid.getExtraAttribute("genprocess"); - if (genprocess != null && genprocess instanceof Integer) { + if ((genprocess != null) && (genprocess instanceof Integer)) { model.setGenprocess((Integer) genprocess); } Object backGenprocess = grid.getExtraAttribute("backGenprocess"); - if (backGenprocess != null && backGenprocess instanceof Integer) { + if ((backGenprocess != null) && (backGenprocess instanceof Integer)) { model.setBackGenprocess((Integer) backGenprocess); } Object pdsTemplate = grid.getExtraAttribute("pdsTemplate"); - if (pdsTemplate != null && pdsTemplate instanceof Integer) { + if ((pdsTemplate != null) && (pdsTemplate instanceof Integer)) { model.setPdsTemplate((Integer) pdsTemplate); } Object gridid = grid.getExtraAttribute("gridid"); - if (gridid != null && gridid instanceof String) { + if ((gridid != null) && (gridid instanceof String)) { model.setGridid((String) gridid); } Object numForecasts = grid.getExtraAttribute("numForecasts"); - if (numForecasts != null && numForecasts instanceof Integer) { + if ((numForecasts != null) && (numForecasts instanceof Integer)) { model.setNumForecasts((Integer) numForecasts); } model.setLevel(grid.getLevel()); diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/CPCoutlookGribPostProcessor.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/CPCoutlookGribPostProcessor.java index 68b69a2195..93278b301f 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/CPCoutlookGribPostProcessor.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/CPCoutlookGribPostProcessor.java @@ -24,7 +24,6 @@ import java.util.Calendar; import com.raytheon.edex.plugin.grib.exception.GribException; import com.raytheon.uf.common.dataplugin.PluginException; -import com.raytheon.uf.common.dataplugin.grid.GridConstants; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; @@ -51,7 +50,8 @@ import com.raytheon.uf.common.time.DataTime; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 03/09/11 4243 porricel Initial Creation + * Mar 09, 2011 4243 porricel Initial Creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -84,7 +84,6 @@ public class CPCoutlookGribPostProcessor implements IDecoderPostProcessor { record.setDataURI(null); try { - record.setPluginName(GridConstants.GRID); record.constructDataURI(); } catch (PluginException e) { statusHandler.handle(Priority.PROBLEM, diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java index f7ea833ca0..2316f22239 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/EnsembleGridAssembler.java @@ -69,10 +69,11 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 4/09/10 4638 bphillip Initial Creation + * Apr 09, 2010 4638 bphillip Initial Creation * Mar 14, 2013 1794 djohnson FileUtil.listFiles now returns List. * Mar 27, 2013 1821 bsteffen Reduce db and pypies requests in grid * assembler. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -231,7 +232,6 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor { newRecord.setEnsembleId(record.getEnsembleId()); newRecord.setDataTime(record.getDataTime()); newRecord.setDataURI(null); - newRecord.setPluginName(GridConstants.GRID); newRecord.setInsertTime(Calendar.getInstance()); try { newRecord.constructDataURI(); @@ -319,7 +319,7 @@ public class EnsembleGridAssembler implements IDecoderPostProcessor { } else { Util.insertSubgrid(assembledData, Util.resizeDataTo2D( (float[]) record.getMessageData(), coverage.getNx(), - coverage.getNy()), nx * modIndex - modIndex, 0, nx, ny); + coverage.getNy()), (nx * modIndex) - modIndex, 0, nx, ny); } assembledRecord.setMessageData(Util.resizeDataTo1D(assembledData, diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/GFSProcessor.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/GFSProcessor.java index 39bb547b18..fcb8386692 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/GFSProcessor.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/GFSProcessor.java @@ -53,6 +53,7 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 25, 2011 rgeorge Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -69,7 +70,7 @@ public class GFSProcessor extends SixHrPrecipGridProcessor { public GridRecord[] process(GridRecord record) throws GribException { // Post process the data if this is a Total Precipitation grid if (record.getParameter().getAbbreviation().equals("TP12hr") - && record.getDataTime().getFcstTime() / 3600 > 180) { + && ((record.getDataTime().getFcstTime() / 3600) > 180)) { return super.process(record); } return new GridRecord[] { record }; @@ -86,6 +87,7 @@ public class GFSProcessor extends SixHrPrecipGridProcessor { * @return The generated 6-hr precipitation grids * @throws GribException */ + @Override protected synchronized GridRecord[] generate6hrPrecipGrids(GridRecord record) throws GribException { List generated6hrPrecips = new ArrayList(); @@ -111,11 +113,11 @@ public class GFSProcessor extends SixHrPrecipGridProcessor { Collections.sort(precipInventory, comparator); // loop through set, find twelve hour gaps and create new 6hr records. - for (int i = 0; i < precipInventory.size() - 1; i++) { + for (int i = 0; i < (precipInventory.size() - 1); i++) { GridRecord sequence1Record = precipInventory.get(i); GridRecord sequence2Record = precipInventory.get(i + 1); - if (sequence1Record.getDataTime().getFcstTime() == sequence2Record - .getDataTime().getFcstTime() - SECONDS_IN_12_HRS) { + if (sequence1Record.getDataTime().getFcstTime() == (sequence2Record + .getDataTime().getFcstTime() - SECONDS_IN_12_HRS)) { // we have a 12Hr gap generated6hrPrecips.add(calculate6hrPrecip(sequence1Record, sequence2Record)); @@ -226,7 +228,6 @@ public class GFSProcessor extends SixHrPrecipGridProcessor { record.setDataTime(newDataTime); record.setDataURI(null); try { - record.setPluginName(GridConstants.GRID); record.constructDataURI(); } catch (PluginException e) { statusHandler.handle(Priority.PROBLEM, diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/Nam80PostProcessor.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/Nam80PostProcessor.java index 8e1ccf307c..0819c6dd0c 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/Nam80PostProcessor.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/Nam80PostProcessor.java @@ -47,7 +47,8 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Nov 17, 2011 bphillip Initial creation + * Nov 17, 2011 bphillip Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -169,14 +170,14 @@ public class Nam80PostProcessor implements IDecoderPostProcessor { float[] newData = null; float[] tp6Data = null; if (tp12HrRecord.getMessageData() == null) { - newData = (float[]) ((FloatDataRecord) dao.getHDF5Data( - tp12HrRecord, -1)[0]).getFloatData(); + newData = ((FloatDataRecord) dao.getHDF5Data(tp12HrRecord, -1)[0]) + .getFloatData(); } else { newData = (float[]) tp12HrRecord.getMessageData(); } if (tp6HrRecord.getMessageData() == null) { - tp6Data = (float[]) ((FloatDataRecord) dao.getHDF5Data( - tp6HrRecord, -1)[0]).getFloatData(); + tp6Data = ((FloatDataRecord) dao.getHDF5Data(tp6HrRecord, -1)[0]) + .getFloatData(); } else { tp6Data = (float[]) tp6HrRecord.getMessageData(); } @@ -197,7 +198,7 @@ public class Nam80PostProcessor implements IDecoderPostProcessor { Calendar refTime = tp12HrRecord.getDataTime().getRefTimeAsCalendar(); Date start = new Date(tp12HrRecord.getDataTime().getValidPeriod() .getEnd().getTime() - - SECONDS_IN_6_HRS * 1000); + - (SECONDS_IN_6_HRS * 1000)); DataTime newDataTime = new DataTime(refTime, tp12HrRecord.getDataTime() .getFcstTime(), new TimeRange(start, tp12HrRecord.getDataTime() @@ -208,7 +209,6 @@ public class Nam80PostProcessor implements IDecoderPostProcessor { newRecord.getInfo().setId(null); newRecord.setDataURI(null); try { - newRecord.setPluginName(GridConstants.GRID); newRecord.constructDataURI(); } catch (PluginException e) { throw new GribException("Error constructing dataURI!", e); diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/SixHrPrecipGridProcessor.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/SixHrPrecipGridProcessor.java index ba46ff2b56..404fd23597 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/SixHrPrecipGridProcessor.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/SixHrPrecipGridProcessor.java @@ -26,7 +26,6 @@ import java.util.List; import com.raytheon.edex.plugin.grib.exception.GribException; import com.raytheon.uf.common.dataplugin.PluginException; -import com.raytheon.uf.common.dataplugin.grid.GridConstants; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.parameter.Parameter; @@ -48,6 +47,7 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 25, 2011 rgeorge Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -107,8 +107,7 @@ public abstract class SixHrPrecipGridProcessor implements IDecoderPostProcessor // previous grid else { for (GridRecord rec : precipInventory) { - if (rec.getDataTime().getFcstTime() == currentFcstTime - - SECONDS_IN_6_HRS) { + if (rec.getDataTime().getFcstTime() == (currentFcstTime - SECONDS_IN_6_HRS)) { tp6hrRecords.add(calculate6hrPrecip(rec, record)); } } @@ -218,7 +217,6 @@ public abstract class SixHrPrecipGridProcessor implements IDecoderPostProcessor record.setDataTime(newDataTime); record.setDataURI(null); try { - record.setPluginName(GridConstants.GRID); record.constructDataURI(); } catch (PluginException e) { statusHandler.handle(Priority.PROBLEM, diff --git a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/ThreeHrPrecipGridProcessor.java b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/ThreeHrPrecipGridProcessor.java index fb3dd3c854..fc51bd5885 100644 --- a/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/ThreeHrPrecipGridProcessor.java +++ b/edexOsgi/com.raytheon.edex.plugin.grib/src/com/raytheon/edex/plugin/grib/decoderpostprocessors/ThreeHrPrecipGridProcessor.java @@ -26,7 +26,6 @@ import java.util.List; import com.raytheon.edex.plugin.grib.exception.GribException; import com.raytheon.uf.common.dataplugin.PluginException; -import com.raytheon.uf.common.dataplugin.grid.GridConstants; import com.raytheon.uf.common.dataplugin.grid.GridRecord; import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.parameter.Parameter; @@ -47,7 +46,8 @@ import com.raytheon.uf.edex.plugin.grid.dao.GridDao; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 24, 2012 DR 14299 M. Porricelli Initial creation + * Jan 24, 2012 14299 M. Porricelli Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -108,8 +108,7 @@ public abstract class ThreeHrPrecipGridProcessor implements // previous grid else { for (GridRecord rec : precipInventory) { - if (rec.getDataTime().getFcstTime() == currentFcstTime - - SECONDS_IN_3_HRS) { + if (rec.getDataTime().getFcstTime() == (currentFcstTime - SECONDS_IN_3_HRS)) { tp3hrRecords.add(calculate3hrPrecip(rec, record)); } } @@ -220,7 +219,6 @@ public abstract class ThreeHrPrecipGridProcessor implements record.setDataTime(newDataTime); record.setDataURI(null); try { - record.setPluginName(GridConstants.GRID); record.constructDataURI(); } catch (PluginException e) { statusHandler.handle(Priority.PROBLEM, diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadhydro/res/spring/ldadhydro-common.xml b/edexOsgi/com.raytheon.edex.plugin.ldadhydro/res/spring/ldadhydro-common.xml index 2213be0afe..df81cd861b 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldadhydro/res/spring/ldadhydro-common.xml +++ b/edexOsgi/com.raytheon.edex.plugin.ldadhydro/res/spring/ldadhydro-common.xml @@ -2,9 +2,6 @@ - - - @@ -12,12 +9,8 @@ - - - - + - diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadhydro/res/spring/ldadhydro-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.ldadhydro/res/spring/ldadhydro-ingest.xml index 3cfd3faf96..fda646aaea 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldadhydro/res/spring/ldadhydro-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.ldadhydro/res/spring/ldadhydro-ingest.xml @@ -4,9 +4,7 @@ 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"> - - - + diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadhydro/src/com/raytheon/edex/plugin/ldadhydro/dao/HydroDecoder.java b/edexOsgi/com.raytheon.edex.plugin.ldadhydro/src/com/raytheon/edex/plugin/ldadhydro/dao/HydroDecoder.java index c871cca1d3..46865d1d68 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldadhydro/src/com/raytheon/edex/plugin/ldadhydro/dao/HydroDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.ldadhydro/src/com/raytheon/edex/plugin/ldadhydro/dao/HydroDecoder.java @@ -64,9 +64,10 @@ import com.raytheon.uf.common.time.DataTime; * * SOFTWARE HISTORY * - * ate Ticket# Engineer Description - * ----------- ---------- ----------- -------------------------- - * 9/30/09 vkorolev Initial creation + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Sep 30, 2009 vkorolev Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * 10/16/13 DR 16685 M.Porricelli Add error checking for date * format * @@ -79,8 +80,6 @@ public class HydroDecoder extends AbstractDecoder implements IBinaryDecoder { private static final String BAD_PROPERTY_FMT = "NumberFormatException setting property %s.%s(%s %s)"; - private final String PLUGIN_NAME; - private String traceId = null; public SimpleDateFormat sdf = new SimpleDateFormat("yy/MM/dd HH:mm:ss"); @@ -89,10 +88,6 @@ public class HydroDecoder extends AbstractDecoder implements IBinaryDecoder { public Properties configFile = new Properties(); - public HydroDecoder(String pluginName) throws DecoderException { - PLUGIN_NAME = pluginName; - } - public void setTraceId(String id) { traceId = id; } @@ -156,7 +151,6 @@ public class HydroDecoder extends AbstractDecoder implements IBinaryDecoder { HydroLdadRecord record = new HydroLdadRecord(); SurfaceObsLocation location = new SurfaceObsLocation(); record.setDataProvider(dd.provider); - record.setPluginName(PLUGIN_NAME); record.setStationType(dd.type); record.setReportTime(dd.reportTime); // Loop through fields @@ -332,8 +326,7 @@ public class HydroDecoder extends AbstractDecoder implements IBinaryDecoder { Class cls = record.getClass(); Field fieldlist[] = cls.getDeclaredFields(); - for (int i = 0; i < fieldlist.length; i++) { - Field fld = fieldlist[i]; + for (Field fld : fieldlist) { System.out.println("name = " + fld.getName()); // System.out.println("decl class = " + // fld.getDeclaringClass()); diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/res/spring/ldadmanual-common.xml b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/res/spring/ldadmanual-common.xml index 937888fc1c..5e9bde03fa 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/res/spring/ldadmanual-common.xml +++ b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/res/spring/ldadmanual-common.xml @@ -2,9 +2,6 @@ - - - @@ -12,9 +9,6 @@ - - - diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/res/spring/ldadmanual-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/res/spring/ldadmanual-ingest.xml index 9bfdd35584..08bb3d9182 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/res/spring/ldadmanual-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/res/spring/ldadmanual-ingest.xml @@ -4,9 +4,7 @@ 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"> - - - + diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualDecoder.java b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualDecoder.java index d2e88d62b6..7b1ac16bec 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualDecoder.java @@ -27,7 +27,6 @@ import java.io.StringReader; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.lang.reflect.Modifier; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -63,9 +62,10 @@ import com.raytheon.uf.common.time.DataTime; * * SOFTWARE HISTORY * - * ate Ticket# Engineer Description - * ----------- ---------- ----------- -------------------------- - * 9/30/09 vkorolev Initial creation + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Sep 30, 2009 vkorolev Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author vkorolev @@ -73,9 +73,6 @@ import com.raytheon.uf.common.time.DataTime; */ public class ManualDecoder extends AbstractDecoder implements IBinaryDecoder { - - private final String PLUGIN_NAME; - private String traceId = null; public SimpleDateFormat sdf = new SimpleDateFormat("yy/MM/dd HH:mm:ss"); @@ -84,10 +81,6 @@ public class ManualDecoder extends AbstractDecoder implements IBinaryDecoder public Properties configFile = new Properties(); - public ManualDecoder(String pluginName) throws DecoderException { - PLUGIN_NAME = pluginName; - } - public void setTraceId(String id) { traceId = id; } @@ -151,7 +144,6 @@ public class ManualDecoder extends AbstractDecoder implements IBinaryDecoder ManualLdadRecord record = new ManualLdadRecord(); SurfaceObsLocation location = new SurfaceObsLocation(); record.setProviderId(dd.provider); - record.setPluginName(PLUGIN_NAME); // record.setReportType???(dd.type)); // record.set???(dd.reportTime); // Loop through fields @@ -241,14 +233,13 @@ public class ManualDecoder extends AbstractDecoder implements IBinaryDecoder * @throws ClassNotFoundException * @throws Throwable */ - - @SuppressWarnings("unchecked") public void setProperty(String name, Object obj, String value, String vunit) { String prop = Character.toUpperCase(name.charAt(0)) + name.substring(1); String mname = "set" + prop; Object val = null; try { + @SuppressWarnings("rawtypes") Class cls = obj.getClass(); Field fld = cls.getDeclaredField(name); Class clazz = fld.getType(); @@ -301,27 +292,4 @@ public class ManualDecoder extends AbstractDecoder implements IBinaryDecoder } return; } - - // List of Fields in record - @SuppressWarnings("unchecked") - public static void main(String args[]) { - ManualLdadRecord record = new ManualLdadRecord(); - try { - Class cls = record.getClass(); - - Field fieldlist[] = cls.getDeclaredFields(); - for (int i = 0; i < fieldlist.length; i++) { - Field fld = fieldlist[i]; - System.out.println("name = " + fld.getName()); - // System.out.println("decl class = " + - // fld.getDeclaringClass()); - System.out.println("type = " + fld.getType()); - int mod = fld.getModifiers(); - System.out.println("modifiers = " + Modifier.toString(mod)); - System.out.println("-----"); - } - } catch (Throwable e) { - System.err.println(e); - } - } } diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualLdadRecord.java b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualLdadRecord.java index e68fdf830f..55473e338e 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualLdadRecord.java +++ b/edexOsgi/com.raytheon.edex.plugin.ldadmanual/src/com/raytheon/edex/plugin/ldadmanual/dao/ManualLdadRecord.java @@ -65,12 +65,13 @@ import com.vividsolutions.jts.geom.Geometry; * * Date Ticket# Engineer Description * ----------- ---------- ----------- -------------------------- - * 9/30/09 vkorolev Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. - * May 07, 2013 1869 bsteffen Remove dataURI column from + * Sep 30, 2009 vkorolev Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. - * + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author vkorolev @@ -84,25 +85,20 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ldad_manual", - indexes = { - @Index(name = "ldad_manual_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ldad_manual", indexes = { @Index(name = "ldad_manual_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize +public class ManualLdadRecord extends PluginDataObject implements + ISpatialEnabled, IDecoderGettable { -public class ManualLdadRecord extends PluginDataObject implements ISpatialEnabled, -IDecoderGettable { - private static final long serialVersionUID = 1L; public static final String OBS_TEXT = "text"; - + public static final Unit LENGTH_UNIT = SI.METER; - + public static final Unit TEMPERATURE_UNIT = SI.KELVIN; public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; @@ -124,727 +120,752 @@ IDecoderGettable { PARM_MAP.put("PMSL", PRES_SLP); PARM_MAP.put("NLAT", STA_LAT); PARM_MAP.put("NLON", STA_LON); - PARM_MAP.put("STA","STA"); - PARM_MAP.put("stationid","STA"); - PARM_MAP.put("message",OBS_TEXT); - PARM_MAP.put(OBS_TEXT,OBS_TEXT); + PARM_MAP.put("STA", "STA"); + PARM_MAP.put("stationid", "STA"); + PARM_MAP.put("message", OBS_TEXT); + PARM_MAP.put(OBS_TEXT, OBS_TEXT); } - // Time of the observation. @DataURI(position = 2) @Column @XmlAttribute @DynamicSerializeElement private Calendar observationTime; - - //Location + + // Location @Embedded @DataURI(position = 3, embedded = true) @XmlElement @DynamicSerializeElement - private SurfaceObsLocation location; //latitude, longitude, elevation, stationId - - //Provider of data + private SurfaceObsLocation location; // latitude, longitude, elevation, + // stationId + + // Provider of data @DataURI(position = 1) @Column @DynamicSerializeElement - @XmlElement - private String providerId; //* "050183" Data Provider - - //Name of station + @XmlElement + private String providerId; // * "050183" Data Provider + + // Name of station @Column @DynamicSerializeElement @XmlElement - private String stationName; //* "ALLENSPARK CO-OP" - - // Home WFO Id for the LDAD data + private String stationName; // * "ALLENSPARK CO-OP" + + // Home WFO Id for the LDAD data @Column @DynamicSerializeElement @XmlElement - private String homeWFO; //* "SJU" - - //Type of report + private String homeWFO; // * "SJU" + + // Type of report @Column @DynamicSerializeElement @XmlElement - private Short reportType; // short - // 1 - Regular - // 2 - Corrected - - //Units Code + private Short reportType; // short + // 1 - Regular + // 2 - Corrected + + // Units Code @Column @DynamicSerializeElement @XmlElement - private Short unitsCode; // short - // 8 - English - // 9 - Standard International - - //Current 24 hr precipitation total + private Short unitsCode; // short + // 8 - English + // 9 - Standard International + + // Current 24 hr precipitation total @Column @DynamicSerializeElement @XmlElement - private Float code10; // inches - - //Incremental precip since previous 7 a.m. + private Float code10; // inches + + // Incremental precip since previous 7 a.m. @Column @DynamicSerializeElement @XmlElement - private Float code11; // inches - - //Precip Criteria report from flash flood observer + private Float code11; // inches + + // Precip Criteria report from flash flood observer @Column @DynamicSerializeElement @XmlElement - private Float code12; // inches - - //4 hr precip total at previous 7 a.m. criteria report + private Float code12; // inches + + // 4 hr precip total at previous 7 a.m. criteria report @Column @DynamicSerializeElement @XmlElement - private Float code13; // inches - - //24 hr precipitation total at 7 a.m. 2 days ago + private Float code13; // inches + + // 24 hr precipitation total at 7 a.m. 2 days ago @Column @DynamicSerializeElement @XmlElement - private Float code14; // inches - - //Storm total precipitation + private Float code14; // inches + + // Storm total precipitation @Column @DynamicSerializeElement @XmlElement - private Float code15; // inches - - //Weekly total precipitation + private Float code15; // inches + + // Weekly total precipitation @Column @DynamicSerializeElement @XmlElement - private Float code16; // inches - - //Monthly total precipitation + private Float code16; // inches + + // Monthly total precipitation @Column @DynamicSerializeElement @XmlElement - private Float code17; // inches - - //Off-Time precipitation report + private Float code17; // inches + + // Off-Time precipitation report @Column @DynamicSerializeElement @XmlElement - private Float code18; // inches - - //Short intense precipitation durations + private Float code18; // inches + + // Short intense precipitation durations @Column @DynamicSerializeElement @XmlElement - private Float code19; // hours - - //Precipitation type + private Float code19; // hours + + // Precipitation type @Column @DynamicSerializeElement @XmlElement - private Short code20; // short - // 0 "Ice Prism" - // 1 "Rain" - // 2 "Freezing Rain" - // 3 "Drizzle" - // 4 "Freezing Drizzle" - // 5 "Snow" - // 6 "Snow Pellets" - // 7 "Snow Grains" - // 8 "Ice Pellets" - // 9 "Hail" - - //Current air temperature + private Short code20; // short + // 0 "Ice Prism" + // 1 "Rain" + // 2 "Freezing Rain" + // 3 "Drizzle" + // 4 "Freezing Drizzle" + // 5 "Snow" + // 6 "Snow Pellets" + // 7 "Snow Grains" + // 8 "Ice Pellets" + // 9 "Hail" + + // Current air temperature @Column @DynamicSerializeElement @XmlElement - private Float code21; // degrees F - - //Daily maximum air temperature + private Float code21; // degrees F + + // Daily maximum air temperature @Column @DynamicSerializeElement @XmlElement - private Float code22; // degrees F - - //Daily minimum air temperature + private Float code22; // degrees F + + // Daily minimum air temperature @Column @DynamicSerializeElement @XmlElement - private Float code23; // degrees F - - //Average weekly maximum air temperature + private Float code23; // degrees F + + // Average weekly maximum air temperature @Column @DynamicSerializeElement @XmlElement - private Float code24; // degrees F - - //Average weekly minimum air temperature + private Float code24; // degrees F + + // Average weekly minimum air temperature @Column @DynamicSerializeElement @XmlElement - private Float code25; // degrees F - - //Current water temperature + private Float code25; // degrees F + + // Current water temperature @Column @DynamicSerializeElement @XmlElement - private Float code26; // degrees F - - //Daily maximum soil temperature + private Float code26; // degrees F + + // Daily maximum soil temperature @Column @DynamicSerializeElement @XmlElement - private Float code27; // degrees F - - //Daily minimum soil temperature + private Float code27; // degrees F + + // Daily minimum soil temperature @Column @DynamicSerializeElement @XmlElement - private Float code28; // degrees F - - //Wet Bulb temperature + private Float code28; // degrees F + + // Wet Bulb temperature @Column @DynamicSerializeElement @XmlElement - private Float code29; // degrees F - - //Number of hours temperature is below 25 degrees F + private Float code29; // degrees F + + // Number of hours temperature is below 25 degrees F @Column @DynamicSerializeElement @XmlElement - private Float code30; // Hours - - //Number of hours temperature is below 32 degrees F + private Float code30; // Hours + + // Number of hours temperature is below 32 degrees F @Column @DynamicSerializeElement @XmlElement - private Float code31; // Hours - - //Dew point temperature + private Float code31; // Hours + + // Dew point temperature @Column @DynamicSerializeElement @XmlElement - private Float code32; // degrees F - - //River Stage at specified ob time + private Float code32; // degrees F + + // River Stage at specified ob time @Column @DynamicSerializeElement @XmlElement - private Float code33; // feet - - //River Stage at previous 1 a.m. + private Float code33; // feet + + // River Stage at previous 1 a.m. @Column @DynamicSerializeElement @XmlElement - private Float code34; // feet - - //River Stage at previous 7 p.m. + private Float code34; // feet + + // River Stage at previous 7 p.m. @Column @DynamicSerializeElement @XmlElement - private Float code35; // feet - - //River Stage at previous 1 p.m. + private Float code35; // feet + + // River Stage at previous 1 p.m. @Column @DynamicSerializeElement @XmlElement - private Float code36; // feet - - //River Stage at previous 7 a.m. + private Float code36; // feet + + // River Stage at previous 7 a.m. @Column @DynamicSerializeElement @XmlElement - private Float code37; // feet - - //River Stage at 7 a.m. 2 days ago + private Float code37; // feet + + // River Stage at 7 a.m. 2 days ago @Column @DynamicSerializeElement @XmlElement - private Float code38; // feet - - //River Stage at observed crest time + private Float code38; // feet + + // River Stage at observed crest time @Column @DynamicSerializeElement @XmlElement - private String code39; // char - // Chars0_1 "month" - // Chars2_3 "day" - // Chars4_5 "hour" - // Chars6_7 "minute" - - //River Stage at observed crest + private String code39; // char + // Chars0_1 "month" + // Chars2_3 "day" + // Chars4_5 "hour" + // Chars6_7 "minute" + + // River Stage at observed crest @Column @DynamicSerializeElement @XmlElement - private Float code40; // feet - - //River Stage Trend + private Float code40; // feet + + // River Stage Trend @Column @DynamicSerializeElement @XmlElement private Short code41; // short - // 0" "River below flood stage - Stationary" - // 1" "River below flood stage - Rising" - // 3" "River below flood stage - Falling" - // 4" "River above flood stage - Stationary" - // 5" "River above flood stage - Rising" - // 6" "River above flood stage - Falling" - - //private Double code42;--?????????????????????????????????????? - - //River Discharge instantaneous measured Kilo Cubic Feet Per Second + // 0" "River below flood stage - Stationary" + // 1" "River below flood stage - Rising" + // 3" "River below flood stage - Falling" + // 4" "River above flood stage - Stationary" + // 5" "River above flood stage - Rising" + // 6" "River above flood stage - Falling" + + // private Double code42;--?????????????????????????????????????? + + // River Discharge instantaneous measured Kilo Cubic Feet Per Second @Column @DynamicSerializeElement @XmlElement - private Float code43; // kcfs - - //River Discharge mean daily measured + private Float code43; // kcfs + + // River Discharge mean daily measured @Column @DynamicSerializeElement @XmlElement - private Float code44; // kcfs - - //River Discharge instantaneous computed + private Float code44; // kcfs + + // River Discharge instantaneous computed @Column @DynamicSerializeElement @XmlElement - private Float code45; // kcfs - - //River Discharge mean daily computed + private Float code45; // kcfs + + // River Discharge mean daily computed @Column @DynamicSerializeElement @XmlElement - private Float code46; // kcfs - - //River Discharge instantaneous from rating + private Float code46; // kcfs + + // River Discharge instantaneous from rating @Column @DynamicSerializeElement @XmlElement - private Float code47; // kcfs - - //River Discharge mean daily from rating + private Float code47; // kcfs + + // River Discharge mean daily from rating @Column @DynamicSerializeElement @XmlElement - private Float code48; // kcfs - - //River Discharge peak + private Float code48; // kcfs + + // River Discharge peak @Column @DynamicSerializeElement @XmlElement - private Float code49; // kcfs - - //River Discharge canal diversion + private Float code49; // kcfs + + // River Discharge canal diversion @Column @DynamicSerializeElement @XmlElement - private Float code50; // kcfs - - //private Float code51; //?????????????????????????????????? - - //Reservoir pool elevation at specified ob time + private Float code50; // kcfs + + // private Float code51; //?????????????????????????????????? + + // Reservoir pool elevation at specified ob time @Column @DynamicSerializeElement @XmlElement - private Float code52; // feet - - //Reservoir pool elevation at previous 6Z + private Float code52; // feet + + // Reservoir pool elevation at previous 6Z @Column @DynamicSerializeElement @XmlElement - private Float code53; // feet - - //Reservoir pool forecast, Day 1 + private Float code53; // feet + + // Reservoir pool forecast, Day 1 @Column @DynamicSerializeElement @XmlElement - private Float code54; // feet - - //Reservoir pool forecast, Day 2 + private Float code54; // feet + + // Reservoir pool forecast, Day 2 @Column @DynamicSerializeElement @XmlElement - private Float code55; // feet - - //Reservoir pool forecast, Day 3 + private Float code55; // feet + + // Reservoir pool forecast, Day 3 @Column @DynamicSerializeElement @XmlElement - private Float code56; // feet - - //Reservoir tailwater elevation + private Float code56; // feet + + // Reservoir tailwater elevation @Column @DynamicSerializeElement @XmlElement - private Float code57; // feet - - //Reservoir inflow, instantanious + private Float code57; // feet + + // Reservoir inflow, instantanious @Column @DynamicSerializeElement @XmlElement - private Float code58; // kcfs - - //Reservoir inflow, mean daily + private Float code58; // kcfs + + // Reservoir inflow, mean daily @Column @DynamicSerializeElement @XmlElement - private Float code59; // kcfs - - //Reservoir outflow, instantanious + private Float code59; // kcfs + + // Reservoir outflow, instantanious @Column @DynamicSerializeElement @XmlElement - private Float code60; // kcfs - - //Reservoir outflow, mean daily + private Float code60; // kcfs + + // Reservoir outflow, mean daily @Column @DynamicSerializeElement @XmlElement - private Float code61; // kcfs - - //Reservoir outflow forecast, mean daily, Day 1 + private Float code61; // kcfs + + // Reservoir outflow forecast, mean daily, Day 1 @Column @DynamicSerializeElement @XmlElement - private Float code62; // kcfs - - //Reservoir outflow forecast, mean daily, Day 2 + private Float code62; // kcfs + + // Reservoir outflow forecast, mean daily, Day 2 @Column @DynamicSerializeElement @XmlElement - private Float code63; // kcfs - - //Reservoir outflow forecast, mean daily, Day 3 + private Float code63; // kcfs + + // Reservoir outflow forecast, mean daily, Day 3 @Column @DynamicSerializeElement @XmlElement - private Float code64; // kcfs - - //Reservoir storage at specified ob time KAF=thousand acre feet + private Float code64; // kcfs + + // Reservoir storage at specified ob time KAF=thousand acre feet @Column @DynamicSerializeElement @XmlElement - private Float code65; // kaf - - //Reservoir evaporation, 24 hour total, computed + private Float code65; // kaf + + // Reservoir evaporation, 24 hour total, computed @Column @DynamicSerializeElement @XmlElement - private Float code66; // inches - - //Snow cover, areal extent + private Float code66; // inches + + // Snow cover, areal extent @Column @DynamicSerializeElement @XmlElement - private Float code67; // percent - - //Snow depth, total on ground + private Float code67; // percent + + // Snow depth, total on ground @Column @DynamicSerializeElement @XmlElement - private Float code68; // inches - - //Snow depth, new snow + private Float code68; // inches + + // Snow depth, new snow @Column @DynamicSerializeElement @XmlElement - private Float code69; // inches - - //Snow density + private Float code69; // inches + + // Snow density @Column @DynamicSerializeElement @XmlElement - private Float code70; // inches/inches - - //Snow, Water equivalent, total of snow and ice on ground + private Float code70; // inches/inches + + // Snow, Water equivalent, total of snow and ice on ground @Column @DynamicSerializeElement @XmlElement - private Float code71; // inches - + private Float code71; // inches + // Snow report ref LDAD Table? @Column @DynamicSerializeElement @XmlElement - private String code72; - //FirstDigit0 "Snow structure - no report" - //FirstDigit1 "Snow structure - losely packed" - //FirstDigit2 "Snow structure - densely packed" - //SecondDigit0 "Base of snowcover - no report" - //SecondDigit1 "Base of snowcover - wet snow" - //SecondDigit2 "Base of snowcover - dry snow" - //SecondDigit3 "Base of snowcover - ice layer" - //ThirdDigit0 "Surface of snowcover - no report" - //ThirdDigit1 "Surface of snowcover - snow crust" - //ThirdDigit2 "Surface of snowcover - loose" - //ThirdDigit3 "Surface of snowcover - ice" - //FourthDigit0 "Area description - no report" - //FourthDigit1 "Area description - uniform" - //FourthDigit2 "Area description - some drifts" - //FourthDigit3 "Area description - drifts" - - //Ice cover, areal extent + private String code72; + + // FirstDigit0 "Snow structure - no report" + // FirstDigit1 "Snow structure - losely packed" + // FirstDigit2 "Snow structure - densely packed" + // SecondDigit0 "Base of snowcover - no report" + // SecondDigit1 "Base of snowcover - wet snow" + // SecondDigit2 "Base of snowcover - dry snow" + // SecondDigit3 "Base of snowcover - ice layer" + // ThirdDigit0 "Surface of snowcover - no report" + // ThirdDigit1 "Surface of snowcover - snow crust" + // ThirdDigit2 "Surface of snowcover - loose" + // ThirdDigit3 "Surface of snowcover - ice" + // FourthDigit0 "Area description - no report" + // FourthDigit1 "Area description - uniform" + // FourthDigit2 "Area description - some drifts" + // FourthDigit3 "Area description - drifts" + + // Ice cover, areal extent @Column @DynamicSerializeElement @XmlElement - private Float code73; // percent - - //Ice extent from reporting area, up to downstream + private Float code73; // percent + + // Ice extent from reporting area, up to downstream @Column @DynamicSerializeElement @XmlElement - private Float code74; // miles - - //Ice open water, extent from reporting area, up or downstream + private Float code74; // miles + + // Ice open water, extent from reporting area, up or downstream @Column @DynamicSerializeElement @XmlElement - private Float code75; // miles - - //Ice thickness + private Float code75; // miles + + // Ice thickness @Column @DynamicSerializeElement @XmlElement - private Float code76; // inches - + private Float code76; // inches + // Ice report ref LDAD Table @Column @DynamicSerializeElement @XmlElement - private String code77; - // FirstDigit0 "Ice structure - no report" - // FirstDigit1 "Ice structure - breaking ice" - // FirstDigit2 "Ice structure - floating (running)" - // FirstDigit3 "Ice structure - hanging" - // FirstDigit4 "Ice structure - honeycomb" - // FirstDigit5 "Ice structure - layered" - // FirstDigit6 "Ice structure - rotten" - // FirstDigit7 "Ice structure - stationary" - // FirstDigit8 "Ice structure - stopped" - // FirstDigit9 "Ice structure - slush" - // SecondDigit0 "Ice type - no report" - // SecondDigit1 "Ice type - anchor (also bottom ice)" - // SecondDigit2 "Ice type - cake" - // SecondDigit3 "Ice type - clear" - // SecondDigit4 "Ice type - frazzle" - // SecondDigit5 "Ice type - ice gorge (also jammed ice)" - // SecondDigit6 "Ice type - locally formed" - // SecondDigit7 "Ice type - sheet ice" - // SecondDigit8 "Ice type - sheet ice (also on bridges)" - // SecondDigit9 "Ice type - shore ice" - // ThirdDigit0 "Ice cover - no ice" - // ThirdDigit1 "Ice cover - 1/10 cover" - // ThirdDigit2 "Ice cover - 2/10 cover" - // ThirdDigit3 "Ice cover - 3/10 cover" - // ThirdDigit4 "Ice cover - 4/10 cover" - // ThirdDigit5 "Ice cover - 5/10 cover" - // ThirdDigit6 "Ice cover - 6/10 cover" - // ThirdDigit7 "Ice cover - 7/10 cover" - // ThirdDigit8 "Ice cover - 8/10 - 9/10 cover" - // ThirdDigit9 "Ice cover - fully covered" - - //Depth of frost - @Column - @DynamicSerializeElement - @XmlElement - private Float code78; // inches - - //Depth of frost thawed - @Column - @DynamicSerializeElement - @XmlElement - private Float code79; // inches - - //Frost structure report - @Column - @DynamicSerializeElement - @XmlElement - private Short code80; // short - // 0 "Frost intensity - no frost" - // 1 "Frost intensity - light frost" - // 2 "Frost intensity - moderate frost" - // 3 "Frost intensity - heavy frost" - - //Surface frost intensity - @Column - @DynamicSerializeElement - @XmlElement - private Short code81; //short - // 0 "Frost intensity - no frost" - // 1 "Frost intensity - light frost" - // 2 "Frost intensity - moderate frost" - // 3 "Frost intensity - heavy frost" - - //State of ground - @Column - @DynamicSerializeElement - @XmlElement - private Short code82; // short - // 0 Surface of ground dry" - // 1 Surface of ground moist" - // 2 Surface of ground wet" - // 3 Flooded" - // 5 Glaze on ground" - // 6 Loose dry dust or sand not covering ground completely" - // 7 Thin cover of loose dry dust or sand covering ground completely" - // 8 Moderate or thick cover of loose dry dust or sand covering ground completely" - // 9 Ground extra dry with cracks" - // 10 Ground predominately covered with ice" - // 11 Compact or wet snow (with or without ice) covering less than one half of the ground" - // 12 Compact or wet snow (with or without ice) covering less than one half of the ground but not completely covered" - // 13 Even layer of comapct or wet snow covering ground completely" - // 14 Uneven layer of comapct or wet snow covering ground completely" - // 15 Loose dry snow covering less than one half of the ground" - // 16 Loose dry snow covering at least one half of the ground (but not completely)" - // 17 Even layers of loose dry snow covering ground completely" - // 18 Uneven layers of loose dry snow covering ground completely" - // 19 Snow covering ground completely; Deep drifts" - // 20 Sleet or hail covering ground completely" - - //Soil moisture - @Column - @DynamicSerializeElement - @XmlElement - private Float code83; // inches - - //Present weather - @Column - @DynamicSerializeElement - @XmlElement - private Short code84; // short - // 5 "Haze" - // 7 "Dust or sand raised by wind" - // 8 "Well developed dust whirls or sand whirls" - // 13 "Lightning (no thunder heard)" - // 17 "Thunderstorm, but no precip at ob time" - // 19 "Funnel cloud at or within sight of station during previous hour or at ob time" - // 41 "Fog or ice fog in patches" - // 42 "Fog or ice fog (sky visible)" - // 43 "Fog or ice fog (sky not visible)" - // 51 "Drizzle, not freezing, slight at ob time" - // 53 "Drizzle, not freezing, moderate at ob time" - // 55 "Drizzle, not freezing, heavy at ob time" - // 56 "Drizzle, freezing, light" - // 57 "Drizzle, freezing, moderate or heavy" - // 61 "Rain, not freezing, continuous, slight at ob time" - // 63 "Rain, not freezing, continuous, moderate at ob time" - // 65 "Rain, not freezing, continuous, heavy at ob time" - // 66 "Rain, freezing, light" - // 67 "Rain, freezing, moderate or heavy" - // 68 "Rain or drizzle and snow, light" - // 69 "Rain or drizzle and snow, moderate or heavy" - // 71 "Snow, continuous, light" - // 73 "Snow, continuous, moderate" - // 75 "Snow, continuous, heavy" - // 79 "Ice Pellets or sleet" - // 80 "Rainshower, light" - // 81 "Rainshower, moderate or heavy" - // 82 "Rainshower, violent" - // 83 "Rain and snowshowers, light" - // 84 "Rain and snowshowers, moderate or heavy" - // 85 "Snowshowers, light" - // 86 "Snowshowers, moderate or heavy" - // 89 "Showers of hail, with or without rain or rain and snow mixed at ob time" - // 95 "Thunderstorm, slight or moderate, without hail, but with rain and/or snow" - // 96 "Thunderstorm, slight or moderate, with hail" - // 97 "Thunderstorm, heavy, without hail, but with rain and/or snow" - // 98 "Thunderstorm, with dust or sand storm" - // 99 "Thunderstorm, heavy with hail" - - //Past 6 hour weather - @Column - @DynamicSerializeElement - @XmlElement - private Short code85; // short - // 0 "Cloud covering one half or less of the sky throughout the appropriate period" - // 1 "Cloud covering more than one half the sky throughout the appropriate period and covering one half or less during part of the period" - // 2 "Cloud covering more than one half the sky throughout the appropriate period" - // 3 "Sandstorm, duststrom, or blowing snow" - // 4 "Fog or ice fog or thick haze" - // 5 "Drizzle" - // 6 "Rain" - // 7 "Snow, or rain and snow mixed" - // 8 "Showers" - // 9 "Thunderstorm(s) with or without precip" + private String code77; - //Relative humidity + // FirstDigit0 "Ice structure - no report" + // FirstDigit1 "Ice structure - breaking ice" + // FirstDigit2 "Ice structure - floating (running)" + // FirstDigit3 "Ice structure - hanging" + // FirstDigit4 "Ice structure - honeycomb" + // FirstDigit5 "Ice structure - layered" + // FirstDigit6 "Ice structure - rotten" + // FirstDigit7 "Ice structure - stationary" + // FirstDigit8 "Ice structure - stopped" + // FirstDigit9 "Ice structure - slush" + // SecondDigit0 "Ice type - no report" + // SecondDigit1 "Ice type - anchor (also bottom ice)" + // SecondDigit2 "Ice type - cake" + // SecondDigit3 "Ice type - clear" + // SecondDigit4 "Ice type - frazzle" + // SecondDigit5 "Ice type - ice gorge (also jammed ice)" + // SecondDigit6 "Ice type - locally formed" + // SecondDigit7 "Ice type - sheet ice" + // SecondDigit8 "Ice type - sheet ice (also on bridges)" + // SecondDigit9 "Ice type - shore ice" + // ThirdDigit0 "Ice cover - no ice" + // ThirdDigit1 "Ice cover - 1/10 cover" + // ThirdDigit2 "Ice cover - 2/10 cover" + // ThirdDigit3 "Ice cover - 3/10 cover" + // ThirdDigit4 "Ice cover - 4/10 cover" + // ThirdDigit5 "Ice cover - 5/10 cover" + // ThirdDigit6 "Ice cover - 6/10 cover" + // ThirdDigit7 "Ice cover - 7/10 cover" + // ThirdDigit8 "Ice cover - 8/10 - 9/10 cover" + // ThirdDigit9 "Ice cover - fully covered" + + // Depth of frost @Column @DynamicSerializeElement @XmlElement - private Float code86; // percent - - //Evaporation, measured, Class A pan or other + private Float code78; // inches + + // Depth of frost thawed @Column @DynamicSerializeElement @XmlElement - private Float code87; // inches - - //Wind speed + private Float code79; // inches + + // Frost structure report @Column @DynamicSerializeElement @XmlElement - private Float code88; // miles per hour - - //Wind direction + private Short code80; // short + // 0 "Frost intensity - no frost" + // 1 "Frost intensity - light frost" + // 2 "Frost intensity - moderate frost" + // 3 "Frost intensity - heavy frost" + + // Surface frost intensity @Column @DynamicSerializeElement @XmlElement - private Float code89; // tens of degrees - - //Sunshine, hours per day + private Short code81; // short + // 0 "Frost intensity - no frost" + // 1 "Frost intensity - light frost" + // 2 "Frost intensity - moderate frost" + // 3 "Frost intensity - heavy frost" + + // State of ground + @Column + @DynamicSerializeElement + @XmlElement + private Short code82; // short + // 0 Surface of ground dry" + // 1 Surface of ground moist" + // 2 Surface of ground wet" + // 3 Flooded" + // 5 Glaze on ground" + // 6 Loose dry dust or sand not covering ground + // completely" + // 7 Thin cover of loose dry dust or sand covering + // ground completely" + // 8 Moderate or thick cover of loose dry dust or sand + // covering ground completely" + // 9 Ground extra dry with cracks" + // 10 Ground predominately covered with ice" + // 11 Compact or wet snow (with or without ice) + // covering less than one half of the ground" + // 12 Compact or wet snow (with or without ice) + // covering less than one half of the ground but not + // completely covered" + // 13 Even layer of comapct or wet snow covering + // ground completely" + // 14 Uneven layer of comapct or wet snow covering + // ground completely" + // 15 Loose dry snow covering less than one half of + // the ground" + // 16 Loose dry snow covering at least one half of the + // ground (but not completely)" + // 17 Even layers of loose dry snow covering ground + // completely" + // 18 Uneven layers of loose dry snow covering ground + // completely" + // 19 Snow covering ground completely; Deep drifts" + // 20 Sleet or hail covering ground completely" + + // Soil moisture + @Column + @DynamicSerializeElement + @XmlElement + private Float code83; // inches + + // Present weather + @Column + @DynamicSerializeElement + @XmlElement + private Short code84; // short + // 5 "Haze" + // 7 "Dust or sand raised by wind" + // 8 "Well developed dust whirls or sand whirls" + // 13 "Lightning (no thunder heard)" + // 17 "Thunderstorm, but no precip at ob time" + // 19 + // "Funnel cloud at or within sight of station during previous hour or at ob time" + // 41 "Fog or ice fog in patches" + // 42 "Fog or ice fog (sky visible)" + // 43 "Fog or ice fog (sky not visible)" + // 51 "Drizzle, not freezing, slight at ob time" + // 53 "Drizzle, not freezing, moderate at ob time" + // 55 "Drizzle, not freezing, heavy at ob time" + // 56 "Drizzle, freezing, light" + // 57 "Drizzle, freezing, moderate or heavy" + // 61 + // "Rain, not freezing, continuous, slight at ob time" + // 63 + // "Rain, not freezing, continuous, moderate at ob time" + // 65 + // "Rain, not freezing, continuous, heavy at ob time" + // 66 "Rain, freezing, light" + // 67 "Rain, freezing, moderate or heavy" + // 68 "Rain or drizzle and snow, light" + // 69 "Rain or drizzle and snow, moderate or heavy" + // 71 "Snow, continuous, light" + // 73 "Snow, continuous, moderate" + // 75 "Snow, continuous, heavy" + // 79 "Ice Pellets or sleet" + // 80 "Rainshower, light" + // 81 "Rainshower, moderate or heavy" + // 82 "Rainshower, violent" + // 83 "Rain and snowshowers, light" + // 84 "Rain and snowshowers, moderate or heavy" + // 85 "Snowshowers, light" + // 86 "Snowshowers, moderate or heavy" + // 89 + // "Showers of hail, with or without rain or rain and snow mixed at ob time" + // 95 + // "Thunderstorm, slight or moderate, without hail, but with rain and/or snow" + // 96 "Thunderstorm, slight or moderate, with hail" + // 97 + // "Thunderstorm, heavy, without hail, but with rain and/or snow" + // 98 "Thunderstorm, with dust or sand storm" + // 99 "Thunderstorm, heavy with hail" + + // Past 6 hour weather + @Column + @DynamicSerializeElement + @XmlElement + private Short code85; // short + // 0 + // "Cloud covering one half or less of the sky throughout the appropriate period" + // 1 + // "Cloud covering more than one half the sky throughout the appropriate period and covering one half or less during part of the period" + // 2 + // "Cloud covering more than one half the sky throughout the appropriate period" + // 3 "Sandstorm, duststrom, or blowing snow" + // 4 "Fog or ice fog or thick haze" + // 5 "Drizzle" + // 6 "Rain" + // 7 "Snow, or rain and snow mixed" + // 8 "Showers" + // 9 "Thunderstorm(s) with or without precip" + + // Relative humidity + @Column + @DynamicSerializeElement + @XmlElement + private Float code86; // percent + + // Evaporation, measured, Class A pan or other + @Column + @DynamicSerializeElement + @XmlElement + private Float code87; // inches + + // Wind speed + @Column + @DynamicSerializeElement + @XmlElement + private Float code88; // miles per hour + + // Wind direction + @Column + @DynamicSerializeElement + @XmlElement + private Float code89; // tens of degrees + + // Sunshine, hours per day @Column @DynamicSerializeElement @XmlElement private Float code90; // hours - - //Solar energy, accumulated incoming + + // Solar energy, accumulated incoming @Column @DynamicSerializeElement @XmlElement - private Float code91; // ly - + private Float code91; // ly + // short Dew intensity @Column @DynamicSerializeElement @XmlElement - private Short code92; - // 0 "No dew" - // 1 "Light dew" - // 2 "Moderate dew" - // 3 "Heavy dew" - - //Leaf wetness + private Short code92; + + // 0 "No dew" + // 1 "Light dew" + // 2 "Moderate dew" + // 3 "Heavy dew" + + // Leaf wetness @Column @DynamicSerializeElement @XmlElement private Float code93; // hours ???????????????????? - - //Water pan temperature maximum + + // Water pan temperature maximum @Column @DynamicSerializeElement @XmlElement - private Float code94; // degrees F - - //Water pan temperature minimum + private Float code94; // degrees F + + // Water pan temperature minimum @Column @DynamicSerializeElement @XmlElement - private Float code95; // degrees F - - //24 hour wind flow + private Float code95; // degrees F + + // 24 hour wind flow @Column @DynamicSerializeElement @XmlElement - private Float code96; // miles + private Float code96; // miles // Raw observation text - ROSA raw message @Column @DynamicSerializeElement @XmlElement - private String rawMessage; //rawMessage - + private String rawMessage; // rawMessage + /** * */ @@ -861,1171 +882,1253 @@ IDecoderGettable { public ManualLdadRecord(String uri) { super(uri); } - - + + /** + * @return the code12 + */ + public Float getCode12() { + return code12; + } + + /** + * @param code12 + * the code12 to set + */ + public void setCode12(Float code12) { + this.code12 = code12; + } + + /** + * @return the code13 + */ + public Float getCode13() { + return code13; + } + + /** + * @param code13 + * the code13 to set + */ + public void setCode13(Float code13) { + this.code13 = code13; + } + + /** + * @return the code14 + */ + public Float getCode14() { + return code14; + } + + /** + * @param code14 + * the code14 to set + */ + public void setCode14(Float code14) { + this.code14 = code14; + } + + /** + * @return the code15 + */ + public Float getCode15() { + return code15; + } + + /** + * @param code15 + * the code15 to set + */ + public void setCode15(Float code15) { + this.code15 = code15; + } + + /** + * @return the code16 + */ + public Float getCode16() { + return code16; + } + + /** + * @param code16 + * the code16 to set + */ + public void setCode16(Float code16) { + this.code16 = code16; + } + + /** + * @return the code17 + */ + public Float getCode17() { + return code17; + } + + /** + * @param code17 + * the code17 to set + */ + public void setCode17(Float code17) { + this.code17 = code17; + } + + /** + * @return the code18 + */ + public Float getCode18() { + return code18; + } + + /** + * @param code18 + * the code18 to set + */ + public void setCode18(Float code18) { + this.code18 = code18; + } + + /** + * @return the code19 + */ + public Float getCode19() { + return code19; + } + + /** + * @param code19 + * the code19 to set + */ + public void setCode19(Float code19) { + this.code19 = code19; + } + + /** + * @return the code20 + */ + public Short getCode20() { + return code20; + } + + /** + * @param code20 + * the code20 to set + */ + public void setCode20(Short code20) { + this.code20 = code20; + } + + /** + * @return the code21 + */ + public Float getCode21() { + return code21; + } + + /** + * @param code21 + * the code21 to set + */ + public void setCode21(Float code21) { + this.code21 = code21; + } + + /** + * @return the code22 + */ + public Float getCode22() { + return code22; + } + + /** + * @param code22 + * the code22 to set + */ + public void setCode22(Float code22) { + this.code22 = code22; + } + + /** + * @return the code23 + */ + public Float getCode23() { + return code23; + } + + /** + * @param code23 + * the code23 to set + */ + public void setCode23(Float code23) { + this.code23 = code23; + } + + /** + * @return the code24 + */ + public Float getCode24() { + return code24; + } + + /** + * @param code24 + * the code24 to set + */ + public void setCode24(Float code24) { + this.code24 = code24; + } + + /** + * @return the code25 + */ + public Float getCode25() { + return code25; + } + + /** + * @param code25 + * the code25 to set + */ + public void setCode25(Float code25) { + this.code25 = code25; + } + + /** + * @return the code26 + */ + public Float getCode26() { + return code26; + } + + /** + * @param code26 + * the code26 to set + */ + public void setCode26(Float code26) { + this.code26 = code26; + } + + /** + * @return the code27 + */ + public Float getCode27() { + return code27; + } + + /** + * @param code27 + * the code27 to set + */ + public void setCode27(Float code27) { + this.code27 = code27; + } + + /** + * @return the code28 + */ + public Float getCode28() { + return code28; + } + + /** + * @param code28 + * the code28 to set + */ + public void setCode28(Float code28) { + this.code28 = code28; + } + + /** + * @return the code29 + */ + public Float getCode29() { + return code29; + } + + /** + * @param code29 + * the code29 to set + */ + public void setCode29(Float code29) { + this.code29 = code29; + } + + /** + * @return the code30 + */ + public Float getCode30() { + return code30; + } + + /** + * @param code30 + * the code30 to set + */ + public void setCode30(Float code30) { + this.code30 = code30; + } + + /** + * @return the code31 + */ + public Float getCode31() { + return code31; + } + + /** + * @param code31 + * the code31 to set + */ + public void setCode31(Float code31) { + this.code31 = code31; + } + + /** + * @return the code32 + */ + public Float getCode32() { + return code32; + } + + /** + * @param code32 + * the code32 to set + */ + public void setCode32(Float code32) { + this.code32 = code32; + } + + /** + * @return the code33 + */ + public Float getCode33() { + return code33; + } + + /** + * @param code33 + * the code33 to set + */ + public void setCode33(Float code33) { + this.code33 = code33; + } + + /** + * @return the code34 + */ + public Float getCode34() { + return code34; + } + + /** + * @param code34 + * the code34 to set + */ + public void setCode34(Float code34) { + this.code34 = code34; + } + + /** + * @return the code35 + */ + public Float getCode35() { + return code35; + } + + /** + * @param code35 + * the code35 to set + */ + public void setCode35(Float code35) { + this.code35 = code35; + } + + /** + * @return the code36 + */ + public Float getCode36() { + return code36; + } + + /** + * @param code36 + * the code36 to set + */ + public void setCode36(Float code36) { + this.code36 = code36; + } + + /** + * @return the code37 + */ + public Float getCode37() { + return code37; + } + + /** + * @param code37 + * the code37 to set + */ + public void setCode37(Float code37) { + this.code37 = code37; + } + + /** + * @return the code38 + */ + public Float getCode38() { + return code38; + } + + /** + * @param code38 + * the code38 to set + */ + public void setCode38(Float code38) { + this.code38 = code38; + } + + /** + * @return the code39 + */ + public String getCode39() { + return code39; + } + + /** + * @param code39 + * the code39 to set + */ + public void setCode39(String code39) { + this.code39 = code39; + } + + /** + * @return the code40 + */ + public Float getCode40() { + return code40; + } + + /** + * @param code40 + * the code40 to set + */ + public void setCode40(Float code40) { + this.code40 = code40; + } + + /** + * @return the code41 + */ + public Short getCode41() { + return code41; + } + + /** + * @param code41 + * the code41 to set + */ + public void setCode41(Short code41) { + this.code41 = code41; + } + + /** + * @return the code43 + */ + public Float getCode43() { + return code43; + } + + /** + * @param code43 + * the code43 to set + */ + public void setCode43(Float code43) { + this.code43 = code43; + } + + /** + * @return the code44 + */ + public Float getCode44() { + return code44; + } + + /** + * @param code44 + * the code44 to set + */ + public void setCode44(Float code44) { + this.code44 = code44; + } + + /** + * @return the code45 + */ + public Float getCode45() { + return code45; + } + + /** + * @param code45 + * the code45 to set + */ + public void setCode45(Float code45) { + this.code45 = code45; + } + + /** + * @return the code46 + */ + public Float getCode46() { + return code46; + } + + /** + * @param code46 + * the code46 to set + */ + public void setCode46(Float code46) { + this.code46 = code46; + } + + /** + * @return the code47 + */ + public Float getCode47() { + return code47; + } + + /** + * @param code47 + * the code47 to set + */ + public void setCode47(Float code47) { + this.code47 = code47; + } + + /** + * @return the code48 + */ + public Float getCode48() { + return code48; + } + + /** + * @param code48 + * the code48 to set + */ + public void setCode48(Float code48) { + this.code48 = code48; + } + + /** + * @return the code49 + */ + public Float getCode49() { + return code49; + } + + /** + * @param code49 + * the code49 to set + */ + public void setCode49(Float code49) { + this.code49 = code49; + } + + /** + * @return the code50 + */ + public Float getCode50() { + return code50; + } + + /** + * @param code50 + * the code50 to set + */ + public void setCode50(Float code50) { + this.code50 = code50; + } + + /** + * @return the code52 + */ + public Float getCode52() { + return code52; + } + + /** + * @param code52 + * the code52 to set + */ + public void setCode52(Float code52) { + this.code52 = code52; + } + + /** + * @return the code53 + */ + public Float getCode53() { + return code53; + } + + /** + * @param code53 + * the code53 to set + */ + public void setCode53(Float code53) { + this.code53 = code53; + } + + /** + * @return the code54 + */ + public Float getCode54() { + return code54; + } + + /** + * @param code54 + * the code54 to set + */ + public void setCode54(Float code54) { + this.code54 = code54; + } + + /** + * @return the code55 + */ + public Float getCode55() { + return code55; + } + + /** + * @param code55 + * the code55 to set + */ + public void setCode55(Float code55) { + this.code55 = code55; + } + + /** + * @return the code56 + */ + public Float getCode56() { + return code56; + } + + /** + * @param code56 + * the code56 to set + */ + public void setCode56(Float code56) { + this.code56 = code56; + } + + /** + * @return the code57 + */ + public Float getCode57() { + return code57; + } + + /** + * @param code57 + * the code57 to set + */ + public void setCode57(Float code57) { + this.code57 = code57; + } + + /** + * @return the code58 + */ + public Float getCode58() { + return code58; + } + + /** + * @param code58 + * the code58 to set + */ + public void setCode58(Float code58) { + this.code58 = code58; + } + + /** + * @return the code59 + */ + public Float getCode59() { + return code59; + } + + /** + * @param code59 + * the code59 to set + */ + public void setCode59(Float code59) { + this.code59 = code59; + } + + /** + * @return the code60 + */ + public Float getCode60() { + return code60; + } + + /** + * @param code60 + * the code60 to set + */ + public void setCode60(Float code60) { + this.code60 = code60; + } + + /** + * @return the code61 + */ + public Float getCode61() { + return code61; + } + + /** + * @param code61 + * the code61 to set + */ + public void setCode61(Float code61) { + this.code61 = code61; + } + + /** + * @return the code62 + */ + public Float getCode62() { + return code62; + } + + /** + * @param code62 + * the code62 to set + */ + public void setCode62(Float code62) { + this.code62 = code62; + } + + /** + * @return the code63 + */ + public Float getCode63() { + return code63; + } + + /** + * @param code63 + * the code63 to set + */ + public void setCode63(Float code63) { + this.code63 = code63; + } + + /** + * @return the code64 + */ + public Float getCode64() { + return code64; + } + + /** + * @param code64 + * the code64 to set + */ + public void setCode64(Float code64) { + this.code64 = code64; + } + + /** + * @return the code65 + */ + public Float getCode65() { + return code65; + } + + /** + * @param code65 + * the code65 to set + */ + public void setCode65(Float code65) { + this.code65 = code65; + } + + /** + * @return the code66 + */ + public Float getCode66() { + return code66; + } + + /** + * @param code66 + * the code66 to set + */ + public void setCode66(Float code66) { + this.code66 = code66; + } + + /** + * @return the code67 + */ + public Float getCode67() { + return code67; + } + + /** + * @param code67 + * the code67 to set + */ + public void setCode67(Float code67) { + this.code67 = code67; + } + + /** + * @return the code68 + */ + public Float getCode68() { + return code68; + } + + /** + * @param code68 + * the code68 to set + */ + public void setCode68(Float code68) { + this.code68 = code68; + } + + /** + * @return the code69 + */ + public Float getCode69() { + return code69; + } + + /** + * @param code69 + * the code69 to set + */ + public void setCode69(Float code69) { + this.code69 = code69; + } + + /** + * @return the code70 + */ + public Float getCode70() { + return code70; + } + + /** + * @param code70 + * the code70 to set + */ + public void setCode70(Float code70) { + this.code70 = code70; + } + + /** + * @return the code71 + */ + public Float getCode71() { + return code71; + } + + /** + * @param code71 + * the code71 to set + */ + public void setCode71(Float code71) { + this.code71 = code71; + } + + /** + * @return the code72 + */ + public String getCode72() { + return code72; + } + + /** + * @param code72 + * the code72 to set + */ + public void setCode72(String code72) { + this.code72 = code72; + } + + /** + * @return the code73 + */ + public Float getCode73() { + return code73; + } + + /** + * @param code73 + * the code73 to set + */ + public void setCode73(Float code73) { + this.code73 = code73; + } + + /** + * @return the code74 + */ + public Float getCode74() { + return code74; + } + + /** + * @param code74 + * the code74 to set + */ + public void setCode74(Float code74) { + this.code74 = code74; + } + + /** + * @return the code75 + */ + public Float getCode75() { + return code75; + } + + /** + * @param code75 + * the code75 to set + */ + public void setCode75(Float code75) { + this.code75 = code75; + } + + /** + * @return the code76 + */ + public Float getCode76() { + return code76; + } + + /** + * @param code76 + * the code76 to set + */ + public void setCode76(Float code76) { + this.code76 = code76; + } + + /** + * @return the code77 + */ + public String getCode77() { + return code77; + } + + /** + * @param code77 + * the code77 to set + */ + public void setCode77(String code77) { + this.code77 = code77; + } + + /** + * @return the code78 + */ + public Float getCode78() { + return code78; + } + + /** + * @param code78 + * the code78 to set + */ + public void setCode78(Float code78) { + this.code78 = code78; + } + + /** + * @return the code79 + */ + public Float getCode79() { + return code79; + } + + /** + * @param code79 + * the code79 to set + */ + public void setCode79(Float code79) { + this.code79 = code79; + } + + /** + * @return the code80 + */ + public Short getCode80() { + return code80; + } + + /** + * @param code80 + * the code80 to set + */ + public void setCode80(Short code80) { + this.code80 = code80; + } + + /** + * @return the code81 + */ + public Short getCode81() { + return code81; + } + + /** + * @param code81 + * the code81 to set + */ + public void setCode81(Short code81) { + this.code81 = code81; + } + + /** + * @return the code82 + */ + public Short getCode82() { + return code82; + } + + /** + * @param code82 + * the code82 to set + */ + public void setCode82(Short code82) { + this.code82 = code82; + } + + /** + * @return the code83 + */ + public Float getCode83() { + return code83; + } + + /** + * @param code83 + * the code83 to set + */ + public void setCode83(Float code83) { + this.code83 = code83; + } + + /** + * @return the code84 + */ + public Short getCode84() { + return code84; + } + + /** + * @param code84 + * the code84 to set + */ + public void setCode84(Short code84) { + this.code84 = code84; + } + + /** + * @return the code85 + */ + public Short getCode85() { + return code85; + } + + /** + * @param code85 + * the code85 to set + */ + public void setCode85(Short code85) { + this.code85 = code85; + } + + /** + * @return the code86 + */ + public Float getCode86() { + return code86; + } + + /** + * @param code86 + * the code86 to set + */ + public void setCode86(Float code86) { + this.code86 = code86; + } + + /** + * @return the code87 + */ + public Float getCode87() { + return code87; + } + + /** + * @param code87 + * the code87 to set + */ + public void setCode87(Float code87) { + this.code87 = code87; + } + + /** + * @return the code88 + */ + public Float getCode88() { + return code88; + } + + /** + * @param code88 + * the code88 to set + */ + public void setCode88(Float code88) { + this.code88 = code88; + } + + /** + * @return the code89 + */ + public Float getCode89() { + return code89; + } + + /** + * @param code89 + * the code89 to set + */ + public void setCode89(Float code89) { + this.code89 = code89; + } + + /** + * @return the code90 + */ + public Float getCode90() { + return code90; + } + + /** + * @param code90 + * the code90 to set + */ + public void setCode90(Float code90) { + this.code90 = code90; + } + + /** + * @return the code91 + */ + public Float getCode91() { + return code91; + } + + /** + * @param code91 + * the code91 to set + */ + public void setCode91(Float code91) { + this.code91 = code91; + } + + /** + * @return the code92 + */ + public Short getCode92() { + return code92; + } + + /** + * @param code92 + * the code92 to set + */ + public void setCode92(Short code92) { + this.code92 = code92; + } + + /** + * @return the code93 + */ + public Float getCode93() { + return code93; + } + + /** + * @param code93 + * the code93 to set + */ + public void setCode93(Float code93) { + this.code93 = code93; + } + + /** + * @return the code94 + */ + public Float getCode94() { + return code94; + } + + /** + * @param code94 + * the code94 to set + */ + public void setCode94(Float code94) { + this.code94 = code94; + } + + /** + * @return the code95 + */ + public Float getCode95() { + return code95; + } + + /** + * @param code95 + * the code95 to set + */ + public void setCode95(Float code95) { + this.code95 = code95; + } + + /** + * @return the code96 + */ + public Float getCode96() { + return code96; + } + + /** + * @param code96 + * the code96 to set + */ + public void setCode96(Float code96) { + this.code96 = code96; + } + /** - * @return the code12 - */ - public Float getCode12() { - return code12; - } - - /** - * @param code12 the code12 to set - */ - public void setCode12(Float code12) { - this.code12 = code12; - } - - /** - * @return the code13 - */ - public Float getCode13() { - return code13; - } - - /** - * @param code13 the code13 to set - */ - public void setCode13(Float code13) { - this.code13 = code13; - } - - /** - * @return the code14 - */ - public Float getCode14() { - return code14; - } - - /** - * @param code14 the code14 to set - */ - public void setCode14(Float code14) { - this.code14 = code14; - } - - /** - * @return the code15 - */ - public Float getCode15() { - return code15; - } - - /** - * @param code15 the code15 to set - */ - public void setCode15(Float code15) { - this.code15 = code15; - } - - /** - * @return the code16 - */ - public Float getCode16() { - return code16; - } - - /** - * @param code16 the code16 to set - */ - public void setCode16(Float code16) { - this.code16 = code16; - } - - /** - * @return the code17 - */ - public Float getCode17() { - return code17; - } - - /** - * @param code17 the code17 to set - */ - public void setCode17(Float code17) { - this.code17 = code17; - } - - /** - * @return the code18 - */ - public Float getCode18() { - return code18; - } - - /** - * @param code18 the code18 to set - */ - public void setCode18(Float code18) { - this.code18 = code18; - } - - /** - * @return the code19 - */ - public Float getCode19() { - return code19; - } - - /** - * @param code19 the code19 to set - */ - public void setCode19(Float code19) { - this.code19 = code19; - } - - /** - * @return the code20 - */ - public Short getCode20() { - return code20; - } - - /** - * @param code20 the code20 to set - */ - public void setCode20(Short code20) { - this.code20 = code20; - } - - /** - * @return the code21 - */ - public Float getCode21() { - return code21; - } - - /** - * @param code21 the code21 to set - */ - public void setCode21(Float code21) { - this.code21 = code21; - } - - /** - * @return the code22 - */ - public Float getCode22() { - return code22; - } - - /** - * @param code22 the code22 to set - */ - public void setCode22(Float code22) { - this.code22 = code22; - } - - /** - * @return the code23 - */ - public Float getCode23() { - return code23; - } - - /** - * @param code23 the code23 to set - */ - public void setCode23(Float code23) { - this.code23 = code23; - } - - /** - * @return the code24 - */ - public Float getCode24() { - return code24; - } - - /** - * @param code24 the code24 to set - */ - public void setCode24(Float code24) { - this.code24 = code24; - } - - /** - * @return the code25 - */ - public Float getCode25() { - return code25; - } - - /** - * @param code25 the code25 to set - */ - public void setCode25(Float code25) { - this.code25 = code25; - } - - /** - * @return the code26 - */ - public Float getCode26() { - return code26; - } - - /** - * @param code26 the code26 to set - */ - public void setCode26(Float code26) { - this.code26 = code26; - } - - /** - * @return the code27 - */ - public Float getCode27() { - return code27; - } - - /** - * @param code27 the code27 to set - */ - public void setCode27(Float code27) { - this.code27 = code27; - } - - /** - * @return the code28 - */ - public Float getCode28() { - return code28; - } - - /** - * @param code28 the code28 to set - */ - public void setCode28(Float code28) { - this.code28 = code28; - } - - /** - * @return the code29 - */ - public Float getCode29() { - return code29; - } - - /** - * @param code29 the code29 to set - */ - public void setCode29(Float code29) { - this.code29 = code29; - } - - /** - * @return the code30 - */ - public Float getCode30() { - return code30; - } - - /** - * @param code30 the code30 to set - */ - public void setCode30(Float code30) { - this.code30 = code30; - } - - /** - * @return the code31 - */ - public Float getCode31() { - return code31; - } - - /** - * @param code31 the code31 to set - */ - public void setCode31(Float code31) { - this.code31 = code31; - } - - /** - * @return the code32 - */ - public Float getCode32() { - return code32; - } - - /** - * @param code32 the code32 to set - */ - public void setCode32(Float code32) { - this.code32 = code32; - } - - /** - * @return the code33 - */ - public Float getCode33() { - return code33; - } - - /** - * @param code33 the code33 to set - */ - public void setCode33(Float code33) { - this.code33 = code33; - } - - /** - * @return the code34 - */ - public Float getCode34() { - return code34; - } - - /** - * @param code34 the code34 to set - */ - public void setCode34(Float code34) { - this.code34 = code34; - } - - /** - * @return the code35 - */ - public Float getCode35() { - return code35; - } - - /** - * @param code35 the code35 to set - */ - public void setCode35(Float code35) { - this.code35 = code35; - } - - /** - * @return the code36 - */ - public Float getCode36() { - return code36; - } - - /** - * @param code36 the code36 to set - */ - public void setCode36(Float code36) { - this.code36 = code36; - } - - /** - * @return the code37 - */ - public Float getCode37() { - return code37; - } - - /** - * @param code37 the code37 to set - */ - public void setCode37(Float code37) { - this.code37 = code37; - } - - /** - * @return the code38 - */ - public Float getCode38() { - return code38; - } - - /** - * @param code38 the code38 to set - */ - public void setCode38(Float code38) { - this.code38 = code38; - } - - /** - * @return the code39 - */ - public String getCode39() { - return code39; - } - - /** - * @param code39 the code39 to set - */ - public void setCode39(String code39) { - this.code39 = code39; - } - - /** - * @return the code40 - */ - public Float getCode40() { - return code40; - } - - /** - * @param code40 the code40 to set - */ - public void setCode40(Float code40) { - this.code40 = code40; - } - - /** - * @return the code41 - */ - public Short getCode41() { - return code41; - } - - /** - * @param code41 the code41 to set - */ - public void setCode41(Short code41) { - this.code41 = code41; - } - - /** - * @return the code43 - */ - public Float getCode43() { - return code43; - } - - /** - * @param code43 the code43 to set - */ - public void setCode43(Float code43) { - this.code43 = code43; - } - - /** - * @return the code44 - */ - public Float getCode44() { - return code44; - } - - /** - * @param code44 the code44 to set - */ - public void setCode44(Float code44) { - this.code44 = code44; - } - - /** - * @return the code45 - */ - public Float getCode45() { - return code45; - } - - /** - * @param code45 the code45 to set - */ - public void setCode45(Float code45) { - this.code45 = code45; - } - - /** - * @return the code46 - */ - public Float getCode46() { - return code46; - } - - /** - * @param code46 the code46 to set - */ - public void setCode46(Float code46) { - this.code46 = code46; - } - - /** - * @return the code47 - */ - public Float getCode47() { - return code47; - } - - /** - * @param code47 the code47 to set - */ - public void setCode47(Float code47) { - this.code47 = code47; - } - - /** - * @return the code48 - */ - public Float getCode48() { - return code48; - } - - /** - * @param code48 the code48 to set - */ - public void setCode48(Float code48) { - this.code48 = code48; - } - - /** - * @return the code49 - */ - public Float getCode49() { - return code49; - } - - /** - * @param code49 the code49 to set - */ - public void setCode49(Float code49) { - this.code49 = code49; - } - - /** - * @return the code50 - */ - public Float getCode50() { - return code50; - } - - /** - * @param code50 the code50 to set - */ - public void setCode50(Float code50) { - this.code50 = code50; - } - - /** - * @return the code52 - */ - public Float getCode52() { - return code52; - } - - /** - * @param code52 the code52 to set - */ - public void setCode52(Float code52) { - this.code52 = code52; - } - - /** - * @return the code53 - */ - public Float getCode53() { - return code53; - } - - /** - * @param code53 the code53 to set - */ - public void setCode53(Float code53) { - this.code53 = code53; - } - - /** - * @return the code54 - */ - public Float getCode54() { - return code54; - } - - /** - * @param code54 the code54 to set - */ - public void setCode54(Float code54) { - this.code54 = code54; - } - - /** - * @return the code55 - */ - public Float getCode55() { - return code55; - } - - /** - * @param code55 the code55 to set - */ - public void setCode55(Float code55) { - this.code55 = code55; - } - - /** - * @return the code56 - */ - public Float getCode56() { - return code56; - } - - /** - * @param code56 the code56 to set - */ - public void setCode56(Float code56) { - this.code56 = code56; - } - - /** - * @return the code57 - */ - public Float getCode57() { - return code57; - } - - /** - * @param code57 the code57 to set - */ - public void setCode57(Float code57) { - this.code57 = code57; - } - - /** - * @return the code58 - */ - public Float getCode58() { - return code58; - } - - /** - * @param code58 the code58 to set - */ - public void setCode58(Float code58) { - this.code58 = code58; - } - - /** - * @return the code59 - */ - public Float getCode59() { - return code59; - } - - /** - * @param code59 the code59 to set - */ - public void setCode59(Float code59) { - this.code59 = code59; - } - - /** - * @return the code60 - */ - public Float getCode60() { - return code60; - } - - /** - * @param code60 the code60 to set - */ - public void setCode60(Float code60) { - this.code60 = code60; - } - - /** - * @return the code61 - */ - public Float getCode61() { - return code61; - } - - /** - * @param code61 the code61 to set - */ - public void setCode61(Float code61) { - this.code61 = code61; - } - - /** - * @return the code62 - */ - public Float getCode62() { - return code62; - } - - /** - * @param code62 the code62 to set - */ - public void setCode62(Float code62) { - this.code62 = code62; - } - - /** - * @return the code63 - */ - public Float getCode63() { - return code63; - } - - /** - * @param code63 the code63 to set - */ - public void setCode63(Float code63) { - this.code63 = code63; - } - - /** - * @return the code64 - */ - public Float getCode64() { - return code64; - } - - /** - * @param code64 the code64 to set - */ - public void setCode64(Float code64) { - this.code64 = code64; - } - - /** - * @return the code65 - */ - public Float getCode65() { - return code65; - } - - /** - * @param code65 the code65 to set - */ - public void setCode65(Float code65) { - this.code65 = code65; - } - - /** - * @return the code66 - */ - public Float getCode66() { - return code66; - } - - /** - * @param code66 the code66 to set - */ - public void setCode66(Float code66) { - this.code66 = code66; - } - - /** - * @return the code67 - */ - public Float getCode67() { - return code67; - } - - /** - * @param code67 the code67 to set - */ - public void setCode67(Float code67) { - this.code67 = code67; - } - - /** - * @return the code68 - */ - public Float getCode68() { - return code68; - } - - /** - * @param code68 the code68 to set - */ - public void setCode68(Float code68) { - this.code68 = code68; - } - - /** - * @return the code69 - */ - public Float getCode69() { - return code69; - } - - /** - * @param code69 the code69 to set - */ - public void setCode69(Float code69) { - this.code69 = code69; - } - - /** - * @return the code70 - */ - public Float getCode70() { - return code70; - } - - /** - * @param code70 the code70 to set - */ - public void setCode70(Float code70) { - this.code70 = code70; - } - - /** - * @return the code71 - */ - public Float getCode71() { - return code71; - } - - /** - * @param code71 the code71 to set - */ - public void setCode71(Float code71) { - this.code71 = code71; - } - - /** - * @return the code72 - */ - public String getCode72() { - return code72; - } - - /** - * @param code72 the code72 to set - */ - public void setCode72(String code72) { - this.code72 = code72; - } - - /** - * @return the code73 - */ - public Float getCode73() { - return code73; - } - - /** - * @param code73 the code73 to set - */ - public void setCode73(Float code73) { - this.code73 = code73; - } - - /** - * @return the code74 - */ - public Float getCode74() { - return code74; - } - - /** - * @param code74 the code74 to set - */ - public void setCode74(Float code74) { - this.code74 = code74; - } - - /** - * @return the code75 - */ - public Float getCode75() { - return code75; - } - - /** - * @param code75 the code75 to set - */ - public void setCode75(Float code75) { - this.code75 = code75; - } - - /** - * @return the code76 - */ - public Float getCode76() { - return code76; - } - - /** - * @param code76 the code76 to set - */ - public void setCode76(Float code76) { - this.code76 = code76; - } - - /** - * @return the code77 - */ - public String getCode77() { - return code77; - } - - /** - * @param code77 the code77 to set - */ - public void setCode77(String code77) { - this.code77 = code77; - } - - /** - * @return the code78 - */ - public Float getCode78() { - return code78; - } - - /** - * @param code78 the code78 to set - */ - public void setCode78(Float code78) { - this.code78 = code78; - } - - /** - * @return the code79 - */ - public Float getCode79() { - return code79; - } - - /** - * @param code79 the code79 to set - */ - public void setCode79(Float code79) { - this.code79 = code79; - } - - /** - * @return the code80 - */ - public Short getCode80() { - return code80; - } - - /** - * @param code80 the code80 to set - */ - public void setCode80(Short code80) { - this.code80 = code80; - } - - /** - * @return the code81 - */ - public Short getCode81() { - return code81; - } - - /** - * @param code81 the code81 to set - */ - public void setCode81(Short code81) { - this.code81 = code81; - } - - /** - * @return the code82 - */ - public Short getCode82() { - return code82; - } - - /** - * @param code82 the code82 to set - */ - public void setCode82(Short code82) { - this.code82 = code82; - } - - /** - * @return the code83 - */ - public Float getCode83() { - return code83; - } - - /** - * @param code83 the code83 to set - */ - public void setCode83(Float code83) { - this.code83 = code83; - } - - /** - * @return the code84 - */ - public Short getCode84() { - return code84; - } - - /** - * @param code84 the code84 to set - */ - public void setCode84(Short code84) { - this.code84 = code84; - } - - /** - * @return the code85 - */ - public Short getCode85() { - return code85; - } - - /** - * @param code85 the code85 to set - */ - public void setCode85(Short code85) { - this.code85 = code85; - } - - /** - * @return the code86 - */ - public Float getCode86() { - return code86; - } - - /** - * @param code86 the code86 to set - */ - public void setCode86(Float code86) { - this.code86 = code86; - } - - /** - * @return the code87 - */ - public Float getCode87() { - return code87; - } - - /** - * @param code87 the code87 to set - */ - public void setCode87(Float code87) { - this.code87 = code87; - } - - /** - * @return the code88 - */ - public Float getCode88() { - return code88; - } - - /** - * @param code88 the code88 to set - */ - public void setCode88(Float code88) { - this.code88 = code88; - } - - /** - * @return the code89 - */ - public Float getCode89() { - return code89; - } - - /** - * @param code89 the code89 to set - */ - public void setCode89(Float code89) { - this.code89 = code89; - } - - /** - * @return the code90 - */ - public Float getCode90() { - return code90; - } - - /** - * @param code90 the code90 to set - */ - public void setCode90(Float code90) { - this.code90 = code90; - } - - /** - * @return the code91 - */ - public Float getCode91() { - return code91; - } - - /** - * @param code91 the code91 to set - */ - public void setCode91(Float code91) { - this.code91 = code91; - } - - /** - * @return the code92 - */ - public Short getCode92() { - return code92; - } - - /** - * @param code92 the code92 to set - */ - public void setCode92(Short code92) { - this.code92 = code92; - } - - /** - * @return the code93 - */ - public Float getCode93() { - return code93; - } - - /** - * @param code93 the code93 to set - */ - public void setCode93(Float code93) { - this.code93 = code93; - } - - /** - * @return the code94 - */ - public Float getCode94() { - return code94; - } - - /** - * @param code94 the code94 to set - */ - public void setCode94(Float code94) { - this.code94 = code94; - } - - /** - * @return the code95 - */ - public Float getCode95() { - return code95; - } - - /** - * @param code95 the code95 to set - */ - public void setCode95(Float code95) { - this.code95 = code95; - } - - /** - * @return the code96 - */ - public Float getCode96() { - return code96; - } - - /** - * @param code96 the code96 to set - */ - public void setCode96(Float code96) { - this.code96 = code96; - } - - /** * Get this observation's geometry. * * @return The geometry for this observation. @@ -2033,7 +2136,7 @@ IDecoderGettable { public Geometry getGeometry() { return location.getGeometry(); } - + /** * Get the geometry latitude. * @@ -2051,7 +2154,7 @@ IDecoderGettable { public Double getLongitude() { return location.getLongitude(); } - + /** * Get the elevation, in meters, of the observing platform or location. * @@ -2060,7 +2163,7 @@ IDecoderGettable { public Integer getElevation() { return location.getElevation(); } - + /** * @return the location */ @@ -2069,34 +2172,19 @@ IDecoderGettable { } /** - * @param location the location to set + * @param location + * the location to set */ public void setLocation(SurfaceObsLocation location) { this.location = location; } -// /** -// * -// * @return -// */ -// public String getNetworkType() { -// return networkType; -// } + @Override + public Amount getValue(String paramName) { + // TODO Auto-generated method stub + return null; + } -// /** -// * -// * @return -// */ -// public void setNetworkType(String type) { -// networkType = type; -// } - - @Override - public Amount getValue(String paramName) { - // TODO Auto-generated method stub - return null; - } - /** * @return the timeObs */ @@ -2118,7 +2206,7 @@ IDecoderGettable { public void setSpatialObject(SurfaceObsLocation loc) { location = loc; } - + /** * */ @@ -2126,10 +2214,10 @@ IDecoderGettable { public SurfaceObsLocation getSpatialObject() { return location; } - + /** - * This class implements IDecoderGettable so return this - * instance. + * This class implements IDecoderGettable so return this instance. + * * @return The reference to this instance. */ @Override @@ -2149,7 +2237,7 @@ IDecoderGettable { } else if (OBS_TEXT.equals(pName)) { retValue = getStationId(); } - + return retValue; } @@ -2157,35 +2245,7 @@ IDecoderGettable { public String[] getStrings(String paramName) { return null; } - -// @Override -// public Amount getValue(String paramName) { -// Amount a = null; -// String pName = PARM_MAP.get(paramName); -// -// if (SFC_TEMP.equals(pName)) { -// a = new Amount(temp, TEMPERATURE_UNIT); -// } else if (SFC_DWPT.equals(pName)) { -// a = new Amount(dwpt, TEMPERATURE_UNIT); -// } else if (SFC_WNDSPD.equals(pName)) { -// a = new Amount(windSpeed, WIND_SPEED_UNIT); -// } else if (SFC_WNDGST.equals(pName)) { -// a = new Amount(windGust, WIND_SPEED_UNIT); -// } else if (SFC_WNDDIR.equals(pName)) { -// a = new Amount(windDirection, WIND_DIR_UNIT); -// } else if (PRES_ALTSG.equals(pName)) { -// a = new Amount(altimeter, PRESSURE_UNIT); -// } else if (STA_LAT.equals(pName)) { -// a = new Amount(getLatitude(), LOCATION_UNIT); -// } else if (STA_LON.equals(pName)) { -// a = new Amount(getLongitude(), LOCATION_UNIT); -// } else if (PRES_SLP.equals(pName)) { -// a = new Amount(seaLevelPressure, PRESSURE_UNIT); -// } -// -// return a; -// } - + /** * */ @@ -2194,113 +2254,112 @@ IDecoderGettable { return null; } - /** - * @param providerId the providerId to set - */ - public void setProviderId(String providerId) { - this.providerId = providerId; - } + /** + * @param providerId + * the providerId to set + */ + public void setProviderId(String providerId) { + this.providerId = providerId; + } - /** - * @return the providerId - */ - public String getProviderId() { - return providerId; - } + /** + * @return the providerId + */ + public String getProviderId() { + return providerId; + } - /** - * @param stationName the stationName to set - */ - public void setStationName(String stationName) { - this.stationName = stationName; - } + /** + * @param stationName + * the stationName to set + */ + public void setStationName(String stationName) { + this.stationName = stationName; + } - /** - * @return the stationName - */ - public String getStationName() { - return stationName; - } + /** + * @return the stationName + */ + public String getStationName() { + return stationName; + } + /** + * @param homeWFO + * the homeWFO to set + */ + public void setHomeWFO(String homeWFO) { + this.homeWFO = homeWFO; + } - /** - * @param homeWFO the homeWFO to set - */ - public void setHomeWFO(String homeWFO) { - this.homeWFO = homeWFO; - } + /** + * @return the homeWFO + */ + public String getHomeWFO() { + return homeWFO; + } - /** - * @return the homeWFO - */ - public String getHomeWFO() { - return homeWFO; - } + /** + * @param reportType + * the reportType to set + */ + public void setReportType(Short reportType) { + this.reportType = reportType; + } - /** - * @param reportType the reportType to set - */ - public void setReportType(Short reportType) { - this.reportType = reportType; - } + /** + * @return the reportType + */ + public Short getReportType() { + return reportType; + } - /** - * @return the reportType - */ - public Short getReportType() { - return reportType; - } + /** + * @param unitsCode + * the unitsCode to set + */ + public void setUnitsCode(Short unitsCode) { + this.unitsCode = unitsCode; + } - /** - * @param unitsCode the unitsCode to set - */ - public void setUnitsCode(Short unitsCode) { - this.unitsCode = unitsCode; - } + /** + * @return the unitsCode + */ + public Short getUnitsCode() { + return unitsCode; + } - /** - * @return the unitsCode - */ - public Short getUnitsCode() { - return unitsCode; - } + /** + * @param code10 + * the code10 to set + */ + public void setCode10(Float code10) { + this.code10 = code10; + } - /** - * @param code10 the code10 to set - */ - public void setCode10(Float code10) { - this.code10 = code10; - } + /** + * @return the code10 + */ + public Float getCode10() { + return code10; + } - /** - * @return the code10 - */ - public Float getCode10() { - return code10; - } + /** + * @param code11 + * the code11 to set + */ + public void setCode11(Float code11) { + this.code11 = code11; + } - /** - * @param code11 the code11 to set - */ - public void setCode11(Float code11) { - this.code11 = code11; - } + /** + * @return the code11 + */ + public Float getCode11() { + return code11; + } - /** - * @return the code11 - */ - public Float getCode11() { - return code11; - } - -// /** -// * @param stationId the stationId to set -// */ -// public void setStationId(String stationId) { -// this.stationId = stationId; -// } - - /** + /** * Get the station identifier for this observation. * * @return the stationId @@ -2309,24 +2368,30 @@ IDecoderGettable { return location.getStationId(); } - /** - * @param rawMessage the rawMessage to set - */ - public void setRawMessage(String rawMessage) { - this.rawMessage = rawMessage; - } + /** + * @param rawMessage + * the rawMessage to set + */ + public void setRawMessage(String rawMessage) { + this.rawMessage = rawMessage; + } + + /** + * @return the rawMessage + */ + public String getRawMessage() { + return rawMessage; + } - /** - * @return the rawMessage - */ - public String getRawMessage() { - return rawMessage; - } @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } -} + @Override + public String getPluginName() { + return "ldadmanual"; + } +} diff --git a/edexOsgi/com.raytheon.edex.plugin.ldadprofiler/src/com/raytheon/edex/plugin/ldadprofiler/common/ProfilerLdadObs.java b/edexOsgi/com.raytheon.edex.plugin.ldadprofiler/src/com/raytheon/edex/plugin/ldadprofiler/common/ProfilerLdadObs.java index 3a5b5117f7..f9455f1d31 100644 --- a/edexOsgi/com.raytheon.edex.plugin.ldadprofiler/src/com/raytheon/edex/plugin/ldadprofiler/common/ProfilerLdadObs.java +++ b/edexOsgi/com.raytheon.edex.plugin.ldadprofiler/src/com/raytheon/edex/plugin/ldadprofiler/common/ProfilerLdadObs.java @@ -68,11 +68,13 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ----------- ---------- ----------- -------------------------- - * 10/07/09 vkorolev Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Oct 07, 2009 vkorolev Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -87,309 +89,305 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ldadprofiler", - indexes = { - @Index(name = "ldadprofiler_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ldadprofiler", indexes = { @Index(name = "ldadprofiler_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class ProfilerLdadObs extends PersistablePluginDataObject implements - ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { + ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { - public static final String PLUGIN_NAME = "ldadprofiler"; + public static final String PLUGIN_NAME = "ldadprofiler"; - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; - public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; + public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; - public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; - private static final HashMap PARM_MAP = new HashMap(); + private static final HashMap PARM_MAP = new HashMap(); - static { - PARM_MAP.put("NLAT", STA_LAT); - PARM_MAP.put("NLON", STA_LON); - PARM_MAP.put("WS", SFC_WNDSPD); - PARM_MAP.put("WD", SFC_WNDDIR); - } + static { + PARM_MAP.put("NLAT", STA_LAT); + PARM_MAP.put("NLON", STA_LON); + PARM_MAP.put("WS", SFC_WNDSPD); + PARM_MAP.put("WD", SFC_WNDDIR); + } - private static final String PRESS = "PRESS"; + private static final String PRESS = "PRESS"; - private static final String AGL = "AGL"; + private static final String AGL = "AGL"; - public static final String PRESS_PARAM_PTRN = ".*:" + PRESS + "=\\d{2,4}"; + public static final String PRESS_PARAM_PTRN = ".*:" + PRESS + "=\\d{2,4}"; - public static final String AGL_PARAM_PTRN = ".*:" + AGL + "=\\d{2,4}"; + public static final String AGL_PARAM_PTRN = ".*:" + AGL + "=\\d{2,4}"; - @Transient - private String parameterName = null; + @Transient + private String parameterName = null; - @DataURI(position = 1) - @XmlAttribute - @DynamicSerializeElement - private Integer reportType; + @DataURI(position = 1) + @XmlAttribute + @DynamicSerializeElement + private Integer reportType; - // Location - @Embedded - @DataURI(position = 2, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; // latitude, longitude, elevation, + // Location + @Embedded + @DataURI(position = 2, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; // latitude, longitude, elevation, - // stationId + // stationId - // Base time in Epoch "seconds since 1970-01-01 00:00:00 UTC" - @Column - @DynamicSerializeElement - @XmlElement - int base_time; + // Base time in Epoch "seconds since 1970-01-01 00:00:00 UTC" + @Column + @DynamicSerializeElement + @XmlElement + int base_time; - // Consensus start time offset from base_time - // "seconds since 2009/10/07 00:00:00 UTC" - @Column - @DynamicSerializeElement - @XmlElement - double start_time_offset; + // Consensus start time offset from base_time + // "seconds since 2009/10/07 00:00:00 UTC" + @Column + @DynamicSerializeElement + @XmlElement + double start_time_offset; - // Consensus end time offset from base_time - // "seconds since 2009/10/07 00:00:00 UTC" - @Column - @DynamicSerializeElement - @XmlElement - double end_time_offset; + // Consensus end time offset from base_time + // "seconds since 2009/10/07 00:00:00 UTC" + @Column + @DynamicSerializeElement + @XmlElement + double end_time_offset; - // nhts Number of heights? - @Column - @DynamicSerializeElement - @XmlElement - int nhts; + // nhts Number of heights? + @Column + @DynamicSerializeElement + @XmlElement + int nhts; - // the level data - @XmlElement - @DynamicSerializeElement - @Transient - private List levels; + // the level data + @XmlElement + @DynamicSerializeElement + @Transient + private List levels; - // The profiler observation time. - @Column - @XmlAttribute - @DynamicSerializeElement - private Calendar timeObs; + // The profiler observation time. + @Column + @XmlAttribute + @DynamicSerializeElement + private Calendar timeObs; - @Column - @XmlAttribute - @DynamicSerializeElement - private String stationName; + @Column + @XmlAttribute + @DynamicSerializeElement + private String stationName; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - /** - * @return the base_time - */ - public int getBase_time() { - return base_time; - } + /** + * @return the base_time + */ + public int getBase_time() { + return base_time; + } - /** - * @param base_time - * the base_time to set - */ - public void setBase_time(int base_time) { - this.base_time = base_time; - } + /** + * @param base_time + * the base_time to set + */ + public void setBase_time(int base_time) { + this.base_time = base_time; + } - public Calendar getTimeObs() { - return timeObs; - } + public Calendar getTimeObs() { + return timeObs; + } - public void setTimeObs(Calendar timeObs) { - this.timeObs = timeObs; - } + public void setTimeObs(Calendar timeObs) { + this.timeObs = timeObs; + } - /** - * @return the start_time_offset - */ - public double getStart_time_offset() { - return start_time_offset; - } + /** + * @return the start_time_offset + */ + public double getStart_time_offset() { + return start_time_offset; + } - /** - * @param start_time_offset - * the start_time_offset to set - */ - public void setStart_time_offset(double start_time_offset) { - this.start_time_offset = start_time_offset; - } + /** + * @param start_time_offset + * the start_time_offset to set + */ + public void setStart_time_offset(double start_time_offset) { + this.start_time_offset = start_time_offset; + } - /** - * @return the end_time_offset - */ - public double getEnd_time_offset() { - return end_time_offset; - } + /** + * @return the end_time_offset + */ + public double getEnd_time_offset() { + return end_time_offset; + } - /** - * @param end_time_offset - * the end_time_offset to set - */ - public void setEnd_time_offset(double end_time_offset) { - this.end_time_offset = end_time_offset; - } + /** + * @param end_time_offset + * the end_time_offset to set + */ + public void setEnd_time_offset(double end_time_offset) { + this.end_time_offset = end_time_offset; + } - /** - * @return the nhts - */ - public int getNhts() { - return nhts; - } + /** + * @return the nhts + */ + public int getNhts() { + return nhts; + } - /** - * @param nhts - * the nhts to set - */ - public void setNhts(int nhts) { - this.nhts = nhts; - } + /** + * @param nhts + * the nhts to set + */ + public void setNhts(int nhts) { + this.nhts = nhts; + } - /** - * @return the levels - */ - public List getLevels() { - return levels; - } + /** + * @return the levels + */ + public List getLevels() { + return levels; + } - /** - * @param levels - * the levels to set - */ - public void setLevels(List levels) { - this.levels = levels; - } + /** + * @param levels + * the levels to set + */ + public void setLevels(List levels) { + this.levels = levels; + } - /** - * @return the pointDataView - */ - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + /** + * @return the pointDataView + */ + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - public ProfilerLdadObs() { - } + public ProfilerLdadObs() { + } - /** - * @param pointDataView - * the pointDataView to set - */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + /** + * @param pointDataView + * the pointDataView to set + */ + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } - // ---------------------------------------------------- + // ---------------------------------------------------- - @Override - public IDecoderGettable getDecoderGettable() { - // TODO Auto-generated method stub - return null; - } + @Override + public IDecoderGettable getDecoderGettable() { + // TODO Auto-generated method stub + return null; + } - @Override - public ISpatialObject getSpatialObject() { - // TODO Auto-generated method stub - return null; - } + @Override + public ISpatialObject getSpatialObject() { + // TODO Auto-generated method stub + return null; + } - @Override - public String getString(String paramName) { - // TODO Auto-generated method stub - return null; - } + @Override + public String getString(String paramName) { + // TODO Auto-generated method stub + return null; + } - @Override - public String[] getStrings(String paramName) { - // TODO Auto-generated method stub - return null; - } + @Override + public String[] getStrings(String paramName) { + // TODO Auto-generated method stub + return null; + } - @Override - public Amount getValue(String paramName) { - // TODO Auto-generated method stub - return null; - } + @Override + public Amount getValue(String paramName) { + // TODO Auto-generated method stub + return null; + } - @Override - public Collection getValues(String paramName) { - // TODO Auto-generated method stub - return null; - } + @Override + public Collection getValues(String paramName) { + // TODO Auto-generated method stub + return null; + } - /** - * @param location - * the location to set - */ - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } + /** + * @param location + * the location to set + */ + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } - /** - * @return the location - */ - public SurfaceObsLocation getLocation() { - return location; - } + /** + * @return the location + */ + public SurfaceObsLocation getLocation() { + return location; + } - /** - * @param stationName - * the stationName to set - */ - public void setStationName(String stationName) { - this.stationName = stationName; - } + /** + * @param stationName + * the stationName to set + */ + public void setStationName(String stationName) { + this.stationName = stationName; + } - /** - * @return the stationName - */ - public String getStationName() { - return stationName; - } + /** + * @return the stationName + */ + public String getStationName() { + return stationName; + } - /** - * @param parameterName - * the parameterName to set - */ - public void setParameterName(String parameterName) { - this.parameterName = parameterName; - } + /** + * @param parameterName + * the parameterName to set + */ + public void setParameterName(String parameterName) { + this.parameterName = parameterName; + } - /** - * @return the parameterName - */ - public String getParameterName() { - return parameterName; - } + /** + * @return the parameterName + */ + public String getParameterName() { + return parameterName; + } - /** - * @param reportType - * the reportType to set - */ - public void setReportType(Integer reportType) { - this.reportType = reportType; - } + /** + * @param reportType + * the reportType to set + */ + public void setReportType(Integer reportType) { + this.reportType = reportType; + } - /** - * @return the reportType - */ - public Integer getReportType() { - return reportType; - } + /** + * @return the reportType + */ + public Integer getReportType() { + return reportType; + } @Override @Column @@ -397,4 +395,9 @@ public class ProfilerLdadObs extends PersistablePluginDataObject implements public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "ldadprofiler"; + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/ModelSoundingDecoder.java b/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/ModelSoundingDecoder.java index 25a3ec5f55..e5298d6f6f 100644 --- a/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/ModelSoundingDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/ModelSoundingDecoder.java @@ -59,21 +59,24 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080303 1026 jkorman Initial implementation. - * 20080408 1039 jkorman Added traceId for tracing data. - * 11/25/08 #1684 chammack Camel Refactor - * 04/29/13 #1861 bkowal Create a separate Point Data Container for - * every record so each forecast hour will - * receive a unique hdf5 file. - * 07/03/13 #2161 bkowal Store and retrieve the Point Data Containers - * by forecast hour and reftime when completing - * a decode operation. Overrode default - * Point Data Container size. - * 07/16/13 #2161 bkowal Store the records in a container that will - * be persisted every X (configurable) seconds - * by a timer. The timer is started during spring - * initialization and destroyed during spring - * container destruction. + * Mar 03, 2008 1026 jkorman Initial implementation. + * Apr 08, 2008 1039 jkorman Added traceId for tracing data. + * Nov 25, 2008 1684 chammack Camel Refactor + * Apr 29, 2013 1861 bkowal Create a separate Point Data Container + * for every record so each forecast hour + * will receive a unique hdf5 file. + * Jul 03, 2013 2161 bkowal Store and retrieve the Point Data + * Containers by forecast hour and reftime + * when completing a decode operation. + * Overrode default Point Data Container + * size. + * Jul 16, 2013 2161 bkowal Store the records in a container that + * will be persisted every X (configurable) + * seconds by a timer. The timer is started + * during spring initialization and + * destroyed during spring container + * destruction. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -219,7 +222,6 @@ public class ModelSoundingDecoder extends AbstractDecoder implements soundingTemporalData); if (soundingData != null) { soundingData.setTraceId(traceId); - soundingData.setPluginName(PLUGIN_NAME); try { soundingData.constructDataURI(); } catch (PluginException e) { diff --git a/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/common/SoundingSite.java b/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/common/SoundingSite.java index b0e832e9ad..201c62ea29 100644 --- a/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/common/SoundingSite.java +++ b/edexOsgi/com.raytheon.edex.plugin.modelsounding/src/com/raytheon/edex/plugin/modelsounding/common/SoundingSite.java @@ -62,11 +62,13 @@ import com.vividsolutions.jts.geom.Geometry; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080303 1026 jkorman Initial implementation. - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Mar 03, 2008 1026 jkorman Initial implementation. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -911,10 +913,16 @@ public class SoundingSite extends PersistablePluginDataObject implements public void setPointDataView(PointDataView pointDataView) { this.pointDataView = pointDataView; } + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "modelsounding"; + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.edex.plugin.obs/META-INF/MANIFEST.MF index 7c388cd7e5..17b41129bd 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.edex.plugin.obs/META-INF/MANIFEST.MF @@ -7,7 +7,6 @@ Eclipse-RegisterBuddy: com.raytheon.edex.common, com.raytheon.uf.common.serializ Bundle-Vendor: RAYTHEON Export-Package: com.raytheon.edex.plugin.obs, com.raytheon.edex.plugin.obs.mesowest, - com.raytheon.edex.plugin.obs.mesowest.util, com.raytheon.edex.plugin.obs.metar, com.raytheon.edex.plugin.obs.metar.util, com.raytheon.edex.uengine.tasks.obs diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject b/edexOsgi/com.raytheon.edex.plugin.obs/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject deleted file mode 100644 index 9ec19727e4..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.obs/META-INF/services/com.raytheon.uf.common.serialization.ISerializableObject +++ /dev/null @@ -1 +0,0 @@ -com.raytheon.edex.plugin.obs.mesowest.MesowestRecord \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest.xml index cd52a3a7e1..5bec4f52ae 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.obs/res/spring/obs-ingest.xml @@ -3,9 +3,7 @@ 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"> - - - + diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/ObsDecoder.java b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/ObsDecoder.java index d6b488f34c..f53857e922 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/ObsDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/ObsDecoder.java @@ -20,30 +20,6 @@ package com.raytheon.edex.plugin.obs; -/** - * Decoder implementation for observation data types. This class provides a - * wrapper in order to select the correct decoder based on the data type - * - *
- *                     
- * SOFTWARE HISTORY
- * 
- * Date          Ticket#     Engineer    Description
- * -----------  ----------  ----------- --------------------------
- * 4/27/07      199         bphillip    Initial creation
- * 07/31/2007          411  jkorman     Added addition logging
- * 08/10/2007          379  jkorman     Added disposal behavior.
- * 20071217            453  jkorman     Added code to check for duplicate obs.
- * 20080314            995  jkorman     Changed setDecoderStrategy to check for
- *                                      empty data.
- * 20080408           1039  jkorman     Added traceId for tracing data.  
- * Mar 19, 2013       1785  bgonzale    Added performance status handler and added
- *                                      status to decode.
- * 
- * - * @author bphillip - * @version 1 - */ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -58,24 +34,40 @@ import com.raytheon.uf.common.time.util.ITimer; import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.edex.wmo.message.WMOHeader; +/** + * Decoder implementation for observation data types. This class provides a + * wrapper in order to select the correct decoder based on the data type + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * -----------  ----------  ----------- --------------------------
+ * Apr 27, 2007 199         bphillip    Initial creation
+ * Jul 31, 2007 411         jkorman     Added addition logging
+ * Aug 10, 2007 379         jkorman     Added disposal behavior.
+ * Dec 17, 2007 453         jkorman     Added code to check for duplicate obs.
+ * Mar 14, 2008 995         jkorman     Changed setDecoderStrategy to check for
+ *                                      empty data.
+ * Apr 08, 2008 1039        jkorman     Added traceId for tracing data.  
+ * Mar 19, 2013 1785        bgonzale    Added performance status handler and added
+ *                                      status to decode.
+ * Aug 30, 2013 2298        rjpeter     Make getPluginName abstract
+ * 
+ * + * @author bphillip + * @version 1 + */ public class ObsDecoder extends AbstractDecoder { /** The logger */ - private Log logger = LogFactory.getLog(getClass()); - - private final String PLUGIN_NAME; + private final Log logger = LogFactory.getLog(getClass()); private final IPerformanceStatusHandler perfLog = PerformanceStatus .getHandler("Obs:"); private String traceId = null; - /** - * Required empty constructor. - */ - public ObsDecoder(String pluginName) { - PLUGIN_NAME = pluginName; - } - /** * * @return A decoded data record. @@ -139,13 +131,13 @@ public class ObsDecoder extends AbstractDecoder { if ('S' == header.getT1()) { switch (header.getT2()) { case 'A': { - decoder = new MetarDecoder(PLUGIN_NAME); - ((MetarDecoder) decoder).setTraceId(traceId); + decoder = new MetarDecoder(); + decoder.setTraceId(traceId); break; } case 'P': { - decoder = new MetarDecoder(PLUGIN_NAME); - ((MetarDecoder) decoder).setTraceId(traceId); + decoder = new MetarDecoder(); + decoder.setTraceId(traceId); break; } } diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/MesowestDecoder.java b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/MesowestDecoder.java deleted file mode 100644 index 3bf446464c..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/MesowestDecoder.java +++ /dev/null @@ -1,150 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ - -package com.raytheon.edex.plugin.obs.mesowest; - -import java.text.DecimalFormat; - -import com.raytheon.edex.esb.Headers; -import com.raytheon.edex.exception.DecoderException; -import com.raytheon.edex.plugin.AbstractDecoder; -import com.raytheon.edex.util.Util; -import com.raytheon.uf.common.dataplugin.PluginDataObject; -import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.edex.decodertools.core.DecoderTools; -import com.raytheon.uf.edex.decodertools.time.TimeTools; - -/** - * Decoder implementation for mesowest plugin - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date       	Ticket#		Engineer	Description
- * ------------	----------	-----------	--------------------------
- * 02/14/06		139			bphillip	Initial creation	
- * 11/11/08     1684        chammack    Refactored to camel interfaces
- * 
- * 
- * - * @author bphillip - * @version 1 - */ - -public class MesowestDecoder extends AbstractDecoder { - - private static final DecimalFormat DECIMALTENTHS = new DecimalFormat("#.#"); - - private static final DecimalFormat WHOLENUMBER = new DecimalFormat("#"); - - /** - * Constructor - * - * @throws DecoderException - */ - public MesowestDecoder() throws DecoderException { - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.edex.plugin.IBinaryDecoder#decode(byte[]) - */ - public PluginDataObject[] decode(byte[] data, Headers headers) - throws DecoderException { - - byte[] messageData = null; - - String theMessage = new String(messageData); - - MesowestRecord record = new MesowestRecord(); - record.setMessageData(theMessage); - record.setPluginName("obs"); - record.setReportType("MESOWEST"); - record.setMessageData(theMessage); - - String[] mwObs = theMessage.split(","); - try { - if (mwObs.length >= 7) { - record.setStationID(mwObs[1]); - String timeGroup = mwObs[6].substring(6, 8) - + mwObs[6].substring(9, 13) + "Z"; - String fileName = null; - if (headers != null) { - fileName = (String) headers - .get(DecoderTools.INGEST_FILE_NAME); - } - record.setTimeObs(TimeTools - .findCurrentTime(timeGroup, fileName)); - record.setDataTime(new DataTime(Util - .findReferenceTime(timeGroup))); - record.setRefHour(Util.findReferenceHour(timeGroup)); - } - // Only want the observations in columns 7 through 15 - int mwArrayLength = mwObs.length < 17 ? mwObs.length : 17; - for (int i = 7; i < mwArrayLength; i++) { - if (i == 7 && mwObs[7].length() > 0) { - double temp = calculateCelsius(mwObs[7]); - record.setTemperature(Integer.parseInt(WHOLENUMBER - .format(temp))); - record.setTempFromTenths(Float.parseFloat(DECIMALTENTHS - .format(temp))); - } else if (i == 9 && mwObs[9].length() > 0) { - double wSpeed = Double.valueOf(mwObs[9].trim()) - .doubleValue(); - record.setWindSpeed(Integer.parseInt(WHOLENUMBER - .format(wSpeed))); - } else if (i == 10 && mwObs[10].length() > 0) { - double wGust = Double.valueOf(mwObs[10].trim()) - .doubleValue(); - record.setWindGust(Integer.parseInt(WHOLENUMBER - .format(wGust))); - } else if (i == 11 && mwObs[11].length() > 0) { - record.setWindDir(mwObs[11]); - } else if (i == 13 && mwObs[13].length() > 0) { - double dewp = calculateCelsius(mwObs[13]); - record.setDewPoint(Integer.parseInt(WHOLENUMBER - .format(dewp))); - record.setDewPointFromTenths(Float.parseFloat(DECIMALTENTHS - .format(dewp))); - } else if (i == 15 && mwObs[15].length() > 0) { - record.setSeaLevelPress(Float.parseFloat(mwObs[15])); - } else if (i == 16 && mwObs[16].length() > 0) { - record.setAltimeter(Float.parseFloat(mwObs[16])); - } - } - - } catch (Exception e) { - throw new DecoderException("Unable to decode Mesowest data", e); - } - - if (record == null) - return new PluginDataObject[0]; - return new PluginDataObject[] { record }; - } - - private double calculateCelsius(String tempString) { - double temp = Double.valueOf(tempString.trim()).doubleValue(); - double tempC = (temp - 32.0) * (5.0 / 9.0); - return tempC; - } - -} diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/MesowestRecord.java b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/MesowestRecord.java deleted file mode 100644 index 556dd016b9..0000000000 --- a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/mesowest/MesowestRecord.java +++ /dev/null @@ -1,361 +0,0 @@ -/** - * This software was developed and / or modified by Raytheon Company, - * pursuant to Contract DG133W-05-CQ-1067 with the US Government. - * - * U.S. EXPORT CONTROLLED TECHNICAL DATA - * This software product contains export-restricted data whose - * export/transfer/disclosure is restricted by U.S. law. Dissemination - * to non-U.S. persons whether in the United States or abroad requires - * an export license or other authorization. - * - * Contractor Name: Raytheon Company - * Contractor Address: 6825 Pine Street, Suite 340 - * Mail Stop B8 - * Omaha, NE 68106 - * 402.291.0100 - * - * See the AWIPS II Master Rights File ("Master Rights File.pdf") for - * further licensing information. - **/ - -package com.raytheon.edex.plugin.obs.mesowest; - -import java.util.Calendar; - -import javax.persistence.Access; -import javax.persistence.AccessType; -import javax.persistence.Column; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -import com.raytheon.uf.common.dataplugin.IDecoderGettable; -import com.raytheon.uf.common.dataplugin.PluginDataObject; -import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; -import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; - -/** - * Record implementation for mesowest plugin - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date       	Ticket#		Engineer	Description
- * ------------	----------	-----------	--------------------------
- * 2/14/2007	139			Phillippe	Initial creation	
- * 20071129            472  jkorman     Added IDecoderGettable interface.
- * May 07, 2013	1869      	bsteffen   	Remove dataURI column from
- *                                      PluginDataObject.
- * 
- * 
- * 
- * - * @author bphillip - * @version 1 - */ -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) -@DynamicSerialize -public class MesowestRecord extends PluginDataObject { - - private static final long serialVersionUID = 1L; - - /** A string denoting the report type */ - @XmlAttribute - @DynamicSerializeElement - private String reportType; - - /** A string denoting the reporting station */ - @XmlAttribute - @DynamicSerializeElement - private String stationID; - - /** A string denoting the time of observation */ - @XmlElement - @DynamicSerializeElement - private Calendar timeObs; - - /** A string denoting the temperature in degrees Celsius */ - @XmlAttribute - @DynamicSerializeElement - private Integer temperature; - - /** A string denoting the current temperature in tenths of degrees Celsius */ - @XmlAttribute - @DynamicSerializeElement - private Float tempFromTenths; - - /** A string denoting the wind direction in degrees from north */ - @XmlAttribute - @DynamicSerializeElement - private String windDir; - - /** A string denoting the wind speed in knots */ - @XmlAttribute - @DynamicSerializeElement - private Integer windSpeed; - - /** A string denoting the wind gusts in knots */ - @XmlAttribute - @DynamicSerializeElement - private Integer windGust; - - /** A string denoting the current dew point in degrees Celsius */ - @XmlAttribute - @DynamicSerializeElement - private Integer dewPoint; - - /** A string denoting the current dew point in tenths of degrees Celsius */ - @XmlAttribute - @DynamicSerializeElement - private Float dewPointFromTenths; - - /** A string denoting the altimeter reading in in/Hg */ - @XmlAttribute - @DynamicSerializeElement - private Float altimeter; - - /** A string denoting the sea level pressure in millibars */ - @XmlAttribute - @DynamicSerializeElement - private Float seaLevelPress; - - /** The reference hour * */ - @XmlElement - @DynamicSerializeElement - private Calendar refHour; - - /** - * No argument constructor - * - */ - public MesowestRecord() { - } - - /** - * Constructs a mesowest record from a dataURI - * - * @param uri - * The dataURI - * @param tableDef - * The table definition associated with this class - */ - public MesowestRecord(String uri) { - super(uri); - } - - /** - * @return the reportType - */ - public String getReportType() { - return reportType; - } - - /** - * @param reportType - * the reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } - - /** - * @return the altimeter - */ - public Float getAltimeter() { - return altimeter; - } - - /** - * @param altimeter - * the altimeter to set - */ - public void setAltimeter(Float altimeter) { - this.altimeter = altimeter; - } - - /** - * @return the dewPoint - */ - public Integer getDewPoint() { - return dewPoint; - } - - /** - * @param dewPoint - * the dewPoint to set - */ - public void setDewPoint(Integer dewPoint) { - this.dewPoint = dewPoint; - } - - /** - * @return the dewPointFromTenths - */ - public Float getDewPointFromTenths() { - return dewPointFromTenths; - } - - /** - * @param dewPointFromTenths - * the dewPointFromTenths to set - */ - public void setDewPointFromTenths(Float dewPointFromTenths) { - this.dewPointFromTenths = dewPointFromTenths; - } - - /** - * @return the refHour - */ - public Calendar getRefHour() { - return refHour; - } - - /** - * @param refHour - * the refHour to set - */ - public void setRefHour(Calendar refHour) { - this.refHour = refHour; - } - - /** - * @return the seaLevelPress - */ - public Float getSeaLevelPress() { - return seaLevelPress; - } - - /** - * @param seaLevelPress - * the seaLevelPress to set - */ - public void setSeaLevelPress(Float seaLevelPress) { - this.seaLevelPress = seaLevelPress; - } - - /** - * @return the stationID - */ - public String getStationID() { - return stationID; - } - - /** - * @param stationID - * the stationID to set - */ - public void setStationID(String stationID) { - this.stationID = stationID; - } - - /** - * @return the temperature - */ - public Integer getTemperature() { - return temperature; - } - - /** - * @param temperature - * the temperature to set - */ - public void setTemperature(Integer temperature) { - this.temperature = temperature; - } - - /** - * @return the tempFromTenths - */ - public Float getTempFromTenths() { - return tempFromTenths; - } - - /** - * @param tempFromTenths - * the tempFromTenths to set - */ - public void setTempFromTenths(Float tempFromTenths) { - this.tempFromTenths = tempFromTenths; - } - - /** - * @return the timeObs - */ - public Calendar getTimeObs() { - return timeObs; - } - - /** - * @param timeObs - * the timeObs to set - */ - public void setTimeObs(Calendar timeObs) { - this.timeObs = timeObs; - } - - /** - * @return the windDir - */ - public String getWindDir() { - return windDir; - } - - /** - * @param windDir - * the windDir to set - */ - public void setWindDir(String windDir) { - this.windDir = windDir; - } - - /** - * @return the windGust - */ - public Integer getWindGust() { - return windGust; - } - - /** - * @param windGust - * the windGust to set - */ - public void setWindGust(Integer windGust) { - this.windGust = windGust; - } - - /** - * @return the windSpeed - */ - public Integer getWindSpeed() { - return windSpeed; - } - - /** - * @param windSpeed - * the windSpeed to set - */ - public void setWindSpeed(Integer windSpeed) { - this.windSpeed = windSpeed; - } - - /** - * Get the IDecoderGettable reference for this record. - * - * @return The IDecoderGettable reference for this record. Null for this - * class. - */ - public IDecoderGettable getDecoderGettable() { - return null; - } - - @Override - @Column - @Access(AccessType.PROPERTY) - public String getDataURI() { - return super.getDataURI(); - } -} diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarDecoder.java b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarDecoder.java index 357d7bd238..fd0f96eed5 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarDecoder.java @@ -54,29 +54,30 @@ import com.vividsolutions.jts.geom.impl.CoordinateArraySequence; * * SOFTWARE HISTORY * - * ate Ticket# Engineer Description - * ----------- ---------- ----------- -------------------------- - * 2/14/07 139 bphillip Initial creation - * 20071029 505 jkorman Changed setting of DataTime from refhour + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Feb 14, 2007 139 bphillip Initial creation + * Oct 29, 2007 505 jkorman Changed setting of DataTime from refhour * to observation time. - * 20071128 575 jkorman Added future obs time threshold check in + * Nov 28, 2007 575 jkorman Added future obs time threshold check in * decode. - * 12/07/07 452 bphillip Retrieve lat/lon info from station table - * 12/17/07 628 bphillip Discarding data with no station info - * 20071217 453 jkorman Major restructure of the decode method + * Dec 07, 2007 452 bphillip Retrieve lat/lon info from station table + * Dec 17, 2007 628 bphillip Discarding data with no station info + * Dec 17, 2007 453 jkorman Major restructure of the decode method * to ensure that all sections are decoded * properly. Added cleanMessage method. - * 20071218 453 jkorman Added metric winds and visibility. - * 20071221 665 jkorman Modified metric vis to ensure it is not + * Dec 18, 2007 453 jkorman Added metric winds and visibility. + * Dec 21, 2007 665 jkorman Modified metric vis to ensure it is not * decoding alstg data. Added checks for * NSC, NCD, and CAVOK. Added checks for * metric sector vis. - * 20080102 667 jkorman Added code to properly decode/store clear - * sky conditions. - * 20080116 798 jkorman Changed logging levels. - * 20080414 996 jkorman Rewrote sky cover decode section to handle - * CB/TCU and /// data. - * 11/11/08 1684 chammack Camel refactor. + * Jan 02, 2008 667 jkorman Added code to properly decode/store + * clear sky conditions. + * Jan 16, 2008 798 jkorman Changed logging levels. + * Apr 14, 2008 996 jkorman Rewrote sky cover decode section to + * handle CB/TCU and /// data. + * Nov 11, 2008 1684 chammack Camel refactor. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author bphillip @@ -185,8 +186,6 @@ public class MetarDecoder extends AbstractDecoder { public static final Pattern SUNSHINE = Pattern .compile("(\\b)98(\\d{3}|///)"); - private final String PLUGIN_NAME; - private boolean useMockInfo = false; private ObStation mockInfo = null; @@ -195,8 +194,7 @@ public class MetarDecoder extends AbstractDecoder { private String traceId = null; - public MetarDecoder(String pluginName) throws DecoderException { - PLUGIN_NAME = pluginName; + public MetarDecoder() { VIS_PARSER = new VisibilityParser(); } @@ -924,7 +922,6 @@ public class MetarDecoder extends AbstractDecoder { record.setSunshine(value); } - record.setPluginName(PLUGIN_NAME); record.constructDataURI(); record.setWmoHeader(sep.getWMOHeader().getWmoHeader()); @@ -1008,7 +1005,7 @@ public class MetarDecoder extends AbstractDecoder { StringBuilder sb = null; if (data != null) { sb = new StringBuilder(data); - for (int i = 0; i < sb.length() - 1; i++) { + for (int i = 0; i < (sb.length() - 1); i++) { if (sb.charAt(i) == '0') { sb.setCharAt(i, ' '); } diff --git a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarPointDataTransform.java b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarPointDataTransform.java index 927378c2ff..8ca48f7421 100644 --- a/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarPointDataTransform.java +++ b/edexOsgi/com.raytheon.edex.plugin.obs/src/com/raytheon/edex/plugin/obs/metar/MetarPointDataTransform.java @@ -59,6 +59,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * dimensioned size. * May 09, 2013 1869 bsteffen Modified D2D time series of point data to * work without dataURI. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -68,7 +69,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; public class MetarPointDataTransform { - public static final String ALTIMETER = "altimeter"; + public static final String ALTIMETER = "altimeter"; public static final String SEA_LEVEL_PRESS = "seaLevelPress"; @@ -232,8 +233,9 @@ public class MetarPointDataTransform { Map pointMap = new HashMap(); for (PluginDataObject p : pdo) { - if (!(p instanceof MetarRecord)) + if (!(p instanceof MetarRecord)) { continue; + } File f = this.dao.getFullFilePath(p); PointDataContainer pdc = pointMap.get(f); @@ -254,7 +256,7 @@ public class MetarPointDataTransform { MetarRecord record) { PointDataView pdv = container.append(); - if (record.getCorrection() != null + if ((record.getCorrection() != null) && record.getCorrection().equals("COR")) { pdv.setInt(CORRECTION, 1); } else { @@ -272,12 +274,12 @@ public class MetarPointDataTransform { if (record.getSkyCoverage() != null) { int maxSize = container.getDescription(SKY_COVER) - .getDimensionAsInt(); + .getDimensionAsInt(); record.sort(record.getSkyCoverage()); Iterator scIterator = record.getSkyCoverage().iterator(); int i = 0; while (scIterator.hasNext()) { - if(i >= maxSize) { + if (i >= maxSize) { break; } // TODO: storing duplicate info like this, needs to be resolved @@ -285,8 +287,9 @@ public class MetarPointDataTransform { if (sc.getType() != null) { StringBuffer scBuffer = new StringBuffer(); scBuffer.append(sc.getType()); - if (sc.getGenus() != null) + if (sc.getGenus() != null) { scBuffer.append(sc.getGenus()); + } pdv.setString(SKY_COVER, scBuffer.toString(), i); if (sc.getType() != null) { @@ -346,7 +349,7 @@ public class MetarPointDataTransform { pdv.setFloat(SNOWFALL6_HOUR, record.getSnowFall_6Hours()); pdv.setInt(SUNSHINE, record.getSunshine()); - if (record.getWindDir() != null + if ((record.getWindDir() != null) && !record.getWindDir().equalsIgnoreCase("VRB")) { pdv.setFloat("windDir", Float.parseFloat(record.getWindDir())); } @@ -415,7 +418,6 @@ public class MetarPointDataTransform { mr.setPressChange3Hour(pdv.getNumber(PRESS_CHANGE3_HOUR).floatValue()); mr.setPressChangeChar(pdv.getString(PRESS_CHANGE_CHAR)); - mr.setPluginName("obs"); mr.setPrecip1Hour(pdv.getNumber(PRECIP1_HOUR).floatValue()); mr.setPrecip3Hour(pdv.getNumber(PRECIP3_HOUR).floatValue()); mr.setPrecip6Hour(pdv.getNumber(PRECIP6_HOUR).floatValue()); @@ -427,7 +429,7 @@ public class MetarPointDataTransform { int i = 0; Set scList = new HashSet(); for (String s : scType) { - if (s != null && !s.equals("")) { + if ((s != null) && !s.equals("")) { SkyCover skyCover = new SkyCover(); skyCover.setType(s); diff --git a/edexOsgi/com.raytheon.edex.plugin.pirep/src/com/raytheon/edex/plugin/pirep/PirepDecoder.java b/edexOsgi/com.raytheon.edex.plugin.pirep/src/com/raytheon/edex/plugin/pirep/PirepDecoder.java index dd4922a752..8d8c3f6f66 100644 --- a/edexOsgi/com.raytheon.edex.plugin.pirep/src/com/raytheon/edex/plugin/pirep/PirepDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.pirep/src/com/raytheon/edex/plugin/pirep/PirepDecoder.java @@ -59,10 +59,11 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080103 384 jkorman Initial Coding. - * 20080128 861 jkorman Add pirep layer data. - * 20080408 1039 jkorman Added traceId for tracing data. - * 11/13/08 1684 chammack Camel Refactor + * Jan 03, 2008 384 jkorman Initial Coding. + * Jan 28, 2008 861 jkorman Add pirep layer data. + * Apr 08, 2008 1039 jkorman Added traceId for tracing data. + * Nov 13, 2008 1684 chammack Camel Refactor + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author jkorman @@ -108,7 +109,6 @@ public class PirepDecoder extends AbstractDecoder { if (report != null) { report.setTraceId(traceId); - report.setPluginName(PLUGIN_NAME); try { report.constructDataURI(); } catch (PluginException e) { @@ -181,8 +181,7 @@ public class PirepDecoder extends AbstractDecoder { record.setHorzVisibility(parser.getHorxVisibility()); // Collect the decoded icing flight conditions data - List icing = parser - .getIcingLayers(); + List icing = parser.getIcingLayers(); if (icing != null) { PirepLayerData iceLayer = null; for (AircraftFlightCondition layer : icing) { @@ -250,7 +249,7 @@ public class PirepDecoder extends AbstractDecoder { } if (traceIdx >= 0) { newTrace = new StackTraceElement[traceIdx + 1]; - for (int j = 0; j < traceIdx + 1; j++) { + for (int j = 0; j < (traceIdx + 1); j++) { newTrace[j] = trace[j]; } e.setStackTrace(newTrace); diff --git a/edexOsgi/com.raytheon.edex.plugin.poessounding/src/com/raytheon/edex/plugin/poessounding/POESSoundingDecoder.java b/edexOsgi/com.raytheon.edex.plugin.poessounding/src/com/raytheon/edex/plugin/poessounding/POESSoundingDecoder.java index 52f7e87a87..9bf246cfb8 100644 --- a/edexOsgi/com.raytheon.edex.plugin.poessounding/src/com/raytheon/edex/plugin/poessounding/POESSoundingDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.poessounding/src/com/raytheon/edex/plugin/poessounding/POESSoundingDecoder.java @@ -57,6 +57,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * Mar 03, 2008 1026 jkorman Initial implementation. * Apr 08, 2008 1039 jkorman Added traceId for tracing data. * May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -70,7 +71,7 @@ public class POESSoundingDecoder extends AbstractDecoder implements public static final String PLUGIN_NAME = "poessounding"; /** The logger */ - private Log logger = LogFactory.getLog(getClass()); + private final Log logger = LogFactory.getLog(getClass()); private PointDataDescription pdd; @@ -118,7 +119,7 @@ public class POESSoundingDecoder extends AbstractDecoder implements PluginDataObject[] decodedData = null; - if (data != null && data.length > 0) { + if ((data != null) && (data.length > 0)) { WMOHeader wmoHeader = new WMOHeader(data, headers); @@ -144,7 +145,6 @@ public class POESSoundingDecoder extends AbstractDecoder implements container); if (soundingData != null) { soundingData.setTraceId(traceId); - soundingData.setPluginName(PLUGIN_NAME); pdoList.add(soundingData); } } diff --git a/edexOsgi/com.raytheon.edex.plugin.profiler/src/com/raytheon/edex/plugin/profiler/ProfilerDecoder.java b/edexOsgi/com.raytheon.edex.plugin.profiler/src/com/raytheon/edex/plugin/profiler/ProfilerDecoder.java index 475f038dc4..b82e388f07 100644 --- a/edexOsgi/com.raytheon.edex.plugin.profiler/src/com/raytheon/edex/plugin/profiler/ProfilerDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.profiler/src/com/raytheon/edex/plugin/profiler/ProfilerDecoder.java @@ -56,8 +56,9 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080303 969 jkorman Initial implementation. - * 20080408 1039 jkorman Added traceId for tracing data. + * Mar 03, 2008 969 jkorman Initial implementation. + * Apr 08, 2008 1039 jkorman Added traceId for tracing data. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -71,7 +72,7 @@ public class ProfilerDecoder extends AbstractDecoder implements public static final String PLUGIN_NAME = "profiler"; /** The logger */ - private Log logger = LogFactory.getLog(getClass()); + private final Log logger = LogFactory.getLog(getClass()); private PointDataDescription pdd; @@ -131,7 +132,7 @@ public class ProfilerDecoder extends AbstractDecoder implements PluginDataObject[] decodedData = null; - if (data != null && data.length > 0) { + if ((data != null) && (data.length > 0)) { WMOHeader wmoHeader = new WMOHeader(data, headers); if ((wmoHeader != null) && (wmoHeader.isValid())) { @@ -160,7 +161,6 @@ public class ProfilerDecoder extends AbstractDecoder implements container, traceId); if (soundingData != null) { soundingData.setTraceId(traceId); - soundingData.setPluginName(PLUGIN_NAME); try { soundingData.constructDataURI(); PointDataView view = soundingData diff --git a/edexOsgi/com.raytheon.edex.plugin.radar/src/com/raytheon/edex/plugin/radar/RadarDecoder.java b/edexOsgi/com.raytheon.edex.plugin.radar/src/com/raytheon/edex/plugin/radar/RadarDecoder.java index fddb62a83a..dfa8f257f0 100644 --- a/edexOsgi/com.raytheon.edex.plugin.radar/src/com/raytheon/edex/plugin/radar/RadarDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.radar/src/com/raytheon/edex/plugin/radar/RadarDecoder.java @@ -87,12 +87,15 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 2/14/2007 139 Phillippe Initial check-in. Refactor of initial implementation. + * Feb 14, 2007 139 Phillippe Initial check-in. Refactor of initial + * implementation. * Dec 17, 2007 600 bphillip Added dao pool usage - * Dec 03, 2010 2235 cjeanbap EDEXUtility.sendMessageAlertViz() signature changed. + * Dec 03, 2010 2235 cjeanbap EDEXUtility.sendMessageAlertViz() + * signature changed. * Mar 19, 2013 1804 bsteffen Optimize decoder performance. - * Mar 19, 2013 1785 bgonzale Added performance status handler and added status - * to decode. + * Mar 19, 2013 1785 bgonzale Added performance status handler and + * added status to decode. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author bphillip @@ -130,7 +133,7 @@ public class RadarDecoder extends AbstractDecoder { private String traceId = ""; - private RadarInfoDict infoDict; + private final RadarInfoDict infoDict; private RadarStationDao radarStationDao = new RadarStationDao(); @@ -541,7 +544,6 @@ public class RadarDecoder extends AbstractDecoder { private void finalizeRecord(RadarRecord record) throws PluginException { record.setTraceId(traceId); - record.setPluginName("radar"); record.constructDataURI(); record.setInsertTime(TimeTools.getSystemCalendar()); // for GSM, we want all the messages as they have the possibility of @@ -562,7 +564,7 @@ public class RadarDecoder extends AbstractDecoder { if (symbologyBlock == null) { return; } - + int packetsKept = 0; List packetsInLyrs = new ArrayList(); @@ -587,9 +589,9 @@ public class RadarDecoder extends AbstractDecoder { GenericDataPacket genericPacket = (GenericDataPacket) packet; List components = genericPacket .getComponents(); - if (components != null - && components.size() == 1 - && components.get(0).getComponentType() == ComponentType.RADIAL) { + if ((components != null) + && (components.size() == 1) + && (components.get(0).getComponentType() == ComponentType.RADIAL)) { processRadialComponent(record, (RadialComponent) components.get(0)); } else { @@ -698,7 +700,7 @@ public class RadarDecoder extends AbstractDecoder { ClusterTask task = ClusterLockUtils.lookupLock(lockname, record.getIcao()); String formatStatus = RadarUtil.formatBits(messagePart, constants); - if (task == null || task.getExtraInfo() == null) { + if ((task == null) || (task.getExtraInfo() == null)) { ClusterLockUtils.lock(lockname, record.getIcao(), formatStatus, 30, true); EDEXUtil.sendMessageAlertViz(Priority.INFO, @@ -711,7 +713,7 @@ public class RadarDecoder extends AbstractDecoder { } if (task.getExtraInfo() != null) { - if (formatStatus != null + if ((formatStatus != null) && !formatStatus.equals(task.getExtraInfo().trim())) { String details = ""; String temp = ""; diff --git a/edexOsgi/com.raytheon.edex.plugin.radar/src/com/raytheon/edex/plugin/radar/dao/RadarDao.java b/edexOsgi/com.raytheon.edex.plugin.radar/src/com/raytheon/edex/plugin/radar/dao/RadarDao.java index c20aa289b0..cf7c22c7d5 100644 --- a/edexOsgi/com.raytheon.edex.plugin.radar/src/com/raytheon/edex/plugin/radar/dao/RadarDao.java +++ b/edexOsgi/com.raytheon.edex.plugin.radar/src/com/raytheon/edex/plugin/radar/dao/RadarDao.java @@ -27,8 +27,9 @@ package com.raytheon.edex.plugin.radar.dao; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 02/06/09 1990 bphillip Initial creation + * Feb 06, 2009 1990 bphillip Initial creation * Mar 18, 2013 1804 bsteffen Reduce useless data stored in radar hdf5 + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -120,7 +121,8 @@ public class RadarDao extends PluginDao { dataStore.addDataRecord(rec, sp); } - if (radarRec.getThresholds() != null && radarRec.getProductCode() != 2) { + if ((radarRec.getThresholds() != null) + && (radarRec.getProductCode() != 2)) { IDataRecord rec = new ShortDataRecord( RadarStoredData.THRESHOLDS_ID, radarRec.getDataURI(), radarRec.getThresholds(), 1, new long[] { 16 }); @@ -139,7 +141,7 @@ public class RadarDao extends PluginDao { } Map symData = radarRec.getSymbologyData(); - if (symData != null && !symData.isEmpty()) { + if ((symData != null) && !symData.isEmpty()) { byte[] data = DynamicSerializationManager.getManager( SerializationType.Thrift).serialize(symData); ByteDataRecord bdr = new ByteDataRecord( @@ -161,7 +163,7 @@ public class RadarDao extends PluginDao { Map>> mapProdVals = radarRec .getMapProductVals(); - if (mapProdVals != null && !mapProdVals.isEmpty()) { + if ((mapProdVals != null) && !mapProdVals.isEmpty()) { byte[] data = DynamicSerializationManager.getManager( SerializationType.Thrift).serialize(mapProdVals); ByteDataRecord bdr = new ByteDataRecord( @@ -192,7 +194,7 @@ public class RadarDao extends PluginDao { Map> mapRecVals = radarRec .getMapRecordVals(); - if (mapRecVals != null && !mapRecVals.isEmpty()) { + if ((mapRecVals != null) && !mapRecVals.isEmpty()) { byte[] data = DynamicSerializationManager.getManager( SerializationType.Thrift).serialize(mapRecVals); ByteDataRecord bdr = new ByteDataRecord( @@ -202,7 +204,7 @@ public class RadarDao extends PluginDao { } Map stormIds = radarRec.getStormIDs(); - if (stormIds != null && !stormIds.isEmpty()) { + if ((stormIds != null) && !stormIds.isEmpty()) { byte[] data = DynamicSerializationManager.getManager( SerializationType.Thrift).serialize(stormIds); ByteDataRecord bdr = new ByteDataRecord( @@ -274,7 +276,6 @@ public class RadarDao extends PluginDao { PluginDataObject[] queryResults = getMetadata(query); for (PluginDataObject obj : queryResults) { RadarRecord record = (RadarRecord) obj; - record.setPluginName(pluginName); IDataRecord[] hdf5Data = getHDF5Data(record, tile); record.setMessageData(hdf5Data[0].getDataObject()); record.setAngleData((float[]) hdf5Data[1].getDataObject()); diff --git a/edexOsgi/com.raytheon.edex.plugin.recco/src/com/raytheon/edex/plugin/recco/RECCODecoder.java b/edexOsgi/com.raytheon.edex.plugin.recco/src/com/raytheon/edex/plugin/recco/RECCODecoder.java index a4d2ec96e7..bed1dbd22a 100644 --- a/edexOsgi/com.raytheon.edex.plugin.recco/src/com/raytheon/edex/plugin/recco/RECCODecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.recco/src/com/raytheon/edex/plugin/recco/RECCODecoder.java @@ -54,8 +54,9 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080103 384 jkorman Initial Coding. - * 11/25/08 #1684 chammack Camel Refactor + * Jan 03, 2008 384 jkorman Initial Coding. + * Nov 25, 2008 1684 chammack Camel Refactor + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author jkorman @@ -115,7 +116,6 @@ public class RECCODecoder extends AbstractDecoder { input.getWmoHeader()); if (report != null) { report.setTraceId(traceId); - report.setPluginName(PLUGIN_NAME); try { report.constructDataURI(); } catch (PluginException e) { diff --git a/edexOsgi/com.raytheon.edex.plugin.recco/src/com/raytheon/edex/plugin/recco/common/RECCORecord.java b/edexOsgi/com.raytheon.edex.plugin.recco/src/com/raytheon/edex/plugin/recco/common/RECCORecord.java index d1645ed8f5..1a9bbe9204 100644 --- a/edexOsgi/com.raytheon.edex.plugin.recco/src/com/raytheon/edex/plugin/recco/common/RECCORecord.java +++ b/edexOsgi/com.raytheon.edex.plugin.recco/src/com/raytheon/edex/plugin/recco/common/RECCORecord.java @@ -73,6 +73,7 @@ import com.vividsolutions.jts.geom.Geometry; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * Jun 20, 2013 2128 bsteffen Ensure setDataURI sets the dataURI. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -86,12 +87,8 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "recco", - indexes = { - @Index(name = "recco_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "recco", indexes = { @Index(name = "recco_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -140,7 +137,7 @@ public class RECCORecord extends PluginDataObject implements ISpatialEnabled, @XmlAttribute private Calendar refHour; - // + // @Column @DataURI(position = 1) @DynamicSerializeElement @@ -687,6 +684,7 @@ public class RECCORecord extends PluginDataObject implements ISpatialEnabled, return a; } + @Override public String[] getStrings(String paramName) { return null; } @@ -723,4 +721,9 @@ public class RECCORecord extends PluginDataObject implements ISpatialEnabled, public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "recco"; + } } \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/RedbookDecoder.java b/edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/RedbookDecoder.java index 063938623c..f5651117af 100644 --- a/edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/RedbookDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/RedbookDecoder.java @@ -47,14 +47,15 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080512 1131 jkorman Initial implementation. - * 20080529 1131 jkorman Added new Separator constructor. - * 11/11/08 1684 chammack Refactored to camel - * 20090327 2019 jkorman Added code to check for non-redbook data. - * 20120524 #647 dgilling Update persistence time in + * May 12, 2008 1131 jkorman Initial implementation. + * May 29, 2008 1131 jkorman Added new Separator constructor. + * Nov 11, 2008 1684 chammack Refactored to camel + * Mar 27, 2009 2019 jkorman Added code to check for non-redbook data. + * May 24, 2012 647 dgilling Update persistence time in * createdBackDatedVersionIfNeeded. - * Mar 19, 2013 1785 bgonzale Added performance status handler and added - * status to decode. + * Mar 19, 2013 1785 bgonzale Added performance status handler and + * added status to decode. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author jkorman @@ -95,6 +96,7 @@ public class RedbookDecoder extends AbstractDecoder { private final IPerformanceStatusHandler perfLog = PerformanceStatus .getHandler("Redbook:"); + private String traceId = null; /** @@ -142,12 +144,11 @@ public class RedbookDecoder extends AbstractDecoder { + "- File is not Redbook data. Type is " + foreign.dataType); } else { - report = new RedbookParser(traceId, data, - wmoHeader).getDecodedRecord(); + report = new RedbookParser(traceId, data, wmoHeader) + .getDecodedRecord(); } if (report != null) { report.setPersistenceTime(new Date()); - report.setPluginName(PLUGIN_NAME); try { report.constructDataURI(); @@ -219,7 +220,6 @@ public class RedbookDecoder extends AbstractDecoder { // and the Wes2Bridge archiver properly finds these backdated // records backDatedRecord.setPersistenceTime(new Date()); - backDatedRecord.setPluginName(PLUGIN_NAME); backDatedRecord.constructDataURI(); } catch (PluginException e) { logger.error(traceId + "Could not create back-dated copy of " diff --git a/edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/common/RedbookRecord.java b/edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/common/RedbookRecord.java index d6ff1ba00d..199634a1d7 100644 --- a/edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/common/RedbookRecord.java +++ b/edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/common/RedbookRecord.java @@ -61,14 +61,17 @@ import com.raytheon.uf.common.time.DataTime; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080512 1131 jkorman Initial implementation. - * 20080529 1131 jkorman getPersistenceTime now returns system time. - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 20130408 1293 bkowal Removed references to hdffileid. - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. - * Apr 29, 2013 1958 bgonzale Added equals and hashcode. + * May 12, 2008 1131 jkorman Initial implementation. + * May 29, 2008 1131 jkorman getPersistenceTime now returns system + * time. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 29, 2013 1958 bgonzale Added equals and hashcode. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -82,17 +85,13 @@ import com.raytheon.uf.common.time.DataTime; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "redbook", - indexes = { - @Index(name = "redbook_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "redbook", indexes = { @Index(name = "redbook_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class RedbookRecord extends PersistablePluginDataObject - implements IPersistable, Cloneable { +public class RedbookRecord extends PersistablePluginDataObject implements + IPersistable, Cloneable { private static final long serialVersionUID = 1L; @@ -361,7 +360,8 @@ public class RedbookRecord extends PersistablePluginDataObject other.id = 0; other.dataURI = null; - Date newRefTime = new Date(dataTime.getRefTime().getTime() - 60 * 1000); + Date newRefTime = new Date(dataTime.getRefTime().getTime() + - (60 * 1000)); if (dataTime.getUtilityFlags().contains(DataTime.FLAG.FCST_USED)) { other.dataTime = new DataTime(newRefTime, dataTime.getFcstTime()); } else { @@ -380,22 +380,23 @@ public class RedbookRecord extends PersistablePluginDataObject public int hashCode() { final int prime = 31; int result = super.hashCode(); - result = prime * result + result = (prime * result) + ((corIndicator == null) ? 0 : corIndicator.hashCode()); - result = prime * result + result = (prime * result) + ((fcstHours == null) ? 0 : fcstHours.hashCode()); - result = prime * result + ((fileId == null) ? 0 : fileId.hashCode()); - result = prime * result + result = (prime * result) + ((fileId == null) ? 0 : fileId.hashCode()); + result = (prime * result) + ((originatorId == null) ? 0 : originatorId.hashCode()); - result = prime * result + result = (prime * result) + ((productId == null) ? 0 : productId.hashCode()); - result = prime * result + Arrays.hashCode(redBookData); - result = prime * result + result = (prime * result) + Arrays.hashCode(redBookData); + result = (prime * result) + ((retentionHours == null) ? 0 : retentionHours.hashCode()); - result = prime * result + ((timeObs == null) ? 0 : timeObs.hashCode()); - result = prime * result + result = (prime * result) + + ((timeObs == null) ? 0 : timeObs.hashCode()); + result = (prime * result) + ((wmoCCCCdt == null) ? 0 : wmoCCCCdt.hashCode()); - result = prime * result + result = (prime * result) + ((wmoTTAAii == null) ? 0 : wmoTTAAii.hashCode()); return result; } @@ -407,60 +408,82 @@ public class RedbookRecord extends PersistablePluginDataObject */ @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } RedbookRecord other = (RedbookRecord) obj; if (corIndicator == null) { - if (other.corIndicator != null) + if (other.corIndicator != null) { return false; - } else if (!corIndicator.equals(other.corIndicator)) + } + } else if (!corIndicator.equals(other.corIndicator)) { return false; + } if (fcstHours == null) { - if (other.fcstHours != null) + if (other.fcstHours != null) { return false; - } else if (!fcstHours.equals(other.fcstHours)) + } + } else if (!fcstHours.equals(other.fcstHours)) { return false; + } if (fileId == null) { - if (other.fileId != null) + if (other.fileId != null) { return false; - } else if (!fileId.equals(other.fileId)) + } + } else if (!fileId.equals(other.fileId)) { return false; + } if (originatorId == null) { - if (other.originatorId != null) + if (other.originatorId != null) { return false; - } else if (!originatorId.equals(other.originatorId)) + } + } else if (!originatorId.equals(other.originatorId)) { return false; + } if (productId == null) { - if (other.productId != null) + if (other.productId != null) { return false; - } else if (!productId.equals(other.productId)) + } + } else if (!productId.equals(other.productId)) { return false; - if (!Arrays.equals(redBookData, other.redBookData)) + } + if (!Arrays.equals(redBookData, other.redBookData)) { return false; + } if (retentionHours == null) { - if (other.retentionHours != null) + if (other.retentionHours != null) { return false; - } else if (!retentionHours.equals(other.retentionHours)) + } + } else if (!retentionHours.equals(other.retentionHours)) { return false; + } if (timeObs == null) { - if (other.timeObs != null) + if (other.timeObs != null) { return false; - } else if (!timeObs.equals(other.timeObs)) + } + } else if (!timeObs.equals(other.timeObs)) { return false; + } if (wmoCCCCdt == null) { - if (other.wmoCCCCdt != null) + if (other.wmoCCCCdt != null) { return false; - } else if (!wmoCCCCdt.equals(other.wmoCCCCdt)) + } + } else if (!wmoCCCCdt.equals(other.wmoCCCCdt)) { return false; + } if (wmoTTAAii == null) { - if (other.wmoTTAAii != null) + if (other.wmoTTAAii != null) { return false; - } else if (!wmoTTAAii.equals(other.wmoTTAAii)) + } + } else if (!wmoTTAAii.equals(other.wmoTTAAii)) { return false; + } return true; } @@ -471,4 +494,8 @@ public class RedbookRecord extends PersistablePluginDataObject return super.getDataURI(); } + @Override + public String getPluginName() { + return "redbook"; + } } \ No newline at end of file diff --git a/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java b/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java index 55827a56ef..1a6457edac 100644 --- a/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.satellite/src/com/raytheon/edex/plugin/satellite/SatelliteDecoder.java @@ -46,9 +46,9 @@ import com.raytheon.uf.common.datastorage.records.IDataRecord; import com.raytheon.uf.common.status.IPerformanceStatusHandler; import com.raytheon.uf.common.status.PerformanceStatus; import com.raytheon.uf.common.time.DataTime; -import com.raytheon.uf.common.util.ArraysUtil; import com.raytheon.uf.common.time.util.ITimer; import com.raytheon.uf.common.time.util.TimeUtil; +import com.raytheon.uf.common.util.ArraysUtil; import com.raytheon.uf.edex.decodertools.time.TimeTools; import com.raytheon.uf.edex.wmo.message.WMOHeader; @@ -79,7 +79,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * 01/03/2013 15294 D. Friedman Start with File instead of byte[] to * reduce memory usage. * Feb 15, 2013 1638 mschenke Moved array based utilities from Util into ArraysUtil - * + * * Mar 19, 2013 1785 bgonzale Added performance status handler and added status * to decode. * @@ -90,7 +90,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; */ public class SatelliteDecoder extends AbstractDecoder { - private String traceId = ""; + private final String traceId = ""; private static final int MAX_IMAGE_SIZE = 30000000; @@ -111,8 +111,9 @@ public class SatelliteDecoder extends AbstractDecoder { SatelliteRecord record = null; - if (file == null || (file.length() < 1)) + if ((file == null) || (file.length() < 1)) { return new PluginDataObject[0]; + } RandomAccessFile f = new RandomAccessFile(file, "r"); try { ITimer timer = TimeUtil.getTimer(); @@ -129,7 +130,8 @@ public class SatelliteDecoder extends AbstractDecoder { byteBuffer = null; } if (byteBuffer != null) { - int offsetOfDataInFile = byteBuffer.position() + GINI_HEADER_SIZE; + int offsetOfDataInFile = byteBuffer.position() + + GINI_HEADER_SIZE; Calendar calendar = Calendar.getInstance(TimeZone .getTimeZone("GMT")); int intValue = 0; @@ -140,20 +142,23 @@ public class SatelliteDecoder extends AbstractDecoder { record = new SatelliteRecord(); if (isCompressed(byteBuffer)) { - /* If the data is compressed, we assume it came from the SBN + /* + * If the data is compressed, we assume it came from the SBN * and will have a reasonable size such that we can have two - * copies of the data in memory at the same time. Ideally, + * copies of the data in memory at the same time. Ideally, * SBN decompression should be performed upstream from EDEX * and this code would be removed. */ - byte[] data = new byte[(int) file.length() - byteBuffer.position()]; + byte[] data = new byte[(int) file.length() + - byteBuffer.position()]; f.seek(byteBuffer.position()); f.readFully(data); byte[][] retVal = decompressSatellite(data); byteBuffer = ByteBuffer.wrap(retVal[0]); tempBytes = retVal[1]; } else { - /* The code bellow performs absolute gets on the buffer, so + /* + * The code bellow performs absolute gets on the buffer, so * it needs to be compacted. */ byteBuffer.compact(); @@ -255,7 +260,7 @@ public class SatelliteDecoder extends AbstractDecoder { // Get the Satellite Height int satHeight = byteBuffer.getShort(53); - if (latSub != 0 || lonSub != 0 || satHeight != 0) { + if ((latSub != 0) || (lonSub != 0) || (satHeight != 0)) { // Correct the longitude so negative is west lonSub *= -1; // Correct the height to be height above ground @@ -287,8 +292,9 @@ public class SatelliteDecoder extends AbstractDecoder { // get number of points along y-axis int ny = byteBuffer.getShort(18); - /* If input was SBN-compressed, we already have the data - * loaded. If not, load it now. + /* + * If input was SBN-compressed, we already have the data loaded. + * If not, load it now. */ if (tempBytes == null) { tempBytes = new byte[nx * ny]; @@ -433,7 +439,6 @@ public class SatelliteDecoder extends AbstractDecoder { record.setCoverage(mapCoverage); record.setPersistenceTime(TimeTools.getSystemCalendar() .getTime()); - record.setPluginName("satellite"); record.constructDataURI(); // Create the data record. IDataRecord dataRec = messageData.getStorageRecord(record, @@ -466,10 +471,11 @@ public class SatelliteDecoder extends AbstractDecoder { * @throws DecoderException * If WMO header is not found, or is incorrect. * @param messageData - * Contains the start of the satellite data file. On return, - * the position is set the beginning of the GINI header. + * Contains the start of the satellite data file. On return, the + * position is set the beginning of the GINI header. */ - private void removeWmoHeader(ByteBuffer messageData) throws DecoderException { + private void removeWmoHeader(ByteBuffer messageData) + throws DecoderException { // Copy to a char [], carefully, as creating a string from // a byte [] with binary data can create erroneous data @@ -500,7 +506,7 @@ public class SatelliteDecoder extends AbstractDecoder { * Checks to see if the current satellite product is compressed. * * Assumes messageData is a byte[]-backed ByteBuffer. - * + * * @return A boolean indicating if the file is compressed or not */ private boolean isCompressed(ByteBuffer messageData) { @@ -508,8 +514,8 @@ public class SatelliteDecoder extends AbstractDecoder { byte[] placeholder = new byte[10]; Inflater decompressor = new Inflater(); try { - decompressor.setInput(messageData.array(), - messageData.position(), messageData.remaining()); + decompressor.setInput(messageData.array(), messageData.position(), + messageData.remaining()); decompressor.inflate(placeholder); } catch (DataFormatException e) { compressed = false; @@ -539,14 +545,13 @@ public class SatelliteDecoder extends AbstractDecoder { // Allocate 30MB for a possible max size ByteArrayOutputStream bos = new ByteArrayOutputStream(MAX_IMAGE_SIZE); int totalBytesDecomp = 0; - int decompByteCounter = 0; byte[] inputArray = new byte[1024 * 10]; Inflater decompressor = new Inflater(); int index = -1; try { while (totalBytesDecomp < zSatellite.length) { - int compChunkSize = zSatellite.length - totalBytesDecomp > 10240 ? 10240 + int compChunkSize = (zSatellite.length - totalBytesDecomp) > 10240 ? 10240 : zSatellite.length - totalBytesDecomp; // copy compChunkSize compressed data from zSatellite, offset by @@ -570,9 +575,6 @@ public class SatelliteDecoder extends AbstractDecoder { throw new DecoderException( "Unable to decompress satellite data - input data appears to be truncated"); } - // add the total bytes decompressed from inflate call - decompByteCounter += inflatedBytes; - // retrieve the total compressed bytes input so far totalBytesDecomp += decompressor.getTotalIn(); @@ -641,9 +643,9 @@ public class SatelliteDecoder extends AbstractDecoder { } - if (index != -1 && (index + 3 <= inflateArray.length - 1)) { - if (!(inflateArray[index] == -1 && inflateArray[index + 1] == 0 - && inflateArray[index + 2] == -1 && inflateArray[index + 3] == 0)) { + if ((index != -1) && ((index + 3) <= (inflateArray.length - 1))) { + if (!((inflateArray[index] == -1) && (inflateArray[index + 1] == 0) + && (inflateArray[index + 2] == -1) && (inflateArray[index + 3] == 0))) { index = getIndex(inflateArray, index + 1); } } else { @@ -686,7 +688,7 @@ public class SatelliteDecoder extends AbstractDecoder { if (byteArray[0] < 0) { // remove the negative value byteArray[0] &= 127; - latitude = byteArrayToFloat(byteArray) / 10000 * -1; + latitude = (byteArrayToFloat(byteArray) / 10000) * -1; } else { latitude = byteArrayToFloat(byteArray) / 10000; } diff --git a/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/SfcObsDecoder.java b/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/SfcObsDecoder.java index 7d67020f90..9d20ce9b65 100644 --- a/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/SfcObsDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.sfcobs/src/com/raytheon/edex/plugin/sfcobs/SfcObsDecoder.java @@ -62,16 +62,17 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20070925 391 jkorman Initial Coding. - * 20071107 391 jkorman Modified findDuplicate to use a different + * Sep 25, 2007 391 jkorman Initial Coding. + * Nov 07, 2007 391 jkorman Modified findDuplicate to use a different * dataURI query. * Dec 17, 2007 600 bphillip Added dao pool usage - * 20080123 758 jkorman Added code to remove observation with a + * Jan 23, 2008 758 jkorman Added code to remove observation with a * time in the future. - * 20080215 887 jkorman Added null checks in decode. - * 20080218 887 jkorman Reverse null checks in findDuplicate. - * Mar 19, 2013 1785 bgonzale Added performance status handler and added status - * to decode. + * Feb 15, 2008 887 jkorman Added null checks in decode. + * Feb 18, 2008 887 jkorman Reverse null checks in findDuplicate. + * Mar 19, 2013 1785 bgonzale Added performance status handler and + * added status to decode. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author jkorman @@ -87,7 +88,7 @@ public class SfcObsDecoder extends AbstractDecoder { .getHandler("SfcObs:"); /** The logger */ - private Log logger = LogFactory.getLog(getClass()); + private final Log logger = LogFactory.getLog(getClass()); private boolean removeNILs = true; @@ -169,7 +170,6 @@ public class SfcObsDecoder extends AbstractDecoder { } if (report != null) { report.setTraceId(traceId); - report.setPluginName(PLUGIN_NAME); try { report.constructDataURI(); } catch (PluginException e) { diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/data/ShefRecord.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/data/ShefRecord.java index 8cc186047e..c0b0419c08 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/data/ShefRecord.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/data/ShefRecord.java @@ -47,14 +47,14 @@ import com.raytheon.uf.common.time.DataTime; /** *
  * SOFTWARE HISTORY
- * Date       	Ticket#		Engineer	Description
- * ------------	----------	-----------	--------------------------
- * June2006		3,14		Phillippe	Initial Creation.	
- * 20071129     472         jkorman     Added IDecoderGettable interface.
- * 19Mar2008    387         M. Duff     Modified to store SHEF data.
- * May 07, 2013	1869      	bsteffen   	Remove dataURI column from
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * June2006     314         Phillippe   Initial Creation.
+ * Nov 29, 2007 472         jkorman     Added IDecoderGettable interface.
+ * Mar 19, 2008 387         M. Duff     Modified to store SHEF data.
+ * May 07, 2013 1869        bsteffen    Remove dataURI column from
  *                                      PluginDataObject.
- * 
+ * Aug 30, 2013 2298        rjpeter     Make getPluginName abstract
  * 
* * @author bphillip @@ -63,21 +63,19 @@ import com.raytheon.uf.common.time.DataTime; @DynamicSerialize @XmlAccessorType(XmlAccessType.NONE) public class ShefRecord extends PluginDataObject { - + public static enum ShefType { A, B, E; } - - private static final long serialVersionUID = 2726928942130489733L; - private static final int MILLIS_PER_MINUTE = 1000 * 60; + private static final long serialVersionUID = 2726928942130489733L; /** * Collection of SHEF data values for this record */ @Transient private List dataValues = null; - + @Transient protected String rawMessage = null; @@ -127,12 +125,12 @@ public class ShefRecord extends PluginDataObject { @Transient private SHEFDate obsDate = null; - + @Transient private SHEFDate createDate = null; @Transient - private int durationValue = ParameterCode.Duration.DEFAULT.getValue(); + private final int durationValue = ParameterCode.Duration.DEFAULT.getValue(); /** * Empty constructor @@ -161,12 +159,12 @@ public class ShefRecord extends PluginDataObject { } public void addDataValue(ShefData value) { - if(dataValues == null) { + if (dataValues == null) { dataValues = new ArrayList(); } dataValues.add(value); } - + /** * Get the record type. * @@ -246,19 +244,19 @@ public class ShefRecord extends PluginDataObject { this.recordDate = recordDate; if (recordDate.length() == 4) { int year = ShefUtil.getFullYear(recordDate); - synchronized(ShefConstants.YYYYMMDD_FORMAT){ + synchronized (ShefConstants.YYYYMMDD_FORMAT) { recordDateObj = ShefConstants.YYYYMMDD_FORMAT.parse(year + recordDate); } } else if (recordDate.length() == 6) { int year = ShefUtil.getFullYear(recordDate); year = year / 100; - synchronized(ShefConstants.YYYYMMDD_FORMAT){ + synchronized (ShefConstants.YYYYMMDD_FORMAT) { recordDateObj = ShefConstants.YYYYMMDD_FORMAT.parse(year + recordDate); } } else { // recordDate length must be 8 - synchronized(ShefConstants.YYYYMMDD_FORMAT){ + synchronized (ShefConstants.YYYYMMDD_FORMAT) { recordDateObj = ShefConstants.YYYYMMDD_FORMAT.parse(recordDate); } } @@ -287,7 +285,7 @@ public class ShefRecord extends PluginDataObject { public void setObsDate(SHEFDate date) { obsDate = date; } - + /** * * @return @@ -295,7 +293,7 @@ public class ShefRecord extends PluginDataObject { public SHEFDate getObsDate() { return obsDate; } - + /** * Get the time zone code * @@ -375,7 +373,7 @@ public class ShefRecord extends PluginDataObject { * @param date */ public void setCreationDate(SHEFDate date) { - if(date != null) { + if (date != null) { createDate = date; creationDate = date.toLocal(); creationDateObj = date.toCalendar().getTime(); @@ -385,7 +383,6 @@ public class ShefRecord extends PluginDataObject { creationDateObj = null; } } - /** * Get the creation date Date object @@ -563,54 +560,15 @@ public class ShefRecord extends PluginDataObject { public IDecoderGettable getDecoderGettable() { return null; } - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Record type = "); sb.append(shefType); - -// if(obsDate != null) { -// sb.append(obsDate.toOutString()); -// } else { -// sb.append(" 0 0 0 0 0 0"); -// } -// sb.append(" "); -// if(createDate != null) { -// sb.append(createDate.toOutString()); -// } else { -// sb.append(" 0 0 0 0 0 0"); -// } -// sb.append(" "); -// // PE -// sb.append("HG"); -// sb.append(" "); -// sb.append(String.format("%4d",durationValue)); -// sb.append(" "); -// // Type Code -// sb.append("R"); -// sb.append(" "); -// // Source Code -// sb.append("G"); -// sb.append(" "); -// // Extremnum -// sb.append("Z"); -// sb.append(" "); -// // Probability Code -// sb.append(" "); -// sb.append(" "); -// // Data Value -// sb.append("00000.000"); -// sb.append(" "); -// // Data Qualifier -// sb.append(" "); -// sb.append(" "); -// // Revision code -// sb.append((revisedRecord) ? "0" : "1"); -// sb.append(ShefConstants.EOL); -// sb.append("----------------------------------------"); - if(dataValues != null) { - for(ShefData d : dataValues) { + + if (dataValues != null) { + for (ShefData d : dataValues) { sb.append(ShefConstants.EOL); d.toString(sb); } @@ -618,11 +576,16 @@ public class ShefRecord extends PluginDataObject { sb.append(ShefConstants.EOL); return sb.toString(); } - + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "shef"; + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java index b31d016b9e..e4dd5ccf43 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/src/com/raytheon/edex/plugin/shef/database/PostShef.java @@ -107,6 +107,9 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * 03/07/2013 15545 w. kwock Added Observe time to log * 03/21/2013 15967 w. kwock Fix the error in buildTsFcstRiv riverstatus table issue * 04/05/2013 16036 w. kwock Fixed no ts=RZ in ingestfilter table but posted to height table + * 10/28/2013 16711 lbousaidi if the id is not in location table,but defined in geoarea table + * data can be posted to appropriate pe-based tables only if the data + * type is not READING like in A1 code. * * * @@ -418,6 +421,18 @@ public class PostShef { if (log.isDebugEnabled()) { log.debug("DataType = " + dataType); } + + /* + * if the station_id exists in location table and + * the data type is READING then the data doesn't get posted + * to the appropriate pe-based tables to match A1 logic. + * DR16711 + */ + + if ((DataType.READING.equals(dataType)) + &&(Location.LOC_GEOAREA.equals(postLocData))) { + postLocData=Location.LOC_UNDEFINED; + } SHEFDate d = data.getObsTime(); if (d == null) { diff --git a/edexOsgi/com.raytheon.edex.plugin.shef/unit-test/test/edex/transform/shef/TestMetarToShefTransformer.java b/edexOsgi/com.raytheon.edex.plugin.shef/unit-test/test/edex/transform/shef/TestMetarToShefTransformer.java index 8a4b988f28..2c473e8bce 100644 --- a/edexOsgi/com.raytheon.edex.plugin.shef/unit-test/test/edex/transform/shef/TestMetarToShefTransformer.java +++ b/edexOsgi/com.raytheon.edex.plugin.shef/unit-test/test/edex/transform/shef/TestMetarToShefTransformer.java @@ -19,10 +19,15 @@ **/ package test.edex.transform.shef; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + import java.util.Iterator; import org.junit.Test; -import static org.junit.Assert.*; import com.raytheon.edex.transform.shef.MetarToShefTransformer; import com.raytheon.uf.common.dataplugin.IDecoderGettable; @@ -32,26 +37,25 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject; * Tests extracted from MetarToShef. * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * ======================================
  * AWIPS2 DR Work
  * 20120918           1185 jkorman     Extracted from mains
- *
+ * 
  * 
- * + * * @author jkorman - * @version 1.0 + * @version 1.0 */ public class TestMetarToShefTransformer { /** - * Test that the transformer creates an empty iterator when - * given no input. + * Test that the transformer creates an empty iterator when given no input. */ @Test public void testMetarToShefInteratorA() { @@ -60,18 +64,17 @@ public class TestMetarToShefTransformer { assertNotNull(it); assertFalse(it.hasNext()); assertNull(it.next()); - - pdos = new PluginDataObject [0]; + + pdos = new PluginDataObject[0]; it = MetarToShefTransformer.iterate(pdos); assertNotNull(it); assertFalse(it.hasNext()); assertNull(it.next()); - + } - + /** - * Test that the transformer creates an non-empty iterator for - * given input. + * Test that the transformer creates an non-empty iterator for given input. */ @Test public void testMetarToShefInteratorB() { @@ -81,8 +84,20 @@ public class TestMetarToShefTransformer { public IDecoderGettable getDecoderGettable() { return null; } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.dataplugin.PluginDataObject#getPluginName + * () + */ + @Override + public String getPluginName() { + return "testMetarToShef"; + } }; - + PluginDataObject[] pdos = { p, }; Iterator it = MetarToShefTransformer.iterate(pdos); assertNotNull(it); @@ -105,9 +120,6 @@ public class TestMetarToShefTransformer { + "\r\r\n: 60000 T00330011 10078 20033 53021 931012 933025 98245 4/005=", newobs.toString()); - } - - - - + } + } diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/TafDecoder.java b/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/TafDecoder.java index 2f65deae88..8b6e1fddf5 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/TafDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/TafDecoder.java @@ -30,18 +30,18 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; /** * - * Decoder implementation for taf plugin + * Decoder implementation for taf plugin. * *
  * 
  * SOFTWARE HISTORY
  * 
- * Date       	Ticket#		Engineer	Description
- * ------------	----------	-----------	--------------------------
- * 2/14/07		139			bphillip	Initial creation	
- * 6/21/07		180			bphillip	Updated to use new plugin pattern
- * 20080425           1001  jkorman     Extracted decoder code into TAFParser.
- * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------  ----------- --------------------------
+ * Feb 14, 2007 139         bphillip    Initial creation
+ * Jun 21, 2007 180         bphillip    Updated to use new plugin pattern
+ * Apr 25, 2008 1001        jkorman     Extracted decoder code into TAFParser.
+ * Aug 30, 2013 2298        rjpeter     Make getPluginName abstract
  * 
* * @author bphillip @@ -52,7 +52,7 @@ public class TafDecoder extends AbstractDecoder { // Name of the plugin controlling this decoder. public static final String PLUGIN_NAME = "TAF"; - private String traceId = ""; + private final String traceId = ""; /** * Constructor. @@ -88,12 +88,12 @@ public class TafDecoder extends AbstractDecoder { record = parser.getDecodedRecord(); if (record != null) { record.setTraceId(traceId); - record.setPluginName("taf"); record.constructDataURI(); } else { TAFParts parts = input.tafParts; - if(parts.getTafHeader() != null) { - logger.error("Could not parse TAF for input " + parts.getTafHeader() + " in file " + traceId); + if (parts.getTafHeader() != null) { + logger.error("Could not parse TAF for input " + + parts.getTafHeader() + " in file " + traceId); } else { logger.error("Could not parse file " + traceId); } @@ -107,8 +107,9 @@ public class TafDecoder extends AbstractDecoder { record = null; } - if (record == null) + if (record == null) { return new PluginDataObject[0]; + } return new PluginDataObject[] { record }; } diff --git a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafRecord.java b/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafRecord.java index d48e049b54..4690840804 100644 --- a/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafRecord.java +++ b/edexOsgi/com.raytheon.edex.plugin.taf/src/com/raytheon/edex/plugin/taf/common/TafRecord.java @@ -22,7 +22,6 @@ package com.raytheon.edex.plugin.taf.common; import java.util.Date; import java.util.HashSet; -import java.util.Iterator; import java.util.Set; import javax.persistence.Access; @@ -61,13 +60,15 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 2/14/07 139 bphillip Initial Creation - * 6/21/07 180 bphillip Updated to use new plugin pattern - * 20071129 472 jkorman Added IDecoderGettable interface. - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime + * Feb 14, 2007 139 bphillip Initial Creation + * Jun 21, 2007 180 bphillip Updated to use new plugin pattern + * Nov 29, 2007 472 jkorman Added IDecoderGettable interface. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -81,12 +82,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "taf", - indexes = { - @Index(name = "taf_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "taf", indexes = { @Index(name = "taf_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement @@ -347,10 +344,8 @@ public class TafRecord extends PluginDataObject implements ISpatialEnabled { this.identifier = dataURI; - if (this.changeGroups != null && this.changeGroups.size() > 0) { - for (Iterator iter = this.changeGroups.iterator(); iter - .hasNext();) { - ChangeGroup group = iter.next(); + if ((this.changeGroups != null) && (this.changeGroups.size() > 0)) { + for (ChangeGroup group : this.changeGroups) { group.setParentID(this); } } @@ -391,7 +386,7 @@ public class TafRecord extends PluginDataObject implements ISpatialEnabled { public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + result = (prime * result) + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); return result; } @@ -405,19 +400,23 @@ public class TafRecord extends PluginDataObject implements ISpatialEnabled { */ @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } TafRecord other = (TafRecord) obj; if (getDataURI() == null) { if (other.getDataURI() != null) { return false; } - } else if (!getDataURI().equals(other.getDataURI())) + } else if (!getDataURI().equals(other.getDataURI())) { return false; + } return true; } @@ -427,4 +426,9 @@ public class TafRecord extends PluginDataObject implements ISpatialEnabled { public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "taf"; + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.text/res/spring/text-ingest.xml b/edexOsgi/com.raytheon.edex.plugin.text/res/spring/text-ingest.xml index 982bc1af13..945f5599a4 100644 --- a/edexOsgi/com.raytheon.edex.plugin.text/res/spring/text-ingest.xml +++ b/edexOsgi/com.raytheon.edex.plugin.text/res/spring/text-ingest.xml @@ -14,6 +14,11 @@
+ + + + diff --git a/edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/TextDecoder.java b/edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/TextDecoder.java index c870667d8e..b06c736958 100644 --- a/edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/TextDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/TextDecoder.java @@ -66,18 +66,19 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * * SOFTWARE HISTORY * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 2008 Aug 11 jkorman + * Date Ticket# Engineer Description + * ------------ ---------- ----------- -------------------------- + * Aug 11, 2008 jkorman Initial creation * Jul 10, 2009 2191 rjpeter Finished implementation. - * Apr 14, 2010 4734 mhuang Corrected StdTextProduct import - * dependency + * Apr 14, 2010 4734 mhuang Corrected StdTextProduct import + * dependency * May 28, 2010 2187 cjeanbap Added StdTextProductFactory - * functionality. + * functionality. * Aug 26, 2010 2187 cjeanbap Renamed operationalMode for - * consistency. + * consistency. * Dec 13, 2010 5805 cjeanbap Parse Report to get AFOS Product Id - * Jul 16, 2013 DR 16323 D. Friedman Use concurrent map + * Jul 16, 2013 16323 D. Friedman Use concurrent map + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author @@ -99,7 +100,7 @@ public class TextDecoder extends AbstractDecoder { .getEnvProperties().getEnvValue("DEFAULTDATADIR") + "badTxt"; - private Log logger = LogFactory.getLog(getClass()); + private final Log logger = LogFactory.getLog(getClass()); private String pluginName; @@ -107,11 +108,11 @@ public class TextDecoder extends AbstractDecoder { private String fileName; - private TextDB textdb = new TextDB(); + private final TextDB textdb = new TextDB(); // keeps track of the headers that have been logged as not mapped and the // time it was logged, so that each one is only logged once a day - private Map notMappedHeaders = new ConcurrentHashMap(); + private final Map notMappedHeaders = new ConcurrentHashMap(); private long msgHdrLogTime = 0; @@ -158,7 +159,6 @@ public class TextDecoder extends AbstractDecoder { if (pdo != null) { pdo.setTraceId(traceId); - pdo.setPluginName(pluginName); try { pdo.constructDataURI(); } catch (PluginException e) { @@ -209,7 +209,7 @@ public class TextDecoder extends AbstractDecoder { TextRecord pdo = null; - WMOReportData rptData = (WMOReportData) separator.next(); + WMOReportData rptData = separator.next(); boolean operationalMode = true; if (rptData != null) { @@ -227,8 +227,8 @@ public class TextDecoder extends AbstractDecoder { if (afosIdContainer != null) { List afosIdList = afosIdContainer .getIdList(); - if (afosIdList != null - && afosIdList.size() > 0) { + if ((afosIdList != null) + && (afosIdList.size() > 0)) { StringTokenizer st = new StringTokenizer( rptData.getReportData(), "\n"); String potentialId = st.nextToken(); @@ -266,20 +266,20 @@ public class TextDecoder extends AbstractDecoder { + rptHdr.getCccc(); Long time = notMappedHeaders.get(key); long curTime = System.currentTimeMillis(); - if (time == null - || (curTime - time > NOT_FOUND_LOG_PERIOD)) { + if ((time == null) + || ((curTime - time) > NOT_FOUND_LOG_PERIOD)) { StringBuilder msg = new StringBuilder(200); msg.append("Could not determine AFOS id for wmo header: ["); msg.append(rptHdr.toString()); msg.append("]"); - if (msgHdr != null + if ((msgHdr != null) && !msgHdr.equals(rptHdr)) { msg.append(" incoming message header ["); msg.append(msgHdr.toString()); msg.append("]"); } - if (curTime - msgHdrLogTime > MSG_HDR_LOG_PERIOD) { + if ((curTime - msgHdrLogTime) > MSG_HDR_LOG_PERIOD) { msg.append("\nMsg for a given header will only be logged once in a " + (NOT_FOUND_LOG_PERIOD / MILLIS_PER_HOUR) + " hour period"); @@ -319,7 +319,6 @@ public class TextDecoder extends AbstractDecoder { if (pdo != null) { pdo.setTraceId(traceId); - pdo.setPluginName(pluginName); try { pdo.constructDataURI(); } catch (PluginException e) { @@ -359,8 +358,8 @@ public class TextDecoder extends AbstractDecoder { key = header.getOriginalMessage(); } Long time = notMappedHeaders.get(key); - if (time == null - || (curTime - time > NOT_FOUND_LOG_PERIOD)) { + if ((time == null) + || ((curTime - time) > NOT_FOUND_LOG_PERIOD)) { notMappedHeaders.put(key, curTime); } else { iter.remove(); @@ -387,7 +386,7 @@ public class TextDecoder extends AbstractDecoder { } } - if (curTime - msgHdrLogTime > MSG_HDR_LOG_PERIOD) { + if ((curTime - msgHdrLogTime) > MSG_HDR_LOG_PERIOD) { msg.append("\nMsg for a given header will only be logged once in a " + (NOT_FOUND_LOG_PERIOD / MILLIS_PER_HOUR) + " hour period"); diff --git a/edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/TextRecord.java b/edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/TextRecord.java index c7790d7afe..43a9094555 100644 --- a/edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/TextRecord.java +++ b/edexOsgi/com.raytheon.edex.plugin.text/src/com/raytheon/edex/plugin/text/TextRecord.java @@ -38,9 +38,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Dec 5, 2008 jkorman Initial creation + * Dec 05, 2008 jkorman Initial creation * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -108,4 +109,8 @@ public class TextRecord extends PluginDataObject { return super.getDataURI(); } + @Override + public String getPluginName() { + return "text"; + } } diff --git a/edexOsgi/com.raytheon.edex.plugin.textlightning/src/com/raytheon/edex/plugin/textlightning/TextLightningDecoder.java b/edexOsgi/com.raytheon.edex.plugin.textlightning/src/com/raytheon/edex/plugin/textlightning/TextLightningDecoder.java index 8f530a7c5d..3337e38f5a 100644 --- a/edexOsgi/com.raytheon.edex.plugin.textlightning/src/com/raytheon/edex/plugin/textlightning/TextLightningDecoder.java +++ b/edexOsgi/com.raytheon.edex.plugin.textlightning/src/com/raytheon/edex/plugin/textlightning/TextLightningDecoder.java @@ -41,22 +41,23 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * TODO Add Description * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Mar 25, 2010            jsanchez     Initial creation
- *
+ * Mar 25, 2010            jsanchez    Initial creation
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
+ * 
  * 
- * + * * @author jsanchez - * @version 1.0 + * @version 1.0 */ public class TextLightningDecoder extends AbstractDecoder implements IBinaryDecoder { - private Log logger = LogFactory.getLog(getClass()); + private final Log logger = LogFactory.getLog(getClass()); private String traceId = null; @@ -74,17 +75,18 @@ public class TextLightningDecoder extends AbstractDecoder implements * @throws DecoderException * Thrown if no data is available. */ + @Override public PluginDataObject[] decode(byte[] data) throws DecoderException { ArrayList strikes = new ArrayList(); TextLightningParser parser = new TextLightningParser(data); - + LightningStrikePoint token; - while(parser.hasNext()) { + while (parser.hasNext()) { token = parser.next(); - if(token != null) { + if (token != null) { strikes.add(token); } - } + } BinLightningRecord report = null; if (strikes.size() > 0) { @@ -106,15 +108,14 @@ public class TextLightningDecoder extends AbstractDecoder implements Calendar cStart = report.getStartTime(); Calendar cStop = report.getStopTime(); - TimeRange range = new TimeRange(cStart.getTimeInMillis(), cStop - .getTimeInMillis()); + TimeRange range = new TimeRange(cStart.getTimeInMillis(), + cStop.getTimeInMillis()); DataTime dataTime = new DataTime(cStart, range); report.setDataTime(dataTime); if (report != null) { report.setTraceId(traceId); - report.setPluginName("binlightning"); try { report.constructDataURI(); } catch (PluginException e) { diff --git a/edexOsgi/com.raytheon.edex.plugin.warning/WarningDecoder.py b/edexOsgi/com.raytheon.edex.plugin.warning/WarningDecoder.py index 3c051d366c..d51f38ec3a 100644 --- a/edexOsgi/com.raytheon.edex.plugin.warning/WarningDecoder.py +++ b/edexOsgi/com.raytheon.edex.plugin.warning/WarningDecoder.py @@ -35,6 +35,7 @@ # May 07, 2013 1973 rferrel Adjust Issue and Purge times to be relative to start time. # Jun 24, 2013 DR 16317 D. Friedman If no storm line, parse storm motion from event text. # Aug 21, 2013 DR16501 m.gamazaychikov Adjusted calculation of Purge time in NoVTECWarningDecoder. +# Sep 12, 2013 DR2249 rferrel When incoming file from warngen adjust start time from file's timestamp. # # # @author rferrel @@ -111,19 +112,24 @@ class StdWarningDecoder(): self._rawMessage = text checkForWmo = True - #base time for decoder - self._time = time.time() + self._timeOffset #present time - - if TimeTools.allowArchive() : - try: - yyyymmddhh = TimeTools.getTimestamp(self._incomingFilename) - if len(yyyymmddhh) < 10: - timeTuple = time.strptime(yyyymmddhh, "%Y%m%d") - else : - timeTuple = time.strptime(yyyymmddhh, "%Y%m%d%H") - self._time = time.mktime(timeTuple) - except : - LogStream.logProblem('Unable to get timestamp from filename: "%s"' % (self._incomingFilename)) + # base time for decoder + warningTimestamp = TimeTools.getWarningTimestamp(self._incomingFilename) + if warningTimestamp is None : + # present time + self._time = time.time() + self._timeOffset + if TimeTools.allowArchive(): + try: + yyyymmddhh = TimeTools.getTimestamp(self._incomingFilename) + if len(yyyymmddhh) < 10: + timeTuple = time.strptime(yyyymmddhh, "%Y%m%d") + else : + timeTuple = time.strptime(yyyymmddhh, "%Y%m%d%H") + self._time = time.mktime(timeTuple) + except : + LogStream.logProblem('Unable to get timestamp from filename: "%s"' % (self._incomingFilename)) + else: + # Use the epoch seconds in the file generated by TextEditorDialog.java. + self._time = long(warningTimestamp) os.umask(0) #ensure proper permissions @@ -155,9 +161,8 @@ class StdWarningDecoder(): def decode(self): #get pil and date-time group - self._adjustIssueTime = True self._productPil, self._issueTime, linePos,\ - self._completeProductPil, self._issueTimeStr = self._getPilAndDTG() + self._completeProductPil = self._getPilAndDTG() # If this is a WCL - don't go any further. Run WCL procedure and exit. if self._productPil[0:3] == "WCL": @@ -411,7 +416,7 @@ usage: VTECDecoder -f productfilename -d -a activeTableName LogStream.logVerbose("Pil=", pil_search.group(0)) return (self._lines[count+1][0:3], self._dtgFromDDHHMM(dtg_search.group(1)), count+2, - pil_search.group(0), dtg_search.group(1)) + pil_search.group(0)) count = count + 1 if count >= len(self._lines)-1: LogStream.logProblem("Did not find either the product DTG" +\ @@ -830,7 +835,7 @@ usage: VTECDecoder -f productfilename -d -a activeTableName ugcs = self._expandUGC(ugcstring) records = [] for vtecS, hvtec in vtecStrings: - search = re.search(self._vtecRE, vtecS) + search = re.search(self._vtecRE, vtecS) #construct the active table entries, without the geography template = {} @@ -845,9 +850,6 @@ usage: VTECDecoder -f productfilename -d -a activeTableName template['seg'] = segment startTime, zeros = self._calcTime(search.group(6), search.group(7), self._issueTime * 1000) - if self._adjustIssueTime : - self._issueTime = self._dtgFromDDHHMM(self._issueTimeStr, startTime/1000.0) - self._adjustIssueTime = False endTime, ufn = self._calcTime(search.group(8), search.group(9), self._maxFutureTime * 1000) template['startTime'] = long(startTime) diff --git a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/query/TermQuery.java b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/query/TermQuery.java index 40982795d7..4e6ee44dcf 100644 --- a/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/query/TermQuery.java +++ b/edexOsgi/com.raytheon.edex.uengine/src/com/raytheon/edex/uengine/tasks/query/TermQuery.java @@ -20,10 +20,7 @@ package com.raytheon.edex.uengine.tasks.query; -import java.util.List; - import com.raytheon.edex.uengine.exception.MicroEngineException; -import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.edex.database.DataAccessLayerException; import com.raytheon.uf.edex.database.plugin.PluginFactory; @@ -37,12 +34,14 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory; * *
  * SOFTWARE HISTORY
- * Date             PR#             Engineer            Description
- * -----------      ----------      ------------        --------------------------
- * Mar 27, 2007                     njensen             Initial Creation.
- * 9/21/2007        368             grichard            Added plugin operations from superclass.
- * 6/04/2008        875             bphillip            Refactored to use DatabaseQuery
- * 
+ * Date Ticket# Engineer Description + * ------------ ---------- ------------ ---------------------------------------- + * Mar 27, 2007 njensen Initial Creation. + * Sep 21, 2007 368 grichard Added plugin operations from + * superclass. + * Jun 04, 2008 875 bphillip Refactored to use DatabaseQuery + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * * * @author njensen */ @@ -61,6 +60,7 @@ public class TermQuery extends TableQuery { * @throws PluginException * @deprecated */ + @Deprecated public TermQuery(String aPlugin, String dummy1, String dummy2) throws DataAccessLayerException, PluginException { this(aPlugin); @@ -80,19 +80,6 @@ public class TermQuery extends TableQuery { this.plugin = aPlugin; } - @SuppressWarnings("unchecked") - public List execute() throws Exception { - List results = (List) super - .execute(); - - if (results != null) { - for (int i = 0; i < results.size(); i++) { - results.get(i).setPluginName(plugin); - } - } - return results; - } - /** * * @return diff --git a/edexOsgi/com.raytheon.edex.utilitysrv/src/com/raytheon/edex/services/GetServersHandler.java b/edexOsgi/com.raytheon.edex.utilitysrv/src/com/raytheon/edex/services/GetServersHandler.java index ead823087b..f276c1107b 100644 --- a/edexOsgi/com.raytheon.edex.utilitysrv/src/com/raytheon/edex/services/GetServersHandler.java +++ b/edexOsgi/com.raytheon.edex.utilitysrv/src/com/raytheon/edex/services/GetServersHandler.java @@ -43,6 +43,8 @@ import com.raytheon.uf.common.util.registry.GenericRegistry; * Jan 14, 2013 1469 bkowal No longer includes the hdf5 data directory * in the response. * May 28, 2013 1989 njensen Uses env variables instead of system props + * Aug 27, 2013 2295 bkowal Return the entire jms connection url in + * the response. * * * @@ -61,18 +63,41 @@ public class GetServersHandler extends GenericRegistry GetServersResponse response = new GetServersResponse(); String httpServer = System.getenv("HTTP_SERVER"); String jmsServer = System.getenv("JMS_SERVER"); + String jmsVirtualHost = System.getenv("JMS_VIRTUALHOST"); String pypiesServer = System.getenv("PYPIES_SERVER"); + String jmsConnectionString = this.constructJMSConnectionString( + jmsServer, jmsVirtualHost); logger.info("http.server=" + httpServer); logger.info("jms.server=" + jmsServer); + logger.info("jms.virtualhost=" + jmsVirtualHost); logger.info("pypies.server=" + pypiesServer); logger.info("server locations=" + registry); ; response.setHttpServer(httpServer); - response.setJmsServer(jmsServer); + response.setJmsConnectionString(jmsConnectionString); response.setPypiesServer(pypiesServer); response.setServerLocations(Collections.unmodifiableMap(this.registry)); return response; } + + // do not enable retry/connectdelay connection and factory will + // silently reconnect and user will never be notified qpid is down + // and cave/text workstation will just act like they are hung + // up to each individual component that opens a connection to handle + // reconnect + private String constructJMSConnectionString(String jmsServer, + String jmsVirtualHost) { + /* build the connection String that CAVE will use. */ + StringBuilder stringBuilder = new StringBuilder( + "amqp://guest:guest@__WSID__/"); + stringBuilder.append(jmsVirtualHost); + stringBuilder.append("?brokerlist='"); + stringBuilder.append(jmsServer); + stringBuilder + .append("?connecttimeout='5000'&heartbeat='0''&maxprefetch='10'&sync_publish='all'&failover='nofailover'&sync_ack='true'"); + + return stringBuilder.toString(); + } } diff --git a/edexOsgi/com.raytheon.uf.common.archive/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.common.archive/META-INF/MANIFEST.MF index 7fa1445e69..fdbfc9a0b5 100644 --- a/edexOsgi/com.raytheon.uf.common.archive/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.common.archive/META-INF/MANIFEST.MF @@ -6,9 +6,14 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: RAYTHEON Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Export-Package: com.raytheon.uf.common.archive.config, - com.raytheon.uf.common.archive.exception + com.raytheon.uf.common.archive.config.select, + com.raytheon.uf.common.archive.exception, + com.raytheon.uf.common.archive.request Require-Bundle: com.raytheon.uf.common.util, com.raytheon.uf.common.localization, com.raytheon.uf.common.status, org.apache.commons.io, - com.raytheon.uf.common.time + com.raytheon.uf.common.time, + com.raytheon.uf.common.serialization;bundle-version="1.12.1174", + com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174", + com.raytheon.uf.common.auth;bundle-version="1.12.1174" diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java index ae9dc87732..7c7c470ed5 100644 --- a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConfigManager.java @@ -21,6 +21,8 @@ package com.raytheon.uf.common.archive.config; import java.io.File; import java.io.FileFilter; +import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.IOException; import java.text.FieldPosition; import java.text.MessageFormat; @@ -30,10 +32,11 @@ import java.util.Calendar; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.TimeZone; -import java.util.TreeSet; +import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -46,6 +49,9 @@ import org.apache.commons.io.filefilter.FileFilterUtils; import org.apache.commons.io.filefilter.IOFileFilter; import org.apache.commons.io.filefilter.RegexFileFilter; +import com.raytheon.uf.common.archive.config.ArchiveConstants.Type; +import com.raytheon.uf.common.archive.config.select.ArchiveSelect; +import com.raytheon.uf.common.archive.config.select.CategorySelect; import com.raytheon.uf.common.archive.exception.ArchiveException; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; @@ -56,6 +62,7 @@ import com.raytheon.uf.common.localization.LocalizationFileInputStream; import com.raytheon.uf.common.localization.LocalizationFileOutputStream; import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.exception.LocalizationException; +import com.raytheon.uf.common.localization.exception.LocalizationOpFailedException; import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus.Priority; @@ -78,7 +85,9 @@ import com.raytheon.uf.common.util.FileUtil; * Added null check for topLevelDirs in purgeExpiredFromArchive. * Changed to use File.delete() instead of Apache FileUtil.deleteQuietly(). * Added warn logging for failure to delete. - * + * Jul 24, 2013 2221 rferrel Changes for select configuration. + * Aug 06, 2013 2224 rferrel Changes to use DataSet. + * Aug 28, 2013 2299 rferrel purgeExpiredFromArchive now returns the number of files purged. * * * @author rferrel @@ -95,7 +104,7 @@ public class ArchiveConfigManager { public final String ARCHIVE_DIR = "archiver/purger"; /** Localization manager. */ - private IPathManager pathMgr; + protected IPathManager pathMgr; private final Map archiveNameToLocalizationFileMap = new HashMap(); @@ -171,9 +180,34 @@ public class ArchiveConfigManager { } /** + * Obtain the collection of Archives setting the Categories' selections + * based on the default retention selections. + * * @return the Collection of Archives. */ public Collection getArchives() { + String fileName = ArchiveConstants.selectFileName(Type.Retention, null); + SelectConfig selections = loadSelection(fileName); + if (selections != null && !selections.isEmpty()) { + try { + for (ArchiveSelect archiveSelect : selections.getArchiveList()) { + ArchiveConfig archiveConfig = archiveMap.get(archiveSelect + .getName()); + for (CategorySelect categorySelect : archiveSelect + .getCategorySelectList()) { + CategoryConfig categoryConfig = archiveConfig + .getCategory(categorySelect.getName()); + categoryConfig.setSelectedDisplayNames(categorySelect + .getSelectList()); + } + } + } catch (NullPointerException ex) { + statusHandler + .handle(Priority.ERROR, + "Retention selection and Archive configuration no longer in sync: ", + ex); + } + } return archiveMap.values(); } @@ -254,18 +288,22 @@ public class ArchiveConfigManager { * Archive. * * @param archive - * @return the list of expired Files purged + * @return purgeCount */ - public Collection purgeExpiredFromArchive(ArchiveConfig archive) { - Collection filesPurged = new ArrayList(); + public int purgeExpiredFromArchive(ArchiveConfig archive) { String archiveRootDirPath = archive.getRootDir(); File archiveRootDir = new File(archiveRootDirPath); + String[] topLevelDirs = archiveRootDir.list(); + List topLevelDirsNotPurged = new ArrayList(); + int purgeCount = 0; if (topLevelDirs != null) { topLevelDirsNotPurged.addAll(Arrays.asList(topLevelDirs)); + topLevelDirs = null; } + for (CategoryConfig category : archive.getCategoryList()) { Calendar purgeTime = calculateExpiration(archive, category); CategoryFileDateHelper helper = new CategoryFileDateHelper( @@ -289,68 +327,92 @@ public class ArchiveConfigManager { List displayFiles = getDisplayFiles(display, null, purgeTime); for (File file : displayFiles) { - filesPurged.addAll(purgeFile(file, fileDateFilter, - archiveRootDirPath)); + purgeCount += purgeFile(file, fileDateFilter); } } } // check for other expired in top level directories not covered - // by the categories in the archives + // by the categories in the archive. Calendar defaultPurgeTime = calculateExpiration(archive, null); + IOFileFilter fileDateFilter = FileFilterUtils.and(FileFilterUtils + .fileFileFilter(), new FileDateFilter(null, defaultPurgeTime)); for (String topDirName : topLevelDirsNotPurged) { - IOFileFilter fileDateFilter = FileFilterUtils.and(FileFilterUtils - .fileFileFilter(), new FileDateFilter(null, - defaultPurgeTime)); File topLevelDir = new File(archiveRootDir, topDirName); - filesPurged.addAll(purgeFile(topLevelDir, fileDateFilter, - archiveRootDirPath)); + // Keep both top level hidden files and hidden directories. + if (!topLevelDir.isHidden()) { + purgeCount += purgeFile(topLevelDir, fileDateFilter); + } } - return filesPurged; + return purgeCount; } - private Collection purgeFile(File fileToPurge, IOFileFilter filter, - final String archiveRootDir) { - Collection filesPurged = new ArrayList(); + /** + * Recursive method for purging files. Never pass in a directory you do not + * want deleted when purging makes it an empty directory. + * + * @param fileToPurge + * @param filter + * @return purgeCount number of files and directories purged + */ + private int purgeFile(File fileToPurge, IOFileFilter filter) { + int purgeCount = 0; if (fileToPurge.isFile() && filter.accept(fileToPurge)) { if (fileToPurge.delete()) { - filesPurged.add(fileToPurge); + ++purgeCount; + if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { + statusHandler.debug("Purged file: \"" + + fileToPurge.getAbsolutePath() + "\""); + } } else { statusHandler.warn("Failed to purge file: " + fileToPurge.getAbsolutePath()); } - } else if (fileToPurge.isDirectory()) { - Collection expiredFilesInDir = FileUtils.listFiles( - fileToPurge, filter, FileFilterUtils.trueFileFilter()); + } else if (fileToPurge.isDirectory() && !fileToPurge.isHidden()) { + // Purge only visible directories. + File[] expiredFilesInDir = fileToPurge.listFiles(); for (File dirFile : expiredFilesInDir) { - filesPurged.addAll(purgeFile(dirFile, filter, archiveRootDir)); + purgeCount += purgeFile(dirFile, filter); } - // if the directory is empty and not the archive root dir, then - // delete it - if (fileToPurge.list().length == 0 - && !fileToPurge.getAbsolutePath().equals(archiveRootDir)) { + // Attempt to delete empty directory. + if ((purgeCount >= expiredFilesInDir.length) + && (fileToPurge.list().length == 0)) { if (!fileToPurge.delete()) { statusHandler.warn("Failed to purge directory: " + fileToPurge.getAbsolutePath()); + } else { + ++purgeCount; + if (statusHandler.isPriorityEnabled(Priority.DEBUG)) { + statusHandler.debug("Purged directory: \"" + + fileToPurge.getAbsolutePath() + + File.separator + "\""); + } } } } - return filesPurged; + return purgeCount; } + /** + * Get expiration time for the category. + * + * @param archive + * @param category + * @return expireCal + */ private Calendar calculateExpiration(ArchiveConfig archive, CategoryConfig category) { - Calendar newCal = TimeUtil.newGmtCalendar(); + Calendar expireCal = TimeUtil.newGmtCalendar(); int retHours = category == null || category.getRetentionHours() == 0 ? archive .getRetentionHours() : category.getRetentionHours(); if (retHours != 0) { - newCal.add(Calendar.HOUR, (-1) * retHours); + expireCal.add(Calendar.HOUR, (-1) * retHours); } - return newCal; + return expireCal; } /** @@ -497,91 +559,79 @@ public class ArchiveConfigManager { */ private List getDisplayFiles(DisplayData displayData, long startTime, long endTime) { + List fileList = new LinkedList(); ArchiveConfig archiveConfig = displayData.archiveConfig; - CategoryConfig categoryConfig = displayData.categoryConfig; - String[] indexValues = categoryConfig.getDateGroupIndices().split( - "\\s*,\\s*"); - int yearIndex = Integer.parseInt(indexValues[0]); - int monthIndex = Integer.parseInt(indexValues[1]); - int dayIndex = Integer.parseInt(indexValues[2]); - int hourIndex = Integer.parseInt(indexValues[3]); + for (CategoryDataSet dataSet : displayData.dataSets) { - String filePatternStr = categoryConfig.getFilePattern(); + int[] timeIndices = dataSet.getTimeIndices(); - boolean dirOnly = (filePatternStr == null) - || ".*".equals(filePatternStr); + String filePatternStr = dataSet.getFilePattern(); - List dirs = displayData.dirs; + boolean dirOnly = dataSet.isDirOnly(); - int beginIndex = archiveConfig.getRootDir().length(); + List dirs = displayData.dirsMap.get(dataSet); - Calendar fileCal = TimeUtil.newCalendar(); - fileCal.setTimeZone(TimeZone.getTimeZone("UTC")); + int beginIndex = archiveConfig.getRootDir().length(); - List fileList = new ArrayList(); + Calendar fileCal = TimeUtil.newCalendar(); + fileCal.setTimeZone(TimeZone.getTimeZone("UTC")); - if (dirOnly) { - for (String dirPattern : categoryConfig.getDirPatternList()) { - Pattern pattern = Pattern.compile(dirPattern); + if (dirOnly) { + for (String dirPattern : dataSet.getDirPatterns()) { + Pattern pattern = dataSet.getPattern(dirPattern); - for (File dir : dirs) { - String path = dir.getAbsolutePath().substring(beginIndex); - Matcher matcher = pattern.matcher(path); - if (matcher.matches()) { - int year = Integer.parseInt(matcher.group(yearIndex)); - // Adjust month value to Calendar's 0 - 11 - int month = Integer.parseInt(matcher.group(monthIndex)) - 1; - int day = Integer.parseInt(matcher.group(dayIndex)); - int hour = Integer.parseInt(matcher.group(hourIndex)); - fileCal.set(year, month, day, hour, 0, 0); - long fileTime = fileCal.getTimeInMillis(); - if ((startTime <= fileTime) && (fileTime < endTime)) { - fileList.add(dir); - } - } - } - } - } else { - for (String dirPattern : categoryConfig.getDirPatternList()) { - Pattern pattern = Pattern.compile(dirPattern + File.separator - + categoryConfig.getFilePattern()); - final Pattern filePattern = Pattern.compile("^" - + filePatternStr + "$"); - for (File dir : dirs) { - List fList = FileUtil.listDirFiles(dir, - new FileFilter() { - - @Override - public boolean accept(File pathname) { - return filePattern.matcher( - pathname.getName()).matches(); - } - }, false); - for (File file : fList) { - String path = file.getAbsolutePath().substring( + for (File dir : dirs) { + String path = dir.getAbsolutePath().substring( beginIndex); Matcher matcher = pattern.matcher(path); if (matcher.matches()) { - int year = Integer.parseInt(matcher - .group(yearIndex)); - // Adjust month value to Calendar's 0 - 11 - int month = Integer.parseInt(matcher - .group(monthIndex)) - 1; - int day = Integer.parseInt(matcher.group(dayIndex)); - int hour = Integer.parseInt(matcher - .group(hourIndex)); - fileCal.set(year, month, day, hour, 0, 0); - long fileTime = fileCal.getTimeInMillis(); + Long fileTime = dataSet.getMatchTimeInMilliseconds( + timeIndices, matcher); + if (fileTime == null) { + fileTime = dir.lastModified(); + } if ((startTime <= fileTime) && (fileTime < endTime)) { - fileList.add(file); + fileList.add(dir); + } + } + } + } + } else { + for (String dirPattern : dataSet.getDirPatterns()) { + Pattern pattern = dataSet.getPattern(dirPattern); + final Pattern filePattern = Pattern.compile("^" + + filePatternStr + "$"); + for (File dir : dirs) { + List fList = FileUtil.listDirFiles(dir, + new FileFilter() { + + @Override + public boolean accept(File pathname) { + return filePattern.matcher( + pathname.getName()).matches(); + } + }, false); + for (File file : fList) { + String path = file.getAbsolutePath().substring( + beginIndex); + Matcher matcher = pattern.matcher(path); + if (matcher.matches()) { + Long timestamp = dataSet + .getMatchTimeInMilliseconds( + timeIndices, matcher); + long fileTime = timestamp == null ? file + .lastModified() : timestamp.longValue(); + if ((startTime <= fileTime) + && (fileTime < endTime)) { + fileList.add(file); + } } } } } } } - return fileList; } @@ -593,15 +643,13 @@ public class ArchiveConfigManager { * @param categoryConfig * @return dirs */ - private List getDirs(ArchiveConfig archiveConfig, - CategoryConfig categoryConfig) { + private List getDirs(File rootFile, CategoryDataSet dataSet) { List resultDirs = new ArrayList(); - File rootFile = new File(archiveConfig.getRootDir()); List dirs = new ArrayList(); List tmpDirs = new ArrayList(); List swpDirs = null; - for (String dirPattern : categoryConfig.getDirPatternList()) { + for (String dirPattern : dataSet.getDirPatterns()) { String[] subExpr = dirPattern.split(File.separator); dirs.clear(); dirs.add(rootFile); @@ -630,20 +678,6 @@ public class ArchiveConfigManager { return resultDirs; } - /** - * Get the Display labels matching the pattern for the archive data's - * category. Assumes the archive data's root directory is the mount point to - * start the search. - * - * @param archiveName - * @param categoryName - * @return displayInfoList order by display label - */ - public List getDisplayData(String archiveName, - String categoryName) { - return getDisplayData(archiveName, categoryName, false); - } - /** * Get the Display labels matching the pattern for the archive data's * category. Assumes the archive data's root directory is the mount point to @@ -661,50 +695,60 @@ public class ArchiveConfigManager { Map> displayMap = new HashMap>(); ArchiveConfig archiveConfig = archiveMap.get(archiveName); + String rootDirName = archiveConfig.getRootDir(); CategoryConfig categoryConfig = findCategory(archiveConfig, categoryName); - List dirPatternList = categoryConfig.getDirPatternList(); + File rootFile = new File(rootDirName); + TreeMap displays = new TreeMap(); + for (CategoryDataSet dataSet : categoryConfig.getDataSetList()) { + List dataSetDirPatterns = dataSet.getDirPatterns(); - // index for making directory paths' relative to the root path. - List dirs = getDirs(archiveConfig, categoryConfig); + List dirs = getDirs(rootFile, dataSet); - File rootFile = new File(archiveMap.get(archiveName).getRootDir()); - int beginIndex = rootFile.getAbsolutePath().length() + 1; - List patterns = new ArrayList(dirPatternList.size()); + int beginIndex = rootFile.getAbsolutePath().length() + 1; + List patterns = new ArrayList( + dataSetDirPatterns.size()); - for (String dirPattern : dirPatternList) { - Pattern pattern = Pattern.compile("^" + dirPattern + "$"); - patterns.add(pattern); - } + for (String dirPattern : dataSetDirPatterns) { + Pattern pattern = Pattern.compile("^" + dirPattern + "$"); + patterns.add(pattern); + } - TreeSet displays = new TreeSet( - String.CASE_INSENSITIVE_ORDER); + MessageFormat msgfmt = new MessageFormat(dataSet.getDisplayLabel()); + StringBuffer sb = new StringBuffer(); + FieldPosition pos0 = new FieldPosition(0); - MessageFormat msgfmt = new MessageFormat(categoryConfig.getDisplay()); - StringBuffer sb = new StringBuffer(); - FieldPosition pos0 = new FieldPosition(0); + for (File dir : dirs) { + String path = dir.getAbsolutePath().substring(beginIndex); + for (Pattern pattern : patterns) { + Matcher matcher = pattern.matcher(path); + if (matcher.matches()) { + sb.setLength(0); + String[] args = new String[matcher.groupCount() + 1]; + args[0] = matcher.group(); + for (int i = 1; i < args.length; ++i) { + args[i] = matcher.group(i); + } + String displayLabel = msgfmt.format(args, sb, pos0) + .toString(); + List displayDirs = displayMap.get(displayLabel); + if (displayDirs == null) { + displayDirs = new ArrayList(); + displayMap.put(displayLabel, displayDirs); + } + displayDirs.add(dir); + DisplayData displayData = displays.get(displayLabel); + if (displayData == null) { + displayData = new DisplayData(archiveConfig, + categoryConfig, dataSet, displayLabel); + displays.put(displayLabel, displayData); + } else if (!displayData.dataSets.contains(dataSet)) { + displayData.dataSets.add(dataSet); + } - for (File dir : dirs) { - String path = dir.getAbsolutePath().substring(beginIndex); - for (Pattern pattern : patterns) { - Matcher matcher = pattern.matcher(path); - if (matcher.matches()) { - sb.setLength(0); - String[] args = new String[matcher.groupCount() + 1]; - args[0] = matcher.group(); - for (int i = 1; i < args.length; ++i) { - args[i] = matcher.group(i); + displayData.dirsMap.put(dataSet, displayDirs); + break; } - String displayLabel = msgfmt.format(args, sb, pos0) - .toString(); - List displayDirs = displayMap.get(displayLabel); - if (displayDirs == null) { - displayDirs = new ArrayList(); - displayMap.put(displayLabel, displayDirs); - } - displayDirs.add(dir); - displays.add(displayLabel); - break; } } } @@ -712,15 +756,7 @@ public class ArchiveConfigManager { List displayDataList = new ArrayList( displays.size()); - for (String displayLabel : displays) { - DisplayData displayData = new DisplayData(archiveConfig, - categoryConfig, displayLabel, displayMap.get(displayLabel)); - if (setSelect) { - displayData.setSelected(categoryConfig - .getSelectedDisplayNames().contains(displayLabel)); - } - displayDataList.add(displayData); - } + displayDataList.addAll(displays.values()); return displayDataList; } @@ -788,4 +824,176 @@ public class ArchiveConfigManager { return archiveConfig; } + /** + * Delete the selection localized site configuration file. + * + * @param fileName + * @throws LocalizationOpFailedException + */ + public void deleteSelection(String fileName) + throws LocalizationOpFailedException { + LocalizationContext siteContext = pathMgr.getContext( + LocalizationType.COMMON_STATIC, LocalizationLevel.SITE); + LocalizationFile lFile = pathMgr.getLocalizationFile(siteContext, + ARCHIVE_DIR + "/" + fileName); + lFile.delete(); + } + + /** + * Load the localized site select configuration file. + * + * @param fileName + * @return selectConfig + */ + public SelectConfig loadSelection(String fileName) { + SelectConfig selections = null; + LocalizationContext siteContext = pathMgr.getContext( + LocalizationType.COMMON_STATIC, LocalizationLevel.SITE); + LocalizationFile lFile = pathMgr.getLocalizationFile(siteContext, + ARCHIVE_DIR + "/" + fileName); + if (lFile.exists()) { + FileInputStream stream = null; + try { + stream = lFile.openInputStream(); + selections = unmarshallSelectionStream(stream); + } catch (LocalizationException e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), + e); + } catch (IOException e) { + statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), + e); + } finally { + if (stream != null) { + try { + stream.close(); + } catch (IOException ex) { + // Ignore + } + } + } + } + return selections; + } + + // TODO possible future methods for supporting importing and exporting + // select configurations. + // + // public SelectConfig importSelections(File selectFile) throws IOException + // { + // SelectConfig selections = null; + // FileInputStream stream = new FileInputStream(selectFile); + // selections = unmarshallSelectionStream(stream); + // return selections; + // } + // + // public boolean exportSelections(SelectConfig selections, File selectFile) + // throws IOException, LocalizationException { + // FileOutputStream stream = null; + // try { + // stream = new FileOutputStream(selectFile); + // marshalSelectStream(selections, stream); + // } finally { + // if (stream != null) { + // try { + // stream.close(); + // } catch (IOException ex) { + // // Ignore + // } + // } + // } + // return false; + // } + + /** + * Get a list of selection names based on the select configuration files in + * the type's directory. + * + * @param type + * @return selectNames + */ + public String[] getSelectionNames(ArchiveConstants.Type type) { + LocalizationFile[] files = pathMgr.listStaticFiles(ARCHIVE_DIR + + IPathManager.SEPARATOR + type.selectionDir, + new String[] { ArchiveConstants.configFileExt }, false, true); + String[] names = new String[files.length]; + int extLen = ArchiveConstants.configFileExt.length(); + int i = 0; + StringBuilder sb = new StringBuilder(); + for (LocalizationFile lFile : files) { + sb.setLength(0); + sb.append(lFile.getName()); + sb.setLength(sb.length() - extLen); + names[i] = sb.substring(sb.lastIndexOf(IPathManager.SEPARATOR) + 1); + ++i; + } + Arrays.sort(names, String.CASE_INSENSITIVE_ORDER); + return names; + } + + /** + * Save the selections configuration in the desired file. + * + * @param selections + * @param fileName + * @throws LocalizationException + * @throws IOException + */ + public void saveSelections(SelectConfig selections, String fileName) + throws LocalizationException, IOException { + LocalizationFileOutputStream stream = null; + LocalizationContext siteContext = pathMgr.getContext( + LocalizationType.COMMON_STATIC, LocalizationLevel.SITE); + LocalizationFile lFile = pathMgr.getLocalizationFile(siteContext, + ARCHIVE_DIR + IPathManager.SEPARATOR + fileName); + + try { + stream = lFile.openOutputStream(); + marshalSelectStream(selections, stream); + } finally { + if (stream != null) { + try { + stream.closeAndSave(); + } catch (Exception ex) { + // Ignore + } + } + } + } + + /** + * load select configuration from the stream. + * + * @param stream + * @return selectConfig + * @throws IOException + */ + private SelectConfig unmarshallSelectionStream(FileInputStream stream) + throws IOException { + SelectConfig selections = null; + try { + selections = JAXB.unmarshal(stream, SelectConfig.class); + } finally { + if (stream != null) { + try { + stream.close(); + } catch (IOException ex) { + // ignore + } + } + } + return selections; + } + + /** + * Save select configuration to the desired stream. + * + * @param selections + * @param stream + * @throws IOException + * @throws LocalizationException + */ + private void marshalSelectStream(SelectConfig selections, + FileOutputStream stream) throws IOException, LocalizationException { + JAXB.marshal(selections, stream); + } } diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConstants.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConstants.java new file mode 100644 index 0000000000..71f1e6af2c --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/ArchiveConstants.java @@ -0,0 +1,112 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.common.archive.config; + +import java.util.regex.Pattern; + +import com.raytheon.uf.common.localization.IPathManager; + +/** + * Constants used by purger and GUIs. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 23, 2013 #2221      rferrel     Initial creation
+ * Aug 26, 2013 #2225      rferrel     Added tar extension.
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ + +public class ArchiveConstants { + + /** Pattern to find slashes in a string. */ + private final static Pattern slashPattern = Pattern.compile("[/\\\\]+"); + + /** Pattern to find white space in a string. */ + private final static Pattern wsPattern = Pattern.compile("\\s+"); + + /** Default selection name to display. */ + public static final String defaultSelectName = "DEFAULT"; + + /** Extension to use for creating a configuration's file name. */ + public static final String configFileExt = ".xml"; + + /** Types of select configuration and their relative localized directory. */ + public enum Type { + Retention("retention" + IPathManager.SEPARATOR), Case("case" + + IPathManager.SEPARATOR); + + public final String selectionDir; + + private Type(String selectionDir) { + this.selectionDir = selectionDir; + } + } + + /** Extension for compressed tar files. */ + public final static String TAR_EXTENSION = ".tgz"; + + /** + * Do not allow an instance of this class. + */ + private ArchiveConstants() { + } + + /** + * Get relative path file name for a select configuration file based on type + * and name. + * + * @param type + * @param name + * - when null use the default select name. + * @return fileName + */ + public static final String selectFileName(Type type, String name) { + String fileName = name; + if (fileName == null) { + fileName = defaultSelectName; + } else { + fileName = convertToFileName(name); + } + return type.selectionDir + fileName + configFileExt; + } + + /** + * Convert name to fileName by trimming whitespace, converting slashes to + * hyphens and embedded whitespace to underscore. + * + * @param name + * - must not be null + * @return fileName + */ + public static final String convertToFileName(String name) { + String fileName = name.trim(); + fileName = slashPattern.matcher(fileName).replaceAll("-"); + fileName = wsPattern.matcher(fileName).replaceAll("_"); + return fileName; + } +} diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryConfig.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryConfig.java index a97dcf22d3..42f5ba8d9a 100644 --- a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryConfig.java +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryConfig.java @@ -39,10 +39,13 @@ import javax.xml.bind.annotation.XmlRootElement; * <name>redbook</name> * <!-- When 0 default to the parent archive's retentionHours --> * <retentionHours>0</retentionHours> - * <dirPattern>hdf5/(redbook)</dirPattern> - * <displayLabel>{1}</displayLabel> - * <filePattern>redbook-(\d{4})-(\d{2})-(\d{2})-(\d{2})\..*</filePattern> - * <dateGroupIndices>2,3,4,5</dateGroupIndices> + * <dataSet> + * <dirPattern>hdf5/(redbook)</dirPattern> + * <displayLabel>{1}</displayLabel> + * <filePattern>redbook-(\d{4})-(\d{2})-(\d{2})-(\d{2})\..*</filePattern> + * <timeType>Date</timeType> + * <dateGroupIndices>2,3,4,5</dateGroupIndices> + * </dataSet> * </category> * * @@ -52,9 +55,12 @@ import javax.xml.bind.annotation.XmlRootElement; * <category> * <name>Model grib</name> * <retentionHours>0</retentionHours> - * <dirPattern>grib/(\d{4})(\d{2})(\d{2})/(\d{2})/(.*)</dirPattern> - * <displayLabel>{5}</displayLabel> - * <dateGroupIndices>1,2,3,4</dateGroupIndices> + * <dataSet> + * <dirPattern>grib/(\d{4})(\d{2})(\d{2})/(\d{2})/(.*)</dirPattern> + * <displayLabel>{5}</displayLabel> + * <timeType>Date</timeType> + * <dateGroupIndices>1,2,3,4</dateGroupIndices> + * </dataSet> * </category> * * @@ -65,6 +71,7 @@ import javax.xml.bind.annotation.XmlRootElement; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 1, 2013 1966 rferrel Initial creation + * Aug 03, 2013 2224 rferrel Changes to include DataSet. * * * @@ -88,63 +95,8 @@ public class CategoryConfig implements Comparable { @XmlElement(name = "extRetentionHours") private int retentionHours; - /** - * A regex pattern to find directories controlled by the category. These - * directories should be relative to the parent archive's directory. For - * example: - * - *
-     * <dirPattern>grib2/\d{8}/\d{2}/(.*)/</dirPattern>
-     * 
- */ - @XmlElement(name = "dirPattern") - private List dirPatternList; - - /** - * Use to display the information found by the dirPattern. Any groups in the - * dirPatern may be displayed. For example: - * - *
-     * <dirName>(grib2)/(\d{4})(\d{2})(\d{2})/(\d{2})/(.*)</dirName>
-     * <displayLabel>{1} - {6}</displayLabel>
-     * 
- * - * The {1} will be replaced by the first group (grib2) in the regex - * expression in dirName. The {6} is the sixth group (.*). {0} is the whole - * expression match. - */ - @XmlElement(name = "displayLabel") - private String display; - - /** - * A comma separated list of 4 numbers representing the group indices - * specifying the location of the numeric date time stamp. The indices must - * be in the order of year, month, day and hour. The group numbering starts - * with the first group in the dirPattern and continues with any grouping in - * the filePattern. - * - *
-     *   <dirPattern>hdf5/(redbook)</dirPattern>
-     *   <displayLabel>{1}</displayLabel>
-     *   <filePattern>redbook-(\d{4})-(\d{2})-(\d{2})-(\d{2})\..*</filePattern>
-     *   <dateGroupIndices>2,3,4,5</dateGroupIndices>
-     * 
- */ - @XmlElement(name = "dateGroupIndices") - private String dateGroupIndices; - - /** - * A saveDir directory may contain files with data for several days. This - * allows any of the year, month, day and hour to be part of a file name. - * Default is all files in the directory. For example: - * - *
-     * <saveDir>hd5/redbook/(^/]*//)</saveDir>
-     * <saveFile>redbook-${YYYY}-${MM}-${DD}-${HH}\..*<saveFiles>
-     * 
- */ - @XmlElement(name = "filePattern") - private String filePattern; + @XmlElement(name = "dataSet") + private List dataSetList; @XmlElement(name = "selectedDisplayName") private final Collection selectedDisplayNames = new TreeSet(); @@ -188,76 +140,12 @@ public class CategoryConfig implements Comparable { this.retentionHours = retentionHours; } - /** - * Obtain the list of directory patterns. - * - * @return dirPatternList - */ - public List getDirPatternList() { - return new ArrayList(dirPatternList); + public List getDataSetList() { + return new ArrayList(dataSetList); } - /** - * Set the directory pattern list; must not be null. - * - * @param dirPatternList - */ - public void setDirPatternList(List dirPatternList) { - this.dirPatternList = dirPatternList; - } - - /** - * Get the display label pattern. - * - * @return display - */ - public String getDisplay() { - return display == null ? "" : display; - } - - /** - * Set the display label pattern. - * - * @param display - */ - public void setDisplay(String display) { - this.display = display; - } - - /** - * Get the save directory pattern.. - * - * @return dateGroups - */ - public String getDateGroupIndices() { - return dateGroupIndices; - } - - /** - * Set the save directory pattern; must not be null. - * - * @param saveDir - */ - public void setDateGroupIndices(String dateGroupIndices) { - this.dateGroupIndices = dateGroupIndices; - } - - /** - * Get the save files pattern. - * - * @return saveFiles - */ - public String getFilePattern() { - return filePattern; - } - - /** - * Set the save files pattern; may be null. - * - * @param saveFiles - */ - public void setFilePattern(String filePattern) { - this.filePattern = filePattern; + public void setDataSetList(List dataSetList) { + this.dataSetList = dataSetList; } public Collection getSelectedDisplayNames() { @@ -285,9 +173,9 @@ public class CategoryConfig implements Comparable { */ @Override public int compareTo(CategoryConfig o) { - return getDisplay().compareToIgnoreCase(o.getDisplay()); + return getName().compareToIgnoreCase(o.getName()); } - + /* * (non-Javadoc) * @@ -298,13 +186,10 @@ public class CategoryConfig implements Comparable { StringBuilder sb = new StringBuilder(); sb.append("Category [ name: ").append(getName()); sb.append(", retentionHours: ").append(getRetentionHours()); - sb.append(", dirPatternList[ "); - for (String dirPattern : getDirPatternList()) { - sb.append(" \"").append(dirPattern).append("\","); + sb.append(", dataSetList[ "); + for (CategoryDataSet dataSet : getDataSetList()) { + sb.append(dataSet).append(", "); } - sb.append("], filePattern: ").append(getFilePattern()); - sb.append(", displayLabel: ").append(getDisplay()); - sb.append(", dateGroupIndices: ").append(getDateGroupIndices()); sb.append(", selectedDisplayNames: "); if (selectedDisplayNames == null) { sb.append("null"); diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryDataSet.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryDataSet.java new file mode 100644 index 0000000000..a68e9f887f --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryDataSet.java @@ -0,0 +1,294 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.common.archive.config; + +import java.io.File; +import java.util.Calendar; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.raytheon.uf.common.time.util.TimeUtil; + +/** + * A grouping of data set information used in a category. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Aug 6, 2013  #2224      rferrel     Initial creation
+ * Oct 02, 2013 #2147      rferrel     Allow Date to ignore hour in time stamp.
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ +@XmlAccessorType(XmlAccessType.NONE) +@XmlRootElement(name = "dataSet") +public class CategoryDataSet { + public static final int YEAR_INDEX = 0; + + public static final int MONTH_INDEX = 1; + + public static final int DAY_INDEX = 2; + + public static final int HOUR_INDEX = 3; + + public static final int TIMESTAMP_INDEX = 0; + + /** + * Types of times and the number of indices for getting the time stamp from + * patterns. + */ + public static enum TimeType { + Date(4), EpochSec(1), EpochMS(1), File(0); + + private final int numIndices; + + private TimeType(int numIndices) { + this.numIndices = numIndices; + } + + public int getNumGroupIndices() { + return numIndices; + } + } + + /** + * List of directory patterns. + */ + @XmlElement(name = "dirPattern") + private List dirPatterns; + + /** + * Optional file pattern. + */ + @XmlElement(name = "filePattern") + private String filePattern; + + @XmlElement(name = "timeType") + private TimeType timeType = TimeType.Date; + + /** + * The display label. + */ + @XmlElement(name = "displayLabel") + private String displayLabel; + + private int[] timeIndices = null; + + /** + * The index with group number for getting desired parts of the TimeType. + */ + @XmlElement(name = "dateGroupIndices") + private String dateGroupIndices = ""; + + public List getDirPatterns() { + return dirPatterns; + } + + public void setDirPatterns(List dirPatterns) { + this.dirPatterns = dirPatterns; + } + + public String getFilePattern() { + return filePattern; + } + + public void setFilePattern(String filePattern) { + this.filePattern = filePattern; + } + + public TimeType getTimeType() { + return timeType; + } + + public void setTimeType(TimeType timeType) { + this.timeType = timeType; + } + + public String getDisplayLabel() { + return displayLabel; + } + + public void setDisplayLabel(String displayLabel) { + this.displayLabel = displayLabel; + } + + public String getDateGroupIndices() { + return dateGroupIndices; + } + + public void setDateGroupIndices(String dateGroupIndices) { + this.dateGroupIndices = dateGroupIndices; + this.timeIndices = null; + } + + /** + * Get the array of time indices based on time type and date group indices. + * + * @return timeIndices + */ + public int[] getTimeIndices() { + if (timeIndices == null) { + timeIndices = new int[timeType.getNumGroupIndices()]; + if (timeIndices.length > 0) { + String[] indexValues = getDateGroupIndices().split("\\s*,\\s*"); + for (int index = 0; index < timeIndices.length; ++index) { + if (indexValues.length > index) { + timeIndices[index] = Integer + .parseInt(indexValues[index]); + } else { + timeIndices[index] = -1; + } + } + } + } + return timeIndices; + } + + /** + * Get the Pattern for dirPattern. + * + * @param dirPattern + * + * @return pattern or null if dirPattern not in the list of directory + * patterns. + */ + public Pattern getPattern(String dirPattern) { + Pattern pattern = null; + if (dirPatterns.contains(dirPattern)) { + if (isDirOnly()) { + pattern = Pattern.compile(dirPattern); + } else { + pattern = Pattern.compile(dirPattern + File.separator + + getFilePattern()); + } + } + return pattern; + } + + /** + * + * @return true when only the dirPatterns should be used. + */ + public boolean isDirOnly() { + return filePattern == null || filePattern.equals(".*"); + } + + /** + * Get time stamp for file based on time type. + * + * @param timeIndices + * @param matcher + * @return fileTime + */ + public Long getMatchTimeInMilliseconds(int[] timeIndices, Matcher matcher) { + return CategoryDataSet.getMatchTimeInMilliseconds(timeType, + timeIndices, matcher); + } + + /** + * Get file time based on time type. Assumes the matcher is set up matching + * a file's path name so the groups in the matcher can be used to get the + * time stamp. + * + * @param timeType + * @param timeIndices + * @param matcher + * @return fileTime or null if time type does not get time using the + * matcher. + */ + public static Long getMatchTimeInMilliseconds( + CategoryDataSet.TimeType timeType, int[] timeIndices, + Matcher matcher) { + Long fileTime = null; + switch (timeType) { + case Date: + Calendar fileCal = TimeUtil.newGmtCalendar(); + int year = Integer.parseInt(matcher + .group(timeIndices[CategoryDataSet.YEAR_INDEX])); + // Adjust month value to Calendar's 0 - 11 + int month = Integer.parseInt(matcher + .group(timeIndices[CategoryDataSet.MONTH_INDEX])) - 1; + int day = Integer.parseInt(matcher + .group(timeIndices[CategoryDataSet.DAY_INDEX])); + + // Default to last hour of the day. + int hour = 23; + + if (timeIndices[CategoryDataSet.HOUR_INDEX] >= 0) { + hour = Integer.parseInt(matcher + .group(timeIndices[CategoryDataSet.HOUR_INDEX])); + } + + fileCal.set(year, month, day, hour, 0, 0); + fileTime = fileCal.getTimeInMillis(); + break; + case EpochMS: + fileTime = Long.parseLong(matcher + .group(timeIndices[CategoryDataSet.TIMESTAMP_INDEX])); + break; + case EpochSec: + fileTime = Long.parseLong(matcher + .group(timeIndices[CategoryDataSet.TIMESTAMP_INDEX])); + fileTime *= TimeUtil.MILLIS_PER_SECOND; + break; + case File: + fileTime = null; + break; + default: + fileTime = null; + break; + } + return fileTime; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder("DataSet[ "); + sb.append("TimeType: ").append(getTimeType()); + sb.append(", dateGroupIndices: ").append(getDateGroupIndices()); + sb.append(", isDirOnly: ").append(isDirOnly()); + sb.append(", displayLabel: ").append(getDisplayLabel()); + sb.append(", dirPatterns[ "); + for (String dirPattern : getDirPatterns()) { + sb.append(dirPattern).append(", "); + } + sb.append("], filePattern: ").append( + filePattern == null ? "null" : filePattern); + sb.append("]"); + return sb.toString(); + } +} diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryFileDateHelper.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryFileDateHelper.java index 4534160878..6f87b7e73d 100644 --- a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryFileDateHelper.java +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/CategoryFileDateHelper.java @@ -40,6 +40,8 @@ import com.raytheon.uf.common.time.util.TimeUtil; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jun 21, 2013 1965 bgonzale Initial creation + * Aug 03, 2013 2224 rferrel Changes for new configuration files. + * Aug 28, 2013 2299 rferrel Changes in IFileDateHelper. * * * @@ -56,13 +58,11 @@ public class CategoryFileDateHelper implements IFileDateHelper { private final Pattern categoryTopLevelDirPattern; - private final int yearIndex; + private final CategoryDataSet.TimeType timeType; - private final int monthIndex; + private final boolean isDirOnly; - private final int dayIndex; - - private final int hourIndex; + private final int[] timeIndices; /** * Initialization constructor. @@ -76,13 +76,13 @@ public class CategoryFileDateHelper implements IFileDateHelper { */ public CategoryDateInfo(Pattern datePattern, Pattern categoryTopLevelDirPattern, - int yearIndex, int monthIndex, int dayIndex, int hourIndex) { + CategoryDataSet.TimeType timeType, boolean isDirOnly, + int[] timeIndices) { this.datePattern = datePattern; this.categoryTopLevelDirPattern = categoryTopLevelDirPattern; - this.yearIndex = yearIndex; - this.monthIndex = monthIndex; - this.dayIndex = dayIndex; - this.hourIndex = hourIndex; + this.timeType = timeType; + this.isDirOnly = isDirOnly; + this.timeIndices = timeIndices; } } @@ -91,8 +91,6 @@ public class CategoryFileDateHelper implements IFileDateHelper { private final String rootDir; - private final boolean isDirOnly; - /** * Initialization constructor. * @@ -101,38 +99,37 @@ public class CategoryFileDateHelper implements IFileDateHelper { * categoryTopLevelDirPattern */ public CategoryFileDateHelper(CategoryConfig config, String rootDir) { - List categoryDirPatternList = config.getDirPatternList(); - this.dateInfoList = new ArrayList( - categoryDirPatternList.size()); - - String filePatternStr = config.getFilePattern(); this.rootDir = rootDir; - this.isDirOnly = (filePatternStr == null) - || ".*".equals(filePatternStr); + List categoryDataSetList = config.getDataSetList(); + int size = 0; + for (CategoryDataSet dataSet : categoryDataSetList) { + size += dataSet.getDirPatterns().size(); + } - for (String patternString : categoryDirPatternList) { - Pattern datePattern = null; - if (isDirOnly) { - datePattern = Pattern.compile(patternString); - } else { - datePattern = Pattern.compile(patternString + File.separator - + config.getFilePattern()); + this.dateInfoList = new ArrayList( + size); + + boolean isDirOnly; + CategoryDataSet.TimeType timeType; + for (CategoryDataSet dataSet : categoryDataSetList) { + isDirOnly = dataSet.isDirOnly(); + timeType = dataSet.getTimeType(); + + for (String patternString : dataSet.getDirPatterns()) { + Pattern datePattern = dataSet.getPattern(patternString); + int dirSeparatorIndex = patternString + .indexOf(File.separatorChar); + patternString = dirSeparatorIndex > patternString.length() + || dirSeparatorIndex < 0 ? patternString + : patternString.substring(0, dirSeparatorIndex); + Pattern categoryTopLevelDirPattern = Pattern + .compile(patternString); + int[] timeIndices = dataSet.getTimeIndices(); + + dateInfoList.add(new CategoryDateInfo(datePattern, + categoryTopLevelDirPattern, timeType, isDirOnly, + timeIndices)); } - int dirSeparatorIndex = patternString.indexOf(File.separatorChar); - patternString = dirSeparatorIndex > patternString.length() - || dirSeparatorIndex < 0 ? patternString : patternString - .substring(0, dirSeparatorIndex); - Pattern categoryTopLevelDirPattern = Pattern.compile(patternString); - String[] indexValues = config.getDateGroupIndices().split( - "\\s*,\\s*"); - int yearIndex = Integer.parseInt(indexValues[0]); - int monthIndex = Integer.parseInt(indexValues[1]); - int dayIndex = Integer.parseInt(indexValues[2]); - int hourIndex = Integer.parseInt(indexValues[3]); - - dateInfoList.add(new CategoryDateInfo(datePattern, - categoryTopLevelDirPattern, yearIndex, monthIndex, - dayIndex, hourIndex)); } } @@ -141,40 +138,43 @@ public class CategoryFileDateHelper implements IFileDateHelper { * * @see * com.raytheon.uf.common.archive.config.IFileDateHelper#getFileDate(java - * .lang.String) + * .io.File) */ @Override - public Calendar getFileDate(String filenamePath) { - String pathForPatternCheck = filenamePath.substring(rootDir.length()); - pathForPatternCheck = isDirOnly ? FilenameUtils - .getFullPathNoEndSeparator(pathForPatternCheck) - : pathForPatternCheck; + public Calendar getFileDate(File file) { + String filenamePath = file.getAbsolutePath(); + String pathForFilePatternCheck = filenamePath.substring(rootDir + .length()); + String pathForDirPatternCheck = FilenameUtils + .getFullPathNoEndSeparator(pathForFilePatternCheck); Calendar result = null; + Long timestamp = null; for (CategoryDateInfo dateInfo : dateInfoList) { - Matcher matcher = dateInfo.datePattern.matcher(pathForPatternCheck); + Matcher matcher = null; + if (dateInfo.isDirOnly) { + matcher = dateInfo.datePattern.matcher(pathForDirPatternCheck); + } else { + matcher = dateInfo.datePattern.matcher(pathForFilePatternCheck); + } if (matcher.matches()) { - int year = Integer.parseInt(matcher.group(dateInfo.yearIndex)); - // Adjust month value to Calendar's 0 - 11 - int month = Integer - .parseInt(matcher.group(dateInfo.monthIndex)) - 1; - int day = Integer.parseInt(matcher.group(dateInfo.dayIndex)); - int hour = Integer.parseInt(matcher.group(dateInfo.hourIndex)); - - result = TimeUtil.newGmtCalendar(); - result.set(year, month, day, hour, 0, 0); + timestamp = CategoryDataSet.getMatchTimeInMilliseconds( + dateInfo.timeType, dateInfo.timeIndices, matcher); break; } } - if (result == null) { - // no matching pattern, use file last modified date - File file = new File(filenamePath); - long lastModifiedMillis = file.lastModified(); - result = TimeUtil.newGmtCalendar(); - result.setTimeInMillis(lastModifiedMillis); + if (timestamp == null) { + // no matching pattern, use file last modified date + timestamp = file.lastModified(); } + + // TODO future speed improvement refactor IFileDateHelper to have a + // method that returns a long instead of Calendar. That will prevent + // converting Calendar to long then back to a Calendar. + result = TimeUtil.newGmtCalendar(); + result.setTimeInMillis(timestamp); return result; } diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/DisplayData.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/DisplayData.java index a1d7f5ee19..7f6d22cadc 100644 --- a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/DisplayData.java +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/DisplayData.java @@ -1,8 +1,11 @@ package com.raytheon.uf.common.archive.config; import java.io.File; +import java.util.ArrayList; import java.util.Comparator; +import java.util.HashMap; import java.util.List; +import java.util.Map; import com.raytheon.uf.common.util.SizeUtil; @@ -18,6 +21,9 @@ import com.raytheon.uf.common.util.SizeUtil; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jun 7, 2013 1966 rferrel Initial creation + * Aug 02, 2013 2224 rferrel Changes to include DataSet in configuration. + * Aug 06, 2013 2222 rferrel Changes to display all selected data. + * Aug 14, 2013 2220 rferrel Add priority comparator. * * * @@ -45,7 +51,34 @@ public class DisplayData implements Comparable { public static final Comparator LABEL_ORDER = new Comparator() { @Override public int compare(DisplayData o1, DisplayData o2) { - return o1.displayLabel.compareToIgnoreCase(o2.displayLabel); + int result = o1.getArchiveName().compareToIgnoreCase( + o2.getArchiveName()); + if (result == 0) { + result = o1.getCategoryName().compareToIgnoreCase( + o2.getCategoryName()); + } + if (result == 0) { + result = o1.displayLabel.compareToIgnoreCase(o2.displayLabel); + } + return result; + } + }; + + /** Comparator for priority ordering for priority queue. */ + public static final Comparator PRIORITY_ORDER = new Comparator() { + + @Override + public int compare(DisplayData o1, DisplayData o2) { + if (o1.visible != o2.visible) { + return o1.visible ? -1 : +1; + } else if (o1.visible) { + return LABEL_ORDER.compare(o1, o2); + } + + if (o1.selected != o2.selected) { + return o1.selected ? -1 : +1; + } + return LABEL_ORDER.compare(o1, o2); } }; @@ -61,21 +94,28 @@ public class DisplayData implements Comparable { /** The data's category configuration. */ protected final CategoryConfig categoryConfig; + protected final List dataSets = new ArrayList( + 1); + /** The display label for this data. */ protected final String displayLabel; /** - * List of directories for the display label matching the category's - * directory pattern and found under the archive's root directory. + * Mappings of a list of directories for the display label matching the data + * set's directory patterns and found under the archive's root directory. */ - protected final List dirs; + protected final Map> dirsMap = new HashMap>(); /** - * For use by GUI to indicate. Use to indicate selected for retention or for - * placing in a case. + * For use by GUI to indicate display label's row is selected. */ private boolean selected = false; + /** + * Indicates data is visible in the display. + */ + private boolean visible = false; + /** For use by GUI for indicating the size of the directories' contents. */ private long size = UNKNOWN_SIZE; @@ -84,15 +124,16 @@ public class DisplayData implements Comparable { * * @param archiveConfig * @param categoryConfig + * @param dataSet * @param displayLabel - * @param dirs */ public DisplayData(ArchiveConfig archiveConfig, - CategoryConfig categoryConfig, String displayLabel, List dirs) { + CategoryConfig categoryConfig, CategoryDataSet dataSet, + String displayLabel) { this.archiveConfig = archiveConfig; this.categoryConfig = categoryConfig; this.displayLabel = displayLabel; - this.dirs = dirs; + this.dataSets.add(dataSet); } /** @@ -113,6 +154,14 @@ public class DisplayData implements Comparable { this.selected = selected; } + public boolean isVisible() { + return visible; + } + + public void setVisible(boolean visible) { + this.visible = visible; + } + /** * * @return displayLabel. @@ -225,4 +274,30 @@ public class DisplayData implements Comparable { } return result; } + + public String getArchiveName() { + return archiveConfig.getName(); + } + + public String getCategoryName() { + return categoryConfig.getName(); + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder("DisplayData["); + sb.append("displayLabel: ").append(displayLabel); + sb.append(", isVisible: ").append(isVisible()); + sb.append(", isSlected: ").append(isSelected()); + sb.append(", size: ").append(size); + sb.append(", category.name: ").append(categoryConfig.getName()); + sb.append(", archive.name: ").append(archiveConfig.getName()) + .append("]"); + return sb.toString(); + } } \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/FileDateFilter.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/FileDateFilter.java index 16dc9fd732..d349faf652 100644 --- a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/FileDateFilter.java +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/FileDateFilter.java @@ -40,6 +40,7 @@ import com.raytheon.uf.common.time.util.TimeUtil; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jun 18, 2013 1965 bgonzale Initial creation + * Aug 28, 2013 2299 rferrel Reject hidden directories. * * * @@ -79,7 +80,9 @@ public class FileDateFilter implements IOFileFilter { this.end = end; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see org.apache.commons.io.filefilter.IOFileFilter#accept(java.io.File) */ @Override @@ -90,16 +93,16 @@ public class FileDateFilter implements IOFileFilter { return accept(new File(dirName), fileName); } - /* (non-Javadoc) - * @see org.apache.commons.io.filefilter.IOFileFilter#accept(java.io.File, java.lang.String) + /* + * (non-Javadoc) + * + * @see org.apache.commons.io.filefilter.IOFileFilter#accept(java.io.File, + * java.lang.String) */ @Override public boolean accept(File dir, String name) { - String dirPath = dir.getAbsolutePath(); - boolean endsWithSeparator = dirPath.endsWith(File.separator); - dirPath = endsWithSeparator ? dirPath : dirPath + File.separator; - String fileFullPath = dirPath + name; - Calendar fileDate = helper.getFileDate(fileFullPath); + File file = new File(dir, name); + Calendar fileDate = helper.getFileDate(file); boolean isAfterEqualsStart = start == null || fileDate.after(start) || fileDate.equals(start); boolean isBeforeEqualsEnd = end == null || fileDate.before(end) @@ -112,9 +115,8 @@ public class FileDateFilter implements IOFileFilter { */ private static final IFileDateHelper DEFAULT_FILE_DATE_HELPER = new IFileDateHelper() { @Override - public Calendar getFileDate(String filenamePath) { + public Calendar getFileDate(File file) { // use file last modified date - File file = new File(filenamePath); long lastModifiedMillis = file.lastModified(); Calendar result = TimeUtil.newGmtCalendar(); result.setTimeInMillis(lastModifiedMillis); diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/IFileDateHelper.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/IFileDateHelper.java index 16a4f24d0c..368e6fe6d4 100644 --- a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/IFileDateHelper.java +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/IFileDateHelper.java @@ -19,6 +19,7 @@ **/ package com.raytheon.uf.common.archive.config; +import java.io.File; import java.util.Calendar; /** @@ -31,6 +32,7 @@ import java.util.Calendar; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jun 21, 2013 bgonzale Initial creation + * Aug 28, 2013 2299 rferrel Change getFileDate argument. * * * @@ -40,6 +42,12 @@ import java.util.Calendar; public interface IFileDateHelper { - public Calendar getFileDate(String filenamePath); + /** + * Get data associated with the file. + * + * @param file + * @return calendar + */ + public Calendar getFileDate(File file); } diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/SelectConfig.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/SelectConfig.java new file mode 100644 index 0000000000..babc5a51ae --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/SelectConfig.java @@ -0,0 +1,192 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.common.archive.config; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +import com.raytheon.uf.common.archive.config.select.ArchiveSelect; +import com.raytheon.uf.common.archive.config.select.CategorySelect; + +/** + * Select configuraton information for retention and case creation. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 19, 2013 2221       rferrel     Initial creation
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ + +@XmlAccessorType(XmlAccessType.NONE) +@XmlRootElement(name = "selection") +public class SelectConfig { + /** + * Name of selection. + */ + @XmlElement(name = "name") + private String name; + + /** + * Hours to back off Start time from the End time. + */ + @XmlElement(name = "startRetentionHours") + private long starRetentionHours = 24L; + + /** + * List of archives + */ + @XmlElement(name = "archive") + private final List archiveList = new ArrayList(); + + /** + * Constructor. + */ + public SelectConfig() { + super(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public long getStarRetentionHours() { + return starRetentionHours; + } + + public void setStarRetentionHours(long startRetentionHours) { + this.starRetentionHours = startRetentionHours; + } + + public List getArchiveList() { + return archiveList; + } + + public void setArchiveList(List archiveList) { + this.archiveList.clear(); + this.archiveList.addAll(archiveList); + } + + public void add(ArchiveSelect archiveSelect) { + archiveList.add(archiveSelect); + } + + /** + * + * @return true when no selections + */ + public boolean isEmpty() { + return archiveList.isEmpty(); + } + + /** + * Get a list of selected display names for the archive and its category. + * + * @param archiveName + * @param categoryName + * @return displayLabelList may be an empty list. + */ + public List getSelectedList(String archiveName, String categoryName) { + ArchiveSelect archiveSelect = getArchive(archiveName); + if (archiveSelect == null || archiveSelect.isEmpty()) { + return new ArrayList(0); + } + CategorySelect categorySelect = getCategorySelect(categoryName, + archiveSelect); + if (categorySelect == null || categorySelect.isEmpty()) { + return new ArrayList(0); + } + + List selected = categorySelect.getSelectList(); + + return selected; + } + + /** + * Find archive with given name + * + * @param archiveName + * @return archive select or null if none found. message + */ + private ArchiveSelect getArchive(String archiveName) { + if (!archiveList.isEmpty()) { + for (ArchiveSelect archiveSelect : archiveList) { + if (archiveName.equals(archiveSelect.getName())) { + return archiveSelect; + } + } + } + return null; + } + + /** + * Find category for the given name under the desired archive. + * + * @param categoryName + * @param archiveSelect + * @return categorySelect or null if none found + */ + private CategorySelect getCategorySelect(String categoryName, + ArchiveSelect archiveSelect) { + if (!archiveSelect.isEmpty()) { + for (CategorySelect categorySelect : archiveSelect + .getCategorySelectList()) { + if (categoryName.equals(categorySelect.getName())) { + return categorySelect; + } + } + } + return null; + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("selectData [name: ").append(getName()); + sb.append(", startRetentionHours: ").append(getStarRetentionHours()); + sb.append("["); + for (ArchiveSelect archiveConfig : getArchiveList()) { + sb.append(archiveConfig).append(", "); + } + sb.append("]]"); + return sb.toString(); + } +} diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/select/ArchiveSelect.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/select/ArchiveSelect.java new file mode 100644 index 0000000000..3d339147f5 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/select/ArchiveSelect.java @@ -0,0 +1,104 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.common.archive.config.select; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Select configuration archive information. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 19, 2013 2221       rferrel     Initial creation
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ + +@XmlAccessorType(XmlAccessType.NONE) +@XmlRootElement(name = "archive") +public class ArchiveSelect { + /** + * The archive name. + */ + @XmlElement(name = "name") + private String name; + + /** + * List of categories with selections. + */ + @XmlElement(name = "category") + private final List categorySelectList = new ArrayList(); + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getCategorySelectList() { + return categorySelectList; + } + + public void setCategorySelectList(List categorySelectList) { + this.categorySelectList.clear(); + this.categorySelectList.addAll(categorySelectList); + } + + public void add(CategorySelect categorySelect) { + categorySelectList.add(categorySelect); + } + + public boolean isEmpty() { + return categorySelectList.isEmpty(); + } + + /* + * (non-Javadoc) + * + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Archive Select [name : ").append(getName()); + sb.append("["); + for (CategorySelect categorySelect : categorySelectList) { + sb.append(categorySelect).append(", "); + } + sb.append("]"); + return sb.toString(); + } + +} diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/select/CategorySelect.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/select/CategorySelect.java new file mode 100644 index 0000000000..5d4d2c5ec0 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/config/select/CategorySelect.java @@ -0,0 +1,98 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.common.archive.config.select; + +import java.util.ArrayList; +import java.util.List; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +/** + * Select configuration class that contains a list of selected display labels + * for a given category. It is assumed this is associated with a given archive. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Jul 19, 2013 2221       rferrel     Initial creation
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ +@XmlAccessorType(XmlAccessType.NONE) +@XmlRootElement(name = "archive") +public class CategorySelect { + /** + * The category name. + */ + @XmlElement(name = "name") + private String name; + + /** + * List of selected labels. + */ + @XmlElement(name = "selectedDisplayName") + private final List selectList = new ArrayList(); + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getSelectList() { + return selectList; + } + + public void setSelectList(List selectList) { + this.selectList.clear(); + this.selectList.addAll(selectList); + } + + public void add(String displayName) { + selectList.add(displayName); + } + + public boolean isEmpty() { + return selectList.isEmpty(); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("CategorySelect [ name: ").append(getName()); + sb.append("[ "); + for (String select : getSelectList()) { + sb.append("\"").append(select).append("\", "); + } + sb.append("]"); + return sb.toString(); + } +} diff --git a/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/request/ArchiveAdminAuthRequest.java b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/request/ArchiveAdminAuthRequest.java new file mode 100644 index 0000000000..375c5e8d48 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.archive/src/com/raytheon/uf/common/archive/request/ArchiveAdminAuthRequest.java @@ -0,0 +1,107 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.common.archive.request; + +import com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest; +import com.raytheon.uf.common.serialization.ISerializableObject; +import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; +import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; + +/** + * Class with the serialized data for the Archive Admin. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 02, 2013 2326       rferrel    Initial creation
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ +@DynamicSerialize +public class ArchiveAdminAuthRequest extends AbstractPrivilegedRequest + implements ISerializableObject { + + @DynamicSerializeElement + private String roleId = null; + + @DynamicSerializeElement + private boolean authorized = false; + + @DynamicSerializeElement + private String notAuthorizedMessage = "Not Authorized"; + + /** + * Constructor + */ + public ArchiveAdminAuthRequest() { + + } + + /** + * @param roleId + * the roleId to set + */ + public void setRoleId(String roleId) { + this.roleId = roleId; + } + + /** + * @return the roleId + */ + public String getRoleId() { + return roleId; + } + + /** + * @return the authorized + */ + public boolean isAuthorized() { + return authorized; + } + + /** + * @param authorized + * the authorized to set + */ + public void setAuthorized(boolean authorized) { + this.authorized = authorized; + } + + /** + * @return the notAuthorizedMessage + */ + public String getNotAuthorizedMessage() { + return notAuthorizedMessage; + } + + /** + * @param notAuthorizedMessage + * the failureMessage to set + */ + public void setNotAuthorizedMessage(String notAuthorizedMessage) { + this.notAuthorizedMessage = notAuthorizedMessage; + } +} diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.acars/src/com/raytheon/uf/common/dataplugin/acars/ACARSRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.acars/src/com/raytheon/uf/common/dataplugin/acars/ACARSRecord.java index 83e2a76d8e..3934a16ec6 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.acars/src/com/raytheon/uf/common/dataplugin/acars/ACARSRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.acars/src/com/raytheon/uf/common/dataplugin/acars/ACARSRecord.java @@ -65,15 +65,17 @@ import com.vividsolutions.jts.geom.Geometry; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 21, 2009 1939 jkorman Initial creation - * Apr 09, 2009 952 jsanchez Updated getValue method. - * Added a getMessageData method. - * Apr 21, 2009 2245 jsanchez Returned temperature unit to kelvin. - * May 21, 2009 2338 jsanchez Updated the getMessageData. - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Jan 21, 2009 1939 jkorman Initial creation + * Apr 09, 2009 952 jsanchez Updated getValue method. Added a + * getMessageData method. + * Apr 21, 2009 2245 jsanchez Returned temperature unit to kelvin. + * May 21, 2009 2338 jsanchez Updated the getMessageData. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -87,12 +89,8 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "acars", - indexes = { - @Index(name = "acars_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "acars", indexes = { @Index(name = "acars_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -698,9 +696,9 @@ public class ACARSRecord extends PluginDataObject implements ISpatialEnabled, a = new Amount(getLatitude(), LOCATION_UNIT); } else if (STA_LON.equals(pName)) { a = new Amount(getLongitude(), LOCATION_UNIT); - } else if (UA_FLTLVL.equals(pName) && getFlightLevel() != null) { + } else if (UA_FLTLVL.equals(pName) && (getFlightLevel() != null)) { a = new Amount(getFlightLevel().intValue(), FLIGHT_LEVEL_UNIT); - } else if (SFC_DWPT.equals(pName) && getDwpt() != null) { + } else if (SFC_DWPT.equals(pName) && (getDwpt() != null)) { a = new Amount(getDwpt(), TEMPERATURE_UNIT); } @@ -724,47 +722,53 @@ public class ACARSRecord extends PluginDataObject implements ISpatialEnabled, return String.format(TEXT_FMT, getTailNumber(), getTimeObs()); } - - - - - - - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + result = (prime * result) + ((tailNumber == null) ? 0 : tailNumber.hashCode()); - result = prime * result + ((timeObs == null) ? 0 : timeObs.hashCode()); + result = (prime * result) + + ((timeObs == null) ? 0 : timeObs.hashCode()); return result; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } ACARSRecord other = (ACARSRecord) obj; if (tailNumber == null) { - if (other.tailNumber != null) + if (other.tailNumber != null) { return false; - } else if (!tailNumber.equals(other.tailNumber)) + } + } else if (!tailNumber.equals(other.tailNumber)) { return false; + } if (timeObs == null) { - if (other.timeObs != null) + if (other.timeObs != null) { return false; - } else if (!timeObs.equals(other.timeObs)) + } + } else if (!timeObs.equals(other.timeObs)) { return false; + } return true; } @@ -782,7 +786,7 @@ public class ACARSRecord extends PluginDataObject implements ISpatialEnabled, if (this == other) { result = EQUAL; } else { - if(getTailNumber().equals(getTailNumber())) { + if (getTailNumber().equals(getTailNumber())) { result = timeObs.compareTo(other.timeObs); } else { result = getTailNumber().compareTo(other.getTailNumber()); @@ -790,11 +794,16 @@ public class ACARSRecord extends PluginDataObject implements ISpatialEnabled, } return result; } - + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "acars"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/ACARSSoundingRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/ACARSSoundingRecord.java index 7529a40c9c..54f4ed92a9 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/ACARSSoundingRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.acarssounding/src/com/raytheon/uf/common/dataplugin/acarssounding/ACARSSoundingRecord.java @@ -64,11 +64,13 @@ import com.vividsolutions.jts.geom.Geometry; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20090403 1939 jkorman Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 03, 2009 1939 jkorman Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -82,12 +84,8 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "acarssounding", - indexes = { - @Index(name = "acarssounding_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "acarssounding", indexes = { @Index(name = "acarssounding_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -122,12 +120,12 @@ public class ACARSSoundingRecord extends PluginDataObject implements @XmlElement private String tailNumber; - // Flight phase (A[scending] D[escending]) + // Flight phase (A[scending] D[escending]) @Column(length = 1) @DynamicSerializeElement @XmlElement private String phase = null; - + // oldest observation time in this sounding @Column @DynamicSerializeElement @@ -139,7 +137,7 @@ public class ACARSSoundingRecord extends PluginDataObject implements @DynamicSerializeElement @XmlElement private Long newestTime = Long.MIN_VALUE; - + // The level data for this observation. @OneToMany(cascade = CascadeType.ALL, mappedBy = "parent", fetch = FetchType.EAGER) @XmlElement @@ -261,7 +259,7 @@ public class ACARSSoundingRecord extends PluginDataObject implements public void setTailNumber(String tailNumber) { this.tailNumber = tailNumber; } - + /** * @return the phase */ @@ -270,7 +268,8 @@ public class ACARSSoundingRecord extends PluginDataObject implements } /** - * @param phase the phase to set + * @param phase + * the phase to set */ public void setPhase(String phase) { this.phase = phase; @@ -284,7 +283,8 @@ public class ACARSSoundingRecord extends PluginDataObject implements } /** - * @param oldestTime the oldestTime to set + * @param oldestTime + * the oldestTime to set */ public void setOldestTime(Long oldestTime) { this.oldestTime = oldestTime; @@ -298,7 +298,8 @@ public class ACARSSoundingRecord extends PluginDataObject implements } /** - * @param newestTime the newestTime to set + * @param newestTime + * the newestTime to set */ public void setNewestTime(Long newestTime) { this.newestTime = newestTime; @@ -328,17 +329,17 @@ public class ACARSSoundingRecord extends PluginDataObject implements * @param cloud */ public void addLevel(ACARSSoundingLayer level) { - if(level != null) { + if (level != null) { level.setParent(this); if (levels == null) { levels = new HashSet(); } levels.add(level); long cTime = level.getTimeObs().getTimeInMillis(); - if(cTime < oldestTime) { + if (cTime < oldestTime) { oldestTime = cTime; } - if(cTime > newestTime) { + if (cTime > newestTime) { newestTime = cTime; } } @@ -386,4 +387,9 @@ public class ACARSSoundingRecord extends PluginDataObject implements public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "acarssounding"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.airep/src/com/raytheon/uf/common/dataplugin/airep/AirepRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.airep/src/com/raytheon/uf/common/dataplugin/airep/AirepRecord.java index d03ca0e507..d1803bda21 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.airep/src/com/raytheon/uf/common/dataplugin/airep/AirepRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.airep/src/com/raytheon/uf/common/dataplugin/airep/AirepRecord.java @@ -69,16 +69,19 @@ import com.vividsolutions.jts.geom.Geometry; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080103 384 jkorman Initial Coding. - * 20080107 720 jkorman remove default assignments from attributes. - * 20120405 435 dgilling Prevent NullPointerExceptions in + * Jan 03, 2008 384 jkorman Initial Coding. + * Jan 07, 2008 720 jkorman remove default assignments from + * attributes. + * Apr 05, 2012 435 dgilling Prevent NullPointerExceptions in * buildMessageData(). - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 20120911 1011 jkorman Added ability to report turbulence from decoded - * TB group. - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Sep 11, 2012 1011 jkorman Added ability to report turbulence from + * decoded TB group. + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -92,12 +95,8 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "airep", - indexes = { - @Index(name = "airep_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "airep", indexes = { @Index(name = "airep_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -330,7 +329,7 @@ public class AirepRecord extends PluginDataObject implements ISpatialEnabled, */ public String getReportData() { String s = null; - if (messageData != null && messageData instanceof String) { + if ((messageData != null) && (messageData instanceof String)) { s = (String) messageData; } else { s = buildMessageData(); @@ -593,7 +592,7 @@ public class AirepRecord extends PluginDataObject implements ISpatialEnabled, a = new Amount(this.getLatitude(), LOCATION_UNIT); } else if (STA_LON.equals(pName)) { a = new Amount(this.getLongitude(), LOCATION_UNIT); - } else if (UA_FLTLVL.equals(pName) && getFlightLevel() != null) { + } else if (UA_FLTLVL.equals(pName) && (getFlightLevel() != null)) { a = new Amount(this.getFlightLevel().intValue(), ALTITUDE_UNIT); } @@ -627,7 +626,7 @@ public class AirepRecord extends PluginDataObject implements ISpatialEnabled, String[] retValue = null; String value = null; - if ("FLT_HZD".matches(paramName) && flightHazard != null) { + if ("FLT_HZD".matches(paramName) && (flightHazard != null)) { if (flightHazard != null) { retValue = new String[] { flightHazard.toString() }; } @@ -720,7 +719,7 @@ public class AirepRecord extends PluginDataObject implements ISpatialEnabled, boolean validLocation = (location != null); StringBuilder messageData = new StringBuilder("ARP "); - if (validLocation && getStationId() != null) { + if (validLocation && (getStationId() != null)) { messageData.append(getStationId()); } messageData.append(' '); @@ -739,7 +738,7 @@ public class AirepRecord extends PluginDataObject implements ISpatialEnabled, } messageData.append(" F"); - if (validLocation && getFlightLevel() != null) { + if (validLocation && (getFlightLevel() != null)) { int flightLevel = (int) ftToHft.convert(getFlightLevel()); messageData.append(flightLevel); } @@ -761,7 +760,7 @@ public class AirepRecord extends PluginDataObject implements ISpatialEnabled, messageData.append(windSpeed.intValue()); messageData.append("KT"); } - if(flightConditions != null) { + if (flightConditions != null) { int turb = flightConditions >> 4; if ((turb & 0x80) > 0) { messageData.append(" TB"); @@ -831,7 +830,7 @@ public class AirepRecord extends PluginDataObject implements ISpatialEnabled, public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + result = (prime * result) + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); return result; } @@ -871,4 +870,9 @@ public class AirepRecord extends PluginDataObject implements ISpatialEnabled, public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "airep"; + } } \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/src/com/raytheon/uf/common/dataplugin/binlightning/BinLightningRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/src/com/raytheon/uf/common/dataplugin/binlightning/BinLightningRecord.java index 3de0e749e4..e6d780cf60 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/src/com/raytheon/uf/common/dataplugin/binlightning/BinLightningRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.binlightning/src/com/raytheon/uf/common/dataplugin/binlightning/BinLightningRecord.java @@ -62,24 +62,27 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * * Date Ticket# Engineer Description * ---------- ---------- ----------- -------------------------- - * 20070810 379 jkorman Initial Coding from prototype. - * 20070817 379 jkorman Fixed convert(). Was writing day into + * Aug 10, 2007 379 jkorman Initial Coding from prototype. + * Aug 17, 2007 379 jkorman Fixed convert(). Was writing day into * hours field of new calendar. - * 20070920 379 jkorman Modified getPersistenceTime. - * 20070921 379 jkorman Modified get/set start/stop times due + * Sep 20, 2007 379 jkorman Modified getPersistenceTime. + * Sep 21, 2007 379 jkorman Modified get/set start/stop times due * to JiBX problems. - * 20070924 379 jkorman Removed Group, added insert_time and - * (set/get)ers to make DataURI work. - * 20071129 472 jkorman Added IDecoderGettable interface. - * 20080107 720 jkorman remove default assignments from attributes. - * 20080708 1174 jkorman Added persistenceTime handling. - * 20090206 1990 bphillip Removed populateDataStore method - * 20130227 DCS 152 jgerth/elau Support for WWLLN and multiple sources - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 20130408 1293 bkowal Removed references to hdffileid. - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Sep 24, 2007 379 jkorman Removed Group, added insert_time and + * (set/get)ers to make DataURI work. + * Nov 29, 2007 472 jkorman Added IDecoderGettable interface. + * Jan 07, 2008 720 jkorman remove default assignments from + * attributes. + * Jul 08, 2008 1174 jkorman Added persistenceTime handling. + * Feb 06, 2009 1990 bphillip Removed populateDataStore method + * Feb 27, 2013 DCS 152 jgerth/elau Support for WWLLN and multiple sources + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -93,17 +96,13 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "binlightning", - indexes = { - @Index(name = "binlightning_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "binlightning", indexes = { @Index(name = "binlightning_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @DynamicSerialize @XmlAccessorType(XmlAccessType.NONE) -public class BinLightningRecord extends - PersistablePluginDataObject implements IPersistable { +public class BinLightningRecord extends PersistablePluginDataObject implements + IPersistable { /** Serializable id * */ private static final long serialVersionUID = 1L; @@ -159,7 +158,7 @@ public class BinLightningRecord extends @DynamicSerializeElement @XmlAttribute private Calendar stopTime; - + // JJG - source of lightning data @Column(length = 5) @DataURI(position = 3) @@ -221,8 +220,8 @@ public class BinLightningRecord extends */ @SuppressWarnings("unused") private void updatePersistenceTime() { - if (startTimeMillis != Long.MAX_VALUE - && stopTimeMillis != Long.MIN_VALUE) { + if ((startTimeMillis != Long.MAX_VALUE) + && (stopTimeMillis != Long.MIN_VALUE)) { persistTime = (startTimeMillis + stopTimeMillis) / 2; setPersistenceTime(TimeTools.newCalendar(persistTime).getTime()); } else { @@ -238,24 +237,25 @@ public class BinLightningRecord extends * A strike report to add. */ public void addStrike(LightningStrikePoint strike) { - // jjg add - if (lightSource == null) { - if (strike.getLightSource() == null) { - lightSource = (String) "NLDN"; - } else if (strike.getLightSource().isEmpty()) { - lightSource = (String) "UNKN"; - } else { - lightSource = (String) strike.getLightSource(); - } - } else { - if (strike.getLightSource() == null) { - lightSource = (String) "NLDN"; - } else if (!lightSource.equals(strike.getLightSource())) - lightSource = (String) "UNKN"; - } - // end + // jjg add + if (lightSource == null) { + if (strike.getLightSource() == null) { + lightSource = "NLDN"; + } else if (strike.getLightSource().isEmpty()) { + lightSource = "UNKN"; + } else { + lightSource = strike.getLightSource(); + } + } else { + if (strike.getLightSource() == null) { + lightSource = "NLDN"; + } else if (!lightSource.equals(strike.getLightSource())) { + lightSource = "UNKN"; + } + } + // end - if (insertIndex < obsTimes.length) { + if (insertIndex < obsTimes.length) { long t1 = startTimeMillis; Calendar c = TimeTools.getBaseCalendar(strike.getYear(), @@ -445,7 +445,7 @@ public class BinLightningRecord extends public void setLightSource(String lightSource) { this.lightSource = lightSource; } - + /** * Get the IDecoderGettable reference for this record. * @@ -506,4 +506,9 @@ public class BinLightningRecord extends public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "binlightning"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrascat/src/com/raytheon/uf/common/dataplugin/bufrascat/AScatObs.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrascat/src/com/raytheon/uf/common/dataplugin/bufrascat/AScatObs.java index fe1843e13e..2e1c4f8a27 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrascat/src/com/raytheon/uf/common/dataplugin/bufrascat/AScatObs.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrascat/src/com/raytheon/uf/common/dataplugin/bufrascat/AScatObs.java @@ -60,6 +60,7 @@ import com.vividsolutions.jts.geom.Geometry; * PluginDataObject. * May 17, 2013 1869 bsteffen Remove DataURI column from sat plot * types. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -74,283 +75,283 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "bufrascat", - indexes = { - @Index(name = "bufrascat_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "bufrascat", indexes = { @Index(name = "bufrascat_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class AScatObs extends PersistablePluginDataObject implements ISpatialEnabled, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - @DataURI(position = 1) - @DynamicSerializeElement - private Integer satId; + @DataURI(position = 1) + @DynamicSerializeElement + private Integer satId; - @Embedded - @DataURI(position = 2, embedded = true) - @DynamicSerializeElement - private SurfaceObsLocation location; + @Embedded + @DataURI(position = 2, embedded = true) + @DynamicSerializeElement + private SurfaceObsLocation location; - // Text of the WMO header - @Column(length = 32) - @DynamicSerializeElement - private String wmoHeader; + // Text of the WMO header + @Column(length = 32) + @DynamicSerializeElement + private String wmoHeader; - @DynamicSerializeElement - @Transient - private Integer orbitNumber; + @DynamicSerializeElement + @Transient + private Integer orbitNumber; - // The observation time. - @DynamicSerializeElement - @Transient - private Calendar validTime; + // The observation time. + @DynamicSerializeElement + @Transient + private Calendar validTime; - @DynamicSerializeElement - @Transient - private Double windDir; + @DynamicSerializeElement + @Transient + private Double windDir; - @DataURI(position = 3) - @DynamicSerializeElement - private Float windSpd; + @DataURI(position = 3) + @DynamicSerializeElement + private Float windSpd; - @DynamicSerializeElement - @Transient - private Double probRain; + @DynamicSerializeElement + @Transient + private Double probRain; - @DynamicSerializeElement - @Transient - private Integer rainIndex; + @DynamicSerializeElement + @Transient + private Integer rainIndex; - /** - * Empty constructor. - */ - public AScatObs() { - } + /** + * Empty constructor. + */ + public AScatObs() { + } - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public AScatObs(String uri) { - super(uri); - } + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public AScatObs(String uri) { + super(uri); + } - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } - /** - * Was this location defined from the station catalog? False if not. - * - * @return Was this location defined from the station catalog? - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } + /** + * Was this location defined from the station catalog? False if not. + * + * @return Was this location defined from the station catalog? + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } - /** - * @return the location - */ - public SurfaceObsLocation getLocation() { - return location; - } + /** + * @return the location + */ + public SurfaceObsLocation getLocation() { + return location; + } - /** - * @param location - * the location to set - */ - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } + /** + * @param location + * the location to set + */ + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } - /** - * @return the satId - */ - public Integer getSatId() { - return satId; - } + /** + * @return the satId + */ + public Integer getSatId() { + return satId; + } - /** - * @param satId - * the satId to set - */ - public void setSatId(Integer satId) { - this.satId = satId; - } + /** + * @param satId + * the satId to set + */ + public void setSatId(Integer satId) { + this.satId = satId; + } - /** - * @return the orbitNumber - */ - public Integer getOrbitNumber() { - return orbitNumber; - } + /** + * @return the orbitNumber + */ + public Integer getOrbitNumber() { + return orbitNumber; + } - /** - * @param orbitNumber - * the orbitNumber to set - */ - public void setOrbitNumber(Integer orbitNumber) { - this.orbitNumber = orbitNumber; - } + /** + * @param orbitNumber + * the orbitNumber to set + */ + public void setOrbitNumber(Integer orbitNumber) { + this.orbitNumber = orbitNumber; + } - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * @return the windDir - */ - public Double getWindDir() { - return windDir; - } + /** + * @return the windDir + */ + public Double getWindDir() { + return windDir; + } - /** - * @param windDir - * the windDir to set - */ - public void setWindDir(Double windDir) { - this.windDir = windDir; - } + /** + * @param windDir + * the windDir to set + */ + public void setWindDir(Double windDir) { + this.windDir = windDir; + } - /** - * @return the windSpd - */ - public Float getWindSpd() { - return windSpd; - } + /** + * @return the windSpd + */ + public Float getWindSpd() { + return windSpd; + } - /** - * @param windSpd - * the windSpd to set - */ - public void setWindSpd(Float windSpd) { - this.windSpd = windSpd; - } + /** + * @param windSpd + * the windSpd to set + */ + public void setWindSpd(Float windSpd) { + this.windSpd = windSpd; + } - /** - * @return the probRain - */ - public Double getProbRain() { - return probRain; - } + /** + * @return the probRain + */ + public Double getProbRain() { + return probRain; + } - /** - * @param probRain - * the probRain to set - */ - public void setProbRain(Double probRain) { - this.probRain = probRain; - } + /** + * @param probRain + * the probRain to set + */ + public void setProbRain(Double probRain) { + this.probRain = probRain; + } - /** - * @return the rainIndex - */ - public Integer getRainIndex() { - return rainIndex; - } + /** + * @return the rainIndex + */ + public Integer getRainIndex() { + return rainIndex; + } - /** - * @param rainIndex - * the rainIndex to set - */ - public void setRainIndex(Integer rainIndex) { - this.rainIndex = rainIndex; - } + /** + * @param rainIndex + * the rainIndex to set + */ + public void setRainIndex(Integer rainIndex) { + this.rainIndex = rainIndex; + } - /** - * Get the observation time for this data. - * - * @return The data observation time. - */ - public Calendar getValidTime() { - return validTime; - } + /** + * Get the observation time for this data. + * + * @return The data observation time. + */ + public Calendar getValidTime() { + return validTime; + } - /** - * Set the observation time for this data. - * - * @param timeObs - * The data observation time. - */ - public void setValidTime(Calendar time) { - validTime = time; - } + /** + * Set the observation time for this data. + * + * @param timeObs + * The data observation time. + */ + public void setValidTime(Calendar time) { + validTime = time; + } - @Override - public ISpatialObject getSpatialObject() { - return location; - } + @Override + public ISpatialObject getSpatialObject() { + return location; + } - /** + /** * */ - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - /** + /** * */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + @Override + public String getPluginName() { + return "bufrascat"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrhdw/src/com/raytheon/uf/common/dataplugin/bufrhdw/BufrHDWObs.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrhdw/src/com/raytheon/uf/common/dataplugin/bufrhdw/BufrHDWObs.java index 805bfd631b..ee2fec58b5 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrhdw/src/com/raytheon/uf/common/dataplugin/bufrhdw/BufrHDWObs.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrhdw/src/com/raytheon/uf/common/dataplugin/bufrhdw/BufrHDWObs.java @@ -59,6 +59,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * PluginDataObject. * May 17, 2013 1869 bsteffen Remove DataURI column from sat plot * types. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -73,557 +74,557 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "bufrhdw", - indexes = { - @Index(name = "bufrhdw_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "bufrhdw", indexes = { @Index(name = "bufrhdw_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class BufrHDWObs extends PersistablePluginDataObject implements ISpatialEnabled, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - // The observation time. - @DataURI(position = 1) - @DynamicSerializeElement - private String satType; - - @DataURI(position = 2) - @DynamicSerializeElement - private Double pressure; - - @Embedded - @DataURI(position = 3, embedded = true) - @DynamicSerializeElement - private SurfaceObsLocation location; - - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - // Text of the WMO header - @Column(length = 32) - @DynamicSerializeElement - private String wmoHeader; - - // The observation time. - @Column - @DynamicSerializeElement - private Calendar validTime; - - @DynamicSerializeElement - @Transient - private Double windDir; - - @DynamicSerializeElement - @Transient - private Double windSpd; - - @DynamicSerializeElement - @Transient - private Double satelliteID; - - @DynamicSerializeElement - @Transient - private Double originatingID; - - @DynamicSerializeElement - @Transient - private Double satelliteClass; - - @DynamicSerializeElement - @Transient - private Double sgmtSzX; - - @DynamicSerializeElement - @Transient - private Double sgmtSzY; - - @DynamicSerializeElement - @Transient - private Integer satelliteInstr; - - @DynamicSerializeElement - @Transient - private Integer satelliteWindMethod; - - @DynamicSerializeElement - @Transient - private Double satelliteFreq; - - @DynamicSerializeElement - @Transient - private Double satelliteBandWidth; - - @DynamicSerializeElement - @Transient - private Double coldestTemp; - - @DynamicSerializeElement - @Transient - private Integer heightMethod; - - @DynamicSerializeElement - @Transient - private Integer tracerCorrelation; - - @DynamicSerializeElement - @Transient - private Integer landSea; - - @DynamicSerializeElement - @Transient - private Double satelliteZenith; - - @DynamicSerializeElement - @Transient - private Integer firstGuess; - - @DynamicSerializeElement - @Transient - private Integer timeSignificance; - - /** - * Empty constructor. - */ - public BufrHDWObs() { - } - - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public BufrHDWObs(String uri) { - super(uri); - } - - /** - * Get the observation time for this data. - * - * @return The data observation time. - */ - public Calendar getValidTime() { - return validTime; - } - - /** - * Set the observation time for this data. - * - * @param timeObs - * The data observation time. - */ - public void setValidTime(Calendar time) { - validTime = time; - } - - /** - * @return the satType - */ - public String getSatType() { - return satType; - } - - /** - * @param satType - * the satType to set - */ - public void setSatType(String type) { - satType = type; - } - - /** - * @param satType - * the satType to set - */ - public void setSatType(BUFRHDWSatType type) { - satType = type.toString(); - } - - /** - * @return the location - */ - public SurfaceObsLocation getLocation() { - return location; - } - - /** - * @param location - * the location to set - */ - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } - - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } - - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } - - /** - * @return the windDir - */ - public Double getWindDir() { - return windDir; - } - - /** - * @param windDir - * the windDir to set - */ - public void setWindDir(Double direction) { - windDir = direction; - } - - /** - * @return the windSpd - */ - public Double getWindSpd() { - return windSpd; - } - - /** - * @param windSpd - * the windSpd to set - */ - public void setWindSpd(Double speed) { - windSpd = speed; - } - - /** - * @return the pressure - */ - public Double getPressure() { - return pressure; - } - - /** - * @param pressure - * the pressure to set - */ - public void setPressure(Double pressure) { - this.pressure = pressure; - } - - /** - * @return the satelliteID - */ - public Double getSatelliteID() { - return satelliteID; - } - - /** - * @param satelliteID - * the satelliteID to set - */ - public void setSatelliteID(Double satelliteID) { - this.satelliteID = satelliteID; - } - - /** - * @return the originatingID - */ - public Double getOriginatingID() { - return originatingID; - } - - /** - * @param originatingID - * the originatingID to set - */ - public void setOriginatingID(Double originatingID) { - this.originatingID = originatingID; - } - - /** - * @return the satelliteClass - */ - public Double getSatelliteClass() { - return satelliteClass; - } - - /** - * @param satelliteClass - * the satelliteClass to set - */ - public void setSatelliteClass(Double satelliteClass) { - this.satelliteClass = satelliteClass; - } - - /** - * @return the sgmtSzX - */ - public Double getSgmtSzX() { - return sgmtSzX; - } - - /** - * @param sgmtSzX - * the sgmtSzX to set - */ - public void setSgmtSzX(Double sgmtSzX) { - this.sgmtSzX = sgmtSzX; - } - - /** - * @return the sgmtSzY - */ - public Double getSgmtSzY() { - return sgmtSzY; - } - - /** - * @param sgmtSzY - * the sgmtSzY to set - */ - public void setSgmtSzY(Double sgmtSzY) { - this.sgmtSzY = sgmtSzY; - } - - /** - * @return the satelliteInstr - */ - public Integer getSatelliteInstr() { - return satelliteInstr; - } - - /** - * @param satelliteInstr - * the satelliteInstr to set - */ - public void setSatelliteInstr(Integer satelliteInstr) { - this.satelliteInstr = satelliteInstr; - } - - /** - * @return the satelliteWindMethod - */ - public Integer getSatelliteWindMethod() { - return satelliteWindMethod; - } - - /** - * @param satelliteWindMethod - * the satelliteWindMethod to set - */ - public void setSatelliteWindMethod(Integer satelliteWindMethod) { - this.satelliteWindMethod = satelliteWindMethod; - } - - /** - * @return the satelliteFreq - */ - public Double getSatelliteFreq() { - return satelliteFreq; - } - - /** - * @param satelliteFreq - * the satelliteFreq to set - */ - public void setSatelliteFreq(Double satelliteFreq) { - this.satelliteFreq = satelliteFreq; - } - - /** - * @return the satelliteBandWidth - */ - public Double getSatelliteBandWidth() { - return satelliteBandWidth; - } - - /** - * @param satelliteBandWidth - * the satelliteBandWidth to set - */ - public void setSatelliteBandWidth(Double satelliteBandWidth) { - this.satelliteBandWidth = satelliteBandWidth; - } - - /** - * @return the coldestTemp - */ - public Double getColdestTemp() { - return coldestTemp; - } - - /** - * @param coldestTemp - * the coldestTemp to set - */ - public void setColdestTemp(Double coldestTemp) { - this.coldestTemp = coldestTemp; - } - - /** - * @return the heightMethod - */ - public Integer getHeightMethod() { - return heightMethod; - } - - /** - * @param heightMethod - * the heightMethod to set - */ - public void setHeightMethod(Integer heightMethod) { - this.heightMethod = heightMethod; - } - - /** - * @return the tracerCorrelation - */ - public Integer getTracerCorrelation() { - return tracerCorrelation; - } - - /** - * @param tracerCorrelation - * the tracerCorrelation to set - */ - public void setTracerCorrelation(Integer tracerCorrelation) { - this.tracerCorrelation = tracerCorrelation; - } - - /** - * @return the landSea - */ - public Integer getLandSea() { - return landSea; - } - - /** - * @param landSea - * the landSea to set - */ - public void setLandSea(Integer landSea) { - this.landSea = landSea; - } - - /** - * @return the satelliteZenith - */ - public Double getSatelliteZenith() { - return satelliteZenith; - } - - /** - * @param satelliteZenith - * the satelliteZenith to set - */ - public void setSatelliteZenith(Double satelliteZenith) { - this.satelliteZenith = satelliteZenith; - } - - /** - * @return the firstGuess - */ - public Integer getFirstGuess() { - return firstGuess; - } - - /** - * @param firstGuess - * the firstGuess to set - */ - public void setFirstGuess(Integer firstGuess) { - this.firstGuess = firstGuess; - } - - /** - * @return the timeSignificance - */ - public Integer getTimeSignificance() { - return timeSignificance; - } - - /** - * @param timeSignificance - * the timeSignificance to set - */ - public void setTimeSignificance(Integer timeSignificance) { - this.timeSignificance = timeSignificance; - } - - @Override - public ISpatialObject getSpatialObject() { - return null; - } - - /** + // The observation time. + @DataURI(position = 1) + @DynamicSerializeElement + private String satType; + + @DataURI(position = 2) + @DynamicSerializeElement + private Double pressure; + + @Embedded + @DataURI(position = 3, embedded = true) + @DynamicSerializeElement + private SurfaceObsLocation location; + + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; + + // Text of the WMO header + @Column(length = 32) + @DynamicSerializeElement + private String wmoHeader; + + // The observation time. + @Column + @DynamicSerializeElement + private Calendar validTime; + + @DynamicSerializeElement + @Transient + private Double windDir; + + @DynamicSerializeElement + @Transient + private Double windSpd; + + @DynamicSerializeElement + @Transient + private Double satelliteID; + + @DynamicSerializeElement + @Transient + private Double originatingID; + + @DynamicSerializeElement + @Transient + private Double satelliteClass; + + @DynamicSerializeElement + @Transient + private Double sgmtSzX; + + @DynamicSerializeElement + @Transient + private Double sgmtSzY; + + @DynamicSerializeElement + @Transient + private Integer satelliteInstr; + + @DynamicSerializeElement + @Transient + private Integer satelliteWindMethod; + + @DynamicSerializeElement + @Transient + private Double satelliteFreq; + + @DynamicSerializeElement + @Transient + private Double satelliteBandWidth; + + @DynamicSerializeElement + @Transient + private Double coldestTemp; + + @DynamicSerializeElement + @Transient + private Integer heightMethod; + + @DynamicSerializeElement + @Transient + private Integer tracerCorrelation; + + @DynamicSerializeElement + @Transient + private Integer landSea; + + @DynamicSerializeElement + @Transient + private Double satelliteZenith; + + @DynamicSerializeElement + @Transient + private Integer firstGuess; + + @DynamicSerializeElement + @Transient + private Integer timeSignificance; + + /** + * Empty constructor. + */ + public BufrHDWObs() { + } + + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public BufrHDWObs(String uri) { + super(uri); + } + + /** + * Get the observation time for this data. + * + * @return The data observation time. + */ + public Calendar getValidTime() { + return validTime; + } + + /** + * Set the observation time for this data. + * + * @param timeObs + * The data observation time. + */ + public void setValidTime(Calendar time) { + validTime = time; + } + + /** + * @return the satType + */ + public String getSatType() { + return satType; + } + + /** + * @param satType + * the satType to set + */ + public void setSatType(String type) { + satType = type; + } + + /** + * @param satType + * the satType to set + */ + public void setSatType(BUFRHDWSatType type) { + satType = type.toString(); + } + + /** + * @return the location + */ + public SurfaceObsLocation getLocation() { + return location; + } + + /** + * @param location + * the location to set + */ + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } + + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } + + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } + + /** + * @return the windDir + */ + public Double getWindDir() { + return windDir; + } + + /** + * @param windDir + * the windDir to set + */ + public void setWindDir(Double direction) { + windDir = direction; + } + + /** + * @return the windSpd + */ + public Double getWindSpd() { + return windSpd; + } + + /** + * @param windSpd + * the windSpd to set + */ + public void setWindSpd(Double speed) { + windSpd = speed; + } + + /** + * @return the pressure + */ + public Double getPressure() { + return pressure; + } + + /** + * @param pressure + * the pressure to set + */ + public void setPressure(Double pressure) { + this.pressure = pressure; + } + + /** + * @return the satelliteID + */ + public Double getSatelliteID() { + return satelliteID; + } + + /** + * @param satelliteID + * the satelliteID to set + */ + public void setSatelliteID(Double satelliteID) { + this.satelliteID = satelliteID; + } + + /** + * @return the originatingID + */ + public Double getOriginatingID() { + return originatingID; + } + + /** + * @param originatingID + * the originatingID to set + */ + public void setOriginatingID(Double originatingID) { + this.originatingID = originatingID; + } + + /** + * @return the satelliteClass + */ + public Double getSatelliteClass() { + return satelliteClass; + } + + /** + * @param satelliteClass + * the satelliteClass to set + */ + public void setSatelliteClass(Double satelliteClass) { + this.satelliteClass = satelliteClass; + } + + /** + * @return the sgmtSzX + */ + public Double getSgmtSzX() { + return sgmtSzX; + } + + /** + * @param sgmtSzX + * the sgmtSzX to set + */ + public void setSgmtSzX(Double sgmtSzX) { + this.sgmtSzX = sgmtSzX; + } + + /** + * @return the sgmtSzY + */ + public Double getSgmtSzY() { + return sgmtSzY; + } + + /** + * @param sgmtSzY + * the sgmtSzY to set + */ + public void setSgmtSzY(Double sgmtSzY) { + this.sgmtSzY = sgmtSzY; + } + + /** + * @return the satelliteInstr + */ + public Integer getSatelliteInstr() { + return satelliteInstr; + } + + /** + * @param satelliteInstr + * the satelliteInstr to set + */ + public void setSatelliteInstr(Integer satelliteInstr) { + this.satelliteInstr = satelliteInstr; + } + + /** + * @return the satelliteWindMethod + */ + public Integer getSatelliteWindMethod() { + return satelliteWindMethod; + } + + /** + * @param satelliteWindMethod + * the satelliteWindMethod to set + */ + public void setSatelliteWindMethod(Integer satelliteWindMethod) { + this.satelliteWindMethod = satelliteWindMethod; + } + + /** + * @return the satelliteFreq + */ + public Double getSatelliteFreq() { + return satelliteFreq; + } + + /** + * @param satelliteFreq + * the satelliteFreq to set + */ + public void setSatelliteFreq(Double satelliteFreq) { + this.satelliteFreq = satelliteFreq; + } + + /** + * @return the satelliteBandWidth + */ + public Double getSatelliteBandWidth() { + return satelliteBandWidth; + } + + /** + * @param satelliteBandWidth + * the satelliteBandWidth to set + */ + public void setSatelliteBandWidth(Double satelliteBandWidth) { + this.satelliteBandWidth = satelliteBandWidth; + } + + /** + * @return the coldestTemp + */ + public Double getColdestTemp() { + return coldestTemp; + } + + /** + * @param coldestTemp + * the coldestTemp to set + */ + public void setColdestTemp(Double coldestTemp) { + this.coldestTemp = coldestTemp; + } + + /** + * @return the heightMethod + */ + public Integer getHeightMethod() { + return heightMethod; + } + + /** + * @param heightMethod + * the heightMethod to set + */ + public void setHeightMethod(Integer heightMethod) { + this.heightMethod = heightMethod; + } + + /** + * @return the tracerCorrelation + */ + public Integer getTracerCorrelation() { + return tracerCorrelation; + } + + /** + * @param tracerCorrelation + * the tracerCorrelation to set + */ + public void setTracerCorrelation(Integer tracerCorrelation) { + this.tracerCorrelation = tracerCorrelation; + } + + /** + * @return the landSea + */ + public Integer getLandSea() { + return landSea; + } + + /** + * @param landSea + * the landSea to set + */ + public void setLandSea(Integer landSea) { + this.landSea = landSea; + } + + /** + * @return the satelliteZenith + */ + public Double getSatelliteZenith() { + return satelliteZenith; + } + + /** + * @param satelliteZenith + * the satelliteZenith to set + */ + public void setSatelliteZenith(Double satelliteZenith) { + this.satelliteZenith = satelliteZenith; + } + + /** + * @return the firstGuess + */ + public Integer getFirstGuess() { + return firstGuess; + } + + /** + * @param firstGuess + * the firstGuess to set + */ + public void setFirstGuess(Integer firstGuess) { + this.firstGuess = firstGuess; + } + + /** + * @return the timeSignificance + */ + public Integer getTimeSignificance() { + return timeSignificance; + } + + /** + * @param timeSignificance + * the timeSignificance to set + */ + public void setTimeSignificance(Integer timeSignificance) { + this.timeSignificance = timeSignificance; + } + + @Override + public ISpatialObject getSpatialObject() { + return null; + } + + /** * */ - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - /** + /** * */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } - /** - * Returns the hashCode for this object. This implementation returns the - * hashCode of the generated dataURI. - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result - + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); - return result; - } + /** + * Returns the hashCode for this object. This implementation returns the + * hashCode of the generated dataURI. + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = (prime * result) + + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); + return result; + } - /** - * Checks if this record is equal to another by checking the generated - * dataURI. - * - * @param obj - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - BufrHDWObs other = (BufrHDWObs) obj; - if (getDataURI() == null) { - if (other.getDataURI() != null) { - return false; - } - } else if (!getDataURI().equals(other.getDataURI())) { - return false; - } - return true; - } + /** + * Checks if this record is equal to another by checking the generated + * dataURI. + * + * @param obj + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + BufrHDWObs other = (BufrHDWObs) obj; + if (getDataURI() == null) { + if (other.getDataURI() != null) { + return false; + } + } else if (!getDataURI().equals(other.getDataURI())) { + return false; + } + return true; + } + @Override + public String getPluginName() { + return "bufrhdw"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrmthdw/src/com/raytheon/uf/common/dataplugin/bufrmthdw/BufrMTHDWObs.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrmthdw/src/com/raytheon/uf/common/dataplugin/bufrmthdw/BufrMTHDWObs.java index 70694a43fe..967b670180 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrmthdw/src/com/raytheon/uf/common/dataplugin/bufrmthdw/BufrMTHDWObs.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrmthdw/src/com/raytheon/uf/common/dataplugin/bufrmthdw/BufrMTHDWObs.java @@ -59,6 +59,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * PluginDataObject. * May 17, 2013 1869 bsteffen Remove DataURI column from sat plot * types. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -73,557 +74,557 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "bufrmthdw", - indexes = { - @Index(name = "bufrmthdw_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "bufrmthdw", indexes = { @Index(name = "bufrmthdw_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class BufrMTHDWObs extends PersistablePluginDataObject implements ISpatialEnabled, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - // The observation time. - @DataURI(position = 1) - @DynamicSerializeElement - private String satType; - - @DataURI(position = 2) - @DynamicSerializeElement - private Double pressure; - - @Embedded - @DataURI(position = 3, embedded = true) - @DynamicSerializeElement - private SurfaceObsLocation location; - - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - // Text of the WMO header - @Column(length = 32) - @DynamicSerializeElement - private String wmoHeader; - - // The observation time. - @Column - @DynamicSerializeElement - private Calendar validTime; - - @DynamicSerializeElement - @Transient - private Double windDir; - - @DynamicSerializeElement - @Transient - private Double windSpd; - - @DynamicSerializeElement - @Transient - private Double satelliteID; - - @DynamicSerializeElement - @Transient - private Double originatingID; - - @DynamicSerializeElement - @Transient - private Double satelliteClass; - - @DynamicSerializeElement - @Transient - private Double sgmtSzX; - - @DynamicSerializeElement - @Transient - private Double sgmtSzY; - - @DynamicSerializeElement - @Transient - private Integer satelliteInstr; - - @DynamicSerializeElement - @Transient - private Integer satelliteWindMethod; - - @DynamicSerializeElement - @Transient - private Double satelliteFreq; - - @DynamicSerializeElement - @Transient - private Double satelliteBandWidth; - - @DynamicSerializeElement - @Transient - private Double coldestTemp; - - @DynamicSerializeElement - @Transient - private Integer heightMethod; - - @DynamicSerializeElement - @Transient - private Integer tracerCorrelation; - - @DynamicSerializeElement - @Transient - private Integer landSea; - - @DynamicSerializeElement - @Transient - private Double satelliteZenith; - - @DynamicSerializeElement - @Transient - private Integer firstGuess; - - @DynamicSerializeElement - @Transient - private Integer timeSignificance; - - /** - * Empty constructor. - */ - public BufrMTHDWObs() { - } - - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public BufrMTHDWObs(String uri) { - super(uri); - } - - /** - * Get the observation time for this data. - * - * @return The data observation time. - */ - public Calendar getValidTime() { - return validTime; - } - - /** - * Set the observation time for this data. - * - * @param timeObs - * The data observation time. - */ - public void setValidTime(Calendar time) { - validTime = time; - } - - /** - * @return the satType - */ - public String getSatType() { - return satType; - } - - /** - * @param satType - * the satType to set - */ - public void setSatType(String type) { - satType = type; - } - - /** - * @param satType - * the satType to set - */ - public void setSatType(BUFRMTHDWSatType type) { - satType = type.toString(); - } - - /** - * @return the location - */ - public SurfaceObsLocation getLocation() { - return location; - } - - /** - * @param location - * the location to set - */ - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } - - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } - - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } - - /** - * @return the windDir - */ - public Double getWindDir() { - return windDir; - } - - /** - * @param windDir - * the windDir to set - */ - public void setWindDir(Double direction) { - windDir = direction; - } - - /** - * @return the windSpd - */ - public Double getWindSpd() { - return windSpd; - } - - /** - * @param windSpd - * the windSpd to set - */ - public void setWindSpd(Double speed) { - windSpd = speed; - } - - /** - * @return the pressure - */ - public Double getPressure() { - return pressure; - } - - /** - * @param pressure - * the pressure to set - */ - public void setPressure(Double pressure) { - this.pressure = pressure; - } - - /** - * @return the satelliteID - */ - public Double getSatelliteID() { - return satelliteID; - } - - /** - * @param satelliteID - * the satelliteID to set - */ - public void setSatelliteID(Double satelliteID) { - this.satelliteID = satelliteID; - } - - /** - * @return the originatingID - */ - public Double getOriginatingID() { - return originatingID; - } - - /** - * @param originatingID - * the originatingID to set - */ - public void setOriginatingID(Double originatingID) { - this.originatingID = originatingID; - } - - /** - * @return the satelliteClass - */ - public Double getSatelliteClass() { - return satelliteClass; - } - - /** - * @param satelliteClass - * the satelliteClass to set - */ - public void setSatelliteClass(Double satelliteClass) { - this.satelliteClass = satelliteClass; - } - - /** - * @return the sgmtSzX - */ - public Double getSgmtSzX() { - return sgmtSzX; - } - - /** - * @param sgmtSzX - * the sgmtSzX to set - */ - public void setSgmtSzX(Double sgmtSzX) { - this.sgmtSzX = sgmtSzX; - } - - /** - * @return the sgmtSzY - */ - public Double getSgmtSzY() { - return sgmtSzY; - } - - /** - * @param sgmtSzY - * the sgmtSzY to set - */ - public void setSgmtSzY(Double sgmtSzY) { - this.sgmtSzY = sgmtSzY; - } - - /** - * @return the satelliteInstr - */ - public Integer getSatelliteInstr() { - return satelliteInstr; - } - - /** - * @param satelliteInstr - * the satelliteInstr to set - */ - public void setSatelliteInstr(Integer satelliteInstr) { - this.satelliteInstr = satelliteInstr; - } - - /** - * @return the satelliteWindMethod - */ - public Integer getSatelliteWindMethod() { - return satelliteWindMethod; - } - - /** - * @param satelliteWindMethod - * the satelliteWindMethod to set - */ - public void setSatelliteWindMethod(Integer satelliteWindMethod) { - this.satelliteWindMethod = satelliteWindMethod; - } - - /** - * @return the satelliteFreq - */ - public Double getSatelliteFreq() { - return satelliteFreq; - } - - /** - * @param satelliteFreq - * the satelliteFreq to set - */ - public void setSatelliteFreq(Double satelliteFreq) { - this.satelliteFreq = satelliteFreq; - } - - /** - * @return the satelliteBandWidth - */ - public Double getSatelliteBandWidth() { - return satelliteBandWidth; - } - - /** - * @param satelliteBandWidth - * the satelliteBandWidth to set - */ - public void setSatelliteBandWidth(Double satelliteBandWidth) { - this.satelliteBandWidth = satelliteBandWidth; - } - - /** - * @return the coldestTemp - */ - public Double getColdestTemp() { - return coldestTemp; - } - - /** - * @param coldestTemp - * the coldestTemp to set - */ - public void setColdestTemp(Double coldestTemp) { - this.coldestTemp = coldestTemp; - } - - /** - * @return the heightMethod - */ - public Integer getHeightMethod() { - return heightMethod; - } - - /** - * @param heightMethod - * the heightMethod to set - */ - public void setHeightMethod(Integer heightMethod) { - this.heightMethod = heightMethod; - } - - /** - * @return the tracerCorrelation - */ - public Integer getTracerCorrelation() { - return tracerCorrelation; - } - - /** - * @param tracerCorrelation - * the tracerCorrelation to set - */ - public void setTracerCorrelation(Integer tracerCorrelation) { - this.tracerCorrelation = tracerCorrelation; - } - - /** - * @return the landSea - */ - public Integer getLandSea() { - return landSea; - } - - /** - * @param landSea - * the landSea to set - */ - public void setLandSea(Integer landSea) { - this.landSea = landSea; - } - - /** - * @return the satelliteZenith - */ - public Double getSatelliteZenith() { - return satelliteZenith; - } - - /** - * @param satelliteZenith - * the satelliteZenith to set - */ - public void setSatelliteZenith(Double satelliteZenith) { - this.satelliteZenith = satelliteZenith; - } - - /** - * @return the firstGuess - */ - public Integer getFirstGuess() { - return firstGuess; - } - - /** - * @param firstGuess - * the firstGuess to set - */ - public void setFirstGuess(Integer firstGuess) { - this.firstGuess = firstGuess; - } - - /** - * @return the timeSignificance - */ - public Integer getTimeSignificance() { - return timeSignificance; - } - - /** - * @param timeSignificance - * the timeSignificance to set - */ - public void setTimeSignificance(Integer timeSignificance) { - this.timeSignificance = timeSignificance; - } - - @Override - public ISpatialObject getSpatialObject() { - return null; - } - - /** + // The observation time. + @DataURI(position = 1) + @DynamicSerializeElement + private String satType; + + @DataURI(position = 2) + @DynamicSerializeElement + private Double pressure; + + @Embedded + @DataURI(position = 3, embedded = true) + @DynamicSerializeElement + private SurfaceObsLocation location; + + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; + + // Text of the WMO header + @Column(length = 32) + @DynamicSerializeElement + private String wmoHeader; + + // The observation time. + @Column + @DynamicSerializeElement + private Calendar validTime; + + @DynamicSerializeElement + @Transient + private Double windDir; + + @DynamicSerializeElement + @Transient + private Double windSpd; + + @DynamicSerializeElement + @Transient + private Double satelliteID; + + @DynamicSerializeElement + @Transient + private Double originatingID; + + @DynamicSerializeElement + @Transient + private Double satelliteClass; + + @DynamicSerializeElement + @Transient + private Double sgmtSzX; + + @DynamicSerializeElement + @Transient + private Double sgmtSzY; + + @DynamicSerializeElement + @Transient + private Integer satelliteInstr; + + @DynamicSerializeElement + @Transient + private Integer satelliteWindMethod; + + @DynamicSerializeElement + @Transient + private Double satelliteFreq; + + @DynamicSerializeElement + @Transient + private Double satelliteBandWidth; + + @DynamicSerializeElement + @Transient + private Double coldestTemp; + + @DynamicSerializeElement + @Transient + private Integer heightMethod; + + @DynamicSerializeElement + @Transient + private Integer tracerCorrelation; + + @DynamicSerializeElement + @Transient + private Integer landSea; + + @DynamicSerializeElement + @Transient + private Double satelliteZenith; + + @DynamicSerializeElement + @Transient + private Integer firstGuess; + + @DynamicSerializeElement + @Transient + private Integer timeSignificance; + + /** + * Empty constructor. + */ + public BufrMTHDWObs() { + } + + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public BufrMTHDWObs(String uri) { + super(uri); + } + + /** + * Get the observation time for this data. + * + * @return The data observation time. + */ + public Calendar getValidTime() { + return validTime; + } + + /** + * Set the observation time for this data. + * + * @param timeObs + * The data observation time. + */ + public void setValidTime(Calendar time) { + validTime = time; + } + + /** + * @return the satType + */ + public String getSatType() { + return satType; + } + + /** + * @param satType + * the satType to set + */ + public void setSatType(String type) { + satType = type; + } + + /** + * @param satType + * the satType to set + */ + public void setSatType(BUFRMTHDWSatType type) { + satType = type.toString(); + } + + /** + * @return the location + */ + public SurfaceObsLocation getLocation() { + return location; + } + + /** + * @param location + * the location to set + */ + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } + + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } + + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } + + /** + * @return the windDir + */ + public Double getWindDir() { + return windDir; + } + + /** + * @param windDir + * the windDir to set + */ + public void setWindDir(Double direction) { + windDir = direction; + } + + /** + * @return the windSpd + */ + public Double getWindSpd() { + return windSpd; + } + + /** + * @param windSpd + * the windSpd to set + */ + public void setWindSpd(Double speed) { + windSpd = speed; + } + + /** + * @return the pressure + */ + public Double getPressure() { + return pressure; + } + + /** + * @param pressure + * the pressure to set + */ + public void setPressure(Double pressure) { + this.pressure = pressure; + } + + /** + * @return the satelliteID + */ + public Double getSatelliteID() { + return satelliteID; + } + + /** + * @param satelliteID + * the satelliteID to set + */ + public void setSatelliteID(Double satelliteID) { + this.satelliteID = satelliteID; + } + + /** + * @return the originatingID + */ + public Double getOriginatingID() { + return originatingID; + } + + /** + * @param originatingID + * the originatingID to set + */ + public void setOriginatingID(Double originatingID) { + this.originatingID = originatingID; + } + + /** + * @return the satelliteClass + */ + public Double getSatelliteClass() { + return satelliteClass; + } + + /** + * @param satelliteClass + * the satelliteClass to set + */ + public void setSatelliteClass(Double satelliteClass) { + this.satelliteClass = satelliteClass; + } + + /** + * @return the sgmtSzX + */ + public Double getSgmtSzX() { + return sgmtSzX; + } + + /** + * @param sgmtSzX + * the sgmtSzX to set + */ + public void setSgmtSzX(Double sgmtSzX) { + this.sgmtSzX = sgmtSzX; + } + + /** + * @return the sgmtSzY + */ + public Double getSgmtSzY() { + return sgmtSzY; + } + + /** + * @param sgmtSzY + * the sgmtSzY to set + */ + public void setSgmtSzY(Double sgmtSzY) { + this.sgmtSzY = sgmtSzY; + } + + /** + * @return the satelliteInstr + */ + public Integer getSatelliteInstr() { + return satelliteInstr; + } + + /** + * @param satelliteInstr + * the satelliteInstr to set + */ + public void setSatelliteInstr(Integer satelliteInstr) { + this.satelliteInstr = satelliteInstr; + } + + /** + * @return the satelliteWindMethod + */ + public Integer getSatelliteWindMethod() { + return satelliteWindMethod; + } + + /** + * @param satelliteWindMethod + * the satelliteWindMethod to set + */ + public void setSatelliteWindMethod(Integer satelliteWindMethod) { + this.satelliteWindMethod = satelliteWindMethod; + } + + /** + * @return the satelliteFreq + */ + public Double getSatelliteFreq() { + return satelliteFreq; + } + + /** + * @param satelliteFreq + * the satelliteFreq to set + */ + public void setSatelliteFreq(Double satelliteFreq) { + this.satelliteFreq = satelliteFreq; + } + + /** + * @return the satelliteBandWidth + */ + public Double getSatelliteBandWidth() { + return satelliteBandWidth; + } + + /** + * @param satelliteBandWidth + * the satelliteBandWidth to set + */ + public void setSatelliteBandWidth(Double satelliteBandWidth) { + this.satelliteBandWidth = satelliteBandWidth; + } + + /** + * @return the coldestTemp + */ + public Double getColdestTemp() { + return coldestTemp; + } + + /** + * @param coldestTemp + * the coldestTemp to set + */ + public void setColdestTemp(Double coldestTemp) { + this.coldestTemp = coldestTemp; + } + + /** + * @return the heightMethod + */ + public Integer getHeightMethod() { + return heightMethod; + } + + /** + * @param heightMethod + * the heightMethod to set + */ + public void setHeightMethod(Integer heightMethod) { + this.heightMethod = heightMethod; + } + + /** + * @return the tracerCorrelation + */ + public Integer getTracerCorrelation() { + return tracerCorrelation; + } + + /** + * @param tracerCorrelation + * the tracerCorrelation to set + */ + public void setTracerCorrelation(Integer tracerCorrelation) { + this.tracerCorrelation = tracerCorrelation; + } + + /** + * @return the landSea + */ + public Integer getLandSea() { + return landSea; + } + + /** + * @param landSea + * the landSea to set + */ + public void setLandSea(Integer landSea) { + this.landSea = landSea; + } + + /** + * @return the satelliteZenith + */ + public Double getSatelliteZenith() { + return satelliteZenith; + } + + /** + * @param satelliteZenith + * the satelliteZenith to set + */ + public void setSatelliteZenith(Double satelliteZenith) { + this.satelliteZenith = satelliteZenith; + } + + /** + * @return the firstGuess + */ + public Integer getFirstGuess() { + return firstGuess; + } + + /** + * @param firstGuess + * the firstGuess to set + */ + public void setFirstGuess(Integer firstGuess) { + this.firstGuess = firstGuess; + } + + /** + * @return the timeSignificance + */ + public Integer getTimeSignificance() { + return timeSignificance; + } + + /** + * @param timeSignificance + * the timeSignificance to set + */ + public void setTimeSignificance(Integer timeSignificance) { + this.timeSignificance = timeSignificance; + } + + @Override + public ISpatialObject getSpatialObject() { + return null; + } + + /** * */ - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - /** + /** * */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } - /** - * Returns the hashCode for this object. This implementation returns the - * hashCode of the generated dataURI. - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result - + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); - return result; - } + /** + * Returns the hashCode for this object. This implementation returns the + * hashCode of the generated dataURI. + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = (prime * result) + + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); + return result; + } - /** - * Checks if this record is equal to another by checking the generated - * dataURI. - * - * @param obj - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - BufrMTHDWObs other = (BufrMTHDWObs) obj; - if (getDataURI() == null) { - if (other.getDataURI() != null) { - return false; - } - } else if (!getDataURI().equals(other.getDataURI())) { - return false; - } - return true; - } + /** + * Checks if this record is equal to another by checking the generated + * dataURI. + * + * @param obj + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + BufrMTHDWObs other = (BufrMTHDWObs) obj; + if (getDataURI() == null) { + if (other.getDataURI() != null) { + return false; + } + } else if (!getDataURI().equals(other.getDataURI())) { + return false; + } + return true; + } + @Override + public String getPluginName() { + return "bufrmthdw"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrncwf/src/com/raytheon/uf/common/dataplugin/ncwf/BUFRncwf.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrncwf/src/com/raytheon/uf/common/dataplugin/ncwf/BUFRncwf.java index 6c27068227..a81679b54d 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrncwf/src/com/raytheon/uf/common/dataplugin/ncwf/BUFRncwf.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrncwf/src/com/raytheon/uf/common/dataplugin/ncwf/BUFRncwf.java @@ -60,10 +60,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Aug 17, 2009 jkorman Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -77,213 +79,215 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "bufrncwf", - indexes = { - @Index(name = "bufrncwf_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "bufrncwf", indexes = { @Index(name = "bufrncwf_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class BUFRncwf extends PersistablePluginDataObject implements - ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { + ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - @Embedded - @DataURI(position = 1, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; + @Embedded + @DataURI(position = 1, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; - @Transient - @XmlElement - @DynamicSerializeElement - private NCWFFeature detection; + @Transient + @XmlElement + @DynamicSerializeElement + private NCWFFeature detection; - @Transient - @XmlElement - @DynamicSerializeElement - private NCWFFeature forecast; + @Transient + @XmlElement + @DynamicSerializeElement + private NCWFFeature forecast; - @Transient - @XmlAttribute - @DynamicSerializeElement - private Double stormDir; + @Transient + @XmlAttribute + @DynamicSerializeElement + private Double stormDir; - @Transient - @XmlAttribute - @DynamicSerializeElement - private Double stormSpeed; + @Transient + @XmlAttribute + @DynamicSerializeElement + private Double stormSpeed; - @Transient - @XmlAttribute - @DynamicSerializeElement - private Double stormTop; + @Transient + @XmlAttribute + @DynamicSerializeElement + private Double stormTop; - /** - * Empty constructor. - */ - public BUFRncwf() { - } + /** + * Empty constructor. + */ + public BUFRncwf() { + } - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public BUFRncwf(String uri) { - super(uri); - } + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public BUFRncwf(String uri) { + super(uri); + } - /** - * @return the location - */ - public SurfaceObsLocation getLocation() { - return location; - } + /** + * @return the location + */ + public SurfaceObsLocation getLocation() { + return location; + } - /** - * @param location - * the location to set - */ - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } + /** + * @param location + * the location to set + */ + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } - /** - * @return the detection - */ - public NCWFFeature getDetection() { - return detection; - } + /** + * @return the detection + */ + public NCWFFeature getDetection() { + return detection; + } - /** - * @param detection - * the detection to set - */ - public void setDetection(NCWFFeature detection) { - this.detection = detection; - } + /** + * @param detection + * the detection to set + */ + public void setDetection(NCWFFeature detection) { + this.detection = detection; + } - /** - * @return the forecast - */ - public NCWFFeature getForecast() { - return forecast; - } + /** + * @return the forecast + */ + public NCWFFeature getForecast() { + return forecast; + } - /** - * @param forecast - * the forecast to set - */ - public void setForecast(NCWFFeature forecast) { - this.forecast = forecast; - } + /** + * @param forecast + * the forecast to set + */ + public void setForecast(NCWFFeature forecast) { + this.forecast = forecast; + } - /** - * @return the stormDir - */ - public Double getStormDir() { - return stormDir; - } + /** + * @return the stormDir + */ + public Double getStormDir() { + return stormDir; + } - /** - * @param stormDir - * the stormDir to set - */ - public void setStormDir(Double stormDir) { - this.stormDir = stormDir; - } + /** + * @param stormDir + * the stormDir to set + */ + public void setStormDir(Double stormDir) { + this.stormDir = stormDir; + } - /** - * @return the stormSpeed - */ - public Double getStormSpeed() { - return stormSpeed; - } + /** + * @return the stormSpeed + */ + public Double getStormSpeed() { + return stormSpeed; + } - /** - * @param stormSpeed - * the stormSpeed to set - */ - public void setStormSpeed(Double stormSpeed) { - this.stormSpeed = stormSpeed; - } + /** + * @param stormSpeed + * the stormSpeed to set + */ + public void setStormSpeed(Double stormSpeed) { + this.stormSpeed = stormSpeed; + } - /** - * @return the stormTop - */ - public Double getStormTop() { - return stormTop; - } + /** + * @return the stormTop + */ + public Double getStormTop() { + return stormTop; + } - /** - * @param stormTop - * the stormTop to set - */ - public void setStormTop(Double stormTop) { - this.stormTop = stormTop; - } + /** + * @param stormTop + * the stormTop to set + */ + public void setStormTop(Double stormTop) { + this.stormTop = stormTop; + } - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } - @Override - public ISpatialObject getSpatialObject() { - return location; - } + @Override + public ISpatialObject getSpatialObject() { + return location; + } - @Override - public String getString(String paramName) { - return null; - } + @Override + public String getString(String paramName) { + return null; + } - @Override - public String[] getStrings(String paramName) { - return null; - } + @Override + public String[] getStrings(String paramName) { + return null; + } - @Override - public Amount getValue(String paramName) { - return null; - } + @Override + public Amount getValue(String paramName) { + return null; + } - @Override - public Collection getValues(String paramName) { - return null; - } + @Override + public Collection getValues(String paramName) { + return null; + } - /** + /** * */ - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - /** + /** * */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "bufrncwf"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrquikscat/src/com/raytheon/uf/common/dataplugin/bufrquikscat/QUIKScatObs.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrquikscat/src/com/raytheon/uf/common/dataplugin/bufrquikscat/QUIKScatObs.java index 6f1637c721..2463ebf132 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrquikscat/src/com/raytheon/uf/common/dataplugin/bufrquikscat/QUIKScatObs.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrquikscat/src/com/raytheon/uf/common/dataplugin/bufrquikscat/QUIKScatObs.java @@ -61,11 +61,13 @@ import com.vividsolutions.jts.geom.Geometry; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jun 18, 2009 2520 jkorman Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Jun 18, 2009 2520 jkorman Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -79,324 +81,326 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "bufrquikscat", - indexes = { - @Index(name = "bufrquikscat_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "bufrquikscat", indexes = { @Index(name = "bufrquikscat_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class QUIKScatObs extends PersistablePluginDataObject implements - ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { + ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - @DataURI(position = 1) - @XmlAttribute - @DynamicSerializeElement - private Integer satId; + @DataURI(position = 1) + @XmlAttribute + @DynamicSerializeElement + private Integer satId; - @Embedded - @DataURI(position = 2, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; + @Embedded + @DataURI(position = 2, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; - // Text of the WMO header - @Column(length = 32) - @DynamicSerializeElement - @XmlElement - private String wmoHeader; + // Text of the WMO header + @Column(length = 32) + @DynamicSerializeElement + @XmlElement + private String wmoHeader; - @XmlAttribute - @DynamicSerializeElement - @Transient - private Integer orbitNumber; + @XmlAttribute + @DynamicSerializeElement + @Transient + private Integer orbitNumber; - // The observation time. - @XmlAttribute - @DynamicSerializeElement - @Transient - private Calendar timeObs; + // The observation time. + @XmlAttribute + @DynamicSerializeElement + @Transient + private Calendar timeObs; - @XmlAttribute - @DynamicSerializeElement - @Transient - private Double windDir; + @XmlAttribute + @DynamicSerializeElement + @Transient + private Double windDir; - @XmlAttribute - @DynamicSerializeElement - @Transient - private Double windSpd; + @XmlAttribute + @DynamicSerializeElement + @Transient + private Double windSpd; - @XmlAttribute - @DynamicSerializeElement - @Transient - private Double probRain; + @XmlAttribute + @DynamicSerializeElement + @Transient + private Double probRain; - @XmlAttribute - @DynamicSerializeElement - @Transient - private Integer rainIndex; + @XmlAttribute + @DynamicSerializeElement + @Transient + private Integer rainIndex; - /** - * Empty constructor. - */ - public QUIKScatObs() { - } + /** + * Empty constructor. + */ + public QUIKScatObs() { + } - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public QUIKScatObs(String uri) { - super(uri); - } + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public QUIKScatObs(String uri) { + super(uri); + } - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } - /** - * Was this location defined from the station catalog? False if not. - * - * @return Was this location defined from the station catalog? - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } + /** + * Was this location defined from the station catalog? False if not. + * + * @return Was this location defined from the station catalog? + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } - /** - * @return the location - */ - public SurfaceObsLocation getLocation() { - return location; - } + /** + * @return the location + */ + public SurfaceObsLocation getLocation() { + return location; + } - /** - * @param location - * the location to set - */ - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } + /** + * @param location + * the location to set + */ + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } - /** - * @return the satId - */ - public Integer getSatId() { - return satId; - } + /** + * @return the satId + */ + public Integer getSatId() { + return satId; + } - /** - * @param satId - * the satId to set - */ - public void setSatId(Integer satId) { - this.satId = satId; - } + /** + * @param satId + * the satId to set + */ + public void setSatId(Integer satId) { + this.satId = satId; + } - /** - * @return the orbitNumber - */ - public Integer getOrbitNumber() { - return orbitNumber; - } + /** + * @return the orbitNumber + */ + public Integer getOrbitNumber() { + return orbitNumber; + } - /** - * @param orbitNumber - * the orbitNumber to set - */ - public void setOrbitNumber(Integer orbitNumber) { - this.orbitNumber = orbitNumber; - } + /** + * @param orbitNumber + * the orbitNumber to set + */ + public void setOrbitNumber(Integer orbitNumber) { + this.orbitNumber = orbitNumber; + } - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * @return the windDir - */ - public Double getWindDir() { - return windDir; - } + /** + * @return the windDir + */ + public Double getWindDir() { + return windDir; + } - /** - * @param windDir - * the windDir to set - */ - public void setWindDir(Double windDir) { - this.windDir = windDir; - } + /** + * @param windDir + * the windDir to set + */ + public void setWindDir(Double windDir) { + this.windDir = windDir; + } - /** - * @return the windSpd - */ - public Double getWindSpd() { - return windSpd; - } + /** + * @return the windSpd + */ + public Double getWindSpd() { + return windSpd; + } - /** - * @param windSpd - * the windSpd to set - */ - public void setWindSpd(Double windSpd) { - this.windSpd = windSpd; - } + /** + * @param windSpd + * the windSpd to set + */ + public void setWindSpd(Double windSpd) { + this.windSpd = windSpd; + } - /** - * @return the probRain - */ - public Double getProbRain() { - return probRain; - } + /** + * @return the probRain + */ + public Double getProbRain() { + return probRain; + } - /** - * @param probRain - * the probRain to set - */ - public void setProbRain(Double probRain) { - this.probRain = probRain; - } + /** + * @param probRain + * the probRain to set + */ + public void setProbRain(Double probRain) { + this.probRain = probRain; + } - /** - * @return the rainIndex - */ - public Integer getRainIndex() { - return rainIndex; - } + /** + * @return the rainIndex + */ + public Integer getRainIndex() { + return rainIndex; + } - /** - * @param rainIndex - * the rainIndex to set - */ - public void setRainIndex(Integer rainIndex) { - this.rainIndex = rainIndex; - } + /** + * @param rainIndex + * the rainIndex to set + */ + public void setRainIndex(Integer rainIndex) { + this.rainIndex = rainIndex; + } - /** - * Get the observation time for this data. - * - * @return The data observation time. - */ - public Calendar getTimeObs() { - return timeObs; - } + /** + * Get the observation time for this data. + * + * @return The data observation time. + */ + public Calendar getTimeObs() { + return timeObs; + } - /** - * Set the observation time for this data. - * - * @param timeObs - * The data observation time. - */ - public void setTimeObs(Calendar timeObs) { - this.timeObs = timeObs; - } + /** + * Set the observation time for this data. + * + * @param timeObs + * The data observation time. + */ + public void setTimeObs(Calendar timeObs) { + this.timeObs = timeObs; + } - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } - @Override - public ISpatialObject getSpatialObject() { - return location; - } + @Override + public ISpatialObject getSpatialObject() { + return location; + } - @Override - public String getString(String paramName) { - return null; - } + @Override + public String getString(String paramName) { + return null; + } - @Override - public String[] getStrings(String paramName) { - return null; - } + @Override + public String[] getStrings(String paramName) { + return null; + } - @Override - public Amount getValue(String paramName) { - return null; - } + @Override + public Amount getValue(String paramName) { + return null; + } - @Override - public Collection getValues(String paramName) { - return null; - } + @Override + public Collection getValues(String paramName) { + return null; + } - /** + /** * */ - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - /** + /** * */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "bufrquikscat"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrsigwx/src/com/raytheon/uf/common/dataplugin/bufrsigwx/SigWxData.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrsigwx/src/com/raytheon/uf/common/dataplugin/bufrsigwx/SigWxData.java index 86c66ac5ff..054de56379 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrsigwx/src/com/raytheon/uf/common/dataplugin/bufrsigwx/SigWxData.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrsigwx/src/com/raytheon/uf/common/dataplugin/bufrsigwx/SigWxData.java @@ -60,10 +60,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jun 18, 2009 jkorman Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -77,250 +79,251 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "bufrsigwx", - indexes = { - @Index(name = "bufrswigwx_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "bufrsigwx", indexes = { @Index(name = "bufrswigwx_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) public class SigWxData extends PersistablePluginDataObject implements - IDecoderGettable, IPointData, IPersistable { + IDecoderGettable, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @Column - @DataURI(position = 1) - @XmlElement - @DynamicSerializeElement - private SigWxLayer wxLayer; + @Column + @DataURI(position = 1) + @XmlElement + @DynamicSerializeElement + private SigWxLayer wxLayer; - @Column - @DataURI(position = 2) - @XmlElement - @DynamicSerializeElement - private SigWxType wxType; + @Column + @DataURI(position = 2) + @XmlElement + @DynamicSerializeElement + private SigWxType wxType; - @Column - @DataURI(position = 3) - @XmlAttribute - @DynamicSerializeElement - private Integer key; + @Column + @DataURI(position = 3) + @XmlAttribute + @DynamicSerializeElement + private Integer key; - @Column - @XmlAttribute - @DynamicSerializeElement - private Integer baseHeight; + @Column + @XmlAttribute + @DynamicSerializeElement + private Integer baseHeight; - @Column - @XmlAttribute - @DynamicSerializeElement - private Integer topHeight; + @Column + @XmlAttribute + @DynamicSerializeElement + private Integer topHeight; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - // Text of the WMO header - @Column(length = 32) - @DynamicSerializeElement - @XmlElement - private String wmoHeader; + // Text of the WMO header + @Column(length = 32) + @DynamicSerializeElement + @XmlElement + private String wmoHeader; - @Transient - @DynamicSerializeElement - @XmlElement - private TropopauseLayerData tropData; + @Transient + @DynamicSerializeElement + @XmlElement + private TropopauseLayerData tropData; - /** - * Empty constructor. - */ - public SigWxData() { - } + /** + * Empty constructor. + */ + public SigWxData() { + } - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public SigWxData(String uri) { - super(uri); - } + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public SigWxData(String uri) { + super(uri); + } - /** - * @return the wxLayer - */ - public SigWxLayer getWxLayer() { - return wxLayer; - } + /** + * @return the wxLayer + */ + public SigWxLayer getWxLayer() { + return wxLayer; + } - /** - * @param wxLayer - * the wxLayer to set - */ - public void setWxLayer(SigWxLayer wxLayer) { - this.wxLayer = wxLayer; - } + /** + * @param wxLayer + * the wxLayer to set + */ + public void setWxLayer(SigWxLayer wxLayer) { + this.wxLayer = wxLayer; + } - /** - * @return the wxType - */ - public SigWxType getWxType() { - return wxType; - } + /** + * @return the wxType + */ + public SigWxType getWxType() { + return wxType; + } - /** - * @param wxType - * the wxType to set - */ - public void setWxType(SigWxType wxType) { - this.wxType = wxType; - } + /** + * @param wxType + * the wxType to set + */ + public void setWxType(SigWxType wxType) { + this.wxType = wxType; + } - /** - * @return the baseHeight - */ - public Integer getBaseHeight() { - return baseHeight; - } + /** + * @return the baseHeight + */ + public Integer getBaseHeight() { + return baseHeight; + } - /** - * @param baseHeight - * the baseHeight to set - */ - public void setBaseHeight(Integer baseHeight) { - this.baseHeight = baseHeight; - } + /** + * @param baseHeight + * the baseHeight to set + */ + public void setBaseHeight(Integer baseHeight) { + this.baseHeight = baseHeight; + } - /** - * @return the topHeight - */ - public Integer getTopHeight() { - return topHeight; - } + /** + * @return the topHeight + */ + public Integer getTopHeight() { + return topHeight; + } - /** - * @param topHeight - * the topHeight to set - */ - public void setTopHeight(Integer topHeight) { - this.topHeight = topHeight; - } + /** + * @param topHeight + * the topHeight to set + */ + public void setTopHeight(Integer topHeight) { + this.topHeight = topHeight; + } - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * @return the tropData - */ - public TropopauseLayerData getTropData() { - return tropData; - } + /** + * @return the tropData + */ + public TropopauseLayerData getTropData() { + return tropData; + } - /** - * @param tropData - * the tropData to set - */ - public void setTropData(TropopauseLayerData tropData) { - this.tropData = tropData; - } + /** + * @param tropData + * the tropData to set + */ + public void setTropData(TropopauseLayerData tropData) { + this.tropData = tropData; + } - /** - * @return the key - */ - public Integer getKey() { - return key; - } + /** + * @return the key + */ + public Integer getKey() { + return key; + } - /** - * @param key - * the key to set - */ - public void setKey(Integer key) { - this.key = key; - } + /** + * @param key + * the key to set + */ + public void setKey(Integer key) { + this.key = key; + } - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } - @Override - public String getString(String paramName) { - return null; - } + @Override + public String getString(String paramName) { + return null; + } - @Override - public String[] getStrings(String paramName) { - return null; - } + @Override + public String[] getStrings(String paramName) { + return null; + } - @Override - public Amount getValue(String paramName) { - return null; - } + @Override + public Amount getValue(String paramName) { + return null; + } - @Override - public Collection getValues(String paramName) { - return null; - } + @Override + public Collection getValues(String paramName) { + return null; + } - /** + /** * */ - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - /** + /** * */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } - /** - * - * @return - */ - public final SigWxData copyObs() { - SigWxData obs = new SigWxData(); + /** + * + * @return + */ + public final SigWxData copyObs() { + SigWxData obs = new SigWxData(); - obs.dataTime = dataTime.clone(); - obs.pluginName = pluginName; + obs.dataTime = dataTime.clone(); - obs.baseHeight = baseHeight; - obs.topHeight = topHeight; - obs.wxLayer = wxLayer; - obs.wxType = wxType; - obs.wmoHeader = wmoHeader; + obs.baseHeight = baseHeight; + obs.topHeight = topHeight; + obs.wxLayer = wxLayer; + obs.wxType = wxType; + obs.wmoHeader = wmoHeader; + + return obs; + } - return obs; - } @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "bufrsigwx"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrssmi/src/com/raytheon/uf/common/dataplugin/bufrssmi/SSMIScanData.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrssmi/src/com/raytheon/uf/common/dataplugin/bufrssmi/SSMIScanData.java index 0ff6dd03bb..16eaed9154 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrssmi/src/com/raytheon/uf/common/dataplugin/bufrssmi/SSMIScanData.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrssmi/src/com/raytheon/uf/common/dataplugin/bufrssmi/SSMIScanData.java @@ -61,6 +61,7 @@ import com.vividsolutions.jts.geom.Geometry; * PluginDataObject. * May 17, 2013 1869 bsteffen Remove DataURI column from sat plot * types. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -75,300 +76,300 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "bufrssmi", - indexes = { - @Index(name = "bufrssmi_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "bufrssmi", indexes = { @Index(name = "bufrssmi_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class SSMIScanData extends PersistablePluginDataObject implements ISpatialEnabled, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @DataURI(position = 1) - @XmlAttribute - @DynamicSerializeElement - private Integer satId; + @DataURI(position = 1) + @XmlAttribute + @DynamicSerializeElement + private Integer satId; - @Embedded - @DataURI(position = 2, embedded = true) - @DynamicSerializeElement - private SurfaceObsLocation location; + @Embedded + @DataURI(position = 2, embedded = true) + @DynamicSerializeElement + private SurfaceObsLocation location; - @DynamicSerializeElement - @Transient - private Integer orbitNumber; + @DynamicSerializeElement + @Transient + private Integer orbitNumber; - @DynamicSerializeElement - @Transient - private Integer scanNumber; + @DynamicSerializeElement + @Transient + private Integer scanNumber; - @DynamicSerializeElement - @Transient - private Integer posNumber; + @DynamicSerializeElement + @Transient + private Integer posNumber; - // The profiler observation time. - @Column - @DynamicSerializeElement - private Calendar timeObs; + // The profiler observation time. + @Column + @DynamicSerializeElement + private Calendar timeObs; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - // Text of the WMO header - @Column(length = 32) - @DynamicSerializeElement - private String wmoHeader; + // Text of the WMO header + @Column(length = 32) + @DynamicSerializeElement + private String wmoHeader; - /** - * Empty constructor. - */ - public SSMIScanData() { - } + /** + * Empty constructor. + */ + public SSMIScanData() { + } - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public SSMIScanData(String uri) { - super(uri); - } + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public SSMIScanData(String uri) { + super(uri); + } - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } - /** - * Was this location defined from the station catalog? False if not. - * - * @return Was this location defined from the station catalog? - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } + /** + * Was this location defined from the station catalog? False if not. + * + * @return Was this location defined from the station catalog? + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } - /** - * @return the satId - */ - public Integer getSatId() { - return satId; - } + /** + * @return the satId + */ + public Integer getSatId() { + return satId; + } - /** - * @param satId - * the satId to set - */ - public void setSatId(Integer satId) { - this.satId = satId; - } + /** + * @param satId + * the satId to set + */ + public void setSatId(Integer satId) { + this.satId = satId; + } - /** - * @return the orbitNumber - */ - public Integer getOrbitNumber() { - return orbitNumber; - } + /** + * @return the orbitNumber + */ + public Integer getOrbitNumber() { + return orbitNumber; + } - /** - * @param orbitNumber - * the orbitNumber to set - */ - public void setOrbitNumber(Integer orbitNumber) { - this.orbitNumber = orbitNumber; - } + /** + * @param orbitNumber + * the orbitNumber to set + */ + public void setOrbitNumber(Integer orbitNumber) { + this.orbitNumber = orbitNumber; + } - /** - * @return the scanNumber - */ - public Integer getScanNumber() { - return scanNumber; - } + /** + * @return the scanNumber + */ + public Integer getScanNumber() { + return scanNumber; + } - /** - * @param scanNumber - * the scanNumber to set - */ - public void setScanNumber(Integer scanNumber) { - this.scanNumber = scanNumber; - } + /** + * @param scanNumber + * the scanNumber to set + */ + public void setScanNumber(Integer scanNumber) { + this.scanNumber = scanNumber; + } - /** - * @return the posNumber - */ - public Integer getPosNumber() { - return posNumber; - } + /** + * @return the posNumber + */ + public Integer getPosNumber() { + return posNumber; + } - /** - * @param posNumber - * the posNumber to set - */ - public void setPosNumber(Integer posNumber) { - this.posNumber = posNumber; - } + /** + * @param posNumber + * the posNumber to set + */ + public void setPosNumber(Integer posNumber) { + this.posNumber = posNumber; + } - /** - * Get the observation time for this data. - * - * @return The data observation time. - */ - public Calendar getTimeObs() { - return timeObs; - } + /** + * Get the observation time for this data. + * + * @return The data observation time. + */ + public Calendar getTimeObs() { + return timeObs; + } - /** - * Set the observation time for this data. - * - * @param timeObs - * The data observation time. - */ - public void setTimeObs(Calendar timeObs) { - this.timeObs = timeObs; - } + /** + * Set the observation time for this data. + * + * @param timeObs + * The data observation time. + */ + public void setTimeObs(Calendar timeObs) { + this.timeObs = timeObs; + } - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } - public SurfaceObsLocation getLocation() { - return location; - } + public SurfaceObsLocation getLocation() { + return location; + } - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } - /** + /** * */ - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - /** + /** * */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } - /** - * - * @return - */ - public final SSMIScanData copyObs() { - SSMIScanData obs = new SSMIScanData(); + /** + * + * @return + */ + public final SSMIScanData copyObs() { + SSMIScanData obs = new SSMIScanData(); - obs.dataTime = dataTime.clone(); - obs.timeObs = TimeTools.copy(timeObs); - obs.orbitNumber = orbitNumber; - obs.satId = satId; - obs.scanNumber = scanNumber; - obs.wmoHeader = wmoHeader; + obs.dataTime = dataTime.clone(); + obs.timeObs = TimeTools.copy(timeObs); + obs.orbitNumber = orbitNumber; + obs.satId = satId; + obs.scanNumber = scanNumber; + obs.wmoHeader = wmoHeader; - return obs; - } + return obs; + } - /** - * Returns the hashCode for this object. This implementation returns the - * hashCode of the generated dataURI. - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result - + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); - return result; - } + /** + * Returns the hashCode for this object. This implementation returns the + * hashCode of the generated dataURI. + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = (prime * result) + + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); + return result; + } - /** - * Checks if this record is equal to another by checking the generated - * dataURI. - * - * @param obj - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - SSMIScanData other = (SSMIScanData) obj; - if (getDataURI() == null) { - if (other.getDataURI() != null) { - return false; - } - } else if (!getDataURI().equals(other.getDataURI())) { - return false; - } - return true; - } + /** + * Checks if this record is equal to another by checking the generated + * dataURI. + * + * @param obj + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + SSMIScanData other = (SSMIScanData) obj; + if (getDataURI() == null) { + if (other.getDataURI() != null) { + return false; + } + } else if (!getDataURI().equals(other.getDataURI())) { + return false; + } + return true; + } + @Override + public String getPluginName() { + return "bufrssmi"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObs.java b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObs.java index 89ecdfa76c..3aae4061d0 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObs.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.bufrua/src/com/raytheon/uf/common/dataplugin/bufrua/UAObs.java @@ -93,6 +93,7 @@ import com.vividsolutions.jts.geom.Geometry; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * Jun 20, 2013 2128 bsteffen Ensure setDataURI sets the dataURI. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -106,73 +107,69 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "bufrua", - indexes = { - @Index(name = "bufrua_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "bufrua", indexes = { @Index(name = "bufrua_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class UAObs extends PersistablePluginDataObject implements - ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { + ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - private static final Comparator corComparator = new Comparator() { - @Override - public int compare(UAObs a, UAObs b) { - int compValue = 0; - String wmoA = a.getWmoHeader(); - String wmoB = b.getWmoHeader(); + private static final Comparator corComparator = new Comparator() { + @Override + public int compare(UAObs a, UAObs b) { + int compValue = 0; + String wmoA = a.getWmoHeader(); + String wmoB = b.getWmoHeader(); - if (wmoA != null) { - if (wmoB != null) { - compValue = wmoA.compareTo(wmoB); - } - } - if (compValue != 0) { - compValue *= -1; - } - return compValue; - } - }; + if (wmoA != null) { + if (wmoB != null) { + compValue = wmoA.compareTo(wmoB); + } + } + if (compValue != 0) { + compValue *= -1; + } + return compValue; + } + }; - public static final Unit DISTANCE_UNIT = SI.METER; + public static final Unit DISTANCE_UNIT = SI.METER; - public static final Unit TEMPERATURE_UNIT = SI.KELVIN; + public static final Unit TEMPERATURE_UNIT = SI.KELVIN; - public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; + public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; - public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; - public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; - private static final HashMap PARM_MAP = new HashMap(); - static { - PARM_MAP.put("GH", UA_GEOHGT); - PARM_MAP.put("Px", UA_PRESSURE); + private static final HashMap PARM_MAP = new HashMap(); + static { + PARM_MAP.put("GH", UA_GEOHGT); + PARM_MAP.put("Px", UA_PRESSURE); - PARM_MAP.put("T", SFC_TEMP); - PARM_MAP.put("DpT", SFC_DWPT); + PARM_MAP.put("T", SFC_TEMP); + PARM_MAP.put("DpT", SFC_DWPT); - PARM_MAP.put("WS", SFC_WNDSPD); - PARM_MAP.put("WD", SFC_WNDDIR); + PARM_MAP.put("WS", SFC_WNDSPD); + PARM_MAP.put("WD", SFC_WNDDIR); - PARM_MAP.put("NLAT", STA_LAT); - PARM_MAP.put("NLON", STA_LON); - } + PARM_MAP.put("NLAT", STA_LAT); + PARM_MAP.put("NLON", STA_LON); + } - public static final String UA_PARAM_PTRN = ".*:PRESS=\\d{2,4}"; + public static final String UA_PARAM_PTRN = ".*:PRESS=\\d{2,4}"; - // Non persisted value. Hold the last requested parameter name. - @Transient - private String parameterName = null; + // Non persisted value. Hold the last requested parameter name. + @Transient + private String parameterName = null; - // Non persisted value. Hold the last requested level value. - @Transient - private Integer levelId; + // Non persisted value. Hold the last requested level value. + @Transient + private Integer levelId; // Time of the observation. @Column @@ -186,268 +183,268 @@ public class UAObs extends PersistablePluginDataObject implements @DynamicSerializeElement private Calendar refHour; - // The observation report type. - @DataURI(position = 1) - @Column - @XmlAttribute - @DynamicSerializeElement - private Integer reportType; + // The observation report type. + @DataURI(position = 1) + @Column + @XmlAttribute + @DynamicSerializeElement + private Integer reportType; - @Embedded - @DataURI(position = 4, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; + @Embedded + @DataURI(position = 4, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; - // Correction indicator from wmo header - @DataURI(position = 2) - @Column - @XmlAttribute - @DynamicSerializeElement - private String corIndicator; + // Correction indicator from wmo header + @DataURI(position = 2) + @Column + @XmlAttribute + @DynamicSerializeElement + private String corIndicator; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - // Text of the WMO header - @DataURI(position = 3) - @Column - @XmlAttribute - @DynamicSerializeElement - private String wmoHeader; + // Text of the WMO header + @DataURI(position = 3) + @Column + @XmlAttribute + @DynamicSerializeElement + private String wmoHeader; - // Station pressure in Pascals. - @Column - @XmlAttribute - @DynamicSerializeElement - private Integer pressure_station; + // Station pressure in Pascals. + @Column + @XmlAttribute + @DynamicSerializeElement + private Integer pressure_station; - // The total cloud cover in 1/8s coverage. - @Column - @XmlAttribute - @DynamicSerializeElement - private Integer totalCloudCover; + // The total cloud cover in 1/8s coverage. + @Column + @XmlAttribute + @DynamicSerializeElement + private Integer totalCloudCover; - // The platform directio in angular degrees. - @Column - @XmlAttribute - @DynamicSerializeElement - private Integer platformDirection; + // The platform directio in angular degrees. + @Column + @XmlAttribute + @DynamicSerializeElement + private Integer platformDirection; - // The platform movement in meters per second. - @Column - @XmlAttribute - @DynamicSerializeElement - private Double platformMovement; + // The platform movement in meters per second. + @Column + @XmlAttribute + @DynamicSerializeElement + private Double platformMovement; - // ICAO of station if known. - @Column - @XmlAttribute - @DynamicSerializeElement - private String stationName; + // ICAO of station if known. + @Column + @XmlAttribute + @DynamicSerializeElement + private String stationName; - // The level data for this observation. - @Transient - @XmlElement - @DynamicSerializeElement - private List levels; + // The level data for this observation. + @Transient + @XmlElement + @DynamicSerializeElement + private List levels; - @Column(insertable = false, updatable = false) - @XmlAttribute - @DynamicSerializeElement - private Integer idx; + @Column(insertable = false, updatable = false) + @XmlAttribute + @DynamicSerializeElement + private Integer idx; - public void setIdx(Integer idx) { - this.idx = idx; - } + public void setIdx(Integer idx) { + this.idx = idx; + } - public Integer getIdx() { - return idx; - } + public Integer getIdx() { + return idx; + } - /** - * Empty constructor. - */ - public UAObs() { - } + /** + * Empty constructor. + */ + public UAObs() { + } - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public UAObs(String uri) { - super(uri); - corIndicator = "null".equals(corIndicator) ? null : corIndicator; - if (location != null) { - String staId = location.getStationId(); - location.setStationId("null".equals(staId) ? null : staId); - } - } + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public UAObs(String uri) { + super(uri); + corIndicator = "null".equals(corIndicator) ? null : corIndicator; + if (location != null) { + String staId = location.getStationId(); + location.setStationId("null".equals(staId) ? null : staId); + } + } - /** - * Get the set of levels for this observation. - * - * @return The level data. - */ - public List getLevels() { - return levels; - } + /** + * Get the set of levels for this observation. + * + * @return The level data. + */ + public List getLevels() { + return levels; + } - /** - * Set the set of levels for this observation. - * - * @param levels - * the levels to set - */ - public void setLevels(List levels) { - this.levels = levels; - } + /** + * Set the set of levels for this observation. + * + * @param levels + * the levels to set + */ + public void setLevels(List levels) { + this.levels = levels; + } - /** - * - * @param cloud - */ - public void addLevel(UAObsLevel level) { - if (levels == null) { - levels = new ArrayList(); - } - levels.add(level); - } + /** + * + * @param cloud + */ + public void addLevel(UAObsLevel level) { + if (levels == null) { + levels = new ArrayList(); + } + levels.add(level); + } - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * Get the report correction indicator. - * - * @return The corIndicator - */ - public String getCorIndicator() { - return corIndicator; - } + /** + * Get the report correction indicator. + * + * @return The corIndicator + */ + public String getCorIndicator() { + return corIndicator; + } - /** - * Set the report correction indicator. - * - * @param corIndicator - * The corIndicator. - */ - public void setCorIndicator(String corIndicator) { - this.corIndicator = corIndicator; - } + /** + * Set the report correction indicator. + * + * @param corIndicator + * The corIndicator. + */ + public void setCorIndicator(String corIndicator) { + this.corIndicator = corIndicator; + } - /** - * Get the report data for this observation. - * - * @return The Report data. - */ - public String getReportData() { - String s = null; - if (messageData instanceof String) { - s = (String) messageData; - } - return s; - } + /** + * Get the report data for this observation. + * + * @return The Report data. + */ + public String getReportData() { + String s = null; + if (messageData instanceof String) { + s = (String) messageData; + } + return s; + } - /** - * Set the report data for this observation. - * - * @param reportData - * The Report data. - */ - public void setReportData(String reportData) { - messageData = reportData; - } + /** + * Set the report data for this observation. + * + * @param reportData + * The Report data. + */ + public void setReportData(String reportData) { + messageData = reportData; + } - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } - /** - * Get whether the location for this observation is defined. - * - * @return Is this location defined. - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } + /** + * Get whether the location for this observation is defined. + * + * @return Is this location defined. + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } - /** - * Get the observation report type. - * - * @return the reportType - */ - public Integer getReportType() { - return reportType; - } + /** + * Get the observation report type. + * + * @return the reportType + */ + public Integer getReportType() { + return reportType; + } - /** - * Set the observation report type. - * - * @param reportType - * the reportType to set - */ - public void setReportType(Integer reportType) { - this.reportType = reportType; + /** + * Set the observation report type. + * + * @param reportType + * the reportType to set + */ + public void setReportType(Integer reportType) { + this.reportType = reportType; } /** @@ -482,453 +479,459 @@ public class UAObs extends PersistablePluginDataObject implements */ public void setRefHour(Calendar refHour) { this.refHour = refHour; - } + } - /** - * Get the station pressure at the observation site. - * - * @return the pressure_station - */ - public Integer getPressure_station() { - return pressure_station; - } + /** + * Get the station pressure at the observation site. + * + * @return the pressure_station + */ + public Integer getPressure_station() { + return pressure_station; + } - /** - * Set the station pressure at the observation site. - * - * @param pressure_station - * the pressure_station to set - */ - public void setPressure_station(Integer pressure_station) { - this.pressure_station = pressure_station; - } + /** + * Set the station pressure at the observation site. + * + * @param pressure_station + * the pressure_station to set + */ + public void setPressure_station(Integer pressure_station) { + this.pressure_station = pressure_station; + } - /** - * Get the total clould cover (n/8s). - * - * @return the totalCloudCover - */ - public Integer getTotalCloudCover() { - return totalCloudCover; - } + /** + * Get the total clould cover (n/8s). + * + * @return the totalCloudCover + */ + public Integer getTotalCloudCover() { + return totalCloudCover; + } - /** - * Get the direction the platform is moving. (Valid only for mobile - * observations i.e. TEMPSHIP. - * - * @return the platformDirection - */ - public Integer getPlatformDirection() { - return platformDirection; - } + /** + * Get the direction the platform is moving. (Valid only for mobile + * observations i.e. TEMPSHIP. + * + * @return the platformDirection + */ + public Integer getPlatformDirection() { + return platformDirection; + } - /** - * Set the direction the platform is moving. (Valid only for mobile - * observations i.e. TEMPSHIP. - * - * @param platformDirection - * the platformDirection to set - */ - public void setPlatformDirection(Integer platformDirection) { - this.platformDirection = platformDirection; - } + /** + * Set the direction the platform is moving. (Valid only for mobile + * observations i.e. TEMPSHIP. + * + * @param platformDirection + * the platformDirection to set + */ + public void setPlatformDirection(Integer platformDirection) { + this.platformDirection = platformDirection; + } - /** - * Get the movement of the platform in meters per second. - * - * @return The platform movement in meters per second. - */ - public Double getPlatformMovement() { - return platformMovement; - } + /** + * Get the movement of the platform in meters per second. + * + * @return The platform movement in meters per second. + */ + public Double getPlatformMovement() { + return platformMovement; + } - /** - * Set the movement of the platform in meters per second. - * - * @param shipMovement - * The platform movement in meters per second. - */ - public void setPlatformMovement(Double platformMovement) { - this.platformMovement = platformMovement; - } + /** + * Set the movement of the platform in meters per second. + * + * @param shipMovement + * The platform movement in meters per second. + */ + public void setPlatformMovement(Double platformMovement) { + this.platformMovement = platformMovement; + } - /** - * Set the total clould cover (n/8s). - * - * @param totalCloudCover - * the totalCloudCover to set - */ - public void setTotalCloudCover(Integer totalCloudCover) { - this.totalCloudCover = totalCloudCover; - } + /** + * Set the total clould cover (n/8s). + * + * @param totalCloudCover + * the totalCloudCover to set + */ + public void setTotalCloudCover(Integer totalCloudCover) { + this.totalCloudCover = totalCloudCover; + } - /** - * @return the stationName - */ - public String getStationName() { - return stationName; - } + /** + * @return the stationName + */ + public String getStationName() { + return stationName; + } - /** - * @param stationName - * the stationName to set - */ - public void setStationName(String stationName) { - this.stationName = stationName; - } + /** + * @param stationName + * the stationName to set + */ + public void setStationName(String stationName) { + this.stationName = stationName; + } - /** - * Set the data uri for this observation. - * - * @param A - * data uri. - */ - @Override - public void setDataURI(String dataURI) { + /** + * Set the data uri for this observation. + * + * @param A + * data uri. + */ + @Override + public void setDataURI(String dataURI) { super.setDataURI(dataURI); - identifier = dataURI; - } + identifier = dataURI; + } - /** - * Get the IDecoderGettable reference for this record. - * - * @return The IDecoderGettable reference for this record. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return this; - } + /** + * Get the IDecoderGettable reference for this record. + * + * @return The IDecoderGettable reference for this record. + */ + @Override + public IDecoderGettable getDecoderGettable() { + return this; + } - /** + /** * */ - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - /** + /** * */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public String getString(String paramName) { - if ("STA".matches(paramName)) { - return this.getStationId(); - } - return null; - } + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public String getString(String paramName) { + if ("STA".matches(paramName)) { + return this.getStationId(); + } + return null; + } - /** - * Get the value and units of a named parameter within this observation. The - * parameter name may include level information for these observation data. - * The format for parameter is: - * - *
-	 *    "parameterName" may be one of 
-	 *        "GH"  geopotential height
-	 *        "Px"  pressure
-	 *        "T"   temperature
-	 *        "DpT" dewpoint
-	 *        "WS"  wind speed
-	 *        "WD"  wind direction
-	 *    followed by a level specification ":PRESS=xxxx" where xxxx is a level
-	 *    in hPa (millibars). To retrieve the temperature from the 850hPa level
-	 *    use the following getValue("T:PRESS=850");
-	 *    
-	 *    Some data is specific to the observation, latitude/longitude for
-	 *    example. These data may be retrieved using the parameter minus any level
-	 *    information as follows
-	 *    "NLAT"  station latitude
-	 *    "NLON"  station longitude
-	 * 
- * - * If the sounding data defines a surface level, and a request for a level - * below surface is requested, a null value is returned. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return An Amount with value and units. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Amount getValue(String paramName) { - Amount a = null; + /** + * Get the value and units of a named parameter within this observation. The + * parameter name may include level information for these observation data. + * The format for parameter is: + * + *
+     *    "parameterName" may be one of 
+     *        "GH"  geopotential height
+     *        "Px"  pressure
+     *        "T"   temperature
+     *        "DpT" dewpoint
+     *        "WS"  wind speed
+     *        "WD"  wind direction
+     *    followed by a level specification ":PRESS=xxxx" where xxxx is a level
+     *    in hPa (millibars). To retrieve the temperature from the 850hPa level
+     *    use the following getValue("T:PRESS=850");
+     *    
+     *    Some data is specific to the observation, latitude/longitude for
+     *    example. These data may be retrieved using the parameter minus any level
+     *    information as follows
+     *    "NLAT"  station latitude
+     *    "NLON"  station longitude
+     * 
+ * + * If the sounding data defines a surface level, and a request for a level + * below surface is requested, a null value is returned. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return An Amount with value and units. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Amount getValue(String paramName) { + Amount a = null; - if (parseParameter(paramName)) { - String pName = PARM_MAP.get(parameterName); - if ((pName != null) && (levels != null) && (levels.size() > 0)) { + if (parseParameter(paramName)) { + String pName = PARM_MAP.get(parameterName); + if ((pName != null) && (levels != null) && (levels.size() > 0)) { - UAObsLevel obsLevel = getLevel(levelId); - if (obsLevel != null) { - Integer iValue = null; - Double dValue = null; - if (UA_GEOHGT.equals(pName)) { - iValue = obsLevel.getGeoHeight(); - if (iValue != null) { - a = new Amount(iValue, DISTANCE_UNIT); - } - } else if (SFC_TEMP.equals(pName)) { - dValue = obsLevel.getTemp(); - if (dValue != null) { - a = new Amount(dValue, TEMPERATURE_UNIT); - } - } else if (SFC_DWPT.equals(pName)) { - dValue = obsLevel.getDwpt(); - if (dValue != null) { - a = new Amount(dValue, TEMPERATURE_UNIT); - } - } else if (SFC_WNDSPD.equals(pName)) { - dValue = obsLevel.getWindSpeed(); - if (dValue != null) { - a = new Amount(dValue, WIND_SPEED_UNIT); - } - } else if (SFC_WNDDIR.equals(pName)) { - iValue = obsLevel.getWindDirection(); - if (iValue != null) { - a = new Amount(iValue, WIND_DIR_UNIT); - } - } - } - } - } else { - // Assume we are trying to get an observation attribute. - String pName = PARM_MAP.get(paramName); - if (STA_LAT.equals(pName)) { - a = new Amount(this.getLatitude(), LOCATION_UNIT); - } else if (STA_LON.equals(pName)) { - a = new Amount(this.getLongitude(), LOCATION_UNIT); - } - } - return a; - } + UAObsLevel obsLevel = getLevel(levelId); + if (obsLevel != null) { + Integer iValue = null; + Double dValue = null; + if (UA_GEOHGT.equals(pName)) { + iValue = obsLevel.getGeoHeight(); + if (iValue != null) { + a = new Amount(iValue, DISTANCE_UNIT); + } + } else if (SFC_TEMP.equals(pName)) { + dValue = obsLevel.getTemp(); + if (dValue != null) { + a = new Amount(dValue, TEMPERATURE_UNIT); + } + } else if (SFC_DWPT.equals(pName)) { + dValue = obsLevel.getDwpt(); + if (dValue != null) { + a = new Amount(dValue, TEMPERATURE_UNIT); + } + } else if (SFC_WNDSPD.equals(pName)) { + dValue = obsLevel.getWindSpeed(); + if (dValue != null) { + a = new Amount(dValue, WIND_SPEED_UNIT); + } + } else if (SFC_WNDDIR.equals(pName)) { + iValue = obsLevel.getWindDirection(); + if (iValue != null) { + a = new Amount(iValue, WIND_DIR_UNIT); + } + } + } + } + } else { + // Assume we are trying to get an observation attribute. + String pName = PARM_MAP.get(paramName); + if (STA_LAT.equals(pName)) { + a = new Amount(this.getLatitude(), LOCATION_UNIT); + } else if (STA_LON.equals(pName)) { + a = new Amount(this.getLongitude(), LOCATION_UNIT); + } + } + return a; + } - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Collection getValues(String paramName) { - return null; - } + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Collection getValues(String paramName) { + return null; + } - /** - * Determine if the parameter is a level request, and parse out the pressure - * level and parameter name if so. - * - * @param parameter - * The parameter string to parse. - * @return This is a level parameter. - */ - private boolean parseParameter(String parameter) { - boolean goodParse = false; - Pattern p = Pattern.compile(UA_PARAM_PTRN); - Matcher m = p.matcher(parameter); - if (m.find()) { - int start = parameter.indexOf(":PRESS="); - if (start > 0) { - parameterName = parameter.substring(0, start); - start += ":PRESS=".length(); - levelId = Integer.parseInt(parameter.substring(start)); - } - goodParse = true; - } - return goodParse; - } + /** + * Determine if the parameter is a level request, and parse out the pressure + * level and parameter name if so. + * + * @param parameter + * The parameter string to parse. + * @return This is a level parameter. + */ + private boolean parseParameter(String parameter) { + boolean goodParse = false; + Pattern p = Pattern.compile(UA_PARAM_PTRN); + Matcher m = p.matcher(parameter); + if (m.find()) { + int start = parameter.indexOf(":PRESS="); + if (start > 0) { + parameterName = parameter.substring(0, start); + start += ":PRESS=".length(); + levelId = Integer.parseInt(parameter.substring(start)); + } + goodParse = true; + } + return goodParse; + } - /** - * Get a specified pressure level data if it exists. If the specified level - * is below the declared surface pressure a null reference is returned. - * - * @param level - * A pressure level to get. - * @return The requested level, if found, null reference if not. - */ - private UAObsLevel getLevel(Integer level) { - UAObsLevel retValue = null; - if (level != null) { - level = level * 100; - for (UAObsLevel l : levels) { - if (IDecoderConstants.MANPRE_LEVEL.equals(l.getVertSig()) - || IDecoderConstants.SIGPRE_LEVEL - .equals(l.getVertSig())) { + /** + * Get a specified pressure level data if it exists. If the specified level + * is below the declared surface pressure a null reference is returned. + * + * @param level + * A pressure level to get. + * @return The requested level, if found, null reference if not. + */ + private UAObsLevel getLevel(Integer level) { + UAObsLevel retValue = null; + if (level != null) { + level = level * 100; + for (UAObsLevel l : levels) { + if (IDecoderConstants.MANPRE_LEVEL.equals(l.getVertSig()) + || IDecoderConstants.SIGPRE_LEVEL + .equals(l.getVertSig())) { - if (level.equals(l.getPressure())) { - retValue = l; - break; - } - } - } - } - if (retValue != null) { - UAObsLevel sfc = getSurfaceLevel(); - if (sfc != null) { - if (LayerTools.isLowerThan(sfc, retValue)) { - retValue = null; - } - } - } - return retValue; - } + if (level.equals(l.getPressure())) { + retValue = l; + break; + } + } + } + } + if (retValue != null) { + UAObsLevel sfc = getSurfaceLevel(); + if (sfc != null) { + if (LayerTools.isLowerThan(sfc, retValue)) { + retValue = null; + } + } + } + return retValue; + } - /** - * Get the defined surface level. If a surface level cannot be found, then - * return null. - * - * @return The surface level found, or null. - */ - private UAObsLevel getSurfaceLevel() { - UAObsLevel retValue = null; - if (levels != null) { - for (UAObsLevel level : levels) { - if (IDecoderConstants.SFC_LEVEL.equals(level.getVertSig())) { - retValue = level; - break; - } - } - } - return retValue; - } + /** + * Get the defined surface level. If a surface level cannot be found, then + * return null. + * + * @return The surface level found, or null. + */ + private UAObsLevel getSurfaceLevel() { + UAObsLevel retValue = null; + if (levels != null) { + for (UAObsLevel level : levels) { + if (IDecoderConstants.SFC_LEVEL.equals(level.getVertSig())) { + retValue = level; + break; + } + } + } + return retValue; + } - @Override - public String[] getStrings(String paramName) { - // TODO Auto-generated method stub - return null; - } + @Override + public String[] getStrings(String paramName) { + // TODO Auto-generated method stub + return null; + } - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } - public SurfaceObsLocation getLocation() { - if (location == null) { - location = new SurfaceObsLocation(); - } - return location; - } + public SurfaceObsLocation getLocation() { + if (location == null) { + location = new SurfaceObsLocation(); + } + return location; + } - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } - /** - * Returns the hashCode for this object. This implementation returns the - * hashCode of the generated dataURI. - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result - + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); - return result; - } + /** + * Returns the hashCode for this object. This implementation returns the + * hashCode of the generated dataURI. + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = (prime * result) + + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); + return result; + } - /** - * Checks if this record is equal to another by checking the generated - * dataURI. - * - * @param obj - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - UAObs other = (UAObs) obj; - if (getDataURI() == null) { - if (other.getDataURI() != null) { - return false; - } - } else if (!getDataURI().equals(other.getDataURI())) { - return false; - } - return true; - } + /** + * Checks if this record is equal to another by checking the generated + * dataURI. + * + * @param obj + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + UAObs other = (UAObs) obj; + if (getDataURI() == null) { + if (other.getDataURI() != null) { + return false; + } + } else if (!getDataURI().equals(other.getDataURI())) { + return false; + } + return true; + } - /** - * Returns a - * - * @param obsList - * @return - */ - public static final List sortByCorrection(List obsList) { + /** + * Returns a + * + * @param obsList + * @return + */ + public static final List sortByCorrection(List obsList) { - // No need to sort for null, empty, or one item. - if ((obsList != null) && (obsList.size() > 1)) { - Collections.sort(obsList, getCorComparator()); - } - return obsList; - } + // No need to sort for null, empty, or one item. + if ((obsList != null) && (obsList.size() > 1)) { + Collections.sort(obsList, getCorComparator()); + } + return obsList; + } - public static Comparator getCorComparator() { - return corComparator; - } + public static Comparator getCorComparator() { + return corComparator; + } - @Override - public String toString() { - return wmoHeader; - } + @Override + public String toString() { + return wmoHeader; + } - public static final void main(String[] args) { + public static final void main(String[] args) { - List obsList = new ArrayList(); - UAObs obsA = new UAObs(); - obsA.setWmoHeader("IUSZ42 KWBC 271845 CCA"); - obsList.add(obsA); - UAObs obsB = new UAObs(); - obsB.setWmoHeader("IUSZ42 KWBC 271835 CCA"); - obsList.add(obsB); - UAObs obs = new UAObs(); - obs.setWmoHeader("IUSZ42 KWBC 271815"); - obsList.add(obs); - obs = new UAObs(); - obs.setWmoHeader("IUSZ42 KWBC 271825 CCA"); - obsList.add(obs); + List obsList = new ArrayList(); + UAObs obsA = new UAObs(); + obsA.setWmoHeader("IUSZ42 KWBC 271845 CCA"); + obsList.add(obsA); + UAObs obsB = new UAObs(); + obsB.setWmoHeader("IUSZ42 KWBC 271835 CCA"); + obsList.add(obsB); + UAObs obs = new UAObs(); + obs.setWmoHeader("IUSZ42 KWBC 271815"); + obsList.add(obs); + obs = new UAObs(); + obs.setWmoHeader("IUSZ42 KWBC 271825 CCA"); + obsList.add(obs); - System.out.println(obsList); - obsList = sortByCorrection(obsList); - System.out.println(obsList); + System.out.println(obsList); + obsList = sortByCorrection(obsList); + System.out.println(obsList); - int c = UAObs.getCorComparator().compare(obsA, obsB); - System.out.println(c); + int c = UAObs.getCorComparator().compare(obsA, obsB); + System.out.println(c); - UAObs test = new UAObs( - "/bufrua/2011-10-07_00:00:00.0/2022/null/IUSZ52_KWBC_070040/72634/44.90833/-84.71944"); + UAObs test = new UAObs( + "/bufrua/2011-10-07_00:00:00.0/2022/null/IUSZ52_KWBC_070040/72634/44.90833/-84.71944"); - System.out.println(test.dataURI); + System.out.println(test.dataURI); + + } - } @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "bufrua"; + } } \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.cwa/src/com/raytheon/uf/common/dataplugin/cwa/CWARecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.cwa/src/com/raytheon/uf/common/dataplugin/cwa/CWARecord.java index 58f715f75b..4a372e7c0e 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.cwa/src/com/raytheon/uf/common/dataplugin/cwa/CWARecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.cwa/src/com/raytheon/uf/common/dataplugin/cwa/CWARecord.java @@ -56,11 +56,13 @@ import com.vividsolutions.jts.geom.Coordinate; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Feb 1, 2010 jsanchez Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Feb 01, 2010 jsanchez Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -74,132 +76,134 @@ import com.vividsolutions.jts.geom.Coordinate; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "cwa", - indexes = { - @Index(name = "cwa_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "cwa", indexes = { @Index(name = "cwa_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class CWARecord extends PersistablePluginDataObject implements - IPointData, IPersistable { + IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - // Text of the WMO header - @Transient - @XmlElement - @DynamicSerializeElement - private String wmoHeader = ""; + // Text of the WMO header + @Transient + @XmlElement + @DynamicSerializeElement + private String wmoHeader = ""; - @Transient - @XmlElement - @DynamicSerializeElement - private CWADimension dimension; + @Transient + @XmlElement + @DynamicSerializeElement + private CWADimension dimension; - @DataURI(position = 1, embedded = true) - @XmlElement - @DynamicSerializeElement - private String eventId; + @DataURI(position = 1, embedded = true) + @XmlElement + @DynamicSerializeElement + private String eventId; - @Transient - @XmlElement - @DynamicSerializeElement - private Coordinate[] coordinates; + @Transient + @XmlElement + @DynamicSerializeElement + private Coordinate[] coordinates; - @Transient - @XmlElement - @DynamicSerializeElement - private String text; + @Transient + @XmlElement + @DynamicSerializeElement + private String text; - public CWADimension getDimension() { - return dimension; - } + public CWADimension getDimension() { + return dimension; + } - public void setDimension(CWADimension dimension) { - this.dimension = dimension; - } + public void setDimension(CWADimension dimension) { + this.dimension = dimension; + } - public String getWmoHeader() { - return wmoHeader; - } + public String getWmoHeader() { + return wmoHeader; + } - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - public Coordinate[] getCoordinates() { - return coordinates; - } + public Coordinate[] getCoordinates() { + return coordinates; + } - public void setCoordinates(Coordinate[] coordinates) { - this.coordinates = coordinates; - } + public void setCoordinates(Coordinate[] coordinates) { + this.coordinates = coordinates; + } - public String getEventId() { - return eventId; - } + public String getEventId() { + return eventId; + } - public void setEventId(String eventId) { - this.eventId = eventId; - } + public void setEventId(String eventId) { + this.eventId = eventId; + } - /** - * Set the data uri for this observation. - * - * @param dataURI - */ - @Override - public void setDataURI(String dataURI) { - super.setDataURI(dataURI); - identifier = dataURI; - } + /** + * Set the data uri for this observation. + * + * @param dataURI + */ + @Override + public void setDataURI(String dataURI) { + super.setDataURI(dataURI); + identifier = dataURI; + } - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } - public String getText() { - return text; - } + public String getText() { + return text; + } - public void setText(String text) { - this.text = text; - } + public void setText(String text) { + this.text = text; + } - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + Calendar c = getDataTime().getRefTimeAsCalendar(); + if (c != null) { + sb.append(String.format("CWA:%1$tY%1$tm%1$td%1$tH%1$tM", + getDataTime().getRefTimeAsCalendar())); + } else { + sb.append("CWA:YYYYMMDDHHmm"); + } + return sb.toString(); + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - Calendar c = getDataTime().getRefTimeAsCalendar(); - if (c != null) { - sb.append(String.format("CWA:%1$tY%1$tm%1$td%1$tH%1$tM", - getDataTime().getRefTimeAsCalendar())); - } else { - sb.append("CWA:YYYYMMDDHHmm"); - } - return sb.toString(); - } @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "cwa"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.cwat/src/com/raytheon/uf/common/dataplugin/cwat/CWATRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.cwat/src/com/raytheon/uf/common/dataplugin/cwat/CWATRecord.java index 8de22de896..ff8fa266ce 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.cwat/src/com/raytheon/uf/common/dataplugin/cwat/CWATRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.cwat/src/com/raytheon/uf/common/dataplugin/cwat/CWATRecord.java @@ -73,12 +73,14 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 06/03/09 2037 D. Hladky Initial release - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 04/08/13 1293 bkowal Removed references to hdffileid. - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Jun 03, 2009 2037 D. Hladky Initial release + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -452,9 +454,9 @@ public class CWATRecord extends PersistablePluginDataObject try { IDataRecord[] dataRec = dataStore.retrieve(getDataURI()); - for (int i = 0; i < dataRec.length; i++) { - if (dataRec[i] instanceof ShortDataRecord) { - setDataArray(((ShortDataRecord) dataRec[i]).getShortData()); + for (IDataRecord element : dataRec) { + if (element instanceof ShortDataRecord) { + setDataArray(((ShortDataRecord) element).getShortData()); } } retrieveMapFromDataStore(dataStore); @@ -574,4 +576,9 @@ public class CWATRecord extends PersistablePluginDataObject public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "cwat"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPRecord.java index 139a2b9826..f00d3f8b0d 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.ffmp/src/com/raytheon/uf/common/dataplugin/ffmp/FFMPRecord.java @@ -77,18 +77,22 @@ import com.raytheon.uf.common.time.util.ImmutableDate; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 06/03/09 2521 D. Hladky Initial release - * 01/27/13 1478 D. Hladky OUN memory help - * Feb 28, 2013 1729 dhladky Supressed un-necessary debug loggers - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 8, 2013 1293 bkowal Removed references to hdffileid. - * April, 9 2013 1890 dhladky Moved dates to referenced map in record rather than multiple dates in FFMPBasin objs. + * Jun 03, 2009 2521 D. Hladky Initial release + * Jan 27, 2013 1478 D. Hladky OUN memory help + * Feb 28, 2013 1729 dhladky Supressed un-necessary debug loggers + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. + * April, 9 2013 1890 dhladky Moved dates to referenced map in record + * rather than multiple dates in + * FFMPBasin objs. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * Apr 16, 2013 1912 bsteffen Initial bulk hdf5 access for ffmp - * Apr 18, 2013 1919 dhladky Added method for VGB loading + * Apr 18, 2013 1919 dhladky Added method for VGB loading * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -102,18 +106,13 @@ import com.raytheon.uf.common.time.util.ImmutableDate; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ffmp", - indexes = { - @Index(name = "ffmp_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) - +@org.hibernate.annotations.Table(appliesTo = "ffmp", indexes = { @Index(name = "ffmp_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class FFMPRecord extends PersistablePluginDataObject - implements IPersistable { +public class FFMPRecord extends PersistablePluginDataObject implements + IPersistable { private static final long serialVersionUID = 76774564365671L; @@ -273,8 +272,8 @@ public class FFMPRecord extends PersistablePluginDataObject String unit = null; if (field == FIELDS.RATE) { unit = "in/hr"; - } else if (field == FIELDS.QPE || field == FIELDS.QPF - || field == FIELDS.GUIDANCE || field == FIELDS.DIFF) { + } else if ((field == FIELDS.QPE) || (field == FIELDS.QPF) + || (field == FIELDS.GUIDANCE) || (field == FIELDS.DIFF)) { unit = "in"; } else if (field == FIELDS.RATIO) { unit = "%"; @@ -394,7 +393,7 @@ public class FFMPRecord extends PersistablePluginDataObject LinkedHashMap map = template.getMap(getSiteKey(), domain.getCwa(), FFMPRecord.ALL); - if (map != null && !map.isEmpty()) { + if ((map != null) && !map.isEmpty()) { fbd.addBasins(datastoreFile, uri, getSiteKey(), domain.getCwa(), FFMPRecord.ALL, sourceName, idate, map.keySet(), aggregate); @@ -446,7 +445,7 @@ public class FFMPRecord extends PersistablePluginDataObject LinkedHashMap map = template.getMap(getSiteKey(), domain.getCwa(), huc); - if (map != null && map.get(pfaf) != null) { + if ((map != null) && (map.get(pfaf) != null)) { int index = 0; for (Long pfafToCheck : map.keySet()) { @@ -696,4 +695,9 @@ public class FFMPRecord extends PersistablePluginDataObject public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "ffmp"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.fog/src/com/raytheon/uf/common/dataplugin/fog/FogRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.fog/src/com/raytheon/uf/common/dataplugin/fog/FogRecord.java index 137c5a7b06..a2314248a7 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.fog/src/com/raytheon/uf/common/dataplugin/fog/FogRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.fog/src/com/raytheon/uf/common/dataplugin/fog/FogRecord.java @@ -62,12 +62,14 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 12/12/09 D. Hladky Initial release - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 04/08/13 1293 bkowal Removed references to hdffileid. + * Dec 12, 2009 D. Hladky Initial release + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -81,17 +83,13 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "fog", - indexes = { - @Index(name = "fog_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "fog", indexes = { @Index(name = "fog_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class FogRecord extends PersistablePluginDataObject - implements IPersistable { +public class FogRecord extends PersistablePluginDataObject implements + IPersistable { private static final long serialVersionUID = 76774564365671L; @@ -429,14 +427,14 @@ public class FogRecord extends PersistablePluginDataObject } public GridGeometry2D getGridGeometry2D() { - return gridGeometry2D; - } + return gridGeometry2D; + } - public void setGridGeometry2D(GridGeometry2D gridGeometry2D) { - this.gridGeometry2D = gridGeometry2D; - } + public void setGridGeometry2D(GridGeometry2D gridGeometry2D) { + this.gridGeometry2D = gridGeometry2D; + } - /** + /** * Set the VIS pixel array * * @param data_array @@ -652,28 +650,31 @@ public class FogRecord extends PersistablePluginDataObject // then means both vis_range and ir_range store range of vis if (getRangeType(j) == IMAGE_GROUP.TWILIGHT_GROUP) { - if (i <= getVisRange(j).getEnd() && i >= getVisRange(j).getStart()) { + if ((i <= getVisRange(j).getEnd()) + && (i >= getVisRange(j).getStart())) { return IMAGE_GROUP.VIS_GROUP; } - else if (i <= getIRRange(j).getEnd() - && i >= getIRRange(j).getStart()) { + else if ((i <= getIRRange(j).getEnd()) + && (i >= getIRRange(j).getStart())) { return IMAGE_GROUP.IR_GROUP; } else { return IMAGE_GROUP.TWILIGHT_GROUP; } } else if (getRangeType(j) == IMAGE_GROUP.VIS_GROUP) { - if ((i <= getVisRange(j).getEnd() && i >= getVisRange(j).getStart()) - || (i <= getIRRange(j).getEnd() && i >= getIRRange(j) - .getStart())) { + if (((i <= getVisRange(j).getEnd()) && (i >= getVisRange(j) + .getStart())) + || ((i <= getIRRange(j).getEnd()) && (i >= getIRRange(j) + .getStart()))) { return IMAGE_GROUP.VIS_GROUP; } else { return IMAGE_GROUP.TWILIGHT_GROUP; } } else { - if ((i <= getVisRange(j).getEnd() && i >= getVisRange(j).getStart()) - || (i <= getIRRange(j).getEnd() && i >= getIRRange(j) - .getStart())) { + if (((i <= getVisRange(j).getEnd()) && (i >= getVisRange(j) + .getStart())) + || ((i <= getIRRange(j).getEnd()) && (i >= getIRRange(j) + .getStart()))) { return IMAGE_GROUP.IR_GROUP; } else { return IMAGE_GROUP.TWILIGHT_GROUP; @@ -704,10 +705,16 @@ public class FogRecord extends PersistablePluginDataObject public Calendar getRefHour() { return refHour; } + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "fog"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.fssobs/src/com/raytheon/uf/common/dataplugin/fssobs/FSSObsRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.fssobs/src/com/raytheon/uf/common/dataplugin/fssobs/FSSObsRecord.java index 3d9e1d9dd1..8389e5d301 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.fssobs/src/com/raytheon/uf/common/dataplugin/fssobs/FSSObsRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.fssobs/src/com/raytheon/uf/common/dataplugin/fssobs/FSSObsRecord.java @@ -26,6 +26,7 @@ import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; + import org.hibernate.annotations.Index; import com.raytheon.uf.common.dataplugin.IDecoderGettable; @@ -48,1219 +49,1187 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "fssobs", - indexes = { - @Index(name = "fssobs_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "fssobs", indexes = { @Index(name = "fssobs_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class FSSObsRecord extends PersistablePluginDataObject implements - ISpatialEnabled, IDecoderGettable, IPersistable, IPointData { + ISpatialEnabled, IDecoderGettable, IPersistable, IPointData { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - public static final String PLUGIN_NAME = "fssobs"; + public static final String PLUGIN_NAME = "fssobs"; - private static final int MISSING = -9999; + private static final int MISSING = -9999; - // UNITS + // UNITS - public static final Unit TEMPERATURE_UNIT = SI.CELSIUS; + public static final Unit TEMPERATURE_UNIT = SI.CELSIUS; - public static final Unit WIND_SPEED_UNIT = NonSI.KNOT; + public static final Unit WIND_SPEED_UNIT = NonSI.KNOT; - public static final Unit HEIGHT_UNIT = SI.METER; + public static final Unit HEIGHT_UNIT = SI.METER; - public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; - public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; - public static final Unit PRESSURE_UNIT = SI.HECTO(SI.PASCAL); + public static final Unit PRESSURE_UNIT = SI.HECTO(SI.PASCAL); - public static final Unit PRECIP_UNIT = NonSI.INCH; + public static final Unit PRECIP_UNIT = NonSI.INCH; - public static final Unit WAVE_UNIT = SI.METER; + public static final Unit WAVE_UNIT = SI.METER; - public static final Unit VISIBILITY_UNIT = NonSI.MILE; + public static final Unit VISIBILITY_UNIT = NonSI.MILE; - public static final Unit CLOUD_COVER = NonSI.OCTET; + public static final Unit CLOUD_COVER = NonSI.OCTET; - /** Metar specific parameter keys */ - public static final class ParameterKey { - public static final String SFC_ALTIMETER = "SFC.PRESS.ALTIMETER"; + /** Metar specific parameter keys */ + public static final class ParameterKey { + public static final String SFC_ALTIMETER = "SFC.PRESS.ALTIMETER"; - public static final String PRESSURE_CHANGE = "PCHNG"; + public static final String PRESSURE_CHANGE = "PCHNG"; - public static final String VISIBILITY = "VIS"; + public static final String VISIBILITY = "VIS"; - public static final String PRECIPITATION_1HR = "PR1HR"; - } + public static final String PRECIPITATION_1HR = "PR1HR"; + } - private static final HashMap PARM_MAP = new HashMap(); - static { - PARM_MAP.put("NLAT", STA_LAT); - PARM_MAP.put("NLON", STA_LON); - PARM_MAP.put("rawMessage", "rawMessage"); - } - - /** is feature new **/ - @Transient - @DynamicSerializeElement - @XmlElement - public boolean isNew = true; - - // Current CWA (WFO) - @Column - @DataURI(position = 2) - @DynamicSerializeElement - @XmlElement(nillable = false) - private String cwa; - - // Monitor which should use this station record - // fog = "fog" - // safeseas = "ss" - // snow = "snow" - @Column - @DataURI(position = 4) - @DynamicSerializeElement - @XmlElement - private String monitorUse = ""; - - // Station name - @Column - @DynamicSerializeElement - @XmlElement - private String stnName; - - /* From ============ObReport================= */ - - @XmlElement - @DynamicSerializeElement - @Column - @DataURI(position = 1) - protected String reportType; - - @Embedded - @DataURI(position = 3, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; - - // Observing platform identifier (same as stationID) - @Transient - @XmlElement - @DynamicSerializeElement - private String platformId; - - // Indicator of whether observing platform is stationary - @Transient - @DynamicSerializeElement - @XmlElement - private boolean isStationary; - - // Actual time of the observation - @Transient - @DynamicSerializeElement - @XmlElement - private Calendar timeObs; - - // Time of the observation to the nearest hour. - @XmlElement - @DynamicSerializeElement - @Column - private Calendar refHour; - - // Raw message - @Transient - @DynamicSerializeElement - @XmlElement - private String rawMessage; - - // Observed wind speed in knots - @Transient - @DynamicSerializeElement - @XmlElement - private float windSpeed = -9999;; - - // Wind gust in knots - @Transient - @DynamicSerializeElement - @XmlElement - private float windGust = -9999;; - - // Observed maximum wind speed in knots - @Transient - @DynamicSerializeElement - @XmlElement - private float maxWindSpeed = -9999; - - // Observed wind direction in azimuth degrees - @Transient - @DynamicSerializeElement - @XmlElement - private float windDir; - - // Observed wind chill in Fahrenheit - @Transient - @DynamicSerializeElement - @XmlElement - private float windChill = -9999; - - // Observed high resolution wave height in - @Transient - @DynamicSerializeElement - @XmlElement - private float highResWaveHeight = -9999; - - // Observed wave steepness in seconds ??? None - @Transient - @DynamicSerializeElement - @XmlElement - private float waveSteepness = -9999; - - // Observed visibility in Statute miles - @Transient - @DynamicSerializeElement - @XmlElement - private float visibility = -9999; - - // Observed visibility in meters for Maritime obs. - @Transient - @DynamicSerializeElement - @XmlElement - private float horzVisibility = -9999; - - // Observed temperature in degrees in Farenheit - @Transient - @DynamicSerializeElement - @XmlElement - private float temperature = -9999; - - // in feet - @Transient - @XmlElement - @DynamicSerializeElement - private Double waveHeight = -9999.0; - - // in seconds - @Transient - @XmlElement - @DynamicSerializeElement - private Integer wavePeriod = -9999; - - // in Azimuth degrees - @Transient - @XmlElement - @DynamicSerializeElement - private Double primarySwellWaveDir = -9999.0; - - // in seconds - @Transient - @XmlElement - @DynamicSerializeElement - private Integer primarySwellWavePeriod = -9999; - - // in feet - @Transient - @XmlElement - @DynamicSerializeElement - private Double primarySwellWaveHeight = -9999.0; - - // in Azimuth degrees - @Transient - @XmlElement - @DynamicSerializeElement - private Double secondarySwellWaveDir = -9999.0; - - // in seconds - @Transient - @XmlElement - @DynamicSerializeElement - private Integer secondarySwellWavePeriod = -9999; - - // in feet - @Transient - @XmlElement - @DynamicSerializeElement - private Double secondarySwellWaveHeight = -9999.0; - - // // Pressure in inches of mercury - // @Transient - // @DynamicSerializeElement - // @XmlElement - // private float pressure = -9999; - - // Three-hour pressure change in thousandths of an inch of mercury ???? - @Transient - @DynamicSerializeElement - @XmlElement - private float pressChange3Hour = -9999f; - - // Pressure change character for metar plot model - /** A string denoting the pressure tendency(rising or falling) */ - @Transient - @DynamicSerializeElement - @XmlElement - private String pressChangeChar; - - // Observed dewpoint in degrees Farenheit - @Transient - @DynamicSerializeElement - @XmlElement - private float dewpoint = -9999f; - - // Observed sea surface temperature in degrees in Farenheit - @Transient - @DynamicSerializeElement - @XmlElement - private float seaSurfaceTemp = -9999f; - - // the sea level pressure in hPa - @XmlElement - @DynamicSerializeElement - @Transient - private float seaLevelPress = -9999f; - - // Altimeter setting in mm Hg. - @Transient - @XmlElement - @DynamicSerializeElement - private float pressureAltimeter = -9999f; - - // Observed hourly precipitation in inches - @Transient - @DynamicSerializeElement - @XmlElement - private float hourlyPrecip = -9999f; - - // Observed snow depth in inch - @Transient - @DynamicSerializeElement - @XmlElement - private float snowDepth = -9999f; - - // Observed snow increasing rapidly, hourly total in inches - @Transient - @DynamicSerializeElement - @XmlElement - private float snincrHourly = -9999f; - - // Observed snow increasing rapidly, total in inches - @Transient - @DynamicSerializeElement - @XmlElement - private float snincrTotal = -9999f; - - // Observed frostbite time in minutes - @Transient - @DynamicSerializeElement - @XmlElement - private float frostbiteTime; - - // present weather conditions for metar plot model - @Transient - @DynamicSerializeElement - @XmlElement - private String[] presWeather; - - // Observed relative humidity in percent - @Transient - @DynamicSerializeElement - @XmlElement - private float relativeHumidity = -9999f; - - // Observed ceiling in feet above ground level - @Transient - @DynamicSerializeElement - @XmlElement - private float ceiling = -9999f; - - // Observed dewpoint depression in Farenheit - @Transient - @DynamicSerializeElement - @XmlElement - private float dewpointDepr = -9999f; - - @XmlElement - @DynamicSerializeElement - @Transient - private String[] skyCover; - - @XmlElement - @DynamicSerializeElement - @Transient - private int totCloudAmount = -9999; - - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - // ---------------------------------------------------------------------------------------------------- - public FSSObsRecord() { - } - - public FSSObsRecord(String uri) { - super(uri); - } - - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - - @Override - public Amount getValue(String paramName) { - Amount a = null; - - String pName = PARM_MAP.get(paramName); - - if (SFC_TEMP.equals(pName) && (temperature != -9999f)) { - a = new Amount(temperature, TEMPERATURE_UNIT); - } else if (SFC_DWPT.equals(pName) && (dewpoint != -9999f)) { - a = new Amount(dewpoint, TEMPERATURE_UNIT); - } else if (SFC_WNDSPD.equals(pName) && (windSpeed != -9999f)) { - a = new Amount(windSpeed, WIND_SPEED_UNIT); - } else if (SFC_WNDDIR.equals(pName) && (windDir != -9999f)) { - a = new Amount(windDir, WIND_DIR_UNIT); - } else if (SFC_WNDGST.equals(pName) && (windGust != -9999f)) { - a = new Amount(windGust, WIND_SPEED_UNIT); - } else if (PRES_SLP.equals(pName) && (seaLevelPress != -9999f)) { - a = new Amount(seaLevelPress, PRESSURE_UNIT); - // } else if (PRES_ALTSG.equals(pName) && (pressureAltimeter != - // -9999f)) { - // a = new Amount(pressureAltimeter, PRESSURE_UNIT); - } else if (STA_LAT.equals(pName)) { - a = new Amount(this.getLatitude(), LOCATION_UNIT); - } else if (STA_LON.equals(pName)) { - a = new Amount(this.getLongitude(), LOCATION_UNIT); - } else if ("WT".equals(pName) && this.seaSurfaceTemp != -9999f) { - a = new Amount(this.seaSurfaceTemp, TEMPERATURE_UNIT); - } else if ("WH".equals(pName)) { - a = new Amount(waveHeight, WAVE_UNIT); - } else if ("SWP".equals(pName)) { - a = new Amount(primarySwellWavePeriod, WAVE_UNIT); - } else if ("SWH".equals(pName)) { - a = new Amount(primarySwellWaveHeight, WAVE_UNIT); - // } else if ("PCHNG".equals(pName) && pressChange3Hour != MISSING) - // { - // a = new Amount(pressChange3Hour, PRESSURE_UNIT); - } else if ("PKWND".equals(paramName) && maxWindSpeed != MISSING) { - a = new Amount(maxWindSpeed, WIND_SPEED_UNIT); - } else if ("SWS".equals(paramName) || "SWGS".equals(paramName)) { - a = new Amount(1, WIND_SPEED_UNIT); - } else if ("SWD".equals(paramName) && primarySwellWaveDir != MISSING) { - a = new Amount(primarySwellWaveDir, WIND_DIR_UNIT); - } - - return a; - } - - /** - * @return the isNew - */ - public boolean getIsNew() { - return isNew; - } - - /** - * @return the cwa - */ - public String getCwa() { - return cwa; - } - - /** - * @param monitorUse - * the monitorUse to set - */ - public void setMonitorUse(String monitorUse) { - this.monitorUse = monitorUse; - } - - /** - * @return the monitorUse - */ - public String getMonitorUse() { - return monitorUse; - } - - /** - * @return the stnName - */ - public String getStnName() { - return stnName; - } - - /** - * @return the reportType - */ - public String getReportType() { - return reportType; - } - - /** - * @return the location - */ - public SurfaceObsLocation getLocation() { - return location; - } - - /** - * @param platformId - * the platformId to set - */ - public void setPlatformId(String platformId) { - this.platformId = platformId; - } - - /** - * @return the platformId - */ - public String getPlatformId() { - return platformId; - } - - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } - - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } - - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } - - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } - - /** - * @return the isStationary - */ - public boolean isStationary() { - return isStationary; - } - - /** - * @return the refHour - */ - public Calendar getRefHour() { - return refHour; - } - - /** - * @return the rawMessage - */ - public String getRawMessage() { - return rawMessage; - } - - /** - * @return the windSpeed - */ - public float getWindSpeed() { - return windSpeed; - } - - /** - * @return the windGust - */ - public float getWindGust() { - return windGust; - } - - /** - * @return the maxWindSpeed - */ - public float getMaxWindSpeed() { - return maxWindSpeed; - } - - /** - * @return the windDir - */ - public float getWindDir() { - return windDir; - } - - /** - * @return the windChill - */ - public float getWindChill() { - return windChill; - } - - // /** - // * @return the highResWaveHeight - // */ - // public float getHighResWaveHeight() { - // return highResWaveHeight; - // } - - /** - * @return the waveSteepness - */ - public float getWaveSteepness() { - return waveSteepness; - } - - /** - * @return the visibility - */ - public float getVisibility() { - return visibility; - } - - /** - * @return the temperature - */ - public float getTemperature() { - return temperature; - } - - /** - * @return the waveHeight - */ - public Double getWaveHeight() { - return waveHeight; - } - - /** - * @return the wavePeriod - */ - public Integer getWavePeriod() { - return wavePeriod; - } - - /** - * @return the primarySwellWaveDir - */ - public Double getPrimarySwellWaveDir() { - return primarySwellWaveDir; - } - - /** - * @return the primarySwellWavePeriod - */ - public Integer getPrimarySwellWavePeriod() { - return primarySwellWavePeriod; - } - - /** - * @return the primarySwellWaveHeight - */ - public Double getPrimarySwellWaveHeight() { - return primarySwellWaveHeight; - } - - /** - * @return the secondarySwellWaveDir - */ - public Double getSecondarySwellWaveDir() { - return secondarySwellWaveDir; - } - - /** - * @return the secondarySwellWavePeriod - */ - public Integer getSecondarySwellWavePeriod() { - return secondarySwellWavePeriod; - } - - /** - * @return the secondarySwellWaveHeight - */ - public Double getSecondarySwellWaveHeight() { - return secondarySwellWaveHeight; - } - - // /** - // * @return the pressure - // */ - // public float getPressure() { - // return pressure; - // } - // - // - // /** - // * @return the pressChangeChar - // */ - // public String getPressChangeChar() { - // return pressChangeChar; - // } - - /** - * @return the dewpoint - */ - public float getDewpoint() { - return dewpoint; - } - - /** - * @return the seaSurfaceTemp - */ - public float getSeaSurfaceTemp() { - return seaSurfaceTemp; - } - - /** - * @return the seaLevelPress - */ - public float getSeaLevelPress() { - return seaLevelPress; - } - - /** - * @param pressureAltimeter - * the pressureAltimeter to set - */ - public void setPressureAltimeter(float pressureAltimeter) { - this.pressureAltimeter = pressureAltimeter; - } - - /** - * @return the pressureAltimeter - */ - public float getPressureAltimeter() { - return pressureAltimeter; - } - - /** - * @param pressChange3Hour - * the pressChange3Hour to set - */ - public void setPressChange3Hour(float pressChange3Hour) { - this.pressChange3Hour = pressChange3Hour; - } - - /** - * @return the pressChange3Hour - */ - public float getPressChange3Hour() { - return pressChange3Hour; - } - - /** - * @return the snowDepth - */ - public float getSnowDepth() { - return snowDepth; - } - - /** - * @return the snincrHourly - */ - public float getSnincrHourly() { - return snincrHourly; - } - - /** - * @return the snincrTotal - */ - public float getSnincrTotal() { - return snincrTotal; - } - - /** - * @return the frostbiteTime - */ - public float getFrostbiteTime() { - return frostbiteTime; - } - - /** - * @return the relativeHumidity - */ - public float getRelativeHumidity() { - return relativeHumidity; - } - - /** - * @param ceiling - * the ceiling to set - */ - public void setCeiling(float ceiling) { - this.ceiling = ceiling; - } - - /** - * @return the ceiling - */ - public float getCeiling() { - return ceiling; - } - - /** - * @return the dewpointDepr - */ - public float getDewpointDepr() { - return dewpointDepr; - } - - /** - * @param isNew - * the isNew to set - */ - public void setIsNew(boolean isNew) { - this.isNew = isNew; - } - - /** - * @param cwa - * the cwa to set - */ - public void setCwa(String cwa) { - this.cwa = cwa; - } - - /** - * @param stnName - * the stnName to set - */ - public void setStnName(String stnName) { - this.stnName = stnName; - } - - /** - * @param reportType - * the reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } - - /** - * @param location - * the location to set - */ - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } - - /** - * @param isStationary - * the isStationary to set - */ - public void setIsStationary(boolean isStationary) { - this.isStationary = isStationary; - } - - public boolean getIsStationary() { - return isStationary; - } - - /** - * @param timeObs - * the timeObs to set - */ - public void setTimeObs(Calendar timeObs) { - this.timeObs = timeObs; - } - - /** - * @return the timeObs - */ - public Calendar getTimeObs() { - return timeObs; - } - - /** - * @param refHour - * the refHour to set - */ - public void setRefHour(Calendar refHour) { - this.refHour = refHour; - } - - /** - * @param rawMessage - * the rawMessage to set - */ - public void setRawMessage(String rawMessage) { - this.rawMessage = rawMessage; - } - - /** - * @param windSpeed - * the windSpeed to set - */ - public void setWindSpeed(float windSpeed) { - this.windSpeed = windSpeed; - } - - /** - * @param windGust - * the windGust to set - */ - public void setWindGust(float windGust) { - this.windGust = windGust; - } - - /** - * @param maxWindSpeed - * the maxWindSpeed to set - */ - public void setMaxWindSpeed(float maxWindSpeed) { - this.maxWindSpeed = maxWindSpeed; - } - - /** - * @param windDir - * the windDir to set - */ - public void setWindDir(float windDir) { - this.windDir = windDir; - } - - /** - * @param windChill - * the windChill to set - */ - public void setWindChill(float windChill) { - this.windChill = windChill; - } - - public void setHighResWaveHeight(float highResWaveHeight) { - this.highResWaveHeight = highResWaveHeight; - } - - public float getHighResWaveHeight() { - return highResWaveHeight; - } - - /** - * @param waveSteepness - * the waveSteepness to set - */ - public void setWaveSteepness(float waveSteepness) { - this.waveSteepness = waveSteepness; - } - - /** - * @param visibility - * the visibility to set - */ - public void setVisibility(float visibility) { - this.visibility = visibility; - } - - /** - * @param horzVisibility - * the horzVisibility to set - */ - public void setHorzVisibility(float horzVisibility) { - this.horzVisibility = horzVisibility; - } - - /** - * @return the horzVisibility - */ - public float getHorzVisibility() { - return horzVisibility; - } - - /** - * @param temperature - * the temperature to set - */ - public void setTemperature(float temperature) { - this.temperature = temperature; - } - - /** - * @param waveHeight - * the waveHeight to set - */ - public void setWaveHeight(Double waveHeight) { - this.waveHeight = waveHeight; - } - - /** - * @param wavePeriod - * the wavePeriod to set - */ - public void setWavePeriod(Integer wavePeriod) { - this.wavePeriod = wavePeriod; - } - - /** - * @param primarySwellWaveDir - * the primarySwellWaveDir to set - */ - public void setPrimarySwellWaveDir(Double primarySwellWaveDir) { - this.primarySwellWaveDir = primarySwellWaveDir; - } - - /** - * @param primarySwellWavePeriod - * the primarySwellWavePeriod to set - */ - public void setPrimarySwellWavePeriod(Integer primarySwellWavePeriod) { - this.primarySwellWavePeriod = primarySwellWavePeriod; - } - - /** - * @param primarySwellWaveHeight - * the primarySwellWaveHeight to set - */ - public void setPrimarySwellWaveHeight(Double primarySwellWaveHeight) { - this.primarySwellWaveHeight = primarySwellWaveHeight; - } - - /** - * @param secondarySwellWaveDir - * the secondarySwellWaveDir to set - */ - public void setSecondarySwellWaveDir(Double secondarySwellWaveDir) { - this.secondarySwellWaveDir = secondarySwellWaveDir; - } - - /** - * @param secondarySwellWavePeriod - * the secondarySwellWavePeriod to set - */ - public void setSecondarySwellWavePeriod(Integer secondarySwellWavePeriod) { - this.secondarySwellWavePeriod = secondarySwellWavePeriod; - } - - /** - * @param secondarySwellWaveHeight - * the secondarySwellWaveHeight to set - */ - public void setSecondarySwellWaveHeight(Double secondarySwellWaveHeight) { - this.secondarySwellWaveHeight = secondarySwellWaveHeight; - } - - /** - * @param pressChangeChar - * the pressChangeChar to set - */ - public void setPressChangeChar(String pressChangeChar) { - this.pressChangeChar = pressChangeChar; - } - - /** - * @return the pressChangeChar - */ - public String getPressChangeChar() { - return pressChangeChar; - } - - /** - * @param dewpoint - * the dewpoint to set - */ - public void setDewpoint(float dewpoint) { - this.dewpoint = dewpoint; - } - - /** - * @param seaSurfaceTemp - * the seaSurfaceTemp to set - */ - public void setSeaSurfaceTemp(float seaSurfaceTemp) { - this.seaSurfaceTemp = seaSurfaceTemp; - } - - /** - * @param seaLevelPress - * the seaLevelPress to set - */ - public void setSeaLevelPress(float seaLevelPress) { - this.seaLevelPress = seaLevelPress; - } - - /** - * @param hourlyPrecip - * the hourlyPrecip to set - */ - public void setHourlyPrecip(float hourlyPrecip) { - this.hourlyPrecip = hourlyPrecip; - } - - /** - * @return the hourlyPrecip - */ - public float getHourlyPrecip() { - return hourlyPrecip; - } - - /** - * @param snowDepth - * the snowDepth to set - */ - public void setSnowDepth(float snowDepth) { - this.snowDepth = snowDepth; - } - - /** - * @param snincrHourly - * the snincrHourly to set - */ - public void setSnincrHourly(float snincrHourly) { - this.snincrHourly = snincrHourly; - } - - /** - * @param snincrTotal - * the snincrTotal to set - */ - public void setSnincrTotal(float snincrTotal) { - this.snincrTotal = snincrTotal; - } - - /** - * @param frostbiteTime - * the frostbiteTime to set - */ - public void setFrostbiteTime(float frostbiteTime) { - this.frostbiteTime = frostbiteTime; - } - - /** - * @param relativeHumidity - * the relativeHumidity to set - */ - public void setRelativeHumidity(float relativeHumidity) { - this.relativeHumidity = relativeHumidity; - } - - /** - * @param presWeather - * the presWeather to set - */ - public void setPresWeather(String[] presWeather) { - this.presWeather = presWeather; - } - - /** - * @return the presWeather - */ - public String[] getPresWeather() { - return presWeather; - } - - /** - * @param dewpointDepr - * the dewpointDepr to set - */ - public void setDewpointDepr(float dewpointDepr) { - this.dewpointDepr = dewpointDepr; - } - - /** - * @return the skyCover - */ - public String[] getSkyCover() { - return skyCover; - } - - /** - * @param skyCover - * the skyCover to set - */ - public void setSkyCover(String[] skyCover) { - this.skyCover = skyCover; - } - - /** - * @param totCloudAmount - * the totCloudAmount to set - */ - public void setTotCloudAmount(int totCloudAmount) { - this.totCloudAmount = totCloudAmount; - } - - /** - * @return the totCloudAmount - */ - public int getTotCloudAmount() { - return totCloudAmount; - } - - @Override - public Collection getValues(String paramName) { - return null; - } - - @Override - public String getString(String paramName) { - return null; - } - - @Override - public String[] getStrings(String paramName) { - return null; - } - - @Override - public ISpatialObject getSpatialObject() { - return location; - } - - /** - * @param pointDataView - * the pointDataView to set - */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } - - /** - * @return the pointDataView - */ - @Override - public PointDataView getPointDataView() { - return pointDataView; - } - - /** - * Used for debugging. - */ - @Override - public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("fssObsRec:\n\t"); - if (this != null) { - sb.append(this.getDataURI() + "\n\t"); - sb.append(this.getLocation().getStationId() + " ===> " - + this.getStnName() + "\n\t"); - sb.append("Latitude = " + this.getLocation().getLatitude() + "\n\t"); - sb.append("Longitude = " + this.getLocation().getLongitude() - + "\n\t"); - sb.append(this.getReportType() + "\n\t"); - sb.append("Visibility = " + this.getVisibility() + "\n\t"); - sb.append("Temperature = " + this.getTemperature() + "\n\t"); - sb.append(this.getDataTime().getRefTime() + "\n"); - } - return sb.toString(); - } + private static final HashMap PARM_MAP = new HashMap(); + static { + PARM_MAP.put("NLAT", STA_LAT); + PARM_MAP.put("NLON", STA_LON); + PARM_MAP.put("rawMessage", "rawMessage"); + } + + /** is feature new **/ + @Transient + @DynamicSerializeElement + @XmlElement + public boolean isNew = true; + + // Current CWA (WFO) + @Column + @DataURI(position = 2) + @DynamicSerializeElement + @XmlElement(nillable = false) + private String cwa; + + // Monitor which should use this station record + // fog = "fog" + // safeseas = "ss" + // snow = "snow" + @Column + @DataURI(position = 4) + @DynamicSerializeElement + @XmlElement + private String monitorUse = ""; + + // Station name + @Column + @DynamicSerializeElement + @XmlElement + private String stnName; + + /* From ============ObReport================= */ + + @XmlElement + @DynamicSerializeElement + @Column + @DataURI(position = 1) + protected String reportType; + + @Embedded + @DataURI(position = 3, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; + + // Observing platform identifier (same as stationID) + @Transient + @XmlElement + @DynamicSerializeElement + private String platformId; + + // Indicator of whether observing platform is stationary + @Transient + @DynamicSerializeElement + @XmlElement + private boolean isStationary; + + // Actual time of the observation + @Transient + @DynamicSerializeElement + @XmlElement + private Calendar timeObs; + + // Time of the observation to the nearest hour. + @XmlElement + @DynamicSerializeElement + @Column + private Calendar refHour; + + // Raw message + @Transient + @DynamicSerializeElement + @XmlElement + private String rawMessage; + + // Observed wind speed in knots + @Transient + @DynamicSerializeElement + @XmlElement + private float windSpeed = -9999;; + + // Wind gust in knots + @Transient + @DynamicSerializeElement + @XmlElement + private float windGust = -9999;; + + // Observed maximum wind speed in knots + @Transient + @DynamicSerializeElement + @XmlElement + private float maxWindSpeed = -9999; + + // Observed wind direction in azimuth degrees + @Transient + @DynamicSerializeElement + @XmlElement + private float windDir; + + // Observed wind chill in Fahrenheit + @Transient + @DynamicSerializeElement + @XmlElement + private float windChill = -9999; + + // Observed high resolution wave height in + @Transient + @DynamicSerializeElement + @XmlElement + private float highResWaveHeight = -9999; + + // Observed wave steepness in seconds ??? None + @Transient + @DynamicSerializeElement + @XmlElement + private float waveSteepness = -9999; + + // Observed visibility in Statute miles + @Transient + @DynamicSerializeElement + @XmlElement + private float visibility = -9999; + + // Observed visibility in meters for Maritime obs. + @Transient + @DynamicSerializeElement + @XmlElement + private float horzVisibility = -9999; + + // Observed temperature in degrees in Farenheit + @Transient + @DynamicSerializeElement + @XmlElement + private float temperature = -9999; + + // in feet + @Transient + @XmlElement + @DynamicSerializeElement + private Double waveHeight = -9999.0; + + // in seconds + @Transient + @XmlElement + @DynamicSerializeElement + private Integer wavePeriod = -9999; + + // in Azimuth degrees + @Transient + @XmlElement + @DynamicSerializeElement + private Double primarySwellWaveDir = -9999.0; + + // in seconds + @Transient + @XmlElement + @DynamicSerializeElement + private Integer primarySwellWavePeriod = -9999; + + // in feet + @Transient + @XmlElement + @DynamicSerializeElement + private Double primarySwellWaveHeight = -9999.0; + + // in Azimuth degrees + @Transient + @XmlElement + @DynamicSerializeElement + private Double secondarySwellWaveDir = -9999.0; + + // in seconds + @Transient + @XmlElement + @DynamicSerializeElement + private Integer secondarySwellWavePeriod = -9999; + + // in feet + @Transient + @XmlElement + @DynamicSerializeElement + private Double secondarySwellWaveHeight = -9999.0; + + // Three-hour pressure change in thousandths of an inch of mercury ???? + @Transient + @DynamicSerializeElement + @XmlElement + private float pressChange3Hour = -9999f; + + // Pressure change character for metar plot model + /** A string denoting the pressure tendency(rising or falling) */ + @Transient + @DynamicSerializeElement + @XmlElement + private String pressChangeChar; + + // Observed dewpoint in degrees Farenheit + @Transient + @DynamicSerializeElement + @XmlElement + private float dewpoint = -9999f; + + // Observed sea surface temperature in degrees in Farenheit + @Transient + @DynamicSerializeElement + @XmlElement + private float seaSurfaceTemp = -9999f; + + // the sea level pressure in hPa + @XmlElement + @DynamicSerializeElement + @Transient + private float seaLevelPress = -9999f; + + // Altimeter setting in mm Hg. + @Transient + @XmlElement + @DynamicSerializeElement + private float pressureAltimeter = -9999f; + + // Observed hourly precipitation in inches + @Transient + @DynamicSerializeElement + @XmlElement + private float hourlyPrecip = -9999f; + + // Observed snow depth in inch + @Transient + @DynamicSerializeElement + @XmlElement + private float snowDepth = -9999f; + + // Observed snow increasing rapidly, hourly total in inches + @Transient + @DynamicSerializeElement + @XmlElement + private float snincrHourly = -9999f; + + // Observed snow increasing rapidly, total in inches + @Transient + @DynamicSerializeElement + @XmlElement + private float snincrTotal = -9999f; + + // Observed frostbite time in minutes + @Transient + @DynamicSerializeElement + @XmlElement + private float frostbiteTime; + + // present weather conditions for metar plot model + @Transient + @DynamicSerializeElement + @XmlElement + private String[] presWeather; + + // Observed relative humidity in percent + @Transient + @DynamicSerializeElement + @XmlElement + private float relativeHumidity = -9999f; + + // Observed ceiling in feet above ground level + @Transient + @DynamicSerializeElement + @XmlElement + private float ceiling = -9999f; + + // Observed dewpoint depression in Farenheit + @Transient + @DynamicSerializeElement + @XmlElement + private float dewpointDepr = -9999f; + + @XmlElement + @DynamicSerializeElement + @Transient + private String[] skyCover; + + @XmlElement + @DynamicSerializeElement + @Transient + private int totCloudAmount = -9999; + + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; + + // ---------------------------------------------------------------------------------------------------- + public FSSObsRecord() { + } + + public FSSObsRecord(String uri) { + super(uri); + } + + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } + + @Override + public Amount getValue(String paramName) { + Amount a = null; + + String pName = PARM_MAP.get(paramName); + + if (SFC_TEMP.equals(pName) && (temperature != -9999f)) { + a = new Amount(temperature, TEMPERATURE_UNIT); + } else if (SFC_DWPT.equals(pName) && (dewpoint != -9999f)) { + a = new Amount(dewpoint, TEMPERATURE_UNIT); + } else if (SFC_WNDSPD.equals(pName) && (windSpeed != -9999f)) { + a = new Amount(windSpeed, WIND_SPEED_UNIT); + } else if (SFC_WNDDIR.equals(pName) && (windDir != -9999f)) { + a = new Amount(windDir, WIND_DIR_UNIT); + } else if (SFC_WNDGST.equals(pName) && (windGust != -9999f)) { + a = new Amount(windGust, WIND_SPEED_UNIT); + } else if (PRES_SLP.equals(pName) && (seaLevelPress != -9999f)) { + a = new Amount(seaLevelPress, PRESSURE_UNIT); + // } else if (PRES_ALTSG.equals(pName) && (pressureAltimeter != + // -9999f)) { + // a = new Amount(pressureAltimeter, PRESSURE_UNIT); + } else if (STA_LAT.equals(pName)) { + a = new Amount(this.getLatitude(), LOCATION_UNIT); + } else if (STA_LON.equals(pName)) { + a = new Amount(this.getLongitude(), LOCATION_UNIT); + } else if ("WT".equals(pName) && (this.seaSurfaceTemp != -9999f)) { + a = new Amount(this.seaSurfaceTemp, TEMPERATURE_UNIT); + } else if ("WH".equals(pName)) { + a = new Amount(waveHeight, WAVE_UNIT); + } else if ("SWP".equals(pName)) { + a = new Amount(primarySwellWavePeriod, WAVE_UNIT); + } else if ("SWH".equals(pName)) { + a = new Amount(primarySwellWaveHeight, WAVE_UNIT); + // } else if ("PCHNG".equals(pName) && pressChange3Hour != MISSING) + // { + // a = new Amount(pressChange3Hour, PRESSURE_UNIT); + } else if ("PKWND".equals(paramName) && (maxWindSpeed != MISSING)) { + a = new Amount(maxWindSpeed, WIND_SPEED_UNIT); + } else if ("SWS".equals(paramName) || "SWGS".equals(paramName)) { + a = new Amount(1, WIND_SPEED_UNIT); + } else if ("SWD".equals(paramName) && (primarySwellWaveDir != MISSING)) { + a = new Amount(primarySwellWaveDir, WIND_DIR_UNIT); + } + + return a; + } + + /** + * @return the isNew + */ + public boolean getIsNew() { + return isNew; + } + + /** + * @return the cwa + */ + public String getCwa() { + return cwa; + } + + /** + * @param monitorUse + * the monitorUse to set + */ + public void setMonitorUse(String monitorUse) { + this.monitorUse = monitorUse; + } + + /** + * @return the monitorUse + */ + public String getMonitorUse() { + return monitorUse; + } + + /** + * @return the stnName + */ + public String getStnName() { + return stnName; + } + + /** + * @return the reportType + */ + public String getReportType() { + return reportType; + } + + /** + * @return the location + */ + public SurfaceObsLocation getLocation() { + return location; + } + + /** + * @param platformId + * the platformId to set + */ + public void setPlatformId(String platformId) { + this.platformId = platformId; + } + + /** + * @return the platformId + */ + public String getPlatformId() { + return platformId; + } + + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } + + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } + + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } + + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } + + /** + * @return the isStationary + */ + public boolean isStationary() { + return isStationary; + } + + /** + * @return the refHour + */ + public Calendar getRefHour() { + return refHour; + } + + /** + * @return the rawMessage + */ + public String getRawMessage() { + return rawMessage; + } + + /** + * @return the windSpeed + */ + public float getWindSpeed() { + return windSpeed; + } + + /** + * @return the windGust + */ + public float getWindGust() { + return windGust; + } + + /** + * @return the maxWindSpeed + */ + public float getMaxWindSpeed() { + return maxWindSpeed; + } + + /** + * @return the windDir + */ + public float getWindDir() { + return windDir; + } + + /** + * @return the windChill + */ + public float getWindChill() { + return windChill; + } + + /** + * @return the waveSteepness + */ + public float getWaveSteepness() { + return waveSteepness; + } + + /** + * @return the visibility + */ + public float getVisibility() { + return visibility; + } + + /** + * @return the temperature + */ + public float getTemperature() { + return temperature; + } + + /** + * @return the waveHeight + */ + public Double getWaveHeight() { + return waveHeight; + } + + /** + * @return the wavePeriod + */ + public Integer getWavePeriod() { + return wavePeriod; + } + + /** + * @return the primarySwellWaveDir + */ + public Double getPrimarySwellWaveDir() { + return primarySwellWaveDir; + } + + /** + * @return the primarySwellWavePeriod + */ + public Integer getPrimarySwellWavePeriod() { + return primarySwellWavePeriod; + } + + /** + * @return the primarySwellWaveHeight + */ + public Double getPrimarySwellWaveHeight() { + return primarySwellWaveHeight; + } + + /** + * @return the secondarySwellWaveDir + */ + public Double getSecondarySwellWaveDir() { + return secondarySwellWaveDir; + } + + /** + * @return the secondarySwellWavePeriod + */ + public Integer getSecondarySwellWavePeriod() { + return secondarySwellWavePeriod; + } + + /** + * @return the secondarySwellWaveHeight + */ + public Double getSecondarySwellWaveHeight() { + return secondarySwellWaveHeight; + } + + /** + * @return the dewpoint + */ + public float getDewpoint() { + return dewpoint; + } + + /** + * @return the seaSurfaceTemp + */ + public float getSeaSurfaceTemp() { + return seaSurfaceTemp; + } + + /** + * @return the seaLevelPress + */ + public float getSeaLevelPress() { + return seaLevelPress; + } + + /** + * @param pressureAltimeter + * the pressureAltimeter to set + */ + public void setPressureAltimeter(float pressureAltimeter) { + this.pressureAltimeter = pressureAltimeter; + } + + /** + * @return the pressureAltimeter + */ + public float getPressureAltimeter() { + return pressureAltimeter; + } + + /** + * @param pressChange3Hour + * the pressChange3Hour to set + */ + public void setPressChange3Hour(float pressChange3Hour) { + this.pressChange3Hour = pressChange3Hour; + } + + /** + * @return the pressChange3Hour + */ + public float getPressChange3Hour() { + return pressChange3Hour; + } + + /** + * @return the snowDepth + */ + public float getSnowDepth() { + return snowDepth; + } + + /** + * @return the snincrHourly + */ + public float getSnincrHourly() { + return snincrHourly; + } + + /** + * @return the snincrTotal + */ + public float getSnincrTotal() { + return snincrTotal; + } + + /** + * @return the frostbiteTime + */ + public float getFrostbiteTime() { + return frostbiteTime; + } + + /** + * @return the relativeHumidity + */ + public float getRelativeHumidity() { + return relativeHumidity; + } + + /** + * @param ceiling + * the ceiling to set + */ + public void setCeiling(float ceiling) { + this.ceiling = ceiling; + } + + /** + * @return the ceiling + */ + public float getCeiling() { + return ceiling; + } + + /** + * @return the dewpointDepr + */ + public float getDewpointDepr() { + return dewpointDepr; + } + + /** + * @param isNew + * the isNew to set + */ + public void setIsNew(boolean isNew) { + this.isNew = isNew; + } + + /** + * @param cwa + * the cwa to set + */ + public void setCwa(String cwa) { + this.cwa = cwa; + } + + /** + * @param stnName + * the stnName to set + */ + public void setStnName(String stnName) { + this.stnName = stnName; + } + + /** + * @param reportType + * the reportType to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } + + /** + * @param location + * the location to set + */ + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } + + /** + * @param isStationary + * the isStationary to set + */ + public void setIsStationary(boolean isStationary) { + this.isStationary = isStationary; + } + + public boolean getIsStationary() { + return isStationary; + } + + /** + * @param timeObs + * the timeObs to set + */ + public void setTimeObs(Calendar timeObs) { + this.timeObs = timeObs; + } + + /** + * @return the timeObs + */ + public Calendar getTimeObs() { + return timeObs; + } + + /** + * @param refHour + * the refHour to set + */ + public void setRefHour(Calendar refHour) { + this.refHour = refHour; + } + + /** + * @param rawMessage + * the rawMessage to set + */ + public void setRawMessage(String rawMessage) { + this.rawMessage = rawMessage; + } + + /** + * @param windSpeed + * the windSpeed to set + */ + public void setWindSpeed(float windSpeed) { + this.windSpeed = windSpeed; + } + + /** + * @param windGust + * the windGust to set + */ + public void setWindGust(float windGust) { + this.windGust = windGust; + } + + /** + * @param maxWindSpeed + * the maxWindSpeed to set + */ + public void setMaxWindSpeed(float maxWindSpeed) { + this.maxWindSpeed = maxWindSpeed; + } + + /** + * @param windDir + * the windDir to set + */ + public void setWindDir(float windDir) { + this.windDir = windDir; + } + + /** + * @param windChill + * the windChill to set + */ + public void setWindChill(float windChill) { + this.windChill = windChill; + } + + public void setHighResWaveHeight(float highResWaveHeight) { + this.highResWaveHeight = highResWaveHeight; + } + + public float getHighResWaveHeight() { + return highResWaveHeight; + } + + /** + * @param waveSteepness + * the waveSteepness to set + */ + public void setWaveSteepness(float waveSteepness) { + this.waveSteepness = waveSteepness; + } + + /** + * @param visibility + * the visibility to set + */ + public void setVisibility(float visibility) { + this.visibility = visibility; + } + + /** + * @param horzVisibility + * the horzVisibility to set + */ + public void setHorzVisibility(float horzVisibility) { + this.horzVisibility = horzVisibility; + } + + /** + * @return the horzVisibility + */ + public float getHorzVisibility() { + return horzVisibility; + } + + /** + * @param temperature + * the temperature to set + */ + public void setTemperature(float temperature) { + this.temperature = temperature; + } + + /** + * @param waveHeight + * the waveHeight to set + */ + public void setWaveHeight(Double waveHeight) { + this.waveHeight = waveHeight; + } + + /** + * @param wavePeriod + * the wavePeriod to set + */ + public void setWavePeriod(Integer wavePeriod) { + this.wavePeriod = wavePeriod; + } + + /** + * @param primarySwellWaveDir + * the primarySwellWaveDir to set + */ + public void setPrimarySwellWaveDir(Double primarySwellWaveDir) { + this.primarySwellWaveDir = primarySwellWaveDir; + } + + /** + * @param primarySwellWavePeriod + * the primarySwellWavePeriod to set + */ + public void setPrimarySwellWavePeriod(Integer primarySwellWavePeriod) { + this.primarySwellWavePeriod = primarySwellWavePeriod; + } + + /** + * @param primarySwellWaveHeight + * the primarySwellWaveHeight to set + */ + public void setPrimarySwellWaveHeight(Double primarySwellWaveHeight) { + this.primarySwellWaveHeight = primarySwellWaveHeight; + } + + /** + * @param secondarySwellWaveDir + * the secondarySwellWaveDir to set + */ + public void setSecondarySwellWaveDir(Double secondarySwellWaveDir) { + this.secondarySwellWaveDir = secondarySwellWaveDir; + } + + /** + * @param secondarySwellWavePeriod + * the secondarySwellWavePeriod to set + */ + public void setSecondarySwellWavePeriod(Integer secondarySwellWavePeriod) { + this.secondarySwellWavePeriod = secondarySwellWavePeriod; + } + + /** + * @param secondarySwellWaveHeight + * the secondarySwellWaveHeight to set + */ + public void setSecondarySwellWaveHeight(Double secondarySwellWaveHeight) { + this.secondarySwellWaveHeight = secondarySwellWaveHeight; + } + + /** + * @param pressChangeChar + * the pressChangeChar to set + */ + public void setPressChangeChar(String pressChangeChar) { + this.pressChangeChar = pressChangeChar; + } + + /** + * @return the pressChangeChar + */ + public String getPressChangeChar() { + return pressChangeChar; + } + + /** + * @param dewpoint + * the dewpoint to set + */ + public void setDewpoint(float dewpoint) { + this.dewpoint = dewpoint; + } + + /** + * @param seaSurfaceTemp + * the seaSurfaceTemp to set + */ + public void setSeaSurfaceTemp(float seaSurfaceTemp) { + this.seaSurfaceTemp = seaSurfaceTemp; + } + + /** + * @param seaLevelPress + * the seaLevelPress to set + */ + public void setSeaLevelPress(float seaLevelPress) { + this.seaLevelPress = seaLevelPress; + } + + /** + * @param hourlyPrecip + * the hourlyPrecip to set + */ + public void setHourlyPrecip(float hourlyPrecip) { + this.hourlyPrecip = hourlyPrecip; + } + + /** + * @return the hourlyPrecip + */ + public float getHourlyPrecip() { + return hourlyPrecip; + } + + /** + * @param snowDepth + * the snowDepth to set + */ + public void setSnowDepth(float snowDepth) { + this.snowDepth = snowDepth; + } + + /** + * @param snincrHourly + * the snincrHourly to set + */ + public void setSnincrHourly(float snincrHourly) { + this.snincrHourly = snincrHourly; + } + + /** + * @param snincrTotal + * the snincrTotal to set + */ + public void setSnincrTotal(float snincrTotal) { + this.snincrTotal = snincrTotal; + } + + /** + * @param frostbiteTime + * the frostbiteTime to set + */ + public void setFrostbiteTime(float frostbiteTime) { + this.frostbiteTime = frostbiteTime; + } + + /** + * @param relativeHumidity + * the relativeHumidity to set + */ + public void setRelativeHumidity(float relativeHumidity) { + this.relativeHumidity = relativeHumidity; + } + + /** + * @param presWeather + * the presWeather to set + */ + public void setPresWeather(String[] presWeather) { + this.presWeather = presWeather; + } + + /** + * @return the presWeather + */ + public String[] getPresWeather() { + return presWeather; + } + + /** + * @param dewpointDepr + * the dewpointDepr to set + */ + public void setDewpointDepr(float dewpointDepr) { + this.dewpointDepr = dewpointDepr; + } + + /** + * @return the skyCover + */ + public String[] getSkyCover() { + return skyCover; + } + + /** + * @param skyCover + * the skyCover to set + */ + public void setSkyCover(String[] skyCover) { + this.skyCover = skyCover; + } + + /** + * @param totCloudAmount + * the totCloudAmount to set + */ + public void setTotCloudAmount(int totCloudAmount) { + this.totCloudAmount = totCloudAmount; + } + + /** + * @return the totCloudAmount + */ + public int getTotCloudAmount() { + return totCloudAmount; + } + + @Override + public Collection getValues(String paramName) { + return null; + } + + @Override + public String getString(String paramName) { + return null; + } + + @Override + public String[] getStrings(String paramName) { + return null; + } + + @Override + public ISpatialObject getSpatialObject() { + return location; + } + + /** + * @param pointDataView + * the pointDataView to set + */ + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + + /** + * @return the pointDataView + */ + @Override + public PointDataView getPointDataView() { + return pointDataView; + } + + /** + * Used for debugging. + */ + @Override + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("fssObsRec:\n\t"); + if (this != null) { + sb.append(this.getDataURI() + "\n\t"); + sb.append(this.getLocation().getStationId() + " ===> " + + this.getStnName() + "\n\t"); + sb.append("Latitude = " + this.getLocation().getLatitude() + "\n\t"); + sb.append("Longitude = " + this.getLocation().getLongitude() + + "\n\t"); + sb.append(this.getReportType() + "\n\t"); + sb.append("Visibility = " + this.getVisibility() + "\n\t"); + sb.append("Temperature = " + this.getTemperature() + "\n\t"); + sb.append(this.getDataTime().getRefTime() + "\n"); + } + return sb.toString(); + } @Override @Column @@ -1268,4 +1237,9 @@ public class FSSObsRecord extends PersistablePluginDataObject implements public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "fssobs"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.java index 7cf79598ea..347f7eab1e 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.gfe/src/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.java @@ -25,6 +25,7 @@ package com.raytheon.uf.common.dataplugin.gfe.db.objects; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; +import java.util.Date; import java.util.List; import java.util.TimeZone; @@ -47,6 +48,7 @@ import org.hibernate.annotations.OnDeleteAction; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.dataplugin.gfe.GridDataHistory; +import com.raytheon.uf.common.dataplugin.persist.IPersistable; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.time.DataTime; @@ -77,6 +79,8 @@ import com.raytheon.uf.common.time.TimeRange; * PluginDataObject. * May 13, 2013 1869 bsteffen Remove DataURI column from GFE. * Jun 20, 2013 2127 rjpeter Added OnDelete annotation. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * Sep 20, 2013 2147 rferrel Changes to archive hdf5 files. * * * @@ -95,7 +99,7 @@ import com.raytheon.uf.common.time.TimeRange; "refTime", "forecastTime" }) }) @DynamicSerialize @BatchSize(size = 500) -public class GFERecord extends PluginDataObject { +public class GFERecord extends PluginDataObject implements IPersistable { private static final long serialVersionUID = 1L; @@ -151,7 +155,6 @@ public class GFERecord extends PluginDataObject { * The parm Info */ public GFERecord(ParmID parmId, TimeRange timeRange) { - this.pluginName = "gfe"; Calendar cal = (Calendar) Calendar.getInstance( TimeZone.getTimeZone("GMT")).clone(); cal.setTime(timeRange.getStart()); @@ -276,4 +279,21 @@ public class GFERecord extends PluginDataObject { } } } + + @Override + public String getPluginName() { + return "gfe"; + } + + @Override + public Date getPersistenceTime() { + return getInsertTime().getTime(); + } + + @Override + public void setPersistenceTime(Date persistTime) { + Calendar pTime = Calendar.getInstance(); + pTime.setTime(persistTime); + setInsertTime(pTime); + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.goessounding/src/com/raytheon/uf/common/dataplugin/goessounding/GOESSounding.java b/edexOsgi/com.raytheon.uf.common.dataplugin.goessounding/src/com/raytheon/uf/common/dataplugin/goessounding/GOESSounding.java index a588315d39..ec39c88693 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.goessounding/src/com/raytheon/uf/common/dataplugin/goessounding/GOESSounding.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.goessounding/src/com/raytheon/uf/common/dataplugin/goessounding/GOESSounding.java @@ -62,6 +62,7 @@ import com.vividsolutions.jts.geom.Geometry; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -76,348 +77,348 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "goessounding", - indexes = { - @Index(name = "goessounding_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "goessounding", indexes = { @Index(name = "goessounding_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class GOESSounding extends PersistablePluginDataObject implements ISpatialEnabled, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @Embedded - @DataURI(position = 1, embedded = true) - @DynamicSerializeElement - private SurfaceObsLocation location; + @Embedded + @DataURI(position = 1, embedded = true) + @DynamicSerializeElement + private SurfaceObsLocation location; - // The bounding box that contains this observation. + // The bounding box that contains this observation. @Column(name = "boxGeometry", columnDefinition = "geometry") @Type(type = "com.raytheon.edex.db.objects.hibernate.GeometryType") - @DynamicSerializeElement - private Geometry boxGeometry; + @DynamicSerializeElement + private Geometry boxGeometry; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - // Text of the WMO header - @Transient - @DynamicSerializeElement - private String wmoHeader; + // Text of the WMO header + @Transient + @DynamicSerializeElement + private String wmoHeader; - @Transient - @DynamicSerializeElement - private Integer satId; + @Transient + @DynamicSerializeElement + private Integer satId; - @Transient - @DynamicSerializeElement - private Integer satInstrument; + @Transient + @DynamicSerializeElement + private Integer satInstrument; - @Transient - @DynamicSerializeElement - private Integer qualityInfo; + @Transient + @DynamicSerializeElement + private Integer qualityInfo; - @Transient - @DynamicSerializeElement - private Integer sounderChannels; + @Transient + @DynamicSerializeElement + private Integer sounderChannels; - @Transient - @DynamicSerializeElement - private Double solarElevation; + @Transient + @DynamicSerializeElement + private Double solarElevation; - // The profiler observation time. - @Transient - @DynamicSerializeElement - private Calendar timeObs; + // The profiler observation time. + @Transient + @DynamicSerializeElement + private Calendar timeObs; - @Transient - @DynamicSerializeElement - private List soundingLevels; + @Transient + @DynamicSerializeElement + private List soundingLevels; - /** - * Create an empty ProfilerObs object. - */ - public GOESSounding() { - } + /** + * Create an empty ProfilerObs object. + */ + public GOESSounding() { + } - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public GOESSounding(String uri) { - super(uri); - } + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public GOESSounding(String uri) { + super(uri); + } - /** - * Get the observation time for this data. - * - * @return The data observation time. - */ - public Calendar getTimeObs() { - return timeObs; - } + /** + * Get the observation time for this data. + * + * @return The data observation time. + */ + public Calendar getTimeObs() { + return timeObs; + } - /** - * Set the observation time for this data. - * - * @param timeObs - * The data observation time. - */ - public void setTimeObs(Calendar timeObs) { - this.timeObs = timeObs; - } + /** + * Set the observation time for this data. + * + * @param timeObs + * The data observation time. + */ + public void setTimeObs(Calendar timeObs) { + this.timeObs = timeObs; + } - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } - /** - * Was this location defined from the station catalog? False if not. - * - * @return Was this location defined from the station catalog? - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } + /** + * Was this location defined from the station catalog? False if not. + * + * @return Was this location defined from the station catalog? + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } - /** - * Set the WMOHeader of the file that contained this data. - * - * @return The wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } + /** + * Set the WMOHeader of the file that contained this data. + * + * @return The wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * Get the WMOHeader of the file that contained this data. - * - * @param wmoHeader - * The WMOHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + /** + * Get the WMOHeader of the file that contained this data. + * + * @param wmoHeader + * The WMOHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * @return the satId - */ - public Integer getSatId() { - return satId; - } + /** + * @return the satId + */ + public Integer getSatId() { + return satId; + } - /** - * @param satId - * the satId to set - */ - public void setSatId(Integer satId) { - this.satId = satId; - } + /** + * @param satId + * the satId to set + */ + public void setSatId(Integer satId) { + this.satId = satId; + } - /** - * @return the satInstrument - */ - public Integer getSatInstrument() { - return satInstrument; - } + /** + * @return the satInstrument + */ + public Integer getSatInstrument() { + return satInstrument; + } - /** - * @param satInstrument - * the satInstrument to set - */ - public void setSatInstrument(Integer satInstrument) { - this.satInstrument = satInstrument; - } + /** + * @param satInstrument + * the satInstrument to set + */ + public void setSatInstrument(Integer satInstrument) { + this.satInstrument = satInstrument; + } - /** - * @return the qualityInfo - */ - public Integer getQualityInfo() { - return qualityInfo; - } + /** + * @return the qualityInfo + */ + public Integer getQualityInfo() { + return qualityInfo; + } - /** - * @param qualityInfo - * the qualityInfo to set - */ - public void setQualityInfo(Integer qualityInfo) { - this.qualityInfo = qualityInfo; - } + /** + * @param qualityInfo + * the qualityInfo to set + */ + public void setQualityInfo(Integer qualityInfo) { + this.qualityInfo = qualityInfo; + } - /** - * Get the satellite channels used to to create the sounding data. - * - *
-	 *  bit  Channel  Wavelength
-	 *   #            micrometers
-	 *   1       1      14.71
-	 *   2       2      14.37
-	 *   3       3      14.06
-	 *   4       4      13.64
-	 *   5       5      13.37
-	 *   6       6      12.66
-	 *   7       7      12.02
-	 *   8       8      11.03
-	 *   9       9       9.71
-	 *  10      10       7.43
-	 *  11      11       7.02
-	 *  12      12       6.51
-	 *  13      13       4.57
-	 *  14      14       4.52
-	 *  15      15       4.45
-	 *  16      16       4.13
-	 *  17      17       3.98
-	 *  18      18       3.74
-	 *  19      19       0.969
-	 *  All 20    Missing value
-	 * 
- * - * @return The sounder channels. - */ - public Integer getSounderChannels() { - return sounderChannels; - } + /** + * Get the satellite channels used to to create the sounding data. + * + *
+     *  bit  Channel  Wavelength
+     *   #            micrometers
+     *   1       1      14.71
+     *   2       2      14.37
+     *   3       3      14.06
+     *   4       4      13.64
+     *   5       5      13.37
+     *   6       6      12.66
+     *   7       7      12.02
+     *   8       8      11.03
+     *   9       9       9.71
+     *  10      10       7.43
+     *  11      11       7.02
+     *  12      12       6.51
+     *  13      13       4.57
+     *  14      14       4.52
+     *  15      15       4.45
+     *  16      16       4.13
+     *  17      17       3.98
+     *  18      18       3.74
+     *  19      19       0.969
+     *  All 20    Missing value
+     * 
+ * + * @return The sounder channels. + */ + public Integer getSounderChannels() { + return sounderChannels; + } - /** - * Get the satellite channels used to to create the sounding data. - * - * @param sounderChannels - * The sounder channels. - */ - public void setSounderChannels(Integer sounderChannels) { - this.sounderChannels = sounderChannels; - } + /** + * Get the satellite channels used to to create the sounding data. + * + * @param sounderChannels + * The sounder channels. + */ + public void setSounderChannels(Integer sounderChannels) { + this.sounderChannels = sounderChannels; + } - /** - * Get the bounding box that contains this observation. - * - * @return The bounding box Geometry. - */ - public Geometry getBoxGeometry() { - return boxGeometry; - } + /** + * Get the bounding box that contains this observation. + * + * @return The bounding box Geometry. + */ + public Geometry getBoxGeometry() { + return boxGeometry; + } - /** - * Set the bounding box that contains this observation. - * - * @param boxGeometry - * The bounding box Geometry. - */ - public void setBoxGeometry(Geometry boxGeometry) { - this.boxGeometry = boxGeometry; - } + /** + * Set the bounding box that contains this observation. + * + * @param boxGeometry + * The bounding box Geometry. + */ + public void setBoxGeometry(Geometry boxGeometry) { + this.boxGeometry = boxGeometry; + } - /** - * @return the solarElevation - */ - public Double getSolarElevation() { - return solarElevation; - } + /** + * @return the solarElevation + */ + public Double getSolarElevation() { + return solarElevation; + } - /** - * @param solarElevation - * the solarElevation to set - */ - public void setSolarElevation(Double solarElevation) { - this.solarElevation = solarElevation; - } + /** + * @param solarElevation + * the solarElevation to set + */ + public void setSolarElevation(Double solarElevation) { + this.solarElevation = solarElevation; + } - /** - * @return the soundingLevels - */ - public List getSoundingLevels() { - return soundingLevels; - } + /** + * @return the soundingLevels + */ + public List getSoundingLevels() { + return soundingLevels; + } - /** - * @param soundingLevels - * the soundingLevels to set - */ - public void setSoundingLevels(List soundingLevels) { - this.soundingLevels = soundingLevels; - } + /** + * @param soundingLevels + * the soundingLevels to set + */ + public void setSoundingLevels(List soundingLevels) { + this.soundingLevels = soundingLevels; + } - /** - * @param soundingLevels - * the soundingLevels to set - */ - public void addSoundingLevel(GOESSoundingLevel soundingLevel) { - if (soundingLevels == null) { - soundingLevels = new ArrayList(); - } - soundingLevels.add(soundingLevel); - } + /** + * @param soundingLevels + * the soundingLevels to set + */ + public void addSoundingLevel(GOESSoundingLevel soundingLevel) { + if (soundingLevels == null) { + soundingLevels = new ArrayList(); + } + soundingLevels.add(soundingLevel); + } - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } - public SurfaceObsLocation getLocation() { - return location; - } + public SurfaceObsLocation getLocation() { + return location; + } - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + @Override + public String getPluginName() { + return "goessounding"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.grib/src/com/raytheon/uf/common/dataplugin/grib/GribRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.grib/src/com/raytheon/uf/common/dataplugin/grib/GribRecord.java index 6dc4dbf6b1..3af072fc9d 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.grib/src/com/raytheon/uf/common/dataplugin/grib/GribRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.grib/src/com/raytheon/uf/common/dataplugin/grib/GribRecord.java @@ -65,12 +65,14 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 4/7/09 1994 bphillip Initial Creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 04/08/13 1293 bkowal Removed references to hdffileid. + * Apr 07, 2009 1994 bphillip Initial Creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -84,12 +86,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "grib", - indexes = { - @Index(name = "grib_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "grib", indexes = { @Index(name = "grib_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -238,7 +236,6 @@ public class GribRecord extends PersistablePluginDataObject implements this.insertTime = (Calendar) recordToCopy.insertTime.clone(); } this.messageData = recordToCopy.messageData; - this.pluginName = recordToCopy.pluginName; this.gridVersion = recordToCopy.gridVersion; if (recordToCopy.hybridCoordList != null) { this.hybridCoordList = Arrays.copyOf(recordToCopy.hybridCoordList, @@ -278,8 +275,9 @@ public class GribRecord extends PersistablePluginDataObject implements @Override public Date getPersistenceTime() { Calendar c = getInsertTime(); - if (c == null) + if (c == null) { return null; + } return c.getTime(); } @@ -526,6 +524,7 @@ public class GribRecord extends PersistablePluginDataObject implements this.resCompFlags = resCompFlags; } + @Override public void setId(int id) { this.id = id; } @@ -566,34 +565,37 @@ public class GribRecord extends PersistablePluginDataObject implements public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + gridVersion; - result = prime * result + Arrays.hashCode(hybridCoordList); - result = prime * result + (hybridGrid ? 1231 : 1237); - result = prime * result + (isVector ? 1231 : 1237); - result = prime * result + Arrays.hashCode(localSection); - result = prime * result + (localSectionUsed ? 1231 : 1237); - result = prime * result + localTableVersion; - result = prime * result + masterTableVersion; - result = prime * result + result = (prime * result) + gridVersion; + result = (prime * result) + Arrays.hashCode(hybridCoordList); + result = (prime * result) + (hybridGrid ? 1231 : 1237); + result = (prime * result) + (isVector ? 1231 : 1237); + result = (prime * result) + Arrays.hashCode(localSection); + result = (prime * result) + (localSectionUsed ? 1231 : 1237); + result = (prime * result) + localTableVersion; + result = (prime * result) + masterTableVersion; + result = (prime * result) + ((modelInfo == null) ? 0 : modelInfo.hashCode()); - result = prime * result + processedDataType; - result = prime * result + productionStatus; - result = prime * result + refTimeSignificance; - result = prime * result + result = (prime * result) + processedDataType; + result = (prime * result) + productionStatus; + result = (prime * result) + refTimeSignificance; + result = (prime * result) + ((resCompFlags == null) ? 0 : resCompFlags.hashCode()); - result = prime * result + (thinnedGrid ? 1231 : 1237); - result = prime * result + Arrays.hashCode(thinnedPts); + result = (prime * result) + (thinnedGrid ? 1231 : 1237); + result = (prime * result) + Arrays.hashCode(thinnedPts); return result; } @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } GribRecord other = (GribRecord) obj; if (!this.dataTime.getRefTimeAsCalendar().equals( other.getDataTime().getRefTimeAsCalendar())) { @@ -606,42 +608,59 @@ public class GribRecord extends PersistablePluginDataObject implements return false; } - if (gridVersion != other.gridVersion) + if (gridVersion != other.gridVersion) { return false; - if (!Arrays.equals(hybridCoordList, other.hybridCoordList)) + } + if (!Arrays.equals(hybridCoordList, other.hybridCoordList)) { return false; - if (hybridGrid != other.hybridGrid) + } + if (hybridGrid != other.hybridGrid) { return false; - if (isVector != other.isVector) + } + if (isVector != other.isVector) { return false; - if (!Arrays.equals(localSection, other.localSection)) + } + if (!Arrays.equals(localSection, other.localSection)) { return false; - if (localSectionUsed != other.localSectionUsed) + } + if (localSectionUsed != other.localSectionUsed) { return false; - if (localTableVersion != other.localTableVersion) + } + if (localTableVersion != other.localTableVersion) { return false; - if (masterTableVersion != other.masterTableVersion) + } + if (masterTableVersion != other.masterTableVersion) { return false; + } if (modelInfo == null) { - if (other.modelInfo != null) + if (other.modelInfo != null) { return false; - } else if (!modelInfo.equals(other.modelInfo)) + } + } else if (!modelInfo.equals(other.modelInfo)) { return false; - if (processedDataType != other.processedDataType) + } + if (processedDataType != other.processedDataType) { return false; - if (productionStatus != other.productionStatus) + } + if (productionStatus != other.productionStatus) { return false; - if (refTimeSignificance != other.refTimeSignificance) + } + if (refTimeSignificance != other.refTimeSignificance) { return false; + } if (resCompFlags == null) { - if (other.resCompFlags != null) + if (other.resCompFlags != null) { return false; - } else if (!resCompFlags.equals(other.resCompFlags)) + } + } else if (!resCompFlags.equals(other.resCompFlags)) { return false; - if (thinnedGrid != other.thinnedGrid) + } + if (thinnedGrid != other.thinnedGrid) { return false; - if (!Arrays.equals(thinnedPts, other.thinnedPts)) + } + if (!Arrays.equals(thinnedPts, other.thinnedPts)) { return false; + } return true; } @@ -651,4 +670,9 @@ public class GribRecord extends PersistablePluginDataObject implements public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "grib"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.grid/src/com/raytheon/uf/common/dataplugin/grid/GridRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.grid/src/com/raytheon/uf/common/dataplugin/grid/GridRecord.java index 29f006cc84..13701da938 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.grid/src/com/raytheon/uf/common/dataplugin/grid/GridRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.grid/src/com/raytheon/uf/common/dataplugin/grid/GridRecord.java @@ -61,11 +61,13 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * May 21, 2012 bsteffen Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * May 21, 2012 bsteffen Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -79,12 +81,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "grid", - indexes = { - @Index(name = "grid_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "grid", indexes = { @Index(name = "grid_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class GridRecord extends PersistablePluginDataObject implements ISpatialEnabled { @@ -110,7 +108,6 @@ public class GridRecord extends PersistablePluginDataObject implements } public GridRecord(GridRecord record) { - this.pluginName = record.getPluginName(); this.dataTime = record.getDataTime(); this.info = new GridInfoRecord(record.getInfoNotNull()); if (record.getExtraAttributes() != null) { @@ -236,24 +233,29 @@ public class GridRecord extends PersistablePluginDataObject implements public int hashCode() { final int prime = 31; int result = super.hashCode(); - result = prime * result + ((info == null) ? 0 : info.hashCode()); + result = (prime * result) + ((info == null) ? 0 : info.hashCode()); return result; } @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } GridRecord other = (GridRecord) obj; if (info == null) { - if (other.info != null) + if (other.info != null) { return false; - } else if (!info.equals(other.info)) + } + } else if (!info.equals(other.info)) { return false; + } return true; } @@ -263,4 +265,9 @@ public class GridRecord extends PersistablePluginDataObject implements public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "grid"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.ldadhydro/src/com/raytheon/uf/common/dataplugin/ldadhydro/HydroLdadRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.ldadhydro/src/com/raytheon/uf/common/dataplugin/ldadhydro/HydroLdadRecord.java index ea11d952f7..83add3d259 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.ldadhydro/src/com/raytheon/uf/common/dataplugin/ldadhydro/HydroLdadRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.ldadhydro/src/com/raytheon/uf/common/dataplugin/ldadhydro/HydroLdadRecord.java @@ -70,11 +70,13 @@ import com.vividsolutions.jts.geom.Geometry; * * Date Ticket# Engineer Description * ----------- ---------- ----------- -------------------------- - * 9/30/09 vkorolev Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Sep 30, 2009 vkorolev Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -89,1073 +91,1075 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ldadhydro", - indexes = { - @Index(name = "ldadhydro_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ldadhydro", indexes = { @Index(name = "ldadhydro_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class HydroLdadRecord extends PersistablePluginDataObject implements - ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { + ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - public static final String OBS_TEXT = "text"; + public static final String OBS_TEXT = "text"; - public static final Unit LENGTH_UNIT = SI.METER; + public static final Unit LENGTH_UNIT = SI.METER; - public static final Unit TEMPERATURE_UNIT = SI.KELVIN; + public static final Unit TEMPERATURE_UNIT = SI.KELVIN; - public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; + public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; - public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; - public static final Unit PRESSURE_UNIT = SI.PASCAL; + public static final Unit PRESSURE_UNIT = SI.PASCAL; - public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; - private static final HashMap PARM_MAP = new HashMap(); - static { - PARM_MAP.put("T", SFC_TEMP); - PARM_MAP.put("DpT", SFC_DWPT); - PARM_MAP.put("WS", SFC_WNDSPD); - PARM_MAP.put("WD", SFC_WNDDIR); - PARM_MAP.put("WGS", SFC_WNDGST); - PARM_MAP.put("ASET", "SFC.PRESS.ALTIMETER"); - PARM_MAP.put("PMSL", PRES_SLP); - PARM_MAP.put("NLAT", STA_LAT); - PARM_MAP.put("NLON", STA_LON); - PARM_MAP.put("STA", "STA"); - PARM_MAP.put("stationId", "STA"); - PARM_MAP.put("message", OBS_TEXT); - PARM_MAP.put(OBS_TEXT, OBS_TEXT); - } + private static final HashMap PARM_MAP = new HashMap(); + static { + PARM_MAP.put("T", SFC_TEMP); + PARM_MAP.put("DpT", SFC_DWPT); + PARM_MAP.put("WS", SFC_WNDSPD); + PARM_MAP.put("WD", SFC_WNDDIR); + PARM_MAP.put("WGS", SFC_WNDGST); + PARM_MAP.put("ASET", "SFC.PRESS.ALTIMETER"); + PARM_MAP.put("PMSL", PRES_SLP); + PARM_MAP.put("NLAT", STA_LAT); + PARM_MAP.put("NLON", STA_LON); + PARM_MAP.put("STA", "STA"); + PARM_MAP.put("stationId", "STA"); + PARM_MAP.put("message", OBS_TEXT); + PARM_MAP.put(OBS_TEXT, OBS_TEXT); + } - // Time of the observation. - @DataURI(position = 2) - @Column - @XmlAttribute - @DynamicSerializeElement - private Calendar observationTime; + // Time of the observation. + @DataURI(position = 2) + @Column + @XmlAttribute + @DynamicSerializeElement + private Calendar observationTime; - // numeric WMO identification number - @Column - @XmlElement - @DynamicSerializeElement - private long numericWMOid; + // numeric WMO identification number + @Column + @XmlElement + @DynamicSerializeElement + private long numericWMOid; - // latitude, longitude, elevation, stationId="RALC2" - @Embedded - @DataURI(position = 3, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; + // latitude, longitude, elevation, stationId="RALC2" + @Embedded + @DataURI(position = 3, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; - // Data Provider station Id - @Column - @XmlElement - @DynamicSerializeElement - private String providerId; // * "110" "FA6026DA" + // Data Provider station Id + @Column + @XmlElement + @DynamicSerializeElement + private String providerId; // * "110" "FA6026DA" - @Column - @XmlElement - @DynamicSerializeElement - private String stationName; // * "Ralston_Res" + @Column + @XmlElement + @DynamicSerializeElement + private String stationName; // * "Ralston_Res" - // Handbook Id (AFOS id or SHEF id) - @Column - @XmlElement - @DynamicSerializeElement - private String handbook5Id; + // Handbook Id (AFOS id or SHEF id) + @Column + @XmlElement + @DynamicSerializeElement + private String handbook5Id; - // Home WFO Id for the LDAD data - @Column - @XmlElement - @DynamicSerializeElement - private String homeWFO; + // Home WFO Id for the LDAD data + @Column + @XmlElement + @DynamicSerializeElement + private String homeWFO; - // LDAD hydro station type. - @Column - @XmlElement - @DynamicSerializeElement - private String stationType; + // LDAD hydro station type. + @Column + @XmlElement + @DynamicSerializeElement + private String stationType; - // LDAD hydro data provider - @DataURI(position = 1) - @Column - @XmlElement - @DynamicSerializeElement - private String dataProvider; + // LDAD hydro data provider + @DataURI(position = 1) + @Column + @XmlElement + @DynamicSerializeElement + private String dataProvider; - // time data was processed by the provider - @Column - @XmlElement - @DynamicSerializeElement - private double reportTime; // * 1.247436157E9 + // time data was processed by the provider + @Column + @XmlElement + @DynamicSerializeElement + private double reportTime; // * 1.247436157E9 - // * time data was received - @Column - @XmlElement - @DynamicSerializeElement - private Double receivedTime; // seconds since 1-1-1970 + // * time data was received + @Column + @XmlElement + @DynamicSerializeElement + private Double receivedTime; // seconds since 1-1-1970 - // Below surface - @Column - @XmlElement - @DynamicSerializeElement - private Float belowSurface; // meter + // Below surface + @Column + @XmlElement + @DynamicSerializeElement + private Float belowSurface; // meter - // River stage - @Column - @XmlElement - @DynamicSerializeElement - private Float riverStage; // meter + // River stage + @Column + @XmlElement + @DynamicSerializeElement + private Float riverStage; // meter - // Pool elevation - @Column - @XmlElement - @DynamicSerializeElement - private Float poolElevation; // meter + // Pool elevation + @Column + @XmlElement + @DynamicSerializeElement + private Float poolElevation; // meter - // Tail water stage - @Column - @XmlElement - @DynamicSerializeElement - private Float tailwaterStage; // meter + // Tail water stage + @Column + @XmlElement + @DynamicSerializeElement + private Float tailwaterStage; // meter - // River velocity - @Column - @XmlElement - @DynamicSerializeElement - private Float riverVelocity; // kph + // River velocity + @Column + @XmlElement + @DynamicSerializeElement + private Float riverVelocity; // kph - // River inflow - @Column - @XmlElement - @DynamicSerializeElement - private Float riverInflow; // meter^3 / sec + // River inflow + @Column + @XmlElement + @DynamicSerializeElement + private Float riverInflow; // meter^3 / sec - // River flow - @Column - @XmlElement - @DynamicSerializeElement - private Float riverFlow; // meter^3 / sec + // River flow + @Column + @XmlElement + @DynamicSerializeElement + private Float riverFlow; // meter^3 / sec - // Computed outflow - @Column - @XmlElement - @DynamicSerializeElement - private Float computedOutflow; // meter^3 / sec + // Computed outflow + @Column + @XmlElement + @DynamicSerializeElement + private Float computedOutflow; // meter^3 / sec - // Water temperature - @Column - @XmlElement - @DynamicSerializeElement - private Float waterTemperature; // kelvin + // Water temperature + @Column + @XmlElement + @DynamicSerializeElement + private Float waterTemperature; // kelvin - // Battery voltage - @Column - @XmlElement - @DynamicSerializeElement - private Float voltageBattery; // volt + // Battery voltage + @Column + @XmlElement + @DynamicSerializeElement + private Float voltageBattery; // volt - // Water conductance - @Column - @XmlElement - @DynamicSerializeElement - private Float waterConductance; // umhos/cm + // Water conductance + @Column + @XmlElement + @DynamicSerializeElement + private Float waterConductance; // umhos/cm - // Water oxygen - @Column - @XmlElement - @DynamicSerializeElement - private Float waterOxygen; // mg/l + // Water oxygen + @Column + @XmlElement + @DynamicSerializeElement + private Float waterOxygen; // mg/l - // Water PH - @Column - @XmlElement - @DynamicSerializeElement - private Float waterPH; // pH + // Water PH + @Column + @XmlElement + @DynamicSerializeElement + private Float waterPH; // pH - // Relative humidity - @Column - @XmlElement - @DynamicSerializeElement - private Float relHumidity; + // Relative humidity + @Column + @XmlElement + @DynamicSerializeElement + private Float relHumidity; - // River stage & flow - time of last change (ALERT) - @Column - @XmlElement - @DynamicSerializeElement - private Double riverReportChangeTime; // seconds since 1970-1-1 00:00:00.0 + // River stage & flow - time of last change (ALERT) + @Column + @XmlElement + @DynamicSerializeElement + private Double riverReportChangeTime; // seconds since 1970-1-1 00:00:00.0 - // Observation air temperature in degrees Kelvin. - @Column - @DynamicSerializeElement - @XmlElement - private Float temperature; + // Observation air temperature in degrees Kelvin. + @Column + @DynamicSerializeElement + @XmlElement + private Float temperature; - // Observation dewpoint temperature in degrees Kelvin. - @Column - @DynamicSerializeElement - @XmlElement - private Float dewpoint; + // Observation dewpoint temperature in degrees Kelvin. + @Column + @DynamicSerializeElement + @XmlElement + private Float dewpoint; - // Observation wind direction in angular degrees. - @Column - @DynamicSerializeElement - @XmlElement - private Float windDir; + // Observation wind direction in angular degrees. + @Column + @DynamicSerializeElement + @XmlElement + private Float windDir; - // Observation wind speed in meters per second. - @Column - @DynamicSerializeElement - @XmlElement - private Float windSpeed; + // Observation wind speed in meters per second. + @Column + @DynamicSerializeElement + @XmlElement + private Float windSpeed; - // Wind speed peak - @Column - @XmlElement - @DynamicSerializeElement - private Float windSpeedPeak; + // Wind speed peak + @Column + @XmlElement + @DynamicSerializeElement + private Float windSpeedPeak; - // Observation wind gust in meters per second. - @Column - @DynamicSerializeElement - @XmlElement - private Double windGust; + // Observation wind gust in meters per second. + @Column + @DynamicSerializeElement + @XmlElement + private Double windGust; - // precip accumulation with an unknown time period in mm. - @Column - @DynamicSerializeElement - @XmlElement - private Float precipAccum; // mm + // precip accumulation with an unknown time period in mm. + @Column + @DynamicSerializeElement + @XmlElement + private Float precipAccum; // mm - // 5 minute precip accumulation - @Column - @DynamicSerializeElement - @XmlElement - private Float precip5min; // mm + // 5 minute precip accumulation + @Column + @DynamicSerializeElement + @XmlElement + private Float precip5min; // mm - // 1 hour precip accumulation - @Column - @DynamicSerializeElement - @XmlElement - private Float precip1hr; // mm + // 1 hour precip accumulation + @Column + @DynamicSerializeElement + @XmlElement + private Float precip1hr; // mm - // 3 hour precip accumulation - @Column - @DynamicSerializeElement - @XmlElement - private Float precip3hr; // float precip3hr mm + // 3 hour precip accumulation + @Column + @DynamicSerializeElement + @XmlElement + private Float precip3hr; // float precip3hr mm - // 6 hour precip accumulation - @Column - @DynamicSerializeElement - @XmlElement - private Float precip6hr; // float precip6hr mm + // 6 hour precip accumulation + @Column + @DynamicSerializeElement + @XmlElement + private Float precip6hr; // float precip6hr mm - // 12 hour precip accumulation mm - @Column - @XmlElement - @DynamicSerializeElement - private Float precip12hr; + // 12 hour precip accumulation mm + @Column + @XmlElement + @DynamicSerializeElement + private Float precip12hr; - // 18 hour precip accumulation mm - @Column - @XmlElement - @DynamicSerializeElement - private Float precip18hr; + // 18 hour precip accumulation mm + @Column + @XmlElement + @DynamicSerializeElement + private Float precip18hr; - // 24 hour precip accumulation - @Column - @DynamicSerializeElement - @XmlElement - private Float precip24hr; // mm + // 24 hour precip accumulation + @Column + @DynamicSerializeElement + @XmlElement + private Float precip24hr; // mm - // Raw text LDAD hydro report - @Column - @DynamicSerializeElement - @XmlElement - private String rawMessage; + // Raw text LDAD hydro report + @Column + @DynamicSerializeElement + @XmlElement + private String rawMessage; - private PointDataView pointDataView; + private PointDataView pointDataView; - /** + /** * */ - public HydroLdadRecord() { - } + public HydroLdadRecord() { + } - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - */ - public HydroLdadRecord(String uri) { - super(uri); - } + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + */ + public HydroLdadRecord(String uri) { + super(uri); + } - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } - /** - * @return the location - */ - public SurfaceObsLocation getLocation() { - return location; - } + /** + * @return the location + */ + public SurfaceObsLocation getLocation() { + return location; + } - /** - * @param location - * the location to set - */ - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } + /** + * @param location + * the location to set + */ + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } - /** - * @return the timeObs - */ - public Calendar getObservationTime() { - return observationTime; - } + /** + * @return the timeObs + */ + public Calendar getObservationTime() { + return observationTime; + } - /** - * @param observationTime - * the observationTime to set - */ - public void setObservationTime(Calendar timeObs) { - this.observationTime = timeObs; - } + /** + * @param observationTime + * the observationTime to set + */ + public void setObservationTime(Calendar timeObs) { + this.observationTime = timeObs; + } - /** - * @return the windSpeed - */ - public Float getWindSpeed() { - return windSpeed; - } + /** + * @return the windSpeed + */ + public Float getWindSpeed() { + return windSpeed; + } - /** - * @param windSpeed - * the windSpeed to set - */ - public void setWindSpeed(Float windSpeed) { - this.windSpeed = windSpeed; - } + /** + * @param windSpeed + * the windSpeed to set + */ + public void setWindSpeed(Float windSpeed) { + this.windSpeed = windSpeed; + } - /** - * @return the windGust - */ - public Double getWindGust() { - return windGust; - } + /** + * @return the windGust + */ + public Double getWindGust() { + return windGust; + } - /** - * @param windGust - * the windGust to set - */ - public void setWindGust(Double windGust) { - this.windGust = windGust; - } + /** + * @param windGust + * the windGust to set + */ + public void setWindGust(Double windGust) { + this.windGust = windGust; + } - /** + /** * */ - public void setSpatialObject(SurfaceObsLocation loc) { - location = loc; - } + public void setSpatialObject(SurfaceObsLocation loc) { + location = loc; + } - /** + /** * */ - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } - /** - * This class implements IDecoderGettable so return this instance. - * - * @return The reference to this instance. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return this; - } + /** + * This class implements IDecoderGettable so return this instance. + * + * @return The reference to this instance. + */ + @Override + public IDecoderGettable getDecoderGettable() { + return this; + } - /** + /** * */ - @Override - public String getString(String paramName) { - String retValue = null; - String pName = PARM_MAP.get(paramName); - if ("STA".matches(pName)) { - retValue = getStationId(); - } else if (OBS_TEXT.equals(pName)) { - retValue = getStationId(); - } + @Override + public String getString(String paramName) { + String retValue = null; + String pName = PARM_MAP.get(paramName); + if ("STA".matches(pName)) { + retValue = getStationId(); + } else if (OBS_TEXT.equals(pName)) { + retValue = getStationId(); + } - return retValue; - } + return retValue; + } - @Override - public String[] getStrings(String paramName) { - return null; - } + @Override + public String[] getStrings(String paramName) { + return null; + } - @Override - public Amount getValue(String paramName) { - Amount a = null; - String pName = PARM_MAP.get(paramName); + @Override + public Amount getValue(String paramName) { + Amount a = null; + String pName = PARM_MAP.get(paramName); - if (SFC_TEMP.equals(pName)) { - a = new Amount(temperature, TEMPERATURE_UNIT); - } else if (SFC_DWPT.equals(pName)) { - a = new Amount(dewpoint, TEMPERATURE_UNIT); - } else if (SFC_WNDSPD.equals(pName)) { - a = new Amount(windSpeed, WIND_SPEED_UNIT); - } else if (SFC_WNDGST.equals(pName)) { - a = new Amount(windGust, WIND_SPEED_UNIT); - } else if (SFC_WNDDIR.equals(pName)) { - a = new Amount(windDir, WIND_DIR_UNIT); - } else if (STA_LAT.equals(pName)) { - a = new Amount(getLatitude(), LOCATION_UNIT); - } else if (STA_LON.equals(pName)) { - a = new Amount(getLongitude(), LOCATION_UNIT); - } + if (SFC_TEMP.equals(pName)) { + a = new Amount(temperature, TEMPERATURE_UNIT); + } else if (SFC_DWPT.equals(pName)) { + a = new Amount(dewpoint, TEMPERATURE_UNIT); + } else if (SFC_WNDSPD.equals(pName)) { + a = new Amount(windSpeed, WIND_SPEED_UNIT); + } else if (SFC_WNDGST.equals(pName)) { + a = new Amount(windGust, WIND_SPEED_UNIT); + } else if (SFC_WNDDIR.equals(pName)) { + a = new Amount(windDir, WIND_DIR_UNIT); + } else if (STA_LAT.equals(pName)) { + a = new Amount(getLatitude(), LOCATION_UNIT); + } else if (STA_LON.equals(pName)) { + a = new Amount(getLongitude(), LOCATION_UNIT); + } - return a; - } + return a; + } - /** + /** * */ - @Override - public Collection getValues(String paramName) { - return null; - } - - /** - * @param providerId - * the providerId to set - */ - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - /** - * @return the providerId - */ - public String getProviderId() { - return providerId; - } - - /** - * @param stationName - * the stationName to set - */ - public void setStationName(String stationName) { - this.stationName = stationName; - } - - /** - * @return the stationName - */ - public String getStationName() { - return stationName; - } - - /** - * @param handbook5Id - * the handbook5Id to set - */ - public void setHandbook5Id(String handbook5Id) { - this.handbook5Id = handbook5Id; - } - - /** - * @return the handbook5Id - */ - public String getHandbook5Id() { - return handbook5Id; - } - - /** - * @param homeWFO - * the homeWFO to set - */ - public void setHomeWFO(String homeWFO) { - this.homeWFO = homeWFO; - } - - /** - * @return the homeWFO - */ - public String getHomeWFO() { - return homeWFO; - } - - /** - * @param stationType - * the stationType to set - */ - public void setStationType(String stationType) { - this.stationType = stationType; - } - - /** - * @return the stationType - */ - public String getStationType() { - return stationType; - } - - /** - * @param dataProvider - * the dataProvider to set - */ - public void setDataProvider(String dataProvider) { - this.dataProvider = dataProvider; - } - - /** - * @return the dataProvider - */ - public String getDataProvider() { - return dataProvider; - } - - /** - * @param receivedTime - * the receivedTime to set - */ - public void setReceivedTime(Double receivedTime) { - this.receivedTime = receivedTime; - } - - /** - * @return the receivedTime - */ - public Double getReceivedTime() { - return receivedTime; - } - - /** - * @param belowSurface - * the belowSurface to set - */ - public void setBelowSurface(Float belowSurface) { - this.belowSurface = belowSurface; - } - - /** - * @return the belowSurface - */ - public Float getBelowSurface() { - return belowSurface; - } - - /** - * @param riverStage - * the riverStage to set - */ - public void setRiverStage(Float riverStage) { - this.riverStage = riverStage; - } - - /** - * @return the riverStage - */ - public Float getRiverStage() { - return riverStage; - } - - /** - * @param poolElevation - * the poolElevation to set - */ - public void setPoolElevation(Float poolElevation) { - this.poolElevation = poolElevation; - } - - /** - * @return the poolElevation - */ - public Float getPoolElevation() { - return poolElevation; - } - - /** - * @param tailwaterStage - * the tailwaterStage to set - */ - public void setTailwaterStage(Float tailwaterStage) { - this.tailwaterStage = tailwaterStage; - } - - /** - * @return the tailwaterStage - */ - public Float getTailwaterStage() { - return tailwaterStage; - } - - /** - * @param riverVelocity - * the riverVelocity to set - */ - public void setRiverVelocity(Float riverVelocity) { - this.riverVelocity = riverVelocity; - } - - /** - * @return the riverVelocity - */ - public Float getRiverVelocity() { - return riverVelocity; - } - - /** - * @param riverInflow - * the riverInflow to set - */ - public void setRiverInflow(Float riverInflow) { - this.riverInflow = riverInflow; - } - - /** - * @return the riverInflow - */ - public Float getRiverInflow() { - return riverInflow; - } - - /** - * @param riverFlow - * the riverFlow to set - */ - public void setRiverFlow(Float riverFlow) { - this.riverFlow = riverFlow; - } - - /** - * @return the riverFlow - */ - public Float getRiverFlow() { - return riverFlow; - } - - /** - * @param computedOutflow - * the computedOutflow to set - */ - public void setComputedOutflow(Float computedOutflow) { - this.computedOutflow = computedOutflow; - } - - /** - * @return the computedOutflow - */ - public Float getComputedOutflow() { - return computedOutflow; - } - - /** - * @param waterTemperature - * the waterTemperature to set - */ - public void setWaterTemperature(Float waterTemperature) { - this.waterTemperature = waterTemperature; - } - - /** - * @return the waterTemperature - */ - public Float getWaterTemperature() { - return waterTemperature; - } - - /** - * @param voltageBattery - * the voltageBattery to set - */ - public void setVoltageBattery(Float voltageBattery) { - this.voltageBattery = voltageBattery; - } - - /** - * @return the voltageBattery - */ - public Float getVoltageBattery() { - return voltageBattery; - } - - /** - * @param waterConductance - * the waterConductance to set - */ - public void setWaterConductance(Float waterConductance) { - this.waterConductance = waterConductance; - } - - /** - * @return the waterConductance - */ - public Float getWaterConductance() { - return waterConductance; - } - - /** - * @param waterOxygen - * the waterOxygen to set - */ - public void setWaterOxygen(Float waterOxygen) { - this.waterOxygen = waterOxygen; - } - - /** - * @return the waterOxygen - */ - public Float getWaterOxygen() { - return waterOxygen; - } - - /** - * @param waterPH - * the waterPH to set - */ - public void setWaterPH(Float waterPH) { - this.waterPH = waterPH; - } - - /** - * @return the waterPH - */ - public Float getWaterPH() { - return waterPH; - } - - /** - * @param riverReportChangeTime - * the riverReportChangeTime to set - */ - public void setRiverReportChangeTime(Double riverReportChangeTime) { - this.riverReportChangeTime = riverReportChangeTime; - } - - /** - * @return the riverReportChangeTime - */ - public Double getRiverReportChangeTime() { - return riverReportChangeTime; - } - - /** - * @param precip12hr - * the precip12hr to set - */ - public void setPrecip12hr(Float precip12hr) { - this.precip12hr = precip12hr; - } - - /** - * @return the precip12hr - */ - public Float getPrecip12hr() { - return precip12hr; - } - - /** - * @param precip18hr - * the precip18hr to set - */ - public void setPrecip18hr(Float precip18hr) { - this.precip18hr = precip18hr; - } - - /** - * @return the precip18hr - */ - public Float getPrecip18hr() { - return precip18hr; - } - - /** - * @param temperature - * the temperature to set - */ - public void setTemperature(Float temperature) { - this.temperature = temperature; - } - - /** - * @return the temperature - */ - public Float getTemperature() { - return temperature; - } - - /** - * @param dewpoint - * the dewpoint to set - */ - public void setDewpoint(Float dewpoint) { - this.dewpoint = dewpoint; - } - - /** - * @return the dewpoint - */ - public Float getDewpoint() { - return dewpoint; - } - - /** - * @param windDir - * the windDir to set - */ - public void setWindDir(Float windDir) { - this.windDir = windDir; - } - - /** - * @return the windDir - */ - public Float getWindDir() { - return windDir; - } - - /** - * @param windSpeedPeak - * the windSpeedPeak to set - */ - public void setWindSpeedPeak(Float windSpeedPeak) { - this.windSpeedPeak = windSpeedPeak; - } - - /** - * @return the windSpeedPeak - */ - public Float getWindSpeedPeak() { - return windSpeedPeak; - } - - /** - * @param precipAccum - * the precipAccum to set - */ - public void setPrecipAccum(Float precipAccum) { - this.precipAccum = precipAccum; - } - - /** - * @return the precipAccum - */ - public Float getPrecipAccum() { - return precipAccum; - } - - /** - * @param precip5min - * the precip5min to set - */ - public void setPrecip5min(Float precip5min) { - this.precip5min = precip5min; - } - - /** - * @return the precip5min - */ - public Float getPrecip5min() { - return precip5min; - } - - /** - * @param precip1hr - * the precip1hr to set - */ - public void setPrecip1hr(Float precip1hr) { - this.precip1hr = precip1hr; - } - - /** - * @return the precip1hr - */ - public Float getPrecip1hr() { - return precip1hr; - } - - /** - * @param precip3hr - * the precip3hr to set - */ - public void setPrecip3hr(Float precip3hr) { - this.precip3hr = precip3hr; - } - - /** - * @return the precip3hr - */ - public Float getPrecip3hr() { - return precip3hr; - } - - /** - * @param precip6hr - * the precip6hr to set - */ - public void setPrecip6hr(Float precip6hr) { - this.precip6hr = precip6hr; - } - - /** - * @return the precip6hr - */ - public Float getPrecip6hr() { - return precip6hr; - } - - /** - * @param precip24hr - * the precip24hr to set - */ - public void setPrecip24hr(Float precip24hr) { - this.precip24hr = precip24hr; - } - - /** - * @return the precip24hr - */ - public Float getPrecip24hr() { - return precip24hr; - } - - /** - * @param rawMessage - * the rawMessage to set - */ - public void setRawMessage(String rawMessage) { - this.rawMessage = rawMessage; - } - - /** - * @return the rawMessage - */ - public String getRawMessage() { - return rawMessage; - } - - /** - * @param relHumidity - * the relHumidity to set - */ - public void setRelHumidity(Float relHumidity) { - this.relHumidity = relHumidity; - } - - /** - * @return the relHumidity - */ - public Float getRelHumidity() { - return relHumidity; - } - - /** - * @param numericWMOid - * the numericWMOid to set - */ - public void setNumericWMOid(long numericWMOid) { - this.numericWMOid = numericWMOid; - } - - /** - * @return the numericWMOid - */ - public long getNumericWMOid() { - return numericWMOid; - } - - /** - * @param l - * the reportTime to set - */ - public void setReportTime(long l) { - this.reportTime = l; - } - - /** - * @return the reportTime - */ - public Double getReportTime() { - return reportTime; - } - - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - - } - - /** - * @return the pointDataView - */ - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } + @Override + public Collection getValues(String paramName) { + return null; + } + + /** + * @param providerId + * the providerId to set + */ + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + /** + * @return the providerId + */ + public String getProviderId() { + return providerId; + } + + /** + * @param stationName + * the stationName to set + */ + public void setStationName(String stationName) { + this.stationName = stationName; + } + + /** + * @return the stationName + */ + public String getStationName() { + return stationName; + } + + /** + * @param handbook5Id + * the handbook5Id to set + */ + public void setHandbook5Id(String handbook5Id) { + this.handbook5Id = handbook5Id; + } + + /** + * @return the handbook5Id + */ + public String getHandbook5Id() { + return handbook5Id; + } + + /** + * @param homeWFO + * the homeWFO to set + */ + public void setHomeWFO(String homeWFO) { + this.homeWFO = homeWFO; + } + + /** + * @return the homeWFO + */ + public String getHomeWFO() { + return homeWFO; + } + + /** + * @param stationType + * the stationType to set + */ + public void setStationType(String stationType) { + this.stationType = stationType; + } + + /** + * @return the stationType + */ + public String getStationType() { + return stationType; + } + + /** + * @param dataProvider + * the dataProvider to set + */ + public void setDataProvider(String dataProvider) { + this.dataProvider = dataProvider; + } + + /** + * @return the dataProvider + */ + public String getDataProvider() { + return dataProvider; + } + + /** + * @param receivedTime + * the receivedTime to set + */ + public void setReceivedTime(Double receivedTime) { + this.receivedTime = receivedTime; + } + + /** + * @return the receivedTime + */ + public Double getReceivedTime() { + return receivedTime; + } + + /** + * @param belowSurface + * the belowSurface to set + */ + public void setBelowSurface(Float belowSurface) { + this.belowSurface = belowSurface; + } + + /** + * @return the belowSurface + */ + public Float getBelowSurface() { + return belowSurface; + } + + /** + * @param riverStage + * the riverStage to set + */ + public void setRiverStage(Float riverStage) { + this.riverStage = riverStage; + } + + /** + * @return the riverStage + */ + public Float getRiverStage() { + return riverStage; + } + + /** + * @param poolElevation + * the poolElevation to set + */ + public void setPoolElevation(Float poolElevation) { + this.poolElevation = poolElevation; + } + + /** + * @return the poolElevation + */ + public Float getPoolElevation() { + return poolElevation; + } + + /** + * @param tailwaterStage + * the tailwaterStage to set + */ + public void setTailwaterStage(Float tailwaterStage) { + this.tailwaterStage = tailwaterStage; + } + + /** + * @return the tailwaterStage + */ + public Float getTailwaterStage() { + return tailwaterStage; + } + + /** + * @param riverVelocity + * the riverVelocity to set + */ + public void setRiverVelocity(Float riverVelocity) { + this.riverVelocity = riverVelocity; + } + + /** + * @return the riverVelocity + */ + public Float getRiverVelocity() { + return riverVelocity; + } + + /** + * @param riverInflow + * the riverInflow to set + */ + public void setRiverInflow(Float riverInflow) { + this.riverInflow = riverInflow; + } + + /** + * @return the riverInflow + */ + public Float getRiverInflow() { + return riverInflow; + } + + /** + * @param riverFlow + * the riverFlow to set + */ + public void setRiverFlow(Float riverFlow) { + this.riverFlow = riverFlow; + } + + /** + * @return the riverFlow + */ + public Float getRiverFlow() { + return riverFlow; + } + + /** + * @param computedOutflow + * the computedOutflow to set + */ + public void setComputedOutflow(Float computedOutflow) { + this.computedOutflow = computedOutflow; + } + + /** + * @return the computedOutflow + */ + public Float getComputedOutflow() { + return computedOutflow; + } + + /** + * @param waterTemperature + * the waterTemperature to set + */ + public void setWaterTemperature(Float waterTemperature) { + this.waterTemperature = waterTemperature; + } + + /** + * @return the waterTemperature + */ + public Float getWaterTemperature() { + return waterTemperature; + } + + /** + * @param voltageBattery + * the voltageBattery to set + */ + public void setVoltageBattery(Float voltageBattery) { + this.voltageBattery = voltageBattery; + } + + /** + * @return the voltageBattery + */ + public Float getVoltageBattery() { + return voltageBattery; + } + + /** + * @param waterConductance + * the waterConductance to set + */ + public void setWaterConductance(Float waterConductance) { + this.waterConductance = waterConductance; + } + + /** + * @return the waterConductance + */ + public Float getWaterConductance() { + return waterConductance; + } + + /** + * @param waterOxygen + * the waterOxygen to set + */ + public void setWaterOxygen(Float waterOxygen) { + this.waterOxygen = waterOxygen; + } + + /** + * @return the waterOxygen + */ + public Float getWaterOxygen() { + return waterOxygen; + } + + /** + * @param waterPH + * the waterPH to set + */ + public void setWaterPH(Float waterPH) { + this.waterPH = waterPH; + } + + /** + * @return the waterPH + */ + public Float getWaterPH() { + return waterPH; + } + + /** + * @param riverReportChangeTime + * the riverReportChangeTime to set + */ + public void setRiverReportChangeTime(Double riverReportChangeTime) { + this.riverReportChangeTime = riverReportChangeTime; + } + + /** + * @return the riverReportChangeTime + */ + public Double getRiverReportChangeTime() { + return riverReportChangeTime; + } + + /** + * @param precip12hr + * the precip12hr to set + */ + public void setPrecip12hr(Float precip12hr) { + this.precip12hr = precip12hr; + } + + /** + * @return the precip12hr + */ + public Float getPrecip12hr() { + return precip12hr; + } + + /** + * @param precip18hr + * the precip18hr to set + */ + public void setPrecip18hr(Float precip18hr) { + this.precip18hr = precip18hr; + } + + /** + * @return the precip18hr + */ + public Float getPrecip18hr() { + return precip18hr; + } + + /** + * @param temperature + * the temperature to set + */ + public void setTemperature(Float temperature) { + this.temperature = temperature; + } + + /** + * @return the temperature + */ + public Float getTemperature() { + return temperature; + } + + /** + * @param dewpoint + * the dewpoint to set + */ + public void setDewpoint(Float dewpoint) { + this.dewpoint = dewpoint; + } + + /** + * @return the dewpoint + */ + public Float getDewpoint() { + return dewpoint; + } + + /** + * @param windDir + * the windDir to set + */ + public void setWindDir(Float windDir) { + this.windDir = windDir; + } + + /** + * @return the windDir + */ + public Float getWindDir() { + return windDir; + } + + /** + * @param windSpeedPeak + * the windSpeedPeak to set + */ + public void setWindSpeedPeak(Float windSpeedPeak) { + this.windSpeedPeak = windSpeedPeak; + } + + /** + * @return the windSpeedPeak + */ + public Float getWindSpeedPeak() { + return windSpeedPeak; + } + + /** + * @param precipAccum + * the precipAccum to set + */ + public void setPrecipAccum(Float precipAccum) { + this.precipAccum = precipAccum; + } + + /** + * @return the precipAccum + */ + public Float getPrecipAccum() { + return precipAccum; + } + + /** + * @param precip5min + * the precip5min to set + */ + public void setPrecip5min(Float precip5min) { + this.precip5min = precip5min; + } + + /** + * @return the precip5min + */ + public Float getPrecip5min() { + return precip5min; + } + + /** + * @param precip1hr + * the precip1hr to set + */ + public void setPrecip1hr(Float precip1hr) { + this.precip1hr = precip1hr; + } + + /** + * @return the precip1hr + */ + public Float getPrecip1hr() { + return precip1hr; + } + + /** + * @param precip3hr + * the precip3hr to set + */ + public void setPrecip3hr(Float precip3hr) { + this.precip3hr = precip3hr; + } + + /** + * @return the precip3hr + */ + public Float getPrecip3hr() { + return precip3hr; + } + + /** + * @param precip6hr + * the precip6hr to set + */ + public void setPrecip6hr(Float precip6hr) { + this.precip6hr = precip6hr; + } + + /** + * @return the precip6hr + */ + public Float getPrecip6hr() { + return precip6hr; + } + + /** + * @param precip24hr + * the precip24hr to set + */ + public void setPrecip24hr(Float precip24hr) { + this.precip24hr = precip24hr; + } + + /** + * @return the precip24hr + */ + public Float getPrecip24hr() { + return precip24hr; + } + + /** + * @param rawMessage + * the rawMessage to set + */ + public void setRawMessage(String rawMessage) { + this.rawMessage = rawMessage; + } + + /** + * @return the rawMessage + */ + public String getRawMessage() { + return rawMessage; + } + + /** + * @param relHumidity + * the relHumidity to set + */ + public void setRelHumidity(Float relHumidity) { + this.relHumidity = relHumidity; + } + + /** + * @return the relHumidity + */ + public Float getRelHumidity() { + return relHumidity; + } + + /** + * @param numericWMOid + * the numericWMOid to set + */ + public void setNumericWMOid(long numericWMOid) { + this.numericWMOid = numericWMOid; + } + + /** + * @return the numericWMOid + */ + public long getNumericWMOid() { + return numericWMOid; + } + + /** + * @param l + * the reportTime to set + */ + public void setReportTime(long l) { + this.reportTime = l; + } + + /** + * @return the reportTime + */ + public Double getReportTime() { + return reportTime; + } + + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + + } + + /** + * @return the pointDataView + */ + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "ldadhydro"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.ldadmesonet/src/com/raytheon/uf/common/dataplugin/ldadmesonet/LdadmesonetPointDataTransform.java b/edexOsgi/com.raytheon.uf.common.dataplugin.ldadmesonet/src/com/raytheon/uf/common/dataplugin/ldadmesonet/LdadmesonetPointDataTransform.java index b075a2479f..ed82b06a2f 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.ldadmesonet/src/com/raytheon/uf/common/dataplugin/ldadmesonet/LdadmesonetPointDataTransform.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.ldadmesonet/src/com/raytheon/uf/common/dataplugin/ldadmesonet/LdadmesonetPointDataTransform.java @@ -25,9 +25,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.ldadmesonet.dao.LdadMesonetDao; import com.raytheon.uf.common.pointdata.PointDataContainer; @@ -44,7 +41,8 @@ import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 10/09/09 DR2814 vkorolev Initial creation + * Oct 09, 2009 DR2814 vkorolev Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -53,108 +51,173 @@ import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; */ public class LdadmesonetPointDataTransform { - - private Log logger = LogFactory.getLog(getClass()); - + private LdadMesonetDao dao; private PointDataDescription description; - //------------------Common params (From OBS plugin)---------------------------- - private static final String PRESS_CHANGE3_HOUR = "pressChange3Hour"; + + // ------------------Common params (From OBS + // plugin)---------------------------- + private static final String PRESS_CHANGE3_HOUR = "pressChange3Hour"; + private static final String PRESS_CHANGE_CHAR = "pressChangeChar"; + private static final String ALTIMETER = "altimeter"; + private static final String WIND_GUST = "windGust"; + private static final String WIND_SPEED = "windSpeed"; + private static final String DEWPOINT = "dewpoint"; + private static final String TEMPERATURE = "temperature"; + private static final String PRES_WEATHER = "presWeather"; + private static final String VISIBILITY = "visibility"; + private static final String LONGITUDE = "longitude"; + private static final String LATITUDE = "latitude"; - private static final String ELEVATION = "elevation"; + + private static final String ELEVATION = "elevation"; + private static final String STATION_NAME = "stationName"; + private static final String DATAURI = "dataURI"; - //------------------From LDAD mesonet netCDF------------------------ + + // ------------------From LDAD mesonet netCDF------------------------ private static final String STORAGE_TYPE = "storageType"; + private static final String STATION_ID = "stationId"; + private static final String DATA_PROVIDER = "dataProvider"; + private static final String HOME_WFO = "homeWFO"; + private static final String OBSERVATION_TIME = "observationTime"; + private static final String PROVIDER_ID = "providerId"; + private static final String HANDBOOK5_ID = "handbook5Id"; + private static final String STATION_TYPE = "stationType"; + private static final String REPORT_TIME = "reportTime"; + private static final String RECEIVED_TIME = "receivedTime"; + private static final String NUMERICAL_WMO_ID = "numericWMOid"; + private static final String DATA_PLATFORM_TYPE = "dataPlatformType"; + private static final String PLATFORM_TRUE_DIRECTION = "platformTrueDirection"; + private static final String PLARFORM_TRUE_SPEED = "platformTrueSpeed"; + private static final String TEMP_CHANGE_TIME = "tempChangeTime"; + private static final String WET_BULB_TEMPERATURE = "wetBulbTemperature"; + private static final String RH_CHANGE_TIME = "rhChangeTime"; + private static final String STATION_PRESSURE = "stationPressure"; + private static final String STATION_PRESS_CHANGE_TIME = "stationPressChangeTime"; + private static final String WIND_DIR_CHANGE_TIME = "windDirChangeTime"; + private static final String WIND_SPEED_CHANGE_TIME = "windSpeedChangeTime"; + private static final String WIND_GUST_CHANGE_TIME = "windGustChangeTime"; + private static final String WIND_DIR_MIN = "windDirMin"; + private static final String WIND_DIR_MAX = "windDirMax"; + private static final String VISIBILITY_STATUS = "visibilityStatus"; + private static final String TOTAL_CLOUD_COVER = "totalCloudCover"; + private static final String CLOUD_BASE_HEIGHT = "cloudBaseHeight"; + private static final String LOW_LEVEL_CLOUD_TYPE = "lowLevelCloudType"; + private static final String MID_LEVEL_CLOUD_TYPE = "midLevelCloudType"; + private static final String HIGH_LEVEL_CLOUD_TYPE = "highLevelCloudType"; + private static final String MAX_TEMP_RECORD_PERIOD = "maxTempRecordPeriod"; + private static final String MAXIMUM_TEMPERATURE = "maximumTemperature"; + private static final String MIN_TEMP_RECORD_PERIOD = "minTempRecordPeriod"; + private static final String MINIMUM_TEMPERATURE = "minimumTemperature"; + private static final String PRECIP_ACCUM = "precipAccum"; + private static final String PRECIP_TYPE = "precipType"; + private static final String PRECIP_INTENSITY = "precipIntensity"; + private static final String TIME_SINCE_LAST_PCP = "timeSinceLastPcp"; + private static final String SOLAR_RADIATION = "solarRadiation"; + private static final String SOLAR_RAD_CHANGE_TIME = "solarRadChangeTime"; + private static final String SEA_SURFACE_TEMP = "seaSurfaceTemp"; + private static final String WAVE_PERIOD = "wavePeriod"; + private static final String WAVE_HEIGHT = "waveHeight"; + private static final String RAW_MESONET = "rawMessage"; + private static final String REL_HUMIDITY = "relHumidity"; + private static final String WIND_DIR = "windDir"; + private static final String PRESSURE = "pressure"; + private static final String SEA_LEVEL_PRESSURE = "seaLevelPressure"; + private static final String PRECIP_RATE = "precipRate"; + private static final String FUEL_TEMPERATURE = "fuelTemperature"; + private static final String FUEL_MOISTURE = "fuelMoisture"; + private static final String SOIL_TEMPERATURE = "soilTemperature"; + private static final String SOIL_MOISTURE = "soilMoisture"; - + /** * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! It is important to * keep this up to date or risk breaking backwards compatibility * */ private static final String[] ALL_PARAMS = { PRESS_CHANGE3_HOUR, - PRESS_CHANGE_CHAR, ALTIMETER, WIND_GUST, WIND_SPEED, DEWPOINT, + PRESS_CHANGE_CHAR, ALTIMETER, WIND_GUST, WIND_SPEED, DEWPOINT, TEMPERATURE, PRES_WEATHER, VISIBILITY, LONGITUDE, LATITUDE, SEA_LEVEL_PRESSURE, STATION_NAME, DATAURI, STORAGE_TYPE, ELEVATION, - STATION_ID, DATA_PROVIDER, HOME_WFO, OBSERVATION_TIME, PROVIDER_ID, - HANDBOOK5_ID, STATION_TYPE, REPORT_TIME, RECEIVED_TIME, - NUMERICAL_WMO_ID, DATA_PLATFORM_TYPE, PLATFORM_TRUE_DIRECTION, - PLARFORM_TRUE_SPEED, TEMP_CHANGE_TIME, WET_BULB_TEMPERATURE, - RH_CHANGE_TIME, STATION_PRESSURE, STATION_PRESS_CHANGE_TIME, - WIND_DIR_CHANGE_TIME, WIND_SPEED_CHANGE_TIME, - WIND_GUST_CHANGE_TIME, WIND_DIR_MIN, WIND_DIR_MAX, - VISIBILITY_STATUS, TOTAL_CLOUD_COVER, CLOUD_BASE_HEIGHT, - LOW_LEVEL_CLOUD_TYPE, MID_LEVEL_CLOUD_TYPE, HIGH_LEVEL_CLOUD_TYPE, - MAX_TEMP_RECORD_PERIOD, MAXIMUM_TEMPERATURE, - MIN_TEMP_RECORD_PERIOD, MINIMUM_TEMPERATURE, PRECIP_ACCUM, PRECIP_TYPE, - PRECIP_INTENSITY, TIME_SINCE_LAST_PCP, SOLAR_RADIATION, - SOLAR_RAD_CHANGE_TIME, SEA_SURFACE_TEMP, WAVE_PERIOD, WAVE_HEIGHT, - RAW_MESONET, REL_HUMIDITY, WIND_DIR, PRESSURE, SEA_LEVEL_PRESSURE, - PRECIP_RATE, FUEL_TEMPERATURE, FUEL_MOISTURE, SOIL_TEMPERATURE, - SOIL_MOISTURE - }; + STATION_ID, DATA_PROVIDER, HOME_WFO, OBSERVATION_TIME, PROVIDER_ID, + HANDBOOK5_ID, STATION_TYPE, REPORT_TIME, RECEIVED_TIME, + NUMERICAL_WMO_ID, DATA_PLATFORM_TYPE, PLATFORM_TRUE_DIRECTION, + PLARFORM_TRUE_SPEED, TEMP_CHANGE_TIME, WET_BULB_TEMPERATURE, + RH_CHANGE_TIME, STATION_PRESSURE, STATION_PRESS_CHANGE_TIME, + WIND_DIR_CHANGE_TIME, WIND_SPEED_CHANGE_TIME, + WIND_GUST_CHANGE_TIME, WIND_DIR_MIN, WIND_DIR_MAX, + VISIBILITY_STATUS, TOTAL_CLOUD_COVER, CLOUD_BASE_HEIGHT, + LOW_LEVEL_CLOUD_TYPE, MID_LEVEL_CLOUD_TYPE, HIGH_LEVEL_CLOUD_TYPE, + MAX_TEMP_RECORD_PERIOD, MAXIMUM_TEMPERATURE, + MIN_TEMP_RECORD_PERIOD, MINIMUM_TEMPERATURE, PRECIP_ACCUM, + PRECIP_TYPE, PRECIP_INTENSITY, TIME_SINCE_LAST_PCP, + SOLAR_RADIATION, SOLAR_RAD_CHANGE_TIME, SEA_SURFACE_TEMP, + WAVE_PERIOD, WAVE_HEIGHT, RAW_MESONET, REL_HUMIDITY, WIND_DIR, + PRESSURE, SEA_LEVEL_PRESSURE, PRECIP_RATE, FUEL_TEMPERATURE, + FUEL_MOISTURE, SOIL_TEMPERATURE, SOIL_MOISTURE }; public static final String ALL_PARAMS_LIST; static { @@ -192,11 +255,12 @@ public class LdadmesonetPointDataTransform { if (pdo.length > 0) { Map pointMap = new HashMap(); - + for (PluginDataObject p : pdo) { - if (!(p instanceof MesonetLdadRecord)) + if (!(p instanceof MesonetLdadRecord)) { continue; - + } + File f = this.dao.getFullFilePath(p); PointDataContainer pdc = pointMap.get(f); @@ -213,228 +277,198 @@ public class LdadmesonetPointDataTransform { return pdo; } - // private PointDataDescription getDescription(String type) - // throws JAXBException { - // InputStream is = this.getClass().getResourceAsStream( - // "/res/pointdata/" + type + ".xml"); - // if (is == null) { - // throw new RuntimeException("Cannot find descriptor for: " + type); - // } - // return PointDataDescription.fromStream(is); - // - // } - private PointDataView buildView(PointDataContainer container, - MesonetLdadRecord record) { + MesonetLdadRecord record) { PointDataView pdv = container.append(); - - -// if (record.getStationName()!=null) { -// pdv.setString(STATION_NAME, record.getStationName()); -// } - if (record.getRawMessage()!=null) { - pdv.setString(RAW_MESONET, record.getRawMessage()); - } - if (record.getSeaLevelPressure()!=null) { - pdv.setFloat(SEA_LEVEL_PRESSURE, record.getSeaLevelPressure()); - } - // if (record.getLocation()!=null) { - // pdv.setFloat(LATITUDE, (float) record.getLatitude()); - // pdv.setFloat(LONGITUDE, (float) record.getLongitude()); - // pdv.setFloat(ELEVATION, record.getElevation()); - // } - if (record.getObservationTime()!=null) { + + if (record.getRawMessage() != null) { + pdv.setString(RAW_MESONET, record.getRawMessage()); + } + if (record.getSeaLevelPressure() != null) { + pdv.setFloat(SEA_LEVEL_PRESSURE, record.getSeaLevelPressure()); + } + + if (record.getObservationTime() != null) { pdv.setLong(OBSERVATION_TIME, record.getDataTime().getRefTime() .getTime()); - } - if (record.getVisibility()!=null) { - pdv.setFloat(VISIBILITY, record.getVisibility()); - } - if (record.getTemperature()!=null) { - pdv.setFloat(TEMPERATURE, record.getTemperature()); - } - if (record.getDewpoint()!=null) { - pdv.setFloat(DEWPOINT, record.getDewpoint()); - } - if (record.getWindSpeed()!=null) { - pdv.setFloat(WIND_SPEED, record.getWindSpeed()); - } - if (record.getWindGust()!=null) { - pdv.setFloat(WIND_GUST, record.getWindGust()); - } - if (record.getAltimeter()!=null) { - pdv.setFloat(ALTIMETER, record.getAltimeter()); - } - if (record.getPressChangeChar()!=null) { - pdv.setInt(PRESS_CHANGE_CHAR, record.getPressChangeChar() - .intValue()); - } - if (record.getPressChange3Hour()!=null) { - pdv.setFloat(PRESS_CHANGE3_HOUR, record.getPressChange3Hour()); - } - //pdv.setString(DATAURI, record.getDataURI()); - -//--------------------------------------LDAD mesonet specific------------------------ - -// if (record.getDataProvider()!=null) { -// pdv.setString(DATA_PROVIDER, record.getDataProvider()); -// } -// if (record.getHomeWFO()!=null) { -// pdv.setString(HOME_WFO, record.getHomeWFO()); -// } -// if (record.getProviderId()!=null) { -// pdv.setString(PROVIDER_ID, record.getProviderId()); -// } -// if (record.getHandbook5Id()!=null) { -// pdv.setString(HANDBOOK5_ID, record.getHandbook5Id()); -// } -// if (record.getStationType()!=null) { -// pdv.setString(STATION_TYPE, record.getStationType()); -// } - if (record.getReportTime()!=null) { - pdv.setLong(REPORT_TIME, record.getReportTime()); - } - if (record.getReceivedTime()!=null) { - pdv.setLong(RECEIVED_TIME, record.getReceivedTime().longValue()); - } - if (record.getNumericWMOid()!=null) { - pdv.setLong(NUMERICAL_WMO_ID, record.getNumericWMOid()); - } - if (record.getDataPlatformType()!=null) { - pdv.setInt(DATA_PLATFORM_TYPE, record.getDataPlatformType().intValue()); - } - if (record.getPlatformTrueDirection()!=null) { - pdv.setFloat(PLATFORM_TRUE_DIRECTION, record.getPlatformTrueDirection()); - } - if (record.getPlatformTrueSpeed()!=null) { - pdv.setFloat(PLARFORM_TRUE_SPEED, record.getPlatformTrueSpeed()); - } - if (record.getTempChangeTime()!=null) { - pdv.setLong(TEMP_CHANGE_TIME, record.getTempChangeTime() - .longValue()); - } - if (record.getWetBulbTemperature()!=null) { - pdv.setFloat(WET_BULB_TEMPERATURE, record.getWetBulbTemperature()); - } - if (record.getRhChangeTime()!=null) { - pdv.setLong(RH_CHANGE_TIME, record.getRhChangeTime().longValue()); - } - if (record.getStationPressure()!=null) { - pdv.setFloat(STATION_PRESSURE, record.getStationPressure()); - } - if (record.getStationPressChangeTime()!=null) { - pdv.setLong(STATION_PRESS_CHANGE_TIME, record.getStationPressChangeTime().longValue()); - } - if (record.getWindDirChangeTime()!=null) { - pdv.setLong(WIND_DIR_CHANGE_TIME, record.getWindDirChangeTime() - .longValue()); - } - if (record.getWindSpeedChangeTime()!=null) { - pdv.setLong(WIND_SPEED_CHANGE_TIME, record.getWindSpeedChangeTime() - .longValue()); - } - if (record.getWindGustChangeTime()!=null) { - pdv.setLong(WIND_GUST_CHANGE_TIME, record.getWindGustChangeTime() - .longValue()); - } - if (record.getWindDirMin()!=null) { - pdv.setFloat(WIND_DIR_MIN, record.getWindDirMin()); - } - if (record.getWindDirMax()!=null) { - pdv.setFloat(WIND_DIR_MAX, record.getWindDirMax()); - } - if (record.getVisibilityStatus()!=null) { - pdv.setString(VISIBILITY_STATUS, record.getVisibilityStatus()); - } - if (record.getTotalCloudCover()!=null) { - pdv.setFloat(TOTAL_CLOUD_COVER, record.getTotalCloudCover()); - } - if (record.getCloudBaseHeight()!=null) { - pdv.setInt(CLOUD_BASE_HEIGHT, record.getCloudBaseHeight() - .intValue()); - } - if (record.getLowLevelCloudType()!=null) { - pdv.setInt(LOW_LEVEL_CLOUD_TYPE, record.getLowLevelCloudType() - .intValue()); - } - if (record.getMidLevelCloudType()!=null) { - pdv.setInt(MID_LEVEL_CLOUD_TYPE, record.getMidLevelCloudType() - .intValue()); - } - if (record.getHighLevelCloudType()!=null) { - pdv.setInt(HIGH_LEVEL_CLOUD_TYPE, record.getHighLevelCloudType() - .intValue()); - } - if (record.getMinTempRecordPeriod()!=null) { - pdv.setInt(MAX_TEMP_RECORD_PERIOD, record.getMinTempRecordPeriod() - .intValue()); - } - if (record.getMaximumTemperature()!=null) { - pdv.setFloat(MAXIMUM_TEMPERATURE, record.getMaximumTemperature()); - } - if (record.getMinTempRecordPeriod()!=null) { - pdv.setInt(MIN_TEMP_RECORD_PERIOD, record.getMinTempRecordPeriod() - .intValue()); - } - if (record.getMinimumTemperature()!=null) { - pdv.setFloat(MINIMUM_TEMPERATURE, record.getMinimumTemperature()); - } - if (record.getPrecipAccum()!=null) { - pdv.setFloat(PRECIP_ACCUM, record.getPrecipAccum()); - } - if (record.getPrecipType()!=null) { - pdv.setInt(PRECIP_TYPE, record.getPrecipType().intValue()); - } - if (record.getPrecipIntensity()!=null) { - pdv.setInt(PRECIP_INTENSITY, record.getPrecipIntensity().intValue()); - } - if (record.getTimeSinceLastPcp()!=null) { - pdv.setLong(TIME_SINCE_LAST_PCP, record.getTimeSinceLastPcp() - .longValue()); - } - if (record.getSolarRadiation()!=null) { - pdv.setFloat(SOLAR_RADIATION, record.getSolarRadiation()); - } - if (record.getSolarRadChangeTime()!=null) { - pdv.setLong(SOLAR_RAD_CHANGE_TIME, record.getSolarRadChangeTime().longValue()); - } - if (record.getSeaSurfaceTemp()!=null) { - pdv.setFloat(SEA_SURFACE_TEMP, record.getSeaSurfaceTemp()); - } - if (record.getWavePeriod()!=null) { - pdv.setFloat(WAVE_PERIOD, record.getWavePeriod()); - } - if (record.getWaveHeight()!=null) { - pdv.setFloat(WAVE_HEIGHT, record.getWaveHeight()); - } - if (record.getRelHumidity()!=null) { - pdv.setFloat(REL_HUMIDITY, record.getRelHumidity()); - } - if (record.getWindDir()!=null) { - pdv.setFloat(WIND_DIR, record.getWindDir()); - } - if (record.getPressure()!=null) { - pdv.setFloat(PRESSURE, record.getPressure()); - } - if (record.getSeaLevelPressure()!=null) { - pdv.setFloat(SEA_LEVEL_PRESSURE, record.getSeaLevelPressure()); - } - if (record.getPrecipRate()!=null) { - pdv.setFloat(PRECIP_RATE, record.getPrecipRate()); - } - if (record.getFuelTemperature()!=null) { - pdv.setFloat(FUEL_TEMPERATURE, record.getFuelTemperature()); - } - if (record.getFuelMoisture()!=null) { - pdv.setFloat(FUEL_MOISTURE, record.getFuelMoisture()); - } - if (record.getSoilTemperature()!=null) { - pdv.setFloat(SOIL_TEMPERATURE, record.getSoilTemperature()); - } - if (record.getSoilMoisture()!=null) { - pdv.setFloat(SOIL_MOISTURE, record.getSoilMoisture()); - } - return pdv; + } + if (record.getVisibility() != null) { + pdv.setFloat(VISIBILITY, record.getVisibility()); + } + if (record.getTemperature() != null) { + pdv.setFloat(TEMPERATURE, record.getTemperature()); + } + if (record.getDewpoint() != null) { + pdv.setFloat(DEWPOINT, record.getDewpoint()); + } + if (record.getWindSpeed() != null) { + pdv.setFloat(WIND_SPEED, record.getWindSpeed()); + } + if (record.getWindGust() != null) { + pdv.setFloat(WIND_GUST, record.getWindGust()); + } + if (record.getAltimeter() != null) { + pdv.setFloat(ALTIMETER, record.getAltimeter()); + } + if (record.getPressChangeChar() != null) { + pdv.setInt(PRESS_CHANGE_CHAR, record.getPressChangeChar() + .intValue()); + } + if (record.getPressChange3Hour() != null) { + pdv.setFloat(PRESS_CHANGE3_HOUR, record.getPressChange3Hour()); + } + + // --------------------------------------LDAD mesonet + // specific------------------------ + + if (record.getReportTime() != null) { + pdv.setLong(REPORT_TIME, record.getReportTime()); + } + if (record.getReceivedTime() != null) { + pdv.setLong(RECEIVED_TIME, record.getReceivedTime().longValue()); + } + if (record.getNumericWMOid() != null) { + pdv.setLong(NUMERICAL_WMO_ID, record.getNumericWMOid()); + } + if (record.getDataPlatformType() != null) { + pdv.setInt(DATA_PLATFORM_TYPE, record.getDataPlatformType() + .intValue()); + } + if (record.getPlatformTrueDirection() != null) { + pdv.setFloat(PLATFORM_TRUE_DIRECTION, + record.getPlatformTrueDirection()); + } + if (record.getPlatformTrueSpeed() != null) { + pdv.setFloat(PLARFORM_TRUE_SPEED, record.getPlatformTrueSpeed()); + } + if (record.getTempChangeTime() != null) { + pdv.setLong(TEMP_CHANGE_TIME, record.getTempChangeTime() + .longValue()); + } + if (record.getWetBulbTemperature() != null) { + pdv.setFloat(WET_BULB_TEMPERATURE, record.getWetBulbTemperature()); + } + if (record.getRhChangeTime() != null) { + pdv.setLong(RH_CHANGE_TIME, record.getRhChangeTime().longValue()); + } + if (record.getStationPressure() != null) { + pdv.setFloat(STATION_PRESSURE, record.getStationPressure()); + } + if (record.getStationPressChangeTime() != null) { + pdv.setLong(STATION_PRESS_CHANGE_TIME, record + .getStationPressChangeTime().longValue()); + } + if (record.getWindDirChangeTime() != null) { + pdv.setLong(WIND_DIR_CHANGE_TIME, record.getWindDirChangeTime() + .longValue()); + } + if (record.getWindSpeedChangeTime() != null) { + pdv.setLong(WIND_SPEED_CHANGE_TIME, record.getWindSpeedChangeTime() + .longValue()); + } + if (record.getWindGustChangeTime() != null) { + pdv.setLong(WIND_GUST_CHANGE_TIME, record.getWindGustChangeTime() + .longValue()); + } + if (record.getWindDirMin() != null) { + pdv.setFloat(WIND_DIR_MIN, record.getWindDirMin()); + } + if (record.getWindDirMax() != null) { + pdv.setFloat(WIND_DIR_MAX, record.getWindDirMax()); + } + if (record.getVisibilityStatus() != null) { + pdv.setString(VISIBILITY_STATUS, record.getVisibilityStatus()); + } + if (record.getTotalCloudCover() != null) { + pdv.setFloat(TOTAL_CLOUD_COVER, record.getTotalCloudCover()); + } + if (record.getCloudBaseHeight() != null) { + pdv.setInt(CLOUD_BASE_HEIGHT, record.getCloudBaseHeight() + .intValue()); + } + if (record.getLowLevelCloudType() != null) { + pdv.setInt(LOW_LEVEL_CLOUD_TYPE, record.getLowLevelCloudType() + .intValue()); + } + if (record.getMidLevelCloudType() != null) { + pdv.setInt(MID_LEVEL_CLOUD_TYPE, record.getMidLevelCloudType() + .intValue()); + } + if (record.getHighLevelCloudType() != null) { + pdv.setInt(HIGH_LEVEL_CLOUD_TYPE, record.getHighLevelCloudType() + .intValue()); + } + if (record.getMinTempRecordPeriod() != null) { + pdv.setInt(MAX_TEMP_RECORD_PERIOD, record.getMinTempRecordPeriod() + .intValue()); + } + if (record.getMaximumTemperature() != null) { + pdv.setFloat(MAXIMUM_TEMPERATURE, record.getMaximumTemperature()); + } + if (record.getMinTempRecordPeriod() != null) { + pdv.setInt(MIN_TEMP_RECORD_PERIOD, record.getMinTempRecordPeriod() + .intValue()); + } + if (record.getMinimumTemperature() != null) { + pdv.setFloat(MINIMUM_TEMPERATURE, record.getMinimumTemperature()); + } + if (record.getPrecipAccum() != null) { + pdv.setFloat(PRECIP_ACCUM, record.getPrecipAccum()); + } + if (record.getPrecipType() != null) { + pdv.setInt(PRECIP_TYPE, record.getPrecipType().intValue()); + } + if (record.getPrecipIntensity() != null) { + pdv.setInt(PRECIP_INTENSITY, record.getPrecipIntensity().intValue()); + } + if (record.getTimeSinceLastPcp() != null) { + pdv.setLong(TIME_SINCE_LAST_PCP, record.getTimeSinceLastPcp() + .longValue()); + } + if (record.getSolarRadiation() != null) { + pdv.setFloat(SOLAR_RADIATION, record.getSolarRadiation()); + } + if (record.getSolarRadChangeTime() != null) { + pdv.setLong(SOLAR_RAD_CHANGE_TIME, record.getSolarRadChangeTime() + .longValue()); + } + if (record.getSeaSurfaceTemp() != null) { + pdv.setFloat(SEA_SURFACE_TEMP, record.getSeaSurfaceTemp()); + } + if (record.getWavePeriod() != null) { + pdv.setFloat(WAVE_PERIOD, record.getWavePeriod()); + } + if (record.getWaveHeight() != null) { + pdv.setFloat(WAVE_HEIGHT, record.getWaveHeight()); + } + if (record.getRelHumidity() != null) { + pdv.setFloat(REL_HUMIDITY, record.getRelHumidity()); + } + if (record.getWindDir() != null) { + pdv.setFloat(WIND_DIR, record.getWindDir()); + } + if (record.getPressure() != null) { + pdv.setFloat(PRESSURE, record.getPressure()); + } + if (record.getSeaLevelPressure() != null) { + pdv.setFloat(SEA_LEVEL_PRESSURE, record.getSeaLevelPressure()); + } + if (record.getPrecipRate() != null) { + pdv.setFloat(PRECIP_RATE, record.getPrecipRate()); + } + if (record.getFuelTemperature() != null) { + pdv.setFloat(FUEL_TEMPERATURE, record.getFuelTemperature()); + } + if (record.getFuelMoisture() != null) { + pdv.setFloat(FUEL_MOISTURE, record.getFuelMoisture()); + } + if (record.getSoilTemperature() != null) { + pdv.setFloat(SOIL_TEMPERATURE, record.getSoilTemperature()); + } + if (record.getSoilMoisture() != null) { + pdv.setFloat(SOIL_MOISTURE, record.getSoilMoisture()); + } + return pdv; } public static MesonetLdadRecord toMesonetLdadRecord(PointDataView pdv) { @@ -445,14 +479,13 @@ public class LdadmesonetPointDataTransform { pdv.getString(STATION_ID)); Double lat = pdv.getNumber(LATITUDE).doubleValue(); Double lon = pdv.getNumber(LONGITUDE).doubleValue(); - loc.assignLocation(lat,lon); + loc.assignLocation(lat, lon); loc.setElevation(pdv.getNumber(ELEVATION).intValue()); mr.setLocation(loc); - mr.setPluginName("ldadmesonet"); mr.setReportType(pdv.getString(STORAGE_TYPE)); mr.setProviderId(pdv.getString(PROVIDER_ID)); mr.setPressChange3Hour(pdv.getNumber(PRESS_CHANGE3_HOUR).floatValue()); - mr.setPressChangeChar((short) pdv.getInt(PRESS_CHANGE_CHAR)); + mr.setPressChangeChar((short) pdv.getInt(PRESS_CHANGE_CHAR)); mr.setSeaLevelPressure(pdv.getNumber(SEA_LEVEL_PRESSURE).floatValue()); mr.setTemperature(pdv.getNumber(TEMPERATURE).floatValue()); mr.setVisibility(pdv.getNumber(VISIBILITY).floatValue()); @@ -461,50 +494,53 @@ public class LdadmesonetPointDataTransform { mr.setWindSpeed(pdv.getFloat(WIND_SPEED)); mr.setDataURI(pdv.getString(DATAURI)); mr.setReceivedTime(pdv.getNumber(RECEIVED_TIME).doubleValue()); -//---------------------------------------------------------------------------------- + // ---------------------------------------------------------------------------------- mr.setTempChangeTime(pdv.getNumber(TEMP_CHANGE_TIME).doubleValue()); - mr.setWetBulbTemperature(pdv.getFloat(WET_BULB_TEMPERATURE)); - mr.setRhChangeTime((Double) pdv.getNumber(RH_CHANGE_TIME)); - mr.setStationPressure(pdv.getFloat(STATION_PRESSURE)); - mr.setStationPressChangeTime((Double) pdv.getNumber(STATION_PRESS_CHANGE_TIME)); - mr.setWindDirChangeTime((Double) pdv.getNumber(WIND_DIR_CHANGE_TIME)); - mr.setWindSpeedChangeTime((Double) pdv.getNumber(WIND_SPEED_CHANGE_TIME)); - mr.setWindGustChangeTime((Double) pdv.getNumber(WIND_GUST_CHANGE_TIME)); + mr.setWetBulbTemperature(pdv.getFloat(WET_BULB_TEMPERATURE)); + mr.setRhChangeTime((Double) pdv.getNumber(RH_CHANGE_TIME)); + mr.setStationPressure(pdv.getFloat(STATION_PRESSURE)); + mr.setStationPressChangeTime((Double) pdv + .getNumber(STATION_PRESS_CHANGE_TIME)); + mr.setWindDirChangeTime((Double) pdv.getNumber(WIND_DIR_CHANGE_TIME)); + mr.setWindSpeedChangeTime((Double) pdv + .getNumber(WIND_SPEED_CHANGE_TIME)); + mr.setWindGustChangeTime((Double) pdv.getNumber(WIND_GUST_CHANGE_TIME)); mr.setWindDirMin(pdv.getFloat(WIND_DIR_MIN)); mr.setWindDirMax(pdv.getFloat(WIND_DIR_MAX)); - mr.setVisibilityStatus(pdv.getString(VISIBILITY_STATUS )); - mr.setTotalCloudCover(pdv.getFloat(TOTAL_CLOUD_COVER )); + mr.setVisibilityStatus(pdv.getString(VISIBILITY_STATUS)); + mr.setTotalCloudCover(pdv.getFloat(TOTAL_CLOUD_COVER)); mr.setCloudBaseHeight((Short) pdv.getNumber(CLOUD_BASE_HEIGHT)); mr.setLowLevelCloudType((Short) pdv.getNumber(LOW_LEVEL_CLOUD_TYPE)); - mr.setMidLevelCloudType((Short) pdv.getNumber(MID_LEVEL_CLOUD_TYPE )); - mr.setHighLevelCloudType((Short) pdv.getNumber(HIGH_LEVEL_CLOUD_TYPE )); - mr.setMaxTempRecordPeriod((Short) pdv.getNumber(MAX_TEMP_RECORD_PERIOD )); - mr.setMaximumTemperature(pdv.getFloat(MAXIMUM_TEMPERATURE )); - mr.setMinTempRecordPeriod((Short) pdv.getNumber(MIN_TEMP_RECORD_PERIOD )); - mr.setMaximumTemperature(pdv.getFloat(MINIMUM_TEMPERATURE )); - mr.setPrecipAccum(pdv.getFloat(PRECIP_ACCUM )); - mr.setPrecipType((Short) pdv.getNumber(PRECIP_TYPE )); - mr.setPrecipIntensity((Short) pdv.getNumber(PRECIP_INTENSITY )); - mr.setTimeSinceLastPcp((Double) pdv.getNumber(TIME_SINCE_LAST_PCP )); - mr.setSolarRadiation(pdv.getFloat(SOLAR_RADIATION )); - mr.setSolarRadChangeTime((Double) pdv.getNumber(SOLAR_RAD_CHANGE_TIME )); - mr.setSeaSurfaceTemp(pdv.getFloat(SEA_SURFACE_TEMP )); - mr.setWavePeriod(pdv.getFloat(WAVE_PERIOD )); - mr.setWaveHeight(pdv.getFloat(WAVE_HEIGHT )); + mr.setMidLevelCloudType((Short) pdv.getNumber(MID_LEVEL_CLOUD_TYPE)); + mr.setHighLevelCloudType((Short) pdv.getNumber(HIGH_LEVEL_CLOUD_TYPE)); + mr.setMaxTempRecordPeriod((Short) pdv.getNumber(MAX_TEMP_RECORD_PERIOD)); + mr.setMaximumTemperature(pdv.getFloat(MAXIMUM_TEMPERATURE)); + mr.setMinTempRecordPeriod((Short) pdv.getNumber(MIN_TEMP_RECORD_PERIOD)); + mr.setMaximumTemperature(pdv.getFloat(MINIMUM_TEMPERATURE)); + mr.setPrecipAccum(pdv.getFloat(PRECIP_ACCUM)); + mr.setPrecipType((Short) pdv.getNumber(PRECIP_TYPE)); + mr.setPrecipIntensity((Short) pdv.getNumber(PRECIP_INTENSITY)); + mr.setTimeSinceLastPcp((Double) pdv.getNumber(TIME_SINCE_LAST_PCP)); + mr.setSolarRadiation(pdv.getFloat(SOLAR_RADIATION)); + mr.setSolarRadChangeTime((Double) pdv.getNumber(SOLAR_RAD_CHANGE_TIME)); + mr.setSeaSurfaceTemp(pdv.getFloat(SEA_SURFACE_TEMP)); + mr.setWavePeriod(pdv.getFloat(WAVE_PERIOD)); + mr.setWaveHeight(pdv.getFloat(WAVE_HEIGHT)); mr.setRawMessage(pdv.getString(RAW_MESONET)); - mr.setRelHumidity(pdv.getFloat(REL_HUMIDITY)); - mr.setWindDir(pdv.getFloat(WIND_DIR )); - mr.setPressure(pdv.getFloat(PRESSURE )); - mr.setSeaLevelPressure(pdv.getFloat(SEA_LEVEL_PRESSURE )); - mr.setPrecipRate(pdv.getFloat(PRECIP_RATE )); - mr.setFuelTemperature(pdv.getFloat(FUEL_TEMPERATURE )); - mr.setFuelMoisture(pdv.getFloat(FUEL_MOISTURE )); - mr.setSoilTemperature(pdv.getFloat(SOIL_TEMPERATURE )); - mr.setSoilMoisture(pdv.getFloat(SOIL_MOISTURE )); + mr.setRelHumidity(pdv.getFloat(REL_HUMIDITY)); + mr.setWindDir(pdv.getFloat(WIND_DIR)); + mr.setPressure(pdv.getFloat(PRESSURE)); + mr.setSeaLevelPressure(pdv.getFloat(SEA_LEVEL_PRESSURE)); + mr.setPrecipRate(pdv.getFloat(PRECIP_RATE)); + mr.setFuelTemperature(pdv.getFloat(FUEL_TEMPERATURE)); + mr.setFuelMoisture(pdv.getFloat(FUEL_MOISTURE)); + mr.setSoilTemperature(pdv.getFloat(SOIL_TEMPERATURE)); + mr.setSoilMoisture(pdv.getFloat(SOIL_MOISTURE)); return mr; } - public static MesonetLdadRecord[] toMesonetLdadRecords(PointDataContainer container) { + public static MesonetLdadRecord[] toMesonetLdadRecords( + PointDataContainer container) { List records = new ArrayList(); container.setCurrentSz(container.getAllocatedSz()); for (int i = 0; i < container.getCurrentSz(); i++) { diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.ldadmesonet/src/com/raytheon/uf/common/dataplugin/ldadmesonet/MesonetLdadRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.ldadmesonet/src/com/raytheon/uf/common/dataplugin/ldadmesonet/MesonetLdadRecord.java index c8b169b277..0889f89703 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.ldadmesonet/src/com/raytheon/uf/common/dataplugin/ldadmesonet/MesonetLdadRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.ldadmesonet/src/com/raytheon/uf/common/dataplugin/ldadmesonet/MesonetLdadRecord.java @@ -60,6 +60,7 @@ import com.vividsolutions.jts.geom.Geometry; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * May 15, 2013 1869 bsteffen Remove DataURI column from ldadmesonet. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -76,1590 +77,1590 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ldadmesonet", - indexes = { - @Index(name = "ldadmesonet_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ldadmesonet", indexes = { @Index(name = "ldadmesonet_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class MesonetLdadRecord extends PersistablePluginDataObject implements ISpatialEnabled, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; private static final String OBS_TIME_FMT = "%1$tY/% * @@ -86,475 +88,477 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "lsr", - indexes = { - @Index(name = "lsr_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "lsr", indexes = { @Index(name = "lsr_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class LocalStormReport extends PersistablePluginDataObject implements - ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { - - private static final long serialVersionUID = 1L; - - private static final int MISSING = -9999; - - public static final Unit TEMPERATURE_UNIT = SI.KELVIN; - - public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; - - public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; - - public static final Unit PRESSURE_UNIT = SI.PASCAL; - - public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; - - public static final Unit WAVE_UNIT = SI.METER; - - public static final Unit VISIBILITY_UNIT = NonSI.MILE; - - public static final Unit CLOUD_COVER = NonSI.OCTET; - - // - @DataURI(position = 1) - @Column - @XmlElement - @DynamicSerializeElement - private LSREventType eventType; - - // Correction indicator from wmo header - @DataURI(position = 2) - @Column - @XmlElement - @DynamicSerializeElement - private String corIndicator; - - @Embedded - @DataURI(position = 3, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; - - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - // Text of the WMO header - @Transient - @XmlElement - @DynamicSerializeElement - private String wmoHeader = ""; - - // Text of the office - @XmlElement - @DynamicSerializeElement - private String officeid = ""; - - // - @Transient - @XmlElement - @DynamicSerializeElement - private String cityLoc = ""; - - // - @Transient - @XmlElement - @DynamicSerializeElement - private String source = ""; - - // - @Transient - @XmlElement - @DynamicSerializeElement - private String countyLoc = ""; - - // - @Transient - @XmlElement - @DynamicSerializeElement - private String stateLoc = ""; - - // - @Transient - @XmlElement - @DynamicSerializeElement - private String remarks = ""; - - // - @Transient - @XmlElement - @DynamicSerializeElement - private Float magnitude = -9999.0f; - - // 0 = unknown - // 1 = estimated - // 2 = measured - // 3 = - // 4 = - @Transient - @XmlElement - @DynamicSerializeElement - private Integer magQual = MISSING; - - // - @Transient - @XmlElement - @DynamicSerializeElement - private Integer injuries = MISSING; - - // - @Transient - @XmlElement - @DynamicSerializeElement - private Integer fatalities = MISSING; - - /** - * Empty default constructor - */ - public LocalStormReport() { - } - - /** - * Construct an instance of this class using the supplied datauri. - * - * @param dataUri - */ - public LocalStormReport(String dataUri) { - super(dataUri); - } - - /** - * @return the eventType - */ - public LSREventType getEventType() { - return eventType; - } - - /** - * @param eventType - * the eventType to set - */ - public void setEventType(LSREventType eventType) { - this.eventType = eventType; - } - - /** - * @return the corIndicator - */ - public String getCorIndicator() { - return corIndicator; - } - - /** - * @param corIndicator - * the corIndicator to set - */ - public void setCorIndicator(String corIndicator) { - this.corIndicator = corIndicator; - } - - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } - - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } - - /** - * @return the officeid - */ - public String getOfficeid() { - return officeid; - } - - /** - * @param officeid - * the officeid to set - */ - public void setOfficeid(String officeid) { - this.officeid = officeid; - } - - /** - * @return the cityLoc - */ - public String getCityLoc() { - return cityLoc; - } - - /** - * @param cityLoc - * the cityLoc to set - */ - public void setCityLoc(String cityLoc) { - this.cityLoc = cityLoc; - } - - /** - * @return the source - */ - public String getSource() { - return source; - } - - /** - * @param source - * the source to set - */ - public void setSource(String source) { - this.source = source; - } - - /** - * @return the countyLoc - */ - public String getCountyLoc() { - return countyLoc; - } - - /** - * @param countyLoc - * the countyLoc to set - */ - public void setCountyLoc(String countyLoc) { - this.countyLoc = countyLoc; - } - - /** - * @return the stateLoc - */ - public String getStateLoc() { - return stateLoc; - } - - /** - * @param stateLoc - * the stateLoc to set - */ - public void setStateLoc(String stateLoc) { - this.stateLoc = stateLoc; - } - - /** - * @return the remarks - */ - public String getRemarks() { - return remarks; - } - - /** - * @param remarks - * the remarks to set - */ - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - /** - * @return the magnitude - */ - public Float getMagnitude() { - return magnitude; - } - - /** - * @param magnitude - * the magnitude to set - */ - public void setMagnitude(Float magnitude) { - this.magnitude = magnitude; - } - - /** - * @return the magQual - */ - public Integer getMagQual() { - return magQual; - } - - /** - * @param magQual - * the magQual to set - */ - public void setMagQual(Integer magQual) { - this.magQual = magQual; - } - - /** - * @return the injuries - */ - public Integer getInjuries() { - return injuries; - } - - /** - * @param injuries - * the injuries to set - */ - public void setInjuries(Integer injuries) { - this.injuries = injuries; - } - - /** - * @return the fatalities - */ - public Integer getFatalities() { - return fatalities; - } - - /** - * @param fatalities - * the fatalities to set - */ - public void setFatalities(Integer fatalities) { - this.fatalities = fatalities; - } - - /** - * Set the data uri for this observation. - * - * @param dataURI - */ - @Override - public void setDataURI(String dataURI) { - super.setDataURI(dataURI); - identifier = dataURI; - } - - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } - - public SurfaceObsLocation getLocation() { - return location; - } - - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } - - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } - - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } - - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } - - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } - - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } - - /** - * Get whether the location for this observation is defined. - * - * @return Is this location defined. - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } - - @Override - public Amount getValue(String paramName) { - return null; - } - - @Override - public String getString(String paramName) { - return null; - } - - @Override - public String[] getStrings(String paramName) { - return null; - } - - @Override - public Collection getValues(String paramName) { - return null; - } - - @Override - public PointDataView getPointDataView() { - return pointDataView; - } - - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - Calendar c = getDataTime().getRefTimeAsCalendar(); - if (c != null) { - sb.append(String.format("LSR:%1$tY%1$tm%1$td%1$tH%1$tM", - getDataTime().getRefTimeAsCalendar())); - } else { - sb.append("LSR:YYYYMMDDHHmm"); - } - sb.append(String.format("%6.2f %7.2f:", getLatitude(), getLongitude())); - sb.append(String.format("%s:", cityLoc)); - sb.append(String.format("%s:", eventType.getEventName())); - sb.append(String.format("%5.2f:%s", getMagnitude(), getEventType() - .getEventUnits())); - return sb.toString(); - } + ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { + + private static final long serialVersionUID = 1L; + + private static final int MISSING = -9999; + + public static final Unit TEMPERATURE_UNIT = SI.KELVIN; + + public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; + + public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; + + public static final Unit PRESSURE_UNIT = SI.PASCAL; + + public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; + + public static final Unit WAVE_UNIT = SI.METER; + + public static final Unit VISIBILITY_UNIT = NonSI.MILE; + + public static final Unit CLOUD_COVER = NonSI.OCTET; + + // + @DataURI(position = 1) + @Column + @XmlElement + @DynamicSerializeElement + private LSREventType eventType; + + // Correction indicator from wmo header + @DataURI(position = 2) + @Column + @XmlElement + @DynamicSerializeElement + private String corIndicator; + + @Embedded + @DataURI(position = 3, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; + + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; + + // Text of the WMO header + @Transient + @XmlElement + @DynamicSerializeElement + private String wmoHeader = ""; + + // Text of the office + @XmlElement + @DynamicSerializeElement + private String officeid = ""; + + // + @Transient + @XmlElement + @DynamicSerializeElement + private String cityLoc = ""; + + // + @Transient + @XmlElement + @DynamicSerializeElement + private String source = ""; + + // + @Transient + @XmlElement + @DynamicSerializeElement + private String countyLoc = ""; + + // + @Transient + @XmlElement + @DynamicSerializeElement + private String stateLoc = ""; + + // + @Transient + @XmlElement + @DynamicSerializeElement + private String remarks = ""; + + // + @Transient + @XmlElement + @DynamicSerializeElement + private Float magnitude = -9999.0f; + + // 0 = unknown + // 1 = estimated + // 2 = measured + // 3 = + // 4 = + @Transient + @XmlElement + @DynamicSerializeElement + private Integer magQual = MISSING; + + // + @Transient + @XmlElement + @DynamicSerializeElement + private Integer injuries = MISSING; + + // + @Transient + @XmlElement + @DynamicSerializeElement + private Integer fatalities = MISSING; + + /** + * Empty default constructor + */ + public LocalStormReport() { + } + + /** + * Construct an instance of this class using the supplied datauri. + * + * @param dataUri + */ + public LocalStormReport(String dataUri) { + super(dataUri); + } + + /** + * @return the eventType + */ + public LSREventType getEventType() { + return eventType; + } + + /** + * @param eventType + * the eventType to set + */ + public void setEventType(LSREventType eventType) { + this.eventType = eventType; + } + + /** + * @return the corIndicator + */ + public String getCorIndicator() { + return corIndicator; + } + + /** + * @param corIndicator + * the corIndicator to set + */ + public void setCorIndicator(String corIndicator) { + this.corIndicator = corIndicator; + } + + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } + + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } + + /** + * @return the officeid + */ + public String getOfficeid() { + return officeid; + } + + /** + * @param officeid + * the officeid to set + */ + public void setOfficeid(String officeid) { + this.officeid = officeid; + } + + /** + * @return the cityLoc + */ + public String getCityLoc() { + return cityLoc; + } + + /** + * @param cityLoc + * the cityLoc to set + */ + public void setCityLoc(String cityLoc) { + this.cityLoc = cityLoc; + } + + /** + * @return the source + */ + public String getSource() { + return source; + } + + /** + * @param source + * the source to set + */ + public void setSource(String source) { + this.source = source; + } + + /** + * @return the countyLoc + */ + public String getCountyLoc() { + return countyLoc; + } + + /** + * @param countyLoc + * the countyLoc to set + */ + public void setCountyLoc(String countyLoc) { + this.countyLoc = countyLoc; + } + + /** + * @return the stateLoc + */ + public String getStateLoc() { + return stateLoc; + } + + /** + * @param stateLoc + * the stateLoc to set + */ + public void setStateLoc(String stateLoc) { + this.stateLoc = stateLoc; + } + + /** + * @return the remarks + */ + public String getRemarks() { + return remarks; + } + + /** + * @param remarks + * the remarks to set + */ + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + /** + * @return the magnitude + */ + public Float getMagnitude() { + return magnitude; + } + + /** + * @param magnitude + * the magnitude to set + */ + public void setMagnitude(Float magnitude) { + this.magnitude = magnitude; + } + + /** + * @return the magQual + */ + public Integer getMagQual() { + return magQual; + } + + /** + * @param magQual + * the magQual to set + */ + public void setMagQual(Integer magQual) { + this.magQual = magQual; + } + + /** + * @return the injuries + */ + public Integer getInjuries() { + return injuries; + } + + /** + * @param injuries + * the injuries to set + */ + public void setInjuries(Integer injuries) { + this.injuries = injuries; + } + + /** + * @return the fatalities + */ + public Integer getFatalities() { + return fatalities; + } + + /** + * @param fatalities + * the fatalities to set + */ + public void setFatalities(Integer fatalities) { + this.fatalities = fatalities; + } + + /** + * Set the data uri for this observation. + * + * @param dataURI + */ + @Override + public void setDataURI(String dataURI) { + super.setDataURI(dataURI); + identifier = dataURI; + } + + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } + + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } + + public SurfaceObsLocation getLocation() { + return location; + } + + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } + + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } + + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } + + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } + + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } + + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } + + /** + * Get whether the location for this observation is defined. + * + * @return Is this location defined. + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } + + @Override + public Amount getValue(String paramName) { + return null; + } + + @Override + public String getString(String paramName) { + return null; + } + + @Override + public String[] getStrings(String paramName) { + return null; + } + + @Override + public Collection getValues(String paramName) { + return null; + } + + @Override + public PointDataView getPointDataView() { + return pointDataView; + } + + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + Calendar c = getDataTime().getRefTimeAsCalendar(); + if (c != null) { + sb.append(String.format("LSR:%1$tY%1$tm%1$td%1$tH%1$tM", + getDataTime().getRefTimeAsCalendar())); + } else { + sb.append("LSR:YYYYMMDDHHmm"); + } + sb.append(String.format("%6.2f %7.2f:", getLatitude(), getLongitude())); + sb.append(String.format("%s:", cityLoc)); + sb.append(String.format("%s:", eventType.getEventName())); + sb.append(String.format("%5.2f:%s", getMagnitude(), getEventType() + .getEventUnits())); + return sb.toString(); + } + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "lsr"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.npp.crimss/src/com/raytheon/uf/common/dataplugin/npp/crimss/CrimssRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.npp.crimss/src/com/raytheon/uf/common/dataplugin/npp/crimss/CrimssRecord.java index f924464cad..84bb14f688 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.npp.crimss/src/com/raytheon/uf/common/dataplugin/npp/crimss/CrimssRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.npp.crimss/src/com/raytheon/uf/common/dataplugin/npp/crimss/CrimssRecord.java @@ -43,10 +43,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Dec 2, 2011 bsteffen Initial creation + * Dec 02, 2011 bsteffen Initial creation * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -84,4 +85,8 @@ public class CrimssRecord extends NPPSoundingRecord { return super.getDataURI(); } + @Override + public String getPluginName() { + return "crimss"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.npp.nucaps/src/com/raytheon/uf/common/dataplugin/npp/nucaps/NucapsRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.npp.nucaps/src/com/raytheon/uf/common/dataplugin/npp/nucaps/NucapsRecord.java index 055dc9e102..b77931e636 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.npp.nucaps/src/com/raytheon/uf/common/dataplugin/npp/nucaps/NucapsRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.npp.nucaps/src/com/raytheon/uf/common/dataplugin/npp/nucaps/NucapsRecord.java @@ -43,10 +43,11 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 15, 2013 mschenke Initial creation + * Jan 15, 2013 mschenke Initial creation * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -92,4 +93,8 @@ public class NucapsRecord extends NPPSoundingRecord { return super.getDataURI(); } + @Override + public String getPluginName() { + return "nucaps"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.npp.viirs/src/com/raytheon/uf/common/dataplugin/npp/viirs/VIIRSDataRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.npp.viirs/src/com/raytheon/uf/common/dataplugin/npp/viirs/VIIRSDataRecord.java index 5bfa9b08bd..a6f5a1a84d 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.npp.viirs/src/com/raytheon/uf/common/dataplugin/npp/viirs/VIIRSDataRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.npp.viirs/src/com/raytheon/uf/common/dataplugin/npp/viirs/VIIRSDataRecord.java @@ -53,11 +53,13 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Nov 30, 2011 mschenke Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Nov 30, 2011 mschenke Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -71,12 +73,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "viirs", - indexes = { - @Index(name = "viirs_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "viirs", indexes = { @Index(name = "viirs_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class VIIRSDataRecord extends PersistablePluginDataObject implements ISpatialEnabled { @@ -127,7 +125,6 @@ public class VIIRSDataRecord extends PersistablePluginDataObject implements private VIIRSSpatialCoverage coverage; public VIIRSDataRecord() { - setPluginName(VIIRSDataRecord.class.getAnnotation(Table.class).name()); } /* @@ -256,8 +253,9 @@ public class VIIRSDataRecord extends PersistablePluginDataObject implements @Override public Date getPersistenceTime() { Calendar c = getInsertTime(); - if (c == null) + if (c == null) { return null; + } return c.getTime(); } @@ -296,10 +294,16 @@ public class VIIRSDataRecord extends PersistablePluginDataObject implements public IDecoderGettable getDecoderGettable() { return null; } + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "viirs"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.obs/src/com/raytheon/uf/common/dataplugin/obs/metar/MetarRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.obs/src/com/raytheon/uf/common/dataplugin/obs/metar/MetarRecord.java index a864957ea4..173fad6ece 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.obs/src/com/raytheon/uf/common/dataplugin/obs/metar/MetarRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.obs/src/com/raytheon/uf/common/dataplugin/obs/metar/MetarRecord.java @@ -25,7 +25,6 @@ import java.util.Calendar; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; -import java.util.Iterator; import java.util.List; import java.util.Set; import java.util.SortedSet; @@ -76,24 +75,28 @@ import com.raytheon.uf.common.time.util.TimeUtil; * * SOFTWARE HISTORY * - * Date Ticket# Engineer Description - * ---------- ---------- ----------- -------------------------- - * 02/14/07 139 bphillip Initial creation - * Nov 15, 2007 njensen Added static units info. - * 20071129 472 jkorman Added IDecoderGettable interface. - * 20071204 472 jkorman getValue was using wrong select value. - * Dec 07,2007 452 bphillip Added station lat/lon - * 20071217 472 jkorman Changed to use ALTIMETER_UNIT. - * 20071221 666 jkorman Modified to default all numerics to -9999. - * 20090423 2338 jsanchez Implemented precip plots, cloud/vis. - * Added @DynamicSerializeElement to location. - * 20090528 2225 jsanchez Implemented tempFromTenths and dewPointFromTenths. - * 20090629 2538 jsanchez Made the sort public. - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. - * May 07, 2013 1869 bsteffen Remove dataURI column from + * Date Ticket# Engineer Description + * ------------ ---------- ----------- --------------------------------------- + * Feb 14, 2007 139 bphillip Initial creation + * Nov 15, 2007 njensen Added static units info. + * Nov 29, 2007 472 jkorman Added IDecoderGettable interface. + * Dec 04, 2007 472 jkorman getValue was using wrong select value. + * Dec 07, 2007 452 bphillip Added station lat/lon + * Dec 17, 2007 472 jkorman Changed to use ALTIMETER_UNIT. + * Dec 21, 2007 666 jkorman Modified to default all numerics to + * -9999. + * Apr 23, 2009 2338 jsanchez Implemented precip plots, cloud/vis. + * Added @DynamicSerializeElement to + * location. + * May 28, 2009 2225 jsanchez Implemented tempFromTenths and + * dewPointFromTenths. + * Jun 29, 2009 2538 jsanchez Made the sort public. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. - * + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author bphillip @@ -106,1611 +109,1612 @@ import com.raytheon.uf.common.time.util.TimeUtil; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "obs", - indexes = { - @Index(name = "obs_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "obs", indexes = { @Index(name = "obs_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class MetarRecord extends PersistablePluginDataObject implements - ISpatialEnabled, IDecoderGettable, IPointData { + ISpatialEnabled, IDecoderGettable, IPointData { - public static final String PLUGIN_NAME = "obs"; + public static final String PLUGIN_NAME = "obs"; - public static final String STATION_ID = "stationId"; + public static final String STATION_ID = "stationId"; - public static final Unit TEMPERATURE_UNIT = SI.CELSIUS; + public static final Unit TEMPERATURE_UNIT = SI.CELSIUS; - public static final Unit WIND_SPEED_UNIT = NonSI.KNOT; + public static final Unit WIND_SPEED_UNIT = NonSI.KNOT; - public static final Unit HEIGHT_UNIT = SI.METER; + public static final Unit HEIGHT_UNIT = SI.METER; - public static final Unit VISIBILITY_UNIT = SI.KILO(NonSI.MILE); + public static final Unit VISIBILITY_UNIT = SI.KILO(NonSI.MILE); - public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; - public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; - public static final Unit PRESSURE_UNIT = SI.HECTO(SI.PASCAL); + public static final Unit PRESSURE_UNIT = SI.HECTO(SI.PASCAL); - public static final Unit ALTIMETER_UNIT = SI.PASCAL; + public static final Unit ALTIMETER_UNIT = SI.PASCAL; - public static final Unit PRECIP_UNIT = NonSI.INCH; + public static final Unit PRECIP_UNIT = NonSI.INCH; - /** Metar specific parameter keys */ - public static final class ParameterKey { - public static final String SFC_ALTIMETER = "SFC.PRESS.ALTIMETER"; + /** Metar specific parameter keys */ + public static final class ParameterKey { + public static final String SFC_ALTIMETER = "SFC.PRESS.ALTIMETER"; - public static final String PRESSURE_CHANGE = "PCHNG"; + public static final String PRESSURE_CHANGE = "PCHNG"; - public static final String VISIBILITY = "VIS"; + public static final String VISIBILITY = "VIS"; - public static final String PRECIPITATION_1HR = "PR1HR"; + public static final String PRECIPITATION_1HR = "PR1HR"; - public static final String PRECIPITATION_3HR = "PR3HR"; + public static final String PRECIPITATION_3HR = "PR3HR"; - public static final String PRECIPITATION_6HR = "PR6HR"; + public static final String PRECIPITATION_6HR = "PR6HR"; - public static final String PRECIPITATION_24HR = "PR24HR"; - } + public static final String PRECIPITATION_24HR = "PR24HR"; + } - /** Parameter keys used in the legacy system */ - public static final class LegacyParameterKey { + /** Parameter keys used in the legacy system */ + public static final class LegacyParameterKey { - public static final String TEMPERATURE = "T"; + public static final String TEMPERATURE = "T"; - public static final String DEW_POINT = "DpT"; + public static final String DEW_POINT = "DpT"; - public static final String WIND_SPEED = "wSp"; + public static final String WIND_SPEED = "wSp"; - public static final String WIND_DIRECTION = "WD"; + public static final String WIND_DIRECTION = "WD"; - public static final String WIND_GUST = "Gust"; + public static final String WIND_GUST = "Gust"; - public static final String ALTIMETER = "Alti"; + public static final String ALTIMETER = "Alti"; - public static final String SEA_LEVEL_PRESSURE = "msl-P"; + public static final String SEA_LEVEL_PRESSURE = "msl-P"; - public static final String PRESSURE_CHANGE_3HR = "PT3"; + public static final String PRESSURE_CHANGE_3HR = "PT3"; - public static final String VISABILITY = "Vis"; + public static final String VISABILITY = "Vis"; - public static final String PRECIPITATION_1HR = "TP"; + public static final String PRECIPITATION_1HR = "TP"; - public static final String PRECIPITATION_3HR = "TP3hr"; + public static final String PRECIPITATION_3HR = "TP3hr"; - public static final String PRECIPITATION_6HR = "TP6hr"; + public static final String PRECIPITATION_6HR = "TP6hr"; - public static final String PRECIPITATION_24HR = "TP24hr"; + public static final String PRECIPITATION_24HR = "TP24hr"; - // public static final String SNOW_DEPTH = "snow"; - // - // public static final String SNOW_WATER = "weqs"; - // - // public static final String SNOWFALL6_HOUR = "TP24hr"; - // - // public static final String SUNSHINE = "msun"; - // - // public static final String TEMP_MAX_6HOUR = "t6xc"; - // - // public static final String TEMP_MIN_6HOUR = "t6nc"; + // public static final String SNOW_DEPTH = "snow"; + // + // public static final String SNOW_WATER = "weqs"; + // + // public static final String SNOWFALL6_HOUR = "TP24hr"; + // + // public static final String SUNSHINE = "msun"; + // + // public static final String TEMP_MAX_6HOUR = "t6xc"; + // + // public static final String TEMP_MIN_6HOUR = "t6nc"; - private String value; + private String value; - /** - * - * @param value - * the value of this legacy parameter key - */ - public void setValue(String value) { - this.value = value; - } + /** + * + * @param value + * the value of this legacy parameter key + */ + public void setValue(String value) { + this.value = value; + } - /** - * - * @return the value of this legacy parameter key - */ - public String getValue() { - return value; - } + /** + * + * @return the value of this legacy parameter key + */ + public String getValue() { + return value; + } - } + } - /** Serializable id * */ - private static final long serialVersionUID = 1L; + /** Serializable id * */ + private static final long serialVersionUID = 1L; + + /** + * Maps common AWIPS I keys to IDecoderGettable and newer parameter key + * constants + */ + private static final HashMap PARM_MAP = new HashMap(); + static { + PARM_MAP.put(LegacyParameterKey.TEMPERATURE, SFC_TEMP); + PARM_MAP.put(LegacyParameterKey.DEW_POINT, SFC_DWPT); + PARM_MAP.put(LegacyParameterKey.WIND_SPEED, SFC_WNDSPD); + PARM_MAP.put(LegacyParameterKey.WIND_DIRECTION, SFC_WNDDIR); + PARM_MAP.put(LegacyParameterKey.WIND_GUST, SFC_WNDGST); + PARM_MAP.put(LegacyParameterKey.ALTIMETER, ParameterKey.SFC_ALTIMETER); + PARM_MAP.put(LegacyParameterKey.SEA_LEVEL_PRESSURE, PRES_SLP); + PARM_MAP.put("NLAT", STA_LAT); + PARM_MAP.put("NLON", STA_LON); + PARM_MAP.put(LegacyParameterKey.PRESSURE_CHANGE_3HR, + ParameterKey.PRESSURE_CHANGE); + // PARM_MAP.put("T24", "T24"); // not used + // PARM_MAP.put("DpT24", "DpT24"); // not used + // PARM_MAP.put("WS24", "WS24"); // not used + // PARM_MAP.put("WD24", "WD24"); // not used + // PARM_MAP.put("WGS24", "WGS24"); // not used + // PARM_MAP.put("ASET24", "ASET24"); // not used + // PARM_MAP.put("HIWC", "HIWC"); // not used + PARM_MAP.put(LegacyParameterKey.VISABILITY, ParameterKey.VISIBILITY); + PARM_MAP.put(LegacyParameterKey.PRECIPITATION_1HR, + ParameterKey.PRECIPITATION_1HR); + PARM_MAP.put(LegacyParameterKey.PRECIPITATION_3HR, + ParameterKey.PRECIPITATION_3HR); + PARM_MAP.put(LegacyParameterKey.PRECIPITATION_6HR, + ParameterKey.PRECIPITATION_6HR); + PARM_MAP.put(LegacyParameterKey.PRECIPITATION_24HR, + ParameterKey.PRECIPITATION_24HR); + } + + @Transient + private String sampleType = null; + + @Transient + private boolean isSkyCoverageSorted = false; + + @XmlElement + @DynamicSerializeElement + @Transient + private String report; + + @XmlElement + @DynamicSerializeElement + @Transient + private String wmoHeader; + + /** Nominal Time extracted from WMO header * */ + @XmlElement + @DynamicSerializeElement + @Transient + private String nominalTime; + + /** A string denoting the time of observation */ + @XmlElement + @DynamicSerializeElement + @Transient + private Calendar timeObs; + + /** Report type extracted from WMO header * */ + @XmlElement + @DynamicSerializeElement + @Column + @DataURI(position = 1) + protected String reportType; + + /** A string denoting if this report is a correction */ + @XmlElement + @DynamicSerializeElement + @Column + @DataURI(position = 2) + private String correction; + + @Embedded + @DataURI(position = 3, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; + + /** A string denoting the type of automated station (AO1 or AO2) */ + @XmlElement + @DynamicSerializeElement + @Transient + private String autoStationType; + + @XmlElement + @DynamicSerializeElement + @Transient + private String skyKey; + + @XmlElement + @DynamicSerializeElement + @Transient + private Set skyCoverage = new HashSet(); + + /** A string denoting the vertical visibility */ + @XmlElement + @DynamicSerializeElement + @Transient + private int vertVisibility = -9999; + + /** A string denoting the lowest layer of clouds */ + @XmlElement + @DynamicSerializeElement + @Transient + private int skyLayerBase = -9999; + + /** The visibility in statute miles */ + @XmlElement + @DynamicSerializeElement + @Transient + private float visibility = -9999; + + /** A String used as the foreign key to the present weather table * */ + @XmlElement + @DynamicSerializeElement + @Transient + private String weatherKey; + + /** A Set of present weather conditions * */ + @DynamicSerializeElement + @XmlElement + @Transient + private List weatherCondition = new ArrayList(); + + /** A string denoting the sea level pressure in millibars */ + @XmlElement + @DynamicSerializeElement + @Transient + private float seaLevelPress = -9999; + + /** A string denoting the temperature in degrees Celsius */ + @XmlElement + @DynamicSerializeElement + @Transient + private int temperature = -9999; + + /** A string denoting the current temperature in tenths of degrees Celsius */ + @XmlElement + @DynamicSerializeElement + @Transient + private float tempFromTenths = -9999; + + /** A string denoting the current dew point in degrees Celsius */ + @XmlElement + @DynamicSerializeElement + @Transient + private int dewPoint = -9999; + + /** A string denoting the current dew point in tenths of degrees Celsius */ + @XmlElement + @DynamicSerializeElement + @Transient + private float dewPointFromTenths = -9999; + + @XmlElement + @DynamicSerializeElement + @Transient + private String windDir; + + @XmlElement + @DynamicSerializeElement + @Transient + private int windSpeed = -9999; + + @XmlElement + @DynamicSerializeElement + @Transient + private int windGust = -9999; + + @XmlElement + @DynamicSerializeElement + @Transient + private int pkWndDir = -9999; + + @XmlElement + @DynamicSerializeElement + @Transient + private int pkWndSpd = -9999; + + @XmlElement + @DynamicSerializeElement + @Transient + private Calendar pkWndTime = null; + + @XmlElement + @DynamicSerializeElement + @Transient + private float altimeterInPa = -9999; + + @XmlElement + @DynamicSerializeElement + @Transient + private float altimeter = -9999; + + @XmlElement + @DynamicSerializeElement + @Transient + private float minTemp24Hour = -9999; + + @XmlElement + @DynamicSerializeElement + @Transient + private float maxTemp24Hour = -9999; + + @XmlElement + @DynamicSerializeElement + @Transient + private float minTemp6Hour = -9999; + + @XmlElement + @DynamicSerializeElement + @Transient + private float maxTemp6Hour = -9999; + + /** A string denoting inches of precipitation observed in the last hour */ + @XmlElement + @DynamicSerializeElement + @Transient + private float precip1Hour = -9999; + + /** A string denoting inches of precipitation observed in the last 3 hours */ + @XmlElement + @DynamicSerializeElement + @Transient + private float precip3Hour = -9999; + + /** A string denoting inches of precipitation observed in the last 6 hours */ + @XmlElement + @DynamicSerializeElement + @Transient + private float precip6Hour = -9999; + + /** A string denoting inches of precipitation observed in the last 24 hours */ + @XmlElement + @DynamicSerializeElement + @Transient + private float precip24Hour = -9999; + + /** A string denoting the pressure tendency(rising or falling) */ + @XmlElement + @DynamicSerializeElement + @Transient + private String pressChangeChar; + + /** A string denoting the pressure change observed in the past 3 hrs. */ + @XmlElement + @DynamicSerializeElement + @Transient + private float pressChange3Hour = -9999; + + // Amount of snow on the ground in inches. + @XmlElement + @DynamicSerializeElement + @Transient + private int snowDepth = -9999; + + // Water equivalent in 0.1 inch increments. + @XmlElement + @DynamicSerializeElement + @Transient + private float snowWater = -9999; + + // Snow fall last 6 hours. + @XmlElement + @DynamicSerializeElement + @Transient + private float snowFall_6Hours = -9999; + + // Number of minutes of sunshine. + @XmlElement + @DynamicSerializeElement + @Transient + private int sunshine = -9999; + + @XmlElement + @DynamicSerializeElement + @Column + private Calendar refHour; + + @DynamicSerializeElement + @Embedded + private PointDataView pointDataView; + + public MetarRecord() { + } + + /** + * Constructs a metar record from a dataURI + * + * @param uri + * The dataURI + * @param tableDef + * The table definition associated with this class + */ + public MetarRecord(String uri) { + super(uri); + } + + /** + * @return the serialVersionUID + */ + public static long getSerialVersionUID() { + return serialVersionUID; + } + + /** + * @return the altimeter + */ + public float getAltimeter() { + return altimeter; + } + + /** + * @param altimeter + * the altimeter to set + */ + public void setAltimeter(float altimeter) { + this.altimeter = altimeter; + } + + /** + * @return the altimeterInPa + */ + public float getAltimeterInPa() { + return altimeterInPa; + } + + /** + * @param altimeterInPa + * the altimeterInPa to set + */ + public void setAltimeterInPa(float altimeterInPa) { + this.altimeterInPa = altimeterInPa; + } + + /** + * @return the autoStationType + */ + public String getAutoStationType() { + return autoStationType; + } + + /** + * @param autoStationType + * the autoStationType to set + */ + public void setAutoStationType(String autoStationType) { + this.autoStationType = autoStationType; + } + + /** + * @return the correction + */ + public String getCorrection() { + return correction; + } + + /** + * @param correction + * the correction to set + */ + public void setCorrection(String correction) { + this.correction = correction; + } + + /** + * @return the dewPoint + */ + public int getDewPoint() { + return dewPoint; + } + + /** + * @param dewPoint + * the dewPoint to set + */ + public void setDewPoint(int dewPoint) { + this.dewPoint = dewPoint; + } + + /** + * @return the dewPointFromTenths + */ + public float getDewPointFromTenths() { + return dewPointFromTenths; + } + + /** + * @param dewPointFromTenths + * the dewPointFromTenths to set + */ + public void setDewPointFromTenths(float dewPointFromTenths) { + this.dewPointFromTenths = dewPointFromTenths; + } + + /** + * @return the maxTemp24Hour + */ + public float getMaxTemp24Hour() { + return maxTemp24Hour; + } + + /** + * @param maxTemp24Hour + * the maxTemp24Hour to set + */ + public void setMaxTemp24Hour(float maxTemp24Hour) { + this.maxTemp24Hour = maxTemp24Hour; + } + + /** + * @return the minTemp24Hour + */ + public float getMinTemp24Hour() { + return minTemp24Hour; + } + + /** + * @param minTemp24Hour + * the minTemp24Hour to set + */ + public void setMinTemp24Hour(float minTemp24Hour) { + this.minTemp24Hour = minTemp24Hour; + } + + /** + * @return the minTemp6Hour + */ + public float getMinTemp6Hour() { + return minTemp6Hour; + } + + /** + * @param minTemp6Hour + * the minTemp6Hour to set + */ + public void setMinTemp6Hour(float minTemp6Hour) { + this.minTemp6Hour = minTemp6Hour; + } + + /** + * @return the maxTemp6Hour + */ + public float getMaxTemp6Hour() { + return maxTemp6Hour; + } + + /** + * @param maxTemp6Hour + * the maxTemp6Hour to set + */ + public void setMaxTemp6Hour(float maxTemp6Hour) { + this.maxTemp6Hour = maxTemp6Hour; + } + + /** + * @return the precip1Hour + */ + public float getPrecip1Hour() { + return precip1Hour; + } + + /** + * @param precip1Hour + * the precip1Hour to set + */ + public void setPrecip1Hour(float precip1Hour) { + this.precip1Hour = precip1Hour; + } + + /** + * @return the precip3Hour + */ + public float getPrecip3Hour() { + return precip3Hour; + } + + /** + * @param precip3Hour + * the precip3Hour to set + */ + public void setPrecip3Hour(float precip3Hour) { + this.precip3Hour = precip3Hour; + } + + /** + * @return the precip6Hour + */ + public float getPrecip6Hour() { + return precip6Hour; + } + + /** + * @param precip6Hour + * the precip6Hour to set + */ + public void setPrecip6Hour(float precip6Hour) { + this.precip6Hour = precip6Hour; + } + + /** + * @return the precip24Hour + */ + public float getPrecip24Hour() { + return precip24Hour; + } + + /** + * @param precip24Hour + * the precip24Hour to set + */ + public void setPrecip24Hour(float precip24Hour) { + this.precip24Hour = precip24Hour; + } + + /** + * @return the pressChange3Hour + */ + public float getPressChange3Hour() { + return pressChange3Hour; + } + + /** + * @param pressChange3Hour + * the pressChange3Hour to set + */ + public void setPressChange3Hour(float pressChange3Hour) { + this.pressChange3Hour = pressChange3Hour; + } + + /** + * @return the pressChangeChar + */ + public String getPressChangeChar() { + return pressChangeChar; + } + + /** + * @param pressChangeChar + * the pressChangeChar to set + */ + public void setPressChangeChar(String pressChangeChar) { + this.pressChangeChar = pressChangeChar; + } + + /** + * @return the seaLevelPress + */ + public float getSeaLevelPress() { + return seaLevelPress; + } + + /** + * @param seaLevelPress + * the seaLevelPress to set + */ + public void setSeaLevelPress(float seaLevelPress) { + this.seaLevelPress = seaLevelPress; + } + + /** + * @return the skyLayerBase + */ + public int getSkyLayerBase() { + return skyLayerBase; + } + + /** + * @param skyLayerBase + * the skyLayerBase to set + */ + public void setSkyLayerBase(int skyLayerBase) { + this.skyLayerBase = skyLayerBase; + } + + /** + * @return the temperature + */ + public int getTemperature() { + return temperature; + } + + /** + * @param temperature + * the temperature to set + */ + public void setTemperature(int temperature) { + this.temperature = temperature; + } + + /** + * @return the tempFromTenths + */ + public float getTempFromTenths() { + return tempFromTenths; + } + + /** + * @param tempFromTenths + * the tempFromTenths to set + */ + public void setTempFromTenths(float tempFromTenths) { + this.tempFromTenths = tempFromTenths; + } + + /** + * @return the vertVisibility + */ + public int getVertVisibility() { + return vertVisibility; + } + + /** + * @param vertVisibility + * the vertVisibility to set + */ + public void setVertVisibility(int vertVisibility) { + this.vertVisibility = vertVisibility; + } + + /** + * @return the visibility + */ + public float getVisibility() { + + return visibility; + } + + /** + * @param visibility + * the visibility to set + */ + public void setVisibility(float visibility) { + this.visibility = visibility; + } + + /** + * @return the windDir + */ + public String getWindDir() { + return windDir; + } + + /** + * @param windDir + * the windDir to set + */ + public void setWindDir(String windDir) { + this.windDir = windDir; + } + + /** + * @return the windGust + */ + public int getWindGust() { + return windGust; + } + + /** + * @param windGust + * the windGust to set + */ + public void setWindGust(int windGust) { + this.windGust = windGust; + } + + /** + * @return the windSpeed + */ + public int getWindSpeed() { + return windSpeed; + } + + /** + * @param windSpeed + * the windSpeed to set + */ + public void setWindSpeed(int windSpeed) { + this.windSpeed = windSpeed; + } + + /** + * @return the pkWndDir + */ + public int getPkWndDir() { + return pkWndDir; + } + + /** + * @param pkWndDir + * the pkWndDir to set + */ + public void setPkWndDir(int pkWndDir) { + this.pkWndDir = pkWndDir; + } + + /** + * @return the pkWndSpd + */ + public int getPkWndSpd() { + return pkWndSpd; + } + + /** + * @param pkWndSpd + * the pkWndSpd to set + */ + public void setPkWndSpd(int pkWndSpd) { + this.pkWndSpd = pkWndSpd; + } + + /** + * @return the pkWndTime + */ + public Calendar getPkWndTime() { + return pkWndTime; + } + + /** + * @param pkWndTime + * the pkWndTime to set + */ + public void setPkWndTime(Calendar pkWndTime) { + this.pkWndTime = pkWndTime; + } + + /** + * @return the timeObs + */ + public Calendar getTimeObs() { + if (this.dataTime == null) { + return null; + } + return this.dataTime.getRefTimeAsCalendar(); + } + + /** + * @param timeObs + * the timeObs to set + */ + public void setTimeObs(Calendar timeObs) { + this.nominalTime = TimeUtil.formatCalendar(timeObs); + this.timeObs = timeObs; + } + + /** + * @return the skyCoverage + */ + public Set getSkyCoverage() { + return skyCoverage; + } + + /** + * @param skyCoverage + * the skyCoverage to set + */ + public void setSkyCoverage(Set skyCoverage) { + this.skyCoverage = skyCoverage; + } + + public void addSkyCoverage(SkyCover cover) { + skyCoverage.add(cover); + cover.setParentMetar(this); + } + + /** + * @return the skyKey + */ + public String getSkyKey() { + return skyKey; + } + + /** + * @param skyKey + * the skyKey to set + */ + public void setSkyKey(String skyKey) { + this.skyKey = skyKey; + } + + /** + * @return the weatherCondition + */ + public List getWeatherCondition() { + return weatherCondition; + } + + /** + * @param weatherCondition + * the weatherCondition to set + */ + public void setWeatherCondition(List weatherCondition) { + this.weatherCondition = weatherCondition; + } + + public void addWeatherCondition(WeatherCondition condition) { + this.weatherCondition.add(condition); + condition.setParentMetar(this); + } + + /** + * @return the weatherKey + */ + public String getWeatherKey() { + return weatherKey; + } + + /** + * @param weatherKey + * the weatherKey to set + */ + public void setWeatherKey(String weatherKey) { + this.weatherKey = weatherKey; + } + + /** + * @return the refHour + */ + public Calendar getRefHour() { + return refHour; + } + + /** + * @param refHour + * the refHour to set + */ + public void setRefHour(Calendar refHour) { + this.refHour = refHour; + } + + /** + * @return the snowDepth + */ + public int getSnowDepth() { + return snowDepth; + } + + /** + * @param snowDepth + * the snowDepth to set + */ + public void setSnowDepth(int snowDepth) { + this.snowDepth = snowDepth; + } + + /** + * @return the snowFall_6Hours + */ + public float getSnowFall_6Hours() { + return snowFall_6Hours; + } + + /** + * @param snowFall_6Hours + * the snowFall_6Hours to set + */ + public void setSnowFall_6Hours(float snowFall_6Hours) { + this.snowFall_6Hours = snowFall_6Hours; + } + + /** + * @return the sunshine + */ + public int getSunshine() { + return sunshine; + } + + /** + * @param sunshine + * the sunshine to set + */ + public void setSunshine(int sunshine) { + this.sunshine = sunshine; + } + + /** + * @return the snowWater + */ + public float getSnowWater() { + return snowWater; + } + + /** + * @param snowWater + * the snowWater to set + */ + public void setSnowWater(float snowWater) { + this.snowWater = snowWater; + } + + /** + * Override existing set method to modify any classes that use the dataURI + * as a foreign key + */ + @Override + public void setIdentifier(Object dataURI) { + this.identifier = dataURI; + // set the parentID to the dataURI for all values + if ((this.getWeatherCondition() != null) + && (this.getWeatherCondition().size() > 0)) { + for (WeatherCondition cond : this.getWeatherCondition()) { + cond.setParentMetar(this); + } + } + + // set the parentID to the dataURI for all values + if ((this.getSkyCoverage() != null) + && (this.getSkyCoverage().size() > 0)) { + for (SkyCover cover : this.getSkyCoverage()) { + cover.setParentMetar(this); + } + } + } + + public String getReportType() { + return reportType; + } + + public void setReportType(String reportType) { + this.reportType = reportType; + } + + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } + + public String getNominalTime() { + return nominalTime; + } + + public void setNominalTime(String nominalTime) { + this.nominalTime = nominalTime; + } + + /** + * Get the IDecoderGettable reference for this record. + * + * @return The IDecoderGettable reference for this record. + */ + @Override + public IDecoderGettable getDecoderGettable() { + return this; + } + + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public String getString(String paramName) { + if ("STA".matches(paramName)) { + return getStationId(); + } + if ("WX".matches(paramName)) { + return this.weatherKey; + } + + return null; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.dataplugin.IDecoderGettable#getValue(java.lang + * .String) + */ + @Override + public Amount getValue(String paramName) { + Amount a = null; + + String pName = paramName; + if (PARM_MAP.containsKey(paramName)) { + // we have recieved an AWIPS I parameter name + pName = PARM_MAP.get(paramName); + } + + if (SFC_TEMP.equals(pName)) { + if (tempFromTenths != -9999) { + a = new Amount(tempFromTenths, TEMPERATURE_UNIT); + } else if (temperature != -9999) { + a = new Amount(temperature, TEMPERATURE_UNIT); + } + } else if (SFC_DWPT.equals(pName)) { + if (dewPointFromTenths != -9999) { + a = new Amount(dewPointFromTenths, TEMPERATURE_UNIT); + } else if (dewPoint != -9999) { + a = new Amount(dewPoint, TEMPERATURE_UNIT); + } + } else if (SFC_WNDSPD.equals(pName)) { + a = new Amount(windSpeed, WIND_SPEED_UNIT); + } else if (SFC_WNDGST.equals(pName)) { + a = new Amount(windGust, WIND_SPEED_UNIT); + } else if (ParameterKey.PRESSURE_CHANGE.equals(pName) + && (pressChange3Hour != -9999)) { + a = new Amount(pressChange3Hour, PRESSURE_UNIT); + } else if (SFC_WNDDIR.equals(pName)) { + String windDir = getWindDir(); + if ((windDir != null) && !windDir.equalsIgnoreCase("VRB")) { + Double result = Double.parseDouble(windDir); + a = new Amount(result, WIND_DIR_UNIT); + } + } else if (PRES_ALTSG.equals(pName)) { + a = new Amount(altimeterInPa, ALTIMETER_UNIT); + } else if (STA_LAT.equals(pName)) { + a = new Amount(getLatitude(), LOCATION_UNIT); + } else if (STA_LON.equals(pName)) { + a = new Amount(getLongitude(), LOCATION_UNIT); + } else if (PRES_SLP.equals(pName)) { + a = new Amount(this.seaLevelPress, PRESSURE_UNIT); + } else if (pName.startsWith("HGT")) { + int start = "HGT".length(); + int index = Integer.parseInt(pName.substring(start)); + if ((index < skyCoverage.size()) + && (getSkyCover(index).getHeight() != null)) { + a = new Amount(getSkyCover(index).getHeight(), HEIGHT_UNIT); + } + } else if (pName.startsWith("HMSL")) { + int start = "HMSL".length(); + int index = Integer.parseInt(pName.substring(start)); + if ((index < skyCoverage.size()) + && (getSkyCover(index).getHeight() != null) + && (getSpatialObject() != null) + && (getSpatialObject().getElevation() != null)) { + a = new Amount(getSkyCover(index).getHeight() + + getSpatialObject().getElevation(), HEIGHT_UNIT); + } + } else if (ParameterKey.PRECIPITATION_1HR.equals(pName) + || ParameterKey.PRECIPITATION_24HR.equals(pName)) { + sampleType = "PR"; + if (precip1Hour != -9999) { + a = new Amount(precip1Hour, PRECIP_UNIT); + } + } else if (ParameterKey.PRECIPITATION_3HR.equals(pName)) { + sampleType = "PR"; + if (precip3Hour != -9999) { + a = new Amount(precip3Hour, PRECIP_UNIT); + } + } else if (ParameterKey.PRECIPITATION_6HR.equals(pName)) { + sampleType = "PR"; + if (precip6Hour != -9999) { + a = new Amount(precip6Hour, PRECIP_UNIT); + } + } else if (ParameterKey.VISIBILITY.equals(pName)) { + a = new Amount(visibility, VISIBILITY_UNIT); + } + + return a; + } + + /** + * Get the value and units of a named parameter within this observation that + * has a multiplicity greater than 1. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return An Amount with value and units. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Collection getValues(String paramName) { + return null; + } + + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } + + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } + + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } + + @Override + public String[] getStrings(String paramName) { + if ("SCV".matches(paramName)) { + ArrayList skyCoverage = new ArrayList(); + for (SkyCover sky : this.skyCoverage) { + skyCoverage.add(sky.getType()); + } + if (skyCoverage.size() > 0) { + return skyCoverage.toArray(new String[skyCoverage.size()]); + } + } else if ("WX".matches(paramName)) { + if (this.weatherKey != null) { + String[] presentWeather = { this.weatherKey }; + return presentWeather; + } + } else if (paramName.startsWith("CLD")) { + int start = "CLD".length(); + int index = Integer.parseInt(paramName.substring(start)); + String[] retVal = { "BLNK" }; + if (index < skyCoverage.size()) { + if (getSkyCover(index).getType() != null) { + retVal[0] = getSkyCover(index).getType(); + } + } + return retVal; + } else if (paramName.matches("CCHAR") && (pressChangeChar != null)) { + String[] changeChar = { pressChangeChar }; + return changeChar; + } + return null; + } + + @Override + public int hashCode() { + final int PRIME = 31; + int result = 1; + result = (PRIME * result) + Float.floatToIntBits(altimeter); + result = (PRIME * result) + Float.floatToIntBits(altimeterInPa); + result = (PRIME * result) + + ((autoStationType == null) ? 0 : autoStationType.hashCode()); + result = (PRIME * result) + + ((correction == null) ? 0 : correction.hashCode()); + result = (PRIME * result) + dewPoint; + result = (PRIME * result) + Float.floatToIntBits(dewPointFromTenths); + result = (PRIME * result) + Float.floatToIntBits(maxTemp24Hour); + result = (PRIME * result) + Float.floatToIntBits(minTemp24Hour); + result = (PRIME * result) + + ((nominalTime == null) ? 0 : nominalTime.hashCode()); + result = (PRIME * result) + Float.floatToIntBits(precip1Hour); + result = (PRIME * result) + Float.floatToIntBits(precip3Hour); + result = (PRIME * result) + Float.floatToIntBits(precip6Hour); + result = (PRIME * result) + Float.floatToIntBits(pressChange3Hour); + result = (PRIME * result) + + ((pressChangeChar == null) ? 0 : pressChangeChar.hashCode()); + result = (PRIME * result) + + ((refHour == null) ? 0 : refHour.hashCode()); + result = (PRIME * result) + + ((reportType == null) ? 0 : reportType.hashCode()); + result = (PRIME * result) + Float.floatToIntBits(seaLevelPress); + result = (PRIME * result) + + ((skyCoverage == null) ? 0 : skyCoverage.hashCode()); + result = (PRIME * result) + ((skyKey == null) ? 0 : skyKey.hashCode()); + result = (PRIME * result) + skyLayerBase; + result = (PRIME * result) + + ((getStationId() == null) ? 0 : getStationId().hashCode()); + long temp; + temp = Double.doubleToLongBits(getLatitude()); + result = (PRIME * result) + (int) (temp ^ (temp >>> 32)); + temp = Double.doubleToLongBits(getLongitude()); + result = (PRIME * result) + (int) (temp ^ (temp >>> 32)); + result = (PRIME * result) + Float.floatToIntBits(tempFromTenths); + result = (PRIME * result) + temperature; + result = (PRIME * result) + + ((timeObs == null) ? 0 : timeObs.hashCode()); + result = (PRIME * result) + vertVisibility; + result = (PRIME * result) + +Float.floatToIntBits(visibility); + + result = (PRIME * result) + + ((weatherCondition == null) ? 0 : weatherCondition.hashCode()); + result = (PRIME * result) + + ((weatherKey == null) ? 0 : weatherKey.hashCode()); + result = (PRIME * result) + + ((windDir == null) ? 0 : windDir.hashCode()); + result = (PRIME * result) + windGust; + result = (PRIME * result) + windSpeed; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + final MetarRecord other = (MetarRecord) obj; + if (Float.floatToIntBits(altimeter) != Float + .floatToIntBits(other.altimeter)) { + return false; + } + if (Float.floatToIntBits(altimeterInPa) != Float + .floatToIntBits(other.altimeterInPa)) { + return false; + } + if (autoStationType == null) { + if (other.autoStationType != null) { + return false; + } + } else if (!autoStationType.equals(other.autoStationType)) { + return false; + } + if (correction == null) { + if (other.correction != null) { + return false; + } + } else if (!correction.equals(other.correction)) { + return false; + } + if (dewPoint != other.dewPoint) { + return false; + } + if (Float.floatToIntBits(dewPointFromTenths) != Float + .floatToIntBits(other.dewPointFromTenths)) { + return false; + } + if (Float.floatToIntBits(maxTemp24Hour) != Float + .floatToIntBits(other.maxTemp24Hour)) { + return false; + } + if (Float.floatToIntBits(minTemp24Hour) != Float + .floatToIntBits(other.minTemp24Hour)) { + return false; + } + if (nominalTime == null) { + if (other.nominalTime != null) { + return false; + } + } else if (!nominalTime.equals(other.nominalTime)) { + return false; + } + if (Float.floatToIntBits(precip1Hour) != Float + .floatToIntBits(other.precip1Hour)) { + return false; + } + if (Float.floatToIntBits(precip3Hour) != Float + .floatToIntBits(other.precip3Hour)) { + return false; + } + if (Float.floatToIntBits(precip6Hour) != Float + .floatToIntBits(other.precip6Hour)) { + return false; + } + if (Float.floatToIntBits(pressChange3Hour) != Float + .floatToIntBits(other.pressChange3Hour)) { + return false; + } + if (pressChangeChar == null) { + if (other.pressChangeChar != null) { + return false; + } + } else if (!pressChangeChar.equals(other.pressChangeChar)) { + return false; + } + if (refHour == null) { + if (other.refHour != null) { + return false; + } + } else if (!refHour.equals(other.refHour)) { + return false; + } + if (reportType == null) { + if (other.reportType != null) { + return false; + } + } else if (!reportType.equals(other.reportType)) { + return false; + } + if (Float.floatToIntBits(seaLevelPress) != Float + .floatToIntBits(other.seaLevelPress)) { + return false; + } + if (skyCoverage == null) { + if (other.skyCoverage != null) { + return false; + } + } else if (!skyCoverage.equals(other.skyCoverage)) { + return false; + } + if (skyKey == null) { + if (other.skyKey != null) { + return false; + } + } else if (!skyKey.equals(other.skyKey)) { + return false; + } + if (skyLayerBase != other.skyLayerBase) { + return false; + } + + if (getStationId() == null) { + if (other.getStationId() != null) { + return false; + } + } else if (!getStationId().equals(other.getStationId())) { + return false; + } + + Double lat = location.getLatitude(); + if (lat == null) { + if (other.location.getLatitude() != null) { + return false; + } + } else { + if (!lat.equals(other.location.getLatitude())) { + return false; + } + } + Double lon = location.getLongitude(); + if (lon == null) { + if (other.location.getLongitude() != null) { + return false; + } + } else { + if (!lon.equals(other.location.getLongitude())) { + return false; + } + } + + if (Float.floatToIntBits(tempFromTenths) != Float + .floatToIntBits(other.tempFromTenths)) { + return false; + } + if (temperature != other.temperature) { + return false; + } + if (timeObs == null) { + if (other.timeObs != null) { + return false; + } + } else if (!timeObs.equals(other.timeObs)) { + return false; + } + if (vertVisibility != other.vertVisibility) { + return false; + } + if (Float.floatToIntBits(visibility) != Float + .floatToIntBits(other.visibility)) { + return false; + } + + if (weatherCondition == null) { + if (other.weatherCondition != null) { + return false; + } + } else if (!weatherCondition.equals(other.weatherCondition)) { + return false; + } + if (weatherKey == null) { + if (other.weatherKey != null) { + return false; + } + } else if (!weatherKey.equals(other.weatherKey)) { + return false; + } + if (windDir == null) { + if (other.windDir != null) { + return false; + } + } else if (!windDir.equals(other.windDir)) { + return false; + } + if (windGust != other.windGust) { + return false; + } + if (windSpeed != other.windSpeed) { + return false; + } + return true; + } + + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } + + public SurfaceObsLocation getLocation() { + return location; + } + + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } + + public String getReport() { + return report; + } + + public void setReport(String report) { + this.report = report; + } + + /** + * + * @return + */ + public String getWmoHeader() { + return wmoHeader; + } + + /** + * + * @param header + */ + public void setWmoHeader(String header) { + wmoHeader = header; + } + + @Override + public void setMessageData(Object message) { + this.messageData = message; + this.report = (String) message; + } + + @Override + public String getMessageData() { + if ((sampleType != null) && sampleType.equals("PR")) { + return getStationId(); + } + return report; + } + + private SkyCover getSkyCover(int index) { + if (!isSkyCoverageSorted) { + isSkyCoverageSorted = true; + sort(skyCoverage); + } + SkyCover[] sc = skyCoverage.toArray(new SkyCover[skyCoverage.size()]); + return sc[index]; + + } + + public void sort(Set skySet) { + SortedSet skSet = new TreeSet(); + for (SkyCover sc : skySet) { + skSet.add(sc); + } + + skyCoverage = skSet; + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() + */ + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon + * .uf.common.pointdata.PointDataView) + */ + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + + public static Set getAvailableParameters() { + return PARM_MAP.keySet(); + } - /** - * Maps common AWIPS I keys to IDecoderGettable and newer parameter key - * constants - */ - private static final HashMap PARM_MAP = new HashMap(); - static { - PARM_MAP.put(LegacyParameterKey.TEMPERATURE, SFC_TEMP); - PARM_MAP.put(LegacyParameterKey.DEW_POINT, SFC_DWPT); - PARM_MAP.put(LegacyParameterKey.WIND_SPEED, SFC_WNDSPD); - PARM_MAP.put(LegacyParameterKey.WIND_DIRECTION, SFC_WNDDIR); - PARM_MAP.put(LegacyParameterKey.WIND_GUST, SFC_WNDGST); - PARM_MAP.put(LegacyParameterKey.ALTIMETER, ParameterKey.SFC_ALTIMETER); - PARM_MAP.put(LegacyParameterKey.SEA_LEVEL_PRESSURE, PRES_SLP); - PARM_MAP.put("NLAT", STA_LAT); - PARM_MAP.put("NLON", STA_LON); - PARM_MAP.put(LegacyParameterKey.PRESSURE_CHANGE_3HR, - ParameterKey.PRESSURE_CHANGE); - // PARM_MAP.put("T24", "T24"); // not used - // PARM_MAP.put("DpT24", "DpT24"); // not used - // PARM_MAP.put("WS24", "WS24"); // not used - // PARM_MAP.put("WD24", "WD24"); // not used - // PARM_MAP.put("WGS24", "WGS24"); // not used - // PARM_MAP.put("ASET24", "ASET24"); // not used - // PARM_MAP.put("HIWC", "HIWC"); // not used - PARM_MAP.put(LegacyParameterKey.VISABILITY, ParameterKey.VISIBILITY); - PARM_MAP.put(LegacyParameterKey.PRECIPITATION_1HR, - ParameterKey.PRECIPITATION_1HR); - PARM_MAP.put(LegacyParameterKey.PRECIPITATION_3HR, - ParameterKey.PRECIPITATION_3HR); - PARM_MAP.put(LegacyParameterKey.PRECIPITATION_6HR, - ParameterKey.PRECIPITATION_6HR); - PARM_MAP.put(LegacyParameterKey.PRECIPITATION_24HR, - ParameterKey.PRECIPITATION_24HR); - } - - @Transient - private String sampleType = null; - - @Transient - private boolean isSkyCoverageSorted = false; - - @XmlElement - @DynamicSerializeElement - @Transient - private String report; - - @XmlElement - @DynamicSerializeElement - @Transient - private String wmoHeader; - - /** Nominal Time extracted from WMO header * */ - @XmlElement - @DynamicSerializeElement - @Transient - private String nominalTime; - - /** A string denoting the time of observation */ - @XmlElement - @DynamicSerializeElement - @Transient - private Calendar timeObs; - - /** Report type extracted from WMO header * */ - @XmlElement - @DynamicSerializeElement - @Column - @DataURI(position = 1) - protected String reportType; - - /** A string denoting if this report is a correction */ - @XmlElement - @DynamicSerializeElement - @Column - @DataURI(position = 2) - private String correction; - - @Embedded - @DataURI(position = 3, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; - - /** A string denoting the type of automated station (AO1 or AO2) */ - @XmlElement - @DynamicSerializeElement - @Transient - private String autoStationType; - - @XmlElement - @DynamicSerializeElement - @Transient - private String skyKey; - - @XmlElement - @DynamicSerializeElement - @Transient - private Set skyCoverage = new HashSet(); - - /** A string denoting the vertical visibility */ - @XmlElement - @DynamicSerializeElement - @Transient - private int vertVisibility = -9999; - - /** A string denoting the lowest layer of clouds */ - @XmlElement - @DynamicSerializeElement - @Transient - private int skyLayerBase = -9999; - - /** The visibility in statute miles */ - @XmlElement - @DynamicSerializeElement - @Transient - private float visibility = -9999; - - /** A String used as the foreign key to the present weather table * */ - @XmlElement - @DynamicSerializeElement - @Transient - private String weatherKey; - - /** A Set of present weather conditions * */ - @DynamicSerializeElement - @XmlElement - @Transient - private List weatherCondition = new ArrayList(); - - /** A string denoting the sea level pressure in millibars */ - @XmlElement - @DynamicSerializeElement - @Transient - private float seaLevelPress = -9999; - - /** A string denoting the temperature in degrees Celsius */ - @XmlElement - @DynamicSerializeElement - @Transient - private int temperature = -9999; - - /** A string denoting the current temperature in tenths of degrees Celsius */ - @XmlElement - @DynamicSerializeElement - @Transient - private float tempFromTenths = -9999; - - /** A string denoting the current dew point in degrees Celsius */ - @XmlElement - @DynamicSerializeElement - @Transient - private int dewPoint = -9999; - - /** A string denoting the current dew point in tenths of degrees Celsius */ - @XmlElement - @DynamicSerializeElement - @Transient - private float dewPointFromTenths = -9999; - - @XmlElement - @DynamicSerializeElement - @Transient - private String windDir; - - @XmlElement - @DynamicSerializeElement - @Transient - private int windSpeed = -9999; - - @XmlElement - @DynamicSerializeElement - @Transient - private int windGust = -9999; - - @XmlElement - @DynamicSerializeElement - @Transient - private int pkWndDir = -9999; - - @XmlElement - @DynamicSerializeElement - @Transient - private int pkWndSpd = -9999; - - @XmlElement - @DynamicSerializeElement - @Transient - private Calendar pkWndTime = null; - - @XmlElement - @DynamicSerializeElement - @Transient - private float altimeterInPa = -9999; - - @XmlElement - @DynamicSerializeElement - @Transient - private float altimeter = -9999; - - @XmlElement - @DynamicSerializeElement - @Transient - private float minTemp24Hour = -9999; - - @XmlElement - @DynamicSerializeElement - @Transient - private float maxTemp24Hour = -9999; - - @XmlElement - @DynamicSerializeElement - @Transient - private float minTemp6Hour = -9999; - - @XmlElement - @DynamicSerializeElement - @Transient - private float maxTemp6Hour = -9999; - - /** A string denoting inches of precipitation observed in the last hour */ - @XmlElement - @DynamicSerializeElement - @Transient - private float precip1Hour = -9999; - - /** A string denoting inches of precipitation observed in the last 3 hours */ - @XmlElement - @DynamicSerializeElement - @Transient - private float precip3Hour = -9999; - - /** A string denoting inches of precipitation observed in the last 6 hours */ - @XmlElement - @DynamicSerializeElement - @Transient - private float precip6Hour = -9999; - - /** A string denoting inches of precipitation observed in the last 24 hours */ - @XmlElement - @DynamicSerializeElement - @Transient - private float precip24Hour = -9999; - - /** A string denoting the pressure tendency(rising or falling) */ - @XmlElement - @DynamicSerializeElement - @Transient - private String pressChangeChar; - - /** A string denoting the pressure change observed in the past 3 hrs. */ - @XmlElement - @DynamicSerializeElement - @Transient - private float pressChange3Hour = -9999; - - // Amount of snow on the ground in inches. - @XmlElement - @DynamicSerializeElement - @Transient - private int snowDepth = -9999; - - // Water equivalent in 0.1 inch increments. - @XmlElement - @DynamicSerializeElement - @Transient - private float snowWater = -9999; - - // Snow fall last 6 hours. - @XmlElement - @DynamicSerializeElement - @Transient - private float snowFall_6Hours = -9999; - - // Number of minutes of sunshine. - @XmlElement - @DynamicSerializeElement - @Transient - private int sunshine = -9999; - - @XmlElement - @DynamicSerializeElement - @Column - private Calendar refHour; - - @DynamicSerializeElement - @Embedded - private PointDataView pointDataView; - - public MetarRecord() { - } - - /** - * Constructs a metar record from a dataURI - * - * @param uri - * The dataURI - * @param tableDef - * The table definition associated with this class - */ - public MetarRecord(String uri) { - super(uri); - } - - /** - * @return the serialVersionUID - */ - public static long getSerialVersionUID() { - return serialVersionUID; - } - - /** - * @return the altimeter - */ - public float getAltimeter() { - return altimeter; - } - - /** - * @param altimeter - * the altimeter to set - */ - public void setAltimeter(float altimeter) { - this.altimeter = altimeter; - } - - /** - * @return the altimeterInPa - */ - public float getAltimeterInPa() { - return altimeterInPa; - } - - /** - * @param altimeterInPa - * the altimeterInPa to set - */ - public void setAltimeterInPa(float altimeterInPa) { - this.altimeterInPa = altimeterInPa; - } - - /** - * @return the autoStationType - */ - public String getAutoStationType() { - return autoStationType; - } - - /** - * @param autoStationType - * the autoStationType to set - */ - public void setAutoStationType(String autoStationType) { - this.autoStationType = autoStationType; - } - - /** - * @return the correction - */ - public String getCorrection() { - return correction; - } - - /** - * @param correction - * the correction to set - */ - public void setCorrection(String correction) { - this.correction = correction; - } - - /** - * @return the dewPoint - */ - public int getDewPoint() { - return dewPoint; - } - - /** - * @param dewPoint - * the dewPoint to set - */ - public void setDewPoint(int dewPoint) { - this.dewPoint = dewPoint; - } - - /** - * @return the dewPointFromTenths - */ - public float getDewPointFromTenths() { - return dewPointFromTenths; - } - - /** - * @param dewPointFromTenths - * the dewPointFromTenths to set - */ - public void setDewPointFromTenths(float dewPointFromTenths) { - this.dewPointFromTenths = dewPointFromTenths; - } - - /** - * @return the maxTemp24Hour - */ - public float getMaxTemp24Hour() { - return maxTemp24Hour; - } - - /** - * @param maxTemp24Hour - * the maxTemp24Hour to set - */ - public void setMaxTemp24Hour(float maxTemp24Hour) { - this.maxTemp24Hour = maxTemp24Hour; - } - - /** - * @return the minTemp24Hour - */ - public float getMinTemp24Hour() { - return minTemp24Hour; - } - - /** - * @param minTemp24Hour - * the minTemp24Hour to set - */ - public void setMinTemp24Hour(float minTemp24Hour) { - this.minTemp24Hour = minTemp24Hour; - } - - /** - * @return the minTemp6Hour - */ - public float getMinTemp6Hour() { - return minTemp6Hour; - } - - /** - * @param minTemp6Hour - * the minTemp6Hour to set - */ - public void setMinTemp6Hour(float minTemp6Hour) { - this.minTemp6Hour = minTemp6Hour; - } - - /** - * @return the maxTemp6Hour - */ - public float getMaxTemp6Hour() { - return maxTemp6Hour; - } - - /** - * @param maxTemp6Hour - * the maxTemp6Hour to set - */ - public void setMaxTemp6Hour(float maxTemp6Hour) { - this.maxTemp6Hour = maxTemp6Hour; - } - - /** - * @return the precip1Hour - */ - public float getPrecip1Hour() { - return precip1Hour; - } - - /** - * @param precip1Hour - * the precip1Hour to set - */ - public void setPrecip1Hour(float precip1Hour) { - this.precip1Hour = precip1Hour; - } - - /** - * @return the precip3Hour - */ - public float getPrecip3Hour() { - return precip3Hour; - } - - /** - * @param precip3Hour - * the precip3Hour to set - */ - public void setPrecip3Hour(float precip3Hour) { - this.precip3Hour = precip3Hour; - } - - /** - * @return the precip6Hour - */ - public float getPrecip6Hour() { - return precip6Hour; - } - - /** - * @param precip6Hour - * the precip6Hour to set - */ - public void setPrecip6Hour(float precip6Hour) { - this.precip6Hour = precip6Hour; - } - - /** - * @return the precip24Hour - */ - public float getPrecip24Hour() { - return precip24Hour; - } - - /** - * @param precip24Hour - * the precip24Hour to set - */ - public void setPrecip24Hour(float precip24Hour) { - this.precip24Hour = precip24Hour; - } - - /** - * @return the pressChange3Hour - */ - public float getPressChange3Hour() { - return pressChange3Hour; - } - - /** - * @param pressChange3Hour - * the pressChange3Hour to set - */ - public void setPressChange3Hour(float pressChange3Hour) { - this.pressChange3Hour = pressChange3Hour; - } - - /** - * @return the pressChangeChar - */ - public String getPressChangeChar() { - return pressChangeChar; - } - - /** - * @param pressChangeChar - * the pressChangeChar to set - */ - public void setPressChangeChar(String pressChangeChar) { - this.pressChangeChar = pressChangeChar; - } - - /** - * @return the seaLevelPress - */ - public float getSeaLevelPress() { - return seaLevelPress; - } - - /** - * @param seaLevelPress - * the seaLevelPress to set - */ - public void setSeaLevelPress(float seaLevelPress) { - this.seaLevelPress = seaLevelPress; - } - - /** - * @return the skyLayerBase - */ - public int getSkyLayerBase() { - return skyLayerBase; - } - - /** - * @param skyLayerBase - * the skyLayerBase to set - */ - public void setSkyLayerBase(int skyLayerBase) { - this.skyLayerBase = skyLayerBase; - } - - /** - * @return the temperature - */ - public int getTemperature() { - return temperature; - } - - /** - * @param temperature - * the temperature to set - */ - public void setTemperature(int temperature) { - this.temperature = temperature; - } - - /** - * @return the tempFromTenths - */ - public float getTempFromTenths() { - return tempFromTenths; - } - - /** - * @param tempFromTenths - * the tempFromTenths to set - */ - public void setTempFromTenths(float tempFromTenths) { - this.tempFromTenths = tempFromTenths; - } - - /** - * @return the vertVisibility - */ - public int getVertVisibility() { - return vertVisibility; - } - - /** - * @param vertVisibility - * the vertVisibility to set - */ - public void setVertVisibility(int vertVisibility) { - this.vertVisibility = vertVisibility; - } - - /** - * @return the visibility - */ - public float getVisibility() { - - return visibility; - } - - /** - * @param visibility - * the visibility to set - */ - public void setVisibility(float visibility) { - this.visibility = visibility; - } - - /** - * @return the windDir - */ - public String getWindDir() { - return windDir; - } - - /** - * @param windDir - * the windDir to set - */ - public void setWindDir(String windDir) { - this.windDir = windDir; - } - - /** - * @return the windGust - */ - public int getWindGust() { - return windGust; - } - - /** - * @param windGust - * the windGust to set - */ - public void setWindGust(int windGust) { - this.windGust = windGust; - } - - /** - * @return the windSpeed - */ - public int getWindSpeed() { - return windSpeed; - } - - /** - * @param windSpeed - * the windSpeed to set - */ - public void setWindSpeed(int windSpeed) { - this.windSpeed = windSpeed; - } - - /** - * @return the pkWndDir - */ - public int getPkWndDir() { - return pkWndDir; - } - - /** - * @param pkWndDir - * the pkWndDir to set - */ - public void setPkWndDir(int pkWndDir) { - this.pkWndDir = pkWndDir; - } - - /** - * @return the pkWndSpd - */ - public int getPkWndSpd() { - return pkWndSpd; - } - - /** - * @param pkWndSpd - * the pkWndSpd to set - */ - public void setPkWndSpd(int pkWndSpd) { - this.pkWndSpd = pkWndSpd; - } - - /** - * @return the pkWndTime - */ - public Calendar getPkWndTime() { - return pkWndTime; - } - - /** - * @param pkWndTime - * the pkWndTime to set - */ - public void setPkWndTime(Calendar pkWndTime) { - this.pkWndTime = pkWndTime; - } - - /** - * @return the timeObs - */ - public Calendar getTimeObs() { - if (this.dataTime == null) { - return null; - } - return this.dataTime.getRefTimeAsCalendar(); - } - - /** - * @param timeObs - * the timeObs to set - */ - public void setTimeObs(Calendar timeObs) { - this.nominalTime = TimeUtil.formatCalendar(timeObs); - this.timeObs = timeObs; - } - - /** - * @return the skyCoverage - */ - public Set getSkyCoverage() { - return skyCoverage; - } - - /** - * @param skyCoverage - * the skyCoverage to set - */ - public void setSkyCoverage(Set skyCoverage) { - this.skyCoverage = skyCoverage; - } - - public void addSkyCoverage(SkyCover cover) { - skyCoverage.add(cover); - cover.setParentMetar(this); - } - - /** - * @return the skyKey - */ - public String getSkyKey() { - return skyKey; - } - - /** - * @param skyKey - * the skyKey to set - */ - public void setSkyKey(String skyKey) { - this.skyKey = skyKey; - } - - /** - * @return the weatherCondition - */ - public List getWeatherCondition() { - return weatherCondition; - } - - /** - * @param weatherCondition - * the weatherCondition to set - */ - public void setWeatherCondition(List weatherCondition) { - this.weatherCondition = weatherCondition; - } - - public void addWeatherCondition(WeatherCondition condition) { - this.weatherCondition.add(condition); - condition.setParentMetar(this); - } - - /** - * @return the weatherKey - */ - public String getWeatherKey() { - return weatherKey; - } - - /** - * @param weatherKey - * the weatherKey to set - */ - public void setWeatherKey(String weatherKey) { - this.weatherKey = weatherKey; - } - - /** - * @return the refHour - */ - public Calendar getRefHour() { - return refHour; - } - - /** - * @param refHour - * the refHour to set - */ - public void setRefHour(Calendar refHour) { - this.refHour = refHour; - } - - /** - * @return the snowDepth - */ - public int getSnowDepth() { - return snowDepth; - } - - /** - * @param snowDepth - * the snowDepth to set - */ - public void setSnowDepth(int snowDepth) { - this.snowDepth = snowDepth; - } - - /** - * @return the snowFall_6Hours - */ - public float getSnowFall_6Hours() { - return snowFall_6Hours; - } - - /** - * @param snowFall_6Hours - * the snowFall_6Hours to set - */ - public void setSnowFall_6Hours(float snowFall_6Hours) { - this.snowFall_6Hours = snowFall_6Hours; - } - - /** - * @return the sunshine - */ - public int getSunshine() { - return sunshine; - } - - /** - * @param sunshine - * the sunshine to set - */ - public void setSunshine(int sunshine) { - this.sunshine = sunshine; - } - - /** - * @return the snowWater - */ - public float getSnowWater() { - return snowWater; - } - - /** - * @param snowWater - * the snowWater to set - */ - public void setSnowWater(float snowWater) { - this.snowWater = snowWater; - } - - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - this.identifier = dataURI; - // set the parentID to the dataURI for all values - if (this.getWeatherCondition() != null - && this.getWeatherCondition().size() > 0) { - for (Iterator iter = this.getWeatherCondition() - .iterator(); iter.hasNext();) { - WeatherCondition cond = iter.next(); - cond.setParentMetar(this); - } - } - - // set the parentID to the dataURI for all values - if (this.getSkyCoverage() != null && this.getSkyCoverage().size() > 0) { - for (Iterator iter = this.getSkyCoverage().iterator(); iter - .hasNext();) { - SkyCover cover = iter.next(); - cover.setParentMetar(this); - } - } - } - - public String getReportType() { - return reportType; - } - - public void setReportType(String reportType) { - this.reportType = reportType; - } - - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } - - public String getNominalTime() { - return nominalTime; - } - - public void setNominalTime(String nominalTime) { - this.nominalTime = nominalTime; - } - - /** - * Get the IDecoderGettable reference for this record. - * - * @return The IDecoderGettable reference for this record. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return this; - } - - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public String getString(String paramName) { - if ("STA".matches(paramName)) { - return getStationId(); - } - if ("WX".matches(paramName)) { - return this.weatherKey; - } - - return null; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.common.dataplugin.IDecoderGettable#getValue(java.lang - * .String) - */ - @Override - public Amount getValue(String paramName) { - Amount a = null; - - String pName = paramName; - if (PARM_MAP.containsKey(paramName)) { - // we have recieved an AWIPS I parameter name - pName = PARM_MAP.get(paramName); - } - - if (SFC_TEMP.equals(pName)) { - if (tempFromTenths != -9999) { - a = new Amount(tempFromTenths, TEMPERATURE_UNIT); - } else if (temperature != -9999) { - a = new Amount(temperature, TEMPERATURE_UNIT); - } - } else if (SFC_DWPT.equals(pName)) { - if (dewPointFromTenths != -9999) { - a = new Amount(dewPointFromTenths, TEMPERATURE_UNIT); - } else if (dewPoint != -9999) { - a = new Amount(dewPoint, TEMPERATURE_UNIT); - } - } else if (SFC_WNDSPD.equals(pName)) { - a = new Amount(windSpeed, WIND_SPEED_UNIT); - } else if (SFC_WNDGST.equals(pName)) { - a = new Amount(windGust, WIND_SPEED_UNIT); - } else if (ParameterKey.PRESSURE_CHANGE.equals(pName) - && pressChange3Hour != -9999) { - a = new Amount(pressChange3Hour, PRESSURE_UNIT); - } else if (SFC_WNDDIR.equals(pName)) { - String windDir = getWindDir(); - if (windDir != null && !windDir.equalsIgnoreCase("VRB")) { - Double result = Double.parseDouble(windDir); - a = new Amount(result, WIND_DIR_UNIT); - } - } else if (PRES_ALTSG.equals(pName)) { - a = new Amount(altimeterInPa, ALTIMETER_UNIT); - } else if (STA_LAT.equals(pName)) { - a = new Amount(getLatitude(), LOCATION_UNIT); - } else if (STA_LON.equals(pName)) { - a = new Amount(getLongitude(), LOCATION_UNIT); - } else if (PRES_SLP.equals(pName)) { - a = new Amount(this.seaLevelPress, PRESSURE_UNIT); - } else if (pName.startsWith("HGT")) { - int start = "HGT".length(); - int index = Integer.parseInt(pName.substring(start)); - if (index < skyCoverage.size() - && getSkyCover(index).getHeight() != null) { - a = new Amount(getSkyCover(index).getHeight(), HEIGHT_UNIT); - } - } else if (pName.startsWith("HMSL")) { - int start = "HMSL".length(); - int index = Integer.parseInt(pName.substring(start)); - if (index < skyCoverage.size() - && getSkyCover(index).getHeight() != null - && getSpatialObject() != null - && getSpatialObject().getElevation() != null) { - a = new Amount(getSkyCover(index).getHeight() - + getSpatialObject().getElevation(), HEIGHT_UNIT); - } - } else if (ParameterKey.PRECIPITATION_1HR.equals(pName) - || ParameterKey.PRECIPITATION_24HR.equals(pName)) { - sampleType = "PR"; - if (precip1Hour != -9999) { - a = new Amount(precip1Hour, PRECIP_UNIT); - } - } else if (ParameterKey.PRECIPITATION_3HR.equals(pName)) { - sampleType = "PR"; - if (precip3Hour != -9999) { - a = new Amount(precip3Hour, PRECIP_UNIT); - } - } else if (ParameterKey.PRECIPITATION_6HR.equals(pName)) { - sampleType = "PR"; - if (precip6Hour != -9999) { - a = new Amount(precip6Hour, PRECIP_UNIT); - } - } else if (ParameterKey.VISIBILITY.equals(pName)) { - a = new Amount(visibility, VISIBILITY_UNIT); - } - - return a; - } - - /** - * Get the value and units of a named parameter within this observation that - * has a multiplicity greater than 1. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return An Amount with value and units. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Collection getValues(String paramName) { - return null; - } - - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } - - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } - - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } - - @Override - public String[] getStrings(String paramName) { - if ("SCV".matches(paramName)) { - ArrayList skyCoverage = new ArrayList(); - for (SkyCover sky : this.skyCoverage) { - skyCoverage.add(sky.getType()); - } - if (skyCoverage.size() > 0) { - return skyCoverage.toArray(new String[skyCoverage.size()]); - } - } else if ("WX".matches(paramName)) { - if (this.weatherKey != null) { - String[] presentWeather = { this.weatherKey }; - return presentWeather; - } - } else if (paramName.startsWith("CLD")) { - int start = "CLD".length(); - int index = Integer.parseInt(paramName.substring(start)); - String[] retVal = { "BLNK" }; - if (index < skyCoverage.size()) { - if (getSkyCover(index).getType() != null) { - retVal[0] = getSkyCover(index).getType(); - } - } - return retVal; - } else if (paramName.matches("CCHAR") && pressChangeChar != null) { - String[] changeChar = { pressChangeChar }; - return changeChar; - } - return null; - } - - @Override - public int hashCode() { - final int PRIME = 31; - int result = 1; - result = PRIME * result + Float.floatToIntBits(altimeter); - result = PRIME * result + Float.floatToIntBits(altimeterInPa); - result = PRIME * result - + ((autoStationType == null) ? 0 : autoStationType.hashCode()); - result = PRIME * result - + ((correction == null) ? 0 : correction.hashCode()); - result = PRIME * result + dewPoint; - result = PRIME * result + Float.floatToIntBits(dewPointFromTenths); - result = PRIME * result + Float.floatToIntBits(maxTemp24Hour); - result = PRIME * result + Float.floatToIntBits(minTemp24Hour); - result = PRIME * result - + ((nominalTime == null) ? 0 : nominalTime.hashCode()); - result = PRIME * result + Float.floatToIntBits(precip1Hour); - result = PRIME * result + Float.floatToIntBits(precip3Hour); - result = PRIME * result + Float.floatToIntBits(precip6Hour); - result = PRIME * result + Float.floatToIntBits(pressChange3Hour); - result = PRIME * result - + ((pressChangeChar == null) ? 0 : pressChangeChar.hashCode()); - result = PRIME * result + ((refHour == null) ? 0 : refHour.hashCode()); - result = PRIME * result - + ((reportType == null) ? 0 : reportType.hashCode()); - result = PRIME * result + Float.floatToIntBits(seaLevelPress); - result = PRIME * result - + ((skyCoverage == null) ? 0 : skyCoverage.hashCode()); - result = PRIME * result + ((skyKey == null) ? 0 : skyKey.hashCode()); - result = PRIME * result + skyLayerBase; - result = PRIME * result - + ((getStationId() == null) ? 0 : getStationId().hashCode()); - long temp; - temp = Double.doubleToLongBits(getLatitude()); - result = PRIME * result + (int) (temp ^ (temp >>> 32)); - temp = Double.doubleToLongBits(getLongitude()); - result = PRIME * result + (int) (temp ^ (temp >>> 32)); - result = PRIME * result + Float.floatToIntBits(tempFromTenths); - result = PRIME * result + temperature; - result = PRIME * result + ((timeObs == null) ? 0 : timeObs.hashCode()); - result = PRIME * result + vertVisibility; - result = PRIME * result + +Float.floatToIntBits(visibility); - - result = PRIME - * result - + ((weatherCondition == null) ? 0 : weatherCondition.hashCode()); - result = PRIME * result - + ((weatherKey == null) ? 0 : weatherKey.hashCode()); - result = PRIME * result + ((windDir == null) ? 0 : windDir.hashCode()); - result = PRIME * result + windGust; - result = PRIME * result + windSpeed; - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final MetarRecord other = (MetarRecord) obj; - if (Float.floatToIntBits(altimeter) != Float - .floatToIntBits(other.altimeter)) { - return false; - } - if (Float.floatToIntBits(altimeterInPa) != Float - .floatToIntBits(other.altimeterInPa)) { - return false; - } - if (autoStationType == null) { - if (other.autoStationType != null) { - return false; - } - } else if (!autoStationType.equals(other.autoStationType)) { - return false; - } - if (correction == null) { - if (other.correction != null) { - return false; - } - } else if (!correction.equals(other.correction)) { - return false; - } - if (dewPoint != other.dewPoint) { - return false; - } - if (Float.floatToIntBits(dewPointFromTenths) != Float - .floatToIntBits(other.dewPointFromTenths)) { - return false; - } - if (Float.floatToIntBits(maxTemp24Hour) != Float - .floatToIntBits(other.maxTemp24Hour)) { - return false; - } - if (Float.floatToIntBits(minTemp24Hour) != Float - .floatToIntBits(other.minTemp24Hour)) { - return false; - } - if (nominalTime == null) { - if (other.nominalTime != null) { - return false; - } - } else if (!nominalTime.equals(other.nominalTime)) { - return false; - } - if (Float.floatToIntBits(precip1Hour) != Float - .floatToIntBits(other.precip1Hour)) { - return false; - } - if (Float.floatToIntBits(precip3Hour) != Float - .floatToIntBits(other.precip3Hour)) { - return false; - } - if (Float.floatToIntBits(precip6Hour) != Float - .floatToIntBits(other.precip6Hour)) { - return false; - } - if (Float.floatToIntBits(pressChange3Hour) != Float - .floatToIntBits(other.pressChange3Hour)) { - return false; - } - if (pressChangeChar == null) { - if (other.pressChangeChar != null) { - return false; - } - } else if (!pressChangeChar.equals(other.pressChangeChar)) { - return false; - } - if (refHour == null) { - if (other.refHour != null) { - return false; - } - } else if (!refHour.equals(other.refHour)) { - return false; - } - if (reportType == null) { - if (other.reportType != null) { - return false; - } - } else if (!reportType.equals(other.reportType)) { - return false; - } - if (Float.floatToIntBits(seaLevelPress) != Float - .floatToIntBits(other.seaLevelPress)) { - return false; - } - if (skyCoverage == null) { - if (other.skyCoverage != null) { - return false; - } - } else if (!skyCoverage.equals(other.skyCoverage)) { - return false; - } - if (skyKey == null) { - if (other.skyKey != null) { - return false; - } - } else if (!skyKey.equals(other.skyKey)) { - return false; - } - if (skyLayerBase != other.skyLayerBase) { - return false; - } - - if (getStationId() == null) { - if (other.getStationId() != null) { - return false; - } - } else if (!getStationId().equals(other.getStationId())) { - return false; - } - - Double lat = location.getLatitude(); - if (lat == null) { - if (other.location.getLatitude() != null) { - return false; - } - } else { - if (!lat.equals(other.location.getLatitude())) { - return false; - } - } - Double lon = location.getLongitude(); - if (lon == null) { - if (other.location.getLongitude() != null) { - return false; - } - } else { - if (!lon.equals(other.location.getLongitude())) { - return false; - } - } - - if (Float.floatToIntBits(tempFromTenths) != Float - .floatToIntBits(other.tempFromTenths)) { - return false; - } - if (temperature != other.temperature) { - return false; - } - if (timeObs == null) { - if (other.timeObs != null) { - return false; - } - } else if (!timeObs.equals(other.timeObs)) { - return false; - } - if (vertVisibility != other.vertVisibility) { - return false; - } - if (Float.floatToIntBits(visibility) != Float - .floatToIntBits(other.visibility)) { - return false; - } - - if (weatherCondition == null) { - if (other.weatherCondition != null) { - return false; - } - } else if (!weatherCondition.equals(other.weatherCondition)) { - return false; - } - if (weatherKey == null) { - if (other.weatherKey != null) { - return false; - } - } else if (!weatherKey.equals(other.weatherKey)) { - return false; - } - if (windDir == null) { - if (other.windDir != null) { - return false; - } - } else if (!windDir.equals(other.windDir)) { - return false; - } - if (windGust != other.windGust) { - return false; - } - if (windSpeed != other.windSpeed) { - return false; - } - return true; - } - - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } - - public SurfaceObsLocation getLocation() { - return location; - } - - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } - - public String getReport() { - return report; - } - - public void setReport(String report) { - this.report = report; - } - - /** - * - * @return - */ - public String getWmoHeader() { - return wmoHeader; - } - - /** - * - * @param header - */ - public void setWmoHeader(String header) { - wmoHeader = header; - } - - @Override - public void setMessageData(Object message) { - this.messageData = message; - this.report = (String) message; - } - - @Override - public String getMessageData() { - if (sampleType != null && sampleType.equals("PR")) { - return getStationId(); - } - return report; - } - - private SkyCover getSkyCover(int index) { - if (!isSkyCoverageSorted) { - isSkyCoverageSorted = true; - sort(skyCoverage); - } - SkyCover[] sc = skyCoverage.toArray(new SkyCover[skyCoverage.size()]); - return sc[index]; - - } - - public void sort(Set skySet) { - SortedSet skSet = new TreeSet(); - for (SkyCover sc : skySet) { - skSet.add(sc); - } - - skyCoverage = skSet; - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() - */ - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon - * .uf.common.pointdata.PointDataView) - */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } - - public static Set getAvailableParameters() { - return PARM_MAP.keySet(); - } @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "obs"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.pirep/src/com/raytheon/uf/common/dataplugin/pirep/PirepRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.pirep/src/com/raytheon/uf/common/dataplugin/pirep/PirepRecord.java index 0d9379d748..67ecda31bf 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.pirep/src/com/raytheon/uf/common/dataplugin/pirep/PirepRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.pirep/src/com/raytheon/uf/common/dataplugin/pirep/PirepRecord.java @@ -71,20 +71,21 @@ import com.vividsolutions.jts.geom.Geometry; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080103 384 jkorman Initial Coding. - * 20090408 952 jsanchez Updated getValue and getStrings methods. - * Added getMessageData method. - * 20090521 2338 jsanchez Changed the unit of the alititude. - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * ====================================== - * AWIPS2 DR Work - * 08/09/2012 1011 jkorman Added separate max icing level as well - * as separated code to generate distinct max icing/turbulence levels. Removed - * code that used "display" boolean to determine data access. - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Jan 03, 2008 384 jkorman Initial Coding. + * Apr 08, 2009 952 jsanchez Updated getValue and getStrings methods. + * Added getMessageData method. + * May 21, 2009 2338 jsanchez Changed the unit of the alititude. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Aug 09, 2012 1011 jkorman Added separate max icing level as well + * as separated code to generate distinct + * max icing/turbulence levels. Removed + * code that used "display" boolean to + * determine data access. + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. - * + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author jkorman @@ -97,12 +98,8 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "pirep", - indexes = { - @Index(name = "pirep_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "pirep", indexes = { @Index(name = "pirep_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -635,14 +632,14 @@ public class PirepRecord extends PluginDataObject implements ISpatialEnabled, a = new Amount(this.getLatitude(), LOCATION_UNIT); } else if (STA_LON.equals(pName)) { a = new Amount(this.getLongitude(), LOCATION_UNIT); - } else if (UA_FLTLVL.equals(pName) && getFlightLevel() != null) { + } else if (UA_FLTLVL.equals(pName) && (getFlightLevel() != null)) { a = new Amount(this.getFlightLevel().intValue(), ALTITUDE_UNIT); - } else if (UA_TOPHGT.equals(pName) && maxTurbcLayerData != null - && maxTurbcLayerData.getTopLayerHeight() != null) { + } else if (UA_TOPHGT.equals(pName) && (maxTurbcLayerData != null) + && (maxTurbcLayerData.getTopLayerHeight() != null)) { a = new Amount(maxTurbcLayerData.getTopLayerHeight().intValue(), ALTITUDE_UNIT); - } else if (UA_BOTHGT.equals(pName) && maxTurbcLayerData != null - && maxTurbcLayerData.getBaseLayerHeight() != null) { + } else if (UA_BOTHGT.equals(pName) && (maxTurbcLayerData != null) + && (maxTurbcLayerData.getBaseLayerHeight() != null)) { a = new Amount(maxTurbcLayerData.getBaseLayerHeight().intValue(), ALTITUDE_UNIT); } @@ -675,7 +672,7 @@ public class PirepRecord extends PluginDataObject implements ISpatialEnabled, retData = new String[] { intensity }; } } - } else if ("ICT".matches(paramName) && maxIcingLayerData != null) { + } else if ("ICT".matches(paramName) && (maxIcingLayerData != null)) { if (maxIcingLayerData != null) { String type = maxIcingLayerData.getDataType(); if (type != null) { @@ -791,7 +788,7 @@ public class PirepRecord extends PluginDataObject implements ISpatialEnabled, public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + result = (prime * result) + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); return result; } @@ -805,25 +802,34 @@ public class PirepRecord extends PluginDataObject implements ISpatialEnabled, */ @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } PirepRecord other = (PirepRecord) obj; if (getDataURI() == null) { if (other.getDataURI() != null) { return false; } - } else if (!getDataURI().equals(other.getDataURI())) + } else if (!getDataURI().equals(other.getDataURI())) { return false; + } return true; } + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } -} \ No newline at end of file + @Override + public String getPluginName() { + return "pirep"; + } +} diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.poessounding/src/com/raytheon/uf/common/dataplugin/poessounding/POESSounding.java b/edexOsgi/com.raytheon.uf.common.dataplugin.poessounding/src/com/raytheon/uf/common/dataplugin/poessounding/POESSounding.java index a21ff790f7..2bdbc8a8ec 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.poessounding/src/com/raytheon/uf/common/dataplugin/poessounding/POESSounding.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.poessounding/src/com/raytheon/uf/common/dataplugin/poessounding/POESSounding.java @@ -59,6 +59,7 @@ import com.vividsolutions.jts.geom.Geometry; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * May 15, 2013 1869 bsteffen Remove DataURI from goes/poes soundings. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -73,184 +74,174 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "poessounding", - indexes = { - @Index(name = "poessounding_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "poessounding", indexes = { @Index(name = "poessounding_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class POESSounding extends PersistablePluginDataObject implements ISpatialEnabled, IPointData { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - // The profiler observation time. - // @Column - // @DynamicSerializeElement - // @XmlElement - // private Calendar timeObs; + // Text of the WMO header + @Column(length = 32) + @DynamicSerializeElement + private String wmoHeader; - // @XmlAttribute - // @DynamicSerializeElement - // private Long fcstSeconds; + @Transient + private Set soundingLevels; - // Text of the WMO header - @Column(length = 32) - @DynamicSerializeElement - private String wmoHeader; + @Embedded + @DataURI(position = 1, embedded = true) + @DynamicSerializeElement + private SurfaceObsLocation location; - @Transient - private Set soundingLevels; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - @Embedded - @DataURI(position = 1, embedded = true) - @DynamicSerializeElement - private SurfaceObsLocation location; + /** + * Create an empty ProfilerObs object. + */ + public POESSounding() { + } - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public POESSounding(String uri) { + super(uri); + } - /** - * Create an empty ProfilerObs object. - */ - public POESSounding() { - } + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public POESSounding(String uri) { - super(uri); - } + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } + /** + * Was this location defined from the station catalog? False if not. + * + * @return Was this location defined from the station catalog? + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } + /** + * Set the WMOHeader of the file that contained this data. + * + * @return The wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * Was this location defined from the station catalog? False if not. - * - * @return Was this location defined from the station catalog? - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } + /** + * Get the WMOHeader of the file that contained this data. + * + * @param wmoHeader + * The WMOHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * Set the WMOHeader of the file that contained this data. - * - * @return The wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } + /** + * @return the soundingLevels + */ + public Set getSoundingLevels() { + return soundingLevels; + } - /** - * Get the WMOHeader of the file that contained this data. - * - * @param wmoHeader - * The WMOHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + /** + * @param soundingLevels + * the soundingLevels to set + */ + public void setSoundingLevels(Set soundingLevels) { + this.soundingLevels = soundingLevels; + } - /** - * @return the soundingLevels - */ - public Set getSoundingLevels() { - return soundingLevels; - } + /** + * @param soundingLevels + * the soundingLevels to set + */ + public void addSoundingLevel(POESSoundingLevel soundingLevel) { + if (soundingLevels == null) { + soundingLevels = new HashSet(); + } + soundingLevels.add(soundingLevel); + } - /** - * @param soundingLevels - * the soundingLevels to set - */ - public void setSoundingLevels(Set soundingLevels) { - this.soundingLevels = soundingLevels; - } + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } - /** - * @param soundingLevels - * the soundingLevels to set - */ - public void addSoundingLevel(POESSoundingLevel soundingLevel) { - if (soundingLevels == null) { - soundingLevels = new HashSet(); - } - soundingLevels.add(soundingLevel); - } + public SurfaceObsLocation getLocation() { + return location; + } - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } - public SurfaceObsLocation getLocation() { - return location; - } + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } - - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } - - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + @Override + public String getPluginName() { + return "poessounding"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.preciprate/src/com/raytheon/uf/common/dataplugin/preciprate/PrecipRateRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.preciprate/src/com/raytheon/uf/common/dataplugin/preciprate/PrecipRateRecord.java index 08e2c3dff4..001f24a6c4 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.preciprate/src/com/raytheon/uf/common/dataplugin/preciprate/PrecipRateRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.preciprate/src/com/raytheon/uf/common/dataplugin/preciprate/PrecipRateRecord.java @@ -75,12 +75,14 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 01/25/10 3796 D. Hladky Initial release - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 04/08/13 1293 bkowal Removed references to hdffileid. - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Jan 25, 2010 3796 D. Hladky Initial release + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -334,14 +336,14 @@ public class PrecipRateRecord extends PersistablePluginDataObject } if (dataRec != null) { - for (int i = 0; i < dataRec.length; i++) { - if (dataRec[i].getName().equals("Data")) { - setRawData(((ByteDataRecord) dataRec[i]).getByteData()); - } else if (dataRec[i].getName().equals("Angles")) { - setAngleData(((FloatDataRecord) dataRec[i]).getFloatData()); - } else if (dataRec[i].getName().equals("DHRMap")) { + for (IDataRecord element : dataRec) { + if (element.getName().equals("Data")) { + setRawData(((ByteDataRecord) element).getByteData()); + } else if (element.getName().equals("Angles")) { + setAngleData(((FloatDataRecord) element).getFloatData()); + } else if (element.getName().equals("DHRMap")) { try { - ByteDataRecord byteData = (ByteDataRecord) dataRec[i]; + ByteDataRecord byteData = (ByteDataRecord) element; ByteArrayInputStream bais = new ByteArrayInputStream( byteData.getByteData()); Object o = DynamicSerializationManager.getManager( @@ -616,4 +618,9 @@ public class PrecipRateRecord extends PersistablePluginDataObject public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "preciprate"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.profiler/src/com/raytheon/uf/common/dataplugin/profiler/ProfilerObs.java b/edexOsgi/com.raytheon.uf.common.dataplugin.profiler/src/com/raytheon/uf/common/dataplugin/profiler/ProfilerObs.java index 89ea424bee..d98ceee511 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.profiler/src/com/raytheon/uf/common/dataplugin/profiler/ProfilerObs.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.profiler/src/com/raytheon/uf/common/dataplugin/profiler/ProfilerObs.java @@ -71,14 +71,16 @@ import com.vividsolutions.jts.geom.Geometry; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080303 969 jkorman Initial implementation. - * 20090413 2251 jsanchez Implemented IDecoderGettable methods - * and plotted Profiler plots. - * 20090610 2489 jsanchez Updated the windSpeeed & windDirection. - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Mar 03, 2008 969 jkorman Initial implementation. + * Apr 13, 2009 2251 jsanchez Implemented IDecoderGettable methods and + * plotted Profiler plots. + * Jun 10, 2009 2489 jsanchez Updated the windSpeeed & windDirection. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -92,12 +94,8 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "profiler", - indexes = { - @Index(name = "profiler_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "profiler", indexes = { @Index(name = "profiler_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -607,18 +605,20 @@ public class ProfilerObs extends PersistablePluginDataObject implements // Adjust to agl heights! Integer height = l.getLevelHeight() - getElevation(); - if (level == 1500 && height <= 1500 && height >= 1250) { + if ((level == 1500) && (height <= 1500) + && (height >= 1250)) { retValue = l; - } else if (level == 1250 && height <= 1500 - && height > 1125) { + } else if ((level == 1250) && (height <= 1500) + && (height > 1125)) { retValue = l; - } else if (level == 1000 && height <= 1125 - && height > 875) { + } else if ((level == 1000) && (height <= 1125) + && (height > 875)) { retValue = l; - } else if (level == 750 && height <= 875 - && height > 625) { + } else if ((level == 750) && (height <= 875) + && (height > 625)) { retValue = l; - } else if (level == 500 && height <= 625 && height > 0) { + } else if ((level == 500) && (height <= 625) + && (height > 0)) { retValue = l; } // No need to go higher than this. @@ -697,4 +697,9 @@ public class ProfilerObs extends PersistablePluginDataObject implements public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "profiler"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.qc/src/com/raytheon/uf/common/dataplugin/qc/QCRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.qc/src/com/raytheon/uf/common/dataplugin/qc/QCRecord.java index 42fcfbec87..01a02b4cd1 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.qc/src/com/raytheon/uf/common/dataplugin/qc/QCRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.qc/src/com/raytheon/uf/common/dataplugin/qc/QCRecord.java @@ -56,6 +56,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * May 16, 2013 1869 bsteffen Remove DataURI column from qc. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -70,1892 +71,1894 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "qc", - indexes = { - @Index(name = "qc_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "qc", indexes = { @Index(name = "qc_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class QCRecord extends PluginDataObject implements ISpatialEnabled { - private static final long serialVersionUID = -8836262244188895665L; + private static final long serialVersionUID = -8836262244188895665L; - @Transient - private Date invTime; + @Transient + private Date invTime; - /** Time to process stages 1 and 2 */ - @Transient - private int secondsStage1_2; + /** Time to process stages 1 and 2 */ + @Transient + private int secondsStage1_2; - /** Time to process stage 3 */ - @Transient - private int secondsStage3; + /** Time to process stage 3 */ + @Transient + private int secondsStage3; - /** Data provider station id */ - @Transient - private String providerId; + /** Data provider station id */ + @Transient + private String providerId; - /** Home WFO id */ - @Transient - private String homeWFO; + /** Home WFO id */ + @Transient + private String homeWFO; - /** Numeric WMO identification */ - @Transient - private int numericWMOid; + /** Numeric WMO identification */ + @Transient + private int numericWMOid; - /** LDAD Station Type */ - @Transient - private String stationType; + /** LDAD Station Type */ + @Transient + private String stationType; - /** Local data provider */ - @Transient - private String dataProvider; + /** Local data provider */ + @Transient + private String dataProvider; - @Transient - private int filterSetNum; + @Transient + private int filterSetNum; - /** List of possible QC checks */ - @Transient - private String qct; + /** List of possible QC checks */ + @Transient + private String qct; - /** List of possible IC checks */ - @Transient - private String ict; + /** List of possible IC checks */ + @Transient + private String ict; - @Embedded - @DataURI(position = 2, embedded = true) - @DynamicSerializeElement - private SurfaceObsLocation location; // latitude, longitude, elevation, + @Embedded + @DataURI(position = 2, embedded = true) + @DynamicSerializeElement + private SurfaceObsLocation location; // latitude, longitude, elevation, - @Column(nullable = false, length = 20) - @DataURI(position = 1) - @DynamicSerializeElement - private String qcType; + @Column(nullable = false, length = 20) + @DataURI(position = 1) + @DynamicSerializeElement + private String qcType; - /** Data Platform Type */ - @Transient - private int dataPlatformType; + /** Data Platform Type */ + @Transient + private int dataPlatformType; - /** Data Platform true direction */ - @Transient - private int platformTrueDirection; + /** Data Platform true direction */ + @Transient + private int platformTrueDirection; - /** Data platform true speed */ - @Transient - private int platformTrueSpeed; + /** Data platform true speed */ + @Transient + private int platformTrueSpeed; - /** Time of observation */ - @Transient - private Date observationTime; + /** Time of observation */ + @Transient + private Date observationTime; - /** Time data was processed by the provider */ - @Transient - private Date reportTime; + /** Time data was processed by the provider */ + @Transient + private Date reportTime; - /** Time data was received */ - @Transient - private Date receivedTime; + /** Time data was received */ + @Transient + private Date receivedTime; - /** Temperature reading */ - @Transient - private float temperature; + /** Temperature reading */ + @Transient + private float temperature; - /** Temperature time of last change */ - @Transient - private Date tempChangeTime; + /** Temperature time of last change */ + @Transient + private Date tempChangeTime; - /** Temperature QC summary value */ - @Transient - private String temperatureDD; + /** Temperature QC summary value */ + @Transient + private String temperatureDD; - /** Temperature QC applied word */ - @Transient - private String[] temperatureQCA; + /** Temperature QC applied word */ + @Transient + private String[] temperatureQCA; - /** Temperature QC Results word */ - @Transient - private String[] temperatureQCR; + /** Temperature QC Results word */ + @Transient + private String[] temperatureQCR; - /** Temperature QC departures */ - @Transient - private int[] temperatureQCD; + /** Temperature QC departures */ + @Transient + private int[] temperatureQCD; - /** Temperature IC applied word */ - @Transient - private String temperatureICA; + /** Temperature IC applied word */ + @Transient + private String temperatureICA; - /** Temperature IC results word */ - @Transient - private String temperatureICR; + /** Temperature IC results word */ + @Transient + private String temperatureICR; - /** Dew Point temperature */ - @Transient - private float dewpoint; + /** Dew Point temperature */ + @Transient + private float dewpoint; - /** Dew Point QC summary value */ - @Transient - private String dewpointDD; + /** Dew Point QC summary value */ + @Transient + private String dewpointDD; - /** Dew point QC applied word */ - @Transient - private String[] dewpointQCA; + /** Dew point QC applied word */ + @Transient + private String[] dewpointQCA; - /** dew point QC results word */ - @Transient - private String[] dewpointQCR; + /** dew point QC results word */ + @Transient + private String[] dewpointQCR; - /** dew point QC departures */ - @Transient - private int[] dewpointQCD; + /** dew point QC departures */ + @Transient + private int[] dewpointQCD; - /** dew point IC applied word */ - @Transient - private String dewpointICA; + /** dew point IC applied word */ + @Transient + private String dewpointICA; - /** dew point IC results word */ - @Transient - private String dewpointICR; + /** dew point IC results word */ + @Transient + private String dewpointICR; - /** wet bulb temperature */ - @Transient - private float wetBulbTemperature; + /** wet bulb temperature */ + @Transient + private float wetBulbTemperature; - /** relative humidity */ - @Transient - private float relHumidity; + /** relative humidity */ + @Transient + private float relHumidity; - /** relative humidity time of last change */ - @Transient - private Date rhChangeTime; + /** relative humidity time of last change */ + @Transient + private Date rhChangeTime; - /** relative humidity QC summary value */ - @Transient - private String relHumidityDD; + /** relative humidity QC summary value */ + @Transient + private String relHumidityDD; - /** relative humidity QC applied word */ - @Transient - private String[] relHumidityQCA; + /** relative humidity QC applied word */ + @Transient + private String[] relHumidityQCA; - /** relative humidity QC results word */ - @Transient - private String[] relHumidityQCR; + /** relative humidity QC results word */ + @Transient + private String[] relHumidityQCR; - /** relative humidity QC departures */ - @Transient - private int[] relHumidityQCD; + /** relative humidity QC departures */ + @Transient + private int[] relHumidityQCD; - /** station pressure */ - @Transient - private float stationPressure; + /** station pressure */ + @Transient + private float stationPressure; - /** station press time of last change */ - @Transient - private Date stationPressChangeTime; + /** station press time of last change */ + @Transient + private Date stationPressChangeTime; - /** station pressure QC summary value */ - @Transient - private String stationPressureDD; + /** station pressure QC summary value */ + @Transient + private String stationPressureDD; - /** station pressure QC applied word */ - @Transient - private String[] stationPressureQCA; + /** station pressure QC applied word */ + @Transient + private String[] stationPressureQCA; - /** station pressure QC results word */ - @Transient - private String[] stationPressureQCR; + /** station pressure QC results word */ + @Transient + private String[] stationPressureQCR; - /** station pressure QC departures */ - @Transient - private int[] stationPressureQCD; + /** station pressure QC departures */ + @Transient + private int[] stationPressureQCD; - /** station pressure IC applied word */ - @Transient - private String stationPressureICA; + /** station pressure IC applied word */ + @Transient + private String stationPressureICA; - /** station pressure IC results word */ - @Transient - private String stationPressureICR; + /** station pressure IC results word */ + @Transient + private String stationPressureICR; - /** sea level pressure */ - @Transient - private float seaLevelPressure; + /** sea level pressure */ + @Transient + private float seaLevelPressure; - /** Sea level pressure QC summary value */ - @Transient - private String seaLevelPressureDD; + /** Sea level pressure QC summary value */ + @Transient + private String seaLevelPressureDD; - /** sea level pressure QC applied word */ - @Transient - private String[] seaLevelPressureQCA; + /** sea level pressure QC applied word */ + @Transient + private String[] seaLevelPressureQCA; - /** sea level pressure QC results word */ - @Transient - private String[] seaLevelPressureQCR; + /** sea level pressure QC results word */ + @Transient + private String[] seaLevelPressureQCR; - /** sea level pressure QC departures */ - @Transient - private int[] seaLevelPressureQCD; + /** sea level pressure QC departures */ + @Transient + private int[] seaLevelPressureQCD; - /** sea level pressure IC applied word */ - @Transient - private String seaLevelPressureICA; + /** sea level pressure IC applied word */ + @Transient + private String seaLevelPressureICA; - /** sea level pressure IC results word */ - @Transient - private String seaLevelPressureICR; + /** sea level pressure IC results word */ + @Transient + private String seaLevelPressureICR; - /** character of pressure change */ - @Transient - private String pressChangeChar; + /** character of pressure change */ + @Transient + private String pressChangeChar; - /** 3 hour pressure change */ - @Transient - private float pressChange3Hour; + /** 3 hour pressure change */ + @Transient + private float pressChange3Hour; - /** 3h pressure change QC summary value */ - @Transient - private String pressChange3HourDD; + /** 3h pressure change QC summary value */ + @Transient + private String pressChange3HourDD; - /** 3h pressure change QC applied word */ - @Transient - private String[] pressChange3HourQCA; + /** 3h pressure change QC applied word */ + @Transient + private String[] pressChange3HourQCA; - /** 3h pressure change QC results word */ - @Transient - private String[] pressChange3HourQCR; + /** 3h pressure change QC results word */ + @Transient + private String[] pressChange3HourQCR; - /** 3h pressure change QC departures */ - @Transient - private int[] pressChange3HourQCD; + /** 3h pressure change QC departures */ + @Transient + private int[] pressChange3HourQCD; - /** 3h pressure change IC applied word */ - @Transient - private String pressChange3HourICA; + /** 3h pressure change IC applied word */ + @Transient + private String pressChange3HourICA; - /** 3h pressure change IC results word */ - @Transient - private String pressChange3HourICR; + /** 3h pressure change IC results word */ + @Transient + private String pressChange3HourICR; - /** altimeter setting */ - @Transient - private float altimeter; + /** altimeter setting */ + @Transient + private float altimeter; - /** altimeter setting QC summary value */ - @Transient - private String altimeterDD; + /** altimeter setting QC summary value */ + @Transient + private String altimeterDD; - /** altimeter setting QC applied word */ - @Transient - private String[] altimeterQCA; + /** altimeter setting QC applied word */ + @Transient + private String[] altimeterQCA; - /** altimeter setting QC results word */ - @Transient - private String[] altimeterQCR; + /** altimeter setting QC results word */ + @Transient + private String[] altimeterQCR; - /** altimeter setting QC departures */ - @Transient - private int[] altimeterQCD; + /** altimeter setting QC departures */ + @Transient + private int[] altimeterQCD; - /** wind direction */ - @Transient - private float windDir; + /** wind direction */ + @Transient + private float windDir; - /** wind direction time of last change */ - @Transient - private Date windDirChangeTime; + /** wind direction time of last change */ + @Transient + private Date windDirChangeTime; - /** wind direction QC summary value */ - @Transient - private String windDirDD; + /** wind direction QC summary value */ + @Transient + private String windDirDD; - /** wind direction QC applied word */ - @Transient - private String[] windDirQCA; + /** wind direction QC applied word */ + @Transient + private String[] windDirQCA; - /** wind direction QC results word */ - @Transient - private String[] windDirQCR; + /** wind direction QC results word */ + @Transient + private String[] windDirQCR; - /** wind direction QC departures */ - @Transient - private int[] windDirQCD; + /** wind direction QC departures */ + @Transient + private int[] windDirQCD; - /** wind direction IC applied word */ - @Transient - private String windDirICA; + /** wind direction IC applied word */ + @Transient + private String windDirICA; - /** wind direction IC results word */ - @Transient - private String windDirICR; + /** wind direction IC results word */ + @Transient + private String windDirICR; - /** wind speed */ - @Transient - private float windSpeed; + /** wind speed */ + @Transient + private float windSpeed; - /** wind speed time of last change */ - @Transient - private Date windSpeedChangeTime; + /** wind speed time of last change */ + @Transient + private Date windSpeedChangeTime; - /** wind speed QC summary value */ - @Transient - private String windSpeedDD; + /** wind speed QC summary value */ + @Transient + private String windSpeedDD; - /** wind speed QC applied word */ - @Transient - private String[] windSpeedQCA; + /** wind speed QC applied word */ + @Transient + private String[] windSpeedQCA; - /** wind speed QC results word */ - @Transient - private String[] windSpeedQCR; + /** wind speed QC results word */ + @Transient + private String[] windSpeedQCR; - /** wind speed QC departures */ - @Transient - private int[] windSpeedQCD; + /** wind speed QC departures */ + @Transient + private int[] windSpeedQCD; - /** wind speed IC applied word */ - @Transient - private String windSpeedICA; + /** wind speed IC applied word */ + @Transient + private String windSpeedICA; - /** wind speed IC results word */ - @Transient - private String windSpeedICR; + /** wind speed IC results word */ + @Transient + private String windSpeedICR; - /** wind gust */ - @Transient - private float windGust; + /** wind gust */ + @Transient + private float windGust; - /** Wind gust QC applied word */ - @Transient - private String[] windGustQCA; + /** Wind gust QC applied word */ + @Transient + private String[] windGustQCA; - /** Wind gust QC results word */ - @Transient - private String[] windGustQCR; + /** Wind gust QC results word */ + @Transient + private String[] windGustQCR; - /** Wind gust QC departures */ - @Transient - private int[] windGustQCD; + /** Wind gust QC departures */ + @Transient + private int[] windGustQCD; - /** wind direction at mininum windspeed */ - @Transient - private float windDirMin; + /** wind direction at mininum windspeed */ + @Transient + private float windDirMin; - /** wind direction at gust */ - @Transient - private float windDirMax; + /** wind direction at gust */ + @Transient + private float windDirMax; - /** wind direction at gust QC summary value */ - @Transient - private String windDirMaxDD; + /** wind direction at gust QC summary value */ + @Transient + private String windDirMaxDD; - /** wind direction at gust QC applied word */ - @Transient - private String[] windDirMaxQCA; + /** wind direction at gust QC applied word */ + @Transient + private String[] windDirMaxQCA; - /** wind direction at gust QC results word */ - @Transient - private String[] windDirMaxQCR; + /** wind direction at gust QC results word */ + @Transient + private String[] windDirMaxQCR; - /** wind direction at gust QC departures */ - @Transient - private int[] windDirMaxQCD; + /** wind direction at gust QC departures */ + @Transient + private int[] windDirMaxQCD; - /** sky cover */ - @Transient - private String skyCover; + /** sky cover */ + @Transient + private String skyCover; - /** sky cover layer base */ - @Transient - private float[] skyLayerBase; + /** sky cover layer base */ + @Transient + private float[] skyLayerBase; - /** visibility */ - @Transient - private float visibility; + /** visibility */ + @Transient + private float visibility; - /** visibility QC summary value */ - @Transient - private String visibilityDD; + /** visibility QC summary value */ + @Transient + private String visibilityDD; - /** visibility QC applied word */ - @Transient - private String[] visibilityQCA; + /** visibility QC applied word */ + @Transient + private String[] visibilityQCA; - /** visibility QC results word */ - @Transient - private String[] visibilityQCR; + /** visibility QC results word */ + @Transient + private String[] visibilityQCR; - /** visibility QC departures */ - @Transient - private int[] visibilityQCD; + /** visibility QC departures */ + @Transient + private int[] visibilityQCD; - /** visibility QC applied word */ - @Transient - private String visibilityICA; + /** visibility QC applied word */ + @Transient + private String visibilityICA; - /** visibility IC results word */ - @Transient - private String visibilityICR; + /** visibility IC results word */ + @Transient + private String visibilityICR; - /** fraction of sky covered by clouds */ - @Transient - private float totalCloudCover; + /** fraction of sky covered by clouds */ + @Transient + private float totalCloudCover; - /** height of the lowest cloud layer */ - @Transient - private String cloudBaseHeight; + /** height of the lowest cloud layer */ + @Transient + private String cloudBaseHeight; - /** present weather */ - @Transient - private String presWeather; + /** present weather */ + @Transient + private String presWeather; - /** low level cloud type */ - @Transient - private String lowLevelCloudType; + /** low level cloud type */ + @Transient + private String lowLevelCloudType; - /** middle level cloud type */ - @Transient - private String midLevelCloudType; + /** middle level cloud type */ + @Transient + private String midLevelCloudType; - /** high level cloud type */ - @Transient - private String highLevelCloudType; + /** high level cloud type */ + @Transient + private String highLevelCloudType; - /** maximum temperature recording period */ - @Transient - private String maxTempRecordPeriod; + /** maximum temperature recording period */ + @Transient + private String maxTempRecordPeriod; - /** minimum temperature recording period */ - @Transient - private String minTempRecordPeriod; + /** minimum temperature recording period */ + @Transient + private String minTempRecordPeriod; - /** minimum temperature */ - @Transient - private float minimumTemperature; + /** minimum temperature */ + @Transient + private float minimumTemperature; - /** raw precip accumulation */ - @Transient - private float rawPrecip; + /** raw precip accumulation */ + @Transient + private float rawPrecip; - /** precip accumulation */ - @Transient - private float precipAccum; + /** precip accumulation */ + @Transient + private float precipAccum; - /** precip amount QC summary value */ - @Transient - private String precipAccumDD; + /** precip amount QC summary value */ + @Transient + private String precipAccumDD; - /** precip amount QC applied word */ - @Transient - private String[] precipAccumQCA; + /** precip amount QC applied word */ + @Transient + private String[] precipAccumQCA; - /** precip amount QC results word */ - @Transient - private String[] precipAccumQCR; + /** precip amount QC results word */ + @Transient + private String[] precipAccumQCR; - /** precip amount QC departures */ - @Transient - private int[] precipAccumQCD; + /** precip amount QC departures */ + @Transient + private int[] precipAccumQCD; - /** precip amount IC applied word */ - @Transient - private String precipAccumICA; + /** precip amount IC applied word */ + @Transient + private String precipAccumICA; - /** precip amount IC results word */ - @Transient - private String precipAccumICR; + /** precip amount IC results word */ + @Transient + private String precipAccumICR; - /** precipitation rate */ - @Transient - private float precipRate; + /** precipitation rate */ + @Transient + private float precipRate; - /** precip rate QC summary value */ - @Transient - private String precipRateDD; + /** precip rate QC summary value */ + @Transient + private String precipRateDD; - /** precip rate QC applied word */ - @Transient - private String[] precipRateQCA; + /** precip rate QC applied word */ + @Transient + private String[] precipRateQCA; - /** precip rate QC results word */ - @Transient - private String[] precipRateQCR; + /** precip rate QC results word */ + @Transient + private String[] precipRateQCR; - /** precip rate QC departures */ - @Transient - private int[] precipRateQCD; + /** precip rate QC departures */ + @Transient + private int[] precipRateQCD; - /** precipitation type */ - @Transient - private String precipType; + /** precipitation type */ + @Transient + private String precipType; - /** precipitation intensity */ - @Transient - private String precipIntensity; + /** precipitation intensity */ + @Transient + private String precipIntensity; - /** time since last precip */ - @Transient - private int timeSinceLastPcp; + /** time since last precip */ + @Transient + private int timeSinceLastPcp; - /** solar radiation */ - @Transient - private float solarRadiation; + /** solar radiation */ + @Transient + private float solarRadiation; - /** solar radiation time of last change */ - @Transient - private Date solarRadiationChangeTime; + /** solar radiation time of last change */ + @Transient + private Date solarRadiationChangeTime; - /** sea surface temperature */ - @Transient - private float seaSurfaceTemp; + /** sea surface temperature */ + @Transient + private float seaSurfaceTemp; - /** Sea surface temperature QC summary value */ - @Transient - private String seaSurfaceTempDD; + /** Sea surface temperature QC summary value */ + @Transient + private String seaSurfaceTempDD; - /** Sea surface temperature QC applied word */ - @Transient - private String[] seaSurfaceTempQCA; + /** Sea surface temperature QC applied word */ + @Transient + private String[] seaSurfaceTempQCA; - /** SeaSurfaceTemp QC Results word */ - @Transient - private String[] seaSurfaceTempQCR; + /** SeaSurfaceTemp QC Results word */ + @Transient + private String[] seaSurfaceTempQCR; - /** Sea surface temperature QC departures */ - @Transient - private int[] seaSurfaceTempQCD; + /** Sea surface temperature QC departures */ + @Transient + private int[] seaSurfaceTempQCD; - /** Sea surface temperature IC applied word */ - @Transient - private String seaSurfaceTempICA; + /** Sea surface temperature IC applied word */ + @Transient + private String seaSurfaceTempICA; - /** Sea surface temperature IC results word */ - @Transient - private String seaSurfaceTempICR; + /** Sea surface temperature IC results word */ + @Transient + private String seaSurfaceTempICR; - /** wave period */ - @Transient - private float wavePeriod; + /** wave period */ + @Transient + private float wavePeriod; - /** wave height */ - @Transient - private float waveHeight; + /** wave height */ + @Transient + private float waveHeight; - /** raw text LDAD mesonet message */ - @Transient - private String rawMessage; + /** raw text LDAD mesonet message */ + @Transient + private String rawMessage; - /** Total column precipitable water vapor */ - @Transient - private float totalColumnPWV; + /** Total column precipitable water vapor */ + @Transient + private float totalColumnPWV; - /** Total GPS signal delay */ - @Transient - private float totalSignalDelay; + /** Total GPS signal delay */ + @Transient + private float totalSignalDelay; - /** Dry component GPS signal delay */ - @Transient - private float drySignalDelay; + /** Dry component GPS signal delay */ + @Transient + private float drySignalDelay; - /** Wet component GPS signal delay */ - @Transient - private float wetSignalDelay; + /** Wet component GPS signal delay */ + @Transient + private float wetSignalDelay; - /** Mean weighted temperature */ - @Transient - private float meanWeightedTemperature; + /** Mean weighted temperature */ + @Transient + private float meanWeightedTemperature; - /** Formal Error */ - @Transient - private float formalError; + /** Formal Error */ + @Transient + private float formalError; - /** Wet delay mapping function */ - @Transient - private float capPi; + /** Wet delay mapping function */ + @Transient + private float capPi; - @Column(length = 15) - private String ncSet; + @Column(length = 15) + private String ncSet; - @Embedded - @DynamicSerializeElement - private FakePointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private FakePointDataView pointDataView; - @Embeddable - @DynamicSerialize - private static class FakePointDataView { - @DynamicSerializeElement - @Column(name = "idx") - int curIdx; - } + @Embeddable + @DynamicSerialize + private static class FakePointDataView { + @DynamicSerializeElement + @Column(name = "idx") + int curIdx; + } - public QCRecord() { + public QCRecord() { - } + } - public QCRecord(String uri) { - super(uri); - } + public QCRecord(String uri) { + super(uri); + } - public Date getInvTime() { - return invTime; - } - - public void setInvTime(Date invTime) { - this.invTime = invTime; - } - - public int getSecondsStage1_2() { - return secondsStage1_2; - } - - public void setSecondsStage1_2(int secondsStage1_2) { - this.secondsStage1_2 = secondsStage1_2; - } - - public int getSecondsStage3() { - return secondsStage3; - } - - public void setSecondsStage3(int secondsStage3) { - this.secondsStage3 = secondsStage3; - } - - public String getProviderId() { - return providerId; - } - - public void setProviderId(String providerId) { - this.providerId = providerId; - } - - public String getStationId() { - return location.getStationId(); - } - - public String getHomeWFO() { - return homeWFO; - } - - public void setHomeWFO(String homeWFO) { - this.homeWFO = homeWFO; - } - - public int getNumericWMOid() { - return numericWMOid; - } - - public void setNumericWMOid(int numericWMOid) { - this.numericWMOid = numericWMOid; - } - - public String getStationType() { - return stationType; - } - - public void setStationType(String stationType) { - this.stationType = stationType; - } - - public String getDataProvider() { - return dataProvider; - } - - public void setDataProvider(String dataProvider) { - this.dataProvider = dataProvider; - } - - public int getFilterSetNum() { - return filterSetNum; - } - - public void setFilterSetNum(int filterSetNum) { - this.filterSetNum = filterSetNum; - } - - public String getQct() { - return qct; - } - - public void setQct(String qct) { - this.qct = qct; - } - - public String getIct() { - return ict; - } - - public void setIct(String ict) { - this.ict = ict; - } + public Date getInvTime() { + return invTime; + } + + public void setInvTime(Date invTime) { + this.invTime = invTime; + } + + public int getSecondsStage1_2() { + return secondsStage1_2; + } + + public void setSecondsStage1_2(int secondsStage1_2) { + this.secondsStage1_2 = secondsStage1_2; + } + + public int getSecondsStage3() { + return secondsStage3; + } + + public void setSecondsStage3(int secondsStage3) { + this.secondsStage3 = secondsStage3; + } + + public String getProviderId() { + return providerId; + } + + public void setProviderId(String providerId) { + this.providerId = providerId; + } + + public String getStationId() { + return location.getStationId(); + } + + public String getHomeWFO() { + return homeWFO; + } + + public void setHomeWFO(String homeWFO) { + this.homeWFO = homeWFO; + } + + public int getNumericWMOid() { + return numericWMOid; + } + + public void setNumericWMOid(int numericWMOid) { + this.numericWMOid = numericWMOid; + } + + public String getStationType() { + return stationType; + } + + public void setStationType(String stationType) { + this.stationType = stationType; + } + + public String getDataProvider() { + return dataProvider; + } + + public void setDataProvider(String dataProvider) { + this.dataProvider = dataProvider; + } + + public int getFilterSetNum() { + return filterSetNum; + } + + public void setFilterSetNum(int filterSetNum) { + this.filterSetNum = filterSetNum; + } + + public String getQct() { + return qct; + } + + public void setQct(String qct) { + this.qct = qct; + } + + public String getIct() { + return ict; + } + + public void setIct(String ict) { + this.ict = ict; + } - /** - * @return the location - */ - public SurfaceObsLocation getLocation() { - return location; - } - - /** - * @param location - * the location to set - */ - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } - - public float getLatitude() { - return location.getLatitude().floatValue(); - } - - public float getLongitude() { - return location.getLongitude().floatValue(); - } - - public float getElevation() { - return location.getElevation(); - } - - public int getDataPlatformType() { - return dataPlatformType; - } - - public void setDataPlatformType(int dataPlatformType) { - this.dataPlatformType = dataPlatformType; - } - - public int getPlatformTrueDirection() { - return platformTrueDirection; - } - - public void setPlatformTrueDirection(int platformTrueDirection) { - this.platformTrueDirection = platformTrueDirection; - } - - public int getPlatformTrueSpeed() { - return platformTrueSpeed; - } - - public void setPlatformTrueSpeed(int platformTrueSpeed) { - this.platformTrueSpeed = platformTrueSpeed; - } - - public Date getObservationTime() { - return observationTime; - } - - public void setObservationTime(Date observationTime) { - this.observationTime = observationTime; - } - - public Date getReportTime() { - return reportTime; - } - - public void setReportTime(Date reportTime) { - this.reportTime = reportTime; - } - - public Date getReceivedTime() { - return receivedTime; - } - - public void setReceivedTime(Date receivedTime) { - this.receivedTime = receivedTime; - } - - public float getTemperature() { - return temperature; - } - - public void setTemperature(float temperature) { - this.temperature = temperature; - } - - public Date getTempChangeTime() { - return tempChangeTime; - } - - public void setTempChangeTime(Date tempChangeTime) { - this.tempChangeTime = tempChangeTime; - } - - public String getTemperatureDD() { - return temperatureDD; - } - - public void setTemperatureDD(String temperatureDD) { - this.temperatureDD = temperatureDD; - } - - public String[] getTemperatureQCA() { - return temperatureQCA; - } - - public void setTemperatureQCA(String[] temperatureQCA) { - this.temperatureQCA = temperatureQCA; - } + /** + * @return the location + */ + public SurfaceObsLocation getLocation() { + return location; + } + + /** + * @param location + * the location to set + */ + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } + + public float getLatitude() { + return location.getLatitude().floatValue(); + } + + public float getLongitude() { + return location.getLongitude().floatValue(); + } + + public float getElevation() { + return location.getElevation(); + } + + public int getDataPlatformType() { + return dataPlatformType; + } + + public void setDataPlatformType(int dataPlatformType) { + this.dataPlatformType = dataPlatformType; + } + + public int getPlatformTrueDirection() { + return platformTrueDirection; + } + + public void setPlatformTrueDirection(int platformTrueDirection) { + this.platformTrueDirection = platformTrueDirection; + } + + public int getPlatformTrueSpeed() { + return platformTrueSpeed; + } + + public void setPlatformTrueSpeed(int platformTrueSpeed) { + this.platformTrueSpeed = platformTrueSpeed; + } + + public Date getObservationTime() { + return observationTime; + } + + public void setObservationTime(Date observationTime) { + this.observationTime = observationTime; + } + + public Date getReportTime() { + return reportTime; + } + + public void setReportTime(Date reportTime) { + this.reportTime = reportTime; + } + + public Date getReceivedTime() { + return receivedTime; + } + + public void setReceivedTime(Date receivedTime) { + this.receivedTime = receivedTime; + } + + public float getTemperature() { + return temperature; + } + + public void setTemperature(float temperature) { + this.temperature = temperature; + } + + public Date getTempChangeTime() { + return tempChangeTime; + } + + public void setTempChangeTime(Date tempChangeTime) { + this.tempChangeTime = tempChangeTime; + } + + public String getTemperatureDD() { + return temperatureDD; + } + + public void setTemperatureDD(String temperatureDD) { + this.temperatureDD = temperatureDD; + } + + public String[] getTemperatureQCA() { + return temperatureQCA; + } + + public void setTemperatureQCA(String[] temperatureQCA) { + this.temperatureQCA = temperatureQCA; + } - public String[] getTemperatureQCR() { - return temperatureQCR; - } + public String[] getTemperatureQCR() { + return temperatureQCR; + } - public void setTemperatureQCR(String[] temperatureQCR) { - this.temperatureQCR = temperatureQCR; - } + public void setTemperatureQCR(String[] temperatureQCR) { + this.temperatureQCR = temperatureQCR; + } - public int[] getTemperatureQCD() { - return temperatureQCD; - } + public int[] getTemperatureQCD() { + return temperatureQCD; + } - public void setTemperatureQCD(int[] temperatureQCD) { - this.temperatureQCD = temperatureQCD; - } + public void setTemperatureQCD(int[] temperatureQCD) { + this.temperatureQCD = temperatureQCD; + } - public String getTemperatureICA() { - return temperatureICA; - } + public String getTemperatureICA() { + return temperatureICA; + } - public void setTemperatureICA(String temperatureICA) { - this.temperatureICA = temperatureICA; - } + public void setTemperatureICA(String temperatureICA) { + this.temperatureICA = temperatureICA; + } - public String getTemperatureICR() { - return temperatureICR; - } + public String getTemperatureICR() { + return temperatureICR; + } - public void setTemperatureICR(String temperatureICR) { - this.temperatureICR = temperatureICR; - } + public void setTemperatureICR(String temperatureICR) { + this.temperatureICR = temperatureICR; + } - public float getDewpoint() { - return dewpoint; - } + public float getDewpoint() { + return dewpoint; + } - public void setDewpoint(float dewpoint) { - this.dewpoint = dewpoint; - } + public void setDewpoint(float dewpoint) { + this.dewpoint = dewpoint; + } - public String getDewpointDD() { - return dewpointDD; - } + public String getDewpointDD() { + return dewpointDD; + } - public void setDewpointDD(String dewpointDD) { - this.dewpointDD = dewpointDD; - } + public void setDewpointDD(String dewpointDD) { + this.dewpointDD = dewpointDD; + } - public String[] getDewpointQCA() { - return dewpointQCA; - } + public String[] getDewpointQCA() { + return dewpointQCA; + } - public void setDewpointQCA(String[] dewpointQCA) { - this.dewpointQCA = dewpointQCA; - } + public void setDewpointQCA(String[] dewpointQCA) { + this.dewpointQCA = dewpointQCA; + } - public String[] getDewpointQCR() { - return dewpointQCR; - } + public String[] getDewpointQCR() { + return dewpointQCR; + } - public void setDewpointQCR(String[] dewpointQCR) { - this.dewpointQCR = dewpointQCR; - } + public void setDewpointQCR(String[] dewpointQCR) { + this.dewpointQCR = dewpointQCR; + } - public int[] getDewpointQCD() { - return dewpointQCD; - } + public int[] getDewpointQCD() { + return dewpointQCD; + } - public void setDewpointQCD(int[] dewpointQCD) { - this.dewpointQCD = dewpointQCD; - } + public void setDewpointQCD(int[] dewpointQCD) { + this.dewpointQCD = dewpointQCD; + } - public String getDewpointICA() { - return dewpointICA; - } + public String getDewpointICA() { + return dewpointICA; + } - public void setDewpointICA(String dewpointICA) { - this.dewpointICA = dewpointICA; - } + public void setDewpointICA(String dewpointICA) { + this.dewpointICA = dewpointICA; + } - public String getDewpointICR() { - return dewpointICR; - } + public String getDewpointICR() { + return dewpointICR; + } - public void setDewpointICR(String dewpointICR) { - this.dewpointICR = dewpointICR; - } + public void setDewpointICR(String dewpointICR) { + this.dewpointICR = dewpointICR; + } - public float getWetBulbTemperature() { - return wetBulbTemperature; - } + public float getWetBulbTemperature() { + return wetBulbTemperature; + } - public void setWetBulbTemperature(float wetBulbTemperature) { - this.wetBulbTemperature = wetBulbTemperature; - } + public void setWetBulbTemperature(float wetBulbTemperature) { + this.wetBulbTemperature = wetBulbTemperature; + } - public float getRelHumidity() { - return relHumidity; - } + public float getRelHumidity() { + return relHumidity; + } - public void setRelHumidity(float relHumidity) { - this.relHumidity = relHumidity; - } + public void setRelHumidity(float relHumidity) { + this.relHumidity = relHumidity; + } - public Date getRhChangeTime() { - return rhChangeTime; - } + public Date getRhChangeTime() { + return rhChangeTime; + } - public void setRhChangeTime(Date rhChangeTime) { - this.rhChangeTime = rhChangeTime; - } + public void setRhChangeTime(Date rhChangeTime) { + this.rhChangeTime = rhChangeTime; + } - public String getRelHumidityDD() { - return relHumidityDD; - } + public String getRelHumidityDD() { + return relHumidityDD; + } - public void setRelHumidityDD(String relHumidityDD) { - this.relHumidityDD = relHumidityDD; - } + public void setRelHumidityDD(String relHumidityDD) { + this.relHumidityDD = relHumidityDD; + } - public String[] getRelHumidityQCA() { - return relHumidityQCA; - } + public String[] getRelHumidityQCA() { + return relHumidityQCA; + } - public void setRelHumidityQCA(String[] relHumidityQCA) { - this.relHumidityQCA = relHumidityQCA; - } + public void setRelHumidityQCA(String[] relHumidityQCA) { + this.relHumidityQCA = relHumidityQCA; + } - public String[] getRelHumidityQCR() { - return relHumidityQCR; - } + public String[] getRelHumidityQCR() { + return relHumidityQCR; + } - public void setRelHumidityQCR(String[] relHumidityQCR) { - this.relHumidityQCR = relHumidityQCR; - } + public void setRelHumidityQCR(String[] relHumidityQCR) { + this.relHumidityQCR = relHumidityQCR; + } - public int[] getRelHumidityQCD() { - return relHumidityQCD; - } + public int[] getRelHumidityQCD() { + return relHumidityQCD; + } - public void setRelHumidityQCD(int[] relHumidityQCD) { - this.relHumidityQCD = relHumidityQCD; - } + public void setRelHumidityQCD(int[] relHumidityQCD) { + this.relHumidityQCD = relHumidityQCD; + } - public float getStationPressure() { - return stationPressure; - } + public float getStationPressure() { + return stationPressure; + } - public void setStationPressure(float stationPressure) { - this.stationPressure = stationPressure; - } + public void setStationPressure(float stationPressure) { + this.stationPressure = stationPressure; + } - public Date getStationPressChangeTime() { - return stationPressChangeTime; - } + public Date getStationPressChangeTime() { + return stationPressChangeTime; + } - public void setStationPressChangeTime(Date stationPressChangeTime) { - this.stationPressChangeTime = stationPressChangeTime; - } + public void setStationPressChangeTime(Date stationPressChangeTime) { + this.stationPressChangeTime = stationPressChangeTime; + } - public String getStationPressureDD() { - return stationPressureDD; - } + public String getStationPressureDD() { + return stationPressureDD; + } - public void setStationPressureDD(String stationPressureDD) { - this.stationPressureDD = stationPressureDD; - } + public void setStationPressureDD(String stationPressureDD) { + this.stationPressureDD = stationPressureDD; + } - public String[] getStationPressureQCA() { - return stationPressureQCA; - } + public String[] getStationPressureQCA() { + return stationPressureQCA; + } - public void setStationPressureQCA(String[] stationPressureQCA) { - this.stationPressureQCA = stationPressureQCA; - } + public void setStationPressureQCA(String[] stationPressureQCA) { + this.stationPressureQCA = stationPressureQCA; + } - public String[] getStationPressureQCR() { - return stationPressureQCR; - } + public String[] getStationPressureQCR() { + return stationPressureQCR; + } - public void setStationPressureQCR(String[] stationPressureQCR) { - this.stationPressureQCR = stationPressureQCR; - } + public void setStationPressureQCR(String[] stationPressureQCR) { + this.stationPressureQCR = stationPressureQCR; + } - public int[] getStationPressureQCD() { - return stationPressureQCD; - } + public int[] getStationPressureQCD() { + return stationPressureQCD; + } - public void setStationPressureQCD(int[] stationPressureQCD) { - this.stationPressureQCD = stationPressureQCD; - } + public void setStationPressureQCD(int[] stationPressureQCD) { + this.stationPressureQCD = stationPressureQCD; + } - public String getStationPressureICA() { - return stationPressureICA; - } + public String getStationPressureICA() { + return stationPressureICA; + } - public void setStationPressureICA(String stationPressureICA) { - this.stationPressureICA = stationPressureICA; - } + public void setStationPressureICA(String stationPressureICA) { + this.stationPressureICA = stationPressureICA; + } - public String getStationPressureICR() { - return stationPressureICR; - } + public String getStationPressureICR() { + return stationPressureICR; + } - public void setStationPressureICR(String stationPressureICR) { - this.stationPressureICR = stationPressureICR; - } + public void setStationPressureICR(String stationPressureICR) { + this.stationPressureICR = stationPressureICR; + } - public float getSeaLevelPressure() { - return seaLevelPressure; - } + public float getSeaLevelPressure() { + return seaLevelPressure; + } - public void setSeaLevelPressure(float seaLevelPressure) { - this.seaLevelPressure = seaLevelPressure; - } + public void setSeaLevelPressure(float seaLevelPressure) { + this.seaLevelPressure = seaLevelPressure; + } - public String getSeaLevelPressureDD() { - return seaLevelPressureDD; - } + public String getSeaLevelPressureDD() { + return seaLevelPressureDD; + } - public void setSeaLevelPressureDD(String seaLevelPressureDD) { - this.seaLevelPressureDD = seaLevelPressureDD; - } + public void setSeaLevelPressureDD(String seaLevelPressureDD) { + this.seaLevelPressureDD = seaLevelPressureDD; + } - public String[] getSeaLevelPressureQCA() { - return seaLevelPressureQCA; - } + public String[] getSeaLevelPressureQCA() { + return seaLevelPressureQCA; + } - public void setSeaLevelPressureQCA(String[] seaLevelPressureQCA) { - this.seaLevelPressureQCA = seaLevelPressureQCA; - } + public void setSeaLevelPressureQCA(String[] seaLevelPressureQCA) { + this.seaLevelPressureQCA = seaLevelPressureQCA; + } - public String[] getSeaLevelPressureQCR() { - return seaLevelPressureQCR; - } + public String[] getSeaLevelPressureQCR() { + return seaLevelPressureQCR; + } - public void setSeaLevelPressureQCR(String[] seaLevelPressureQCR) { - this.seaLevelPressureQCR = seaLevelPressureQCR; - } + public void setSeaLevelPressureQCR(String[] seaLevelPressureQCR) { + this.seaLevelPressureQCR = seaLevelPressureQCR; + } - public int[] getSeaLevelPressureQCD() { - return seaLevelPressureQCD; - } + public int[] getSeaLevelPressureQCD() { + return seaLevelPressureQCD; + } - public void setSeaLevelPressureQCD(int[] seaLevelPressureQCD) { - this.seaLevelPressureQCD = seaLevelPressureQCD; - } + public void setSeaLevelPressureQCD(int[] seaLevelPressureQCD) { + this.seaLevelPressureQCD = seaLevelPressureQCD; + } - public String getSeaLevelPressureICA() { - return seaLevelPressureICA; - } + public String getSeaLevelPressureICA() { + return seaLevelPressureICA; + } - public void setSeaLevelPressureICA(String seaLevelPressureICA) { - this.seaLevelPressureICA = seaLevelPressureICA; - } + public void setSeaLevelPressureICA(String seaLevelPressureICA) { + this.seaLevelPressureICA = seaLevelPressureICA; + } - public String getSeaLevelPressureICR() { - return seaLevelPressureICR; - } + public String getSeaLevelPressureICR() { + return seaLevelPressureICR; + } - public void setSeaLevelPressureICR(String seaLevelPressureICR) { - this.seaLevelPressureICR = seaLevelPressureICR; - } + public void setSeaLevelPressureICR(String seaLevelPressureICR) { + this.seaLevelPressureICR = seaLevelPressureICR; + } - public String getPressChangeChar() { - return pressChangeChar; - } + public String getPressChangeChar() { + return pressChangeChar; + } - public void setPressChangeChar(String pressChangeChar) { - this.pressChangeChar = pressChangeChar; - } + public void setPressChangeChar(String pressChangeChar) { + this.pressChangeChar = pressChangeChar; + } - public float getPressChange3Hour() { - return pressChange3Hour; - } + public float getPressChange3Hour() { + return pressChange3Hour; + } - public void setPressChange3Hour(float pressChange3Hour) { - this.pressChange3Hour = pressChange3Hour; - } + public void setPressChange3Hour(float pressChange3Hour) { + this.pressChange3Hour = pressChange3Hour; + } - public String getPressChange3HourDD() { - return pressChange3HourDD; - } + public String getPressChange3HourDD() { + return pressChange3HourDD; + } - public void setPressChange3HourDD(String pressChange3HourDD) { - this.pressChange3HourDD = pressChange3HourDD; - } + public void setPressChange3HourDD(String pressChange3HourDD) { + this.pressChange3HourDD = pressChange3HourDD; + } - public String[] getPressChange3HourQCA() { - return pressChange3HourQCA; - } + public String[] getPressChange3HourQCA() { + return pressChange3HourQCA; + } - public void setPressChange3HourQCA(String[] pressChange3HourQCA) { - this.pressChange3HourQCA = pressChange3HourQCA; - } + public void setPressChange3HourQCA(String[] pressChange3HourQCA) { + this.pressChange3HourQCA = pressChange3HourQCA; + } - public String[] getPressChange3HourQCR() { - return pressChange3HourQCR; - } + public String[] getPressChange3HourQCR() { + return pressChange3HourQCR; + } - public void setPressChange3HourQCR(String[] pressChange3HourQCR) { - this.pressChange3HourQCR = pressChange3HourQCR; - } + public void setPressChange3HourQCR(String[] pressChange3HourQCR) { + this.pressChange3HourQCR = pressChange3HourQCR; + } - public int[] getPressChange3HourQCD() { - return pressChange3HourQCD; - } + public int[] getPressChange3HourQCD() { + return pressChange3HourQCD; + } - public void setPressChange3HourQCD(int[] pressChange3HourQCD) { - this.pressChange3HourQCD = pressChange3HourQCD; - } + public void setPressChange3HourQCD(int[] pressChange3HourQCD) { + this.pressChange3HourQCD = pressChange3HourQCD; + } - public String getPressChange3HourICA() { - return pressChange3HourICA; - } + public String getPressChange3HourICA() { + return pressChange3HourICA; + } - public void setPressChange3HourICA(String pressChange3HourICA) { - this.pressChange3HourICA = pressChange3HourICA; - } + public void setPressChange3HourICA(String pressChange3HourICA) { + this.pressChange3HourICA = pressChange3HourICA; + } - public String getPressChange3HourICR() { - return pressChange3HourICR; - } + public String getPressChange3HourICR() { + return pressChange3HourICR; + } - public void setPressChange3HourICR(String pressChange3HourICR) { - this.pressChange3HourICR = pressChange3HourICR; - } + public void setPressChange3HourICR(String pressChange3HourICR) { + this.pressChange3HourICR = pressChange3HourICR; + } - public float getAltimeter() { - return altimeter; - } + public float getAltimeter() { + return altimeter; + } - public void setAltimeter(float altimeter) { - this.altimeter = altimeter; - } + public void setAltimeter(float altimeter) { + this.altimeter = altimeter; + } - public String getAltimeterDD() { - return altimeterDD; - } + public String getAltimeterDD() { + return altimeterDD; + } - public void setAltimeterDD(String altimeterDD) { - this.altimeterDD = altimeterDD; - } + public void setAltimeterDD(String altimeterDD) { + this.altimeterDD = altimeterDD; + } - public String[] getAltimeterQCA() { - return altimeterQCA; - } + public String[] getAltimeterQCA() { + return altimeterQCA; + } - public void setAltimeterQCA(String[] altimeterQCA) { - this.altimeterQCA = altimeterQCA; - } + public void setAltimeterQCA(String[] altimeterQCA) { + this.altimeterQCA = altimeterQCA; + } - public String[] getAltimeterQCR() { - return altimeterQCR; - } + public String[] getAltimeterQCR() { + return altimeterQCR; + } - public void setAltimeterQCR(String[] altimeterQCR) { - this.altimeterQCR = altimeterQCR; - } + public void setAltimeterQCR(String[] altimeterQCR) { + this.altimeterQCR = altimeterQCR; + } - public int[] getAltimeterQCD() { - return altimeterQCD; - } + public int[] getAltimeterQCD() { + return altimeterQCD; + } - public void setAltimeterQCD(int[] altimeterQCD) { - this.altimeterQCD = altimeterQCD; - } + public void setAltimeterQCD(int[] altimeterQCD) { + this.altimeterQCD = altimeterQCD; + } - public float getWindDir() { - return windDir; - } + public float getWindDir() { + return windDir; + } - public void setWindDir(float windDir) { - this.windDir = windDir; - } + public void setWindDir(float windDir) { + this.windDir = windDir; + } - public Date getWindDirChangeTime() { - return windDirChangeTime; - } + public Date getWindDirChangeTime() { + return windDirChangeTime; + } - public void setWindDirChangeTime(Date windDirChangeTime) { - this.windDirChangeTime = windDirChangeTime; - } + public void setWindDirChangeTime(Date windDirChangeTime) { + this.windDirChangeTime = windDirChangeTime; + } - public String getWindDirDD() { - return windDirDD; - } + public String getWindDirDD() { + return windDirDD; + } - public void setWindDirDD(String windDirDD) { - this.windDirDD = windDirDD; - } + public void setWindDirDD(String windDirDD) { + this.windDirDD = windDirDD; + } - public String[] getWindDirQCA() { - return windDirQCA; - } + public String[] getWindDirQCA() { + return windDirQCA; + } - public void setWindDirQCA(String[] windDirQCA) { - this.windDirQCA = windDirQCA; - } + public void setWindDirQCA(String[] windDirQCA) { + this.windDirQCA = windDirQCA; + } - public String[] getWindDirQCR() { - return windDirQCR; - } + public String[] getWindDirQCR() { + return windDirQCR; + } - public void setWindDirQCR(String[] windDirQCR) { - this.windDirQCR = windDirQCR; - } + public void setWindDirQCR(String[] windDirQCR) { + this.windDirQCR = windDirQCR; + } - public int[] getWindDirQCD() { - return windDirQCD; - } + public int[] getWindDirQCD() { + return windDirQCD; + } - public void setWindDirQCD(int[] windDirQCD) { - this.windDirQCD = windDirQCD; - } + public void setWindDirQCD(int[] windDirQCD) { + this.windDirQCD = windDirQCD; + } - public String getWindDirICA() { - return windDirICA; - } + public String getWindDirICA() { + return windDirICA; + } - public void setWindDirICA(String windDirICA) { - this.windDirICA = windDirICA; - } + public void setWindDirICA(String windDirICA) { + this.windDirICA = windDirICA; + } - public String getWindDirICR() { - return windDirICR; - } + public String getWindDirICR() { + return windDirICR; + } - public void setWindDirICR(String windDirICR) { - this.windDirICR = windDirICR; - } + public void setWindDirICR(String windDirICR) { + this.windDirICR = windDirICR; + } - public float getWindSpeed() { - return windSpeed; - } + public float getWindSpeed() { + return windSpeed; + } - public void setWindSpeed(float windSpeed) { - this.windSpeed = windSpeed; - } + public void setWindSpeed(float windSpeed) { + this.windSpeed = windSpeed; + } - public Date getWindSpeedChangeTime() { - return windSpeedChangeTime; - } + public Date getWindSpeedChangeTime() { + return windSpeedChangeTime; + } - public void setWindSpeedChangeTime(Date windSpeedChangeTime) { - this.windSpeedChangeTime = windSpeedChangeTime; - } + public void setWindSpeedChangeTime(Date windSpeedChangeTime) { + this.windSpeedChangeTime = windSpeedChangeTime; + } - public String getWindSpeedDD() { - return windSpeedDD; - } + public String getWindSpeedDD() { + return windSpeedDD; + } - public void setWindSpeedDD(String windSpeedDD) { - this.windSpeedDD = windSpeedDD; - } + public void setWindSpeedDD(String windSpeedDD) { + this.windSpeedDD = windSpeedDD; + } - public String[] getWindSpeedQCA() { - return windSpeedQCA; - } + public String[] getWindSpeedQCA() { + return windSpeedQCA; + } - public void setWindSpeedQCA(String[] windSpeedQCA) { - this.windSpeedQCA = windSpeedQCA; - } + public void setWindSpeedQCA(String[] windSpeedQCA) { + this.windSpeedQCA = windSpeedQCA; + } - public String[] getWindSpeedQCR() { - return windSpeedQCR; - } + public String[] getWindSpeedQCR() { + return windSpeedQCR; + } - public void setWindSpeedQCR(String[] windSpeedQCR) { - this.windSpeedQCR = windSpeedQCR; - } + public void setWindSpeedQCR(String[] windSpeedQCR) { + this.windSpeedQCR = windSpeedQCR; + } - public int[] getWindSpeedQCD() { - return windSpeedQCD; - } + public int[] getWindSpeedQCD() { + return windSpeedQCD; + } - public void setWindSpeedQCD(int[] windSpeedQCD) { - this.windSpeedQCD = windSpeedQCD; - } + public void setWindSpeedQCD(int[] windSpeedQCD) { + this.windSpeedQCD = windSpeedQCD; + } - public String getWindSpeedICA() { - return windSpeedICA; - } + public String getWindSpeedICA() { + return windSpeedICA; + } - public void setWindSpeedICA(String windSpeedICA) { - this.windSpeedICA = windSpeedICA; - } + public void setWindSpeedICA(String windSpeedICA) { + this.windSpeedICA = windSpeedICA; + } - public String getWindSpeedICR() { - return windSpeedICR; - } + public String getWindSpeedICR() { + return windSpeedICR; + } - public void setWindSpeedICR(String windSpeedICR) { - this.windSpeedICR = windSpeedICR; - } + public void setWindSpeedICR(String windSpeedICR) { + this.windSpeedICR = windSpeedICR; + } - public float getWindGust() { - return windGust; - } + public float getWindGust() { + return windGust; + } - public void setWindGust(float windGust) { - this.windGust = windGust; - } + public void setWindGust(float windGust) { + this.windGust = windGust; + } - public String[] getWindGustQCA() { - return windGustQCA; - } + public String[] getWindGustQCA() { + return windGustQCA; + } - public void setWindGustQCA(String[] windGustQCA) { - this.windGustQCA = windGustQCA; - } + public void setWindGustQCA(String[] windGustQCA) { + this.windGustQCA = windGustQCA; + } - public String[] getWindGustQCR() { - return windGustQCR; - } + public String[] getWindGustQCR() { + return windGustQCR; + } - public void setWindGustQCR(String[] windGustQCR) { - this.windGustQCR = windGustQCR; - } + public void setWindGustQCR(String[] windGustQCR) { + this.windGustQCR = windGustQCR; + } - public int[] getWindGustQCD() { - return windGustQCD; - } + public int[] getWindGustQCD() { + return windGustQCD; + } - public void setWindGustQCD(int[] windGustQCD) { - this.windGustQCD = windGustQCD; - } + public void setWindGustQCD(int[] windGustQCD) { + this.windGustQCD = windGustQCD; + } - public float getWindDirMin() { - return windDirMin; - } + public float getWindDirMin() { + return windDirMin; + } - public void setWindDirMin(float windDirMin) { - this.windDirMin = windDirMin; - } + public void setWindDirMin(float windDirMin) { + this.windDirMin = windDirMin; + } - public float getWindDirMax() { - return windDirMax; - } + public float getWindDirMax() { + return windDirMax; + } - public void setWindDirMax(float windDirMax) { - this.windDirMax = windDirMax; - } + public void setWindDirMax(float windDirMax) { + this.windDirMax = windDirMax; + } - public String getWindDirMaxDD() { - return windDirMaxDD; - } + public String getWindDirMaxDD() { + return windDirMaxDD; + } - public void setWindDirMaxDD(String windDirMaxDD) { - this.windDirMaxDD = windDirMaxDD; - } + public void setWindDirMaxDD(String windDirMaxDD) { + this.windDirMaxDD = windDirMaxDD; + } - public String[] getWindDirMaxQCA() { - return windDirMaxQCA; - } + public String[] getWindDirMaxQCA() { + return windDirMaxQCA; + } - public void setWindDirMaxQCA(String[] windDirMaxQCA) { - this.windDirMaxQCA = windDirMaxQCA; - } + public void setWindDirMaxQCA(String[] windDirMaxQCA) { + this.windDirMaxQCA = windDirMaxQCA; + } - public String[] getWindDirMaxQCR() { - return windDirMaxQCR; - } + public String[] getWindDirMaxQCR() { + return windDirMaxQCR; + } - public void setWindDirMaxQCR(String[] windDirMaxQCR) { - this.windDirMaxQCR = windDirMaxQCR; - } + public void setWindDirMaxQCR(String[] windDirMaxQCR) { + this.windDirMaxQCR = windDirMaxQCR; + } - public int[] getWindDirMaxQCD() { - return windDirMaxQCD; - } + public int[] getWindDirMaxQCD() { + return windDirMaxQCD; + } - public void setWindDirMaxQCD(int[] windDirMaxQCD) { - this.windDirMaxQCD = windDirMaxQCD; - } + public void setWindDirMaxQCD(int[] windDirMaxQCD) { + this.windDirMaxQCD = windDirMaxQCD; + } - public String getSkyCover() { - return skyCover; - } + public String getSkyCover() { + return skyCover; + } - public void setSkyCover(String skyCover) { - this.skyCover = skyCover; - } + public void setSkyCover(String skyCover) { + this.skyCover = skyCover; + } - public float[] getSkyLayerBase() { - return skyLayerBase; - } + public float[] getSkyLayerBase() { + return skyLayerBase; + } - public void setSkyLayerBase(float[] skyLayerBase) { - this.skyLayerBase = skyLayerBase; - } + public void setSkyLayerBase(float[] skyLayerBase) { + this.skyLayerBase = skyLayerBase; + } - public float getVisibility() { - return visibility; - } + public float getVisibility() { + return visibility; + } - public void setVisibility(float visibility) { - this.visibility = visibility; - } + public void setVisibility(float visibility) { + this.visibility = visibility; + } - public String getVisibilityDD() { - return visibilityDD; - } + public String getVisibilityDD() { + return visibilityDD; + } - public void setVisibilityDD(String visibilityDD) { - this.visibilityDD = visibilityDD; - } + public void setVisibilityDD(String visibilityDD) { + this.visibilityDD = visibilityDD; + } - public String[] getVisibilityQCA() { - return visibilityQCA; - } + public String[] getVisibilityQCA() { + return visibilityQCA; + } - public void setVisibilityQCA(String[] visibilityQCA) { - this.visibilityQCA = visibilityQCA; - } + public void setVisibilityQCA(String[] visibilityQCA) { + this.visibilityQCA = visibilityQCA; + } - public String[] getVisibilityQCR() { - return visibilityQCR; - } + public String[] getVisibilityQCR() { + return visibilityQCR; + } - public void setVisibilityQCR(String[] visibilityQCR) { - this.visibilityQCR = visibilityQCR; - } + public void setVisibilityQCR(String[] visibilityQCR) { + this.visibilityQCR = visibilityQCR; + } - public int[] getVisibilityQCD() { - return visibilityQCD; - } + public int[] getVisibilityQCD() { + return visibilityQCD; + } - public void setVisibilityQCD(int[] visibilityQCD) { - this.visibilityQCD = visibilityQCD; - } + public void setVisibilityQCD(int[] visibilityQCD) { + this.visibilityQCD = visibilityQCD; + } - public String getVisibilityICA() { - return visibilityICA; - } + public String getVisibilityICA() { + return visibilityICA; + } - public void setVisibilityICA(String visibilityICA) { - this.visibilityICA = visibilityICA; - } + public void setVisibilityICA(String visibilityICA) { + this.visibilityICA = visibilityICA; + } - public String getVisibilityICR() { - return visibilityICR; - } + public String getVisibilityICR() { + return visibilityICR; + } - public void setVisibilityICR(String visibilityICR) { - this.visibilityICR = visibilityICR; - } + public void setVisibilityICR(String visibilityICR) { + this.visibilityICR = visibilityICR; + } - public float getTotalCloudCover() { - return totalCloudCover; - } + public float getTotalCloudCover() { + return totalCloudCover; + } - public void setTotalCloudCover(float totalCloudCover) { - this.totalCloudCover = totalCloudCover; - } + public void setTotalCloudCover(float totalCloudCover) { + this.totalCloudCover = totalCloudCover; + } - public String getCloudBaseHeight() { - return cloudBaseHeight; - } + public String getCloudBaseHeight() { + return cloudBaseHeight; + } - public void setCloudBaseHeight(String cloudBaseHeight) { - this.cloudBaseHeight = cloudBaseHeight; - } + public void setCloudBaseHeight(String cloudBaseHeight) { + this.cloudBaseHeight = cloudBaseHeight; + } - public String getPresWeather() { - return presWeather; - } + public String getPresWeather() { + return presWeather; + } - public void setPresWeather(String presWeather) { - this.presWeather = presWeather; - } + public void setPresWeather(String presWeather) { + this.presWeather = presWeather; + } - public String getLowLevelCloudType() { - return lowLevelCloudType; - } + public String getLowLevelCloudType() { + return lowLevelCloudType; + } - public void setLowLevelCloudType(String lowLevelCloudType) { - this.lowLevelCloudType = lowLevelCloudType; - } + public void setLowLevelCloudType(String lowLevelCloudType) { + this.lowLevelCloudType = lowLevelCloudType; + } - public String getMidLevelCloudType() { - return midLevelCloudType; - } + public String getMidLevelCloudType() { + return midLevelCloudType; + } - public void setMidLevelCloudType(String midLevelCloudType) { - this.midLevelCloudType = midLevelCloudType; - } + public void setMidLevelCloudType(String midLevelCloudType) { + this.midLevelCloudType = midLevelCloudType; + } - public String getHighLevelCloudType() { - return highLevelCloudType; - } + public String getHighLevelCloudType() { + return highLevelCloudType; + } - public void setHighLevelCloudType(String highLevelCloudType) { - this.highLevelCloudType = highLevelCloudType; - } + public void setHighLevelCloudType(String highLevelCloudType) { + this.highLevelCloudType = highLevelCloudType; + } - public String getMaxTempRecordPeriod() { - return maxTempRecordPeriod; - } + public String getMaxTempRecordPeriod() { + return maxTempRecordPeriod; + } - public void setMaxTempRecordPeriod(String maxTempRecordPeriod) { - this.maxTempRecordPeriod = maxTempRecordPeriod; - } + public void setMaxTempRecordPeriod(String maxTempRecordPeriod) { + this.maxTempRecordPeriod = maxTempRecordPeriod; + } - public String getMinTempRecordPeriod() { - return minTempRecordPeriod; - } + public String getMinTempRecordPeriod() { + return minTempRecordPeriod; + } - public void setMinTempRecordPeriod(String minTempRecordPeriod) { - this.minTempRecordPeriod = minTempRecordPeriod; - } + public void setMinTempRecordPeriod(String minTempRecordPeriod) { + this.minTempRecordPeriod = minTempRecordPeriod; + } - public float getMinimumTemperature() { - return minimumTemperature; - } + public float getMinimumTemperature() { + return minimumTemperature; + } - public void setMinimumTemperature(float minimumTemperature) { - this.minimumTemperature = minimumTemperature; - } + public void setMinimumTemperature(float minimumTemperature) { + this.minimumTemperature = minimumTemperature; + } - public float getRawPrecip() { - return rawPrecip; - } + public float getRawPrecip() { + return rawPrecip; + } - public void setRawPrecip(float rawPrecip) { - this.rawPrecip = rawPrecip; - } + public void setRawPrecip(float rawPrecip) { + this.rawPrecip = rawPrecip; + } - public float getPrecipAccum() { - return precipAccum; - } + public float getPrecipAccum() { + return precipAccum; + } - public void setPrecipAccum(float precipAccum) { - this.precipAccum = precipAccum; - } + public void setPrecipAccum(float precipAccum) { + this.precipAccum = precipAccum; + } - public String getPrecipAccumDD() { - return precipAccumDD; - } + public String getPrecipAccumDD() { + return precipAccumDD; + } - public void setPrecipAccumDD(String precipAccumDD) { - this.precipAccumDD = precipAccumDD; - } + public void setPrecipAccumDD(String precipAccumDD) { + this.precipAccumDD = precipAccumDD; + } - public String[] getPrecipAccumQCA() { - return precipAccumQCA; - } + public String[] getPrecipAccumQCA() { + return precipAccumQCA; + } - public void setPrecipAccumQCA(String[] precipAccumQCA) { - this.precipAccumQCA = precipAccumQCA; - } + public void setPrecipAccumQCA(String[] precipAccumQCA) { + this.precipAccumQCA = precipAccumQCA; + } - public String[] getPrecipAccumQCR() { - return precipAccumQCR; - } + public String[] getPrecipAccumQCR() { + return precipAccumQCR; + } - public void setPrecipAccumQCR(String[] precipAccumQCR) { - this.precipAccumQCR = precipAccumQCR; - } + public void setPrecipAccumQCR(String[] precipAccumQCR) { + this.precipAccumQCR = precipAccumQCR; + } - public int[] getPrecipAccumQCD() { - return precipAccumQCD; - } + public int[] getPrecipAccumQCD() { + return precipAccumQCD; + } - public void setPrecipAccumQCD(int[] precipAccumQCD) { - this.precipAccumQCD = precipAccumQCD; - } + public void setPrecipAccumQCD(int[] precipAccumQCD) { + this.precipAccumQCD = precipAccumQCD; + } - public String getPrecipAccumICA() { - return precipAccumICA; - } + public String getPrecipAccumICA() { + return precipAccumICA; + } - public void setPrecipAccumICA(String precipAccumICA) { - this.precipAccumICA = precipAccumICA; - } + public void setPrecipAccumICA(String precipAccumICA) { + this.precipAccumICA = precipAccumICA; + } - public String getPrecipAccumICR() { - return precipAccumICR; - } + public String getPrecipAccumICR() { + return precipAccumICR; + } - public void setPrecipAccumICR(String precipAccumICR) { - this.precipAccumICR = precipAccumICR; - } + public void setPrecipAccumICR(String precipAccumICR) { + this.precipAccumICR = precipAccumICR; + } - public float getPrecipRate() { - return precipRate; - } + public float getPrecipRate() { + return precipRate; + } - public void setPrecipRate(float precipRate) { - this.precipRate = precipRate; - } + public void setPrecipRate(float precipRate) { + this.precipRate = precipRate; + } - public String getPrecipRateDD() { - return precipRateDD; - } + public String getPrecipRateDD() { + return precipRateDD; + } - public void setPrecipRateDD(String precipRateDD) { - this.precipRateDD = precipRateDD; - } + public void setPrecipRateDD(String precipRateDD) { + this.precipRateDD = precipRateDD; + } - public String[] getPrecipRateQCA() { - return precipRateQCA; - } + public String[] getPrecipRateQCA() { + return precipRateQCA; + } - public void setPrecipRateQCA(String[] precipRateQCA) { - this.precipRateQCA = precipRateQCA; - } + public void setPrecipRateQCA(String[] precipRateQCA) { + this.precipRateQCA = precipRateQCA; + } - public String[] getPrecipRateQCR() { - return precipRateQCR; - } + public String[] getPrecipRateQCR() { + return precipRateQCR; + } - public void setPrecipRateQCR(String[] precipRateQCR) { - this.precipRateQCR = precipRateQCR; - } + public void setPrecipRateQCR(String[] precipRateQCR) { + this.precipRateQCR = precipRateQCR; + } - public int[] getPrecipRateQCD() { - return precipRateQCD; - } + public int[] getPrecipRateQCD() { + return precipRateQCD; + } - public void setPrecipRateQCD(int[] precipRateQCD) { - this.precipRateQCD = precipRateQCD; - } + public void setPrecipRateQCD(int[] precipRateQCD) { + this.precipRateQCD = precipRateQCD; + } - public String getPrecipType() { - return precipType; - } + public String getPrecipType() { + return precipType; + } - public void setPrecipType(String precipType) { - this.precipType = precipType; - } + public void setPrecipType(String precipType) { + this.precipType = precipType; + } - public String getPrecipIntensity() { - return precipIntensity; - } + public String getPrecipIntensity() { + return precipIntensity; + } - public void setPrecipIntensity(String precipIntensity) { - this.precipIntensity = precipIntensity; - } + public void setPrecipIntensity(String precipIntensity) { + this.precipIntensity = precipIntensity; + } - public int getTimeSinceLastPcp() { - return timeSinceLastPcp; - } + public int getTimeSinceLastPcp() { + return timeSinceLastPcp; + } - public void setTimeSinceLastPcp(int timeSinceLastPcp) { - this.timeSinceLastPcp = timeSinceLastPcp; - } + public void setTimeSinceLastPcp(int timeSinceLastPcp) { + this.timeSinceLastPcp = timeSinceLastPcp; + } - public float getSolarRadiation() { - return solarRadiation; - } + public float getSolarRadiation() { + return solarRadiation; + } - public void setSolarRadiation(float solarRadiation) { - this.solarRadiation = solarRadiation; - } + public void setSolarRadiation(float solarRadiation) { + this.solarRadiation = solarRadiation; + } - public Date getSolarRadiationChangeTime() { - return solarRadiationChangeTime; - } + public Date getSolarRadiationChangeTime() { + return solarRadiationChangeTime; + } - public void setSolarRadiationChangeTime(Date solarRadiationChangeTime) { - this.solarRadiationChangeTime = solarRadiationChangeTime; - } + public void setSolarRadiationChangeTime(Date solarRadiationChangeTime) { + this.solarRadiationChangeTime = solarRadiationChangeTime; + } - public float getSeaSurfaceTemp() { - return seaSurfaceTemp; - } + public float getSeaSurfaceTemp() { + return seaSurfaceTemp; + } - public void setSeaSurfaceTemp(float seaSurfaceTemp) { - this.seaSurfaceTemp = seaSurfaceTemp; - } + public void setSeaSurfaceTemp(float seaSurfaceTemp) { + this.seaSurfaceTemp = seaSurfaceTemp; + } - public String getSeaSurfaceTempDD() { - return seaSurfaceTempDD; - } + public String getSeaSurfaceTempDD() { + return seaSurfaceTempDD; + } - public void setSeaSurfaceTempDD(String seaSurfaceTempDD) { - this.seaSurfaceTempDD = seaSurfaceTempDD; - } + public void setSeaSurfaceTempDD(String seaSurfaceTempDD) { + this.seaSurfaceTempDD = seaSurfaceTempDD; + } - public String[] getSeaSurfaceTempQCA() { - return seaSurfaceTempQCA; - } + public String[] getSeaSurfaceTempQCA() { + return seaSurfaceTempQCA; + } - public void setSeaSurfaceTempQCA(String[] seaSurfaceTempQCA) { - this.seaSurfaceTempQCA = seaSurfaceTempQCA; - } + public void setSeaSurfaceTempQCA(String[] seaSurfaceTempQCA) { + this.seaSurfaceTempQCA = seaSurfaceTempQCA; + } - public String[] getSeaSurfaceTempQCR() { - return seaSurfaceTempQCR; - } + public String[] getSeaSurfaceTempQCR() { + return seaSurfaceTempQCR; + } - public void setSeaSurfaceTempQCR(String[] seaSurfaceTempQCR) { - this.seaSurfaceTempQCR = seaSurfaceTempQCR; - } + public void setSeaSurfaceTempQCR(String[] seaSurfaceTempQCR) { + this.seaSurfaceTempQCR = seaSurfaceTempQCR; + } - public int[] getSeaSurfaceTempQCD() { - return seaSurfaceTempQCD; - } + public int[] getSeaSurfaceTempQCD() { + return seaSurfaceTempQCD; + } - public void setSeaSurfaceTempQCD(int[] seaSurfaceTempQCD) { - this.seaSurfaceTempQCD = seaSurfaceTempQCD; - } + public void setSeaSurfaceTempQCD(int[] seaSurfaceTempQCD) { + this.seaSurfaceTempQCD = seaSurfaceTempQCD; + } - public String getSeaSurfaceTempICA() { - return seaSurfaceTempICA; - } + public String getSeaSurfaceTempICA() { + return seaSurfaceTempICA; + } - public void setSeaSurfaceTempICA(String seaSurfaceTempICA) { - this.seaSurfaceTempICA = seaSurfaceTempICA; - } + public void setSeaSurfaceTempICA(String seaSurfaceTempICA) { + this.seaSurfaceTempICA = seaSurfaceTempICA; + } - public String getSeaSurfaceTempICR() { - return seaSurfaceTempICR; - } - - public void setSeaSurfaceTempICR(String seaSurfaceTempICR) { - this.seaSurfaceTempICR = seaSurfaceTempICR; - } - - public float getWavePeriod() { - return wavePeriod; - } - - public void setWavePeriod(float wavePeriod) { - this.wavePeriod = wavePeriod; - } - - public float getWaveHeight() { - return waveHeight; - } - - public void setWaveHeight(float waveHeight) { - this.waveHeight = waveHeight; - } - - public String getRawMessage() { - return rawMessage; - } - - public void setRawMessage(String rawMessage) { - this.rawMessage = rawMessage; - } - - public float getTotalColumnPWV() { - return totalColumnPWV; - } - - public void setTotalColumnPWV(float totalColumnPWV) { - this.totalColumnPWV = totalColumnPWV; - } - - public float getTotalSignalDelay() { - return totalSignalDelay; - } - - public void setTotalSignalDelay(float totalSignalDelay) { - this.totalSignalDelay = totalSignalDelay; - } - - public float getDrySignalDelay() { - return drySignalDelay; - } - - public void setDrySignalDelay(float drySignalDelay) { - this.drySignalDelay = drySignalDelay; - } - - public float getWetSignalDelay() { - return wetSignalDelay; - } - - public void setWetSignalDelay(float wetSignalDelay) { - this.wetSignalDelay = wetSignalDelay; - } - - public float getMeanWeightedTemperature() { - return meanWeightedTemperature; - } - - public void setMeanWeightedTemperature(float meanWeightedTemperature) { - this.meanWeightedTemperature = meanWeightedTemperature; - } - - public float getFormalError() { - return formalError; - } - - public void setFormalError(float formalError) { - this.formalError = formalError; - } - - public float getCapPi() { - return capPi; - } - - public void setCapPi(float capPi) { - this.capPi = capPi; - } - - public static long getSerialVersionUID() { - return serialVersionUID; - } - - /** - * @return the ncSet - */ - public String getNcSet() { - return ncSet; - } - - /** - * @param ncSet - * the ncSet to set - */ - public void setNcSet(String ncSet) { - this.ncSet = ncSet; - } - - /** - * @return the ncIndex - */ - public int getNcIndex() { - return pointDataView != null ? pointDataView.curIdx : -1; - } - - /** - * @param ncIndex - * the ncIndex to set - */ - public void setNcIndex(int ncIndex) { - if (this.pointDataView == null) - pointDataView = new FakePointDataView(); - this.pointDataView.curIdx = ncIndex; - } - - @Override - public ISpatialObject getSpatialObject() { - return location; - } - - /** - * @return the qcType - */ - public String getQcType() { - return qcType; - } - - /** - * @param qcType - * the qcType to set - */ - public void setQcType(String qcType) { - this.qcType = qcType; - } - - public FakePointDataView getPointDataView() { - return pointDataView; - } - - public void setPointDataView(FakePointDataView pointDataView) { - this.pointDataView = pointDataView; - } + public String getSeaSurfaceTempICR() { + return seaSurfaceTempICR; + } + + public void setSeaSurfaceTempICR(String seaSurfaceTempICR) { + this.seaSurfaceTempICR = seaSurfaceTempICR; + } + + public float getWavePeriod() { + return wavePeriod; + } + + public void setWavePeriod(float wavePeriod) { + this.wavePeriod = wavePeriod; + } + + public float getWaveHeight() { + return waveHeight; + } + + public void setWaveHeight(float waveHeight) { + this.waveHeight = waveHeight; + } + + public String getRawMessage() { + return rawMessage; + } + + public void setRawMessage(String rawMessage) { + this.rawMessage = rawMessage; + } + + public float getTotalColumnPWV() { + return totalColumnPWV; + } + + public void setTotalColumnPWV(float totalColumnPWV) { + this.totalColumnPWV = totalColumnPWV; + } + + public float getTotalSignalDelay() { + return totalSignalDelay; + } + + public void setTotalSignalDelay(float totalSignalDelay) { + this.totalSignalDelay = totalSignalDelay; + } + + public float getDrySignalDelay() { + return drySignalDelay; + } + + public void setDrySignalDelay(float drySignalDelay) { + this.drySignalDelay = drySignalDelay; + } + + public float getWetSignalDelay() { + return wetSignalDelay; + } + + public void setWetSignalDelay(float wetSignalDelay) { + this.wetSignalDelay = wetSignalDelay; + } + + public float getMeanWeightedTemperature() { + return meanWeightedTemperature; + } + + public void setMeanWeightedTemperature(float meanWeightedTemperature) { + this.meanWeightedTemperature = meanWeightedTemperature; + } + + public float getFormalError() { + return formalError; + } + + public void setFormalError(float formalError) { + this.formalError = formalError; + } + + public float getCapPi() { + return capPi; + } + + public void setCapPi(float capPi) { + this.capPi = capPi; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + /** + * @return the ncSet + */ + public String getNcSet() { + return ncSet; + } + + /** + * @param ncSet + * the ncSet to set + */ + public void setNcSet(String ncSet) { + this.ncSet = ncSet; + } + + /** + * @return the ncIndex + */ + public int getNcIndex() { + return pointDataView != null ? pointDataView.curIdx : -1; + } + + /** + * @param ncIndex + * the ncIndex to set + */ + public void setNcIndex(int ncIndex) { + if (this.pointDataView == null) { + pointDataView = new FakePointDataView(); + } + this.pointDataView.curIdx = ncIndex; + } + + @Override + public ISpatialObject getSpatialObject() { + return location; + } + + /** + * @return the qcType + */ + public String getQcType() { + return qcType; + } + + /** + * @param qcType + * the qcType to set + */ + public void setQcType(String qcType) { + this.qcType = qcType; + } + + public FakePointDataView getPointDataView() { + return pointDataView; + } + + public void setPointDataView(FakePointDataView pointDataView) { + this.pointDataView = pointDataView; + } + + @Override + public String getPluginName() { + return "qc"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.qpf/src/com/raytheon/uf/common/dataplugin/qpf/QPFRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.qpf/src/com/raytheon/uf/common/dataplugin/qpf/QPFRecord.java index 52b7ec81bb..990b1bda20 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.qpf/src/com/raytheon/uf/common/dataplugin/qpf/QPFRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.qpf/src/com/raytheon/uf/common/dataplugin/qpf/QPFRecord.java @@ -64,14 +64,16 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 2/24/09 2027 D. Hladky Initial release - * 4/27/12 #562 dgilling Rename getters/setters to - * match Java conventions. - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 04/08/13 #1293 bkowal Removed references to hdffileid. + * Feb 24, 2009 2027 D. Hladky Initial release + * Apr 27, 2012 562 dgilling Rename getters/setters to match Java + * conventions. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -85,17 +87,13 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "qpf", - indexes = { - @Index(name = "qpf_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "qpf", indexes = { @Index(name = "qpf_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class QPFRecord extends PersistablePluginDataObject - implements ISpatialEnabled, IMonitorProcessing { +public class QPFRecord extends PersistablePluginDataObject implements + ISpatialEnabled, IMonitorProcessing { private static final long serialVersionUID = 767763365671L; @@ -515,9 +513,9 @@ public class QPFRecord extends PersistablePluginDataObject try { IDataRecord[] dataRec = dataStore.retrieve(getDataURI()); - for (int i = 0; i < dataRec.length; i++) { - if (dataRec[i] instanceof FloatDataRecord) { - setDataArray(((FloatDataRecord) dataRec[i]).getFloatData()); + for (IDataRecord element : dataRec) { + if (element instanceof FloatDataRecord) { + setDataArray(((FloatDataRecord) element).getFloatData()); } } } catch (Exception se) { @@ -592,4 +590,9 @@ public class QPFRecord extends PersistablePluginDataObject public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "qpf"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/RadarRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/RadarRecord.java index 7e86311d89..93aafa1d65 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/RadarRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.radar/src/com/raytheon/uf/common/dataplugin/radar/RadarRecord.java @@ -118,19 +118,22 @@ import com.vividsolutions.jts.geom.Coordinate; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 02/14/2007 139 Phillippe Initial creation - * 09/14/2007 379 jkorman Added populateDataStore() and - * getPersistenceTime() from new IPersistable - * 10/09/2007 465 randerso Updated to better represent level 3 data - * 20071129 472 jkorman Added IDecoderGettable interface. - * 03/04/2013 DCS51 zwang Handle MIGFA product + * Feb 14, 2007 139 Phillippe Initial creation + * Sep 14, 2007 379 jkorman Added populateDataStore() and + * getPersistenceTime() from new + * IPersistable + * Oct 09, 2007 465 randerso Updated to better represent level 3 data + * Nov 29, 2007 472 jkorman Added IDecoderGettable interface. + * Mar 04, 2013 DCS51 zwang Handle MIGFA product * Mar 18, 2013 1804 bsteffen Remove AlphanumericValues from radar * HDF5. - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime * Apr 08, 2013 1293 bkowal Removed references to hdffileid. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -144,12 +147,8 @@ import com.vividsolutions.jts.geom.Coordinate; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "radar", - indexes = { - @Index(name = "radar_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "radar", indexes = { @Index(name = "radar_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -384,7 +383,6 @@ public class RadarRecord extends PersistablePluginDataObject implements public RadarRecord(RadarRecord that) { this.id = that.id; this.dataURI = that.dataURI; - this.pluginName = that.pluginName; this.dataTime = that.dataTime; this.insertTime = that.insertTime; this.messageData = that.messageData; @@ -614,18 +612,18 @@ public class RadarRecord extends PersistablePluginDataObject implements public void setRawDataValue(int radial, int bin, byte value) { byte[] rawData = getRawData(); - if (rawData != null && numRadials != null && numBins != null) { + if ((rawData != null) && (numRadials != null) && (numBins != null)) { if ((radial < numRadials) && (bin < numBins)) { - rawData[radial * numBins + bin] = value; + rawData[(radial * numBins) + bin] = value; } } } public byte getRawDataValue(int radial, int bin) { byte[] rawData = getRawData(); - if (rawData != null && numRadials != null && numBins != null) { + if ((rawData != null) && (numRadials != null) && (numBins != null)) { if ((radial < numRadials) && (bin < numBins)) { - return rawData[radial * numBins + bin]; + return rawData[(radial * numBins) + bin]; } } return 0; @@ -638,9 +636,9 @@ public class RadarRecord extends PersistablePluginDataObject implements short[] rawShortData = getRawShortData(); byte[] rawData = getRawData(); if (rawShortData != null) { - return rawShortData[radial * numBins + bin]; + return rawShortData[(radial * numBins) + bin]; } else if (rawData != null) { - return (short) (rawData[radial * numBins + bin] & 0xFF); + return (short) (rawData[(radial * numBins) + bin] & 0xFF); } } return 0; @@ -652,9 +650,9 @@ public class RadarRecord extends PersistablePluginDataObject implements short[] rawShortData = getRawShortData(); byte[] rawData = getRawData(); if (rawShortData != null) { - return rawShortData[radial * numBins + bin] & 0xFFFF; + return rawShortData[(radial * numBins) + bin] & 0xFFFF; } else if (rawData != null) { - return rawData[radial * numBins + bin] & 0xFF; + return rawData[(radial * numBins) + bin] & 0xFF; } } return 0; @@ -892,7 +890,7 @@ public class RadarRecord extends PersistablePluginDataObject implements pix = new double[] { 129, 149 }; } - double[] data = { offset, offset + (nLevels - 1) * scale }; + double[] data = { offset, offset + ((nLevels - 1) * scale) }; rval = new PiecewisePixel(getUnitObject(), pix, data); } else { @@ -1127,7 +1125,7 @@ public class RadarRecord extends PersistablePluginDataObject implements } // distance - double mag = Math.sqrt(i * i + j * j); + double mag = Math.sqrt((i * i) + (j * j)); // 1 i or j is 1/4 km, so convert to meters mag *= 250; @@ -1201,19 +1199,19 @@ public class RadarRecord extends PersistablePluginDataObject implements private void addPacketData(double i, double j, String stormID, int type, RadarProductType productType, T currData, boolean needToConvert) { - - // Convert x/y to lon/lat - if (needToConvert) { - Coordinate coor; - - // for MIGFA, i/j unit is 1km, for other radar products, unit is 1/4km - if (type == 140) { - coor = convertStormLatLon(i * 4.0, j * 4.0); - } - else { + + // Convert x/y to lon/lat + if (needToConvert) { + Coordinate coor; + + // for MIGFA, i/j unit is 1km, for other radar products, unit is + // 1/4km + if (type == 140) { + coor = convertStormLatLon(i * 4.0, j * 4.0); + } else { coor = convertStormLatLon(i, j); - } - + } + i = coor.x; j = coor.y; } @@ -1496,11 +1494,11 @@ public class RadarRecord extends PersistablePluginDataObject implements convertLatLon = true; Map map = new HashMap(); - + for (GenericDataParameter param : packet.getParams() .values()) { - - GFMAttributeIDs id = null; + + GFMAttributeIDs id = null; id = GFMAttributeIDs.getAttribute(param.getId()); if (id != null) { @@ -1517,7 +1515,7 @@ public class RadarRecord extends PersistablePluginDataObject implements for (GenericDataComponent currComponent : packet .getFeatures().values()) { currFeature = (AreaComponent) currComponent; - //first point of GFM + // first point of GFM i = currFeature.getPoints().get(0).getCoordinate1(); j = currFeature.getPoints().get(0).getCoordinate2(); @@ -1525,7 +1523,7 @@ public class RadarRecord extends PersistablePluginDataObject implements currFeature, convertLatLon); } continue PACKET; - }else if (currPacket instanceof GenericDataPacket) { + } else if (currPacket instanceof GenericDataPacket) { // Generic Packet will contain most of the data for the // product, so, in general, nothing probably needs to be // done here @@ -1753,4 +1751,9 @@ public class RadarRecord extends PersistablePluginDataObject implements public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "radar"; + } } \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/SatelliteRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/SatelliteRecord.java index 60e7602073..43d16cf8ff 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/SatelliteRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/SatelliteRecord.java @@ -57,21 +57,22 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 02/14/07 139 bphillip Initial Creation - * 20070914 379 jkorman Added populateDataStore() and - * getPersistenceTime() from new IPersistable - * 20071129 472 jkorman Added IDecoderGettable interface. - * 20081106 1515 jkorman Changed units length from 16 to 26 - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * - AWIPS2 Baseline Repository -------- - * 07/30/2012 798 jkorman Support for common satellite data. - * 03/25/2013 1823 dgilling Replace underscores with spaces in URI + * Feb 14, 2007 139 bphillip Initial Creation + * Sep 14, 2007 379 jkorman Added populateDataStore() and + * getPersistenceTime() from new + * IPersistable + * Nov 29, 2007 472 jkorman Added IDecoderGettable interface. + * Nov 06, 2008 1515 jkorman Changed units length from 16 to 26 + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Jul 30, 2012 798 jkorman Support for common satellite data. + * Mar 25, 2013 1823 dgilling Replace underscores with spaces in URI * constructor. - * 04/08/2013 1293 bkowal Removed references to hdffileid. + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. - * + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author bphillip @@ -412,4 +413,9 @@ public class SatelliteRecord extends PersistablePluginDataObject public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "satellite"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.scan/src/com/raytheon/uf/common/dataplugin/scan/ScanRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.scan/src/com/raytheon/uf/common/dataplugin/scan/ScanRecord.java index 12766b1ae7..6c8088a775 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.scan/src/com/raytheon/uf/common/dataplugin/scan/ScanRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.scan/src/com/raytheon/uf/common/dataplugin/scan/ScanRecord.java @@ -68,14 +68,16 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 03/17/10 2521 D. Hladky Initial release - * 02/01/13 1649 D. Hladky better logging, + * Mar 17, 2010 2521 D. Hladky Initial release + * Feb 01, 2013 1649 D. Hladky better logging, * Feb 28, 2013 1731 bsteffen Optimize construction of scan resource. - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 8, 2013 1293 bkowal Removed references to hdffileid. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -407,4 +409,9 @@ public class ScanRecord extends PersistablePluginDataObject { public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "scan"; + } } \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.sfcobs/src/com/raytheon/uf/common/dataplugin/sfcobs/ObsCommon.java b/edexOsgi/com.raytheon.uf.common.dataplugin.sfcobs/src/com/raytheon/uf/common/dataplugin/sfcobs/ObsCommon.java index b2fadfe38c..74cb688e0d 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.sfcobs/src/com/raytheon/uf/common/dataplugin/sfcobs/ObsCommon.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.sfcobs/src/com/raytheon/uf/common/dataplugin/sfcobs/ObsCommon.java @@ -71,11 +71,13 @@ import com.vividsolutions.jts.geom.Geometry; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Oct 1, 2009 jkorman Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Oct 01, 2009 jkorman Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -89,1589 +91,1591 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "sfcobs", - indexes = { - @Index(name = "sfcobs_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "sfcobs", indexes = { @Index(name = "sfcobs_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class ObsCommon extends PersistablePluginDataObject implements - ISpatialEnabled, IDecoderGettable, IPointData { - - private static final long serialVersionUID = 1L; - - private static final int MISSING = -9999; - - public static final Unit TEMPERATURE_UNIT = SI.KELVIN; - - public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; - - public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; - - public static final Unit PRESSURE_UNIT = SI.PASCAL; - - public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; - - public static final Unit WAVE_UNIT = SI.METER; - - public static final Unit VISIBILITY_UNIT = NonSI.MILE; - - public static final Unit CLOUD_COVER = NonSI.OCTET; - - private static final HashMap PARM_MAP = new HashMap(); - static { - PARM_MAP.put("T", SFC_TEMP); - PARM_MAP.put("DpT", SFC_DWPT); - PARM_MAP.put("WS", SFC_WNDSPD); - PARM_MAP.put("WD", SFC_WNDDIR); - PARM_MAP.put("WGS", SFC_WNDGST); - PARM_MAP.put("Px", PRES_STATION); - PARM_MAP.put("PMSL", PRES_SLP); - PARM_MAP.put("ASET", PRES_ALTSG); - PARM_MAP.put("NLAT", STA_LAT); - PARM_MAP.put("NLON", STA_LON); - PARM_MAP.put("WT", "WT"); - PARM_MAP.put("TCC", "TCC"); - PARM_MAP.put("WP", "WP"); - PARM_MAP.put("WH", "WH"); - PARM_MAP.put("SWP", "SWP"); - PARM_MAP.put("SWH", "SWH"); - PARM_MAP.put("SWS", "SWS"); - PARM_MAP.put("SWD", "SWD"); - PARM_MAP.put("SWGS", "SWGS"); - PARM_MAP.put("PCHNG", "PCHNG"); - PARM_MAP.put("PKWND", "PKWND"); - PARM_MAP.put("VIS", "VIS"); - PARM_MAP.put("COVpct", "COVpct"); - } - - // - @DataURI(position = 1) - @Column - @XmlAttribute - @DynamicSerializeElement - @Index(name = "reporttype_index") - private Integer reportType; - - // Correction indicator from wmo header - @DataURI(position = 2) - @Column - @XmlElement - @DynamicSerializeElement - private String corIndicator; - - @Embedded - @DataURI(position = 3, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; - - // Time of the observation. - @Column - @XmlAttribute - @DynamicSerializeElement - private Calendar timeObs; - - // Time of the observation to the nearest hour. - @Column - @XmlAttribute - @DynamicSerializeElement - private Calendar refHour; - - @Transient - @XmlElement - @DynamicSerializeElement - private String obsText = ""; - - // Text of the WMO header - @Transient - @XmlElement - @DynamicSerializeElement - private String wmoHeader = ""; - - // Observation air temperature in degrees Kelvin. - @Transient - @XmlElement - @DynamicSerializeElement - private Double temp = -9999.0; - - // Observation dewpoint temperature in degrees Kelvin. - @Transient - @XmlElement - @DynamicSerializeElement - private Double dwpt = -9999.0; - - // Relative Humidity in percent. Decimal(5,2) - @Transient - @XmlElement - @DynamicSerializeElement - private Double humidity = -9999.0; - - // Observation sea surface temperature in degrees Kelvin. - @Transient - @XmlElement - @DynamicSerializeElement - private Double seaTemp = -9999.0; - - // Observation wetbulb temperature in degrees Kelvin. - @Transient - @XmlElement - @DynamicSerializeElement - private Double wetBulb = -9999.0; - - // Observation wind direction in angular degrees. Integer - @Transient - @XmlElement - @DynamicSerializeElement - private Integer windDirection = -9999; - - // Observation wind speed in meters per second. - @Transient - @XmlElement - @DynamicSerializeElement - private Double windSpeed = -9999.0; - - // Observation wind speed gust in meters per second. - @Transient - @XmlElement - @DynamicSerializeElement - private Double windGust = -9999.0; - - // Direction of the peak wind observation in angular degrees - @Transient - @XmlElement - @DynamicSerializeElement - private Integer peakWindDir = -9999; - - // Speed of the peak wind observation in meters per second. - @Transient - @XmlElement - @DynamicSerializeElement - private Double peakWindSpeed = -9999.0; - - // Time of the peak wind observation. - @Transient - @XmlElement - @DynamicSerializeElement - private Long peakWindTime = -1L; - - // The equivilent 10 meter wind speed in meters per second. - @Transient - @XmlElement - @DynamicSerializeElement - private Double wind10mSpeed = -9999.0; - - // The equivilent 20 meter wind speed in meters per second. - @Transient - @XmlElement - @DynamicSerializeElement - private Double wind20mSpeed = -9999.0; - - // Altimeter setting in Pascals. - @Transient - @XmlElement - @DynamicSerializeElement - private Integer pressureAltimeter = -9999; - - // Sea level pressure in Pascals. - @Transient - @XmlElement - @DynamicSerializeElement - private Integer pressureSealevel = -9999; - - // Station pressure in Pascals. - @Transient - @XmlElement - @DynamicSerializeElement - private Integer pressureStation = -9999; - - // Three hour pressure change in pascals. - @Transient - @XmlElement - @DynamicSerializeElement - private Double pressChange3Hr = -9999.0; - - // Three hour pressure change characteristic. - @Transient - @XmlElement - @DynamicSerializeElement - private Integer pressChangeChar = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer wx_past_1 = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer wx_past_2 = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer wx_present = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private String presWeather = null; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer wx_report_type = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer horzVisibility = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer vertVisibility = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer totalCloudCover = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer cloudBaseHeight = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer lowCloudType = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer midCloudType = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer highCloudType = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer platformDirection = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Double platformMovement = -9999.0; - - @Transient - @XmlElement - @DynamicSerializeElement - private String shipIceData = ""; - - @Transient - @XmlElement - @DynamicSerializeElement - private Double windWaveHeight = -9999.0; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer windWavePeriod = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Double waveSteepness = -9999.0; - - @Transient - @XmlElement - @DynamicSerializeElement - private Double waveHeight = -9999.0; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer wavePeriod = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Double highResWaveHeight = -9999.0; - - @Transient - @XmlElement - @DynamicSerializeElement - private Double primarySwellWaveDir = -9999.0; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer primarySwellWavePeriod = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Double primarySwellWaveHeight = -9999.0; - - @Transient - @XmlElement - @DynamicSerializeElement - private Double secondarySwellWaveDir = -9999.0; - - @Transient - @XmlElement - @DynamicSerializeElement - private Integer secondarySwellWavePeriod = -9999; - - @Transient - @XmlElement - @DynamicSerializeElement - private Double secondarySwellWaveHeight = -9999.0; - - @Transient - @XmlElement - @DynamicSerializeElement - private List ancClouds; - - @Transient - @XmlElement - @DynamicSerializeElement - private List ancWaves; - - @Transient - @XmlElement - @DynamicSerializeElement - private List ancTemp; - - @Transient - @XmlElement - @DynamicSerializeElement - private List ancPrecip; - - @Transient - @XmlElement - @DynamicSerializeElement - private List ancWinds; - - @Transient - @XmlElement - @DynamicSerializeElement - private List ancPressure; - - @Transient - @XmlElement - @DynamicSerializeElement - private List interWinds; - - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - /** - * Empty default constructor - */ - public ObsCommon() { - } - - /** - * Construct an instance of this class using the supplied datauri. - * - * @param dataUri - */ - public ObsCommon(String dataUri) { - super(dataUri); - } - - /** - * @return the reportType - */ - public Integer getReportType() { - return reportType; - } - - /** - * @param reportType - * the reportType to set - */ - public void setReportType(Integer reportType) { - this.reportType = reportType; - } - - /** - * @return the corIndicator - */ - public String getCorIndicator() { - return corIndicator; - } - - /** - * @param corIndicator - * the corIndicator to set - */ - public void setCorIndicator(String corIndicator) { - this.corIndicator = corIndicator; - } - - /** - * @return the timeObs - */ - public Calendar getTimeObs() { - return timeObs; - } - - /** - * @param timeObs - * the timeObs to set - */ - public void setTimeObs(Calendar timeObs) { - this.timeObs = timeObs; - } - - /** - * @return the refHour - */ - public Calendar getRefHour() { - return refHour; - } - - /** - * @param refHour - * the refHour to set - */ - public void setRefHour(Calendar refHour) { - this.refHour = refHour; - } - - /** - * @return the obsText - */ - public String getObsText() { - return obsText; - } - - /** - * @param obsText - * the obsText to set - */ - public void setObsText(String obsText) { - this.obsText = obsText; - } - - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } - - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } - - /** - * @return the temp - */ - public Double getTemp() { - return temp; - } - - /** - * @param temp - * the temp to set - */ - public void setTemp(Double temp) { - this.temp = temp; - } - - /** - * @return the dwpt - */ - public Double getDwpt() { - return dwpt; - } - - /** - * @param dwpt - * the dwpt to set - */ - public void setDwpt(Double dwpt) { - this.dwpt = dwpt; - } - - /** - * @return the humidity - */ - public Double getHumidity() { - return humidity; - } - - /** - * @param humidity - * the humidity to set - */ - public void setHumidity(Double humidity) { - this.humidity = humidity; - } - - /** - * @return the seaTemp - */ - public Double getSeaTemp() { - return seaTemp; - } - - /** - * @param seaTemp - * the seaTemp to set - */ - public void setSeaTemp(Double seaTemp) { - this.seaTemp = seaTemp; - } - - /** - * @return the wetBulb - */ - public Double getWetBulb() { - return wetBulb; - } - - /** - * @param wetBulb - * the wetBulb to set - */ - public void setWetBulb(Double wetBulb) { - this.wetBulb = wetBulb; - } - - /** - * @return the windDirection - */ - public Integer getWindDirection() { - return windDirection; - } - - /** - * @param windDirection - * the windDirection to set - */ - public void setWindDirection(Integer windDirection) { - this.windDirection = windDirection; - } - - /** - * @return the windSpeed - */ - public Double getWindSpeed() { - return windSpeed; - } - - /** - * @param windSpeed - * the windSpeed to set - */ - public void setWindSpeed(Double windSpeed) { - this.windSpeed = windSpeed; - } - - /** - * - * @return the windGust - */ - public Double getWindGust() { - return windGust; - } - - /** - * - * @param windGust - * the windGust to set - */ - public void setWindGust(Double windGust) { - this.windGust = windGust; - } - - /** - * Get the direction of the peak wind observation. - * - * @return The direction of the peak wind observation in angular degrees - */ - public Integer getPeakWindDir() { - return peakWindDir; - } - - /** - * Set the direction of the peak wind observation. - * - * @param peakWindDir - * The direction of the peak wind observation in angular degrees - */ - public void setPeakWindDir(Integer peakWindDir) { - this.peakWindDir = peakWindDir; - } - - /** - * Get the speed of the peak wind observation. - * - * @return The speed of the peak wind observation in meters per second. - */ - public Double getPeakWindSpeed() { - return peakWindSpeed; - } - - /** - * Set the speed of the peak wind observation. - * - * @param peakWindSpeed - * The speed of the peak wind observation in meters per second. - */ - public void setPeakWindSpeed(Double peakWindSpeed) { - this.peakWindSpeed = peakWindSpeed; - } - - /** - * Set the time of the peak wind observation. - * - * @return The time of the peak wind observation (msecs from 1-1-1970). - */ - public Long getPeakWindTime() { - return peakWindTime; - } - - /** - * Get the time of the peak wind observation. - * - * @param peakWindTime - * The time of the peak wind observation (msecs from 1-1-1970). - */ - public void setPeakWindTime(Long peakWindTime) { - this.peakWindTime = peakWindTime; - } - - /** - * Get the equivilent 10 meter wind speed. - * - * @return The equivilent 10 meter wind speed in meters per second. - */ - public Double getWind10mSpeed() { - return wind10mSpeed; - } - - /** - * Set the equivilent 10 meter wind speed. - * - * @param windSpeed - * The equivilent 20 meter wind speed in meters per second. - */ - public void setWind10mSpeed(Double windSpeed) { - this.wind10mSpeed = windSpeed; - } - - /** - * Get the equivilent 20 meter wind speed. - * - * @return The equivilent 20 meter wind speed in meters per second. - */ - public Double getWind20mSpeed() { - return wind20mSpeed; - } - - /** - * Set the equivilent 20 meter wind speed. - * - * @param windSpeed - * The equivilent 20 meter wind speed in meters per second. - */ - public void setWind20mSpeed(Double windSpeed) { - this.wind20mSpeed = windSpeed; - } - - /** - * Get the altimeter setting. - * - * @return The altimeter setting in Pascals. - */ - public Integer getPressureAltimeter() { - return pressureAltimeter; - } - - /** - * Set the altimeter setting. - * - * @param pressure - * The altimeter setting in Pascals. - */ - public void setPressureAltimeter(Integer pressure) { - pressureAltimeter = pressure; - } - - /** - * Get the sea level pressure. - * - * @return The sea level pressure in Pascals. - */ - public Integer getPressureSealevel() { - return pressureSealevel; - } - - /** - * Set the sea level pressure. - * - * @param pressure - * The sea level pressure in Pascals. - */ - public void setPressureSealevel(Integer pressure) { - pressureSealevel = pressure; - } - - /** - * Get the station pressure. - * - * @return The station pressure in Pascals. - */ - public Integer getPressureStation() { - return pressureStation; - } - - /** - * Set the station pressure. - * - * @param pressure - * The station pressure in Pascals. - */ - public void setPressureStation(Integer pressure) { - this.pressureStation = pressure; - } - - /** - * Get the three hour pressure change. - * - * @return The three hour pressure change in Pascals. - */ - public Double getPressChange3Hr() { - return pressChange3Hr; - } - - /** - * Set the three hour pressure change. - * - *
-	 *   0 = press same or higher than 3 hrs ago
-	 *   1 = increasing then steady
-	 *   2 = increasing
-	 *   3 = decreasing or steady,then increasing
-	 *   4 = steady
-	 *   5 = press same or lower than 3 hrs ago
-	 *   6 = decreasing then steady
-	 *   7 = decreasing
-	 *   8 = steady or increasing,then decreasing
-	 * 
- * - * @param pressure - * The three hour pressure change in Pascals. - */ - public void setPressChange3Hr(Double pressure) { - this.pressChange3Hr = pressure; - } - - /** - * Get the three hour pressure change characteristic. - * - * @return The three hour pressure change characteristic. - */ - public Integer getPressChangeChar() { - return pressChangeChar; - } - - /** - * Set the three hour pressure change characteristic. - * - * @param pressChangeChar - * The three hour pressure change characteristic. - */ - public void setPressChangeChar(Integer pressChangeChar) { - this.pressChangeChar = pressChangeChar; - } - - /** - * @return the wx_past_1 - */ - public Integer getWx_past_1() { - return wx_past_1; - } - - /** - * @param wx_past_1 - * the wx_past_1 to set - */ - public void setWx_past_1(Integer wx_past_1) { - this.wx_past_1 = wx_past_1; - } - - /** - * @return the wx_past_2 - */ - public Integer getWx_past_2() { - return wx_past_2; - } - - /** - * @param wx_past_2 - * the wx_past_2 to set - */ - public void setWx_past_2(Integer wx_past_2) { - this.wx_past_2 = wx_past_2; - } - - /** - * @return the wx_present - */ - public Integer getWx_present() { - return wx_present; - } - - /** - * @param wx_present - * the wx_present to set - */ - public void setWx_present(Integer wx_present) { - this.wx_present = wx_present; - } - - /** - * @return the presWeather - */ - public String getPresWeather() { - return presWeather; - } - - /** - * @param presWeather - * the presWeather to set - */ - public void setPresWeather(String presWeather) { - this.presWeather = presWeather; - } - - /** - * @return the wx_report_type - */ - public Integer getWx_report_type() { - return wx_report_type; - } - - /** - * @param wx_report_type - * the wx_report_type to set - */ - public void setWx_report_type(Integer wx_report_type) { - this.wx_report_type = wx_report_type; - } - - /** - * @return the horzVisibility - */ - public Integer getHorzVisibility() { - return horzVisibility; - } - - /** - * @param horzVisibility - * the horzVisibility to set - */ - public void setHorzVisibility(Integer horzVisibility) { - this.horzVisibility = horzVisibility; - } - - /** - * @return the vertVisibility - */ - public Integer getVertVisibility() { - return vertVisibility; - } - - /** - * @param vertVisibility - * the vertVisibility to set - */ - public void setVertVisibility(Integer vertVisibility) { - this.vertVisibility = vertVisibility; - } - - /** - * @return the totalCloudCover - */ - public Integer getTotalCloudCover() { - return totalCloudCover; - } - - /** - * @param totalCloudCover - * the totalCloudCover to set - */ - public void setTotalCloudCover(Integer totalCloudCover) { - this.totalCloudCover = totalCloudCover; - } - - /** - * @return the cloudBaseHeight - */ - public Integer getCloudBaseHeight() { - return cloudBaseHeight; - } - - /** - * @param cloudBaseHeight - * the cloudBaseHeight to set - */ - public void setCloudBaseHeight(Integer cloudBaseHeight) { - this.cloudBaseHeight = cloudBaseHeight; - } - - /** - * @return the lowCloudType - */ - public Integer getLowCloudType() { - return lowCloudType; - } - - /** - * @param lowCloudType - * the lowCloudType to set - */ - public void setLowCloudType(Integer lowCloudType) { - this.lowCloudType = lowCloudType; - } - - /** - * @return the midCloudType - */ - public Integer getMidCloudType() { - return midCloudType; - } - - /** - * @param midCloudType - * the midCloudType to set - */ - public void setMidCloudType(Integer midCloudType) { - this.midCloudType = midCloudType; - } - - /** - * @return the highCloudType - */ - public Integer getHighCloudType() { - return highCloudType; - } - - /** - * @param highCloudType - * the highCloudType to set - */ - public void setHighCloudType(Integer highCloudType) { - this.highCloudType = highCloudType; - } - - /** - * @return the platformDirection - */ - public Integer getPlatformDirection() { - return platformDirection; - } - - /** - * @param platformDirection - * the platformDirection to set - */ - public void setPlatformDirection(Integer direction) { - platformDirection = direction; - } - - /** - * @return the platformMovement - */ - public Double getPlatformMovement() { - return platformMovement; - } - - /** - * @param platformMovement - * the platformMovement to set - */ - public void setPlatformMovement(Double movement) { - platformMovement = movement; - } - - /** - * @return the shipIceData - */ - public String getShipIceData() { - return shipIceData; - } - - /** - * @param shipIceData - * the shipIceData to set - */ - public void setShipIceData(String iceData) { - shipIceData = iceData; - } - - /** - * Set the wind wave height. - * - * @param windWaveHeight - * The windWaveHeight in meters. - */ - public void setWindWaveHeight(Double waveHeight) { - windWaveHeight = waveHeight; - } - - /** - * Get the wind wave height. - * - * @return The windWaveHeight in meters. - */ - public Double getWindWaveHeight() { - return windWaveHeight; - } - - /** - * Set the wind wave period. - * - * @param windWavePeriod - * The windWavePeriod in seconds. - */ - public void setWindWavePeriod(Integer wavePeriod) { - windWavePeriod = wavePeriod; - } - - /** - * Get the wind wave period. - * - * @return The windWavePeriod in seconds. - */ - public Integer getWindWavePeriod() { - return windWavePeriod; - } - - /** - * @return the waveSteepness - */ - public Double getWaveSteepness() { - return waveSteepness; - } - - /** - * @param waveSteepness - * the waveSteepness to set - */ - public void setWaveSteepness(Double waveSteepness) { - this.waveSteepness = waveSteepness; - } - - /** - * @return the waveHeight - */ - public Double getWaveHeight() { - return waveHeight; - } - - /** - * @param waveHeight - * the waveHeight to set - */ - public void setWaveHeight(Double waveHeight) { - this.waveHeight = waveHeight; - } - - /** - * @return the wavePeriod - */ - public Integer getWavePeriod() { - return wavePeriod; - } - - /** - * @param wavePeriod - * the wavePeriod to set - */ - public void setWavePeriod(Integer wavePeriod) { - this.wavePeriod = wavePeriod; - } - - /** - * @return the highResWaveHeight - */ - public Double getHighResWaveHeight() { - return highResWaveHeight; - } - - /** - * @param highResWaveHeight - * the highResWaveHeight to set - */ - public void setHighResWaveHeight(Double waveHeight) { - highResWaveHeight = waveHeight; - } - - /** - * @return the primarySwellWaveDir - */ - public Double getPrimarySwellWaveDir() { - return primarySwellWaveDir; - } - - /** - * @param primarySwellWaveDir - * the primarySwellWaveDir to set - */ - public void setPrimarySwellWaveDir(Double waveDir) { - primarySwellWaveDir = waveDir; - } - - /** - * @return the primarySwellWavePeriod - */ - public Integer getPrimarySwellWavePeriod() { - return primarySwellWavePeriod; - } - - /** - * @param primarySwellWavePeriod - * the primarySwellWavePeriod to set - */ - public void setPrimarySwellWavePeriod(Integer primarySwellWavePeriod) { - this.primarySwellWavePeriod = primarySwellWavePeriod; - } - - /** - * @return the primarySwellWaveHeight - */ - public Double getPrimarySwellWaveHeight() { - return primarySwellWaveHeight; - } - - /** - * @param primarySwellWaveHeight - * the primarySwellWaveHeight to set - */ - public void setPrimarySwellWaveHeight(Double waveHeight) { - primarySwellWaveHeight = waveHeight; - } - - /** - * @return the secondarySwellWaveDir - */ - public Double getSecondarySwellWaveDir() { - return secondarySwellWaveDir; - } - - /** - * @param secondarySwellWaveDir - * the secondarySwellWaveDir to set - */ - public void setSecondarySwellWaveDir(Double waveDir) { - secondarySwellWaveDir = waveDir; - } - - /** - * @return the secondarySwellWavePeriod - */ - public Integer getSecondarySwellWavePeriod() { - return secondarySwellWavePeriod; - } - - /** - * @param secondarySwellWavePeriod - * the secondarySwellWavePeriod to set - */ - public void setSecondarySwellWavePeriod(Integer wavePeriod) { - secondarySwellWavePeriod = wavePeriod; - } - - /** - * @return the secondarySwellWaveHeight - */ - public Double getSecondarySwellWaveHeight() { - return secondarySwellWaveHeight; - } - - /** - * @param secondarySwellWaveHeight - * the secondarySwellWaveHeight to set - */ - public void setSecondarySwellWaveHeight(Double height) { - secondarySwellWaveHeight = height; - } - - /** - * @return the ancClouds - */ - public List getAncClouds() { - return ancClouds; - } - - /** - * @param ancClouds - * the ancClouds to set - */ - public void setAncClouds(List ancClouds) { - this.ancClouds = ancClouds; - } - - /** - * - * @param cloud - */ - public void addCloud(AncCloud cloud) { - if (ancClouds == null) { - ancClouds = new ArrayList(); - } - ancClouds.add(cloud); - } - - /** - * @return the ancWaves - */ - public List getAncWaves() { - return ancWaves; - } - - /** - * @param ancWaves - * the ancWaves to set - */ - public void setAncWaves(List ancWaves) { - this.ancWaves = ancWaves; - } - - /** - * - * @param wave - */ - public void addWave(AncWave wave) { - if (ancWaves == null) { - ancWaves = new ArrayList(); - } - ancWaves.add(wave); - } - - /** - * @return the ancTemp - */ - public List getAncTemp() { - return ancTemp; - } - - /** - * @param ancTemp - * the ancTemp to set - */ - public void setAncTemp(List ancTemp) { - this.ancTemp = ancTemp; - } - - /** - * - * @param temp - */ - public void addTemp(AncTemp temp) { - if (ancTemp == null) { - ancTemp = new ArrayList(); - } - ancTemp.add(temp); - } - - /** - * @return the ancPrecip - */ - public List getAncPrecip() { - return ancPrecip; - } - - /** - * @param ancPrecip - * the ancPrecip to set - */ - public void setAncPrecip(List ancPrecip) { - this.ancPrecip = ancPrecip; - } - - /** - * - * @param precip - */ - public void addPrecip(AncPrecip precip) { - if (ancPrecip == null) { - ancPrecip = new ArrayList(); - } - ancPrecip.add(precip); - } - - /** - * @return the ancWinds - */ - public List getAncWinds() { - return ancWinds; - } - - /** - * @param ancWinds - * the ancWinds to set - */ - public void setAncWinds(List ancWinds) { - this.ancWinds = ancWinds; - } - - /** - * - * @param wind - */ - public void addWind(AncWind wind) { - if (ancWinds == null) { - ancWinds = new ArrayList(); - } - ancWinds.add(wind); - } - - /** - * @return the ancPressure - */ - public List getAncPressure() { - return ancPressure; - } - - /** - * @param ancPressure - * the ancPressure to set - */ - public void setAncPressure(List ancPressure) { - this.ancPressure = ancPressure; - } - - /** - * - * @param pressure - */ - public void addPressure(AncPressure pressure) { - if (ancPressure == null) { - ancPressure = new ArrayList(); - } - ancPressure.add(pressure); - } - - /** - * @return the ancPressure - */ - public List getInterWinds() { - return interWinds; - } - - /** - * @param ancPressure - * the ancPressure to set - */ - public void setInterWinds(List winds) { - interWinds = winds; - } - - /** - * - * @param pressure - */ - public void addInterWind(InterWinds wind) { - if (interWinds == null) { - interWinds = new ArrayList(); - } - interWinds.add(wind); - } - - /** - * Set the data uri for this observation. - * - * @param dataURI - */ - @Override - public void setDataURI(String dataURI) { - super.setDataURI(dataURI); - identifier = dataURI; - } - - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } - - public SurfaceObsLocation getLocation() { - return location; - } - - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } - - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } - - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } - - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } - - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } - - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } - - /** - * Get whether the location for this observation is defined. - * - * @return Is this location defined. - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } - - @Override - public String getString(String paramName) { - return null; - } - - @Override - public String[] getStrings(String paramName) { - return null; - } - - /** - * Get the value and units of a named parameter within this observation. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return An Amount with value and units. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Amount getValue(String paramName) { - Amount a = null; - - String pName = PARM_MAP.get(paramName); - - if (SFC_TEMP.equals(pName) && (temp != null)) { - a = new Amount(temp, TEMPERATURE_UNIT); - } else if (SFC_DWPT.equals(pName) && (dwpt != null)) { - a = new Amount(dwpt, TEMPERATURE_UNIT); - } else if (SFC_WNDSPD.equals(pName) && (windSpeed != null)) { - a = new Amount(windSpeed, WIND_SPEED_UNIT); - } else if (SFC_WNDDIR.equals(pName) && (windDirection != null)) { - a = new Amount(windDirection, WIND_DIR_UNIT); - } else if (SFC_WNDGST.equals(pName) && (windGust != null)) { - a = new Amount(windGust, WIND_SPEED_UNIT); - } else if (PRES_STATION.equals(pName) && (pressureStation != null)) { - a = new Amount(pressureStation, PRESSURE_UNIT); - } else if (PRES_SLP.equals(pName) && (pressureSealevel != null)) { - a = new Amount(pressureSealevel, PRESSURE_UNIT); - } else if (PRES_ALTSG.equals(pName) && (pressureAltimeter != null)) { - a = new Amount(pressureAltimeter, PRESSURE_UNIT); - } else if (STA_LAT.equals(pName)) { - a = new Amount(this.getLatitude(), LOCATION_UNIT); - } else if (STA_LON.equals(pName)) { - a = new Amount(this.getLongitude(), LOCATION_UNIT); - } else if ("WT".equals(pName) && this.seaTemp != null) { - a = new Amount(this.seaTemp, TEMPERATURE_UNIT); - } else if ("TCC".equals(pName) && this.totalCloudCover != null) { - a = new Amount(this.totalCloudCover, CLOUD_COVER); - } else if ("COVpct".equals(pName) && this.totalCloudCover != null) { - a = new Amount(this.totalCloudCover * 10, CLOUD_COVER); - } else if ("WP".equals(pName)) { - a = new Amount(wavePeriod, WAVE_UNIT); - } else if ("WH".equals(pName)) { - a = new Amount(waveHeight, WAVE_UNIT); - } else if ("SWP".equals(pName)) { - a = new Amount(primarySwellWavePeriod, WAVE_UNIT); - } else if ("SWH".equals(pName)) { - a = new Amount(primarySwellWaveHeight, WAVE_UNIT); - } else if ("PCHNG".equals(pName) && pressChange3Hr != MISSING) { - a = new Amount(pressChange3Hr, PRESSURE_UNIT); - } else if ("VIS".equals(pName) && this.horzVisibility != null) { - a = new Amount(this.horzVisibility / 1000, VISIBILITY_UNIT); - } else if ("PKWND".equals(paramName) && peakWindSpeed != MISSING) { - a = new Amount(peakWindSpeed, WIND_SPEED_UNIT); - } else if ("SWS".equals(paramName) || "SWGS".equals(paramName)) { - a = new Amount(1, WIND_SPEED_UNIT); - } else if ("SWD".equals(paramName) && primarySwellWaveDir != MISSING) { - a = new Amount(primarySwellWaveDir, WIND_DIR_UNIT); - } - - return a; - } - - @Override - public Collection getValues(String paramName) { - return null; - } - - @Override - public PointDataView getPointDataView() { - return pointDataView; - } - - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + ISpatialEnabled, IDecoderGettable, IPointData { + + private static final long serialVersionUID = 1L; + + private static final int MISSING = -9999; + + public static final Unit TEMPERATURE_UNIT = SI.KELVIN; + + public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; + + public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; + + public static final Unit PRESSURE_UNIT = SI.PASCAL; + + public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; + + public static final Unit WAVE_UNIT = SI.METER; + + public static final Unit VISIBILITY_UNIT = NonSI.MILE; + + public static final Unit CLOUD_COVER = NonSI.OCTET; + + private static final HashMap PARM_MAP = new HashMap(); + static { + PARM_MAP.put("T", SFC_TEMP); + PARM_MAP.put("DpT", SFC_DWPT); + PARM_MAP.put("WS", SFC_WNDSPD); + PARM_MAP.put("WD", SFC_WNDDIR); + PARM_MAP.put("WGS", SFC_WNDGST); + PARM_MAP.put("Px", PRES_STATION); + PARM_MAP.put("PMSL", PRES_SLP); + PARM_MAP.put("ASET", PRES_ALTSG); + PARM_MAP.put("NLAT", STA_LAT); + PARM_MAP.put("NLON", STA_LON); + PARM_MAP.put("WT", "WT"); + PARM_MAP.put("TCC", "TCC"); + PARM_MAP.put("WP", "WP"); + PARM_MAP.put("WH", "WH"); + PARM_MAP.put("SWP", "SWP"); + PARM_MAP.put("SWH", "SWH"); + PARM_MAP.put("SWS", "SWS"); + PARM_MAP.put("SWD", "SWD"); + PARM_MAP.put("SWGS", "SWGS"); + PARM_MAP.put("PCHNG", "PCHNG"); + PARM_MAP.put("PKWND", "PKWND"); + PARM_MAP.put("VIS", "VIS"); + PARM_MAP.put("COVpct", "COVpct"); + } + + // + @DataURI(position = 1) + @Column + @XmlAttribute + @DynamicSerializeElement + @Index(name = "reporttype_index") + private Integer reportType; + + // Correction indicator from wmo header + @DataURI(position = 2) + @Column + @XmlElement + @DynamicSerializeElement + private String corIndicator; + + @Embedded + @DataURI(position = 3, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; + + // Time of the observation. + @Column + @XmlAttribute + @DynamicSerializeElement + private Calendar timeObs; + + // Time of the observation to the nearest hour. + @Column + @XmlAttribute + @DynamicSerializeElement + private Calendar refHour; + + @Transient + @XmlElement + @DynamicSerializeElement + private String obsText = ""; + + // Text of the WMO header + @Transient + @XmlElement + @DynamicSerializeElement + private String wmoHeader = ""; + + // Observation air temperature in degrees Kelvin. + @Transient + @XmlElement + @DynamicSerializeElement + private Double temp = -9999.0; + + // Observation dewpoint temperature in degrees Kelvin. + @Transient + @XmlElement + @DynamicSerializeElement + private Double dwpt = -9999.0; + + // Relative Humidity in percent. Decimal(5,2) + @Transient + @XmlElement + @DynamicSerializeElement + private Double humidity = -9999.0; + + // Observation sea surface temperature in degrees Kelvin. + @Transient + @XmlElement + @DynamicSerializeElement + private Double seaTemp = -9999.0; + + // Observation wetbulb temperature in degrees Kelvin. + @Transient + @XmlElement + @DynamicSerializeElement + private Double wetBulb = -9999.0; + + // Observation wind direction in angular degrees. Integer + @Transient + @XmlElement + @DynamicSerializeElement + private Integer windDirection = -9999; + + // Observation wind speed in meters per second. + @Transient + @XmlElement + @DynamicSerializeElement + private Double windSpeed = -9999.0; + + // Observation wind speed gust in meters per second. + @Transient + @XmlElement + @DynamicSerializeElement + private Double windGust = -9999.0; + + // Direction of the peak wind observation in angular degrees + @Transient + @XmlElement + @DynamicSerializeElement + private Integer peakWindDir = -9999; + + // Speed of the peak wind observation in meters per second. + @Transient + @XmlElement + @DynamicSerializeElement + private Double peakWindSpeed = -9999.0; + + // Time of the peak wind observation. + @Transient + @XmlElement + @DynamicSerializeElement + private Long peakWindTime = -1L; + + // The equivilent 10 meter wind speed in meters per second. + @Transient + @XmlElement + @DynamicSerializeElement + private Double wind10mSpeed = -9999.0; + + // The equivilent 20 meter wind speed in meters per second. + @Transient + @XmlElement + @DynamicSerializeElement + private Double wind20mSpeed = -9999.0; + + // Altimeter setting in Pascals. + @Transient + @XmlElement + @DynamicSerializeElement + private Integer pressureAltimeter = -9999; + + // Sea level pressure in Pascals. + @Transient + @XmlElement + @DynamicSerializeElement + private Integer pressureSealevel = -9999; + + // Station pressure in Pascals. + @Transient + @XmlElement + @DynamicSerializeElement + private Integer pressureStation = -9999; + + // Three hour pressure change in pascals. + @Transient + @XmlElement + @DynamicSerializeElement + private Double pressChange3Hr = -9999.0; + + // Three hour pressure change characteristic. + @Transient + @XmlElement + @DynamicSerializeElement + private Integer pressChangeChar = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer wx_past_1 = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer wx_past_2 = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer wx_present = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private String presWeather = null; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer wx_report_type = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer horzVisibility = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer vertVisibility = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer totalCloudCover = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer cloudBaseHeight = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer lowCloudType = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer midCloudType = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer highCloudType = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer platformDirection = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Double platformMovement = -9999.0; + + @Transient + @XmlElement + @DynamicSerializeElement + private String shipIceData = ""; + + @Transient + @XmlElement + @DynamicSerializeElement + private Double windWaveHeight = -9999.0; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer windWavePeriod = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Double waveSteepness = -9999.0; + + @Transient + @XmlElement + @DynamicSerializeElement + private Double waveHeight = -9999.0; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer wavePeriod = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Double highResWaveHeight = -9999.0; + + @Transient + @XmlElement + @DynamicSerializeElement + private Double primarySwellWaveDir = -9999.0; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer primarySwellWavePeriod = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Double primarySwellWaveHeight = -9999.0; + + @Transient + @XmlElement + @DynamicSerializeElement + private Double secondarySwellWaveDir = -9999.0; + + @Transient + @XmlElement + @DynamicSerializeElement + private Integer secondarySwellWavePeriod = -9999; + + @Transient + @XmlElement + @DynamicSerializeElement + private Double secondarySwellWaveHeight = -9999.0; + + @Transient + @XmlElement + @DynamicSerializeElement + private List ancClouds; + + @Transient + @XmlElement + @DynamicSerializeElement + private List ancWaves; + + @Transient + @XmlElement + @DynamicSerializeElement + private List ancTemp; + + @Transient + @XmlElement + @DynamicSerializeElement + private List ancPrecip; + + @Transient + @XmlElement + @DynamicSerializeElement + private List ancWinds; + + @Transient + @XmlElement + @DynamicSerializeElement + private List ancPressure; + + @Transient + @XmlElement + @DynamicSerializeElement + private List interWinds; + + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; + + /** + * Empty default constructor + */ + public ObsCommon() { + } + + /** + * Construct an instance of this class using the supplied datauri. + * + * @param dataUri + */ + public ObsCommon(String dataUri) { + super(dataUri); + } + + /** + * @return the reportType + */ + public Integer getReportType() { + return reportType; + } + + /** + * @param reportType + * the reportType to set + */ + public void setReportType(Integer reportType) { + this.reportType = reportType; + } + + /** + * @return the corIndicator + */ + public String getCorIndicator() { + return corIndicator; + } + + /** + * @param corIndicator + * the corIndicator to set + */ + public void setCorIndicator(String corIndicator) { + this.corIndicator = corIndicator; + } + + /** + * @return the timeObs + */ + public Calendar getTimeObs() { + return timeObs; + } + + /** + * @param timeObs + * the timeObs to set + */ + public void setTimeObs(Calendar timeObs) { + this.timeObs = timeObs; + } + + /** + * @return the refHour + */ + public Calendar getRefHour() { + return refHour; + } + + /** + * @param refHour + * the refHour to set + */ + public void setRefHour(Calendar refHour) { + this.refHour = refHour; + } + + /** + * @return the obsText + */ + public String getObsText() { + return obsText; + } + + /** + * @param obsText + * the obsText to set + */ + public void setObsText(String obsText) { + this.obsText = obsText; + } + + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } + + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } + + /** + * @return the temp + */ + public Double getTemp() { + return temp; + } + + /** + * @param temp + * the temp to set + */ + public void setTemp(Double temp) { + this.temp = temp; + } + + /** + * @return the dwpt + */ + public Double getDwpt() { + return dwpt; + } + + /** + * @param dwpt + * the dwpt to set + */ + public void setDwpt(Double dwpt) { + this.dwpt = dwpt; + } + + /** + * @return the humidity + */ + public Double getHumidity() { + return humidity; + } + + /** + * @param humidity + * the humidity to set + */ + public void setHumidity(Double humidity) { + this.humidity = humidity; + } + + /** + * @return the seaTemp + */ + public Double getSeaTemp() { + return seaTemp; + } + + /** + * @param seaTemp + * the seaTemp to set + */ + public void setSeaTemp(Double seaTemp) { + this.seaTemp = seaTemp; + } + + /** + * @return the wetBulb + */ + public Double getWetBulb() { + return wetBulb; + } + + /** + * @param wetBulb + * the wetBulb to set + */ + public void setWetBulb(Double wetBulb) { + this.wetBulb = wetBulb; + } + + /** + * @return the windDirection + */ + public Integer getWindDirection() { + return windDirection; + } + + /** + * @param windDirection + * the windDirection to set + */ + public void setWindDirection(Integer windDirection) { + this.windDirection = windDirection; + } + + /** + * @return the windSpeed + */ + public Double getWindSpeed() { + return windSpeed; + } + + /** + * @param windSpeed + * the windSpeed to set + */ + public void setWindSpeed(Double windSpeed) { + this.windSpeed = windSpeed; + } + + /** + * + * @return the windGust + */ + public Double getWindGust() { + return windGust; + } + + /** + * + * @param windGust + * the windGust to set + */ + public void setWindGust(Double windGust) { + this.windGust = windGust; + } + + /** + * Get the direction of the peak wind observation. + * + * @return The direction of the peak wind observation in angular degrees + */ + public Integer getPeakWindDir() { + return peakWindDir; + } + + /** + * Set the direction of the peak wind observation. + * + * @param peakWindDir + * The direction of the peak wind observation in angular degrees + */ + public void setPeakWindDir(Integer peakWindDir) { + this.peakWindDir = peakWindDir; + } + + /** + * Get the speed of the peak wind observation. + * + * @return The speed of the peak wind observation in meters per second. + */ + public Double getPeakWindSpeed() { + return peakWindSpeed; + } + + /** + * Set the speed of the peak wind observation. + * + * @param peakWindSpeed + * The speed of the peak wind observation in meters per second. + */ + public void setPeakWindSpeed(Double peakWindSpeed) { + this.peakWindSpeed = peakWindSpeed; + } + + /** + * Set the time of the peak wind observation. + * + * @return The time of the peak wind observation (msecs from 1-1-1970). + */ + public Long getPeakWindTime() { + return peakWindTime; + } + + /** + * Get the time of the peak wind observation. + * + * @param peakWindTime + * The time of the peak wind observation (msecs from 1-1-1970). + */ + public void setPeakWindTime(Long peakWindTime) { + this.peakWindTime = peakWindTime; + } + + /** + * Get the equivilent 10 meter wind speed. + * + * @return The equivilent 10 meter wind speed in meters per second. + */ + public Double getWind10mSpeed() { + return wind10mSpeed; + } + + /** + * Set the equivilent 10 meter wind speed. + * + * @param windSpeed + * The equivilent 20 meter wind speed in meters per second. + */ + public void setWind10mSpeed(Double windSpeed) { + this.wind10mSpeed = windSpeed; + } + + /** + * Get the equivilent 20 meter wind speed. + * + * @return The equivilent 20 meter wind speed in meters per second. + */ + public Double getWind20mSpeed() { + return wind20mSpeed; + } + + /** + * Set the equivilent 20 meter wind speed. + * + * @param windSpeed + * The equivilent 20 meter wind speed in meters per second. + */ + public void setWind20mSpeed(Double windSpeed) { + this.wind20mSpeed = windSpeed; + } + + /** + * Get the altimeter setting. + * + * @return The altimeter setting in Pascals. + */ + public Integer getPressureAltimeter() { + return pressureAltimeter; + } + + /** + * Set the altimeter setting. + * + * @param pressure + * The altimeter setting in Pascals. + */ + public void setPressureAltimeter(Integer pressure) { + pressureAltimeter = pressure; + } + + /** + * Get the sea level pressure. + * + * @return The sea level pressure in Pascals. + */ + public Integer getPressureSealevel() { + return pressureSealevel; + } + + /** + * Set the sea level pressure. + * + * @param pressure + * The sea level pressure in Pascals. + */ + public void setPressureSealevel(Integer pressure) { + pressureSealevel = pressure; + } + + /** + * Get the station pressure. + * + * @return The station pressure in Pascals. + */ + public Integer getPressureStation() { + return pressureStation; + } + + /** + * Set the station pressure. + * + * @param pressure + * The station pressure in Pascals. + */ + public void setPressureStation(Integer pressure) { + this.pressureStation = pressure; + } + + /** + * Get the three hour pressure change. + * + * @return The three hour pressure change in Pascals. + */ + public Double getPressChange3Hr() { + return pressChange3Hr; + } + + /** + * Set the three hour pressure change. + * + *
+     *   0 = press same or higher than 3 hrs ago
+     *   1 = increasing then steady
+     *   2 = increasing
+     *   3 = decreasing or steady,then increasing
+     *   4 = steady
+     *   5 = press same or lower than 3 hrs ago
+     *   6 = decreasing then steady
+     *   7 = decreasing
+     *   8 = steady or increasing,then decreasing
+     * 
+ * + * @param pressure + * The three hour pressure change in Pascals. + */ + public void setPressChange3Hr(Double pressure) { + this.pressChange3Hr = pressure; + } + + /** + * Get the three hour pressure change characteristic. + * + * @return The three hour pressure change characteristic. + */ + public Integer getPressChangeChar() { + return pressChangeChar; + } + + /** + * Set the three hour pressure change characteristic. + * + * @param pressChangeChar + * The three hour pressure change characteristic. + */ + public void setPressChangeChar(Integer pressChangeChar) { + this.pressChangeChar = pressChangeChar; + } + + /** + * @return the wx_past_1 + */ + public Integer getWx_past_1() { + return wx_past_1; + } + + /** + * @param wx_past_1 + * the wx_past_1 to set + */ + public void setWx_past_1(Integer wx_past_1) { + this.wx_past_1 = wx_past_1; + } + + /** + * @return the wx_past_2 + */ + public Integer getWx_past_2() { + return wx_past_2; + } + + /** + * @param wx_past_2 + * the wx_past_2 to set + */ + public void setWx_past_2(Integer wx_past_2) { + this.wx_past_2 = wx_past_2; + } + + /** + * @return the wx_present + */ + public Integer getWx_present() { + return wx_present; + } + + /** + * @param wx_present + * the wx_present to set + */ + public void setWx_present(Integer wx_present) { + this.wx_present = wx_present; + } + + /** + * @return the presWeather + */ + public String getPresWeather() { + return presWeather; + } + + /** + * @param presWeather + * the presWeather to set + */ + public void setPresWeather(String presWeather) { + this.presWeather = presWeather; + } + + /** + * @return the wx_report_type + */ + public Integer getWx_report_type() { + return wx_report_type; + } + + /** + * @param wx_report_type + * the wx_report_type to set + */ + public void setWx_report_type(Integer wx_report_type) { + this.wx_report_type = wx_report_type; + } + + /** + * @return the horzVisibility + */ + public Integer getHorzVisibility() { + return horzVisibility; + } + + /** + * @param horzVisibility + * the horzVisibility to set + */ + public void setHorzVisibility(Integer horzVisibility) { + this.horzVisibility = horzVisibility; + } + + /** + * @return the vertVisibility + */ + public Integer getVertVisibility() { + return vertVisibility; + } + + /** + * @param vertVisibility + * the vertVisibility to set + */ + public void setVertVisibility(Integer vertVisibility) { + this.vertVisibility = vertVisibility; + } + + /** + * @return the totalCloudCover + */ + public Integer getTotalCloudCover() { + return totalCloudCover; + } + + /** + * @param totalCloudCover + * the totalCloudCover to set + */ + public void setTotalCloudCover(Integer totalCloudCover) { + this.totalCloudCover = totalCloudCover; + } + + /** + * @return the cloudBaseHeight + */ + public Integer getCloudBaseHeight() { + return cloudBaseHeight; + } + + /** + * @param cloudBaseHeight + * the cloudBaseHeight to set + */ + public void setCloudBaseHeight(Integer cloudBaseHeight) { + this.cloudBaseHeight = cloudBaseHeight; + } + + /** + * @return the lowCloudType + */ + public Integer getLowCloudType() { + return lowCloudType; + } + + /** + * @param lowCloudType + * the lowCloudType to set + */ + public void setLowCloudType(Integer lowCloudType) { + this.lowCloudType = lowCloudType; + } + + /** + * @return the midCloudType + */ + public Integer getMidCloudType() { + return midCloudType; + } + + /** + * @param midCloudType + * the midCloudType to set + */ + public void setMidCloudType(Integer midCloudType) { + this.midCloudType = midCloudType; + } + + /** + * @return the highCloudType + */ + public Integer getHighCloudType() { + return highCloudType; + } + + /** + * @param highCloudType + * the highCloudType to set + */ + public void setHighCloudType(Integer highCloudType) { + this.highCloudType = highCloudType; + } + + /** + * @return the platformDirection + */ + public Integer getPlatformDirection() { + return platformDirection; + } + + /** + * @param platformDirection + * the platformDirection to set + */ + public void setPlatformDirection(Integer direction) { + platformDirection = direction; + } + + /** + * @return the platformMovement + */ + public Double getPlatformMovement() { + return platformMovement; + } + + /** + * @param platformMovement + * the platformMovement to set + */ + public void setPlatformMovement(Double movement) { + platformMovement = movement; + } + + /** + * @return the shipIceData + */ + public String getShipIceData() { + return shipIceData; + } + + /** + * @param shipIceData + * the shipIceData to set + */ + public void setShipIceData(String iceData) { + shipIceData = iceData; + } + + /** + * Set the wind wave height. + * + * @param windWaveHeight + * The windWaveHeight in meters. + */ + public void setWindWaveHeight(Double waveHeight) { + windWaveHeight = waveHeight; + } + + /** + * Get the wind wave height. + * + * @return The windWaveHeight in meters. + */ + public Double getWindWaveHeight() { + return windWaveHeight; + } + + /** + * Set the wind wave period. + * + * @param windWavePeriod + * The windWavePeriod in seconds. + */ + public void setWindWavePeriod(Integer wavePeriod) { + windWavePeriod = wavePeriod; + } + + /** + * Get the wind wave period. + * + * @return The windWavePeriod in seconds. + */ + public Integer getWindWavePeriod() { + return windWavePeriod; + } + + /** + * @return the waveSteepness + */ + public Double getWaveSteepness() { + return waveSteepness; + } + + /** + * @param waveSteepness + * the waveSteepness to set + */ + public void setWaveSteepness(Double waveSteepness) { + this.waveSteepness = waveSteepness; + } + + /** + * @return the waveHeight + */ + public Double getWaveHeight() { + return waveHeight; + } + + /** + * @param waveHeight + * the waveHeight to set + */ + public void setWaveHeight(Double waveHeight) { + this.waveHeight = waveHeight; + } + + /** + * @return the wavePeriod + */ + public Integer getWavePeriod() { + return wavePeriod; + } + + /** + * @param wavePeriod + * the wavePeriod to set + */ + public void setWavePeriod(Integer wavePeriod) { + this.wavePeriod = wavePeriod; + } + + /** + * @return the highResWaveHeight + */ + public Double getHighResWaveHeight() { + return highResWaveHeight; + } + + /** + * @param highResWaveHeight + * the highResWaveHeight to set + */ + public void setHighResWaveHeight(Double waveHeight) { + highResWaveHeight = waveHeight; + } + + /** + * @return the primarySwellWaveDir + */ + public Double getPrimarySwellWaveDir() { + return primarySwellWaveDir; + } + + /** + * @param primarySwellWaveDir + * the primarySwellWaveDir to set + */ + public void setPrimarySwellWaveDir(Double waveDir) { + primarySwellWaveDir = waveDir; + } + + /** + * @return the primarySwellWavePeriod + */ + public Integer getPrimarySwellWavePeriod() { + return primarySwellWavePeriod; + } + + /** + * @param primarySwellWavePeriod + * the primarySwellWavePeriod to set + */ + public void setPrimarySwellWavePeriod(Integer primarySwellWavePeriod) { + this.primarySwellWavePeriod = primarySwellWavePeriod; + } + + /** + * @return the primarySwellWaveHeight + */ + public Double getPrimarySwellWaveHeight() { + return primarySwellWaveHeight; + } + + /** + * @param primarySwellWaveHeight + * the primarySwellWaveHeight to set + */ + public void setPrimarySwellWaveHeight(Double waveHeight) { + primarySwellWaveHeight = waveHeight; + } + + /** + * @return the secondarySwellWaveDir + */ + public Double getSecondarySwellWaveDir() { + return secondarySwellWaveDir; + } + + /** + * @param secondarySwellWaveDir + * the secondarySwellWaveDir to set + */ + public void setSecondarySwellWaveDir(Double waveDir) { + secondarySwellWaveDir = waveDir; + } + + /** + * @return the secondarySwellWavePeriod + */ + public Integer getSecondarySwellWavePeriod() { + return secondarySwellWavePeriod; + } + + /** + * @param secondarySwellWavePeriod + * the secondarySwellWavePeriod to set + */ + public void setSecondarySwellWavePeriod(Integer wavePeriod) { + secondarySwellWavePeriod = wavePeriod; + } + + /** + * @return the secondarySwellWaveHeight + */ + public Double getSecondarySwellWaveHeight() { + return secondarySwellWaveHeight; + } + + /** + * @param secondarySwellWaveHeight + * the secondarySwellWaveHeight to set + */ + public void setSecondarySwellWaveHeight(Double height) { + secondarySwellWaveHeight = height; + } + + /** + * @return the ancClouds + */ + public List getAncClouds() { + return ancClouds; + } + + /** + * @param ancClouds + * the ancClouds to set + */ + public void setAncClouds(List ancClouds) { + this.ancClouds = ancClouds; + } + + /** + * + * @param cloud + */ + public void addCloud(AncCloud cloud) { + if (ancClouds == null) { + ancClouds = new ArrayList(); + } + ancClouds.add(cloud); + } + + /** + * @return the ancWaves + */ + public List getAncWaves() { + return ancWaves; + } + + /** + * @param ancWaves + * the ancWaves to set + */ + public void setAncWaves(List ancWaves) { + this.ancWaves = ancWaves; + } + + /** + * + * @param wave + */ + public void addWave(AncWave wave) { + if (ancWaves == null) { + ancWaves = new ArrayList(); + } + ancWaves.add(wave); + } + + /** + * @return the ancTemp + */ + public List getAncTemp() { + return ancTemp; + } + + /** + * @param ancTemp + * the ancTemp to set + */ + public void setAncTemp(List ancTemp) { + this.ancTemp = ancTemp; + } + + /** + * + * @param temp + */ + public void addTemp(AncTemp temp) { + if (ancTemp == null) { + ancTemp = new ArrayList(); + } + ancTemp.add(temp); + } + + /** + * @return the ancPrecip + */ + public List getAncPrecip() { + return ancPrecip; + } + + /** + * @param ancPrecip + * the ancPrecip to set + */ + public void setAncPrecip(List ancPrecip) { + this.ancPrecip = ancPrecip; + } + + /** + * + * @param precip + */ + public void addPrecip(AncPrecip precip) { + if (ancPrecip == null) { + ancPrecip = new ArrayList(); + } + ancPrecip.add(precip); + } + + /** + * @return the ancWinds + */ + public List getAncWinds() { + return ancWinds; + } + + /** + * @param ancWinds + * the ancWinds to set + */ + public void setAncWinds(List ancWinds) { + this.ancWinds = ancWinds; + } + + /** + * + * @param wind + */ + public void addWind(AncWind wind) { + if (ancWinds == null) { + ancWinds = new ArrayList(); + } + ancWinds.add(wind); + } + + /** + * @return the ancPressure + */ + public List getAncPressure() { + return ancPressure; + } + + /** + * @param ancPressure + * the ancPressure to set + */ + public void setAncPressure(List ancPressure) { + this.ancPressure = ancPressure; + } + + /** + * + * @param pressure + */ + public void addPressure(AncPressure pressure) { + if (ancPressure == null) { + ancPressure = new ArrayList(); + } + ancPressure.add(pressure); + } + + /** + * @return the ancPressure + */ + public List getInterWinds() { + return interWinds; + } + + /** + * @param ancPressure + * the ancPressure to set + */ + public void setInterWinds(List winds) { + interWinds = winds; + } + + /** + * + * @param pressure + */ + public void addInterWind(InterWinds wind) { + if (interWinds == null) { + interWinds = new ArrayList(); + } + interWinds.add(wind); + } + + /** + * Set the data uri for this observation. + * + * @param dataURI + */ + @Override + public void setDataURI(String dataURI) { + super.setDataURI(dataURI); + identifier = dataURI; + } + + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } + + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } + + public SurfaceObsLocation getLocation() { + return location; + } + + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } + + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } + + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } + + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } + + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } + + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } + + /** + * Get whether the location for this observation is defined. + * + * @return Is this location defined. + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } + + @Override + public String getString(String paramName) { + return null; + } + + @Override + public String[] getStrings(String paramName) { + return null; + } + + /** + * Get the value and units of a named parameter within this observation. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return An Amount with value and units. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Amount getValue(String paramName) { + Amount a = null; + + String pName = PARM_MAP.get(paramName); + + if (SFC_TEMP.equals(pName) && (temp != null)) { + a = new Amount(temp, TEMPERATURE_UNIT); + } else if (SFC_DWPT.equals(pName) && (dwpt != null)) { + a = new Amount(dwpt, TEMPERATURE_UNIT); + } else if (SFC_WNDSPD.equals(pName) && (windSpeed != null)) { + a = new Amount(windSpeed, WIND_SPEED_UNIT); + } else if (SFC_WNDDIR.equals(pName) && (windDirection != null)) { + a = new Amount(windDirection, WIND_DIR_UNIT); + } else if (SFC_WNDGST.equals(pName) && (windGust != null)) { + a = new Amount(windGust, WIND_SPEED_UNIT); + } else if (PRES_STATION.equals(pName) && (pressureStation != null)) { + a = new Amount(pressureStation, PRESSURE_UNIT); + } else if (PRES_SLP.equals(pName) && (pressureSealevel != null)) { + a = new Amount(pressureSealevel, PRESSURE_UNIT); + } else if (PRES_ALTSG.equals(pName) && (pressureAltimeter != null)) { + a = new Amount(pressureAltimeter, PRESSURE_UNIT); + } else if (STA_LAT.equals(pName)) { + a = new Amount(this.getLatitude(), LOCATION_UNIT); + } else if (STA_LON.equals(pName)) { + a = new Amount(this.getLongitude(), LOCATION_UNIT); + } else if ("WT".equals(pName) && (this.seaTemp != null)) { + a = new Amount(this.seaTemp, TEMPERATURE_UNIT); + } else if ("TCC".equals(pName) && (this.totalCloudCover != null)) { + a = new Amount(this.totalCloudCover, CLOUD_COVER); + } else if ("COVpct".equals(pName) && (this.totalCloudCover != null)) { + a = new Amount(this.totalCloudCover * 10, CLOUD_COVER); + } else if ("WP".equals(pName)) { + a = new Amount(wavePeriod, WAVE_UNIT); + } else if ("WH".equals(pName)) { + a = new Amount(waveHeight, WAVE_UNIT); + } else if ("SWP".equals(pName)) { + a = new Amount(primarySwellWavePeriod, WAVE_UNIT); + } else if ("SWH".equals(pName)) { + a = new Amount(primarySwellWaveHeight, WAVE_UNIT); + } else if ("PCHNG".equals(pName) && (pressChange3Hr != MISSING)) { + a = new Amount(pressChange3Hr, PRESSURE_UNIT); + } else if ("VIS".equals(pName) && (this.horzVisibility != null)) { + a = new Amount(this.horzVisibility / 1000, VISIBILITY_UNIT); + } else if ("PKWND".equals(paramName) && (peakWindSpeed != MISSING)) { + a = new Amount(peakWindSpeed, WIND_SPEED_UNIT); + } else if ("SWS".equals(paramName) || "SWGS".equals(paramName)) { + a = new Amount(1, WIND_SPEED_UNIT); + } else if ("SWD".equals(paramName) && (primarySwellWaveDir != MISSING)) { + a = new Amount(primarySwellWaveDir, WIND_DIR_UNIT); + } + + return a; + } + + @Override + public Collection getValues(String paramName) { + return null; + } + + @Override + public PointDataView getPointDataView() { + return pointDataView; + } + + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "sfcobs"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.svrwx/src/com/raytheon/uf/common/dataplugin/svrwx/SvrWxRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.svrwx/src/com/raytheon/uf/common/dataplugin/svrwx/SvrWxRecord.java index f88ea2a2d4..db716a3398 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.svrwx/src/com/raytheon/uf/common/dataplugin/svrwx/SvrWxRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.svrwx/src/com/raytheon/uf/common/dataplugin/svrwx/SvrWxRecord.java @@ -57,11 +57,13 @@ import com.vividsolutions.jts.geom.Geometry; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 4, 2010 jsanchez Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Jan 04, 2010 jsanchez Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -75,229 +77,231 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "svrwx", - indexes = { - @Index(name = "svrwx_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "svrwx", indexes = { @Index(name = "svrwx_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class SvrWxRecord extends PersistablePluginDataObject implements - ISpatialEnabled, IPointData { + ISpatialEnabled, IPointData { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - // Text of the WMO header - @Transient - @XmlElement - @DynamicSerializeElement - private String wmoHeader = ""; + // Text of the WMO header + @Transient + @XmlElement + @DynamicSerializeElement + private String wmoHeader = ""; - @Embedded - @DataURI(position = 2, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; + @Embedded + @DataURI(position = 2, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; - @Transient - @XmlElement - @DynamicSerializeElement - protected String eventKey; + @Transient + @XmlElement + @DynamicSerializeElement + protected String eventKey; - @XmlElement - @DynamicSerializeElement - @Column - @DataURI(position = 1) - protected String reportType; + @XmlElement + @DynamicSerializeElement + @Column + @DataURI(position = 1) + protected String reportType; - @Transient - @XmlElement - @DynamicSerializeElement - protected String details; + @Transient + @XmlElement + @DynamicSerializeElement + protected String details; - @Transient - @XmlElement - @DynamicSerializeElement - protected String greenTime; + @Transient + @XmlElement + @DynamicSerializeElement + protected String greenTime; - /** - * Empty default constructor - */ - public SvrWxRecord() { - } + /** + * Empty default constructor + */ + public SvrWxRecord() { + } - /** - * Construct an instance of this class using the supplied datauri. - * - * @param dataUri - */ - public SvrWxRecord(String dataUri) { - super(dataUri); - } + /** + * Construct an instance of this class using the supplied datauri. + * + * @param dataUri + */ + public SvrWxRecord(String dataUri) { + super(dataUri); + } - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * Set the data uri for this observation. - * - * @param dataURI - */ - @Override - public void setDataURI(String dataURI) { - super.setDataURI(dataURI); - identifier = dataURI; - } + /** + * Set the data uri for this observation. + * + * @param dataURI + */ + @Override + public void setDataURI(String dataURI) { + super.setDataURI(dataURI); + identifier = dataURI; + } - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } - public SurfaceObsLocation getLocation() { - return location; - } + public SurfaceObsLocation getLocation() { + return location; + } - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } - public String getEventKey() { - return eventKey; - } + public String getEventKey() { + return eventKey; + } - public void setEventKey(String eventKey) { - this.eventKey = eventKey; - } + public void setEventKey(String eventKey) { + this.eventKey = eventKey; + } - public String getGreenTime() { - return greenTime; - } + public String getGreenTime() { + return greenTime; + } - public void setGreenTime(String greenTime) { - this.greenTime = greenTime; - } + public void setGreenTime(String greenTime) { + this.greenTime = greenTime; + } - public String getDetails() { - return details; - } + public String getDetails() { + return details; + } - public void setDetails(String details) { - this.details = details; - } + public void setDetails(String details) { + this.details = details; + } - public String getReportType() { - return reportType; - } + public String getReportType() { + return reportType; + } - public void setReportType(String reportType) { - this.reportType = reportType; - } + public void setReportType(String reportType) { + this.reportType = reportType; + } - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } - /** - * Get whether the location for this observation is defined. - * - * @return Is this location defined. - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } + /** + * Get whether the location for this observation is defined. + * + * @return Is this location defined. + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + Calendar c = getDataTime().getRefTimeAsCalendar(); + if (c != null) { + sb.append(String.format("SvrWx:%1$tY%1$tm%1$td%1$tH%1$tM", + getDataTime().getRefTimeAsCalendar())); + } else { + sb.append("SvrWx:YYYYMMDDHHmm"); + } + sb.append(String.format("%6.2f %7.2f:", getLatitude(), getLongitude())); + return sb.toString(); + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - Calendar c = getDataTime().getRefTimeAsCalendar(); - if (c != null) { - sb.append(String.format("SvrWx:%1$tY%1$tm%1$td%1$tH%1$tM", - getDataTime().getRefTimeAsCalendar())); - } else { - sb.append("SvrWx:YYYYMMDDHHmm"); - } - sb.append(String.format("%6.2f %7.2f:", getLatitude(), getLongitude())); - return sb.toString(); - } @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "svrwx"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.tcg/src/com/raytheon/uf/common/dataplugin/tcg/TropicalCycloneGuidance.java b/edexOsgi/com.raytheon.uf.common.dataplugin.tcg/src/com/raytheon/uf/common/dataplugin/tcg/TropicalCycloneGuidance.java index 09eccfafa4..2e63810550 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.tcg/src/com/raytheon/uf/common/dataplugin/tcg/TropicalCycloneGuidance.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.tcg/src/com/raytheon/uf/common/dataplugin/tcg/TropicalCycloneGuidance.java @@ -57,11 +57,13 @@ import com.vividsolutions.jts.geom.Geometry; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Oct 28, 2009 jsanchez Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Oct 28, 2009 jsanchez Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -75,230 +77,232 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "tcg", - indexes = { - @Index(name = "tcg_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "tcg", indexes = { @Index(name = "tcg_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class TropicalCycloneGuidance extends PersistablePluginDataObject - implements ISpatialEnabled, IPointData { + implements ISpatialEnabled, IPointData { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - // Text of the WMO header - @Transient - @XmlElement - @DynamicSerializeElement - private String wmoHeader = ""; + // Text of the WMO header + @Transient + @XmlElement + @DynamicSerializeElement + private String wmoHeader = ""; - @XmlElement - @DynamicSerializeElement - @Transient - protected String stormName; + @XmlElement + @DynamicSerializeElement + @Transient + protected String stormName; - @XmlElement - @DynamicSerializeElement - @DataURI(position = 1) - @Column - protected String productType = ""; + @XmlElement + @DynamicSerializeElement + @DataURI(position = 1) + @Column + protected String productType = ""; - @XmlElement - @DynamicSerializeElement - @DataURI(position = 2) - @Column - protected String modelName = "NONE"; + @XmlElement + @DynamicSerializeElement + @DataURI(position = 2) + @Column + protected String modelName = "NONE"; - @Embedded - @DataURI(position = 3, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; + @Embedded + @DataURI(position = 3, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; - @Transient - @XmlElement - @DynamicSerializeElement - protected TCGStormType type = TCGStormType.UNKNOWN; + @Transient + @XmlElement + @DynamicSerializeElement + protected TCGStormType type = TCGStormType.UNKNOWN; - /** - * Empty default constructor - */ - public TropicalCycloneGuidance() { - } + /** + * Empty default constructor + */ + public TropicalCycloneGuidance() { + } - /** - * Construct an instance of this class using the supplied datauri. - * - * @param dataUri - */ - public TropicalCycloneGuidance(String dataUri) { - super(dataUri); - } + /** + * Construct an instance of this class using the supplied datauri. + * + * @param dataUri + */ + public TropicalCycloneGuidance(String dataUri) { + super(dataUri); + } - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - public String getModelName() { - return modelName; - } + public String getModelName() { + return modelName; + } - public void setModelName(String modelName) { - this.modelName = modelName; - } + public void setModelName(String modelName) { + this.modelName = modelName; + } - /** - * Set the data uri for this observation. - * - * @param dataURI - */ - @Override - public void setDataURI(String dataURI) { - super.setDataURI(dataURI); - identifier = dataURI; - } + /** + * Set the data uri for this observation. + * + * @param dataURI + */ + @Override + public void setDataURI(String dataURI) { + super.setDataURI(dataURI); + identifier = dataURI; + } - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } - public SurfaceObsLocation getLocation() { - return location; - } + public SurfaceObsLocation getLocation() { + return location; + } - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } - public String getStormName() { - return stormName; - } + public String getStormName() { + return stormName; + } - public void setStormName(String stormName) { - this.stormName = stormName; - } + public void setStormName(String stormName) { + this.stormName = stormName; + } - public TCGStormType getType() { - return type; - } + public TCGStormType getType() { + return type; + } - public void setType(TCGStormType type) { - this.type = type; - } + public void setType(TCGStormType type) { + this.type = type; + } - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } - /** - * Get whether the location for this observation is defined. - * - * @return Is this location defined. - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } + /** + * Get whether the location for this observation is defined. + * + * @return Is this location defined. + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } - public String getProductType() { - return productType; - } + public String getProductType() { + return productType; + } - public void setProductType(String productType) { - this.productType = productType; - } + public void setProductType(String productType) { + this.productType = productType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + Calendar c = getDataTime().getRefTimeAsCalendar(); + if (c != null) { + sb.append(String.format("TCG:%1$tY%1$tm%1$td%1$tH%1$tM", + getDataTime().getRefTimeAsCalendar())); + } else { + sb.append("TCG:YYYYMMDDHHmm"); + } + sb.append(String.format("%6.2f %7.2f:", getLatitude(), getLongitude())); + return sb.toString(); + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - Calendar c = getDataTime().getRefTimeAsCalendar(); - if (c != null) { - sb.append(String.format("TCG:%1$tY%1$tm%1$td%1$tH%1$tM", - getDataTime().getRefTimeAsCalendar())); - } else { - sb.append("TCG:YYYYMMDDHHmm"); - } - sb.append(String.format("%6.2f %7.2f:", getLatitude(), getLongitude())); - return sb.toString(); - } @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "tcg"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/TropicalCycloneSummary.java b/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/TropicalCycloneSummary.java index d891f550e6..89ae09e699 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/TropicalCycloneSummary.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.tcs/src/com/raytheon/uf/common/dataplugin/tcs/TropicalCycloneSummary.java @@ -58,11 +58,13 @@ import com.vividsolutions.jts.geom.Geometry; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Nov 12, 2009 jsanchez Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Nov 12, 2009 jsanchez Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -76,272 +78,274 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "tcs", - indexes = { - @Index(name = "tcs_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "tcs", indexes = { @Index(name = "tcs_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class TropicalCycloneSummary extends PersistablePluginDataObject - implements ISpatialEnabled, IPointData { + implements ISpatialEnabled, IPointData { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - // Text of the WMO header - @Transient - @XmlElement - @DynamicSerializeElement - private String wmoHeader = ""; + // Text of the WMO header + @Transient + @XmlElement + @DynamicSerializeElement + private String wmoHeader = ""; - @XmlElement - @DynamicSerializeElement - @Column - @DataURI(position = 1) - protected String productType = ""; + @XmlElement + @DynamicSerializeElement + @Column + @DataURI(position = 1) + protected String productType = ""; - @Embedded - @DataURI(position = 2, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; + @Embedded + @DataURI(position = 2, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; - @XmlElement - @DynamicSerializeElement - @Transient - protected String name; + @XmlElement + @DynamicSerializeElement + @Transient + protected String name; - @XmlElement - @DynamicSerializeElement - @Transient - private boolean tropical; + @XmlElement + @DynamicSerializeElement + @Transient + private boolean tropical; - @XmlElement - @DynamicSerializeElement - @Transient - private String displayTime; + @XmlElement + @DynamicSerializeElement + @Transient + private String displayTime; - @XmlElement - @DynamicSerializeElement - @Transient - private int pressure; + @XmlElement + @DynamicSerializeElement + @Transient + private int pressure; - @XmlElement - @DynamicSerializeElement - @Transient - protected int windSpeed; + @XmlElement + @DynamicSerializeElement + @Transient + protected int windSpeed; - @XmlElement - @DynamicSerializeElement - @Transient - protected ArrayList radiusList; + @XmlElement + @DynamicSerializeElement + @Transient + protected ArrayList radiusList; - // @XmlElement - // @DynamicSerializeElement - // @Transient - // protected List windRadii; + // @XmlElement + // @DynamicSerializeElement + // @Transient + // protected List windRadii; - /** - * Empty default constructor - */ - public TropicalCycloneSummary() { - tropical = true; - windSpeed = 0; - displayTime = ""; - } + /** + * Empty default constructor + */ + public TropicalCycloneSummary() { + tropical = true; + windSpeed = 0; + displayTime = ""; + } - public TropicalCycloneSummary(String dataUri) { - super(dataUri); - tropical = true; - windSpeed = 0; - displayTime = ""; - } + public TropicalCycloneSummary(String dataUri) { + super(dataUri); + tropical = true; + windSpeed = 0; + displayTime = ""; + } - public TropicalCycloneSummary(String name, int pressure, double longitude, - double latitude, String displayTime, int wind, boolean tropical) { - this.name = name; - this.pressure = pressure; - location = new SurfaceObsLocation(name); - location.setLatitude(latitude); - location.setLongitude(longitude); - this.displayTime = displayTime; - this.windSpeed = wind; - this.tropical = tropical; - } + public TropicalCycloneSummary(String name, int pressure, double longitude, + double latitude, String displayTime, int wind, boolean tropical) { + this.name = name; + this.pressure = pressure; + location = new SurfaceObsLocation(name); + location.setLatitude(latitude); + location.setLongitude(longitude); + this.displayTime = displayTime; + this.windSpeed = wind; + this.tropical = tropical; + } - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * Set the data uri for this observation. - * - * @param dataURI - */ - @Override - public void setDataURI(String dataURI) { - super.setDataURI(dataURI); - identifier = dataURI; - } + /** + * Set the data uri for this observation. + * + * @param dataURI + */ + @Override + public void setDataURI(String dataURI) { + super.setDataURI(dataURI); + identifier = dataURI; + } - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } - @Override - public PointDataView getPointDataView() { - return pointDataView; - } + @Override + public PointDataView getPointDataView() { + return pointDataView; + } - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } - public String getProductType() { - return productType; - } + public String getProductType() { + return productType; + } - public void setProductType(String productType) { - this.productType = productType; - } + public void setProductType(String productType) { + this.productType = productType; + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) { + this.name = name; + } - public int getPressure() { - return pressure; - } + public int getPressure() { + return pressure; + } - public void setPressure(int pressure) { - this.pressure = pressure; - } + public void setPressure(int pressure) { + this.pressure = pressure; + } - public SurfaceObsLocation getLocation() { - return location; - } + public SurfaceObsLocation getLocation() { + return location; + } - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } - public boolean isTropical() { - return tropical; - } + public boolean isTropical() { + return tropical; + } - public void setTropical(boolean tropical) { - this.tropical = tropical; - } + public void setTropical(boolean tropical) { + this.tropical = tropical; + } - public String getDisplayTime() { - return displayTime; - } + public String getDisplayTime() { + return displayTime; + } - public void setDisplayTime(String displayTime) { - this.displayTime = displayTime; - } + public void setDisplayTime(String displayTime) { + this.displayTime = displayTime; + } - public int getWindSpeed() { - return windSpeed; - } + public int getWindSpeed() { + return windSpeed; + } - public void setWindSpeed(int windSpeed) { - this.windSpeed = windSpeed; - } + public void setWindSpeed(int windSpeed) { + this.windSpeed = windSpeed; + } - public ArrayList getRadiusList() { - return radiusList; - } + public ArrayList getRadiusList() { + return radiusList; + } - public void setRadiusList(ArrayList radiusList) { - this.radiusList = radiusList; - } + public void setRadiusList(ArrayList radiusList) { + this.radiusList = radiusList; + } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - Calendar c = getDataTime().getRefTimeAsCalendar(); - if (c != null) { - sb.append(String.format("TCS:%1$tY%1$tm%1$td%1$tH%1$tM", - getDataTime().getRefTimeAsCalendar())); - } else { - sb.append("TCS:YYYYMMDDHHmm"); - } - sb.append(String.format("%6.2f %7.2f:", getLatitude(), getLongitude())); - return sb.toString(); - } + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + Calendar c = getDataTime().getRefTimeAsCalendar(); + if (c != null) { + sb.append(String.format("TCS:%1$tY%1$tm%1$td%1$tH%1$tM", + getDataTime().getRefTimeAsCalendar())); + } else { + sb.append("TCS:YYYYMMDDHHmm"); + } + sb.append(String.format("%6.2f %7.2f:", getLatitude(), getLongitude())); + return sb.toString(); + } + + public String print() { + String s = ""; + s += "Display Time = " + displayTime + "\n"; + s += location.getLatitude() + ", " + location.getLongitude() + "\n"; + s += "Wind Speed = " + windSpeed + "\n"; + if (radiusList != null) { + for (Radius r : radiusList) { + s += r + "\n"; + } + } + return s; + } - public String print() { - String s = ""; - s += "Display Time = " + displayTime + "\n"; - s += location.getLatitude() + ", " + location.getLongitude() + "\n"; - s += "Wind Speed = " + windSpeed + "\n"; - if (radiusList != null) { - for (Radius r : radiusList) { - s += r + "\n"; - } - } - return s; - } @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "tcs"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAARecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAARecord.java index 0bacb09b39..b3d62641c8 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAARecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.vaa/src/com/raytheon/uf/common/dataplugin/vaa/VAARecord.java @@ -22,9 +22,9 @@ package com.raytheon.uf.common.dataplugin.vaa; import java.util.HashSet; import java.util.Set; -import javax.persistence.CascadeType; import javax.persistence.Access; import javax.persistence.AccessType; +import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Embedded; import javax.persistence.Entity; @@ -58,11 +58,13 @@ import com.vividsolutions.jts.geom.Geometry; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Nov 4, 2009 jkorman Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Nov 04, 2009 jkorman Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from - + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract + * * PluginDataObject. * * @@ -71,7 +73,6 @@ import com.vividsolutions.jts.geom.Geometry; * @version 1.0 */ - @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "vaaseq") @Table(name = "vaa", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -79,20 +80,15 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "vaa", - indexes = { - @Index(name = "vaa_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "vaa", indexes = { @Index(name = "vaa_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class VAARecord extends PluginDataObject implements - ISpatialEnabled { - +public class VAARecord extends PluginDataObject implements ISpatialEnabled { + private static final long serialVersionUID = 1L; - + @Embedded @DataURI(position = 1, embedded = true) @XmlElement @@ -106,7 +102,7 @@ public class VAARecord extends PluginDataObject implements @DataURI(position = 2) @XmlElement @DynamicSerializeElement - private String recordType; + private String recordType; /** * @@ -115,8 +111,8 @@ public class VAARecord extends PluginDataObject implements @DataURI(position = 3) @XmlElement @DynamicSerializeElement - private String advisoryNumber; - + private String advisoryNumber; + // Correction indicator from wmo header @DataURI(position = 4) @Column(length = 8) @@ -135,7 +131,7 @@ public class VAARecord extends PluginDataObject implements @Column(length = 2048) @XmlElement @DynamicSerializeElement - private String message; + private String message; /** * @@ -143,7 +139,7 @@ public class VAARecord extends PluginDataObject implements @Column(length = 512) @XmlElement @DynamicSerializeElement - private String anal00Hr; + private String anal00Hr; /** * @@ -151,7 +147,7 @@ public class VAARecord extends PluginDataObject implements @Column(length = 512) @XmlElement @DynamicSerializeElement - private String fcst06Hr; + private String fcst06Hr; /** * @@ -159,7 +155,7 @@ public class VAARecord extends PluginDataObject implements @Column(length = 512) @XmlElement @DynamicSerializeElement - private String fcst12Hr; + private String fcst12Hr; /** * @@ -167,8 +163,8 @@ public class VAARecord extends PluginDataObject implements @Column(length = 512) @XmlElement @DynamicSerializeElement - private String fcst18Hr; - + private String fcst18Hr; + // Text of the WMO header @Column(length = 64) @XmlElement @@ -180,21 +176,21 @@ public class VAARecord extends PluginDataObject implements @OneToMany(cascade = CascadeType.ALL, mappedBy = "parentId", fetch = FetchType.EAGER) private Set subParts = new HashSet(); - /** * Empty default constructor */ public VAARecord() { } - + /** * Construct an instance of this class using the supplied datauri. + * * @param dataUri */ public VAARecord(String dataUri) { super(dataUri); } - + /** * @return the corIndicator */ @@ -203,12 +199,13 @@ public class VAARecord extends PluginDataObject implements } /** - * @param corIndicator the corIndicator to set + * @param corIndicator + * the corIndicator to set */ public void setCorIndicator(String corIndicator) { this.corIndicator = corIndicator; } - + /** * @return the centerId */ @@ -217,7 +214,8 @@ public class VAARecord extends PluginDataObject implements } /** - * @param centerId the centerId to set + * @param centerId + * the centerId to set */ public void setCenterId(String centerId) { this.centerId = centerId; @@ -231,7 +229,8 @@ public class VAARecord extends PluginDataObject implements } /** - * @param wmoHeader the wmoHeader to set + * @param wmoHeader + * the wmoHeader to set */ public void setWmoHeader(String wmoHeader) { this.wmoHeader = wmoHeader; @@ -241,7 +240,7 @@ public class VAARecord extends PluginDataObject implements public IDecoderGettable getDecoderGettable() { return null; } - + @Override public SurfaceObsLocation getSpatialObject() { return location; @@ -254,7 +253,7 @@ public class VAARecord extends PluginDataObject implements public void setLocation(SurfaceObsLocation location) { this.location = location; } - + /** * Get this observation's geometry. * @@ -308,9 +307,7 @@ public class VAARecord extends PluginDataObject implements public Boolean getLocationDefined() { return location.getLocationDefined(); } - - - + /** * @return the recordType */ @@ -319,7 +316,8 @@ public class VAARecord extends PluginDataObject implements } /** - * @param recordType the recordType to set + * @param recordType + * the recordType to set */ public void setRecordType(String recordType) { this.recordType = recordType; @@ -333,7 +331,8 @@ public class VAARecord extends PluginDataObject implements } /** - * @param advisoryNumber the advisoryNumber to set + * @param advisoryNumber + * the advisoryNumber to set */ public void setAdvisoryNumber(String advisoryNumber) { this.advisoryNumber = advisoryNumber; @@ -347,7 +346,8 @@ public class VAARecord extends PluginDataObject implements } /** - * @param message the message to set + * @param message + * the message to set */ public void setMessage(String message) { this.message = message; @@ -361,7 +361,8 @@ public class VAARecord extends PluginDataObject implements } /** - * @param anal00Hr the anal00Hr to set + * @param anal00Hr + * the anal00Hr to set */ public void setAnal00Hr(String anal00Hr) { this.anal00Hr = anal00Hr; @@ -375,7 +376,8 @@ public class VAARecord extends PluginDataObject implements } /** - * @param fcst06Hr the fcst06Hr to set + * @param fcst06Hr + * the fcst06Hr to set */ public void setFcst06Hr(String fcst06Hr) { this.fcst06Hr = fcst06Hr; @@ -389,7 +391,8 @@ public class VAARecord extends PluginDataObject implements } /** - * @param fcst12Hr the fcst12Hr to set + * @param fcst12Hr + * the fcst12Hr to set */ public void setFcst12Hr(String fcst12Hr) { this.fcst12Hr = fcst12Hr; @@ -403,21 +406,21 @@ public class VAARecord extends PluginDataObject implements } /** - * @param fcst18Hr the fcst18Hr to set + * @param fcst18Hr + * the fcst18Hr to set */ public void setFcst18Hr(String fcst18Hr) { this.fcst18Hr = fcst18Hr; } public void addSubPart(VAASubPart part) { - if(subParts == null) { + if (subParts == null) { subParts = new HashSet(); } part.setParentId(this); subParts.add(part); } - - + /** * @return the subParts */ @@ -426,15 +429,16 @@ public class VAARecord extends PluginDataObject implements } /** - * @param subParts the subParts to set + * @param subParts + * the subParts to set */ public void setSubParts(Set subParts) { - for(VAASubPart p : subParts) { + for (VAASubPart p : subParts) { p.setParentId(this); } this.subParts = subParts; } - + /** * */ @@ -448,36 +452,35 @@ public class VAARecord extends PluginDataObject implements sb.append(","); sb.append(getLongitude()); sb.append("]"); - - + return sb.toString(); } - -// "\r\r\nVA ADVISORY" + -// "\r\r\nDTG: 20091104/1708Z" + -// "\r\r\nVAAC: WASHINGTON" + -// "\r\r\nVOLCANO: SOUFRIERE HILLS 1600-05" + -// "\r\r\nPSN: N1642 W06210" + -// "\r\r\nAREA: W_INDIES" + -// "\r\r\nSUMMIT ELEV: 3002 FT (915 M)" + -// "\r\r\nADVISORY NR: 2009/146" + -// "\r\r\nINFO SOURCE: GOES-12. GFS WINDS." + -// "\r\r\nERUPTION DETAILS: CONTINUOUS EMISSIONS" + -// "\r\r\nOBS VA DTG: 04/1645Z" + -// "\r\r\nOBS VA CLD: SFC/FL100 42NM WID LINE BTN N1638" + -// "\r\r\nW06611 - N1643 W06214. MOV W 7KT" + -// "\r\r\nFCST VA CLD +6HR: 04/2300Z SFC/FL100 40NM WID" + -// "\r\r\nLINE BTN N1640 W06614 - N1644 W06214." + -// "\r\r\nFCST VA CLD +12HR: 05/0500Z SFC/FL100 40NM WID" + -// "\r\r\nLINE BTN N1638 W06614 - N1643 W06214. SFC/FL100" + -// "\r\r\n40NM WID LINE BTN N1641 W06616 - N1643 W06214." + -// "\r\r\nFCST VA CLD +18HR: 05/1100Z" + -// "\r\r\nRMK: A SPREADING 42 NMI WIDE ASH PLUME MOVING AT" + -// "\r\r\nA MEASURED 7 KTS EXTENDS AT LEAST 211 NMI TO THE" + -// "\r\r\nWEST OF THE VOLCANO, OR TO ABOUT 66W. NO" + -// "\r\r\nSIGNIFICANT CHANGE IN DIRECTION OR SPEED IS" + -// "\r\r\nANTICIPATED DURING THE NEXT 12 HOURS. ...BALDWIN" + -// "\r\r\nNXT ADVISORY: WILL BE ISSUED BY 20091104/2315Z" + + + // "\r\r\nVA ADVISORY" + + // "\r\r\nDTG: 20091104/1708Z" + + // "\r\r\nVAAC: WASHINGTON" + + // "\r\r\nVOLCANO: SOUFRIERE HILLS 1600-05" + + // "\r\r\nPSN: N1642 W06210" + + // "\r\r\nAREA: W_INDIES" + + // "\r\r\nSUMMIT ELEV: 3002 FT (915 M)" + + // "\r\r\nADVISORY NR: 2009/146" + + // "\r\r\nINFO SOURCE: GOES-12. GFS WINDS." + + // "\r\r\nERUPTION DETAILS: CONTINUOUS EMISSIONS" + + // "\r\r\nOBS VA DTG: 04/1645Z" + + // "\r\r\nOBS VA CLD: SFC/FL100 42NM WID LINE BTN N1638" + + // "\r\r\nW06611 - N1643 W06214. MOV W 7KT" + + // "\r\r\nFCST VA CLD +6HR: 04/2300Z SFC/FL100 40NM WID" + + // "\r\r\nLINE BTN N1640 W06614 - N1644 W06214." + + // "\r\r\nFCST VA CLD +12HR: 05/0500Z SFC/FL100 40NM WID" + + // "\r\r\nLINE BTN N1638 W06614 - N1643 W06214. SFC/FL100" + + // "\r\r\n40NM WID LINE BTN N1641 W06616 - N1643 W06214." + + // "\r\r\nFCST VA CLD +18HR: 05/1100Z" + + // "\r\r\nRMK: A SPREADING 42 NMI WIDE ASH PLUME MOVING AT" + + // "\r\r\nA MEASURED 7 KTS EXTENDS AT LEAST 211 NMI TO THE" + + // "\r\r\nWEST OF THE VOLCANO, OR TO ABOUT 66W. NO" + + // "\r\r\nSIGNIFICANT CHANGE IN DIRECTION OR SPEED IS" + + // "\r\r\nANTICIPATED DURING THE NEXT 12 HOURS. ...BALDWIN" + + // "\r\r\nNXT ADVISORY: WILL BE ISSUED BY 20091104/2315Z" + @Override @Column @@ -485,4 +488,9 @@ public class VAARecord extends PluginDataObject implements public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "vaa"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.vil/src/com/raytheon/uf/common/dataplugin/vil/VILRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.vil/src/com/raytheon/uf/common/dataplugin/vil/VILRecord.java index 1fcf2e33ea..e190a15221 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.vil/src/com/raytheon/uf/common/dataplugin/vil/VILRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.vil/src/com/raytheon/uf/common/dataplugin/vil/VILRecord.java @@ -63,12 +63,14 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 1/14/09 2027 D. Hladky Initial release - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 04/08/13 #1293 bkowal Removed references to hdffileid. + * Jan 14, 2009 2027 D. Hladky Initial release + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -82,17 +84,13 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "vil", - indexes = { - @Index(name = "vil_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "vil", indexes = { @Index(name = "vil_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class VILRecord extends PersistablePluginDataObject - implements ISpatialEnabled { +public class VILRecord extends PersistablePluginDataObject implements + ISpatialEnabled { private static final long serialVersionUID = 767763365671L; @@ -416,9 +414,9 @@ public class VILRecord extends PersistablePluginDataObject try { IDataRecord[] dataRec = dataStore.retrieve(getDataURI()); - for (int i = 0; i < dataRec.length; i++) { - if (dataRec[i] instanceof FloatDataRecord) { - setDataArray(((FloatDataRecord) dataRec[i]).getFloatData()); + for (IDataRecord element : dataRec) { + if (element instanceof FloatDataRecord) { + setDataArray(((FloatDataRecord) element).getFloatData()); } } } catch (Exception se) { @@ -493,4 +491,9 @@ public class VILRecord extends PersistablePluginDataObject public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "vil"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/AbstractWarningRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/AbstractWarningRecord.java index 2ecce321a9..3fcde57f96 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/AbstractWarningRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/AbstractWarningRecord.java @@ -52,7 +52,9 @@ import com.vividsolutions.jts.geom.Geometry; * 03/12/2007 1003 bwoodle initial creation * 04/12/2013 1857 bgonzale Added SequenceGenerator annotation. * 05/02/2013 1949 rjpeter Moved ugcZones to be a column inside table. - * 08/08/2013 2243 jsanchez Removed super method in copy constructor. + * Aug 08, 2013 2243 jsanchez Removed super method in copy + * constructor. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author bwoodle @@ -246,7 +248,6 @@ public abstract class AbstractWarningRecord extends PluginDataObject { this.setMotspd(old.getMotspd()); this.setPil(old.getPil()); this.setPhensig(old.getPhensig()); - this.setPluginName(old.getPluginName()); this.setRawmessage(old.getRawmessage()); this.setSeg(old.getSeg()); this.setTraceId(old.getTraceId()); diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/PracticeWarningRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/PracticeWarningRecord.java index c4ede7e9b4..347210ad33 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/PracticeWarningRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/PracticeWarningRecord.java @@ -41,13 +41,15 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 10/04/2011 10049 bgonzale initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime + * Oct 04, 2011 10049 bgonzale initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 02, 2013 1949 rjpeter Removed ugcZones. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author bgonzale @@ -104,4 +106,9 @@ public class PracticeWarningRecord extends AbstractWarningRecord { public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "practicewarning"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/WarningRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/WarningRecord.java index aa8859a38e..fa5549c219 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/WarningRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/WarningRecord.java @@ -44,12 +44,14 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 03/12/2007 1003 bwoodle initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime + * Mar 12, 2007 1003 bwoodle initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 02, 2013 1949 rjpeter Removed ugcZones. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author bwoodle @@ -166,4 +168,9 @@ public class WarningRecord extends AbstractWarningRecord { public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "warning"; + } } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/PluginDataObject.java b/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/PluginDataObject.java index 52f74e4406..b1a22cadd5 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/PluginDataObject.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/PluginDataObject.java @@ -102,6 +102,7 @@ import com.raytheon.uf.common.time.DataTime; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * May 16, 2013 1869 bsteffen Rewrite dataURI property mappings. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * */ @@ -123,12 +124,6 @@ public abstract class PluginDataObject extends PersistableDataObject implements @Id protected int id; - /** The name of the plugin this object is associated with */ - @Transient - @XmlAttribute - @DynamicSerializeElement - protected String pluginName; - /** The data time for this record */ @Embedded @XmlElement @@ -190,7 +185,7 @@ public abstract class PluginDataObject extends PersistableDataObject implements } public String getDataURI() { - if (dataURI == null && pluginName != null) { + if (dataURI == null) { try { this.dataURI = DataURIUtil.createDataURI(this); } catch (PluginException e) { @@ -230,13 +225,7 @@ public abstract class PluginDataObject extends PersistableDataObject implements this.messageData = messageData; } - public String getPluginName() { - return pluginName; - } - - public void setPluginName(String pluginName) { - this.pluginName = pluginName; - } + public abstract String getPluginName(); public void setDataTime(DataTime dataTime) { this.dataTime = dataTime; @@ -325,11 +314,13 @@ public abstract class PluginDataObject extends PersistableDataObject implements return false; } + String pluginName = getPluginName(); + String rhsPluginName = rhs.getPluginName(); if (pluginName == null) { - if (rhs.pluginName != null) { + if (rhsPluginName != null) { return false; } - } else if (!pluginName.equals(rhs.pluginName)) { + } else if (!pluginName.equals(rhsPluginName)) { return false; } @@ -340,14 +331,16 @@ public abstract class PluginDataObject extends PersistableDataObject implements public int hashCode() { final int prime = 31; int result = 1; - result = prime * result + result = (prime * result) + ((dataTime == null) ? 0 : dataTime.hashCode()); - result = prime * result - + ((getDataURI() == null) ? 0 : dataURI.hashCode()); - result = prime * result + id; - result = prime * result + String dataUri = getDataURI(); + result = (prime * result) + + ((dataUri == null) ? 0 : dataURI.hashCode()); + result = (prime * result) + id; + result = (prime * result) + ((insertTime == null) ? 0 : insertTime.hashCode()); - result = prime * result + String pluginName = getPluginName(); + result = (prime * result) + ((pluginName == null) ? 0 : pluginName.hashCode()); return result; } diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/annotations/DataURIUtil.java b/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/annotations/DataURIUtil.java index 1c96cbf508..7bd40cbdcf 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/annotations/DataURIUtil.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin/src/com/raytheon/uf/common/dataplugin/annotations/DataURIUtil.java @@ -54,6 +54,7 @@ import com.raytheon.uf.common.util.ConvertUtil; * from PluginDataObject * May 15, 2013 1869 bsteffen Move uri map creation from RecordFactory. * May 16, 2013 1869 bsteffen Rewrite dataURI property mappings. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract and removed setPluginName. * * * @@ -66,6 +67,9 @@ public class DataURIUtil { private static final String FIELD_SEPARATOR = "."; + private static final Pattern FIELD_SEPARATOR_PATTERN = Pattern.compile("[" + + FIELD_SEPARATOR + "]"); + private static final Pattern SEPARATOR_PATTERN = Pattern .compile(DataURI.SEPARATOR); @@ -165,7 +169,7 @@ public class DataURIUtil { throws PluginException { List tokens = tokenizeURI(dataURI); Map dataMap = new HashMap( - (int) (tokens.size() / 0.75f + 1), 0.75f); + (int) ((tokens.size() / 0.75f) + 1), 0.75f); String pluginName = tokens.get(0); tokens = tokens.subList(1, tokens.size()); dataMap.put(PLUGIN_NAME_KEY, pluginName); @@ -246,7 +250,6 @@ public class DataURIUtil { */ public static void populatePluginDataObject(PluginDataObject pdo, Map dataMap) throws PluginException { - pdo.setPluginName(dataMap.get(PLUGIN_NAME_KEY).toString()); populateObject(pdo, dataMap); } @@ -275,7 +278,7 @@ public class DataURIUtil { throws PluginException { DataURIFieldAccess[] accessArray = getAccess(object.getClass()); Map dataMap = new HashMap( - (int) (accessArray.length / 0.75f + 2), 0.75f); + (int) ((accessArray.length / 0.75f) + 2), 0.75f); if (object instanceof PluginDataObject) { dataMap.put(PLUGIN_NAME_KEY, ((PluginDataObject) object).getPluginName()); @@ -300,14 +303,19 @@ public class DataURIUtil { accessMap.put(access.getFieldName(), access); } for (String dataKey : dataMap.keySet()) { - Object data = dataMap.get(dataKey); - DataURIFieldAccess access = accessMap.get(dataKey); - if (access == null) { - access = new DataURIFieldAccess(Arrays.asList(dataKey.split("[" - + FIELD_SEPARATOR + "]")), - object != null ? object.getClass() : null); + if (!PLUGIN_NAME_KEY.equals(dataKey)) { + Object data = dataMap.get(dataKey); + DataURIFieldAccess access = accessMap.get(dataKey); + if (access == null) { + + access = new DataURIFieldAccess( + Arrays.asList(FIELD_SEPARATOR_PATTERN + .split(dataKey)), + object != null ? object.getClass() : null); + } + + access.setFieldValue(object, data); } - access.setFieldValue(object, data); } } @@ -316,7 +324,6 @@ public class DataURIUtil { */ private static void populatePluginDataObject(PluginDataObject pdo, List uriTokens) throws PluginException { - pdo.setPluginName(uriTokens.get(0)); uriTokens = uriTokens.subList(1, uriTokens.size()); DataURIFieldAccess[] access = getAccess(pdo.getClass()); for (int i = 0; i < access.length; i += 1) { @@ -471,7 +478,7 @@ public class DataURIUtil { throws PluginException { Object source = pdo; try { - for (int i = 0; i < fieldNames.length - 1; i += 1) { + for (int i = 0; i < (fieldNames.length - 1); i += 1) { Object obj = PropertyUtils.getProperty(source, fieldNames[i]); if (obj == null) { diff --git a/edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/msgs/GetServersResponse.java b/edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/msgs/GetServersResponse.java index e78f3542cd..6b5d6db970 100644 --- a/edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/msgs/GetServersResponse.java +++ b/edexOsgi/com.raytheon.uf.common.localization/src/com/raytheon/uf/common/localization/msgs/GetServersResponse.java @@ -37,6 +37,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Aug 6, 2009 mschenke Initial creation * Sep 12, 2012 1167 djohnson Add datadelivery servers. * Jan 14, 2013 1469 bkowal Removed the hdf5 data directory + * Aug 27, 2013 2995 bkowal Removed jms server; added jms connection string * * * @@ -50,7 +51,7 @@ public class GetServersResponse implements ISerializableObject { private String httpServer; @DynamicSerializeElement - private String jmsServer; + private String jmsConnectionString; @DynamicSerializeElement private String pypiesServer; @@ -66,12 +67,12 @@ public class GetServersResponse implements ISerializableObject { this.httpServer = httpServer; } - public String getJmsServer() { - return jmsServer; + public String getJmsConnectionString() { + return jmsConnectionString; } - public void setJmsServer(String jmsServer) { - this.jmsServer = jmsServer; + public void setJmsConnectionString(String jmsConnectionString) { + this.jmsConnectionString = jmsConnectionString; } public String getPypiesServer() { diff --git a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/header/WMOHeaderFinder.java b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/header/WMOHeaderFinder.java index 4e29123be7..2828dd0563 100644 --- a/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/header/WMOHeaderFinder.java +++ b/edexOsgi/com.raytheon.uf.common.util/src/com/raytheon/uf/common/util/header/WMOHeaderFinder.java @@ -37,8 +37,8 @@ import java.util.regex.Pattern; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jul 27, 2012 mschenke Initial creation - * + * Jul 27, 2012 mschenke Initial creation + * Sep 09, 2013 2327 rjpeter Updated to allow pattern to be used again. Added capture for DTG * * * @author mschenke @@ -46,10 +46,9 @@ import java.util.regex.Pattern; */ public class WMOHeaderFinder { - - private static Pattern WMOPATTERN = Pattern - .compile("([A-Z]{3}[A-Z0-9](\\d{0,2}|[A-Z]{0,2}) [A-Z0-9 ]{4} " - + "\\d{6}[^\\r\\n]*)[\\r\\n]+"); + private static final Pattern WMOPATTERN = Pattern + .compile("([A-Z]{3}[A-Z0-9](?:\\d{0,2}|[A-Z]{0,2}) [A-Z0-9 ]{4} " + + "(\\d{6})[^\\r\\n]*)[\\r\\n]*"); /** * Finds and returns the WMO header on the {@link File} @@ -99,4 +98,21 @@ public class WMOHeaderFinder { in.close(); } } + + /** + * Returns the Date Time Group associated with a WMO Header + * + * @param header + * @return + */ + public static String findDtg(String header) { + String dtg = null; + Matcher matcher = WMOPATTERN.matcher(header); + + if (matcher.matches()) { + dtg = matcher.group(2); + } + + return dtg; + } } diff --git a/edexOsgi/com.raytheon.uf.edex.archive/.classpath b/edexOsgi/com.raytheon.uf.edex.archive/.classpath index a6f75277ac..4158707b64 100644 --- a/edexOsgi/com.raytheon.uf.edex.archive/.classpath +++ b/edexOsgi/com.raytheon.uf.edex.archive/.classpath @@ -1,8 +1,8 @@ - - - - - + + + + + diff --git a/edexOsgi/com.raytheon.uf.edex.archive/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.archive/META-INF/MANIFEST.MF index d6df454102..dd531b7090 100644 --- a/edexOsgi/com.raytheon.uf.edex.archive/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.archive/META-INF/MANIFEST.MF @@ -6,4 +6,12 @@ Bundle-Version: 1.0.0.qualifier Bundle-Vendor: RAYTHEON Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Export-Package: com.raytheon.uf.edex.archive.purge -Import-Package: com.raytheon.uf.common.archive.config +Import-Package: com.raytheon.uf.common.archive.config, + com.raytheon.uf.common.archive.request +Require-Bundle: com.raytheon.uf.common.auth;bundle-version="1.12.1174", + com.raytheon.uf.edex.auth;bundle-version="1.12.1174", + com.raytheon.uf.common.serialization.comm;bundle-version="1.12.1174", + com.raytheon.uf.common.status;bundle-version="1.12.1174", + com.raytheon.uf.common.serialization;bundle-version="1.12.1174", + com.raytheon.uf.common.util;bundle-version="1.12.1174", + com.raytheon.uf.common.localization;bundle-version="1.12.1174" diff --git a/edexOsgi/com.raytheon.uf.edex.archive/res/spring/archiveadmim-request.xml b/edexOsgi/com.raytheon.uf.edex.archive/res/spring/archiveadmim-request.xml new file mode 100644 index 0000000000..7b1cc0cfa5 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.archive/res/spring/archiveadmim-request.xml @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/edexOsgi/com.raytheon.uf.edex.archive/resources/com.raytheon.uf.edex.archive.cron.properties b/edexOsgi/com.raytheon.uf.edex.archive/resources/com.raytheon.uf.edex.archive.cron.properties new file mode 100644 index 0000000000..9b9705e607 --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.archive/resources/com.raytheon.uf.edex.archive.cron.properties @@ -0,0 +1,6 @@ +# runs database and hdf5 archive for archive server to pull data from +archive.cron=0+40+*+*+*+? +# purge archives +archive.purge.cron=0+5+*+*+*+? +# enable archive purge +archive.purge.enable=false diff --git a/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/purge/ArchivePurger.java b/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/purge/ArchivePurger.java index af69b267eb..3802050faa 100644 --- a/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/purge/ArchivePurger.java +++ b/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/purge/ArchivePurger.java @@ -19,7 +19,6 @@ **/ package com.raytheon.uf.edex.archive.purge; -import java.io.File; import java.util.Collection; import com.raytheon.uf.common.archive.config.ArchiveConfig; @@ -39,6 +38,9 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * ------------ ---------- ----------- -------------------------- * May 6, 2013 1965 bgonzale Initial creation * Added info logging for purge counts. + * Aug 28, 2013 2299 rferrel manager.purgeExpiredFromArchive now returns + * number of files purged. + * Sep 03, 2013 2224 rferrel Add check to enable/disable purger. * * * @@ -48,28 +50,34 @@ import com.raytheon.uf.common.status.UFStatus.Priority; public class ArchivePurger { private final static IUFStatusHandler statusHandler = UFStatus - .getHandler(ArchiveConfigManager.class); + .getHandler(ArchivePurger.class); + + private final static String ENABLE_PROPERTY = "archive.purge.enable"; /** * Purge expired elements from the archives. */ public static void purge() { - ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); - Collection archives = manager.getArchives(); - for (ArchiveConfig archive : archives) { - Collection deletedFiles = manager - .purgeExpiredFromArchive(archive); - if (statusHandler.isPriorityEnabled(Priority.INFO)) { - StringBuilder sb = new StringBuilder(archive.getName()); - sb.append("::Archive Purged "); - sb.append(deletedFiles.size()); - sb.append(" file"); - if (deletedFiles.size() != 1) { - sb.append("s"); + String enableString = System.getProperty(ENABLE_PROPERTY, "false"); + if (Boolean.parseBoolean(enableString)) { + statusHandler.info("::Archive Purged started."); + ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); + Collection archives = manager.getArchives(); + for (ArchiveConfig archive : archives) { + int purgeCount = manager.purgeExpiredFromArchive(archive); + if (statusHandler.isPriorityEnabled(Priority.INFO)) { + StringBuilder sb = new StringBuilder(archive.getName()); + sb.append("::Archive Purged "); + sb.append(purgeCount); + sb.append(" file"); + if (purgeCount != 1) { + sb.append("s"); + } + sb.append("."); + statusHandler.info(sb.toString()); } - sb.append("."); - statusHandler.info(sb.toString()); } + statusHandler.info("::Archive Purged finished."); } } } diff --git a/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/useradmin/ArchiveAdminPrivilegedRequestHandler.java b/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/useradmin/ArchiveAdminPrivilegedRequestHandler.java new file mode 100644 index 0000000000..7d68c406ff --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.archive/src/com/raytheon/uf/edex/archive/useradmin/ArchiveAdminPrivilegedRequestHandler.java @@ -0,0 +1,98 @@ +/** + * 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.archive.useradmin; + +import com.raytheon.uf.common.archive.request.ArchiveAdminAuthRequest; +import com.raytheon.uf.common.auth.exception.AuthorizationException; +import com.raytheon.uf.common.auth.user.IUser; +import com.raytheon.uf.edex.auth.AuthManager; +import com.raytheon.uf.edex.auth.AuthManagerFactory; +import com.raytheon.uf.edex.auth.req.AbstractPrivilegedRequestHandler; +import com.raytheon.uf.edex.auth.resp.AuthorizationResponse; +import com.raytheon.uf.edex.auth.roles.IRoleStorage; + +/** + * Handler for Archive Admin Privileged Requests. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Oct 02, 2013  2326      rferrel     Initial creation.
+ * 
+ * 
+ * + * @author rferrel + * @version 1.0 + */ + +public class ArchiveAdminPrivilegedRequestHandler extends + AbstractPrivilegedRequestHandler { + + /** + * Application name. This must match the application tag in the user role + * file. + */ + private static final String APPLICATION = "Data Archiving"; + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.serialization.comm.IRequestHandler#handleRequest + * (com.raytheon.uf.common.serialization.comm.IServerRequest) + */ + @Override + public ArchiveAdminAuthRequest handleRequest(ArchiveAdminAuthRequest request) + throws Exception { + // If it reaches this point in the code, then the user is authorized, so + // just return the request object with authorized set to true + request.setAuthorized(true); + return request; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.edex.auth.req.AbstractPrivilegedRequestHandler#authorized + * (com.raytheon.uf.common.auth.user.IUser, + * com.raytheon.uf.common.auth.req.AbstractPrivilegedRequest) + */ + @Override + public AuthorizationResponse authorized(IUser user, + ArchiveAdminAuthRequest request) throws AuthorizationException { + + AuthManager manager = AuthManagerFactory.getInstance().getManager(); + IRoleStorage roleStorage = manager.getRoleStorage(); + + boolean authorized = roleStorage.isAuthorized((request).getRoleId(), + user.uniqueId().toString(), APPLICATION); + + if (authorized) { + return new AuthorizationResponse(authorized); + } else { + return new AuthorizationResponse( + (request).getNotAuthorizedMessage()); + } + } +} diff --git a/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archiver/purger/PROCESSED_DATA.xml b/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archiver/purger/PROCESSED_DATA.xml index 7ec34bdc8a..6376546ab5 100644 --- a/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archiver/purger/PROCESSED_DATA.xml +++ b/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archiver/purger/PROCESSED_DATA.xml @@ -24,43 +24,62 @@ * Date Ticket# Engineer Description * ============ ========== =========== ========================== * Jun 20, 2013 1966 rferrel Initial creation + * Aug 05, 2013 2224 rferrel Changes to add dataSet tags. + * Oct 01, 2013 2147 rfrrel Date time stamp no longer requires an hour field. * * @author rferrel * @version 1.0 --> + (mcidas|viirs)/.*/.*/.*/.* + .*-(\d{4})-(\d{2})-(\d{2})-(\d{2}).* + 2,3,4,5 + {1} + - Sounding + Profiles 168 - (acarssounding|bufrua|goessounding|poessounding|profiler|raobs) - {1} - 2,3,4,5 - [^/]*-(\d{4})-(\d{2})-(\d{2})-(\d{2})\..* - - - ModelSounding - 168 - (modelsounding)/(.*) - (bufrmos)(.*) - {1} - {2} - 3,4,5,6 - .*(\d{4})-(\d{2})-(\d{2})[-_](\d{2}).* + + (acarssounding|bufrua|goessounding|poessounding|profiler) + {1} + 2,3,4,5 + .*-(\d{4})-(\d{2})-(\d{2})-(\d{2})\..* + + radar 168 - radar/(.*)/(.*) - {1} - 3,4,5,6 - .*-(\d{4})-(\d{2})-(\d{2})-(\d{2})\..* + + radar/(.*)/(.*) + {1} + 3,4,5,6 + .*-(\d{4})-(\d{2})-(\d{2})-(\d{2})\..* + diff --git a/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archiver/purger/RAW_DATA.xml b/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archiver/purger/RAW_DATA.xml index 88308bd6ed..5b7eb5cd63 100644 --- a/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archiver/purger/RAW_DATA.xml +++ b/edexOsgi/com.raytheon.uf.edex.archive/utility/common_static/base/archiver/purger/RAW_DATA.xml @@ -24,43 +24,62 @@ * Date Ticket# Engineer Description * ============ ========== =========== ========================== * Jun 20, 2013 1966 rferrel Initial creation + * Aug 05, 2013 2224 rferrel Changes to add dataSet tags. + * Oct 01, 2013 2147 rfrrel Date time stamp no longer requires an hour field. * * @author rferrel * @version 1.0 --> + + + This permission allows the user to access Archive Retention. + + + + + + This permission allows the user to access Archive Case Creation. + + + \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.base.feature/feature.xml b/edexOsgi/com.raytheon.uf.edex.base.feature/feature.xml index 86abdf2f3c..547e059577 100644 --- a/edexOsgi/com.raytheon.uf.edex.base.feature/feature.xml +++ b/edexOsgi/com.raytheon.uf.edex.base.feature/feature.xml @@ -183,4 +183,10 @@ install-size="0" version="0.0.0"/> + + diff --git a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/cluster/ClusterLockUtils.java b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/cluster/ClusterLockUtils.java index 94fd35a7e5..55b6439c83 100644 --- a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/cluster/ClusterLockUtils.java +++ b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/cluster/ClusterLockUtils.java @@ -48,6 +48,8 @@ import com.raytheon.uf.edex.database.dao.DaoConfig; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 28, 2010 #5050 rjpeter Initial creation from SmartInitTransaction. + * Aug 26, 2013 #2272 bkowal Add a function to see if a cluster suffix has + * been specified via the environment. * * * @@ -55,6 +57,16 @@ import com.raytheon.uf.edex.database.dao.DaoConfig; * @version 1.0 */ public class ClusterLockUtils { + /* + * An optional context suffix can be included in an EDEX properties file. + * This suffix will be appended to the details of each cluster task. + */ + public static final String CLUSTER_SUFFIX; + + static { + CLUSTER_SUFFIX = System.getProperty("cluster.suffix") != null ? "-" + + System.getProperty("cluster.suffix") : ""; + } public enum LockState { SUCCESSFUL, ALREADY_RUNNING, FAILED, OLD; diff --git a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/handlers/DbQueryHandler.java b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/handlers/DbQueryHandler.java index e41bc25a6e..ec8d93c7f7 100644 --- a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/handlers/DbQueryHandler.java +++ b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/handlers/DbQueryHandler.java @@ -24,7 +24,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataquery.db.QueryParam; import com.raytheon.uf.common.dataquery.db.QueryParam.QueryOperand; import com.raytheon.uf.common.dataquery.db.ReturnedField; @@ -49,8 +48,9 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 21, 2010 mschenke Initial creation + * Jan 21, 2010 mschenke Initial creation * Mar 19, 2013 1807 rferrel OrderBy now performed. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -179,10 +179,7 @@ public class DbQueryHandler implements IRequestHandler { if (row == null) { continue; } - if (fields == null || fields.size() == 0) { - if (row instanceof PluginDataObject) { - ((PluginDataObject) row).setPluginName(pluginName); - } + if ((fields == null) || (fields.size() == 0)) { objectMap.put(null, row); } else if (fields.size() == 1) { objectMap.put(fields.get(0).field, row); diff --git a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/plugin/PluginDao.java b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/plugin/PluginDao.java index 38d7bf69e1..6c7d2e2858 100644 --- a/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/plugin/PluginDao.java +++ b/edexOsgi/com.raytheon.uf.edex.database/src/com/raytheon/uf/edex/database/plugin/PluginDao.java @@ -112,6 +112,7 @@ import com.raytheon.uf.edex.database.query.DatabaseQuery; * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. * May 16, 2013 1869 bsteffen Rewrite dataURI property mappings. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * Oct 07, 2013 2392 rjpeter Updated to pass null productKeys as actual null instead of string null. * * @@ -360,8 +361,8 @@ public abstract class PluginDao extends CoreDao { Boolean hasDataURIColumn = pluginDataURIColumn.get(pdoClazz); if (!Boolean.FALSE.equals(hasDataURIColumn)) { try { - getSessionFactory().getClassMetadata(pdoClazz) - .getPropertyType("dataURI"); + getSessionFactory().getClassMetadata(pdoClazz).getPropertyType( + "dataURI"); criteria.add(Restrictions.eq("dataURI", pdo.getDataURI())); return; } catch (QueryException e) { @@ -633,7 +634,6 @@ public abstract class PluginDao extends CoreDao { throws PluginException { PluginDataObject[] queryResults = getMetadata(query); for (PluginDataObject obj : queryResults) { - obj.setPluginName(pluginName); obj.setMessageData(getHDF5Data(obj, tile)); } return queryResults; @@ -846,7 +846,7 @@ public abstract class PluginDao extends CoreDao { long dateTimeAsLong = timeToCompare.getTime(); if (rule.isDeltaTimeMultiple()) { - if (dateTimeAsLong % delta == 0) { + if ((dateTimeAsLong % delta) == 0) { // If the versions to keep is zero we keep it if // it does not exceed the period specified, if // any @@ -1610,7 +1610,8 @@ public abstract class PluginDao extends CoreDao { } private Date roundDateToHour(Date dateToRound) { - return new Date(dateToRound.getTime() - dateToRound.getTime() % 3600000); + return new Date(dateToRound.getTime() + - (dateToRound.getTime() % 3600000)); } /** @@ -1754,7 +1755,7 @@ public abstract class PluginDao extends CoreDao { // remove .h5 int index = path.lastIndexOf('.'); - if ((index > 0) && (path.length() - index < 5)) { + if ((index > 0) && ((path.length() - index) < 5)) { // ensure its end of string in case extension is // dropped/changed path = path.substring(0, index); @@ -1818,7 +1819,7 @@ public abstract class PluginDao extends CoreDao { } protected void updateRate(float rate) { - cumulativeRate = (rate + cumulativeRate * total) / (total + 1); + cumulativeRate = (rate + (cumulativeRate * total)) / (total + 1); duplicateCheck = cumulativeRate < DUPLICATE_CHECK_THRESHOLD; if (total < DUPLICATE_MEMORY) { diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.feature/feature.xml b/edexOsgi/com.raytheon.uf.edex.datadelivery.feature/feature.xml index 6aa5e8f2f2..1d0fbaeb17 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.feature/feature.xml +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.feature/feature.xml @@ -121,4 +121,11 @@ version="0.0.0" unpack="false"/> + + diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/res/spring/harvester-datadelivery.xml b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/res/spring/harvester-datadelivery.xml index 15d153514a..d231a27f79 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/res/spring/harvester-datadelivery.xml +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.harvester/res/spring/harvester-datadelivery.xml @@ -2,8 +2,13 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> + + + + - + diff --git a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/ResponseProcessingUtilities.java b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/ResponseProcessingUtilities.java index 22c66bd081..e145ca8280 100644 --- a/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/ResponseProcessingUtilities.java +++ b/edexOsgi/com.raytheon.uf.edex.datadelivery.retrieval/src/com/raytheon/uf/edex/datadelivery/retrieval/util/ResponseProcessingUtilities.java @@ -46,9 +46,12 @@ import com.raytheon.uf.common.time.DataTime; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jan 07, 2011 dhladky Initial creation - * Aug 20, 2012 0743 djohnson Fix cache lookup to use the model name and not hashcode. - * Nov 19, 2012 1166 djohnson Clean up JAXB representation of registry objects. - * Jan 30, 2013 1543 djohnson Log exception stacktrace. + * Aug 20, 2012 0743 djohnson Fix cache lookup to use the model name + * and not hashcode. + * Nov 19, 2012 1166 djohnson Clean up JAXB representation of registry + * objects. + * Jan 30, 2013 1543 djohnson Log exception stacktrace. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -62,8 +65,7 @@ public class ResponseProcessingUtilities { .getHandler(ResponseProcessingUtilities.class); public static GridRecord getGridRecord(String name, Parameter parm, - Level level, String ensembleId, - GridCoverage gridCoverage) { + Level level, String ensembleId, GridCoverage gridCoverage) { com.raytheon.uf.common.parameter.Parameter parameter = new com.raytheon.uf.common.parameter.Parameter(); parameter.setAbbreviation(parm.getName()); @@ -71,7 +73,6 @@ public class ResponseProcessingUtilities { parameter.setUnitString(parm.getUnits()); GridRecord record = new GridRecord(); - record.setPluginName("grid"); record.setLocation(gridCoverage); record.setLevel(level); record.setParameter(parameter); @@ -160,8 +161,8 @@ public class ResponseProcessingUtilities { for (int index = startLevel; index <= endLevel; index++) { double levelOneValue = plevels.getLevelAt(index); - String masterLevelName = LevelType - .getLevelTypeIdName(plevels.getLevelType()); + String masterLevelName = LevelType.getLevelTypeIdName(plevels + .getLevelType()); MasterLevel masterLevel = LevelFactory.getInstance() .getMasterLevel(masterLevelName); Level level = LevelFactory.getInstance().getLevel( diff --git a/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/core/filterimpl/PluginDataObjectFilter.java b/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/core/filterimpl/PluginDataObjectFilter.java index efd6eb6d43..10ad340aad 100644 --- a/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/core/filterimpl/PluginDataObjectFilter.java +++ b/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/core/filterimpl/PluginDataObjectFilter.java @@ -21,16 +21,13 @@ package com.raytheon.uf.edex.decodertools.core.filterimpl; import static com.raytheon.uf.common.localization.LocalizationContext.LocalizationType.EDEX_STATIC; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; -import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; -import javax.xml.bind.Marshaller; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -44,8 +41,8 @@ import com.raytheon.uf.common.geospatial.ISpatialEnabled; import com.raytheon.uf.common.geospatial.ISpatialObject; import com.raytheon.uf.common.localization.IPathManager; import com.raytheon.uf.common.localization.LocalizationContext; -import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel; +import com.raytheon.uf.common.localization.PathManagerFactory; import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.serialization.SerializationUtil; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; @@ -59,6 +56,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Jul 16, 2009 jkorman Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -73,10 +71,10 @@ public class PluginDataObjectFilter extends AbstractObsFilter { private static final String ERROR_1_FMT = "Could not create {%s} context for file \"%s\""; private static final String ERROR_2_FMT = "File %s does not exist"; - + public static final String FILTERS_DIR = "plugin-filters"; - - private Log logger = LogFactory.getLog(getClass()); + + private final Log logger = LogFactory.getLog(getClass()); private String filterConfigFile = null; @@ -87,11 +85,12 @@ public class PluginDataObjectFilter extends AbstractObsFilter { filterConfigFile = configFile; try { File filterDir = null; - + IPathManager manager = PathManagerFactory.getPathManager(); - if(manager != null) { - LocalizationContext context = manager.getContext(EDEX_STATIC, LocalizationLevel.valueOf(localContext)); - if(context != null) { + if (manager != null) { + LocalizationContext context = manager.getContext(EDEX_STATIC, + LocalizationLevel.valueOf(localContext)); + if (context != null) { filterDir = manager.getFile(context, FILTERS_DIR); if (filterDir.exists()) { File srcFile = new File(filterDir, filterConfigFile); @@ -111,22 +110,24 @@ public class PluginDataObjectFilter extends AbstractObsFilter { } catch (IOException e) { logger.error("Unable to read filter config", e); } catch (JAXBException e) { - logger.error("Unable to unmarshall filter config", e); + logger.error("Unable to unmarshall filter config", + e); } } else { - logger.error(String.format(ERROR_2_FMT,filterDir.getPath())); + logger.error(String.format(ERROR_2_FMT, + filterDir.getPath())); createDummyFilter(); } } else { - logger.error(String.format(ERROR_1_FMT, localContext,configFile)); + logger.error(String.format(ERROR_1_FMT, localContext, + configFile)); createDummyFilter(); } } else { // Could not create PathManager } } catch (Exception e) { - logger.error( - "Error creating filter.", e); + logger.error("Error creating filter.", e); createDummyFilter(); } logger.info("Filter name = " + getFilterName()); @@ -144,24 +145,27 @@ public class PluginDataObjectFilter extends AbstractObsFilter { int reportCount = 0; if (reports != null) { - for (int i = 0; i < reports.length; i++) { PluginDataObject r = null; boolean keep = true; for (AbstractFilterElement element : filterElements) { r = element.filter(reports[i]); - - // Only allow keep to be set to true. Once true it stays that way. - if(AbstractObsFilter.INCLUDE_TYPE.equals(element.getFilterType())) { + + // Only allow keep to be set to true. Once true it stays + // that way. + if (AbstractObsFilter.INCLUDE_TYPE.equals(element + .getFilterType())) { // Did the filter pass? - if(r == null) { - // If we fail an element, exit now. + if (r == null) { + // If we fail an element, exit now. keep = false; break; } - } else if(AbstractObsFilter.EXCLUDE_TYPE.equals(element.getFilterType())) { - if(r != null) { - // There was a match, so we want to remove this item. + } else if (AbstractObsFilter.EXCLUDE_TYPE.equals(element + .getFilterType())) { + if (r != null) { + // There was a match, so we want to remove this + // item. keep = false; // And there's no reason for further checks. break; @@ -220,30 +224,37 @@ public class PluginDataObjectFilter extends AbstractObsFilter { return fis; } - private static class TestObject extends PluginDataObject implements ISpatialEnabled { + private static class TestObject extends PluginDataObject implements + ISpatialEnabled { private static final long serialVersionUID = 1L; SurfaceObsLocation location; - + @Override public IDecoderGettable getDecoderGettable() { return null; } - + @Override public ISpatialObject getSpatialObject() { return location; } - + + @Override public String toString() { return location.getStationId() + " Passed"; } + + @Override + public String getPluginName() { + return "test"; + } } - - public static final void main(String [] args) { - - RadiusFilterElement element = new RadiusFilterElement(0,0,60); + + public static final void main(String[] args) { + + RadiusFilterElement element = new RadiusFilterElement(0, 0, 60); element.setFilterType("INCLUDE"); TestObject p = new TestObject(); @@ -257,26 +268,26 @@ public class PluginDataObjectFilter extends AbstractObsFilter { p.location.assignLocation(.7, .7); p = (TestObject) element.filter(p); System.out.println((p == null) ? "failed" : p); - + // Southeast corner of OAX WFO - element = new RadiusFilterElement(40,-94.90,100); + element = new RadiusFilterElement(40, -94.90, 100); element.setFilterType("INCLUDE"); p = new TestObject(); p.location = new SurfaceObsLocation("2.1"); - p.location.assignLocation(38.78, -97.65); // KSLN 38 47N 097 39W + p.location.assignLocation(38.78, -97.65); // KSLN 38 47N 097 39W p = (TestObject) element.filter(p); System.out.println((p == null) ? p : "failed"); p = new TestObject(); p.location = new SurfaceObsLocation("2.2"); - p.location.assignLocation(39.13, -96.68); // KMHK 39 08N 096 41W + p.location.assignLocation(39.13, -96.68); // KMHK 39 08N 096 41W p = (TestObject) element.filter(p); System.out.println((p != null) ? p : "failed"); - + // Test set 3 PluginDataObjectFilter filter = new PluginDataObjectFilter(); - element = new RadiusFilterElement(40,-94.90,100); + element = new RadiusFilterElement(40, -94.90, 100); element.setFilterType("INCLUDE"); filter.addFilterElement(element); @@ -288,55 +299,55 @@ public class PluginDataObjectFilter extends AbstractObsFilter { e.setLowerRightLon(-94.90); e.setFilterType("INCLUDE"); filter.addFilterElement(e); - - PluginDataObject [] pp = new PluginDataObject [3]; + + PluginDataObject[] pp = new PluginDataObject[3]; p = new TestObject(); p.location = new SurfaceObsLocation("KSLN"); - p.location.assignLocation(38.78, -97.65); // KSLN 38 47N 097 39W + p.location.assignLocation(38.78, -97.65); // KSLN 38 47N 097 39W pp[0] = p; p = new TestObject(); p.location = new SurfaceObsLocation("KMHK"); - p.location.assignLocation(39.13, -96.68); // KMHK 39 08N 096 41W + p.location.assignLocation(39.13, -96.68); // KMHK 39 08N 096 41W pp[1] = p; p = new TestObject(); p.location = new SurfaceObsLocation("KSTJ"); p.location.assignLocation(41, -96.00); pp[2] = p; - + pp = filter.filter(pp); - + System.out.println("----------------------------------"); System.out.println("- Success = KSTJ"); System.out.println("----------"); - for(PluginDataObject o : pp) { + for (PluginDataObject o : pp) { System.out.println(o); } - + // Test set 4 - pp = new PluginDataObject [4]; + pp = new PluginDataObject[4]; p = new TestObject(); p.location = new SurfaceObsLocation("KORD"); - p.location.assignLocation(38.78, -97.65); // KSLN 38 47N 097 39W + p.location.assignLocation(38.78, -97.65); // KSLN 38 47N 097 39W pp[0] = p; - + p = new TestObject(); p.location = new SurfaceObsLocation("KSLN"); - p.location.assignLocation(38.78, -97.65); // KSLN 38 47N 097 39W + p.location.assignLocation(38.78, -97.65); // KSLN 38 47N 097 39W pp[1] = p; p = new TestObject(); p.location = new SurfaceObsLocation("KMHK"); - p.location.assignLocation(39.13, -96.68); // KMHK 39 08N 096 41W + p.location.assignLocation(39.13, -96.68); // KMHK 39 08N 096 41W pp[2] = p; p = new TestObject(); p.location = new SurfaceObsLocation("KSTJ"); p.location.assignLocation(41, -96.00); pp[3] = p; - + filter = new PluginDataObjectFilter(); StationIdFilterElement s = new StationIdFilterElement(); @@ -345,10 +356,10 @@ public class PluginDataObjectFilter extends AbstractObsFilter { s.setFilterType(INCLUDE_TYPE); filter.addFilterElement(s); -// s = new StationIdFilterElement(); -// s.addPattern("KM[HIJ]K"); -// s.setFilterType(EXCLUDE_TYPE); -// filter.addFilterElement(s); + // s = new StationIdFilterElement(); + // s.addPattern("KM[HIJ]K"); + // s.setFilterType(EXCLUDE_TYPE); + // filter.addFilterElement(s); e = new RectFilterElement(); e.setUpperLeftLat(42.90); @@ -359,36 +370,14 @@ public class PluginDataObjectFilter extends AbstractObsFilter { e.setFilterType("INCLUDE"); filter.addFilterElement(e); - - - - pp = filter.filter(pp); - + System.out.println("----------------------------------"); System.out.println("- Success = KSLN, KSTJ"); System.out.println("----------"); - for(PluginDataObject o : pp) { + for (PluginDataObject o : pp) { System.out.println(o); } System.out.println("----------------------------------"); - - -// try { -// JAXBContext ctx = JAXBContext.newInstance(PluginDataObjectFilter.class,StationIdFilterElement.class); -// -// Marshaller msh = ctx.createMarshaller(); -// -// msh.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); -// -// ByteArrayOutputStream istrm = new ByteArrayOutputStream(); -// msh.marshal(filter, istrm); -// -// String ss = istrm.toString(); -// -// System.out.println(ss); -// } catch(Exception ee) { -// ee.printStackTrace(); -// } } } diff --git a/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/core/filterimpl/WMOHeaderFilterElement.java b/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/core/filterimpl/WMOHeaderFilterElement.java index b88f813c0e..cd337e1be3 100644 --- a/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/core/filterimpl/WMOHeaderFilterElement.java +++ b/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/core/filterimpl/WMOHeaderFilterElement.java @@ -30,11 +30,7 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; -import com.raytheon.uf.common.dataplugin.IDecoderGettable; import com.raytheon.uf.common.dataplugin.PluginDataObject; -import com.raytheon.uf.common.geospatial.ISpatialEnabled; -import com.raytheon.uf.common.geospatial.ISpatialObject; -import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.serialization.ISerializableObject; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; @@ -42,23 +38,25 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; * TODO Add Description * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
  * Oct 25, 2011 11312      jkorman     Initial creation
- *
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
+ * 
  * 
- * + * * @author jkorman - * @version 1.0 + * @version 1.0 */ @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class WMOHeaderFilterElement extends AbstractFilterElement implements ISerializableObject { - - private static final Class [] GETTER_CLASS = new Class [0]; +public class WMOHeaderFilterElement extends AbstractFilterElement implements + ISerializableObject { + + private static final Class[] GETTER_CLASS = new Class[0]; private static final String WMO_HEADER = "getWmoHeader"; @@ -69,7 +67,7 @@ public class WMOHeaderFilterElement extends AbstractFilterElement implements ISe public WMOHeaderFilterElement() { super(); } - + /** * @return the patterns */ @@ -78,7 +76,8 @@ public class WMOHeaderFilterElement extends AbstractFilterElement implements ISe } /** - * @param patterns the patterns to set + * @param patterns + * the patterns to set */ public void setPatterns(List patterns) { this.patterns = patterns; @@ -89,7 +88,7 @@ public class WMOHeaderFilterElement extends AbstractFilterElement implements ISe * @param pattern */ public void addPattern(Pattern pattern) { - if(patterns == null) { + if (patterns == null) { patterns = new ArrayList(); } patterns.add(pattern); @@ -100,26 +99,27 @@ public class WMOHeaderFilterElement extends AbstractFilterElement implements ISe * @param pattern */ public void addPattern(String pattern) { - if(pattern != null) { + if (pattern != null) { addPattern(Pattern.compile(pattern)); } } /** * This execute + * * @see com.raytheon.uf.edex.decodertools.core.IObsFilterElement#filter(com.raytheon.uf.common.dataplugin.PluginDataObject) */ @Override public PluginDataObject filter(PluginDataObject report) { boolean pass = false; - if(report != null) { + if (report != null) { String wmoHeader = getWMOHeader(report); - - if(wmoHeader != null) { - for(Pattern p : patterns) { - if(p != null) { + + if (wmoHeader != null) { + for (Pattern p : patterns) { + if (p != null) { Matcher m = p.matcher(wmoHeader); - if(m.matches()) { + if (m.matches()) { pass = true; break; } @@ -127,105 +127,48 @@ public class WMOHeaderFilterElement extends AbstractFilterElement implements ISe } } } - return (pass ? report : null) ; + return (pass ? report : null); } /** - * Get the WMO header from this report object. If an error occurs or the - * WMO header is not defined, a null String reference is returned. + * Get the WMO header from this report object. If an error occurs or the WMO + * header is not defined, a null String reference is returned. + * * @param report * @return */ private String getWMOHeader(PluginDataObject report) { - + String header = null; - if(report != null) { + if (report != null) { Method getter = null; try { getter = report.getClass().getMethod(WMO_HEADER, GETTER_CLASS); } catch (Exception e) { // Nothing } - if(getter != null) { + if (getter != null) { try { header = (String) getter.invoke(report); - } catch(Exception e) { + } catch (Exception e) { // Nothing } } } return header; } - + /** * */ @Override public String toString() { StringBuilder sb = new StringBuilder("WMOHeaderFilterElement:{"); - for(Pattern p : patterns) { + for (Pattern p : patterns) { sb.append(p.pattern()); sb.append(","); } sb.append("}"); return sb.toString(); } - - private static class TestObject extends PluginDataObject implements ISpatialEnabled { - private static final long serialVersionUID = 1L; - - String wmoHeader = null; - - SurfaceObsLocation location; - - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - - @Override - public ISpatialObject getSpatialObject() { - return location; - } - - public String getWmoHeader() { - return wmoHeader; - } - - public void setWmoHeader(String header) { - wmoHeader = header; - } - - public String toString() { - return wmoHeader + " Passed"; - } - - } - - public static final void main(String [] args) { - - PluginDataObjectFilter filter = new PluginDataObjectFilter(); - WMOHeaderFilterElement element = new WMOHeaderFilterElement(); - element.setFilterElementName(""); - element.setFilterType(AbstractObsFilter.EXCLUDE_TYPE); - element.addPattern(Pattern.compile("SAUS70.*")); - filter.addFilterElement(element); - - TestObject t = new TestObject(); - System.out.println("---- Test 1 -----"); - PluginDataObject [] pp = new TestObject[] { t, }; - t.setWmoHeader("SAUS43 KWBC 251300"); - pp = filter.filter(pp); - for(PluginDataObject p : pp) { - System.out.println(p); - } - - System.out.println("---- Test 2 -----"); - t.setWmoHeader("SAUS70 KWBC 251410 RRA"); - pp = new TestObject[] { t, }; - pp = filter.filter(pp); - for(PluginDataObject p : pp) { - System.out.println(p); - } - } } diff --git a/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/time/TimeTools.java b/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/time/TimeTools.java index 02dd25686c..765257d16c 100644 --- a/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/time/TimeTools.java +++ b/edexOsgi/com.raytheon.uf.edex.decodertools/src/com/raytheon/uf/edex/decodertools/time/TimeTools.java @@ -19,6 +19,7 @@ **/ package com.raytheon.uf.edex.decodertools.time; +import java.io.File; import java.text.ParseException; import java.util.Calendar; import java.util.TimeZone; @@ -49,6 +50,7 @@ import com.raytheon.uf.edex.decodertools.core.DecoderTools; * 20070925 391 jkorman Added copyToNearestHour method. * 20071019 391 jkorman Added getSystemCalendar and TimeService. * 20130219 1636 rferrel File timestamp can now be YYMMDD or YYMMDDHH. + * 20130912 2249 rferrel Added getWarningTimestamp method. * * * @author jkorman @@ -64,7 +66,24 @@ public class TimeTools { * name: .YYYYMMDD or .YYYYMMDDHH */ private static final Pattern FILE_TIMESTAMP = Pattern - .compile("(.*\\.)(\\d{8}|\\d{10}$)"); + .compile("(.*\\.)(\\d{8}|\\d{10})$"); + + /** + * Time stamp for a file name created by the Text Editor Dialog. This + * assumes the 10 digit following .wan is the warning's issue time in epoch + * seconds. + */ + private static final String TEXT_EDITOR_WARNING = ".*\\.wan(\\d{10})$"; + + /** + * Environment variable with the root directory. + */ + private static final String DATA_ARCHIVE_ROOT = "data.archive.root"; + + /** + * Pattern for getting time stamp from Text Editor Dialog created files. + */ + private static Pattern FILE_WARNING_TIMESTAMP = null; public static final Pattern WMO_TIMESTAMP = Pattern .compile("([0-3][0-9])(\\d{2})(\\d{2})[Zz]?"); @@ -106,7 +125,7 @@ public class TimeTools { } - /** Allows the check on archive to be overriden for testing. */ + /** Allows the check on archive to be overridden for testing. */ static ICheckAllowArchive checkAllowArchive = new CheckOSEnv(); /** @@ -238,6 +257,35 @@ public class TimeTools { return timestamp; } + /** + * Get the time stamp of a warning file name based on the name generated by + * the TextEditorDialog. + * + * @param fileName + * @return timestamp warning's issue time in epoch seconds when fileName is + * a Text Editor Dialog file otherwise null + */ + public static final String getWarningTimestamp(String fileName) { + if (FILE_WARNING_TIMESTAMP == null) { + // Create pattern to test if fileName is in a director relative to + // DATA_ARCHIVE_ROOT and ends with the expected extension. + StringBuilder pattern = new StringBuilder("^"); + pattern.append(System.getProperty(DATA_ARCHIVE_ROOT)); + if (!pattern.substring(pattern.length() - 1).equals(File.separator)) { + pattern.append(File.separator); + } + pattern.append(TEXT_EDITOR_WARNING); + FILE_WARNING_TIMESTAMP = Pattern.compile(pattern.toString()); + } + + String timestamp = null; + Matcher matcher = FILE_WARNING_TIMESTAMP.matcher(fileName); + if (matcher.find()) { + timestamp = matcher.group(1); + } + return timestamp; + } + /** * Converts a ddhhmm time group to a Calendar. Adjusts the calendar as * follows: Any time group with a day (dd) in the future is set back one diff --git a/edexOsgi/com.raytheon.uf.edex.distribution/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.distribution/META-INF/MANIFEST.MF index 21c2288bf1..49b50e4215 100644 --- a/edexOsgi/com.raytheon.uf.edex.distribution/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.distribution/META-INF/MANIFEST.MF @@ -10,3 +10,4 @@ Require-Bundle: com.raytheon.uf.common.serialization, com.raytheon.uf.common.status;bundle-version="1.12.1112" Import-Package: org.apache.camel, org.apache.commons.logging +Export-Package: com.raytheon.uf.edex.distribution diff --git a/edexOsgi/com.raytheon.uf.edex.distribution/res/spring/distribution-spring.xml b/edexOsgi/com.raytheon.uf.edex.distribution/res/spring/distribution-spring.xml index 9572d27ad3..018a905229 100644 --- a/edexOsgi/com.raytheon.uf.edex.distribution/res/spring/distribution-spring.xml +++ b/edexOsgi/com.raytheon.uf.edex.distribution/res/spring/distribution-spring.xml @@ -3,6 +3,7 @@ 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"> + @@ -63,9 +64,7 @@ - - - + java.lang.Throwable diff --git a/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/DistributionPatterns.java b/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/DistributionPatterns.java new file mode 100644 index 0000000000..69eaf6bd4e --- /dev/null +++ b/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/DistributionPatterns.java @@ -0,0 +1,215 @@ +/** + * 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.distribution; + +import java.io.File; +import java.util.Collection; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +import com.raytheon.uf.common.localization.IPathManager; +import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; +import com.raytheon.uf.common.localization.LocalizationFile; +import com.raytheon.uf.common.localization.PathManagerFactory; +import com.raytheon.uf.common.serialization.SerializationUtil; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; + +/** + * Container for the various Distribution patterns used by plugins. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Sep 6, 2013  2327      rjpeter     Initial creation
+ * 
+ * 
+ * + * @author rjpeter + * @version 1.0 + */ +public class DistributionPatterns { + private static final IUFStatusHandler statusHandler = UFStatus + .getHandler(DistributionPatterns.class); + + private static final DistributionPatterns instance = new DistributionPatterns(); + + /** + * Used to track file modified time to determine if a pattern set needs to + * be reloaded. + */ + private final ConcurrentMap modifiedTimes = new ConcurrentHashMap(); + + /** + * Patterns for the various plugins. + */ + private final ConcurrentMap patterns = new ConcurrentHashMap(); + + /** + * Returns the singleton instance. + * + * @return + */ + public static DistributionPatterns getInstance() { + return instance; + } + + private DistributionPatterns() { + refresh(); + } + + /** + * Loads patterns from a distribution file for the specified plugin. + * + * @param file + * The file containing the ingest patterns + * @throws DistributionException + * If the modelFile cannot be deserialized + */ + private RequestPatterns loadPatterns(File file) + throws DistributionException { + RequestPatterns patternSet = null; + try { + patternSet = SerializationUtil.jaxbUnmarshalFromXmlFile( + RequestPatterns.class, file.getPath()); + } catch (Exception e) { + throw new DistributionException("File " + file.getAbsolutePath() + + " could not be unmarshalled.", e); + } + patternSet.compilePatterns(); + return patternSet; + } + + /** + * Lists the files in the distribution directory + * + * @return An array of the files in the distribution directory + */ + private Collection getDistributionFiles() { + IPathManager pathMgr = PathManagerFactory.getPathManager(); + + LocalizationFile[] files = pathMgr.listFiles( + pathMgr.getLocalSearchHierarchy(LocalizationType.EDEX_STATIC), + "distribution", new String[] { ".xml" }, true, true); + Map distFiles = new HashMap(); + for (LocalizationFile file : files) { + if (distFiles.containsKey(file.getName()) == false) { + distFiles.put(file.getName(), file.getFile()); + } + } + + return distFiles.values(); + } + + /** + * Refreshes the distribution patterns if a plugin's distribution pattern + * file has been modified. This method is executed via a quartz timer every + * five seconds + */ + public void refresh() { + for (File file : getDistributionFiles()) { + String fileName = file.getName(); + Long modTime = modifiedTimes.get(fileName); + if ((modTime == null) + || (modTime.longValue() != file.lastModified())) { + // getDistributionFiles only returns files ending in .xml + int index = fileName.lastIndexOf("."); + String plugin = null; + if (index > 0) { + plugin = fileName.substring(0, index); + } else { + plugin = fileName; + } + + try { + if (patterns.containsKey(plugin)) { + statusHandler + .info("Change to distribution file detected. " + + fileName + + " has been modified. Reloading distribution patterns"); + } + patterns.put(plugin, loadPatterns(file)); + modifiedTimes.put(fileName, file.lastModified()); + } catch (DistributionException e) { + statusHandler.error( + "Error reloading distribution patterns from file: " + + fileName, e); + } + } + } + } + + /** + * Returns a list of plugins that are interested in the given header. + * + * @param header + * @return + */ + public List getMatchingPlugins(String header) { + List plugins = new LinkedList(); + + for (Map.Entry entry : patterns.entrySet()) { + if (entry.getValue().isDesiredHeader(header)) { + plugins.add(entry.getKey()); + } + } + + return plugins; + } + + /** + * Returns a list of plugins that are interested in the given header. + * + * @param header + * @param pluginsToCheck + * @return + */ + public List getMatchingPlugins(String header, + Collection pluginsToCheck) { + List plugins = new LinkedList(); + + for (String plugin : pluginsToCheck) { + RequestPatterns pattern = patterns.get(plugin); + if ((pattern != null) && pattern.isDesiredHeader(header)) { + plugins.add(plugin); + } + } + + return plugins; + } + + /** + * Returns true if there are patterns registered for the given plugin, false + * otherwise. + * + * @param pluginName + * @return + */ + public boolean hasPatternsForPlugin(String pluginName) { + return patterns.containsKey(pluginName); + } +} diff --git a/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/DistributionSrv.java b/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/DistributionSrv.java index 20bb844fd8..a42376af0f 100644 --- a/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/DistributionSrv.java +++ b/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/DistributionSrv.java @@ -20,11 +20,8 @@ package com.raytheon.uf.edex.distribution; import java.io.File; -import java.io.IOException; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -34,16 +31,6 @@ import org.apache.camel.RecipientList; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import com.raytheon.uf.common.localization.IPathManager; -import com.raytheon.uf.common.localization.LocalizationContext; -import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType; -import com.raytheon.uf.common.localization.LocalizationFile; -import com.raytheon.uf.common.localization.PathManagerFactory; -import com.raytheon.uf.common.serialization.SerializationUtil; -import com.raytheon.uf.common.status.IUFStatusHandler; -import com.raytheon.uf.common.status.UFStatus; -import com.raytheon.uf.common.status.UFStatus.Priority; - /** * The purpose of this bean is to load a series of XML files from localization * for each plugin registering itself with this bean and route messages based on @@ -55,111 +42,30 @@ import com.raytheon.uf.common.status.UFStatus.Priority; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Oct 16, 2009 brockwoo Initial creation + * Oct 16, 2009 brockwoo Initial creation * 6/8/2010 4647 bphillip Added automatic pattern refreshing * 09/01/2010 4293 cjeanbap Logging of unknown Weather Products. - * Feb 27, 2013 1638 mschenke Cleaned up localization code to fix null pointer + * Feb 27, 2013 1638 mschenke Cleaned up localization code to fix null pointer * when no distribution files present * Mar 19, 2013 1794 djohnson PatternWrapper is immutable, add toString() to it for debugging. * Aug 19, 2013 2257 bkowal edexBridge to qpid 0.18 upgrade * Aug 30, 2013 2163 bkowal edexBridge to qpid 0.18 RHEL6 upgrade - * + * Sep 06, 2013 2327 rjpeter Updated to use DistributionPatterns. * * * @author brockwoo * @version 1.0 */ - public class DistributionSrv { - - private static final IUFStatusHandler statusHandler = UFStatus - .getHandler(DistributionSrv.class); - private static final String HEADER_QPID_SUBJECT = "qpid.subject"; private static final String MESSAGE_HEADER = "header"; + protected Log logger = LogFactory.getLog("Ingest"); - private static class PatternWrapper { - private final String plugin; - private final RequestPatterns patterns; + protected Log routeFailedLogger = LogFactory.getLog("RouteFailedLog"); - private final String route; - - private final String displayString; - - private PatternWrapper(String plugin, String route, - RequestPatterns patterns) { - this.plugin = plugin; - this.route = route; - this.patterns = patterns; - this.displayString = createDisplayString(); - } - - private String createDisplayString() { - StringBuilder sb = new StringBuilder(); - sb.append("plugin=").append(plugin).append(", "); - sb.append("route=").append(route).append(", "); - sb.append("patterns=").append(patterns); - return sb.toString(); - } - - @Override - public String toString() { - return displayString; - } - } - - protected transient Log logger = LogFactory.getLog("Ingest"); - - protected transient Log routeFailedLogger = LogFactory - .getLog("RouteFailedLog"); - - private final List pluginPatterns = new ArrayList( - 100); - - private final ConcurrentMap patternMap = new ConcurrentHashMap(); - - private final ConcurrentMap modifiedTimes = new ConcurrentHashMap(); - - public DistributionSrv() { - for (File file : getDistributionFiles()) { - modifiedTimes.put(file.getName(), file.lastModified()); - } - } - - /** - * Refreshes the distribution patterns if a plugin's distribution pattern - * file has been modified. This method is executed via a quartz timer every - * five seconds - */ - public synchronized void refresh() { - for (File file : getDistributionFiles()) { - if (!file.getName().endsWith("~") - && modifiedTimes.containsKey(file.getName()) - && (modifiedTimes.get(file.getName()) < file.lastModified())) { - String plugin = file.getName().replace(".xml", ""); - PatternWrapper wrapper = patternMap.get(plugin); - if (wrapper != null) { - try { - statusHandler - .handle(Priority.EVENTA, - "Change to distribution file detected. " - + file.getName() - + " has been modified. Reloading distribution patterns"); - wrapper = new PatternWrapper(wrapper.plugin, - wrapper.route, loadPatterns(file, plugin)); - patternMap.put(plugin, wrapper); - modifiedTimes.put(file.getName(), file.lastModified()); - } catch (DistributionException e) { - statusHandler.handle(Priority.PROBLEM, - "Error reloading distribution patterns from file: " - + file.getName(), e); - } - } - } - } - } + private final ConcurrentMap pluginRoutes = new ConcurrentHashMap(); /** * Allows a plugin to register itself with this bean. Note: if the plugin @@ -170,49 +76,18 @@ public class DistributionSrv { * @param destination * a destination to send this message to * @return an instance of this bean - * @throws EdexException + * @throws DistributionException */ public DistributionSrv register(String pluginName, String destination) throws DistributionException { - IPathManager pathMgr = PathManagerFactory.getPathManager(); - LocalizationContext commonStaticBase = pathMgr.getContext( - LocalizationContext.LocalizationType.EDEX_STATIC, - LocalizationContext.LocalizationLevel.BASE); - - LocalizationContext siteStaticBase = pathMgr.getContext( - LocalizationContext.LocalizationType.EDEX_STATIC, - LocalizationContext.LocalizationLevel.SITE); - - String path = ""; - String sitePath = ""; - try { - path = pathMgr.getFile(commonStaticBase, - "distribution" + File.separator + pluginName + ".xml") - .getCanonicalPath(); - sitePath = pathMgr.getFile(siteStaticBase, - "distribution" + File.separator + pluginName + ".xml") - .getCanonicalPath(); - } catch (IOException e) { + if (!DistributionPatterns.getInstance() + .hasPatternsForPlugin(pluginName)) { throw new DistributionException( "Plugin " + pluginName + " does not have an accompanying patterns file in localization."); } - - File modelFile = new File(path); - File siteModelFile = new File(sitePath); - RequestPatterns patterns = null; - if (siteModelFile.exists()) { - patterns = loadPatterns(siteModelFile, pluginName); - } else if (modelFile.exists()) { - patterns = loadPatterns(modelFile, pluginName); - } else { - patterns = new RequestPatterns(); - } - PatternWrapper wrapper = new PatternWrapper(pluginName, destination, - patterns); - patternMap.put(wrapper.plugin, wrapper); - pluginPatterns.add(wrapper); + pluginRoutes.put(pluginName, destination); return this; } @@ -226,8 +101,6 @@ public class DistributionSrv { */ @RecipientList public List route(Exchange exchange) { - StringBuilder pluginNames = new StringBuilder(); - List dest = new ArrayList(); Message in = exchange.getIn(); // determine if the header is in the qpid subject field? String header = (String) in.getHeader(HEADER_QPID_SUBJECT); @@ -257,14 +130,22 @@ public class DistributionSrv { // No header entry so will try and use the filename instead header = (String) exchange.getIn().getBody(); } - for (PatternWrapper wrapper : pluginPatterns) { - if (wrapper.patterns.isDesiredHeader(header)) { + + List plugins = DistributionPatterns.getInstance() + .getMatchingPlugins(header, pluginRoutes.keySet()); + List routes = new ArrayList(plugins.size()); + StringBuilder pluginNames = new StringBuilder(plugins.size() * 8); + for (String plugin : plugins) { + String route = pluginRoutes.get(plugin); + if (route != null) { if (pluginNames.length() != 0) { pluginNames.append(","); } - pluginNames.append(wrapper.plugin); - dest.add(wrapper.route); + pluginNames.append(plugin); + routes.add(route); unroutedFlag = false; + } else if (logger.isDebugEnabled()) { + logger.debug("No route registered for plugin: " + plugin); } } @@ -273,53 +154,8 @@ public class DistributionSrv { // using warn instead of error; app can continue routeFailedLogger.warn(header); } + in.setHeader("pluginName", pluginNames.toString()); - return dest; - } - - /** - * Loads patterns from a distribution file for the specified plugin - * - * @param modelFile - * The file containing the ingest patterns - * @param pluginName - * The plugin name associated with the ingest patterns - * @throws DistributionException - * If the modelFile cannot be deserialized - */ - private RequestPatterns loadPatterns(File modelFile, String pluginName) - throws DistributionException { - RequestPatterns patternSet = null; - try { - patternSet = SerializationUtil.jaxbUnmarshalFromXmlFile( - RequestPatterns.class, modelFile.getPath()); - } catch (Exception e) { - throw new DistributionException("File " - + modelFile.getAbsolutePath() - + " could not be unmarshalled.", e); - } - patternSet.compilePatterns(); - return patternSet; - } - - /** - * Lists the files in the distribution directory - * - * @return An array of the files in the distribution directory - */ - private File[] getDistributionFiles() { - IPathManager pathMgr = PathManagerFactory.getPathManager(); - - LocalizationFile[] files = pathMgr.listFiles( - pathMgr.getLocalSearchHierarchy(LocalizationType.EDEX_STATIC), - "distribution", null, true, true); - Map distFiles = new HashMap(); - for (LocalizationFile file : files) { - if (distFiles.containsKey(file.getName()) == false) { - distFiles.put(file.getName(), file.getFile()); - } - } - - return distFiles.values().toArray(new File[0]); + return routes; } } diff --git a/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/RequestPatterns.java b/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/RequestPatterns.java index 139602ca98..e18765ffba 100644 --- a/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/RequestPatterns.java +++ b/edexOsgi/com.raytheon.uf.edex.distribution/src/com/raytheon/uf/edex/distribution/RequestPatterns.java @@ -51,7 +51,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject; * May 16, 2011 7317 cjeanbap Added try-catch statement * for PatternSyntaxException. * Mar 19, 2013 1794 djohnson Add toString() for debugging. - * + * Sep 10, 2013 2327 rjpeter Sized ArrayList declarations. * * * @author brockwoo @@ -60,22 +60,22 @@ import com.raytheon.uf.common.serialization.ISerializableObject; @XmlRootElement(name = "requestPatterns") @XmlAccessorType(XmlAccessType.NONE) -public class RequestPatterns implements ISerializableObject{ - +public class RequestPatterns implements ISerializableObject { + /** * List of patterns requested by a plugin. */ - @XmlElements( { @XmlElement(name = "regex", type = String.class) }) - private List patterns = new ArrayList(); - - private final List compiledPatterns = new ArrayList(); - - protected transient Log patternFailedLogger = LogFactory.getLog("PatternFailedLog"); - + @XmlElements({ @XmlElement(name = "regex", type = String.class) }) + private List patterns = new ArrayList(0); + + private List compiledPatterns = new ArrayList(0); + + protected Log patternFailedLogger = LogFactory.getLog("PatternFailedLog"); + /** * Creates a new instance of the container. */ - public RequestPatterns(){ + public RequestPatterns() { } /** @@ -90,27 +90,30 @@ public class RequestPatterns implements ISerializableObject{ /** * Sets the list of regex strings for this container. * - * @param patterns an arraylist of regex strings + * @param patterns + * an arraylist of regex strings */ public void setPatterns(List patterns) { this.patterns = patterns; } - + /** * Inserts a single string into the list. * - * @param pattern The regex string to insert + * @param pattern + * The regex string to insert */ public void setPattern(String pattern) { this.patterns.add(pattern); } - + /** * Will compile the strings into Pattern objects. * */ - public void compilePatterns(){ - for(String pattern : patterns) { + public void compilePatterns() { + compiledPatterns = new ArrayList(patterns.size()); + for (String pattern : patterns) { try { compiledPatterns.add(Pattern.compile(pattern)); } catch (PatternSyntaxException e) { @@ -121,19 +124,19 @@ public class RequestPatterns implements ISerializableObject{ } } } - + /** - * Takes a string and compares against the patterns in this - * container. The first one that matches breaks the search and - * returns true. + * Takes a string and compares against the patterns in this container. The + * first one that matches breaks the search and returns true. * - * @param header The string to search for + * @param header + * The string to search for * @return a boolean indicating success */ public boolean isDesiredHeader(String header) { boolean isFound = false; - for(Pattern headerPattern : compiledPatterns) { - if(headerPattern.matcher(header).find()) { + for (Pattern headerPattern : compiledPatterns) { + if (headerPattern.matcher(header).find()) { isFound = true; break; } diff --git a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/cluster/quartz/ClusteredQuartzEndpoint.java b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/cluster/quartz/ClusteredQuartzEndpoint.java index 2d852ff443..fd6a04329c 100644 --- a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/cluster/quartz/ClusteredQuartzEndpoint.java +++ b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/cluster/quartz/ClusteredQuartzEndpoint.java @@ -40,6 +40,7 @@ import com.raytheon.uf.edex.database.cluster.ClusterTask; * ------------ ---------- ----------- -------------------------- * Feb 19, 2010 njensen Initial creation * Aug 21, 2013 DR 16521 D. Friedman Ensure endpoint URI is used for cluster entry + * Aug 26, 2013 DR 2272 bkowal Append an optional suffix to the cluster task details * * * @@ -62,7 +63,7 @@ public class ClusteredQuartzEndpoint extends QuartzEndpoint { @Override public void onJobExecute(final JobExecutionContext jobExecutionContext) throws JobExecutionException { - String jName = getEndpointUri(); + String jName = getEndpointUri() + ClusterLockUtils.CLUSTER_SUFFIX; long period = Math.abs(jobExecutionContext.getFireTime().getTime() - jobExecutionContext.getNextFireTime().getTime()) / 2; ClusterTask ct = ClusterLockUtils.lock(TASK, jName, period, false); diff --git a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ClusteredContextManager.java b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ClusteredContextManager.java index dfdfce69b7..910a3d06a4 100644 --- a/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ClusteredContextManager.java +++ b/edexOsgi/com.raytheon.uf.edex.esb.camel/src/com/raytheon/uf/edex/esb/camel/context/ClusteredContextManager.java @@ -50,6 +50,7 @@ import com.raytheon.uf.edex.database.cluster.ClusterTask; * Nov 10, 2010 5050 rjpeter Initial creation * Jul 16, 2012 DR 15073 D. Friedman Stop consumers instead of whole context * May 14, 2013 1989 njensen Camel 2.11 compatibility + * Aug 26, 2013 DR 2272 bkowal Append an optional suffix to the cluster task details * * * @author rjpeter @@ -112,8 +113,9 @@ public class ClusteredContextManager { } public void checkClusteredContexts() { + String suffix = ClusterLockUtils.CLUSTER_SUFFIX; for (CamelContext camelContext : clusteredContextList) { - String contextName = camelContext.getName(); + String contextName = camelContext.getName() + suffix; ClusterTask lock = ClusterLockUtils.lock(taskName, contextName, myName, timeOutMillis, false); boolean activateRoute = false; diff --git a/edexOsgi/com.raytheon.uf.edex.maintenance/src/com/raytheon/uf/edex/maintenance/archive/DataStoreArchiver.java b/edexOsgi/com.raytheon.uf.edex.maintenance/src/com/raytheon/uf/edex/maintenance/archive/DataStoreArchiver.java index d386da9309..ba7ea799da 100644 --- a/edexOsgi/com.raytheon.uf.edex.maintenance/src/com/raytheon/uf/edex/maintenance/archive/DataStoreArchiver.java +++ b/edexOsgi/com.raytheon.uf.edex.maintenance/src/com/raytheon/uf/edex/maintenance/archive/DataStoreArchiver.java @@ -43,6 +43,7 @@ import com.raytheon.uf.edex.maintenance.archive.config.DataArchiveConfig; * ------------ ---------- ----------- -------------------------- * Dec 8, 2011 njensen Initial creation * Jan 14, 2013 1469 bkowal Removed the hdf5 data directory. + * Jul 23, 2013 2216 rferrel Removed the time stamp filter in hdf5 copy. * * * @@ -68,12 +69,8 @@ public class DataStoreArchiver { String outputDir = archiveDir; // + dirs of hdf5 file try { - // data must be older than 30 minutes, and no older than hours - // to keep hours need to lookup plugin and see if compression - // matches, or embed in configuration the compression level on - // archive, but would still need to lookup plugin - ds.copy(outputDir, compression, "lastArchived", 1800000, - conf.getHoursToKeep() * 60000 + 1800000); + // Do not perform time stamp check. + ds.copy(outputDir, compression, null, 0, 0); } catch (StorageException e) { statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage()); } diff --git a/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/DPADecoder-spring.xml b/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/DPADecoder-spring.xml index e5e7eff311..7db114019d 100644 --- a/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/DPADecoder-spring.xml +++ b/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/DPADecoder-spring.xml @@ -18,6 +18,11 @@
+ + + + diff --git a/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/hpeDHRDecoder-spring.xml b/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/hpeDHRDecoder-spring.xml index edd49c3b2d..40cdd388fc 100644 --- a/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/hpeDHRDecoder-spring.xml +++ b/edexOsgi/com.raytheon.uf.edex.ohd/res/spring/hpeDHRDecoder-spring.xml @@ -11,13 +11,18 @@
- + - + + + + + diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/dao/ACARSDao.java b/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/dao/ACARSDao.java index 3e81fd1a43..76e680fc13 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/dao/ACARSDao.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/dao/ACARSDao.java @@ -41,9 +41,10 @@ import com.raytheon.uf.edex.database.DataAccessLayerException; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 21, 2009 1939 jkorman Initial creation + * Jan 21, 2009 1939 jkorman Initial creation * Oct 10, 2012 1261 djohnson Add some generics wildcarding. * Nov 02, 2012 1302 djohnson Add Javadoc. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -201,7 +202,6 @@ public class ACARSDao extends DefaultPluginDao { retData = new ArrayList(); for (Object o : result) { ACARSRecord r = (ACARSRecord) o; - r.setPluginName(pluginName); retData.add(r); } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/decoder/ACARSDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/decoder/ACARSDataAdapter.java index 07def435a6..ba9180c769 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/decoder/ACARSDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.acars/src/com/raytheon/uf/edex/plugin/acars/decoder/ACARSDataAdapter.java @@ -52,7 +52,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 22, 2009 1939 jkorman Initial creation + * Jan 22, 2009 1939 jkorman Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -72,13 +73,13 @@ public class ACARSDataAdapter { private static final int SECOND_OFFSET = 5; - private Log logger = LogFactory.getLog(getClass()); + private final Log logger = LogFactory.getLog(getClass()); // Map detailed flight phase [0-08-009] to flight phase [0-08-004] private static final int[] DETAIL_PHASE_MAP = { 3, 4, 2, 3, 4, 5, 6, 5, 5, 5, 5, 6, 6, 6, 6, 7, }; - private String pluginName; + private final String pluginName; private String traceId = null; @@ -115,7 +116,6 @@ public class ACARSDataAdapter { ACARSRecord record = getDataRecord(parser.next()); if (record != null) { record.setWmoHeader(parser.getWmoHeader().getWmoHeader()); - record.setPluginName(pluginName); try { record.constructDataURI(); @@ -333,14 +333,13 @@ public class ACARSDataAdapter { } } } - if(rpt != null) { - if(rpt.getFlightLevel() == null) { - logger.error(traceId - + " -No aircraft flight level was found"); + if (rpt != null) { + if (rpt.getFlightLevel() == null) { + logger.error(traceId + " -No aircraft flight level was found"); rpt = null; } } - + return rpt; } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.acarssounding/src/com/raytheon/uf/edex/plugin/acarssounding/tools/SoundingBuilder.java b/edexOsgi/com.raytheon.uf.edex.plugin.acarssounding/src/com/raytheon/uf/edex/plugin/acarssounding/tools/SoundingBuilder.java index 29aa287239..525372b6d6 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.acarssounding/src/com/raytheon/uf/edex/plugin/acarssounding/tools/SoundingBuilder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.acarssounding/src/com/raytheon/uf/edex/plugin/acarssounding/tools/SoundingBuilder.java @@ -55,6 +55,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Apr 16, 2009 jkorman Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -64,11 +65,7 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; public class SoundingBuilder { - private Log logger = LogFactory.getLog(getClass()); - - private String pluginName = ACARSSoundingTools.ACARS_SNDG_PLUGIN_NAME; - - private String acarsPluginName = ACARSSoundingTools.ACARS_PLUGIN_NAME; + private final Log logger = LogFactory.getLog(getClass()); File dataDir = null; @@ -237,7 +234,6 @@ public class SoundingBuilder { loc.setElevation(airport.getElevation().intValue()); sounding.setLocation(loc); sounding.setTailNumber(data.getTailNumber()); - sounding.setPluginName(pluginName); try { sounding.constructDataURI(); @@ -288,8 +284,9 @@ public class SoundingBuilder { // If we find an obs with the same time as one in // the sounding, get rid of it. if (layer.getTimeObs().equals(r.getTimeObs())) { - if(logger.isDebugEnabled()) { - logger.debug("Deleting duplicate layer" + r.getDataURI()); + if (logger.isDebugEnabled()) { + logger.debug("Deleting duplicate layer" + + r.getDataURI()); } obs.remove(cRec); incNext = false; @@ -298,8 +295,10 @@ public class SoundingBuilder { // Is the obs time between the current // layers? If so we want to find out if // it needs to be included. - if(ACARSSoundingTools.checkBetween(lastLayer,r,layer)) { - logger.info("Found candidate layer" + r.getDataURI()); + if (ACARSSoundingTools.checkBetween( + lastLayer, r, layer)) { + logger.info("Found candidate layer" + + r.getDataURI()); obs.remove(cRec); incNext = false; } else { @@ -319,7 +318,6 @@ public class SoundingBuilder { } } - /** * Returns a sorted not-null list of layers that are contained in a set of * layers. @@ -395,12 +393,10 @@ public class SoundingBuilder { currTime.add(lastRec); for (int i = 1; i < obsData.size(); i++) { ACARSRecord r = obsData.get(i); - if(r != null) { - r.setPluginName(acarsPluginName); - + if (r != null) { // Do the observations have the same time? - if (ACARSSoundingTools.ACARS_TIME_COMPARATOR - .compare(lastRec, r) != 0) { + if (ACARSSoundingTools.ACARS_TIME_COMPARATOR.compare( + lastRec, r) != 0) { // Different times, so create a new list currTime = new ArrayList(); times.add(currTime); @@ -516,10 +512,4 @@ public class SoundingBuilder { } return retValue; } - - - public static final void main(String[] args) { - - } - } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrascat/src/com/raytheon/uf/edex/plugin/bufrascat/decoder/AScatDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrascat/src/com/raytheon/uf/edex/plugin/bufrascat/decoder/AScatDataAdapter.java index 292a81bb32..c400b70369 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrascat/src/com/raytheon/uf/edex/plugin/bufrascat/decoder/AScatDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrascat/src/com/raytheon/uf/edex/plugin/bufrascat/decoder/AScatDataAdapter.java @@ -48,6 +48,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * Mar 03, 2008 969 jkorman Initial implementation. * May 17, 2013 1869 bsteffen Remove DataURI column from sat plot * types. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -118,7 +119,6 @@ public class AScatDataAdapter extends BUFRPointDataAdapter { obsData = getHeaderData(dataList); if (obsData != null) { // pickup the data. - obsData.setPluginName(getPluginName()); obsData.setWmoHeader(wmoHeader.getWmoHeader()); PointDataContainer container = getContainer(obsData); if (container != null) { diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrhdw/src/com/raytheon/uf/edex/plugin/bufrhdw/decoder/HDWDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrhdw/src/com/raytheon/uf/edex/plugin/bufrhdw/decoder/HDWDataAdapter.java index efb4b7fa05..9d5263b4dc 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrhdw/src/com/raytheon/uf/edex/plugin/bufrhdw/decoder/HDWDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrhdw/src/com/raytheon/uf/edex/plugin/bufrhdw/decoder/HDWDataAdapter.java @@ -49,6 +49,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * Mar 03, 2008 969 jkorman Initial implementation. * May 17, 2013 1869 bsteffen Remove DataURI column from sat plot * types. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -105,7 +106,6 @@ public class HDWDataAdapter extends BUFRPointDataAdapter { if ((obsData = getHeaderData(dataList)) != null) { // Need to set plugin name before getting container! obsData.setWmoHeader(wmoHeader.getWmoHeader()); - obsData.setPluginName(getPluginName()); obsData = getPointData(obsData, dataList); } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrmthdw/src/com/raytheon/uf/edex/plugin/bufrmthdw/decoder/MTHDWDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrmthdw/src/com/raytheon/uf/edex/plugin/bufrmthdw/decoder/MTHDWDataAdapter.java index d8cc115695..eff6e8765e 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrmthdw/src/com/raytheon/uf/edex/plugin/bufrmthdw/decoder/MTHDWDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrmthdw/src/com/raytheon/uf/edex/plugin/bufrmthdw/decoder/MTHDWDataAdapter.java @@ -50,6 +50,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * Jul 26, 2010 jkorman Initial creation * May 17, 2013 1869 bsteffen Remove DataURI column from sat plot * types. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -107,7 +108,6 @@ public class MTHDWDataAdapter extends BUFRPointDataAdapter { if ((obsData = getHeaderData(dataList)) != null) { // Need to set plugin name before getting container! obsData.setWmoHeader(wmoHeader.getWmoHeader()); - obsData.setPluginName(getPluginName()); obsData = getPointData(obsData, dataList); } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrncwf/src/com/raytheon/uf/edex/plugin/bufrncwf/decoder/BUFRncwfDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrncwf/src/com/raytheon/uf/edex/plugin/bufrncwf/decoder/BUFRncwfDataAdapter.java index eebfcdbbc6..c31dd22356 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrncwf/src/com/raytheon/uf/edex/plugin/bufrncwf/decoder/BUFRncwfDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrncwf/src/com/raytheon/uf/edex/plugin/bufrncwf/decoder/BUFRncwfDataAdapter.java @@ -55,6 +55,7 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Aug 17, 2009 jkorman Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -64,281 +65,295 @@ import com.vividsolutions.jts.geom.Coordinate; public class BUFRncwfDataAdapter extends BUFRPointDataAdapter { - // Position within sub-list - private static final int YEAR_POS = 0; - private static final int MONTH_POS = 1; - private static final int DAY_POS = 2; - private static final int HOUR_POS = 3; - private static final int MINUTE_POS = 4; - private static final int SECOND_POS = 5; + // Position within sub-list + private static final int YEAR_POS = 0; - private static final int FEATURES_POS = 6; + private static final int MONTH_POS = 1; - private static final int FEATURE_TIMSIG_POS = 0; - private static final int FEATURE_TIMEPD_POS = 1; - private static final int FEATURE_ATTSIG_POS = 2; - private static final int FEATURE_DIMSIG_POS = 3; - private static final int FEATURE_LAT_POS = 4; - private static final int FEATURE_LON_POS = 5; - private static final int BOUNDARY_ATTSIG_POS = 6; - private static final int BOUNDARY_DIMSIG_POS = 7; - private static final int BOUNDARY_SUBLIST_POS = 8; + private static final int DAY_POS = 2; - private static final int VERTEX_LAT_POS = 0; - private static final int VERTEX_LON_POS = 1; + private static final int HOUR_POS = 3; - private static final int STORM_TOP_POS = 7; - private static final int STORM_DIR_POS = 8; - private static final int STORM_SPD_POS = 9; + private static final int MINUTE_POS = 4; - private static final int INVALID = -9999; + private static final int SECOND_POS = 5; - /** - * - * @param pdd - * @param dao - * @param pluginName - */ - public BUFRncwfDataAdapter(PointDataDescription pdd, - PointDataPluginDao dao, String pluginName) { - super(pdd, dao, pluginName); - } + private static final int FEATURES_POS = 6; - /** - * Not used. - * - * @see com.raytheon.uf.edex.bufrtools.BUFRPointDataAdapter#createData(java.util.Iterator, - * com.raytheon.uf.edex.wmo.message.WMOHeader) - */ - @Override - public BUFRncwf createData(Iterator iterator, - WMOHeader wmoHeader) { - return null; - } + private static final int FEATURE_TIMSIG_POS = 0; - /** - * - * - * - * - * @see com.raytheon.uf.edex.bufrtools.BUFRPointDataAdapter#createDataList(java.util.Iterator, - * com.raytheon.uf.edex.wmo.message.WMOHeader) - */ - @Override - public List createDataList(Iterator iterator, - WMOHeader wmoHeader) { + private static final int FEATURE_TIMEPD_POS = 1; - List reports = new ArrayList(); + private static final int FEATURE_ATTSIG_POS = 2; - BUFRDataDocument dataDoc = iterator.next(); - if (dataDoc != null) { - // Get the primary data list. - List dataList = dataDoc.getList(); - for (IBUFRDataPacket p : dataList) { - if (p != null) { - List sList = getPacketSubList(p); - for (IBUFRDataPacket pp : sList) { - BUFRncwf ncwfReport = getReport(pp); + private static final int FEATURE_DIMSIG_POS = 3; - if (ncwfReport != null) { - ncwfReport.setPluginName(getPluginName()); + private static final int FEATURE_LAT_POS = 4; - PointDataContainer container = getContainer(ncwfReport); - if (container != null) { - PointDataView view = container.append(); + private static final int FEATURE_LON_POS = 5; - long vt = ncwfReport.getDataTime() - .getValidTime().getTimeInMillis(); - view.setLong("validTime", vt); + private static final int BOUNDARY_ATTSIG_POS = 6; - view.setFloat("storm_top", ncwfReport - .getStormTop().floatValue()); - view.setFloat("storm_dir", ncwfReport - .getStormDir().floatValue()); - view.setFloat("storm_speed", ncwfReport - .getStormSpeed().floatValue()); + private static final int BOUNDARY_DIMSIG_POS = 7; - NCWFFeature detect = ncwfReport.getDetection(); - view.setFloat("or_centroid_lat", - (float) detect.getCentroidLatitude()); - view.setFloat("or_centroid_lon", - (float) detect.getCentroidLongitude()); - int pos = 0; - for (Coordinate dc : detect - .getFeatureBoundary()) { - float lat = (float) DecoderTools - .getCoordinateLatitude(dc); - float lon = (float) DecoderTools - .getCoordinateLongitude(dc); - view.setFloat("oalat", lat, pos); - view.setFloat("oalon", lon, pos++); - } - view.setInt("or_num_of_vertices", pos); - NCWFFeature forecast = ncwfReport.getForecast(); - view.setFloat("centroid_lat", - (float) forecast.getCentroidLatitude()); - view.setFloat("centroid_lon", - (float) forecast.getCentroidLongitude()); - pos = 0; - for (Coordinate dc : forecast - .getFeatureBoundary()) { - float lat = (float) DecoderTools - .getCoordinateLatitude(dc); - float lon = (float) DecoderTools - .getCoordinateLongitude(dc); - view.setFloat("alat", lat, pos); - view.setFloat("alon", lon, pos++); - } - view.setInt("num_of_vertices", pos); + private static final int BOUNDARY_SUBLIST_POS = 8; - ncwfReport.setPointDataView(view); - reports.add(ncwfReport); - } - } - } - } - } - } - return reports; - } + private static final int VERTEX_LAT_POS = 0; - @SuppressWarnings("unchecked") - private BUFRncwf getReport(IBUFRDataPacket packet) { - BUFRncwf ncwfReport = null; - if (packet != null) { - List sList = (List) packet - .getValue(); + private static final int VERTEX_LON_POS = 1; - Calendar c = getTimeInfo(sList); - if (c != null) { - ncwfReport = new BUFRncwf(); + private static final int STORM_TOP_POS = 7; - ncwfReport.setDataTime(new DataTime(TimeTools.copy(c))); - List features = getPacketSubList(sList - .get(FEATURES_POS)); + private static final int STORM_DIR_POS = 8; - ncwfReport - .setDetection(getFeatureData(getPacketSubList(features - .get(0)))); - ncwfReport.setForecast(getFeatureData(getPacketSubList(features - .get(1)))); + private static final int STORM_SPD_POS = 9; - double height = getDouble(sList.get(STORM_TOP_POS), INVALID); - if (height >= 0) { - height = Math.floor((height * 3.280839) / 100); - } - ncwfReport.setStormTop(height); - ncwfReport.setStormDir(getDouble(sList.get(STORM_DIR_POS), - INVALID)); - ncwfReport.setStormSpeed(getDouble(sList.get(STORM_SPD_POS), - INVALID)); - if (ncwfReport.getDetection() != null) { - Coordinate centroid = ncwfReport.getDetection() - .getCentroidLocation(); - SurfaceObsLocation loc = new SurfaceObsLocation(); - loc.assignLocation( - DecoderTools.getCoordinateLatitude(centroid), - DecoderTools.getCoordinateLongitude(centroid)); - ncwfReport.setLocation(loc); - } - } - } - return ncwfReport; - } + private static final int INVALID = -9999; - private NCWFFeature getFeatureData(List featureList) { - NCWFFeature feature = null; - if ((featureList != null) && (featureList.size() > 0)) { - // 0 0 08 021 : CODE TABLE Comments: Time significance - // 1 0 04 026 : Second Comments: Time period or displacement - // 2 0 08 005 : Comments: Meteorological attribute significance - // 3 0 08 007 : Comments: Dimensional significance - // 4 0 05 001 : Comments: Latitude (high accuracy) - // 5 0 06 001 : Comments: Longitude (high accuracy) - // 6 0 08 005 : Comments: Meteorological attribute significance - // 7 0 08 007 : Comments: Dimensional significance - // 8 1 01 000 : Comments: Boundary-Sublist + /** + * + * @param pdd + * @param dao + * @param pluginName + */ + public BUFRncwfDataAdapter(PointDataDescription pdd, + PointDataPluginDao dao, String pluginName) { + super(pdd, dao, pluginName); + } - double lat = getDouble(featureList.get(FEATURE_LAT_POS), INVALID); - double lon = getDouble(featureList.get(FEATURE_LON_POS), INVALID); - if ((lat != INVALID) && (lon != INVALID)) { - feature = new NCWFFeature(lat, lon); + /** + * Not used. + * + * @see com.raytheon.uf.edex.bufrtools.BUFRPointDataAdapter#createData(java.util.Iterator, + * com.raytheon.uf.edex.wmo.message.WMOHeader) + */ + @Override + public BUFRncwf createData(Iterator iterator, + WMOHeader wmoHeader) { + return null; + } - IBUFRDataPacket p1 = featureList.get(BOUNDARY_SUBLIST_POS); - feature.setFeatureBoundary(getVertices(getPacketSubList(p1))); - } - } - return feature; - } + /** + * + * + * + * + * @see com.raytheon.uf.edex.bufrtools.BUFRPointDataAdapter#createDataList(java.util.Iterator, + * com.raytheon.uf.edex.wmo.message.WMOHeader) + */ + @Override + public List createDataList(Iterator iterator, + WMOHeader wmoHeader) { - /** - * - * @param vertexList - * @return - */ - private List getVertices(List vertexList) { - List vertices = new ArrayList(); - if (vertexList != null) { - for (IBUFRDataPacket p : vertexList) { - List vertex = getPacketSubList(p); - double lat = getDouble(vertex.get(VERTEX_LAT_POS), INVALID); - double lon = getDouble(vertex.get(VERTEX_LON_POS), INVALID); - if ((lat != INVALID) && (lon != INVALID)) { - vertices.add(DecoderTools.createCoordinate(lat, lon)); - } - } - } - return vertices; - } + List reports = new ArrayList(); - /** - * - * @param dataList - * @return - */ - private Calendar getTimeInfo(List dataList) { + BUFRDataDocument dataDoc = iterator.next(); + if (dataDoc != null) { + // Get the primary data list. + List dataList = dataDoc.getList(); + for (IBUFRDataPacket p : dataList) { + if (p != null) { + List sList = getPacketSubList(p); + for (IBUFRDataPacket pp : sList) { + BUFRncwf ncwfReport = getReport(pp); - int year = getInt(dataList.get(YEAR_POS), IDecoderConstants.VAL_MISSING); - int month = getInt(dataList.get(MONTH_POS), - IDecoderConstants.VAL_MISSING); - int day = getInt(dataList.get(DAY_POS), IDecoderConstants.VAL_MISSING); - int hour = getInt(dataList.get(HOUR_POS), IDecoderConstants.VAL_MISSING); - int minute = getInt(dataList.get(MINUTE_POS), - IDecoderConstants.VAL_MISSING); - int second = getInt(dataList.get(SECOND_POS), - IDecoderConstants.VAL_MISSING); + if (ncwfReport != null) { + PointDataContainer container = getContainer(ncwfReport); + if (container != null) { + PointDataView view = container.append(); - Calendar baseTime = null; + long vt = ncwfReport.getDataTime() + .getValidTime().getTimeInMillis(); + view.setLong("validTime", vt); - // Ensure that we have all of the time info and create the - // date-time and datatime info. - if ((year > 0) && (month > 0) && (day > 0) && (hour >= 0) - && (minute >= 0) && (second >= 0)) { - baseTime = TimeTools.getBaseCalendar(year, month, day); - baseTime.set(Calendar.HOUR_OF_DAY, hour); - baseTime.set(Calendar.MINUTE, minute); - baseTime.set(Calendar.SECOND, second); - baseTime.set(Calendar.MILLISECOND, 0); - } - return baseTime; - } + view.setFloat("storm_top", ncwfReport + .getStormTop().floatValue()); + view.setFloat("storm_dir", ncwfReport + .getStormDir().floatValue()); + view.setFloat("storm_speed", ncwfReport + .getStormSpeed().floatValue()); - /** - * - * @param packet - * @return - */ - @SuppressWarnings("unchecked") - private static List getPacketSubList(IBUFRDataPacket packet) { - List list = null; - if (packet instanceof BUFRSublistPacket) { - if (RepSubList.getPacketType().equals(packet.getUnits())) { - list = (List) packet.getValue(); - } else if (SubSetList.getPacketType().equals(packet.getUnits())) { - list = (List) packet.getValue(); - } - } - return list; - } + NCWFFeature detect = ncwfReport.getDetection(); + view.setFloat("or_centroid_lat", + (float) detect.getCentroidLatitude()); + view.setFloat("or_centroid_lon", + (float) detect.getCentroidLongitude()); + int pos = 0; + for (Coordinate dc : detect + .getFeatureBoundary()) { + float lat = (float) DecoderTools + .getCoordinateLatitude(dc); + float lon = (float) DecoderTools + .getCoordinateLongitude(dc); + view.setFloat("oalat", lat, pos); + view.setFloat("oalon", lon, pos++); + } + view.setInt("or_num_of_vertices", pos); + NCWFFeature forecast = ncwfReport.getForecast(); + view.setFloat("centroid_lat", + (float) forecast.getCentroidLatitude()); + view.setFloat("centroid_lon", + (float) forecast.getCentroidLongitude()); + pos = 0; + for (Coordinate dc : forecast + .getFeatureBoundary()) { + float lat = (float) DecoderTools + .getCoordinateLatitude(dc); + float lon = (float) DecoderTools + .getCoordinateLongitude(dc); + view.setFloat("alat", lat, pos); + view.setFloat("alon", lon, pos++); + } + view.setInt("num_of_vertices", pos); + + ncwfReport.setPointDataView(view); + reports.add(ncwfReport); + } + } + } + } + } + } + return reports; + } + + @SuppressWarnings("unchecked") + private BUFRncwf getReport(IBUFRDataPacket packet) { + BUFRncwf ncwfReport = null; + if (packet != null) { + List sList = (List) packet + .getValue(); + + Calendar c = getTimeInfo(sList); + if (c != null) { + ncwfReport = new BUFRncwf(); + + ncwfReport.setDataTime(new DataTime(TimeTools.copy(c))); + List features = getPacketSubList(sList + .get(FEATURES_POS)); + + ncwfReport + .setDetection(getFeatureData(getPacketSubList(features + .get(0)))); + ncwfReport.setForecast(getFeatureData(getPacketSubList(features + .get(1)))); + + double height = getDouble(sList.get(STORM_TOP_POS), INVALID); + if (height >= 0) { + height = Math.floor((height * 3.280839) / 100); + } + ncwfReport.setStormTop(height); + ncwfReport.setStormDir(getDouble(sList.get(STORM_DIR_POS), + INVALID)); + ncwfReport.setStormSpeed(getDouble(sList.get(STORM_SPD_POS), + INVALID)); + if (ncwfReport.getDetection() != null) { + Coordinate centroid = ncwfReport.getDetection() + .getCentroidLocation(); + SurfaceObsLocation loc = new SurfaceObsLocation(); + loc.assignLocation( + DecoderTools.getCoordinateLatitude(centroid), + DecoderTools.getCoordinateLongitude(centroid)); + ncwfReport.setLocation(loc); + } + } + } + return ncwfReport; + } + + private NCWFFeature getFeatureData(List featureList) { + NCWFFeature feature = null; + if ((featureList != null) && (featureList.size() > 0)) { + // 0 0 08 021 : CODE TABLE Comments: Time significance + // 1 0 04 026 : Second Comments: Time period or displacement + // 2 0 08 005 : Comments: Meteorological attribute significance + // 3 0 08 007 : Comments: Dimensional significance + // 4 0 05 001 : Comments: Latitude (high accuracy) + // 5 0 06 001 : Comments: Longitude (high accuracy) + // 6 0 08 005 : Comments: Meteorological attribute significance + // 7 0 08 007 : Comments: Dimensional significance + // 8 1 01 000 : Comments: Boundary-Sublist + + double lat = getDouble(featureList.get(FEATURE_LAT_POS), INVALID); + double lon = getDouble(featureList.get(FEATURE_LON_POS), INVALID); + if ((lat != INVALID) && (lon != INVALID)) { + feature = new NCWFFeature(lat, lon); + + IBUFRDataPacket p1 = featureList.get(BOUNDARY_SUBLIST_POS); + feature.setFeatureBoundary(getVertices(getPacketSubList(p1))); + } + } + return feature; + } + + /** + * + * @param vertexList + * @return + */ + private List getVertices(List vertexList) { + List vertices = new ArrayList(); + if (vertexList != null) { + for (IBUFRDataPacket p : vertexList) { + List vertex = getPacketSubList(p); + double lat = getDouble(vertex.get(VERTEX_LAT_POS), INVALID); + double lon = getDouble(vertex.get(VERTEX_LON_POS), INVALID); + if ((lat != INVALID) && (lon != INVALID)) { + vertices.add(DecoderTools.createCoordinate(lat, lon)); + } + } + } + return vertices; + } + + /** + * + * @param dataList + * @return + */ + private Calendar getTimeInfo(List dataList) { + + int year = getInt(dataList.get(YEAR_POS), IDecoderConstants.VAL_MISSING); + int month = getInt(dataList.get(MONTH_POS), + IDecoderConstants.VAL_MISSING); + int day = getInt(dataList.get(DAY_POS), IDecoderConstants.VAL_MISSING); + int hour = getInt(dataList.get(HOUR_POS), IDecoderConstants.VAL_MISSING); + int minute = getInt(dataList.get(MINUTE_POS), + IDecoderConstants.VAL_MISSING); + int second = getInt(dataList.get(SECOND_POS), + IDecoderConstants.VAL_MISSING); + + Calendar baseTime = null; + + // Ensure that we have all of the time info and create the + // date-time and datatime info. + if ((year > 0) && (month > 0) && (day > 0) && (hour >= 0) + && (minute >= 0) && (second >= 0)) { + baseTime = TimeTools.getBaseCalendar(year, month, day); + baseTime.set(Calendar.HOUR_OF_DAY, hour); + baseTime.set(Calendar.MINUTE, minute); + baseTime.set(Calendar.SECOND, second); + baseTime.set(Calendar.MILLISECOND, 0); + } + return baseTime; + } + + /** + * + * @param packet + * @return + */ + @SuppressWarnings("unchecked") + private static List getPacketSubList(IBUFRDataPacket packet) { + List list = null; + if (packet instanceof BUFRSublistPacket) { + if (RepSubList.getPacketType().equals(packet.getUnits())) { + list = (List) packet.getValue(); + } else if (SubSetList.getPacketType().equals(packet.getUnits())) { + list = (List) packet.getValue(); + } + } + return list; + } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrquikscat/src/com/raytheon/uf/edex/plugin/bufrquikscat/decoder/QUIKScatDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrquikscat/src/com/raytheon/uf/edex/plugin/bufrquikscat/decoder/QUIKScatDataAdapter.java index e7604a748a..ca115d97f4 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrquikscat/src/com/raytheon/uf/edex/plugin/bufrquikscat/decoder/QUIKScatDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrquikscat/src/com/raytheon/uf/edex/plugin/bufrquikscat/decoder/QUIKScatDataAdapter.java @@ -45,7 +45,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080303 969 jkorman Initial implementation. + * Mar 03, 2008 969 jkorman Initial implementation. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -55,21 +56,29 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; public class QUIKScatDataAdapter extends BUFRPointDataAdapter { // Note inverted logic private static final int RAIN_FLAG_NOT_USABLE = 0x00001000; - private static final int RAIN_FLAG = 0x00002000; - - private static final int RAIN_DATA_MASK = RAIN_FLAG_NOT_USABLE | RAIN_FLAG; - - private static final int RAIN_NOT_PRESENT = 0x00000000; - private static final int RAIN_PRESENT = RAIN_FLAG; - - private static final int YEAR_POS = 2; - private static final int MONTH_POS = 3; - private static final int DAY_POS = 4; - private static final int HOUR_POS = 5; + + private static final int RAIN_FLAG = 0x00002000; + + private static final int RAIN_DATA_MASK = RAIN_FLAG_NOT_USABLE | RAIN_FLAG; + + private static final int RAIN_NOT_PRESENT = 0x00000000; + + private static final int RAIN_PRESENT = RAIN_FLAG; + + private static final int YEAR_POS = 2; + + private static final int MONTH_POS = 3; + + private static final int DAY_POS = 4; + + private static final int HOUR_POS = 5; + private static final int MINUTE_POS = 6; + private static final int SECOND_POS = 7; private static final int SAT_ID_POS = 0; + private static final int ORBIT_N_POS = 1; /** @@ -78,8 +87,9 @@ public class QUIKScatDataAdapter extends BUFRPointDataAdapter { * @param dao * @param pluginName */ - public QUIKScatDataAdapter(PointDataDescription pdd, PointDataPluginDao dao, String pluginName) { - super(pdd,dao,pluginName); + public QUIKScatDataAdapter(PointDataDescription pdd, + PointDataPluginDao dao, String pluginName) { + super(pdd, dao, pluginName); } /** @@ -93,53 +103,56 @@ public class QUIKScatDataAdapter extends BUFRPointDataAdapter { * @return A ProfilerObs instance, or null in the event of an error. */ @Override - public QUIKScatObs createData( - Iterator iterator, WMOHeader wmoHeader) { + public QUIKScatObs createData(Iterator iterator, + WMOHeader wmoHeader) { QUIKScatObs obsData = null; BUFRDataDocument dataDoc = iterator.next(); - + if (dataDoc != null) { // Get the primary data list. List dataList = dataDoc.getList(); - + obsData = getHeaderData(dataList); - if(obsData != null) { + if (obsData != null) { // pickup the data. - obsData.setPluginName(getPluginName()); obsData.setWmoHeader(wmoHeader.getWmoHeader()); PointDataContainer container = getContainer(obsData); - if(container != null) { - + if (container != null) { + logger.debug("Creating obs data "); - PointDataView view = container.append(); + PointDataView view = container.append(); // view.setInt("satelliteID", obsData.getSatId()); view.setInt("orbitNumber", obsData.getOrbitNumber()); - view.setLong("validTime",obsData.getTimeObs().getTimeInMillis()); - - double lat = getDouble(dataList.get(8), IDecoderConstants.VAL_MISSING); - double lon = getDouble(dataList.get(9), IDecoderConstants.VAL_MISSING); - + view.setLong("validTime", obsData.getTimeObs() + .getTimeInMillis()); + + double lat = getDouble(dataList.get(8), + IDecoderConstants.VAL_MISSING); + double lon = getDouble(dataList.get(9), + IDecoderConstants.VAL_MISSING); + SurfaceObsLocation location = new SurfaceObsLocation(); - location.assignLocation(lat,lon); + location.assignLocation(lat, lon); obsData.setLocation(location); - view.setFloat("latitude",(float) lat); - view.setFloat("longitude",(float) lon); - - int rainFlag = getInt(dataList.get(10),IDecoderConstants.VAL_MISSING); - switch((rainFlag & RAIN_DATA_MASK)) { - case RAIN_NOT_PRESENT : { + view.setFloat("latitude", (float) lat); + view.setFloat("longitude", (float) lon); + + int rainFlag = getInt(dataList.get(10), + IDecoderConstants.VAL_MISSING); + switch ((rainFlag & RAIN_DATA_MASK)) { + case RAIN_NOT_PRESENT: { rainFlag = 0; break; } - case RAIN_PRESENT : { + case RAIN_PRESENT: { rainFlag = 1; break; } - default : { // + default: { // rainFlag = -9999; break; } @@ -147,22 +160,23 @@ public class QUIKScatDataAdapter extends BUFRPointDataAdapter { view.setInt("rainIndex", rainFlag); setViewData("probRain", view, dataList.get(11)); // Wind data - float val = (float) getDouble(dataList.get(12), PDV_FILL_DBL); - if(val < 0) { + float val = (float) getDouble(dataList.get(12), + PDV_FILL_DBL); + if (val < 0) { val = (float) PDV_FILL_DBL; } view.setFloat("windSpd", val); val = (float) getDouble(dataList.get(13), PDV_FILL_DBL); - if(val < 0) { + if (val < 0) { val = (float) PDV_FILL_DBL; } view.setFloat("windDir", val); - + obsData.setPointDataView(view); } } } - + return obsData; } @@ -176,7 +190,7 @@ public class QUIKScatDataAdapter extends BUFRPointDataAdapter { return obsList; } - + /** * * @param dataList @@ -184,21 +198,24 @@ public class QUIKScatDataAdapter extends BUFRPointDataAdapter { */ private QUIKScatObs getHeaderData(List dataList) { QUIKScatObs obsData = null; - + Calendar obsTime = getTimeInfo(dataList); - if(obsTime != null) { + if (obsTime != null) { obsData = new QUIKScatObs(); obsData.setTimeObs(obsTime); obsData.setDataTime(new DataTime(TimeTools.copy(obsTime))); - int satId = getInt(dataList.get(SAT_ID_POS), IDecoderConstants.VAL_MISSING); - int orbNo = getInt(dataList.get(ORBIT_N_POS), IDecoderConstants.VAL_MISSING); - - logger.debug("getHeaderData(" + satId + "," + orbNo + ")" + obsData.getDataTime()); - - if(satId != IDecoderConstants.VAL_MISSING) { + int satId = getInt(dataList.get(SAT_ID_POS), + IDecoderConstants.VAL_MISSING); + int orbNo = getInt(dataList.get(ORBIT_N_POS), + IDecoderConstants.VAL_MISSING); + + logger.debug("getHeaderData(" + satId + "," + orbNo + ")" + + obsData.getDataTime()); + + if (satId != IDecoderConstants.VAL_MISSING) { obsData.setSatId(satId); - if(orbNo != IDecoderConstants.VAL_MISSING) { + if (orbNo != IDecoderConstants.VAL_MISSING) { obsData.setOrbitNumber(orbNo); } else { obsData = null; @@ -209,26 +226,30 @@ public class QUIKScatDataAdapter extends BUFRPointDataAdapter { } return obsData; } - + /** * * @param dataList * @return */ private Calendar getTimeInfo(List dataList) { - - int year = getInt(dataList.get(YEAR_POS),IDecoderConstants.VAL_MISSING); - int month = getInt(dataList.get(MONTH_POS),IDecoderConstants.VAL_MISSING); - int day = getInt(dataList.get(DAY_POS),IDecoderConstants.VAL_MISSING); - int hour = getInt(dataList.get(HOUR_POS),IDecoderConstants.VAL_MISSING); - int minute = getInt(dataList.get(MINUTE_POS),IDecoderConstants.VAL_MISSING); - int second = getInt(dataList.get(SECOND_POS),IDecoderConstants.VAL_MISSING); - + + int year = getInt(dataList.get(YEAR_POS), IDecoderConstants.VAL_MISSING); + int month = getInt(dataList.get(MONTH_POS), + IDecoderConstants.VAL_MISSING); + int day = getInt(dataList.get(DAY_POS), IDecoderConstants.VAL_MISSING); + int hour = getInt(dataList.get(HOUR_POS), IDecoderConstants.VAL_MISSING); + int minute = getInt(dataList.get(MINUTE_POS), + IDecoderConstants.VAL_MISSING); + int second = getInt(dataList.get(SECOND_POS), + IDecoderConstants.VAL_MISSING); + Calendar baseTime = null; - + // Ensure that we have all of the time info and create the // date-time and datatime info. - if ((year > 0) && (month > 0) && (day > 0) && (hour >= 0)&& (minute >= 0)&& (second >= 0)) { + if ((year > 0) && (month > 0) && (day > 0) && (hour >= 0) + && (minute >= 0) && (second >= 0)) { baseTime = TimeTools.getBaseCalendar(year, month, day); baseTime.set(Calendar.HOUR_OF_DAY, hour); baseTime.set(Calendar.MINUTE, minute); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrsigwx/src/com/raytheon/uf/edex/plugin/bufrsigwx/SigWxDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrsigwx/src/com/raytheon/uf/edex/plugin/bufrsigwx/SigWxDecoder.java index 067a7f2ecd..4910740310 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrsigwx/src/com/raytheon/uf/edex/plugin/bufrsigwx/SigWxDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrsigwx/src/com/raytheon/uf/edex/plugin/bufrsigwx/SigWxDecoder.java @@ -42,7 +42,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 21, 2009 1939 jkorman Initial creation + * Jan 21, 2009 1939 jkorman Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -52,7 +53,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; public class SigWxDecoder extends AbstractBUFRDecoder { - private PointDataDescription pdd = null; + private final PointDataDescription pdd = null; private SigWxDataDao dao; @@ -69,21 +70,23 @@ public class SigWxDecoder extends AbstractBUFRDecoder { * */ @Override - public List decodeData(List document, String traceId, WMOHeader wmoHeader) { + public List decodeData(List document, + String traceId, WMOHeader wmoHeader) { - List decodedData = null; - if(document != null) { + List decodedData = null; + if (document != null) { decodedData = new ArrayList(); - SigWxDataAdapter adapter = SigWxDataAdapter.getAdapter(pdd, dao, traceId, wmoHeader); + SigWxDataAdapter adapter = SigWxDataAdapter.getAdapter(pdd, dao, + traceId, wmoHeader); logger.debug(traceId + " - Document size = " + document.size()); Iterator iterator = document.iterator(); while (iterator.hasNext()) { logger.debug(traceId + " - Entering createDataList"); - List sigwx = adapter.createDataList(iterator, wmoHeader); + List sigwx = adapter.createDataList(iterator, + wmoHeader); if (sigwx != null) { - for(SigWxData d : sigwx) { - d.setPluginName(getPluginName()); + for (SigWxData d : sigwx) { d.setTraceId(traceId); try { d.constructDataURI(); @@ -100,23 +103,23 @@ public class SigWxDecoder extends AbstractBUFRDecoder { } return decodedData; } - + /** * * @param recreate */ @Override protected void createDAO(boolean recreate) { - if(recreate) { + if (recreate) { dao = null; } try { dao = new SigWxDataDao(pluginName); } catch (Exception e) { - logger.error("SigWxDataDao creation failed",e); + logger.error("SigWxDataDao creation failed", e); logger.error("Plugin set to failSafe mode"); setFailSafe(true); } } - + } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrsigwx/src/com/raytheon/uf/edex/plugin/bufrsigwx/decoder/SigWxDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrsigwx/src/com/raytheon/uf/edex/plugin/bufrsigwx/decoder/SigWxDataAdapter.java index 1eff18adc7..ed45dd0fe7 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrsigwx/src/com/raytheon/uf/edex/plugin/bufrsigwx/decoder/SigWxDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrsigwx/src/com/raytheon/uf/edex/plugin/bufrsigwx/decoder/SigWxDataAdapter.java @@ -19,7 +19,6 @@ **/ package com.raytheon.uf.edex.plugin.bufrsigwx.decoder; - import static com.raytheon.uf.edex.decodertools.bufr.packets.DataPacketTypes.RepSubList; import static com.raytheon.uf.edex.decodertools.bufr.packets.DataPacketTypes.SubSetList; @@ -52,8 +51,9 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20080303 969 jkorman Initial implementation. - * 20090706 2538 jsanchez Added latitude,longitude to point data. + * Mar 03, 2008 969 jkorman Initial implementation. + * Jul 06, 2009 2538 jsanchez Added latitude,longitude to point data. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -64,30 +64,37 @@ public abstract class SigWxDataAdapter extends BUFRPointDataAdapter { private static Log logger = LogFactory.getLog(SigWxDataAdapter.class); - private static final int YEAR_POS = 0; - private static final int MONTH_POS = 1; - private static final int DAY_POS = 2; - private static final int HOUR_POS = 3; + private static final int YEAR_POS = 0; + + private static final int MONTH_POS = 1; + + private static final int DAY_POS = 2; + + private static final int HOUR_POS = 3; + private static final int MINUTE_POS = 4; private static final int TIME_SIG_FCST = 4; - + private static final int BASE_HGT_POS = 13; + private static final int TOP_HGT_POS = 14; - + private static final int MID_LYR_BASE = 3050; + private static final int HI_LYR_TOP = 19200; - + static final int MISSING = PointDataDescription.FILL_VALUE_INT; - + /** * * @param pdd * @param dao * @param pluginName */ - public SigWxDataAdapter(PointDataDescription pdd, PointDataPluginDao dao, String pluginName) { - super(pdd,dao,pluginName); + public SigWxDataAdapter(PointDataDescription pdd, + PointDataPluginDao dao, String pluginName) { + super(pdd, dao, pluginName); } /** @@ -101,8 +108,8 @@ public abstract class SigWxDataAdapter extends BUFRPointDataAdapter { * @return A ProfilerObs instance, or null in the event of an error. */ @Override - public SigWxData createData( - Iterator iterator, WMOHeader wmoHeader) { + public SigWxData createData(Iterator iterator, + WMOHeader wmoHeader) { return null; } @@ -111,8 +118,9 @@ public abstract class SigWxDataAdapter extends BUFRPointDataAdapter { * @param iterator * @param wmoHeader */ - public List createDataList( - Iterator iterator, WMOHeader wmoHeader) { + @Override + public List createDataList(Iterator iterator, + WMOHeader wmoHeader) { List tropList = null; @@ -125,9 +133,8 @@ public abstract class SigWxDataAdapter extends BUFRPointDataAdapter { // Extract the header data. sigWx = getHeaderData(dataList); - + if (sigWx != null) { - sigWx.setPluginName(getPluginName()); sigWx.setWmoHeader(wmoHeader.getWmoHeader()); sigWx.setWxType(getType()); // Go collect the data specific to the data being decoded. @@ -136,7 +143,7 @@ public abstract class SigWxDataAdapter extends BUFRPointDataAdapter { } return tropList; } - + /** * * @param dataList @@ -149,7 +156,7 @@ public abstract class SigWxDataAdapter extends BUFRPointDataAdapter { if (TIME_SIG_FCST == timeSig) { Calendar baseTime = getTimeInfo(dataList, 2); Calendar fcstTime = getTimeInfo(dataList, 8); - if ((fcstTime != null)&&(baseTime != null)) { + if ((fcstTime != null) && (baseTime != null)) { sigWx = new SigWxData(); int fcstSeconds = (int) (fcstTime.getTimeInMillis() - baseTime @@ -179,25 +186,26 @@ public abstract class SigWxDataAdapter extends BUFRPointDataAdapter { } return sigWx; } - + /** * * @param dataList * @return */ private Calendar getTimeInfo(List dataList, int basePos) { - - int year = getInt(dataList.get(basePos + YEAR_POS),MISSING); - int month = getInt(dataList.get(basePos + MONTH_POS),MISSING); - int day = getInt(dataList.get(basePos + DAY_POS),MISSING); - int hour = getInt(dataList.get(basePos + HOUR_POS),MISSING); - int minute = getInt(dataList.get(basePos + MINUTE_POS),MISSING); - + + int year = getInt(dataList.get(basePos + YEAR_POS), MISSING); + int month = getInt(dataList.get(basePos + MONTH_POS), MISSING); + int day = getInt(dataList.get(basePos + DAY_POS), MISSING); + int hour = getInt(dataList.get(basePos + HOUR_POS), MISSING); + int minute = getInt(dataList.get(basePos + MINUTE_POS), MISSING); + Calendar baseTime = null; - + // Ensure that we have all of the time info and create the // date-time and datatime info. - if ((year > 0) && (month > 0) && (day > 0) && (hour >= 0)&& (minute >= 0)) { + if ((year > 0) && (month > 0) && (day > 0) && (hour >= 0) + && (minute >= 0)) { baseTime = TimeTools.getBaseCalendar(year, month, day); baseTime.set(Calendar.HOUR_OF_DAY, hour); baseTime.set(Calendar.MINUTE, minute); @@ -206,21 +214,21 @@ public abstract class SigWxDataAdapter extends BUFRPointDataAdapter { } return baseTime; } - + /** * * @param sigWx * @param index */ - abstract List getSigWxData(SigWxData sigWx, List dataList); - + abstract List getSigWxData(SigWxData sigWx, + List dataList); + /** * * @return */ abstract SigWxType getType(); - abstract void setType(SigWxType type); /** @@ -231,7 +239,7 @@ public abstract class SigWxDataAdapter extends BUFRPointDataAdapter { @SuppressWarnings("unchecked") static List getPacketSubList(IBUFRDataPacket packet) { List list = null; - if(packet instanceof BUFRSublistPacket) { + if (packet instanceof BUFRSublistPacket) { if (RepSubList.getPacketType().equals(packet.getUnits())) { list = (List) packet.getValue(); } else if (SubSetList.getPacketType().equals(packet.getUnits())) { @@ -302,23 +310,26 @@ public abstract class SigWxDataAdapter extends BUFRPointDataAdapter { adapter.setType(SigWxType.VTS); } else { adapter = new SigWxNullData(pdd, dao, pluginName); - logger.error("No decoder adapter for file " + wmoHeader.getWmoHeader()); + logger.error("No decoder adapter for file " + + wmoHeader.getWmoHeader()); } return adapter; } private static PointDataDescription loadPDD(String pddFileName) { - + PointDataDescription pdd = null; try { - pdd = PointDataDescription.fromStream(SigWxDataAdapter.class.getResourceAsStream(pddFileName)); + pdd = PointDataDescription.fromStream(SigWxDataAdapter.class + .getResourceAsStream(pddFileName)); logger.info(pddFileName + "PointDataDescription loaded"); - - } catch(Exception e) { - logger.error("PointDataDescription failed loading " + pddFileName,e); + + } catch (Exception e) { + logger.error("PointDataDescription failed loading " + pddFileName, + e); } - + return pdd; } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.bufrssmi/src/com/raytheon/uf/edex/plugin/bufrssmi/decoder/SSMIDataAdapter.java b/edexOsgi/com.raytheon.uf.edex.plugin.bufrssmi/src/com/raytheon/uf/edex/plugin/bufrssmi/decoder/SSMIDataAdapter.java index 3ed5ec1706..39a7fb75c8 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.bufrssmi/src/com/raytheon/uf/edex/plugin/bufrssmi/decoder/SSMIDataAdapter.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.bufrssmi/src/com/raytheon/uf/edex/plugin/bufrssmi/decoder/SSMIDataAdapter.java @@ -53,6 +53,7 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * Jul 06, 2009 2538 jsanchez Added latitude,longitude to point data. * May 17, 2013 1869 bsteffen Remove DataURI column from sat plot * types. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -114,7 +115,6 @@ public class SSMIDataAdapter extends BUFRPointDataAdapter { if (obsData != null) { // Need to set plugin name before getting container! - obsData.setPluginName(getPluginName()); PointDataContainer container = getContainer(obsData); if (container != null) { PointDataView view = container.append(); @@ -138,6 +138,7 @@ public class SSMIDataAdapter extends BUFRPointDataAdapter { /** * */ + @Override @SuppressWarnings("unchecked") public List createDataList( Iterator iterator, WMOHeader wmoHeader) { @@ -182,7 +183,6 @@ public class SSMIDataAdapter extends BUFRPointDataAdapter { // Make a copy for each data point. SSMIScanData pointData = obsData.copyObs(); // Need to set plugin name before getting container! - pointData.setPluginName(getPluginName()); pointData = getPointData(pointData, p, it.next()); if (pointData != null) { obsList.add(pointData); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.cwa/src/com/raytheon/uf/edex/plugin/cwa/decoder/CWAParser.java b/edexOsgi/com.raytheon.uf.edex.plugin.cwa/src/com/raytheon/uf/edex/plugin/cwa/decoder/CWAParser.java index 3d56c3ad2c..e0c25617ec 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.cwa/src/com/raytheon/uf/edex/plugin/cwa/decoder/CWAParser.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.cwa/src/com/raytheon/uf/edex/plugin/cwa/decoder/CWAParser.java @@ -60,10 +60,10 @@ import com.vividsolutions.jts.geom.Coordinate; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Feb 01, 2010 jsanchez Initial creation - * Apr 18, 2012 #473 dgilling Modify parser to set - * DataTime based on ingest - * file name. + * Feb 01, 2010 jsanchez Initial creation + * Apr 18, 2012 473 dgilling Modify parser to set DataTime based on + * ingest file name. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -72,7 +72,7 @@ import com.vividsolutions.jts.geom.Coordinate; */ public class CWAParser { /** The logger */ - private Log logger = LogFactory.getLog(getClass()); + private final Log logger = LogFactory.getLog(getClass()); private final PointDataDescription pointDataDescription; @@ -80,11 +80,11 @@ public class CWAParser { private final CWARecordDao cwaDao; - private Map containerMap; + private final Map containerMap; private final GeodeticCalculator gc = new GeodeticCalculator(); - private String pluginName; + private final String pluginName; private String eventId; @@ -98,7 +98,7 @@ public class CWAParser { private CWADimension dimension; - private List coordinates = new ArrayList(); + private final List coordinates = new ArrayList(); boolean isVicinity; @@ -108,7 +108,7 @@ public class CWAParser { int currentReport = -1; - private HashMap URI_MAP = new HashMap(); + private final HashMap URI_MAP = new HashMap(); private static HashMap dirToDeg = new HashMap(); @@ -258,7 +258,8 @@ public class CWAParser { String s = iRpt.getReportLine(); switch (iRpt.getLineType()) { case ISSUANCE: - if (eventId != null && dimension != CWADimension.CANCELED) { + if ((eventId != null) + && (dimension != CWADimension.CANCELED)) { reports.add(getRecord()); } clearData(); @@ -286,7 +287,8 @@ public class CWAParser { } break; case END: - if (eventId != null && dimension != CWADimension.CANCELED) { + if ((eventId != null) + && (dimension != CWADimension.CANCELED)) { reports.add(getRecord()); } clearData(); @@ -322,7 +324,7 @@ public class CWAParser { private void parseIssuanceInfo(String issuanceInfo) { String[] parts = issuanceInfo.split(" "); - if (parts != null && parts[0] != null) { + if ((parts != null) && (parts[0] != null)) { eventId = parts[0]; } @@ -412,7 +414,7 @@ public class CWAParser { } dimension = CWADimension.AREA; distance = 0; - } else if (tok.length() == 0 || tok.equals("")) { + } else if ((tok.length() == 0) || tok.equals("")) { getMoreCoords = true; } else { logger.error("Bad location. '" + tok @@ -444,7 +446,7 @@ public class CWAParser { } } - if (!found && size == 0 && (isVicinity || coordinates.size() > 0)) { + if (!found && (size == 0) && (isVicinity || (coordinates.size() > 0))) { size = 2000; // 2 km = 2000 m } } @@ -474,7 +476,6 @@ public class CWAParser { record.setEventId(eventId); record.setDimension(dimension); record.setMessageData(text); - record.setPluginName(pluginName); // TimeRange tr = new TimeRange( // startTime.getRefTimeAsCalendar(), // endTime.getRefTimeAsCalendar()); @@ -485,7 +486,7 @@ public class CWAParser { Coordinate[] coord = null; if (coordinates.size() == 1) { coord = Utility.makeArea(coordinates.get(0), size); - } else if (coordinates.size() == 2 && size > 0) { + } else if ((coordinates.size() == 2) && (size > 0)) { coord = Utility.makeArea( coordinates.toArray(new Coordinate[coordinates.size()]), size); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.cwat/src/com/raytheon/uf/edex/plugin/cwat/CWATGenerator.java b/edexOsgi/com.raytheon.uf.edex.plugin.cwat/src/com/raytheon/uf/edex/plugin/cwat/CWATGenerator.java index 6705caa142..07b24b5946 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.cwat/src/com/raytheon/uf/edex/plugin/cwat/CWATGenerator.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.cwat/src/com/raytheon/uf/edex/plugin/cwat/CWATGenerator.java @@ -49,7 +49,8 @@ import com.raytheon.uf.edex.plugin.cwat.common.CWATConfig; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 02/25/13 1660 D. Hladky Fixed configuration bug in scan. + * Feb 25, 2013 1660 D. Hladky Fixed configuration bug in scan. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -68,7 +69,7 @@ public class CWATGenerator extends CompositeProductGenerator implements /** Set of icaos to filter for */ private Set icaos = null; - + /** run configuration manager **/ public SCANRunSiteConfigurationManager srcm = null; @@ -98,7 +99,7 @@ public class CWATGenerator extends CompositeProductGenerator implements if (!configValid) { statusHandler.handle(Priority.WARN, - "Configuration for CWAT(scan) is invalid!!!"); + "Configuration for CWAT(scan) is invalid!!!"); return; } @@ -133,7 +134,7 @@ public class CWATGenerator extends CompositeProductGenerator implements cwa_config = new CWATConfig(genMessage, this); } catch (Exception e) { statusHandler.handle(Priority.ERROR, - "CWAT Configuration parameters for run not met...",e); + "CWAT Configuration parameters for run not met...", e); return; } @@ -156,8 +157,6 @@ public class CWATGenerator extends CompositeProductGenerator implements + cwa_config.getVil().getNumBins()); } - cwaRec.setPluginName(cwa_config.getGenerator() - .getCompositeProductType()); cwaRec.setIcao(cwa_config.getIcao()); cwaRec.setDataTime(new DataTime(cwa_config.getCZ().getDataTime() .getRefTime())); @@ -193,7 +192,7 @@ public class CWATGenerator extends CompositeProductGenerator implements resetFilters(); } } - + /** * run config manager * diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/FFMPGenerator.java b/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/FFMPGenerator.java index 2cc6408d3d..e27d61d78c 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/FFMPGenerator.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.ffmp/src/com/raytheon/uf/edex/plugin/ffmp/FFMPGenerator.java @@ -32,7 +32,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executor; import java.util.regex.Pattern; -import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage; import com.raytheon.edex.plugin.radar.dao.RadarStationDao; import com.raytheon.edex.urifilter.URIFilter; import com.raytheon.edex.urifilter.URIGenerateMessage; @@ -48,6 +47,7 @@ import com.raytheon.uf.common.dataplugin.ffmp.FFMPTemplates.MODE; import com.raytheon.uf.common.dataplugin.ffmp.FFMPUtils; import com.raytheon.uf.common.dataplugin.ffmp.SourceBinList; import com.raytheon.uf.common.dataplugin.ffmp.dao.FFMPDao; +import com.raytheon.uf.common.dataplugin.message.DataURINotificationMessage; import com.raytheon.uf.common.dataplugin.radar.RadarStation; import com.raytheon.uf.common.dataplugin.radar.util.RadarsInUseUtil; import com.raytheon.uf.common.datastorage.DataStoreFactory; @@ -114,17 +114,28 @@ import com.raytheon.uf.edex.plugin.ffmp.common.FFTIRatioDiff; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 06/21/2009 2521 dhladky Initial Creation. - * 02/03/2011 6500 cjeanbap Fixed NullPointerException. - * 07/31/2011 578 dhladky FFTI modifications - * 01/27/13 1478 D. Hladky Added creation of full cache records to help read write stress on NAS - * 02/01/13 1569 D. Hladky Added constants, switched to using aggregate records written through pypies - * 02/20/13 1635 D. Hladky Added some finally methods to increase dead lock safety. Reduced wait times for threads. - * 02/25/13 1660 D. Hladky Redesigned data flow for FFTI in order to have only one mosaic piece in memory at a time. - * 03/13/13 1478 D. Hladky non-FFTI mosaic containers weren't getting ejected. Made it so that they are ejected after processing as well. - * 03/22/13 1803 D. Hladky Fixed broken performance logging for ffmp. - * 07/03/13 2131 D. Hladky InitialLoad array was forcing total FDC re-query with every update. - * Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL + * Jun 21, 2009 2521 dhladky Initial Creation. + * Feb 03, 2011 6500 cjeanbap Fixed NullPointerException. + * Jul 31, 2011 578 dhladky FFTI modifications + * Jan 27, 2013 1478 D. Hladky Added creation of full cache records to + * help read write stress on NAS + * Feb 01, 2013 1569 D. Hladky Added constants, switched to using + * aggregate records written through pypies + * Feb 20, 2013 1635 D. Hladky Added some finally methods to increase + * dead lock safety. Reduced wait times for + * threads. + * Feb 25, 2013 1660 D. Hladky Redesigned data flow for FFTI in order to + * have only one mosaic piece in memory at a + * time. + * Mar 13, 2013 1478 D. Hladky non-FFTI mosaic containers weren't + * getting ejected. Made it so that they + * are ejected after processing as well. + * Mar 22, 2013 1803 D. Hladky Fixed broken performance logging for + * ffmp. + * Jul 03, 2013 2131 D. Hladky InitialLoad array was forcing total FDC + * re-query with every update. + * Jul 15, 2013 2184 dhladky Remove all HUC's for storage except ALL + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author dhladky @@ -408,9 +419,9 @@ public class FFMPGenerator extends CompositeProductGenerator implements if (messages instanceof DataURINotificationMessage) { URIFilter[] filters = getFilters(); if (filters != null) { - for (int i = 0; i < filters.length; i++) { - if (filters[i] != null) { - FFMPURIFilter filter = (FFMPURIFilter) filters[i]; + for (URIFilter filter2 : filters) { + if (filter2 != null) { + FFMPURIFilter filter = (FFMPURIFilter) filter2; if (loaded) { @@ -682,7 +693,6 @@ public class FFMPGenerator extends CompositeProductGenerator implements ffmpRec.setSourceName(ffmpProduct.getSourceName()); ffmpRec.setDataKey(dataKey); ffmpRec.setSiteKey(siteKey); - ffmpRec.setPluginName(getCompositeProductType()); ffmpRec.setWfo(config.getCWA()); FFMPProcessor ffmp = new FFMPProcessor(config, generator, ffmpRec, template); @@ -890,7 +900,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements if (source.isRfc()) { int i = 0; for (String dataKey : ingest.getDataKey()) { - if (i < ingest.getDataKey().size() - 1) { + if (i < (ingest.getDataKey().size() - 1)) { buf.append(dataKey + ","); } else { buf.append(dataKey); @@ -1234,7 +1244,6 @@ public class FFMPGenerator extends CompositeProductGenerator implements - (TimeUtil.MILLIS_PER_HOUR * SOURCE_CACHE_TIME)); } - // pull from disk if there fdc = getFFMPDataContainer(sourceSiteDataKey, backDate); @@ -1265,7 +1274,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements Date newDate = fdc.getNewest(); Date oldDate = fdc.getOldest(); - if (newDate != null && oldDate != null) { + if ((newDate != null) && (oldDate != null)) { if ((ffmpRec.getDataTime().getRefTime().getTime() - newDate .getTime()) >= (source .getExpirationMinutes(ffmpRec.getSiteKey()) * TimeUtil.MILLIS_PER_MINUTE)) { @@ -1377,14 +1386,14 @@ public class FFMPGenerator extends CompositeProductGenerator implements } // condition for first time read in - if (fdc == null && record != null) { + if ((fdc == null) && (record != null)) { // creates a place holder for this source fdc = new FFMPDataContainer(sourceSiteDataKey, record); populated = true; } // condition for update to fdc while in use - if (record != null && !populated) { + if ((record != null) && !populated) { fdc.setAggregateData(record); } @@ -1444,10 +1453,11 @@ public class FFMPGenerator extends CompositeProductGenerator implements */ private class WriteAggregateRecord implements Runnable { - private FFMPDataContainer fdc; + private final FFMPDataContainer fdc; - private String sourceSiteDataKey; + private final String sourceSiteDataKey; + @Override public void run() { try { write(); @@ -1750,7 +1760,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements } // This will only happen at initial load, update, and duration changes. - if (accumulator.isReset() || accumulator.getDuration() != duration) { + if (accumulator.isReset() || (accumulator.getDuration() != duration)) { accumulator.setDuration(duration); accumulator.setUnit(unit); @@ -1852,7 +1862,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements if (isFFTI(siteDataKey)) { values = (FFTIRatioDiff) getFFTIData(siteDataKey); - if (values.getGuids() == null || values.getQpes() == null) { + if ((values.getGuids() == null) || (values.getQpes() == null)) { values.setReset(true); } } else { @@ -1860,7 +1870,7 @@ public class FFMPGenerator extends CompositeProductGenerator implements } // This will only happen at initial load, update, and duration changes. - if (values.isReset() || values.getDuration() != duration) { + if (values.isReset() || (values.getDuration() != duration)) { values.setDuration(duration); values.setUnit(unit); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.fog/src/com/raytheon/uf/edex/plugin/fog/FogGenerator.java b/edexOsgi/com.raytheon.uf.edex.plugin.fog/src/com/raytheon/uf/edex/plugin/fog/FogGenerator.java index bcfc14d19e..726258ecaa 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.fog/src/com/raytheon/uf/edex/plugin/fog/FogGenerator.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.fog/src/com/raytheon/uf/edex/plugin/fog/FogGenerator.java @@ -71,7 +71,6 @@ public class FogGenerator extends CompositeProductGenerator { FogRecord fogRec = new FogRecord(); this.setPluginDao(new FogDao(productType)); - fogRec.setPluginName(this.getCompositeProductType()); fogRec.setDataTime(this.getProductTime()); fogRec.setRefHour(TimeTools.roundToNearestHour(fogRec.getDataTime() .getValidTime())); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.fssobs/src/com/raytheon/uf/edex/plugin/fssobs/common/FSSObsConfig.java b/edexOsgi/com.raytheon.uf.edex.plugin.fssobs/src/com/raytheon/uf/edex/plugin/fssobs/common/FSSObsConfig.java index 04c05710cf..01f3a3ee1b 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.fssobs/src/com/raytheon/uf/edex/plugin/fssobs/common/FSSObsConfig.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.fssobs/src/com/raytheon/uf/edex/plugin/fssobs/common/FSSObsConfig.java @@ -41,7 +41,8 @@ import com.raytheon.uf.edex.plugin.fssobs.FSSObsUtils; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Nov 19, 2010 skorolev Initial creation + * Nov 19, 2010 skorolev Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -108,8 +109,8 @@ public class FSSObsConfig { tableRow.setRelativeHumidity(RH); } float[] snowData = FSSObsUtils.getSnowData(tableRow); - if (tableRow.getTemperature() != FSSObsUtils.MISSING - && tableRow.getDewpoint() != FSSObsUtils.MISSING) { + if ((tableRow.getTemperature() != FSSObsUtils.MISSING) + && (tableRow.getDewpoint() != FSSObsUtils.MISSING)) { // TODO to check if this is correct. calcdpd() in Meteolib tableRow.setDewpointDepr(tableRow.getTemperature() - tableRow.getDewpoint()); @@ -122,7 +123,6 @@ public class FSSObsConfig { tableRow.setWindChill(snowData[3]); tableRow.setFrostbiteTime(snowData[4]); - tableRow.setPluginName("fssobs"); tableRow.setCwa(cwa); tableRow.setMonitorUse(monitorUse); tableRow.setPlatformId(tableRow.getLocation().getStationId()); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.ldadmesonet/src/com/raytheon/uf/edex/plugin/ldadmesonet/MesonetDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.ldadmesonet/src/com/raytheon/uf/edex/plugin/ldadmesonet/MesonetDecoder.java index 1cdf0f192e..c6929e8080 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.ldadmesonet/src/com/raytheon/uf/edex/plugin/ldadmesonet/MesonetDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.ldadmesonet/src/com/raytheon/uf/edex/plugin/ldadmesonet/MesonetDecoder.java @@ -68,6 +68,7 @@ import com.raytheon.uf.common.time.DataTime; * ----------- ---------- ----------- -------------------------- * Sep 04, 2009 vkorolev Initial creation * May 15, 2013 1869 bsteffen Remove DataURI column from ldadmesonet. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author vkorolev @@ -84,7 +85,7 @@ public class MesonetDecoder extends AbstractDecoder implements private String traceId = null; private String currentFile = null; - + public SimpleDateFormat sdf = new SimpleDateFormat("yy/MM/dd HH:mm:ss"); public File confile; @@ -190,7 +191,6 @@ public class MesonetDecoder extends AbstractDecoder implements MesonetLdadRecord record = new MesonetLdadRecord(); SurfaceObsLocation location = new SurfaceObsLocation(); record.setDataProvider(dd.provider); - record.setPluginName(PLUGIN_NAME); record.setStationType(dd.type); record.setReportTime(dd.reportTime); record.setReportType(dd.storageType); @@ -241,9 +241,9 @@ public class MesonetDecoder extends AbstractDecoder implements } } // for // DataTime = Observation time - + Calendar ot = record.getObservationTime(); - if(ot != null) { + if (ot != null) { DataTime dt = new DataTime(ot); record.setDataTime(dt); record.setLocation(location); @@ -306,21 +306,22 @@ public class MesonetDecoder extends AbstractDecoder implements cal.setTimeZone(TimeZone.getTimeZone("GMT")); cal.setTime(ot); val = cal; - } catch(Exception e) { + } catch (Exception e) { abort = true; - logger.error("Could not parse date field [" + name + ":" + value + "] for file " + currentFile); + logger.error("Could not parse date field [" + name + ":" + + value + "] for file " + currentFile); } // only numbers } else { - + // Get rid of some troublesome data // TODO: find out what should be done with these values abort = "B".equals(value); abort |= "R".equals(value); abort |= "V".equals(value); abort |= "NAN0".equals(value); - - if(!abort) { + + if (!abort) { Double tval = null; try { tval = Double.parseDouble(value); @@ -333,20 +334,21 @@ public class MesonetDecoder extends AbstractDecoder implements } if (configFile.containsKey(vunit)) { Unit inUnit = null; - + Unit outUnit = null; - + try { - inUnit = (Unit) UnitFormat - .getUCUMInstance().parseObject( - configFile.getProperty(vunit)); - outUnit = (Unit) UnitFormat - .getUCUMInstance().parseObject( - configFile.getProperty(name)); + inUnit = (Unit) UnitFormat.getUCUMInstance() + .parseObject(configFile.getProperty(vunit)); + outUnit = (Unit) UnitFormat.getUCUMInstance() + .parseObject(configFile.getProperty(name)); tval = inUnit.getConverterTo(outUnit).convert( (tval).doubleValue()); } catch (ConversionException ce) { - logger.error("Property[" + fld.getName() + "]Input unit " + inUnit.getStandardUnit() + " not compatable with Output unit " + outUnit.getStandardUnit()); + logger.error("Property[" + fld.getName() + + "]Input unit " + inUnit.getStandardUnit() + + " not compatable with Output unit " + + outUnit.getStandardUnit()); return; } } @@ -361,7 +363,7 @@ public class MesonetDecoder extends AbstractDecoder implements } } } - if(!abort) { + if (!abort) { Class types = clazz; Method method = obj.getClass().getMethod(mname, types); method.invoke(obj, val); @@ -432,8 +434,7 @@ public class MesonetDecoder extends AbstractDecoder implements Class cls = record.getClass(); Field fieldlist[] = cls.getDeclaredFields(); - for (int i = 0; i < fieldlist.length; i++) { - Field fld = fieldlist[i]; + for (Field fld : fieldlist) { System.out.println("name = " + fld.getName()); System.out.println("decl class = " + fld.getDeclaringClass().getSimpleName()); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.lsr/src/com/raytheon/uf/edex/plugin/lsr/decoder/LSRParser.java b/edexOsgi/com.raytheon.uf.edex.plugin.lsr/src/com/raytheon/uf/edex/plugin/lsr/decoder/LSRParser.java index b2129081ed..275044021b 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.lsr/src/com/raytheon/uf/edex/plugin/lsr/decoder/LSRParser.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.lsr/src/com/raytheon/uf/edex/plugin/lsr/decoder/LSRParser.java @@ -52,7 +52,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 21, 2009 1939 jkorman Initial creation + * Jan 21, 2009 1939 jkorman Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -137,18 +138,18 @@ public class LSRParser { } // private Pattern rptStartPtrn = Pattern.compile(TIME_PTRN); - private Pattern latlanPtrn = Pattern.compile(LATLON_PTRN); + private final Pattern latlanPtrn = Pattern.compile(LATLON_PTRN); /** The logger */ - private Log logger = LogFactory.getLog(getClass()); + private final Log logger = LogFactory.getLog(getClass()); private final PointDataDescription pointDataDescription; private final LocalStormReportDao lsrDao; - private Map containerMap; + private final Map containerMap; - private String pluginName; + private final String pluginName; private WMOHeader wmoHeader; @@ -166,7 +167,7 @@ public class LSRParser { int currentReport = -1; - private HashMap URI_MAP = new HashMap(); + private final HashMap URI_MAP = new HashMap(); private List reports; @@ -361,7 +362,6 @@ public class LSRParser { .getWmoHeader()); rpt.setOfficeid(officeid); rpt.setTraceId(traceId); - rpt.setPluginName(pluginName); reports.add(rpt); } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/META-INF/MANIFEST.MF index e179fbdc57..f7db2eec67 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/META-INF/MANIFEST.MF @@ -8,5 +8,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Require-Bundle: org.apache.camel;bundle-version="1.0.0", org.springframework;bundle-version="2.5.6", com.raytheon.edex.common;bundle-version="1.11.17", - com.raytheon.uf.common.status + com.raytheon.uf.common.status, + com.raytheon.uf.edex.decodertools, + com.raytheon.uf.edex.distribution, + org.apache.commons.io Import-Package: com.raytheon.uf.edex.site.ingest diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/src/com/raytheon/uf/edex/plugin/manualIngest/MessageGenerator.java b/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/src/com/raytheon/uf/edex/plugin/manualIngest/MessageGenerator.java index 99a1e6523e..3d4f4e3353 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/src/com/raytheon/uf/edex/plugin/manualIngest/MessageGenerator.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.manualIngest/src/com/raytheon/uf/edex/plugin/manualIngest/MessageGenerator.java @@ -21,18 +21,27 @@ package com.raytheon.uf.edex.plugin.manualIngest; import java.io.File; import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.TimeZone; import org.apache.camel.Exchange; import org.apache.camel.Processor; -import org.springframework.util.FileCopyUtils; +import org.apache.commons.io.FileUtils; 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.time.SimulatedTime; import com.raytheon.uf.common.util.header.WMOHeaderFinder; import com.raytheon.uf.edex.core.EDEXUtil; -import com.raytheon.uf.edex.core.EdexException; import com.raytheon.uf.edex.core.props.PropertiesFactory; +import com.raytheon.uf.edex.decodertools.time.TimeTools; +import com.raytheon.uf.edex.distribution.DistributionPatterns; /** * A bean based on FileToString that will take a message generated from a file @@ -45,8 +54,8 @@ import com.raytheon.uf.edex.core.props.PropertiesFactory; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Oct 28, 2009 brockwoo Initial creation - * + * Oct 28, 2009 brockwoo Initial creation + * Sep 03, 2013 2327 rjpeter Added directory routing by plugin and date of product. * * * @author brockwoo @@ -65,6 +74,29 @@ public class MessageGenerator implements Processor { private String ingestRoute = null; + private final ThreadLocal sdfs = new ThreadLocal() { + + /* + * (non-Javadoc) + * + * @see java.lang.ThreadLocal#initialValue() + */ + @Override + protected SimpleDateFormat initialValue() { + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd" + + File.separatorChar + "HH"); + sdf.setTimeZone(TimeZone.getTimeZone("GMT")); + return sdf; + } + + }; + + /** + * Set of plugins that are not the primary decoder of the data. These are + * secondary or additional information such as text, dhr, dpa, etc. + */ + private final Set secondaryPlugins = new HashSet(); + public static MessageGenerator getInstance() { return instance; } @@ -77,6 +109,19 @@ public class MessageGenerator implements Processor { this.ingestRoute = ingestRoute; } + /** + * Register a secondary plugin, i.e. not the primary decoder of the data. + * These are plugins that provide data in a different format oradditional + * information such as text, dhr, dpa, etc. + * + * @param plugin + * @return + */ + public MessageGenerator registerSecondaryPlugin(String plugin) { + secondaryPlugins.add(plugin); + return this; + } + /* * (non-Javadoc) * @@ -86,14 +131,12 @@ public class MessageGenerator implements Processor { public void process(Exchange arg0) throws Exception { File file = (File) arg0.getIn().getBody(); if (file != null) { - String fileName = file.getName(); String messageHeader = WMOHeaderFinder.find(file); if (messageHeader == null) { - messageHeader = fileName; + messageHeader = file.getName(); } else { messageHeader = messageHeader.trim(); } - arg0.getIn().setBody(file.toString()); arg0.getIn().setHeader("header", messageHeader); arg0.getIn().setHeader("enqueueTime", System.currentTimeMillis()); @@ -103,21 +146,87 @@ public class MessageGenerator implements Processor { } } - public File copyFileToArchive(File inFile) { - String path = DIR + File.separator; + /** + * Copies the specified file to the archive directory. + * + * @param inFile + * @return + * @throws IOException + */ + public File copyFileToArchive(File inFile) throws IOException { + StringBuilder path = new StringBuilder(inFile.getPath().length()); + path.append(DIR).append(File.separatorChar); + + // find header and determine file date + Date fileTime = null; + String header = WMOHeaderFinder.find(inFile); + if (header == null) { + header = inFile.getName(); + } else { + header = header.trim(); + try { + String dtg = WMOHeaderFinder.findDtg(header); + Calendar headerTime = TimeTools.findCurrentTime(dtg, + inFile.getName()); + if (headerTime != null) { + fileTime = headerTime.getTime(); + } + } catch (Exception e) { + statusHandler.error("Exception occurred parsing WMO Header", e); + } + } + + // determine the plugin + List plugins = DistributionPatterns.getInstance() + .getMatchingPlugins(header); + int numPlugins = plugins.size(); + if (numPlugins == 1) { + path.append(plugins.get(0)).append(File.separatorChar); + } else if (numPlugins > 1) { + if (plugins.size() <= secondaryPlugins.size()) { + // check for a non secondary plugin, + String plugin = null; + for (String pluginToCheck : plugins) { + if (!secondaryPlugins.contains(pluginToCheck)) { + plugin = pluginToCheck; + break; + } + } + + if (plugin == null) { + // didn't find a non secondary plugin, just grab first + // plugin + plugin = plugins.get(0); + } + + path.append(plugin).append(File.separatorChar); + } else { + // remove secondary and grab first one + plugins.removeAll(secondaryPlugins); + path.append(plugins.get(0)).append(File.separatorChar); + } + } else { + path.append("unknown").append(File.separatorChar); + } + + // append YYYYMMDD/HH + if (fileTime == null) { + // default to current time + fileTime = SimulatedTime.getSystemTime().getTime(); + } + path.append(sdfs.get().format(fileTime)).append(File.separatorChar); // Determine the sub-directory String inputPath = inFile.getParent(); // Split on the manual directory to get the sub-directory String[] parts = inputPath.split("manual"); - File dir = null; if (parts.length > 1) { - dir = new File(path + parts[1]); - } else { - dir = new File(path); + path.append(parts[1]); } + File dir = new File(path.toString()); + if (!dir.exists()) { dir.mkdirs(); } @@ -125,7 +234,7 @@ public class MessageGenerator implements Processor { File newFile = new File(dir, inFile.getName()); try { - FileCopyUtils.copy(inFile, newFile); + FileUtils.copyFile(inFile, newFile); statusHandler.handle(Priority.INFO, "DataManual: " + inFile.getAbsolutePath()); } catch (IOException e) { @@ -137,7 +246,14 @@ public class MessageGenerator implements Processor { return newFile; } - public File moveFileToArchive(File inFile) { + /** + * Moves the specified file to the archive directory. + * + * @param inFile + * @return + * @throws IOException + */ + public File moveFileToArchive(File inFile) throws IOException { File newFile = copyFileToArchive(inFile); if (newFile != null) { inFile.delete(); @@ -145,10 +261,25 @@ public class MessageGenerator implements Processor { return newFile; } + /** + * Copies a file to the archive directory and sends the path to the manual + * ingest route. + * + * @param inFile + * @return + */ public boolean sendFileToIngest(String inFile) { return sendFileToIngest(inFile, ingestRoute); } + /** + * Copies a file to the archive directory and sends the path to the + * specified route. + * + * @param inFile + * @param route + * @return + */ public boolean sendFileToIngest(String inFile, String route) { boolean rval = true; @@ -156,7 +287,7 @@ public class MessageGenerator implements Processor { File archiveFile = copyFileToArchive(new File(inFile)); EDEXUtil.getMessageProducer().sendAsync(route, archiveFile.getAbsolutePath()); - } catch (EdexException e) { + } catch (Exception e) { rval = false; statusHandler.handle(Priority.ERROR, "Failed to insert file [" + inFile + "] into ingest stream", e); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/MESOWestDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/MESOWestDecoder.java index be6bcf1e5c..3b90cfe1bc 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/MESOWestDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/MESOWestDecoder.java @@ -37,27 +37,28 @@ import com.raytheon.uf.edex.plugin.mesowest.decoder.MESOWestParser; * TODO Add Description * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Mar 3, 2009            jkorman     Initial creation
- *
+ * Mar 03, 2009            jkorman     Initial creation
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
+ * 
  * 
- * + * * @author jkorman - * @version 1.0 + * @version 1.0 */ public class MESOWestDecoder { - private Log logger = LogFactory.getLog(getClass()); + private final Log logger = LogFactory.getLog(getClass()); private String pluginName = "mesowest"; - private Map parserMap = new HashMap(); - + private final Map parserMap = new HashMap(); + /** * * @param name @@ -77,27 +78,28 @@ public class MESOWestDecoder { PluginDataObject[] decodedData = null; String traceId = null; - + logger.debug("MESOWestDecoder.decode()"); - - if(input != null) { - traceId = (String) input.getProperty(MESOWestConstants.TRACEID); + + if (input != null) { + traceId = input.getProperty(MESOWestConstants.TRACEID); MESOWestRecord record = null; - + String type = input.getProperty(MESOWestConstants.K_DATATYPE); - if(MESOWestConstants.T_PARMHEADER.equals(type)) { - parserMap.put(input.getProperty("uuid"),new MESOWestParser(input.getReport())); + if (MESOWestConstants.T_PARMHEADER.equals(type)) { + parserMap.put(input.getProperty("uuid"), new MESOWestParser( + input.getReport())); logger.debug("Created parser "); } else if (MESOWestConstants.T_LASTITEM.equals(type)) { parserMap.remove(input.getProperty("uuid")); logger.debug("Destroyed parser "); } else { - MESOWestParser parser = parserMap.get(input.getProperty("uuid")); - if(parser != null) { - if(input.getReport().length() > 10) { - if((record = parser.decode(input.getReport())) != null) { - record.setPluginName(pluginName); + MESOWestParser parser = parserMap + .get(input.getProperty("uuid")); + if (parser != null) { + if (input.getReport().length() > 10) { + if ((record = parser.decode(input.getReport())) != null) { record.setTraceId(traceId); record.setObsText(input.getReport() + "\n"); } @@ -106,15 +108,16 @@ public class MESOWestDecoder { logger.error("Unexpected data in data stream"); } } - + try { if (record != null) { logger.info("Decoded obs " + record.getStationId()); - + try { record.constructDataURI(); } catch (PluginException e) { - throw new DecoderException("Unable to construct dataURI", e); + throw new DecoderException( + "Unable to construct dataURI", e); } decodedData = new PluginDataObject[] { record }; @@ -124,7 +127,7 @@ public class MESOWestDecoder { } catch (Exception e) { logger.error("Error in MESOWestDecoder", e); } finally { - if(decodedData == null) { + if (decodedData == null) { decodedData = new PluginDataObject[0]; } } @@ -134,7 +137,7 @@ public class MESOWestDecoder { return decodedData; } - + /** * @return the pluginName */ diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/common/MESOWestRecord.java b/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/common/MESOWestRecord.java index 2eb7f65b23..04a4dfc50b 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/common/MESOWestRecord.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.mesowest/src/com/raytheon/uf/edex/plugin/mesowest/common/MESOWestRecord.java @@ -63,10 +63,11 @@ import com.vividsolutions.jts.geom.Geometry; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Mar 3, 2009 jkorman Initial creation - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Mar 03, 2009 jkorman Initial creation + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -79,15 +80,15 @@ import com.vividsolutions.jts.geom.Geometry; @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize -public class MESOWestRecord extends PluginDataObject implements ISpatialEnabled, -IDecoderGettable { - +public class MESOWestRecord extends PluginDataObject implements + ISpatialEnabled, IDecoderGettable { + private static final long serialVersionUID = 1L; public static final String OBS_TEXT = "text"; - + public static final Unit LENGTH_UNIT = SI.METER; - + public static final Unit TEMPERATURE_UNIT = SI.KELVIN; public static final Unit WIND_SPEED_UNIT = SI.METERS_PER_SECOND; @@ -109,10 +110,10 @@ IDecoderGettable { PARM_MAP.put("PMSL", PRES_SLP); PARM_MAP.put("NLAT", STA_LAT); PARM_MAP.put("NLON", STA_LON); - PARM_MAP.put("STA","STA"); - PARM_MAP.put("stationid","STA"); - PARM_MAP.put("message",OBS_TEXT); - PARM_MAP.put(OBS_TEXT,OBS_TEXT); + PARM_MAP.put("STA", "STA"); + PARM_MAP.put("stationid", "STA"); + PARM_MAP.put("message", OBS_TEXT); + PARM_MAP.put(OBS_TEXT, OBS_TEXT); } @DataURI(position = 1) @@ -131,7 +132,7 @@ IDecoderGettable { @XmlElement @DynamicSerializeElement private SurfaceObsLocation location; - + // Observation air temperature in degrees Kelvin. @Column @DynamicSerializeElement @@ -155,7 +156,7 @@ IDecoderGettable { @DynamicSerializeElement @XmlElement private Double minT24; - + // Relative Humidity in percent. @Column @DynamicSerializeElement @@ -197,7 +198,7 @@ IDecoderGettable { @DynamicSerializeElement @XmlElement private Double altimeter; - + // Observation precip in mm. @Column @DynamicSerializeElement @@ -209,7 +210,7 @@ IDecoderGettable { @DynamicSerializeElement @XmlElement private Double precip_01M; - + // 5 minute precip in inches. @Column @DynamicSerializeElement @@ -257,13 +258,13 @@ IDecoderGettable { @DynamicSerializeElement @XmlElement private Double precip_24H; - + // Raw observation text @Column @DynamicSerializeElement @XmlElement private String obsText; - + /** * */ @@ -280,8 +281,7 @@ IDecoderGettable { public MESOWestRecord(String uri) { super(uri); } - - + /** * Get this observation's geometry. * @@ -290,7 +290,7 @@ IDecoderGettable { public Geometry getGeometry() { return location.getGeometry(); } - + /** * Get the geometry latitude. * @@ -308,7 +308,7 @@ IDecoderGettable { public double getLongitude() { return location.getLongitude(); } - + /** * Get the station identifier for this observation. * @@ -326,7 +326,7 @@ IDecoderGettable { public Integer getElevation() { return location.getElevation(); } - + /** * @return the location */ @@ -335,7 +335,8 @@ IDecoderGettable { } /** - * @param location the location to set + * @param location + * the location to set */ public void setLocation(SurfaceObsLocation location) { this.location = location; @@ -343,7 +344,7 @@ IDecoderGettable { /** * - * @return + * @return */ public String getNetworkType() { return networkType; @@ -351,7 +352,7 @@ IDecoderGettable { /** * - * @return + * @return */ public void setNetworkType(String type) { networkType = type; @@ -373,7 +374,7 @@ IDecoderGettable { } // ****************************************** - + /** * @return the temp */ @@ -382,7 +383,8 @@ IDecoderGettable { } /** - * @param temp the temp to set + * @param temp + * the temp to set */ public void setTemp(Double temp) { this.temp = temp; @@ -396,12 +398,13 @@ IDecoderGettable { } /** - * @param dwpt the dwpt to set + * @param dwpt + * the dwpt to set */ public void setDwpt(Double dwpt) { this.dwpt = dwpt; } - + /** * @return the maxT24 */ @@ -410,7 +413,8 @@ IDecoderGettable { } /** - * @param maxT24 the maxT24 to set + * @param maxT24 + * the maxT24 to set */ public void setMaxT24(Double maxT24) { this.maxT24 = maxT24; @@ -424,7 +428,8 @@ IDecoderGettable { } /** - * @param minT24 the minT24 to set + * @param minT24 + * the minT24 to set */ public void setMinT24(Double minT24) { this.minT24 = minT24; @@ -438,7 +443,8 @@ IDecoderGettable { } /** - * @param humidity the humidity to set + * @param humidity + * the humidity to set */ public void setHumidity(Double humidity) { this.humidity = humidity; @@ -452,7 +458,8 @@ IDecoderGettable { } /** - * @param windDirection the windDirection to set + * @param windDirection + * the windDirection to set */ public void setWindDirection(Double windDirection) { this.windDirection = windDirection; @@ -466,7 +473,8 @@ IDecoderGettable { } /** - * @param windSpeed the windSpeed to set + * @param windSpeed + * the windSpeed to set */ public void setWindSpeed(Double windSpeed) { this.windSpeed = windSpeed; @@ -480,12 +488,13 @@ IDecoderGettable { } /** - * @param windGust the windGust to set + * @param windGust + * the windGust to set */ public void setWindGust(Double windGust) { this.windGust = windGust; } - + /** * @return the pressure */ @@ -494,12 +503,13 @@ IDecoderGettable { } /** - * @param pressure the pressure to set + * @param pressure + * the pressure to set */ public void setPressure(Double pressure) { this.pressure = pressure; } - + /** * @return the seaLevelPressure */ @@ -508,7 +518,8 @@ IDecoderGettable { } /** - * @param seaLevelPressure the seaLevelPressure to set + * @param seaLevelPressure + * the seaLevelPressure to set */ public void setSeaLevelPressure(Double seaLevelPressure) { this.seaLevelPressure = seaLevelPressure; @@ -522,12 +533,12 @@ IDecoderGettable { } /** - * @param altimeter the altimeter to set + * @param altimeter + * the altimeter to set */ public void setAltimeter(Double altimeter) { this.altimeter = altimeter; } - /** * @return the precip @@ -537,7 +548,8 @@ IDecoderGettable { } /** - * @param precip the precip to set + * @param precip + * the precip to set */ public void setPrecip(Double precip) { this.precip = precip; @@ -551,7 +563,8 @@ IDecoderGettable { } /** - * @param precip_01M the precip_01M to set + * @param precip_01M + * the precip_01M to set */ public void setPrecip_01M(Double precip_01M) { this.precip_01M = precip_01M; @@ -565,7 +578,8 @@ IDecoderGettable { } /** - * @param precip_05M the precip_05M to set + * @param precip_05M + * the precip_05M to set */ public void setPrecip_05M(Double precip_05M) { this.precip_05M = precip_05M; @@ -579,7 +593,8 @@ IDecoderGettable { } /** - * @param precip_10M the precip_10M to set + * @param precip_10M + * the precip_10M to set */ public void setPrecip_10M(Double precip_10M) { this.precip_10M = precip_10M; @@ -593,7 +608,8 @@ IDecoderGettable { } /** - * @param precip_15M the precip_15M to set + * @param precip_15M + * the precip_15M to set */ public void setPrecip_15M(Double precip_15M) { this.precip_15M = precip_15M; @@ -607,7 +623,8 @@ IDecoderGettable { } /** - * @param precip_30M the precip_30M to set + * @param precip_30M + * the precip_30M to set */ public void setPrecip_30M(Double precip_30M) { this.precip_30M = precip_30M; @@ -621,7 +638,8 @@ IDecoderGettable { } /** - * @param precip_01H the precip_01H to set + * @param precip_01H + * the precip_01H to set */ public void setPrecip_01H(Double precip_01H) { this.precip_01H = precip_01H; @@ -635,7 +653,8 @@ IDecoderGettable { } /** - * @param precip_03H the precip_03H to set + * @param precip_03H + * the precip_03H to set */ public void setPrecip_03H(Double precip_03H) { this.precip_03H = precip_03H; @@ -649,7 +668,8 @@ IDecoderGettable { } /** - * @param precip_06H the precip_06H to set + * @param precip_06H + * the precip_06H to set */ public void setPrecip_06H(Double precip_06H) { this.precip_06H = precip_06H; @@ -663,7 +683,8 @@ IDecoderGettable { } /** - * @param precip_24H the precip_24H to set + * @param precip_24H + * the precip_24H to set */ public void setPrecip_24H(Double precip_24H) { this.precip_24H = precip_24H; @@ -677,12 +698,13 @@ IDecoderGettable { } /** - * @param obsText the obsText to set + * @param obsText + * the obsText to set */ public void setObsText(String obsText) { this.obsText = obsText; } - + // ****************************************** /** @@ -691,7 +713,7 @@ IDecoderGettable { public void setSpatialObject(SurfaceObsLocation loc) { location = loc; } - + /** * */ @@ -699,10 +721,10 @@ IDecoderGettable { public SurfaceObsLocation getSpatialObject() { return location; } - + /** - * This class implements IDecoderGettable so return this - * instance. + * This class implements IDecoderGettable so return this instance. + * * @return The reference to this instance. */ @Override @@ -722,7 +744,7 @@ IDecoderGettable { } else if (OBS_TEXT.equals(pName)) { retValue = getStationId(); } - + return retValue; } @@ -730,7 +752,7 @@ IDecoderGettable { public String[] getStrings(String paramName) { return null; } - + @Override public Amount getValue(String paramName) { Amount a = null; @@ -755,10 +777,10 @@ IDecoderGettable { } else if (PRES_SLP.equals(pName)) { a = new Amount(seaLevelPressure, PRESSURE_UNIT); } - + return a; } - + /** * */ @@ -766,11 +788,16 @@ IDecoderGettable { public Collection getValues(String paramName) { return null; } - + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "mesowest"; + } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.npp.sounding/src/com/raytheon/uf/edex/plugin/npp/sounding/NPPSoundingDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.npp.sounding/src/com/raytheon/uf/edex/plugin/npp/sounding/NPPSoundingDecoder.java index 8ca9ec0a69..d6007ea832 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.npp.sounding/src/com/raytheon/uf/edex/plugin/npp/sounding/NPPSoundingDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.npp.sounding/src/com/raytheon/uf/edex/plugin/npp/sounding/NPPSoundingDecoder.java @@ -57,7 +57,8 @@ import com.raytheon.uf.edex.plugin.npp.AbstractNPPDecoder; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 4, 2013 mschenke Initial creation + * Jan 04, 2013 mschenke Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -67,14 +68,14 @@ import com.raytheon.uf.edex.plugin.npp.AbstractNPPDecoder; public class NPPSoundingDecoder extends AbstractNPPDecoder { - private IUFStatusHandler statusHandler = UFStatus + private final IUFStatusHandler statusHandler = UFStatus .getHandler(NPPSoundingDecoder.class); private static final String LATITUDE_DATASET_ID = "Latitude@"; private static final String LONGITUDE_DATASET_ID = "Longitude@"; - private String pluginName; + private final String pluginName; private NPPSoundingDao pluginDao; @@ -128,7 +129,7 @@ public class NPPSoundingDecoder extends AbstractNPPDecoder { longitude = var; } } - if (latitude == null || longitude == null) { + if ((latitude == null) || (longitude == null)) { throw new DecoderException("Unable to find lat/lon information"); } @@ -142,7 +143,6 @@ public class NPPSoundingDecoder extends AbstractNPPDecoder { // Create PDO for lat/lon entry NPPSoundingRecord record = (NPPSoundingRecord) pluginDao .newObject(); - record.setPluginName(pluginName); record.setDataTime(dataTime); record.setLatitude((double) latArray.getFloat(i)); record.setLongitude((double) lonArray.getFloat(i)); @@ -182,7 +182,7 @@ public class NPPSoundingDecoder extends AbstractNPPDecoder { } else if (sourceNumDims == 1) { read1D(records, var, name); } - } else if (sourceNumDims == 1 && destNumDims == 2) { + } else if ((sourceNumDims == 1) && (destNumDims == 2)) { read1Dto2D(records, var, name); } } @@ -209,8 +209,8 @@ public class NPPSoundingDecoder extends AbstractNPPDecoder { String parameter) throws IOException { int numLevels = var.getDimension(0).getLength(); Array data = var.read(); - for (int i = 0; i < records.length; i++) { - PointDataView pdv = records[i].getPointDataView(); + for (NPPSoundingRecord record : records) { + PointDataView pdv = record.getPointDataView(); for (int j = 0; j < numLevels; j++) { float value = data.getFloat(j); pdv.setFloat(parameter, value, j); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.nwsauth/utility/common_static/base/roles/userRoles.xml b/edexOsgi/com.raytheon.uf.edex.plugin.nwsauth/utility/common_static/base/roles/userRoles.xml index 91752e1a0c..7d6bc4cda1 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.nwsauth/utility/common_static/base/roles/userRoles.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.nwsauth/utility/common_static/base/roles/userRoles.xml @@ -92,6 +92,8 @@ + + com.raytheon.localization.site/common_static/purge @@ -125,6 +127,8 @@ com.raytheon.localization.site/common_static/roles com.raytheon.localization.site/common_static/datadelivery com.raytheon.localization.site/common_static/archiver/purger + com.raytheon.localization.site/common_static/archiver/purger/retention + com.raytheon.localization.site/common_static/archiver/purger/case diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.preciprate/src/com/raytheon/uf/edex/plugin/preciprate/PrecipRateGenerator.java b/edexOsgi/com.raytheon.uf.edex.plugin.preciprate/src/com/raytheon/uf/edex/plugin/preciprate/PrecipRateGenerator.java index 2457c47d68..9f26511832 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.preciprate/src/com/raytheon/uf/edex/plugin/preciprate/PrecipRateGenerator.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.preciprate/src/com/raytheon/uf/edex/plugin/preciprate/PrecipRateGenerator.java @@ -49,8 +49,9 @@ import com.raytheon.uf.edex.plugin.preciprate.common.PrecipRateConfig; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 01/25/10 3796 D. Hladky Initial release - * 02/25/13 1660 D. Hladky Fixed SCAN configuration bug. + * Jan 25, 2010 3796 D. Hladky Initial release + * Feb 25, 2013 1660 D. Hladky Fixed SCAN configuration bug. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -59,15 +60,15 @@ import com.raytheon.uf.edex.plugin.preciprate.common.PrecipRateConfig; */ public class PrecipRateGenerator extends CompositeProductGenerator implements -MonitorConfigListener{ - + MonitorConfigListener { + private static final IUFStatusHandler statusHandler = UFStatus .getHandler(PrecipRateGenerator.class); private static final String genName = "PrecipRate"; private static final String productType = "preciprate"; - + /** run configuration manager **/ public SCANRunSiteConfigurationManager srcm = null; @@ -99,7 +100,7 @@ MonitorConfigListener{ if (!configValid) { statusHandler.handle(Priority.WARN, - "Configuration for PrecipRate(scan) is invalid!!!"); + "Configuration for PrecipRate(scan) is invalid!!!"); return; } @@ -137,7 +138,6 @@ MonitorConfigListener{ PrecipRateRecord precipRateRec = new PrecipRateRecord(); this.setPluginDao(new PrecipRateDao(productType)); - precipRateRec.setPluginName(this.getCompositeProductType()); precipRateRec.setDataTime(this.getProductTime()); precipRateRec.setIcao(preciprate_config.getIcao()); precipRateRec.setGateResolution(preciprate_config.getDHR() @@ -166,8 +166,7 @@ MonitorConfigListener{ precipRateRec.setAcoefficent(pr.getDhrMap().get( DHRValues.ZRMULTCOEFF)); - precipRateRec.setBias(pr.getDhrMap().get( - DHRValues.BIAS)); + precipRateRec.setBias(pr.getDhrMap().get(DHRValues.BIAS)); precipRateRec.setHailcap(pr.getDhrMap().get( DHRValues.MAXPRECIPRATEALLOW)); precipRateRec.setCoefficent(pr.getDhrMap().get( @@ -193,12 +192,13 @@ MonitorConfigListener{ @Override public void configChanged(MonitorConfigEvent fce) { if (fce.getSource() instanceof SCANRunSiteConfigurationManager) { - statusHandler.handle(Priority.INFO, - "Re-configuring PrecipRate URI filters...Run Site Config change"); + statusHandler + .handle(Priority.INFO, + "Re-configuring PrecipRate URI filters...Run Site Config change"); resetFilters(); } } - + /** * run config manager * diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java b/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java index b8c39b423c..5c77463dda 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java @@ -45,8 +45,8 @@ import com.raytheon.uf.edex.database.plugin.PluginFactory; import com.raytheon.uf.edex.plugin.qc.dao.QCDao; /** - * Scans NetCDF files generated by A1 legacy applications and generates - * QCRecord instances that refer to their records. + * Scans NetCDF files generated by A1 legacy applications and generates QCRecord + * instances that refer to their records. * *
  * 
@@ -58,6 +58,7 @@ import com.raytheon.uf.edex.plugin.qc.dao.QCDao;
  * Mar 07, 2013 15842      D. Friedman Use Java NetCDF library instead of
  *                                     pupynere
  * May 16, 2013 1869       bsteffen    Remove DataURI column from qc.
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
  * 
  * 
* @@ -66,7 +67,7 @@ import com.raytheon.uf.edex.plugin.qc.dao.QCDao; */ public class QCScanner { private static final transient IUFStatusHandler statusHandler = UFStatus - .getHandler(QCScanner.class); + .getHandler(QCScanner.class); private Integer maxRecordsInChunk; @@ -123,8 +124,10 @@ public class QCScanner { private static final int ID_LENGTH = 24; private class QCDirectoryScanner { - private String qcType; - private File directory; + private final String qcType; + + private final File directory; + private QCDao qcDao; public QCDirectoryScanner(String qcType, File directory) { @@ -140,8 +143,9 @@ public class QCScanner { try { scanFile(fn); } catch (Exception e) { - statusHandler.error(String.format("error reading %s/%s: %s", - directory, fn, e.getMessage()), e); + statusHandler.error(String.format( + "error reading %s/%s: %s", directory, fn, + e.getMessage()), e); } } } @@ -151,60 +155,68 @@ public class QCScanner { NetcdfFile nc = NetcdfFile.open(new File(directory, fn).toString()); try { int index = qcDao.getMaxRecordIndex(qcType, fn); - if (index < 0) + if (index < 0) { index = 0; - else + } else { index += 1; + } int nRecords = nc.getUnlimitedDimension().getLength(); - if (index >= nRecords) + if (index >= nRecords) { return; + } String[] idVariablesNames = nc - .findGlobalAttribute("idVariables") - .getStringValue().split(","); + .findGlobalAttribute("idVariables").getStringValue() + .split(","); String[] timeVariableNames = nc - .findGlobalAttribute("timeVariables") - .getStringValue().split(","); + .findGlobalAttribute("timeVariables").getStringValue() + .split(","); Variable[] idVariables = new Variable[idVariablesNames.length]; - for (int i = 0; i < idVariables.length; ++i) + for (int i = 0; i < idVariables.length; ++i) { idVariables[i] = nc.findVariable(idVariablesNames[i]); + } Variable vObsTime = nc.findVariable(timeVariableNames[0]); - double vObsTimeFillValue = vObsTime.findAttribute("_FillValue").getNumericValue().doubleValue(); + double vObsTimeFillValue = vObsTime.findAttribute("_FillValue") + .getNumericValue().doubleValue(); Double vObsTimeMissingValue = null; Attribute a = vObsTime.findAttribute("missing_value"); - if (a != null) + if (a != null) { vObsTimeMissingValue = a.getNumericValue().doubleValue(); + } Variable vLat = nc.findVariable("latitude"); Variable vLon = nc.findVariable("longitude"); Variable vElev = nc.findVariable("elevation"); while (index < nRecords) { - PluginDataObject[] records = new PluginDataObject[Math.min(maxRecordsInChunk, nRecords - index)]; + PluginDataObject[] records = new PluginDataObject[Math.min( + maxRecordsInChunk, nRecords - index)]; int[] ofs = new int[] { index }; int[] len = new int[] { records.length }; Section sec = new Section(); - sec.appendRange(index, index + records.length - 1); + sec.appendRange(index, (index + records.length) - 1); sec.appendRange(); Array dObsTime = vObsTime.read(ofs, len); Array dLat = vLat.read(ofs, len); Array dLon = vLon.read(ofs, len); Array dElev = vElev.read(ofs, len); ArrayChar[] dIDs = new ArrayChar[idVariables.length]; - for (int i = 0; i < dIDs.length; ++i) + for (int i = 0; i < dIDs.length; ++i) { dIDs[i] = (ArrayChar) idVariables[i].read(sec); + } int ri = 0; int oi = 0; while (ri < records.length) { QCRecord r = new QCRecord(); - r.setPluginName("qc"); double obsTime = dObsTime.getDouble(ri); - if (obsTime != vObsTimeFillValue && - (vObsTimeMissingValue == null || - vObsTimeMissingValue != obsTime)) { - r.setDataTime(new DataTime(new Date((long)(obsTime * 1000)))); + if ((obsTime != vObsTimeFillValue) + && ((vObsTimeMissingValue == null) || (vObsTimeMissingValue != obsTime))) { + r.setDataTime(new DataTime(new Date( + (long) (obsTime * 1000)))); SurfaceObsLocation loc = new SurfaceObsLocation(); - loc.assignLocation(dLat.getDouble(ri), dLon.getDouble(ri)); + loc.assignLocation(dLat.getDouble(ri), + dLon.getDouble(ri)); loc.setElevation(dElev.getInt(ri)); - StringBuilder stationId = new StringBuilder(ID_LENGTH); + StringBuilder stationId = new StringBuilder( + ID_LENGTH); for (ArrayChar idArray : dIDs) { stationId.append(idArray.getString(ri)); } @@ -218,8 +230,9 @@ public class QCScanner { ++index; ++ri; } - if (oi < records.length) + if (oi < records.length) { records = Arrays.copyOf(records, oi); + } target.acceptRecords(records); } } finally { diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.qpf/src/com/raytheon/uf/edex/plugin/qpf/QPFGenerator.java b/edexOsgi/com.raytheon.uf.edex.plugin.qpf/src/com/raytheon/uf/edex/plugin/qpf/QPFGenerator.java index 750eecde04..918988688f 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.qpf/src/com/raytheon/uf/edex/plugin/qpf/QPFGenerator.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.qpf/src/com/raytheon/uf/edex/plugin/qpf/QPFGenerator.java @@ -49,10 +49,11 @@ import com.raytheon.uf.edex.plugin.qpf.common.QPFConfig; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 02/07/2009 1981 dhladky Initial Creation. - * 04/27/2012 #562 dgilling Accept getter and setter - * renames in QPFRecord. - * 02/25/13 1660 D. Hladky Fixed configuration bug in scan. + * Feb 07, 2009 1981 dhladky Initial Creation. + * Apr 27, 2012 562 dgilling Accept getter and setter renames in + * QPFRecord. + * Feb 25, 2013 1660 D. Hladky Fixed configuration bug in scan. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -164,7 +165,6 @@ public class QPFGenerator extends CompositeProductGenerator implements .getNumBins()); } - qpfRec.setPluginName(this.getCompositeProductType()); qpfRec.setIcao(qpf_config.getIcao()); qpfRec.setDataTime(this.getProductTime()); qpfRec.setSpatialInfo(qpf_config.getSpatialInfo()); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/src/com/raytheon/uf/edex/plugin/satellite/mcidas/McidasSatelliteDecoder.java b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/src/com/raytheon/uf/edex/plugin/satellite/mcidas/McidasSatelliteDecoder.java index 45d31869c2..c55436c775 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/src/com/raytheon/uf/edex/plugin/satellite/mcidas/McidasSatelliteDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.satellite.mcidas/src/com/raytheon/uf/edex/plugin/satellite/mcidas/McidasSatelliteDecoder.java @@ -98,7 +98,8 @@ public class McidasSatelliteDecoder { /** * - * @param data The file byte array data to be decoded. + * @param data + * The file byte array data to be decoded. * @return The decoded data record(s). * @return * @throws Exception @@ -160,13 +161,13 @@ public class McidasSatelliteDecoder { /* int creationHhmmss = */buf.getInt(); int bandMap1to32 = buf.getInt(); int bandMap33to64 = buf.getInt(); - buf.position(buf.position() + 4 * 4); // sensor specific - buf.position(buf.position() + 4 * 8); // memo + buf.position(buf.position() + (4 * 4)); // sensor specific + buf.position(buf.position() + (4 * 8)); // memo int areaNumber = buf.getInt(); int dataBlockOffset = buf.getInt(); int navBlockOffset = buf.getInt(); /* int validityCode = */buf.getInt(); - buf.position(buf.position() + 8 * 4); // PDL + buf.position(buf.position() + (8 * 4)); // PDL buf.getInt(); // GOES AA band 8 /* int imageYyyddd = */buf.getInt(); /* int imageHhmmssOrMillis = */buf.getInt(); @@ -176,7 +177,7 @@ public class McidasSatelliteDecoder { /* int prefixBandListLength = */buf.getInt(); buf.getInt(); // source type buf.getInt(); // cal type - buf.position(buf.position() + 3 * 4); // reserved + buf.position(buf.position() + (3 * 4)); // reserved /* int originalSourceType = */buf.getInt(); // actually a 4cc? /* int units = */buf.getInt(); // also 4cc? /* int scaling = */buf.getInt(); @@ -218,7 +219,8 @@ public class McidasSatelliteDecoder { rec.setCoverage(coverage); // TODO: Line pad if not a multiple of four bytes - if (linePrefixLength == 0 && nBytesPerElement == 1 && nBands == 1) { + if ((linePrefixLength == 0) && (nBytesPerElement == 1) + && (nBands == 1)) { byte[] imageBytes = new byte[nLines * nElementsPerLine]; buf.position(dataBlockOffset); buf.get(imageBytes); @@ -227,7 +229,7 @@ public class McidasSatelliteDecoder { } else if (nBytesPerElement == 1) { byte[] imageBytes = new byte[nLines * nElementsPerLine]; - int si = dataBlockOffset + ri * nBytesPerElement; + int si = dataBlockOffset + (ri * nBytesPerElement); int di = 0; int eincr = nBands * nBytesPerElement; for (int y = 0; y < nLines; ++y) { @@ -243,7 +245,6 @@ public class McidasSatelliteDecoder { rec.setTraceId(traceId); rec.setPersistenceTime(TimeTools.getSystemCalendar().getTime()); - rec.setPluginName("satellite"); rec.constructDataURI(); // Set the data into the IDataRecord @@ -303,22 +304,22 @@ public class McidasSatelliteDecoder { double dy = spacingAtStdLatInMeters * yImgRes; double phi0r = clat * DTR; - double rxp = ((double) (elementOfEquator - ulX) / xImgRes + 1.); - double ryp = (ny - (double) (lineOfEquator - ulY) / yImgRes); + double rxp = (((double) (elementOfEquator - ulX) / xImgRes) + 1.); + double ryp = (ny - ((double) (lineOfEquator - ulY) / yImgRes)); double dxp = 1. - rxp; double dyp = 1. - ryp; double rm = dx * dyp; double rcos = radiusInMeters * Math.cos(phi0r); double arg = Math.exp(rm / rcos); - la1 = (float) ((2. * Math.atan(arg) - HALFPI) * RTD); - lo1 = (float) prnlon((clon + ((dx * dxp) / rcos) * RTD)); + la1 = (float) (((2. * Math.atan(arg)) - HALFPI) * RTD); + lo1 = (float) prnlon((clon + (((dx * dxp) / rcos) * RTD))); dxp = nx - rxp; dyp = ny - ryp; rm = dx * dyp; arg = Math.exp(rm / rcos); - la2 = (float) ((2. * Math.atan(arg) - HALFPI) * RTD); - lo2 = (float) prnlon((clon + ((dx * dxp) / rcos) * RTD)); + la2 = (float) (((2. * Math.atan(arg)) - HALFPI) * RTD); + lo2 = (float) prnlon((clon + (((dx * dxp) / rcos) * RTD))); lo2 = (float) prnlon(lo2); result = SatSpatialFactory.getInstance().getMapCoverage( @@ -332,11 +333,11 @@ public class McidasSatelliteDecoder { } private static double prnlon(double lon) { - double dlon = lon - (int) (lon / 360.f) * 360.f; + double dlon = lon - ((int) (lon / 360.f) * 360.f); if (lon < -180.) { dlon = lon + 360.f; } else if (lon > 180.) { - dlon = (double) (lon - 360.); + dlon = lon - 360.; } return dlon; } @@ -345,12 +346,12 @@ public class McidasSatelliteDecoder { Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT")); cal.setTimeInMillis(0); - cal.set(Calendar.YEAR, +1900 + yyyddd / 1000); + cal.set(Calendar.YEAR, +1900 + (yyyddd / 1000)); cal.set(Calendar.DAY_OF_YEAR, yyyddd % 1000); int hh = hhmmss / 10000; cal.set(Calendar.HOUR_OF_DAY, hh); - cal.set(Calendar.MINUTE, (hhmmss - hh * 10000) / 100); + cal.set(Calendar.MINUTE, (hhmmss - (hh * 10000)) / 100); cal.set(Calendar.SECOND, hhmmss % 100); return cal; @@ -358,9 +359,9 @@ public class McidasSatelliteDecoder { private static double unpackDdmmss(int ddmmss) { int dd = ddmmss / 10000; - int mm = (ddmmss - dd * 10000) / 100; + int mm = (ddmmss - (dd * 10000)) / 100; int ss = ddmmss % 100; - return dd + mm / 60.0 + ss / 3600.0; + return dd + (mm / 60.0) + (ss / 3600.0); } private static double flipLon(double lon, boolean flip) { diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.scan/src/com/raytheon/uf/edex/plugin/scan/ScanGenerator.java b/edexOsgi/com.raytheon.uf.edex.plugin.scan/src/com/raytheon/uf/edex/plugin/scan/ScanGenerator.java index 406bef6cc3..2ac2dfd8a9 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.scan/src/com/raytheon/uf/edex/plugin/scan/ScanGenerator.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.scan/src/com/raytheon/uf/edex/plugin/scan/ScanGenerator.java @@ -56,7 +56,8 @@ import com.raytheon.uf.edex.dat.utils.ScanDataCache; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 02/25/13 1660 D. Hladky Fixed SCAN configuration bug. + * Feb 25, 2013 1660 D. Hladky Fixed SCAN configuration bug. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -102,13 +103,14 @@ public class ScanGenerator extends CompositeProductGenerator implements try { getRunConfig().readConfigXml(); } catch (SerializationException e) { - statusHandler.handle(Priority.ERROR, "Couldn't read scan configuration!!!", e); + statusHandler.handle(Priority.ERROR, + "Couldn't read scan configuration!!!", e); } boolean configValid = getRunConfig().isPopulated(); if (!configValid) { statusHandler.handle(Priority.WARN, - "Configuration for SCAN is invalid!!!"); + "Configuration for SCAN is invalid!!!"); return; } @@ -203,7 +205,6 @@ public class ScanGenerator extends CompositeProductGenerator implements ScanRecord scanRec = new ScanRecord(); scanRec.setType(type); scanRec.setTilt(sfilter.getTilt(table)); - scanRec.setPluginName(this.getCompositeProductType()); scanRec.setIcao(sfilter.getIcao()); scanRec.setLastElevationAngle(tables.get(table) .getLastElevationAngle()); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.svrwx/src/com/raytheon/uf/edex/plugin/svrwx/decoder/SvrWxParser.java b/edexOsgi/com.raytheon.uf.edex.plugin.svrwx/src/com/raytheon/uf/edex/plugin/svrwx/decoder/SvrWxParser.java index f0091efed4..ed760110c2 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.svrwx/src/com/raytheon/uf/edex/plugin/svrwx/decoder/SvrWxParser.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.svrwx/src/com/raytheon/uf/edex/plugin/svrwx/decoder/SvrWxParser.java @@ -51,7 +51,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Jan 04, 2010 jsanchez Initial creation + * Jan 04, 2010 jsanchez Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -61,23 +62,23 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; public class SvrWxParser { /** The logger */ - private Log logger = LogFactory.getLog(getClass()); + private final Log logger = LogFactory.getLog(getClass()); private final PointDataDescription pointDataDescription; private final SvrWxRecordDao svrWxDao; - private Map containerMap; + private final Map containerMap; private WMOHeader wmoHeader; - private String pluginName; + private final String pluginName; private String traceId; int currentReport = -1; - private HashMap URI_MAP = new HashMap(); + private final HashMap URI_MAP = new HashMap(); private List reports; @@ -260,13 +261,12 @@ public class SvrWxParser { parseTimeRangeLine(rpt.getReportLine()); break; case REPORT_TYPE: - if (reportType != null && eventKey != null) { + if ((reportType != null) && (eventKey != null)) { SurfaceObsLocation location = new SurfaceObsLocation( stationId); location.setLongitude(longitude.doubleValue()); location.setLatitude(latitude.doubleValue()); svrWxRecord = new SvrWxRecord(); - svrWxRecord.setPluginName(pluginName); svrWxRecord.setReportType(reportType); svrWxRecord.setGreenTime(greenTime); svrWxRecord.setLocation(location); @@ -278,13 +278,12 @@ public class SvrWxParser { clearData(); break; case EVENT_LN: - if (reportType != null && eventKey != null) { + if ((reportType != null) && (eventKey != null)) { SurfaceObsLocation location = new SurfaceObsLocation( stationId); location.setLongitude(longitude.doubleValue()); location.setLatitude(latitude.doubleValue()); svrWxRecord = new SvrWxRecord(); - svrWxRecord.setPluginName(pluginName); svrWxRecord.setReportType(reportType); svrWxRecord.setGreenTime(greenTime); svrWxRecord.setLocation(location); @@ -301,19 +300,18 @@ public class SvrWxParser { break; case EXTRA: String s = rpt.getReportLine().trim(); - if (s.length() != 0 && remarks != null) { + if ((s.length() != 0) && (remarks != null)) { remarks += " " + s; } break; case END: - if (reportType != null && eventKey != null) { + if ((reportType != null) && (eventKey != null)) { SurfaceObsLocation location = new SurfaceObsLocation( stationId); location.setLongitude(longitude.doubleValue()); location.setLatitude(latitude.doubleValue()); svrWxRecord = new SvrWxRecord(); svrWxRecord.setReportType(reportType); - svrWxRecord.setPluginName(pluginName); svrWxRecord.setGreenTime(greenTime); svrWxRecord.setLocation(location); svrWxRecord.setDataTime(refTime); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/HURData.java b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/HURData.java index 83d4ce4b2d..3606a81a11 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/HURData.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/HURData.java @@ -39,173 +39,190 @@ import com.vividsolutions.jts.geom.Coordinate; * TODO Add Description * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Oct 26, 2009            jsanchez     Initial creation
- *
+ * Oct 26, 2009            jsanchez    Initial creation
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
+ * 
  * 
- * + * * @author jsanchez - * @version 1.0 + * @version 1.0 */ -public class HURData extends TCGDataAdapter{ - - private List forecastTimes = new ArrayList(); - - private HashMap> coordinates = new HashMap>(); - - public HURData(PointDataDescription pdd, TropicalCycloneGuidanceDao dao, String pluginName) { - super(pdd,dao,pluginName); +public class HURData extends TCGDataAdapter { + + private final List forecastTimes = new ArrayList(); + + private final HashMap> coordinates = new HashMap>(); + + public HURData(PointDataDescription pdd, TropicalCycloneGuidanceDao dao, + String pluginName) { + super(pdd, dao, pluginName); } - - public List findReports(byte [] message) { - + + @Override + public List findReports(byte[] message) { + List reports = new ArrayList(); List parts = InternalReport.identifyMessage(message); - - if(parts != null) { + + if (parts != null) { clearData(); - for(InternalReport iRpt : parts) { + for (InternalReport iRpt : parts) { InternalType t = iRpt.getLineType(); String s = iRpt.getReportLine(); - if (InternalType.PRODUCT.equals(t)) { + if (InternalType.PRODUCT.equals(t)) { productType = s; } else if (InternalType.DATA_INFO.equals(t)) { parseDataInfo(s); } else if (InternalType.DATETIME_INFO.equals(t)) { parseDateTimeInfo(s); - } else if(InternalType.MODEL_INFO.equals(t)) { + } else if (InternalType.MODEL_INFO.equals(t)) { parseModelInfo(s); - } else if(InternalType.END.equals(t)) { - for(String model : coordinates.keySet()) { + } else if (InternalType.END.equals(t)) { + for (String model : coordinates.keySet()) { List list = coordinates.get(model); - if(list.size() == forecastTimes.size()) { + if (list.size() == forecastTimes.size()) { for (int i = 0; i < list.size(); i++) { TropicalCycloneGuidance rpt = new TropicalCycloneGuidance(); - SurfaceObsLocation location = new SurfaceObsLocation(stationId); + SurfaceObsLocation location = new SurfaceObsLocation( + stationId); location.setLongitude(list.get(i).x); location.setLatitude(list.get(i).y); - + rpt.setWmoHeader(wmoHeader.getWmoHeader()); rpt.setTraceId(traceId); - rpt.setPluginName(pluginName); rpt.setStormName(stormName); rpt.setType(stormType); rpt.setProductType(productType); - rpt.setModelName(model); + rpt.setModelName(model); rpt.setLocation(location); - rpt.setInsertTime(Calendar.getInstance(TimeZone.getTimeZone("GMT"))); + rpt.setInsertTime(Calendar.getInstance(TimeZone + .getTimeZone("GMT"))); DataTime dt; - if(i != 0){ + if (i != 0) { int fcstTime = new Double( - (forecastTimes.get(i).getValidTime().getTimeInMillis() - - refTime.getValidTime().getTimeInMillis())/1000L).intValue(); - dt = new DataTime(refTime.getRefTimeAsCalendar(),fcstTime); + (forecastTimes.get(i) + .getValidTime() + .getTimeInMillis() - refTime + .getValidTime() + .getTimeInMillis()) / 1000L) + .intValue(); + dt = new DataTime( + refTime.getRefTimeAsCalendar(), + fcstTime); } else { - dt = new DataTime(refTime.getRefTimeAsCalendar()); + dt = new DataTime( + refTime.getRefTimeAsCalendar()); } rpt.setDataTime(dt); reports.add(rpt); } - } + } } clearData(); - } + } } } return reports; } - + private void parseModelInfo(String modelInfo) { Pattern modelPtrn = Pattern.compile(InternalReport.MODEL_PTRN); Pattern latlonPtrn = Pattern.compile(InternalReport.LATLON_PTRN); Matcher m = modelPtrn.matcher(modelInfo); - if(m.find()) { + if (m.find()) { String model = m.group(); List coordinate = coordinates.get(model); if (coordinate == null) { coordinate = new ArrayList(); } m = latlonPtrn.matcher(modelInfo); - while(m.find()){ + while (m.find()) { String latlon[] = m.group().split(" "); int n = latlon.length - 1; - - double lon = Double.valueOf(latlon[n].trim().substring(0, latlon[n].length() - 1)); - double lat = Double.valueOf(latlon[0].trim().substring(0, latlon[0].length() - 1)); - lon = latlon[n].charAt(latlon[n].length() - 1) == 'E'? lon : lon * -1; - lat = latlon[0].charAt(latlon[0].length() - 1) == 'N'? lat : lat * -1; - - Coordinate c = new Coordinate(lon,lat); + double lon = Double.valueOf(latlon[n].trim().substring(0, + latlon[n].length() - 1)); + double lat = Double.valueOf(latlon[0].trim().substring(0, + latlon[0].length() - 1)); + + lon = latlon[n].charAt(latlon[n].length() - 1) == 'E' ? lon + : lon * -1; + lat = latlon[0].charAt(latlon[0].length() - 1) == 'N' ? lat + : lat * -1; + + Coordinate c = new Coordinate(lon, lat); coordinate.add(c); } coordinates.put(model, coordinate); - + } } - + private void parseDateTimeInfo(String dateTimeInfo) { - Pattern dateTimePtrn = Pattern.compile(InternalReport.DATETIME); + Pattern dateTimePtrn = Pattern.compile(InternalReport.DATETIME); Matcher m = dateTimePtrn.matcher(dateTimeInfo); while (m.find()) { - //YYMMDD HHMM - String yy = m.group().substring(0,2); - if(Integer.valueOf(yy) < 70) { + // YYMMDD HHMM + String yy = m.group().substring(0, 2); + if (Integer.valueOf(yy) < 70) { yy = "20" + yy; } else { yy = "19" + yy; } int year = Integer.valueOf(yy); - int month = Integer.valueOf(m.group().substring(2,4)); - int day = Integer.valueOf(m.group().substring(4,6)); - int hour = Integer.valueOf(m.group().substring(8,10)); + int month = Integer.valueOf(m.group().substring(2, 4)); + int day = Integer.valueOf(m.group().substring(4, 6)); + int hour = Integer.valueOf(m.group().substring(8, 10)); int minute = Integer.valueOf(m.group().substring(10)); - forecastTimes.add(getDataTime(year, month, day, hour, minute, "GMT")); + forecastTimes + .add(getDataTime(year, month, day, hour, minute, "GMT")); } } - + private void parseDataInfo(String dataInfo) { Pattern stationIdPtrn = Pattern.compile(InternalReport.STATIONID_PTRN); Pattern refTimePtrn = Pattern.compile(InternalReport.REFTIME_PTRN); Matcher m = stationIdPtrn.matcher(dataInfo); - - if(m.find()) { - stationId = m.group().substring(1,m.group().length()-1); + + if (m.find()) { + stationId = m.group().substring(1, m.group().length() - 1); } - + m = refTimePtrn.matcher(dataInfo); - if(m.find()){ - //Reference Time - //YYYYMMDD HHMM + if (m.find()) { + // Reference Time + // YYYYMMDD HHMM int year = Integer.valueOf(m.group().substring(0, 4)); int month = Integer.valueOf(m.group().substring(4, 6)); int day = Integer.valueOf(m.group().substring(6, 8)); - int hour = Integer.valueOf(m.group().substring(9,11)); + int hour = Integer.valueOf(m.group().substring(9, 11)); int minute = Integer.valueOf(m.group().substring(11)); - refTime = getDataTime(year, month, day, hour, minute,"UTC"); + refTime = getDataTime(year, month, day, hour, minute, "UTC"); } else { refTime = new DataTime(); } - + int index = setStormType(dataInfo); - + if (index != -1) { - stormName = dataInfo.substring(index,dataInfo.indexOf("(")).trim(); + stormName = dataInfo.substring(index, dataInfo.indexOf("(")).trim(); } } - - private void refreshMaps(){ + + private void refreshMaps() { coordinates.put("BAMS", null); coordinates.put("BAMD", null); coordinates.put("BAMD", null); coordinates.put("LBAR", null); } - - public void clearData(){ + + @Override + public void clearData() { refreshMaps(); forecastTimes.clear(); stationId = null; @@ -213,5 +230,5 @@ public class HURData extends TCGDataAdapter{ stormName = null; refTime = null; } - + } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/QLMData.java b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/QLMData.java index 0edd86c120..24ef9d6065 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/QLMData.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/QLMData.java @@ -40,11 +40,11 @@ import com.raytheon.uf.common.time.DataTime; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Oct 26, 2009 jsanchez Initial creation - * Jun 28, 2012 #826 dgilling Use wmoHeader headerDate to - * set refTime so times are set - * correctly when processing archive - * data. + * Oct 26, 2009 jsanchez Initial creation + * Jun 28, 2012 826 dgilling Use wmoHeader headerDate to set refTime + * so times are set correctly when + * processing archive data. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -67,7 +67,7 @@ public class QLMData extends TCGDataAdapter { } } - private List list = new ArrayList(); + private final List list = new ArrayList(); private static final int MAX_FORECASTS = 22; @@ -94,7 +94,7 @@ public class QLMData extends TCGDataAdapter { } else if (InternalType.FORECAST_POSITION_INFO.equals(t)) { parseForecastPositionInfo(s); } else if (InternalType.STORM_DISSIPATED.equals(t) - || list.size() == MAX_FORECASTS) { + || (list.size() == MAX_FORECASTS)) { boolean firstValue = true; for (ForecastPosition fp : list) { TropicalCycloneGuidance rpt = new TropicalCycloneGuidance(); @@ -105,7 +105,6 @@ public class QLMData extends TCGDataAdapter { rpt.setWmoHeader(wmoHeader.getWmoHeader()); rpt.setTraceId(traceId); - rpt.setPluginName(pluginName); rpt.setStormName(stormName); rpt.setType(stormType); rpt.setProductType(productType); diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/TCEData.java b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/TCEData.java index 4005da42e3..180c7a1e8c 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/TCEData.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.tcg/src/com/raytheon/uf/edex/plugin/tcg/decoder/TCEData.java @@ -37,76 +37,82 @@ import com.raytheon.uf.common.time.DataTime; * TODO Add Description * *
- *
+ * 
  * SOFTWARE HISTORY
- *
+ * 
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * Nov 12, 2009            jsanchez     Initial creation
- *
+ * Nov 12, 2009            jsanchez    Initial creation
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
+ * 
  * 
- * + * * @author jsanchez - * @version 1.0 + * @version 1.0 */ -public class TCEData extends TCGDataAdapter{ - +public class TCEData extends TCGDataAdapter { + private float latitude = -9999; - + private float longitude = -9999; - + private int month; - + private int year; - + private int day; - + private int hour; - + private int minute; - - public TCEData(PointDataDescription pdd, TropicalCycloneGuidanceDao dao, String pluginName) { - super(pdd,dao,pluginName); + + public TCEData(PointDataDescription pdd, TropicalCycloneGuidanceDao dao, + String pluginName) { + super(pdd, dao, pluginName); } - - public List findReports(byte [] message) { + + @Override + public List findReports(byte[] message) { List reports = new ArrayList(); List parts = InternalReport.identifyMessage(message); - if(parts != null) { + if (parts != null) { clearData(); - for(InternalReport iRpt : parts) { + for (InternalReport iRpt : parts) { InternalType t = iRpt.getLineType(); String s = iRpt.getReportLine(); if (InternalType.PRODUCT.equals(t)) { productType = s; - } else if(InternalType.STORM_TYPE_INFO.equals(t)){ + } else if (InternalType.STORM_TYPE_INFO.equals(t)) { parseStormTypeInfo(s); - } else if(InternalType.STATIONID.equals(t)){ + } else if (InternalType.STATIONID.equals(t)) { parseStationIdInfo(s); - } else if(InternalType.INIT_TIME_INFO.equals(t)){ + } else if (InternalType.INIT_TIME_INFO.equals(t)) { parseInitTimeInfo(s); - } else if(InternalType.TCE_REFHOUR.equals(t)){ + } else if (InternalType.TCE_REFHOUR.equals(t)) { parseRefhour(s); - } else if(InternalType.LATITUDE.equals(t)){ + } else if (InternalType.LATITUDE.equals(t)) { parseLatitude(s); - } else if(InternalType.LONGITUDE.equals(t)){ + } else if (InternalType.LONGITUDE.equals(t)) { parseLongitude(s); - } else if(InternalType.END.equals(t)){ - if(latitude != -9999 && longitude != -9999){ + } else if (InternalType.END.equals(t)) { + if ((latitude != -9999) && (longitude != -9999)) { TropicalCycloneGuidance rpt = new TropicalCycloneGuidance(); - SurfaceObsLocation location = new SurfaceObsLocation(stationId); - location.setLongitude((double)longitude); - location.setLatitude((double)latitude); + SurfaceObsLocation location = new SurfaceObsLocation( + stationId); + location.setLongitude((double) longitude); + location.setLatitude((double) latitude); rpt.setWmoHeader(wmoHeader.getWmoHeader()); rpt.setTraceId(traceId); - rpt.setPluginName(pluginName); rpt.setStormName(stormName); rpt.setType(stormType); - rpt.setProductType(productType); + rpt.setProductType(productType); rpt.setLocation(location); - rpt.setInsertTime(Calendar.getInstance(TimeZone.getTimeZone("GMT"))); - refTime = getDataTime(year, month, day, hour, minute, "GMT"); - DataTime dt = new DataTime(refTime.getRefTimeAsCalendar()); + rpt.setInsertTime(Calendar.getInstance(TimeZone + .getTimeZone("GMT"))); + refTime = getDataTime(year, month, day, hour, minute, + "GMT"); + DataTime dt = new DataTime( + refTime.getRefTimeAsCalendar()); rpt.setDataTime(dt); reports.add(rpt); } @@ -116,65 +122,66 @@ public class TCEData extends TCGDataAdapter{ } return reports; } - - private void parseStormTypeInfo(String stormTypeInfo){ + + private void parseStormTypeInfo(String stormTypeInfo) { int index = setStormType(stormTypeInfo); if (index != -1) { String temp[] = stormTypeInfo.substring(index).trim().split(" "); stormName = temp[0]; } } - - private void parseStationIdInfo(String stationIdInfo){ + + private void parseStationIdInfo(String stationIdInfo) { Pattern p = Pattern.compile("(\\w{2,2}\\d{6,6})"); Matcher m = p.matcher(stationIdInfo); - if(m.find()){ + if (m.find()) { stationId = m.group(); } } - - private void parseInitTimeInfo(String initTimeInfo){ + + private void parseInitTimeInfo(String initTimeInfo) { String parts[] = getParts(initTimeInfo, 7); month = MONTH_MAP.get(parts[4]); day = Integer.parseInt(parts[5]); year = Integer.parseInt(parts[6]); } - - private void parseRefhour(String refhourInfo){ + + private void parseRefhour(String refhourInfo) { Pattern p = Pattern.compile("(\\d{4,4})"); Matcher m = p.matcher(refhourInfo); - if(m.find()){ - hour = Integer.parseInt(m.group().substring(0,2)); + if (m.find()) { + hour = Integer.parseInt(m.group().substring(0, 2)); minute = Integer.parseInt(m.group().substring(2)); } } - - private void parseLatitude(String latitudeInfo){ + + private void parseLatitude(String latitudeInfo) { Pattern p = Pattern.compile(InternalReport.LAT_PTRN); Matcher m = p.matcher(latitudeInfo); - if(m.find()){ + if (m.find()) { latitude = Float.parseFloat(m.group().substring(8).trim()); - if (latitudeInfo.contains("SOUTH")){ + if (latitudeInfo.contains("SOUTH")) { latitude *= -1; } } - + } - - private void parseLongitude(String longitudeInfo){ + + private void parseLongitude(String longitudeInfo) { Pattern p = Pattern.compile(InternalReport.LON_PTRN); Matcher m = p.matcher(longitudeInfo); - if(m.find()){ + if (m.find()) { longitude = Float.parseFloat(m.group().substring(10).trim()); - if(longitudeInfo.contains("WEST")){ + if (longitudeInfo.contains("WEST")) { longitude *= -1; - } else if (longitudeInfo.contains("SOUTH") && latitude > 0){ + } else if (longitudeInfo.contains("SOUTH") && (latitude > 0)) { latitude *= -1; } } } - - public void clearData(){ + + @Override + public void clearData() { latitude = -9999; longitude = -9999; stationId = null; diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.tcs/src/com/raytheon/uf/edex/plugin/tcs/decoder/TCMData.java b/edexOsgi/com.raytheon.uf.edex.plugin.tcs/src/com/raytheon/uf/edex/plugin/tcs/decoder/TCMData.java index 3d2da99d16..826f3ef328 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.tcs/src/com/raytheon/uf/edex/plugin/tcs/decoder/TCMData.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.tcs/src/com/raytheon/uf/edex/plugin/tcs/decoder/TCMData.java @@ -48,9 +48,10 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Oct 20, 2010 jsanchez Initial creation - * Apr 19, 2012 #457 dgilling Use TimeTools.findDataTime() - * to calculate times. + * Oct 20, 2010 jsanchez Initial creation + * Apr 19, 2012 457 dgilling Use TimeTools.findDataTime() to + * calculate times. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -144,7 +145,7 @@ public class TCMData extends TCSDataAdapter { } } - if (name == null || name.length() == 0) { + if ((name == null) || (name.length() == 0)) { m = stormNamePtrn.matcher(line); if (m.find()) { name = m.group(2); @@ -175,11 +176,11 @@ public class TCMData extends TCSDataAdapter { break; } // Searching for the press - if (pressure == 0 && line.contains(" PRESSURE ")) { + if ((pressure == 0) && line.contains(" PRESSURE ")) { m = pressurePtrn.matcher(line); if (m.find()) { pressure = Integer.parseInt(m.group(2)); - if (pressure < 800 || pressure > 1050) { + if ((pressure < 800) || (pressure > 1050)) { pressure = 0; } continue; @@ -192,7 +193,7 @@ public class TCMData extends TCSDataAdapter { m = windPtrn.matcher(line.replace("-", "")); if (m.find()) { int wind = Integer.parseInt(m.group(2)); - storm.setWindSpeed(wind > 0 && wind < 250 ? wind : 0); + storm.setWindSpeed((wind > 0) && (wind < 250) ? wind : 0); continue; } } @@ -208,9 +209,9 @@ public class TCMData extends TCSDataAdapter { String mask = line; // Searching for the wind radius if (Util.isWindRadius(type, mask, radius)) { - if (radius.getKFUnit() != 'x' && radius.getKT_FT() != -1 - && radius.getNE() != -1 && radius.getSE() != -1 - && radius.getSW() != -1 && radius.getNW() != -1) { + if ((radius.getKFUnit() != 'x') && (radius.getKT_FT() != -1) + && (radius.getNE() != -1) && (radius.getSE() != -1) + && (radius.getSW() != -1) && (radius.getNW() != -1)) { boolean exist = false; ArrayList radiusList = storm.getRadiusList(); @@ -234,12 +235,11 @@ public class TCMData extends TCSDataAdapter { } if (isLocation && !storm.getDisplayTime().equals("") - && storm.getWindSpeed() != 0) { + && (storm.getWindSpeed() != 0)) { storm.setTropical(!isExtraTropical); storm.setName(name); storm.setPressure(pressure); storm.setProductType(type.toString()); - storm.setPluginName(pluginName); stormList.add(storm); // Reset values @@ -272,7 +272,7 @@ public class TCMData extends TCSDataAdapter { break; } } - if (k < stormList.size() || storm.getDisplayTime().equals(time)) { + if ((k < stormList.size()) || storm.getDisplayTime().equals(time)) { continue; } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.vaa/src/com/raytheon/uf/edex/plugin/vaa/decoder/VAAParser.java b/edexOsgi/com.raytheon.uf.edex.plugin.vaa/src/com/raytheon/uf/edex/plugin/vaa/decoder/VAAParser.java index eebebc431f..43b20a9e02 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.vaa/src/com/raytheon/uf/edex/plugin/vaa/decoder/VAAParser.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.vaa/src/com/raytheon/uf/edex/plugin/vaa/decoder/VAAParser.java @@ -43,7 +43,8 @@ import com.raytheon.uf.edex.wmo.message.WMOHeader; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Nov 05, 2009 3267 jkorman Initial creation + * Nov 05, 2009 3267 jkorman Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -69,13 +70,13 @@ public class VAAParser implements Iterable { public String shapeType; } - private String pluginName; + private final String pluginName; - private WMOHeader wmoHeader; + private final WMOHeader wmoHeader; - private String traceId; + private final String traceId; - private List records = new ArrayList(); + private final List records = new ArrayList(); private List reports; @@ -115,7 +116,6 @@ public class VAAParser implements Iterable { VAARecord vaa = new VAARecord(); vaa.setTraceId(traceId); - vaa.setPluginName(pluginName); vaa.setWmoHeader(wmoHeader.getWmoHeader()); String cor = wmoHeader.getBBBIndicator(); if (cor != null) { diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.vil/src/com/raytheon/uf/edex/plugin/vil/VILGenerator.java b/edexOsgi/com.raytheon.uf.edex.plugin.vil/src/com/raytheon/uf/edex/plugin/vil/VILGenerator.java index 43ba2ad369..9e3632848c 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.vil/src/com/raytheon/uf/edex/plugin/vil/VILGenerator.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.vil/src/com/raytheon/uf/edex/plugin/vil/VILGenerator.java @@ -49,8 +49,9 @@ import com.raytheon.uf.edex.plugin.vil.common.VILConfig; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 02/07/2009 2037 dhladky Initial Creation. - * 02/25/13 1660 D. Hladky Fixed SCAN configuration bug. + * Feb 07, 2009 2037 dhladky Initial Creation. + * Feb 25, 2013 1660 D. Hladky Fixed SCAN configuration bug. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -69,7 +70,7 @@ public class VILGenerator extends CompositeProductGenerator implements /** Set of icaos to filter for */ private Set icaos = null; - + /** run configuration manager **/ public SCANRunSiteConfigurationManager srcm = null; @@ -119,7 +120,7 @@ public class VILGenerator extends CompositeProductGenerator implements if (!configValid) { statusHandler.handle(Priority.WARN, - "Configuration for vil(scan) is invalid!!!"); + "Configuration for vil(scan) is invalid!!!"); return; } @@ -157,7 +158,6 @@ public class VILGenerator extends CompositeProductGenerator implements vilRec.setDy(ScanUtils.SCAN_GRID_DIM_RESOLUTION / 2); } - vilRec.setPluginName(this.getCompositeProductType()); vilRec.setIcao(vil_config.getIcao()); vilRec.setDataTime(this.getProductTime()); vilRec.setSpatialInfo(vil_config.getSpatialInfo()); @@ -190,7 +190,7 @@ public class VILGenerator extends CompositeProductGenerator implements resetFilters(); } } - + /** * run config manager * diff --git a/edexOsgi/com.raytheon.uf.edex.python.decoder/src/com/raytheon/uf/edex/python/decoder/PythonDecoder.java b/edexOsgi/com.raytheon.uf.edex.python.decoder/src/com/raytheon/uf/edex/python/decoder/PythonDecoder.java index 73921b93f0..753979938d 100644 --- a/edexOsgi/com.raytheon.uf.edex.python.decoder/src/com/raytheon/uf/edex/python/decoder/PythonDecoder.java +++ b/edexOsgi/com.raytheon.uf.edex.python.decoder/src/com/raytheon/uf/edex/python/decoder/PythonDecoder.java @@ -49,6 +49,7 @@ import com.vividsolutions.jts.io.WKTReader; * ------------ ---------- ----------- -------------------------- * Sep 22, 2008 njensen Initial creation * Nov 24, 2008 chammack Camel Refactor + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author njensen @@ -79,12 +80,13 @@ public class PythonDecoder extends AbstractDecoder { public PluginDataObject[] decode(File file) throws Exception { - List decodedObjects = new ArrayList(0); + List decodedObjects = new ArrayList( + 0); PythonScript py = null; long id = Thread.currentThread().getId(); try { - if (!cache || cachedInterpreters.get(id) == null) { + if (!cache || (cachedInterpreters.get(id) == null)) { py = PythonDecoderFactory.makePythonDecoder(pluginFQN, moduleName); } else { @@ -130,7 +132,7 @@ public class PythonDecoder extends AbstractDecoder { public List asPluginDataObjects(List result) throws Exception { List decodedObjects = null; - if (result == null || result.isEmpty()) { + if ((result == null) || result.isEmpty()) { decodedObjects = new ArrayList(0); } else { if (result.get(0) instanceof Map) { @@ -142,11 +144,9 @@ public class PythonDecoder extends AbstractDecoder { ArrayList> resultList = (ArrayList>) result; PluginDataObject record = (PluginDataObject) recordClass .newInstance(); - record.setPluginName(pluginName); BeanMap bm = BeanMap.create(record); for (HashMap map : resultList) { record = (PluginDataObject) recordClass.newInstance(); - record.setPluginName(pluginName); bm.setBean(record); try { for (String key : map.keySet()) { @@ -167,17 +167,17 @@ public class PythonDecoder extends AbstractDecoder { private Object transformValue(String key, Object val, BeanMap bm) { Class type = bm.getPropertyType(key); if (type != null) { - if (type.equals(Calendar.class) && val instanceof Long) { + if (type.equals(Calendar.class) && (val instanceof Long)) { Calendar cal = Calendar.getInstance(TimeZone .getTimeZone("Zulu")); cal.setTimeInMillis((Long) val); val = cal; - } else if (type.equals(DataTime.class) && val instanceof Long) { + } else if (type.equals(DataTime.class) && (val instanceof Long)) { Calendar cal = Calendar.getInstance(TimeZone .getTimeZone("Zulu")); cal.setTimeInMillis((Long) val); val = new DataTime(cal); - } else if (type.equals(Geometry.class) && val instanceof String) { + } else if (type.equals(Geometry.class) && (val instanceof String)) { val = buildGeometry((String) val); } } @@ -206,10 +206,10 @@ public class PythonDecoder extends AbstractDecoder { for (String coord : coords) { counter++; if ((counter % 2) == 0) { - buf.append(Double.parseDouble(coord) / -100 + " " + buf.append((Double.parseDouble(coord) / -100) + " " + tempbuf.toString() + ", "); if (counter == 2) { - firstpt.append(Double.parseDouble(coord) / -100 + " " + firstpt.append((Double.parseDouble(coord) / -100) + " " + tempbuf.toString() + ", "); } tempbuf.delete(0, tempbuf.length()); diff --git a/nativeLib/rary.ohd.pproc/src/nc2grib/TEXT/main_nc2grib.c b/nativeLib/rary.ohd.pproc/src/nc2grib/TEXT/main_nc2grib.c index 65d485b2c0..c9cab33640 100644 --- a/nativeLib/rary.ohd.pproc/src/nc2grib/TEXT/main_nc2grib.c +++ b/nativeLib/rary.ohd.pproc/src/nc2grib/TEXT/main_nc2grib.c @@ -34,7 +34,7 @@ * a text file requires no code change as long as the parameters don't change. * That logic could perhaps change as well. * -* The routine first uses standard C calls to read the netcdf file. The structure +* The routine first uses standard C calls to read the NetCDF file. The structure * of that file can be reviewed by reading the GFE help reference section on the * ifpnetCDF command. * @@ -61,12 +61,16 @@ * * Version 4 allows users to combine all GRIB messages into one file. This becomes useful * when dealing with a lot of files for a parameter such as 1 hour QPF or temperature that -* goes out to 240 hours. +* goes out to num_hours hours. * * This is still a work in progress and code can always be improved to increase efficiency. * * Oct 2011 - PTilles - added read of new token for defining number of days of data to process * +* Mar 2012 - PTilles - added functionality to allow for more than 10 days (more than 240 +* hours) of data in one file to be processed. This looks for a value of '10' +* in the 5th parameter of gfe2grib.txt. +* * Sep 2012 -Dan Stein - The original nc2grib program assumed the first variable in the * NetCDF file (variable[0]) would be the data variable to be converted to grib format. The * nc2grib tool was hard-coded to only look at variable[0]. In AWIPS-II, GFE began putting @@ -93,9 +97,14 @@ #include "packgrib.h" #include "getopt.h" - #include "cmapf.h" +/*#include "version_info.h"*/ +#define VERSION_NAME "AWIPS II" +#define VERSION_NUMBER "13.5.2" +#define VERSION_DATE "(Oct 30, 2013)" + + #define SECINHR 3600. #define PATH_LEN 500 #define FILE_LEN 300 @@ -200,23 +209,24 @@ int nc2grib_main (int argc, char *argv[]) char adayhrmin[7]={'\0'}; /* day, hour, minute info attached to WMO header */ - - int numgfeparms=0; - + char cnum[3] = {'\0'}; + int num_hours = 0; /* (num_days * 24) */ + /* number of days of data to process - read from token - previously hard coded as 10 */ + /* default value = 10 - if token not found then default value used */ + int num_days = 0; int numgfiles=0; /* number of grib files for combining files into one if desired */ - char *gfiles[240]; /* array of char pointers for holding grib filenames if combining files */ /* for reading the NetCDF file */ - int NetCDF_ID; /* Netcdf id */ - int ndims; /* number of dimensions */ + int NetCDF_ID; /* NetCDF id */ + int numDims; /* number of dimensions */ int numVars; /* number of variables */ - int ngatts; /* number of attributes */ - int recdim; + int numGlobalAttributes; /* number of attributes */ + int unlimitedDimensionID; long start[] = {0, 0, 0}; /* start at first value */ long start1r[] = {0, 0}; /* accounts for netcdf with only 1 record and 2 dimensions of y,x */ @@ -261,9 +271,9 @@ int nc2grib_main (int argc, char *argv[]) double *latlonLL, *latlonUR, lonOrigin,*domainOrigin, *domainExtent, *latLonOrigin; int *gridPointLL, *gridPointUR; double x1, y1, x2, y2, lat1, lon1, lat2, lon2; - nc_type vt_type, dn_type, ll_type, d_type, g_type; + nc_type dataType, dn_type, ll_type, d_type, g_type; nc_type varDataType; - int vt_len, ll_len, d_len, g_len; + int attributeLength, ll_len, d_len, g_len; int variableID, *gridSize; int numberOfVariableDimensions; int dimensionIDVector[MAX_VAR_DIMS]; @@ -274,7 +284,7 @@ int nc2grib_main (int argc, char *argv[]) char cdfunits[MAX_NC_NAME]={'\0'}; char projection[MAX_NC_NAME]={'\0'}; long dim_size; - float *cdfvargrid=NULL; /* this is the main array holding the actual data values */ + float *cdfDataArray=NULL; /* this is the main array holding the actual data values */ float arraysize; long *validTimes; @@ -361,7 +371,7 @@ int nc2grib_main (int argc, char *argv[]) output_buffer = (size_t *) malloc (sizeof(size_t)*odim); /* output buffer used when writing GRIB message */ - int variableFound = FALSE; /* Is the variable present in the NetCDF file? Stein Sep 2012 */ + int variableFound = FALSE; /* Is the variable present in the NetCDF file? */ /* output_buffer = (int *) malloc (sizeof(int)*odim); /* output buffer used when writing GRIB message */ @@ -378,7 +388,7 @@ int nc2grib_main (int argc, char *argv[]) /* parse command line arguments */ - while ((c = getopt(argc, argv, ":n:i:t:o::b:p:g:Nfrqhv1")) != -1) { + while ((c = getopt(argc, argv, ":n:i:t:o::b:p:g:Nfrqhv1V")) != -1) { switch (c) { @@ -710,6 +720,10 @@ int nc2grib_main (int argc, char *argv[]) case '1': /* process only one record of NetCDF, useful for debugging */ time1flag++; break; + case 'V': + printf("version number = %s-%s\n",VERSION_NAME,VERSION_NUMBER); + exit(0); + break; case ':': /* for options that need an operand */ if(optopt != 'o') { @@ -738,7 +752,8 @@ int nc2grib_main (int argc, char *argv[]) printf("Unrecognized program command line option: -%c\n", optopt); errflag++; } - } + + } /* while c = getopt */ if (errflag || helpflag || argc==1 || ( iflag==0 || pflag==0) ) @@ -753,6 +768,24 @@ int nc2grib_main (int argc, char *argv[]) return USAGE; } +/* Print CHPS build number */ + printf("version number = %s-%s\n",VERSION_NAME,VERSION_NUMBER); + + if(getAppsDefaults("nc2g_num_days",cnum) == -1) + { + num_days = 10; + } + else + { + + num_days = atoi(cnum); + } + + num_hours = num_days * 24; + + char *gfiles[num_hours]; /* array of char pointers for holding grib filenames if combining files */ + + printf("\n number of days to process = %d \n", num_days); if(nc_getAppsDefaults("nc2g_app_dir",appsdir) == -1) { @@ -805,7 +838,7 @@ int nc2grib_main (int argc, char *argv[]) /**************************************************************************/ /* debugflag > 0; debug option is on */ - if(debugflag>0) + if(debugflag) printf("\n Debug option on...reading from GFE to GRIB configuation file:\n" \ " %s\n\n",file_path); @@ -817,9 +850,11 @@ int nc2grib_main (int argc, char *argv[]) if(fileline[0] != '#') /* check for comments */ { - sscanf(fileline,"%s%s%d%d%d%d%d",gfe2grib.GFEParameterName, gfe2grib.gfename, &gfe2grib.processid, - &gfe2grib.gribnum,&gfe2grib.decscale, &gfe2grib.timerange, &gfe2grib.timeunit); - if(debugflag>0) + sscanf(fileline,"%s%s%d%d%d%d%d",gfe2grib.GFEParameterName, + gfe2grib.gfename, &gfe2grib.processid, + &gfe2grib.gribnum,&gfe2grib.decscale, &gfe2grib.timerange, + &gfe2grib.timeunit); + if(debugflag) printf(" DEBUG: Read in from gfe2grib.txt %s %s %d %d %d %d %d \n",gfe2grib.GFEParameterName, gfe2grib.gfename, gfe2grib.processid, gfe2grib.gribnum,gfe2grib.decscale, gfe2grib.timerange, gfe2grib.timeunit); @@ -828,12 +863,12 @@ int nc2grib_main (int argc, char *argv[]) if (!(strcmp(gfe2grib.GFEParameterName, process))) { - found = 1; break; } - } - } + } /* If not a comment */ + + } /* While we haven't reach the end of the gfe2grib.txt file */ @@ -851,13 +886,12 @@ int nc2grib_main (int argc, char *argv[]) fclose(fp); - /* open the Netcdf file*/ + /* open the NetCDF file*/ if(inpath==NULL) { inpath=(char *) malloc(sizeof(char)*(FILE_LEN+1)); - if(inpath==NULL) { printf(" ERROR: Something went wrong with memory allocation for the NetCDF input directory....exiting\n"); @@ -871,12 +905,13 @@ int nc2grib_main (int argc, char *argv[]) printf(" ERROR: Invalid token value for token \"netcdf_dir\".\n\t Program exit."); return APSDEFERR; } - else if (debugflag>0) + else if (debugflag) { printf(" Default path for the input NetCDF file not specified...Will use the following:\n" \ " %s\n",inpath); } - } + } /* if inpath is NULL */ + /***************************************************************************/ else if(debugflag) printf(" Will attempt to read NetCDF file from this path:\n" \ @@ -895,32 +930,21 @@ int nc2grib_main (int argc, char *argv[]) if (NetCDF_ID==-1) { - printf("\n ERROR: Could not open the netcdf file: %s\n", fn); + printf("\n ERROR: Could not open the NetCDF file: %s\n", fn); return CDFERR; } else { - printf ("\n Netcdf file %s was opened successfully.\n\n",fn); + printf ("\n NetCDF file %s was opened successfully.\n\n",fn); } - /* Inquire about the Netcdf file: No.of dimensions, No.of variables, - No. of global attributes etc.*/ + /* Inquire about the NetCDF file: No.of dimensions, No.of variables, No.of + * global attributes etc. + */ - ncinquire (NetCDF_ID, &ndims, &numVars, &ngatts, &recdim); -/*************************************************************************/ -/* debug */ + ncinquire (NetCDF_ID, &numDims, &numVars, &numGlobalAttributes, &unlimitedDimensionID); -if (debugflag >0) -{ - printf("\n Debug option on. Debug info from reading the netcdf file follows:\n\n"); - printf (" Number of dimensions for this netcdf file is: %d\n",ndims); - printf (" Number of variables for this netcdf file is: %d\n",numVars); - printf (" Number of global attributes for this netcdf file is: %d\n",ngatts); -} -/*************************************************************************/ - - /************************************************************************** - * Sep 2012 - Stein The utility that takes GFE data and converts it to + /* Sep 2012 - Stein The utility that takes GFE data and converts it to * NetCDF format is ifpNetCDF. To the best of my knowledge, this utility * always puts exactly one variable and exactly one history variable into * each NetCDF file. The section of code below originally assumed that the @@ -930,7 +954,7 @@ if (debugflag >0) * For whatever reason, this order was changed in AWIPS-II so that the * history variable showed up first and the program wouldn't work. I was * tasked with correcting this program to make it order independent. My - * solution was to loop through all the variables to see whether the + * solution is to loop through all the variables to see whether the * variable we're looking for is in the NetCDF file. If it is, variableID * is set to it's value. If not found, the program will exit as it did * before. @@ -989,11 +1013,6 @@ if (debugflag >0) * end of the section of code that I changed. */ - - - - - if(numberOfVariableDimensions==3) /* in some cases, this may not be true if file is produced from MPE/DQC */ { for (i=0; i0) return CDFERR; } /*************************************************************************/ -if (debugflag >0) + if (debugflag) { printf(" DEBUG: cdfvar dimension %d: name=%s size=%ld\n",i+1,dimname,dim_size); } /*************************************************************************/ - } - } + } /* for i */ + + } /* if (numberOfVariableDimensions == 3) */ + else if (numberOfVariableDimensions==2) { - for (i=0; i0) else if (i==1) x=dim_size; /*************************************************************************/ -if (debugflag >0) +if (debugflag) { printf(" DEBUG: cdfvar dimension %d: name=%s size=%ld\n",i+1,dimname,dim_size); } /*************************************************************************/ - } - } + } /* for i */ + + } /* else if (numberOfVariableDimensions == 2) */ + else { printf("\n nc2grib is not coded to handle %d number of dimensions for variable %s.\n" \ @@ -1055,17 +1077,29 @@ if (debugflag >0) /* get variable attributes */ + /* get the values of NetCDF attributes given the variable ID and name */ arraysize = x * y; - cdfvargrid = (float *) malloc (sizeof(float)*arraysize); + cdfDataArray = (float *) malloc (sizeof(float) * arraysize); long count[]={1,y,x}; long count1r[]={y,x}; - ncattinq(NetCDF_ID,variableID,"validTimes",&vt_type,&vt_len); +if (debugflag) +{ + printf ("DEBUG: ncattinq call Before\n"); +} - validTimes = (long *) malloc(vt_len * nctypelen(vt_type)); + /* Get Information about an Attribute (att inquiry) */ + ncattinq(NetCDF_ID, variableID, "validTimes", &dataType, &attributeLength); + +if (debugflag) +{ + printf ("DEBUG: ncattinq call After\n"); +} + + validTimes = (long *) malloc (attributeLength * nctypelen(dataType)); ncattget(NetCDF_ID, variableID, "validTimes", validTimes); @@ -1077,6 +1111,8 @@ if (debugflag >0) ncattget(NetCDF_ID, variableID, "projectionType", projection); + + /* Get Information about an Attribute (att inquiry) */ ncattinq(NetCDF_ID,variableID,"latLonLL",&ll_type,&ll_len); latlonLL = (double *) malloc(ll_len * nctypelen(ll_type)); @@ -1087,30 +1123,40 @@ if (debugflag >0) ncattget(NetCDF_ID, variableID, "latLonUR", (void *) latlonUR); + + /* Get Information about an Attribute (att inquiry) */ ncattinq(NetCDF_ID,variableID,"domainOrigin",&d_type,&d_len); domainOrigin = (double *) malloc(d_len * nctypelen(d_type)); ncattget(NetCDF_ID, variableID, "domainOrigin", (void *) domainOrigin); + + /* Get Information about an Attribute (att inquiry) */ ncattinq(NetCDF_ID,variableID,"domainExtent",&d_type,&d_len); domainExtent = (double *) malloc(d_len * nctypelen(d_type)); ncattget(NetCDF_ID, variableID, "domainExtent", (void *) domainExtent); + + /* Get Information about an Attribute (att inquiry) */ ncattinq(NetCDF_ID,variableID,"gridSize",&g_type,&g_len); gridSize = (int *) malloc(g_len * nctypelen(g_type)); ncattget(NetCDF_ID, variableID, "gridSize", (void *) gridSize); + + /* Get Information about an Attribute (att inquiry) */ ncattinq(NetCDF_ID,variableID,"gridPointLL",&g_type,&g_len); gridPointLL = (int *) malloc(g_len * nctypelen(g_type)); ncattget(NetCDF_ID, variableID, "gridPointLL", (void *) gridPointLL); + + /* Get Information about an Attribute (att inquiry) */ ncattinq(NetCDF_ID,variableID,"gridPointUR",&g_type,&g_len); gridPointUR = (int *) malloc(g_len * nctypelen(g_type)); @@ -1119,8 +1165,8 @@ if (debugflag >0) /* initialize the array to missing value */ - for (i=0;i0) { printf(" DEBUG: siteID = %s\n",siteID); - printf(" DEBUG: number of valid times = %d type = %d\n",vt_len, vt_type); + printf(" DEBUG: number of valid times = %d type = %d\n",attributeLength, dataType); printf(" DEBUG: descriptName = %s\n",descriptName); printf(" DEBUG: projection = %s\n",projection); @@ -1344,7 +1390,7 @@ if (debugflag >0) } else { - printf(" Unknown projection read from netcdf...Exiting"); + printf(" Unknown projection read from NetCDF...Exiting"); return CDFERR; /* might account for this as this is a lat,lon grid */ @@ -1602,16 +1648,15 @@ if (debugflag>0) */ - if (time1flag>0) /* for testing only to do just the first valid time from the netcdf file */ - vt_len=2; + if (time1flag>0) /* for testing only to do just the first valid time from the NetCDF file */ + attributeLength=2; /****************************************************************************/ if (debugflag>0) printf("\n ***Entering main loop to process NetCDF records(s) into GRIB files*** \n\n"); /****************************************************************************/ - for (m=0; m0) fcsth=0; - /* In the case of multiple accumulation periods in the same netcdf file, will need to attach this to the + /* In the case of multiple accumulation periods in the same NetCDF file, will need to attach this to the filename in both cases. Can't reuse fcsth as it might be needed to determine the WMO header for any future NPVU estimate/observed grids. */ @@ -1714,14 +1759,14 @@ if (debugflag>0) - if (esth > 240 || esth < 0) + if (esth > num_hours || esth < 0) { - printf(" The estimated/observed time period is either less than 0 or greater than 10 days (240 hours).\n" \ + printf(" The estimated/observed time period is either less than 0 or greater than %d hours.\n" \ " Therefore, valid times within the input NetCDF filename may not have been generated \n" \ " correctly. Or this is actually a forecast grid and the -b option should be used so it \n" \ " will be processed correctly. Check your options and ensure this is an estimate or observed grid\n" \ " You could also try to generate the file again.\n" \ - " For debug esth = %d\n",esth); + " For debug esth = %d\n",num_hours, esth); return FILEERR; } @@ -1784,13 +1829,13 @@ if (debugflag>0) printf(" DEBUG: fcsth = %d timediff=%f valid time = %ld basis time_t = %ld\n",fcsth, timediff,(*(validTimes+m+1)), basetime_t); /*************************************************************/ - if (fcsth > 240 || fcsth < 0) + if (fcsth > num_hours || fcsth < 0) { - printf(" The forecast time is either less than 0 or greater than 10 days (240 hours).\n" \ + printf(" The forecast time is either less than 0 or greater than %d hours.\n" \ " Therefore, the basis time may not be specified correctly or may need to be specified \n" \ " on the command line according to guidance. Please check your command options or \n" \ " or the NetCDF file creation and try again.\n" \ - " for debug fcsth = %d\n",fcsth); + " for debug fcsth = %d\n",num_hours, fcsth); return FILEERR; } @@ -1816,10 +1861,12 @@ if (debugflag >0) grib_lbl[16]=fcsth-(int)(timediff/SECINHR); /* P1 */ grib_lbl[17]=fcsth; /* P2 */ } - else if (gfe2grib.timerange==0) + else if (gfe2grib.timerange==0 || gfe2grib.timerange == 10) { /* this is for a forecast product valid at reference time + P1 and at present using this for PETF + OR + case of forecast hour > 255 */ grib_lbl[16]=fcsth; /* P1 */ @@ -1842,13 +1889,13 @@ if (debugflag >0) start[0]=(long) (m/2); - status = ncvarget(NetCDF_ID,variableID,start,count,cdfvargrid); + status = ncvarget(NetCDF_ID,variableID,start,count,cdfDataArray); } else if (numberOfVariableDimensions==2) { start1r[0]=(long) (m/2); - status = ncvarget(NetCDF_ID,variableID,start1r,count1r,cdfvargrid); + status = ncvarget(NetCDF_ID,variableID,start1r,count1r,cdfDataArray); } if (status != NC_NOERR) @@ -1862,7 +1909,7 @@ if (debugflag >0) for (i=0;i xmissing) + if((*(cdfDataArray+i))> xmissing) { mischek=1; break; @@ -1880,7 +1927,7 @@ if (debugflag >0) for (i=0;i0) for (i=0;i xmissing) + if((*(cdfDataArray+i))> xmissing) - *(cdfvargrid+i) *= 25.4; /* convert inches to mm */ + *(cdfDataArray+i) *= 25.4; /* convert inches to mm */ } } @@ -1920,9 +1967,9 @@ if (debugflag >0) for (i=0;i xmissing) + if((*(cdfDataArray+i))> xmissing) - *(cdfvargrid+i) = ((*(cdfvargrid+i)-32) * 5/9) + 273.16; /* convert F to K */ + *(cdfDataArray+i) = ((*(cdfDataArray+i)-32) * 5/9) + 273.16; /* convert F to K */ } @@ -1931,9 +1978,9 @@ if (debugflag >0) { for (i=0;i xmissing) - - *(cdfvargrid+i) += 273.16; /* convert C to K */ + if((*(cdfDataArray+i))> xmissing) + + *(cdfDataArray+i) += 273.16; /* convert C to K */ } } @@ -1953,9 +2000,9 @@ if (debugflag >0) for (i=0;i xmissing) + if((*(cdfDataArray+i))> xmissing) - *(cdfvargrid+i) *= 0.3048; /* convert feet to meters */ + *(cdfDataArray+i) *= 0.3048; /* convert feet to meters */ } } @@ -1983,9 +2030,8 @@ if (debugflag >0) } /*************************************************************************/ - - status = packgrib(grib_lbl,pds_ext,&iplen,cdfvargrid,&idim,&xmissing, - output_buffer,&odim,&length); + status = packgrib(grib_lbl, pds_ext, &iplen, cdfDataArray, &idim, + &xmissing, output_buffer,&odim,&length); if (status !=0) { @@ -2206,7 +2252,7 @@ if(debugflag) sprintf(ofn,ofn,fcsth); /* standard forecast product using forecast hours past basis time */ - } + } /* if (bflag) */ else /* without a basis time, this has to be an estimated/observed product using the valid time in the output file. Note that if "%%" is NULL and bflag == 0, specifying esth here is ignored in the output filename. @@ -2340,7 +2386,7 @@ if(debugflag>0) - if(bflag && qflag==0) /* old - strstr(process,"QPE")==NULL && strstr(process,"qpe")==NULL) */ + if(bflag && qflag==0) /* old - strstr(GFEParameterName,"QPE")==NULL && strstr(process,"qpe")==NULL) */ { if(debugflag>0) @@ -2357,6 +2403,7 @@ if(debugflag>0) /* first write out the main GRIB file using the copygb command without the header determined above to a temporary holding file. This file will now contain the QPF forecast on GRID218 at 10km resolution */ + copygb_main_(command); /* status = system(command); */ } @@ -2768,8 +2815,8 @@ if (debugflag >0) if(output_buffer!=NULL) free(output_buffer); - if(cdfvargrid!=NULL) - free(cdfvargrid); + if(cdfDataArray!=NULL) + free(cdfDataArray); if(gribdir!=NULL) free(gribdir); @@ -2868,15 +2915,15 @@ int timet_to_userformat_ansi(time_t timet, char *ansi, char* userformat) int display_usage(void) { printf("\n\n nc2grib GFE NetCDF to GRIB1 translator, usage:\n\n" \ - "./nc2grib.LX -n (input netcdf path) -i (netcdf file) -t (output grib path) -o (output grib file) \n" \ + "./nc2grib.LX -n (input NetCDF path) -i (NetCDF file) -t (output grib path) -o (output grib file) \n" \ " -b (basis time) -p (process ID) -g (one GRIB filename) -f -N -v -h\n" \ "where:\n" \ - "-n (input netcdf path) Refers to the path containing the NetCDF file\n" \ - " Optional, requires argument generated by the GFE routine ifpnetCDF.\n" \ + "-n (input NetCDF path) Refers to the path containing the NetCDF file\n" \ + " Optional, requires argument generated by the GFE routine ifpNetCDF.\n" \ " If not used, the token netcdf_dir will be used \n" \ " to retrieve this information\n\n" \ - "-i (input netcdf file) Refers to the NetCDF file generated in the format\n" \ - " Required, requires argument used by the GFE routine ifpnetCDF.\n\n" \ + "-i (input NetCDF file) Refers to the NetCDF file generated in the format\n" \ + " Required, requires argument used by the GFE routine ifpNetCDF.\n\n" \ " NOTE that this command line option and its argument\n" \ " must be specified in the call to nc2grib.\n\n" \ "-t (output grib path) Refers to the path of the GRIB file(s) generated by nc2grib.\n" \ @@ -2893,7 +2940,7 @@ int display_usage(void) " Required for forecast Example: -b 2009051412 \n" \ " grids and QPE grids going to \n" \ " NPVU,requires argument \n\n" \ - "-p (process ID) Refers to the parameter process ID relating to a GFE parameter\n" \ + "-p (GFEParameterName ID) Refers to the parameter process ID relating to a GFE parameter\n" \ " Required, requires argument such as QPF. Needs to match against a process in the gfe2grib.txt\n" \ " configuration file.\n" \ " NOTE that this command line option and its argument \n" \ @@ -2935,10 +2982,6 @@ int display_usage(void) return 0; -/* ============== Statements containing RCS keywords: */ -{static char rcs_id1[] = "$Source: /fs/hseb/ob9d/ohd/pproc/src/nc2grib/RCS/main_nc2grib.c,v $"; - static char rcs_id2[] = "$Id: main_nc2grib.c,v 1.2 2010/06/14 15:04:32 millerd Exp $";} -/* =================================================== */ - } + diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.airmet/src/gov/noaa/nws/ncep/common/dataplugin/airmet/AirmetRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.airmet/src/gov/noaa/nws/ncep/common/dataplugin/airmet/AirmetRecord.java index 6f067b1de7..87501866f8 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.airmet/src/gov/noaa/nws/ncep/common/dataplugin/airmet/AirmetRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.airmet/src/gov/noaa/nws/ncep/common/dataplugin/airmet/AirmetRecord.java @@ -60,110 +60,103 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "airmet", - indexes = { - @Index(name = "airmet_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "airmet", indexes = { @Index(name = "airmet_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize +public class AirmetRecord extends PluginDataObject { - -public class AirmetRecord extends PluginDataObject{ - - /** + /** * */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - // reportType is AIRMET. - @Column(length=32) - @DataURI(position=4) - @DynamicSerializeElement - private String reportType; - - // reportName will be SIERRA, TANGO, or ZULU - @Column(length=32) - @DataURI(position=1) - @DynamicSerializeElement - private String reportName; - - // WMO header - @Column(length=32) - @DataURI(position=2) - @DynamicSerializeElement - private String wmoHeader; - - // The issue office where the report from - @Column(length=32) - @DynamicSerializeElement - private String issueOffice; - - // Update number as: 1, 2, 3, ... - @Column - @DataURI(position=3) - @DynamicSerializeElement - private Integer updateNumber; - - // Issue time of the report - @Column - @DynamicSerializeElement - private Calendar issueTime; - - // The designator - @Column(length=8) - @DynamicSerializeElement - private String designatorBBB; - - // CorrectionFlag is a flag: 0 for normal, 1 for COR or CC, 2 for AMD, and 3 for TEST - /* - * CorrectionFlag is a flag: - * 0 for normal, 1 for COR or CC, 2 for AMD, 3 for TEST, and 4 for NIL report - */ - @Column + // reportType is AIRMET. + @Column(length = 32) + @DataURI(position = 4) @DynamicSerializeElement - private Integer correctionFlag; - - // The entire report - @Column(length=15000) - @DynamicSerializeElement - private String bullMessage; + private String reportType; + // reportName will be SIERRA, TANGO, or ZULU + @Column(length = 32) + @DataURI(position = 1) + @DynamicSerializeElement + private String reportName; - /** - * Airmet report - */ - @DynamicSerializeElement - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - @JoinColumn(name = "parentID", nullable = false) + // WMO header + @Column(length = 32) + @DataURI(position = 2) + @DynamicSerializeElement + private String wmoHeader; + + // The issue office where the report from + @Column(length = 32) + @DynamicSerializeElement + private String issueOffice; + + // Update number as: 1, 2, 3, ... + @Column + @DataURI(position = 3) + @DynamicSerializeElement + private Integer updateNumber; + + // Issue time of the report + @Column + @DynamicSerializeElement + private Calendar issueTime; + + // The designator + @Column(length = 8) + @DynamicSerializeElement + private String designatorBBB; + + // CorrectionFlag is a flag: 0 for normal, 1 for COR or CC, 2 for AMD, and 3 + // for TEST + /* + * CorrectionFlag is a flag: 0 for normal, 1 for COR or CC, 2 for AMD, 3 for + * TEST, and 4 for NIL report + */ + @Column + @DynamicSerializeElement + private Integer correctionFlag; + + // The entire report + @Column(length = 15000) + @DynamicSerializeElement + private String bullMessage; + + /** + * Airmet report + */ + @DynamicSerializeElement + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @JoinColumn(name = "parentID", nullable = false) @Index(name = "airmetReport_parentid_idex") - private Set airmetReport = new HashSet(); + private Set airmetReport = new HashSet(); - - /** + /** * Default Convstructor */ public AirmetRecord() { - this.issueOffice=""; - this.wmoHeader=""; - this.bullMessage=""; - this.designatorBBB=""; - this.updateNumber=0; - this.reportType=""; - this.reportName=null; - this.correctionFlag=0; + this.issueOffice = ""; + this.wmoHeader = ""; + this.bullMessage = ""; + this.designatorBBB = ""; + this.updateNumber = 0; + this.reportType = ""; + this.reportName = null; + this.correctionFlag = 0; } /** * Convstructs an airmet record from a dataURI * - * @param uri The dataURI + * @param uri + * The dataURI */ public AirmetRecord(String uri) { super(uri); } - @Override public IDecoderGettable getDecoderGettable() { // TODO Auto-generated method stub @@ -171,172 +164,180 @@ public class AirmetRecord extends PluginDataObject{ } /** - * @return the issueOffice - */ - public String getIssueOffice(){ - return issueOffice; - } + * @return the issueOffice + */ + public String getIssueOffice() { + return issueOffice; + } - /** - * @param issueOffice to set - */ - public void setIssueOffice(String issueOffice){ - this.issueOffice=issueOffice; - } - - /** - * @return the wmoHeader - */ - public String getWmoHeader(){ - return wmoHeader; - } + /** + * @param issueOffice + * to set + */ + public void setIssueOffice(String issueOffice) { + this.issueOffice = issueOffice; + } - /** - * @param wnoHeader to set - */ - public void setWmoHeader(String wmoHeader){ - this.wmoHeader=wmoHeader; - } - - /** - * @return the issueTime - */ - public Calendar getIssueTime(){ - return issueTime; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param issueTime to set - */ - public void setIssueTime(Calendar issueTime){ - this.issueTime=issueTime; - } - - /** - * @return the reportType - */ - public String getReportType() { - return reportType; - } + /** + * @param wnoHeader + * to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * @param reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } + /** + * @return the issueTime + */ + public Calendar getIssueTime() { + return issueTime; + } - /** - * @return the designatorBBB - */ - public String getDesignatorBBB() { - return designatorBBB; - } + /** + * @param issueTime + * to set + */ + public void setIssueTime(Calendar issueTime) { + this.issueTime = issueTime; + } - /** - * @param designatorBBB to set - */ - public void setDesignatorBBB(String designatorBBB) { - this.designatorBBB = designatorBBB; - } + /** + * @return the reportType + */ + public String getReportType() { + return reportType; + } - /** - * @return the correctionFlag - */ - public Integer getCorrectionFlag() { - return correctionFlag; - } + /** + * @param reportType + * to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } - /** - * @param correctionFlag to set - */ - public void setCorrectionFlag(Integer correctionFlag) { - this.correctionFlag = correctionFlag; - } + /** + * @return the designatorBBB + */ + public String getDesignatorBBB() { + return designatorBBB; + } - /** - * @return the updateNumber - */ - public Integer getUpdateNumber() { - return updateNumber; - } + /** + * @param designatorBBB + * to set + */ + public void setDesignatorBBB(String designatorBBB) { + this.designatorBBB = designatorBBB; + } - /** - * @param updateNumber to set - */ - public void setUpdateNumber(Integer updateNumber) { - this.updateNumber = updateNumber; - } + /** + * @return the correctionFlag + */ + public Integer getCorrectionFlag() { + return correctionFlag; + } - /** - * @return the bullMessage - */ - public String getBullMessage() { - return bullMessage; - } + /** + * @param correctionFlag + * to set + */ + public void setCorrectionFlag(Integer correctionFlag) { + this.correctionFlag = correctionFlag; + } - /** - * @param bullMessage to set - */ - public void setBullMessage(String bullMessage) { - this.bullMessage = bullMessage; - } - - /** - * @return the reportName - */ - public String getReportName() { - return reportName; - } + /** + * @return the updateNumber + */ + public Integer getUpdateNumber() { + return updateNumber; + } - /** - * @param reportName to set - */ - public void setReportName(String reportName) { - this.reportName = reportName; - } - - /** - * @return the set of AIRMET report - */ - public Set getAirmetReport() { - return airmetReport; - } + /** + * @param updateNumber + * to set + */ + public void setUpdateNumber(Integer updateNumber) { + this.updateNumber = updateNumber; + } - /** - * @param airmet the report to set - */ - public void setAirmetReport(Set curReport) { - this.airmetReport = curReport; - } + /** + * @return the bullMessage + */ + public String getBullMessage() { + return bullMessage; + } - /** - * @param add AirmetReport to set - */ - public void addAirmetReport(AirmetReport curReport){ - airmetReport.add(curReport); - //curReport.setParentID(this); - } - - /** - * Override existing set method to modify any - * classes that use the dataURI as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) - { + /** + * @param bullMessage + * to set + */ + public void setBullMessage(String bullMessage) { + this.bullMessage = bullMessage; + } - this.identifier = dataURI; - /* - if(this.getAirmetReport() != null && this.getAirmetReport().size() > 0) - { - for (Iterator iter = this.getAirmetReport().iterator(); iter.hasNext();) { - AirmetReport cs = iter.next(); - cs.setParentID(this); - } - }*/ - - } + /** + * @return the reportName + */ + public String getReportName() { + return reportName; + } + + /** + * @param reportName + * to set + */ + public void setReportName(String reportName) { + this.reportName = reportName; + } + + /** + * @return the set of AIRMET report + */ + public Set getAirmetReport() { + return airmetReport; + } + + /** + * @param airmet + * the report to set + */ + public void setAirmetReport(Set curReport) { + this.airmetReport = curReport; + } + + /** + * @param add + * AirmetReport to set + */ + public void addAirmetReport(AirmetReport curReport) { + airmetReport.add(curReport); + // curReport.setParentID(this); + } + + /** + * Override existing set method to modify any classes that use the dataURI + * as a foreign key + */ + @Override + public void setIdentifier(Object dataURI) { + + this.identifier = dataURI; + /* + * if(this.getAirmetReport() != null && this.getAirmetReport().size() > + * 0) { for (Iterator iter = + * this.getAirmetReport().iterator(); iter.hasNext();) { AirmetReport cs + * = iter.next(); cs.setParentID(this); } } + */ + + } @Override @Column @@ -344,4 +345,9 @@ public class AirmetRecord extends PluginDataObject{ public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "airmet"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.atcf/src/gov/noaa/nws/ncep/common/dataplugin/atcf/AtcfRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.atcf/src/gov/noaa/nws/ncep/common/dataplugin/atcf/AtcfRecord.java index 7707ba49d9..b646d7d64d 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.atcf/src/gov/noaa/nws/ncep/common/dataplugin/atcf/AtcfRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.atcf/src/gov/noaa/nws/ncep/common/dataplugin/atcf/AtcfRecord.java @@ -1,23 +1,3 @@ -/* - * - * AtcfRecord - * - * This class performs the mapping to the database tables for the Automated - * Tropical Cyclone Forecast (ATCF) Decoder Plug-In - * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ----------- -------------- ----------------------------------- - * 06/23/10 283 F. J. Yen Initial creation - * * - * This code has been developed by the SIB for use in the AWIPS2 system. - * - * - * @author F. J. Yen, SIB - * @version 1 - - */ - package gov.noaa.nws.ncep.common.dataplugin.atcf; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; @@ -55,13 +35,14 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 06/23/10 208 F. J. Yen Initial Coding. - * 03/10/12 606 G. Hull added reportType to URI - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Jun 23, 2010 208 F. J. Yen Initial Coding. + * Mar 10, 2012 606 G. Hull added reportType to URI + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. - * + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author F. J. Yen, SIB @@ -74,683 +55,681 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "atcf", - indexes = { - @Index(name = "atcf_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "atcf", indexes = { @Index(name = "atcf_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class AtcfRecord extends PluginDataObject { - private static final long serialVersionUID = 1L; - private static final float RMISSD = IDecoderConstantsN.FLOAT_MISSING; - private static final Integer IMISSD = IDecoderConstantsN.INTEGER_MISSING; - - /** Report type */ - @DataURI(position = 8) - @Column(length = 32) - @XmlElement - @DynamicSerializeElement - private String reportType; - - /** - * Basin, e.g. WP, IO, SH, CP, EP, AL, SL - */ - @DataURI(position = 1) - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String basin; - - /** - * Annual cyclone number; 1 through 99 - */ - @DataURI(position = 2) - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private int cycloneNum; - - /** - * Warning Date-Time - */ - @DataURI(position = 3) - @Column - @DynamicSerializeElement - @XmlElement - private Calendar warnTime; - - /** - * Objective technique sorting number/Minutes for best track: 00-99 - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private int techniqueNum; - - /** - * Objective Technique or CARQ or WRNG, BEST for best Track - */ - @DataURI(position = 4) - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String technique; - - /** - * TAU -- forecast Period: -24 through 120 hours, 0 for best-track, negative - * forecastHours used for CARQ and WRNG records. - */ - @DataURI(position = 5) - @Column - @DynamicSerializeElement - @XmlElement - private int fcstHour; - - /** - * Latitude (degrees) for the DTG: -900 through 900 - */ - @DynamicSerializeElement - @XmlElement - private float clat; - - /** - * Longitude (degrees) for the DTG: -1800 through 1800 - */ - @DynamicSerializeElement - @XmlElement - private float clon; - - /** - * Maximum sustained wind speed in knots: 0 through 300 - */ - @DynamicSerializeElement - @XmlElement - private float windMax; - - /** - * Minimum sea level pressure, 1 through 1100MB - */ - @DynamicSerializeElement - @XmlElement - private float mslp; - - /** - * Level of tropical cyclone development; such as DB, TD, TS, TY, ... - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String intensity; - - /** - * Wind intensity (kts) for the radii defined i this record: 34, 50, 64 - */ - @DataURI(position = 6) - @DynamicSerializeElement - @XmlElement - private float radWind; - - /** - * Radius Code for wind intensity: AAA = full circle; QQQ = quadrant (NNQ, - * NEQ, EEQ, SEQ, SSQ, SWQ, WWQ, NWQ) - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String radWindQuad; - - /** - * If full circle, radius of specified wind intensity. If semicircle or - * quadrant, radius of specified wind intensity of circle portion specified - * in radius code. 0 - 1200 nm. - */ - @DynamicSerializeElement - @XmlElement - private float quad1WindRad; - - /** - * If full circle, this field not used. If semicircle, radius (nm) of - * specified wind intensity for semicircle not specified in radius code. If - * quadrant, radius (nm) of specified wind intensity for 2nd quadrant - * (counting clockwise from quadrant specified in radius code). 0 - 1200 nm. - */ - @DynamicSerializeElement - @XmlElement - private float quad2WindRad; - - /** - * If full circle or semicircle this field not used. If quadrant, radius - * (nm) of specified wind intensity for 3rd quadrant (counting clockwise - * from quadrant specified in radius code). 0 - 1200 nm. - */ - @DynamicSerializeElement - @XmlElement - private float quad3WindRad; - - /** - * If full circle or semicircle this field not used. If quadrant, radius - * (nm) of specified wind intensity for 4th quadrant (counting clockwise - * from quadrant specified in radius code). 0 - 1200 nm. - */ - @DynamicSerializeElement - @XmlElement - private float quad4WindRad; - - /** - * Pressure in millibars of the last closed isobar. 900 - 1050 mb - */ - @DynamicSerializeElement - @XmlElement - private float closedP; - - /** - * Radius of the last closed isobar in nm. 0 - 9999 nm - */ - @DynamicSerializeElement - @XmlElement - private float radClosedP; - - /** - * Radius of max winds. 0 - 999 nm - */ - @DynamicSerializeElement - @XmlElement - private float maxWindRad; - - /** - * Gusts. 0 - 995 kts. - */ - @DynamicSerializeElement - @XmlElement - private float gust; - - /** - * Eye diameter. 0 - 999nm - */ - @DynamicSerializeElement - @XmlElement - private float eyeSize; - - /** - * Subregion code: A, B, C, E, L, P, Q, S, W - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String subRegion; - - /** - * Max seas: 0 through 999 ft. - */ - @DynamicSerializeElement - @XmlElement - private float maxSeas; - - /** - * Forecaster's initials, used for forecastHour 0 WRNG, up to 3 chars - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String forecaster; - - /** - * Storm direction in compass coordinates, 0 - 359 degrees - */ - @DynamicSerializeElement - @XmlElement - private float stormDrct; - - /** - * Storm speed. 0 - 999 kts - */ - @DynamicSerializeElement - @XmlElement - private float stormSped; - - /** - * Literal storm name, NONAME, or INVEST - */ - @DataURI(position = 7) - @Column(length = 32) - @DynamicSerializeElement - @XmlElement - private String stormName; - - /** - * System depth, D=deep, M=medium, S=shallow, X=unknown - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String stormDepth; - - /** - * Wave height for radii defined in seas1 - seas4. 0 - 99 ft. - */ - @DynamicSerializeElement - @XmlElement - private float radWave; - - /** - * Radius code for seas wave height - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String radWaveQuad; - - /** - * First quadrant seas radius as defined by radWaveQuad, 0 - 999 nm - */ - @DynamicSerializeElement - @XmlElement - private float quad1WaveRad; - - /** - * Second quadrant seas radius as defined by radWaveQuad, 0 - 999 nm - */ - @DynamicSerializeElement - @XmlElement - private float quad2WaveRad; - - /** - * Third quadrant seas radius as defined by radWaveQuad, 0 - 999 nm - */ - @DynamicSerializeElement - @XmlElement - private float quad3WaveRad; - - /** - * Fourth quadrant seas radius as defined by radWaveQuad, 0 - 999 nm - */ - @DynamicSerializeElement - @XmlElement - private float quad4WaveRad; - - /* - * 20 character description of format to follow in userData - */ - @Column(length = 20) - @DynamicSerializeElement - @XmlElement - private String userDefined; - - /* - * User data section as indicated by userDefined parameter - */ - @Column(length = 30) - @DynamicSerializeElement - @XmlElement - private String userData; - - /** - * Default Constructor - */ - public AtcfRecord() { - this.reportType="ATCF"; - this.basin = " "; - this.cycloneNum = IMISSD; - this.warnTime = null; - this.techniqueNum = IMISSD; - this.technique = " "; - this.fcstHour = IMISSD; - this.clat = RMISSD; - this.clon = RMISSD; - this.windMax = RMISSD; - this.mslp = RMISSD; - this.intensity = " "; - this.radWind = RMISSD; - this.radWindQuad = " "; - this.quad1WindRad = RMISSD; - this.quad2WindRad = RMISSD; - this.quad3WindRad = RMISSD; - this.quad4WindRad = RMISSD; - this.closedP = RMISSD; - this.radClosedP = RMISSD; - this.maxWindRad = RMISSD; - this.gust = RMISSD; - this.eyeSize = RMISSD; - this.subRegion = " "; - this.maxSeas = RMISSD; - this.forecaster = " "; - this.stormDrct = RMISSD; - this.stormSped = RMISSD; - this.stormName = " "; - this.stormDepth = " "; - this.radWave = RMISSD; - this.radWaveQuad = " "; - this.quad1WaveRad = RMISSD; - this.quad2WaveRad = RMISSD; - this.quad3WaveRad = RMISSD; - this.quad4WaveRad = RMISSD; - this.userDefined = " "; - this.userData = " "; - } - - /** - * Constructs a atcf record from a dataURI - * - * @param uri - * The dataURI - */ - public AtcfRecord(String uri) { - super(uri); - } - - @Override - public IDecoderGettable getDecoderGettable() { - // TODO Auto-generated method stub - return null; - } - - public String getReportType() { - return reportType; - } - - public void setReportType(String reportType) { - this.reportType = reportType; - } - - public String getBasin() { - return basin; - } - - public void setBasin(String basin) { - this.basin = basin; - } - - public int getCycloneNum() { - return cycloneNum; - } - - public void setCycloneNum(int cycloneNum) { - this.cycloneNum = cycloneNum; - } - - public Calendar getWarnTime() { - return warnTime; - } - - public void setWarnTime(Calendar warnTime) { - this.warnTime = warnTime; - } - - public int getTechniqueNum() { - return techniqueNum; - } - - public void setTechniqueNum(int techniqueNum) { - this.techniqueNum = techniqueNum; - } - - public String getTechnique() { - return technique; - } - - public void setTechnique(String technique) { - this.technique = technique; - } - - public int getFcstHour() { - return fcstHour; - } - - public void setFcstHour(int fcstHour) { - this.fcstHour = fcstHour; - } - - public float getClat() { - return clat; - } - - public void setClat(float clat) { - this.clat = clat; - } - - public float getClon() { - return clon; - } - - public void setClon(float clon) { - this.clon = clon; - } - - public float getWindMax() { - return windMax; - } - - public void setWindMax(float windMax) { - this.windMax = windMax; - } - - public float getMslp() { - return mslp; - } - - public void setMslp(float mslp) { - this.mslp = mslp; - } - - public String getIntensity() { - return intensity; - } + private static final long serialVersionUID = 1L; + + private static final float RMISSD = IDecoderConstantsN.FLOAT_MISSING; + + private static final Integer IMISSD = IDecoderConstantsN.INTEGER_MISSING; + + /** Report type */ + @DataURI(position = 8) + @Column(length = 32) + @XmlElement + @DynamicSerializeElement + private String reportType; + + /** + * Basin, e.g. WP, IO, SH, CP, EP, AL, SL + */ + @DataURI(position = 1) + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String basin; + + /** + * Annual cyclone number; 1 through 99 + */ + @DataURI(position = 2) + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private int cycloneNum; + + /** + * Warning Date-Time + */ + @DataURI(position = 3) + @Column + @DynamicSerializeElement + @XmlElement + private Calendar warnTime; + + /** + * Objective technique sorting number/Minutes for best track: 00-99 + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private int techniqueNum; + + /** + * Objective Technique or CARQ or WRNG, BEST for best Track + */ + @DataURI(position = 4) + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String technique; + + /** + * TAU -- forecast Period: -24 through 120 hours, 0 for best-track, negative + * forecastHours used for CARQ and WRNG records. + */ + @DataURI(position = 5) + @Column + @DynamicSerializeElement + @XmlElement + private int fcstHour; + + /** + * Latitude (degrees) for the DTG: -900 through 900 + */ + @DynamicSerializeElement + @XmlElement + private float clat; + + /** + * Longitude (degrees) for the DTG: -1800 through 1800 + */ + @DynamicSerializeElement + @XmlElement + private float clon; + + /** + * Maximum sustained wind speed in knots: 0 through 300 + */ + @DynamicSerializeElement + @XmlElement + private float windMax; + + /** + * Minimum sea level pressure, 1 through 1100MB + */ + @DynamicSerializeElement + @XmlElement + private float mslp; + + /** + * Level of tropical cyclone development; such as DB, TD, TS, TY, ... + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String intensity; + + /** + * Wind intensity (kts) for the radii defined i this record: 34, 50, 64 + */ + @DataURI(position = 6) + @DynamicSerializeElement + @XmlElement + private float radWind; + + /** + * Radius Code for wind intensity: AAA = full circle; QQQ = quadrant (NNQ, + * NEQ, EEQ, SEQ, SSQ, SWQ, WWQ, NWQ) + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String radWindQuad; + + /** + * If full circle, radius of specified wind intensity. If semicircle or + * quadrant, radius of specified wind intensity of circle portion specified + * in radius code. 0 - 1200 nm. + */ + @DynamicSerializeElement + @XmlElement + private float quad1WindRad; + + /** + * If full circle, this field not used. If semicircle, radius (nm) of + * specified wind intensity for semicircle not specified in radius code. If + * quadrant, radius (nm) of specified wind intensity for 2nd quadrant + * (counting clockwise from quadrant specified in radius code). 0 - 1200 nm. + */ + @DynamicSerializeElement + @XmlElement + private float quad2WindRad; + + /** + * If full circle or semicircle this field not used. If quadrant, radius + * (nm) of specified wind intensity for 3rd quadrant (counting clockwise + * from quadrant specified in radius code). 0 - 1200 nm. + */ + @DynamicSerializeElement + @XmlElement + private float quad3WindRad; + + /** + * If full circle or semicircle this field not used. If quadrant, radius + * (nm) of specified wind intensity for 4th quadrant (counting clockwise + * from quadrant specified in radius code). 0 - 1200 nm. + */ + @DynamicSerializeElement + @XmlElement + private float quad4WindRad; + + /** + * Pressure in millibars of the last closed isobar. 900 - 1050 mb + */ + @DynamicSerializeElement + @XmlElement + private float closedP; + + /** + * Radius of the last closed isobar in nm. 0 - 9999 nm + */ + @DynamicSerializeElement + @XmlElement + private float radClosedP; + + /** + * Radius of max winds. 0 - 999 nm + */ + @DynamicSerializeElement + @XmlElement + private float maxWindRad; + + /** + * Gusts. 0 - 995 kts. + */ + @DynamicSerializeElement + @XmlElement + private float gust; + + /** + * Eye diameter. 0 - 999nm + */ + @DynamicSerializeElement + @XmlElement + private float eyeSize; + + /** + * Subregion code: A, B, C, E, L, P, Q, S, W + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String subRegion; + + /** + * Max seas: 0 through 999 ft. + */ + @DynamicSerializeElement + @XmlElement + private float maxSeas; + + /** + * Forecaster's initials, used for forecastHour 0 WRNG, up to 3 chars + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String forecaster; + + /** + * Storm direction in compass coordinates, 0 - 359 degrees + */ + @DynamicSerializeElement + @XmlElement + private float stormDrct; + + /** + * Storm speed. 0 - 999 kts + */ + @DynamicSerializeElement + @XmlElement + private float stormSped; + + /** + * Literal storm name, NONAME, or INVEST + */ + @DataURI(position = 7) + @Column(length = 32) + @DynamicSerializeElement + @XmlElement + private String stormName; + + /** + * System depth, D=deep, M=medium, S=shallow, X=unknown + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String stormDepth; + + /** + * Wave height for radii defined in seas1 - seas4. 0 - 99 ft. + */ + @DynamicSerializeElement + @XmlElement + private float radWave; + + /** + * Radius code for seas wave height + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String radWaveQuad; + + /** + * First quadrant seas radius as defined by radWaveQuad, 0 - 999 nm + */ + @DynamicSerializeElement + @XmlElement + private float quad1WaveRad; + + /** + * Second quadrant seas radius as defined by radWaveQuad, 0 - 999 nm + */ + @DynamicSerializeElement + @XmlElement + private float quad2WaveRad; + + /** + * Third quadrant seas radius as defined by radWaveQuad, 0 - 999 nm + */ + @DynamicSerializeElement + @XmlElement + private float quad3WaveRad; + + /** + * Fourth quadrant seas radius as defined by radWaveQuad, 0 - 999 nm + */ + @DynamicSerializeElement + @XmlElement + private float quad4WaveRad; + + /* + * 20 character description of format to follow in userData + */ + @Column(length = 20) + @DynamicSerializeElement + @XmlElement + private String userDefined; + + /* + * User data section as indicated by userDefined parameter + */ + @Column(length = 30) + @DynamicSerializeElement + @XmlElement + private String userData; + + /** + * Default Constructor + */ + public AtcfRecord() { + this.reportType = "ATCF"; + this.basin = " "; + this.cycloneNum = IMISSD; + this.warnTime = null; + this.techniqueNum = IMISSD; + this.technique = " "; + this.fcstHour = IMISSD; + this.clat = RMISSD; + this.clon = RMISSD; + this.windMax = RMISSD; + this.mslp = RMISSD; + this.intensity = " "; + this.radWind = RMISSD; + this.radWindQuad = " "; + this.quad1WindRad = RMISSD; + this.quad2WindRad = RMISSD; + this.quad3WindRad = RMISSD; + this.quad4WindRad = RMISSD; + this.closedP = RMISSD; + this.radClosedP = RMISSD; + this.maxWindRad = RMISSD; + this.gust = RMISSD; + this.eyeSize = RMISSD; + this.subRegion = " "; + this.maxSeas = RMISSD; + this.forecaster = " "; + this.stormDrct = RMISSD; + this.stormSped = RMISSD; + this.stormName = " "; + this.stormDepth = " "; + this.radWave = RMISSD; + this.radWaveQuad = " "; + this.quad1WaveRad = RMISSD; + this.quad2WaveRad = RMISSD; + this.quad3WaveRad = RMISSD; + this.quad4WaveRad = RMISSD; + this.userDefined = " "; + this.userData = " "; + } + + /** + * Constructs a atcf record from a dataURI + * + * @param uri + * The dataURI + */ + public AtcfRecord(String uri) { + super(uri); + } + + @Override + public IDecoderGettable getDecoderGettable() { + // TODO Auto-generated method stub + return null; + } + + public String getReportType() { + return reportType; + } + + public void setReportType(String reportType) { + this.reportType = reportType; + } + + public String getBasin() { + return basin; + } + + public void setBasin(String basin) { + this.basin = basin; + } + + public int getCycloneNum() { + return cycloneNum; + } + + public void setCycloneNum(int cycloneNum) { + this.cycloneNum = cycloneNum; + } + + public Calendar getWarnTime() { + return warnTime; + } + + public void setWarnTime(Calendar warnTime) { + this.warnTime = warnTime; + } + + public int getTechniqueNum() { + return techniqueNum; + } + + public void setTechniqueNum(int techniqueNum) { + this.techniqueNum = techniqueNum; + } + + public String getTechnique() { + return technique; + } + + public void setTechnique(String technique) { + this.technique = technique; + } + + public int getFcstHour() { + return fcstHour; + } + + public void setFcstHour(int fcstHour) { + this.fcstHour = fcstHour; + } + + public float getClat() { + return clat; + } + + public void setClat(float clat) { + this.clat = clat; + } + + public float getClon() { + return clon; + } + + public void setClon(float clon) { + this.clon = clon; + } + + public float getWindMax() { + return windMax; + } + + public void setWindMax(float windMax) { + this.windMax = windMax; + } + + public float getMslp() { + return mslp; + } + + public void setMslp(float mslp) { + this.mslp = mslp; + } + + public String getIntensity() { + return intensity; + } - public void setIntensity(String intensity) { - this.intensity = intensity; - } + public void setIntensity(String intensity) { + this.intensity = intensity; + } - public float getRadWind() { - return radWind; - } + public float getRadWind() { + return radWind; + } - public void setRadWind(float radWind) { - this.radWind = radWind; - } + public void setRadWind(float radWind) { + this.radWind = radWind; + } - public String getRadWindQuad() { - return radWindQuad; - } + public String getRadWindQuad() { + return radWindQuad; + } - public void setRadWindQuad(String radWindQuad) { - this.radWindQuad = radWindQuad; - } + public void setRadWindQuad(String radWindQuad) { + this.radWindQuad = radWindQuad; + } - public float getQuad1WindRad() { - return quad1WindRad; - } + public float getQuad1WindRad() { + return quad1WindRad; + } - public void setQuad1WindRad(float quad1WindRad) { - this.quad1WindRad = quad1WindRad; - } + public void setQuad1WindRad(float quad1WindRad) { + this.quad1WindRad = quad1WindRad; + } - public float getQuad2WindRad() { - return quad2WindRad; - } + public float getQuad2WindRad() { + return quad2WindRad; + } - public void setQuad2WindRad(float quad2WindRad) { - this.quad2WindRad = quad2WindRad; - } + public void setQuad2WindRad(float quad2WindRad) { + this.quad2WindRad = quad2WindRad; + } - public float getQuad3WindRad() { - return quad3WindRad; - } + public float getQuad3WindRad() { + return quad3WindRad; + } - public void setQuad3WindRad(float quad3WindRad) { - this.quad3WindRad = quad3WindRad; - } + public void setQuad3WindRad(float quad3WindRad) { + this.quad3WindRad = quad3WindRad; + } - public float getQuad4WindRad() { - return quad4WindRad; - } + public float getQuad4WindRad() { + return quad4WindRad; + } - public void setQuad4WindRad(float quad4WindRad) { - this.quad4WindRad = quad4WindRad; - } + public void setQuad4WindRad(float quad4WindRad) { + this.quad4WindRad = quad4WindRad; + } - public float getClosedP() { - return closedP; - } + public float getClosedP() { + return closedP; + } - public void setClosedP(float closedP) { - this.closedP = closedP; - } + public void setClosedP(float closedP) { + this.closedP = closedP; + } - public float getRadClosedP() { - return radClosedP; - } + public float getRadClosedP() { + return radClosedP; + } - public void setRadClosedP(float radClosedP) { - this.radClosedP = radClosedP; - } + public void setRadClosedP(float radClosedP) { + this.radClosedP = radClosedP; + } - public float getMaxWindRad() { - return maxWindRad; - } + public float getMaxWindRad() { + return maxWindRad; + } - public void setMaxWindRad(float maxWindRad) { - this.maxWindRad = maxWindRad; - } + public void setMaxWindRad(float maxWindRad) { + this.maxWindRad = maxWindRad; + } - public float getGust() { - return gust; - } + public float getGust() { + return gust; + } - public void setGust(float gust) { - this.gust = gust; - } + public void setGust(float gust) { + this.gust = gust; + } - public float getEyeSize() { - return eyeSize; - } + public float getEyeSize() { + return eyeSize; + } - public void setEyeSize(float eyeSize) { - this.eyeSize = eyeSize; - } + public void setEyeSize(float eyeSize) { + this.eyeSize = eyeSize; + } - public String getSubRegion() { - return subRegion; - } + public String getSubRegion() { + return subRegion; + } - public void setSubRegion(String subRegion) { - this.subRegion = subRegion; - } + public void setSubRegion(String subRegion) { + this.subRegion = subRegion; + } - public float getMaxSeas() { - return maxSeas; - } + public float getMaxSeas() { + return maxSeas; + } - public void setMaxSeas(float maxSeas) { - this.maxSeas = maxSeas; - } + public void setMaxSeas(float maxSeas) { + this.maxSeas = maxSeas; + } - public String getForecaster() { - return forecaster; - } + public String getForecaster() { + return forecaster; + } - public void setForecaster(String forecaster) { - this.forecaster = forecaster; - } + public void setForecaster(String forecaster) { + this.forecaster = forecaster; + } - public float getStormDrct() { - return stormDrct; - } + public float getStormDrct() { + return stormDrct; + } - public void setStormDrct(float stormDrct) { - this.stormDrct = stormDrct; - } + public void setStormDrct(float stormDrct) { + this.stormDrct = stormDrct; + } - public float getStormSped() { - return stormSped; - } + public float getStormSped() { + return stormSped; + } - public void setStormSped(float stormSped) { - this.stormSped = stormSped; - } + public void setStormSped(float stormSped) { + this.stormSped = stormSped; + } - public String getStormName() { - return stormName; - } + public String getStormName() { + return stormName; + } - public void setStormName(String stormName) { - this.stormName = stormName; - } + public void setStormName(String stormName) { + this.stormName = stormName; + } - public String getStormDepth() { - return stormDepth; - } + public String getStormDepth() { + return stormDepth; + } - public void setStormDepth(String stormDepth) { - this.stormDepth = stormDepth; - } + public void setStormDepth(String stormDepth) { + this.stormDepth = stormDepth; + } - public float getRadWave() { - return radWave; - } + public float getRadWave() { + return radWave; + } - public void setRadWave(float radWave) { - this.radWave = radWave; - } + public void setRadWave(float radWave) { + this.radWave = radWave; + } - public String getRadWaveQuad() { - return radWaveQuad; - } + public String getRadWaveQuad() { + return radWaveQuad; + } - public void setRadWaveQuad(String radWaveQuad) { - this.radWaveQuad = radWaveQuad; - } + public void setRadWaveQuad(String radWaveQuad) { + this.radWaveQuad = radWaveQuad; + } - public float getQuad1WaveRad() { - return quad1WaveRad; - } + public float getQuad1WaveRad() { + return quad1WaveRad; + } - public void setQuad1WaveRad(float quad1WaveRad) { - this.quad1WaveRad = quad1WaveRad; - } + public void setQuad1WaveRad(float quad1WaveRad) { + this.quad1WaveRad = quad1WaveRad; + } - public float getQuad2WaveRad() { - return quad2WaveRad; - } + public float getQuad2WaveRad() { + return quad2WaveRad; + } - public void setQuad2WaveRad(float quad2WaveRad) { - this.quad2WaveRad = quad2WaveRad; - } + public void setQuad2WaveRad(float quad2WaveRad) { + this.quad2WaveRad = quad2WaveRad; + } - public float getQuad3WaveRad() { - return quad3WaveRad; - } + public float getQuad3WaveRad() { + return quad3WaveRad; + } - public void setQuad3WaveRad(float quad3WaveRad) { - this.quad3WaveRad = quad3WaveRad; - } + public void setQuad3WaveRad(float quad3WaveRad) { + this.quad3WaveRad = quad3WaveRad; + } - public float getQuad4WaveRad() { - return quad4WaveRad; - } + public float getQuad4WaveRad() { + return quad4WaveRad; + } - public void setQuad4WaveRad(float quad4WaveRad) { - this.quad4WaveRad = quad4WaveRad; - } + public void setQuad4WaveRad(float quad4WaveRad) { + this.quad4WaveRad = quad4WaveRad; + } - public String getUserDefined() { - return userDefined; - } + public String getUserDefined() { + return userDefined; + } - public void setUserDefined(String userDefined) { - this.userDefined = userDefined; - } + public void setUserDefined(String userDefined) { + this.userDefined = userDefined; + } - public String getUserData() { - return userData; - } + public String getUserData() { + return userData; + } - public void setUserData(String userData) { - this.userData = userData; - } + public void setUserData(String userData) { + this.userData = userData; + } @Override @Column @@ -758,4 +737,9 @@ public class AtcfRecord extends PluginDataObject { public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "atcf"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.aww/src/gov/noaa/nws/ncep/common/dataplugin/aww/AwwRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.aww/src/gov/noaa/nws/ncep/common/dataplugin/aww/AwwRecord.java index 5d99f7939a..61e7aecdb9 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.aww/src/gov/noaa/nws/ncep/common/dataplugin/aww/AwwRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.aww/src/gov/noaa/nws/ncep/common/dataplugin/aww/AwwRecord.java @@ -66,52 +66,26 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "aww", - indexes = { - @Index(name = "aww_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "aww", indexes = { @Index(name = "aww_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize +public class AwwRecord extends PluginDataObject { -public class AwwRecord extends PluginDataObject{ - - private static final long serialVersionUID = 1L; - - /* - * There are many report types as follows: - * 1. SEVERE THUNDERSTORM WARNING - * 2. SEVERE THUNDERSTORM WATCH - * 3. TORNADO WARNING - * 4. TORNADO WATCH - * 5. SEVERE THUNDERSTORM OUTLINE UPDATE - * 6. TORNADO WATCH OUTLINE UPDATE - * 7. FLASH FLOOD WARNING - * 8. FLASH FLOOD WATCH - * 9. FLOOD WARNING - * 10. FLOOD WATCH - * 11. FLOOD STATEMENT - * 12. WINTER STORM WARNING - * 13. WINTER STORM WATCH - * 14. WATCH COUNTY NOTIFICATION - * 15. SEVERE WEATHER STATEMENT - * 16. WIND ADVISORY - * 17. FOG ADVISORY - * 18. HEAT ADVISORY - * 19. FROST ADVISORY - * 20. SMOKE ADVISORY - * 21. WEATHER ADVISORY - * 22. WINTER WEATHER ADVISORY - * 23. SIGNIGICANT WEATHER ADVISORY - * 24. SPECIAL WEATHER STATEMENT - * 25. RED FLAG WARNING - * 26. TORNADO REPORT - * 27. HIGH WIND WARNING - * 28. FREEZE WARNING - * 29. ADVERTENCIA DE INUNDACIONES - * 30. HYDROLOGIC STATEMENT - * 31. URGENT WEATHER MESSAGE - */ + private static final long serialVersionUID = 1L; + + /* + * There are many report types as follows: 1. SEVERE THUNDERSTORM WARNING 2. + * SEVERE THUNDERSTORM WATCH 3. TORNADO WARNING 4. TORNADO WATCH 5. SEVERE + * THUNDERSTORM OUTLINE UPDATE 6. TORNADO WATCH OUTLINE UPDATE 7. FLASH + * FLOOD WARNING 8. FLASH FLOOD WATCH 9. FLOOD WARNING 10. FLOOD WATCH 11. + * FLOOD STATEMENT 12. WINTER STORM WARNING 13. WINTER STORM WATCH 14. WATCH + * COUNTY NOTIFICATION 15. SEVERE WEATHER STATEMENT 16. WIND ADVISORY 17. + * FOG ADVISORY 18. HEAT ADVISORY 19. FROST ADVISORY 20. SMOKE ADVISORY 21. + * WEATHER ADVISORY 22. WINTER WEATHER ADVISORY 23. SIGNIGICANT WEATHER + * ADVISORY 24. SPECIAL WEATHER STATEMENT 25. RED FLAG WARNING 26. TORNADO + * REPORT 27. HIGH WIND WARNING 28. FREEZE WARNING 29. ADVERTENCIA DE + * INUNDACIONES 30. HYDROLOGIC STATEMENT 31. URGENT WEATHER MESSAGE + */ public static enum AwwReportType { SEVERE_THUNDERSTORM_WARNING, SEVERE_THUNDERSTORM_WATCH, @@ -175,89 +149,87 @@ public class AwwRecord extends PluginDataObject{ } } - @Column(length=40) - @DataURI(position=1) - @DynamicSerializeElement - private String reportType; - - // The issue office where the report from - @Column(length=32) - @DataURI(position=2) - @DynamicSerializeElement - private String issueOffice; - - // The collection of watch numbers in the report - @Column(length=160) - @DataURI(position=5) - @DynamicSerializeElement - private String watchNumber; - - // WMO header - @Column(length=32) - @DynamicSerializeElement - private String wmoHeader; - - // Issue time of the report - @Column - @DataURI(position=3) - @DynamicSerializeElement - private Calendar issueTime; - - // The designator - @Column(length=8) - @DataURI(position=4) - @DynamicSerializeElement - private String designatorBBB; - - // The designator - @Column(length=72) - @DataURI(position=6) - @DynamicSerializeElement - private String mndTime; - - // Attention WFO - @Column(length=72) - @DynamicSerializeElement - private String attentionWFO; - - // The entire report - @Column(length=40000) - @DynamicSerializeElement - private String bullMessage; - + @Column(length = 40) + @DataURI(position = 1) + @DynamicSerializeElement + private String reportType; - // AWW UGC Table - @DynamicSerializeElement - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - @JoinColumn(name = "parentID", nullable = false) + // The issue office where the report from + @Column(length = 32) + @DataURI(position = 2) + @DynamicSerializeElement + private String issueOffice; + + // The collection of watch numbers in the report + @Column(length = 160) + @DataURI(position = 5) + @DynamicSerializeElement + private String watchNumber; + + // WMO header + @Column(length = 32) + @DynamicSerializeElement + private String wmoHeader; + + // Issue time of the report + @Column + @DataURI(position = 3) + @DynamicSerializeElement + private Calendar issueTime; + + // The designator + @Column(length = 8) + @DataURI(position = 4) + @DynamicSerializeElement + private String designatorBBB; + + // The designator + @Column(length = 72) + @DataURI(position = 6) + @DynamicSerializeElement + private String mndTime; + + // Attention WFO + @Column(length = 72) + @DynamicSerializeElement + private String attentionWFO; + + // The entire report + @Column(length = 40000) + @DynamicSerializeElement + private String bullMessage; + + // AWW UGC Table + @DynamicSerializeElement + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @JoinColumn(name = "parentID", nullable = false) @Index(name = "awwUGC_parentid_idex") - private Set awwUGC = new HashSet(); + private Set awwUGC = new HashSet(); - - /** + /** * Default Convstructor */ public AwwRecord() { - this.issueOffice=null; - this.watchNumber="0000"; - this.issueTime=null; - this.attentionWFO=null; - this.wmoHeader=null; - this.designatorBBB=null; - this.bullMessage=null; - this.mndTime=null; + this.issueOffice = null; + this.watchNumber = "0000"; + this.issueTime = null; + this.attentionWFO = null; + this.wmoHeader = null; + this.designatorBBB = null; + this.bullMessage = null; + this.mndTime = null; } /** * Convstructs a consigmet record from a dataURI * - * @param uri The dataURI + * @param uri + * The dataURI */ public AwwRecord(String uri) { super(uri); } - - + @Override public IDecoderGettable getDecoderGettable() { // TODO Auto-generated method stub @@ -265,165 +237,173 @@ public class AwwRecord extends PluginDataObject{ } /** - * @return the reportType - */ + * @return the reportType + */ public String getReportType() { - return reportType; - } + return reportType; + } /** - * @return the reportType - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } + * @return the reportType + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } - /** - * @return the wmoHeader - */ - public String getWmoHeader(){ - return wmoHeader; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param wnoHeader to set - */ - public void setWmoHeader(String wmoHeader){ - this.wmoHeader=wmoHeader; - } - - /** - * @return the issueTime - */ - public Calendar getIssueTime(){ - return issueTime; - } + /** + * @param wnoHeader + * to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * @param issueTime to set - */ - public void setIssueTime(Calendar issueTime){ - this.issueTime=issueTime; - } + /** + * @return the issueTime + */ + public Calendar getIssueTime() { + return issueTime; + } - /** - * @return the set of UGC - */ - public Set getAwwUGC() { - return awwUGC; - } + /** + * @param issueTime + * to set + */ + public void setIssueTime(Calendar issueTime) { + this.issueTime = issueTime; + } - /** - * @param awwUgc the ugc to set - */ - public void setAwwUGC(Set awwUgc) { - this.awwUGC = awwUgc; - } + /** + * @return the set of UGC + */ + public Set getAwwUGC() { + return awwUGC; + } - /** - * @param add AWW UGC to set - */ - public void addAwwUGC(AwwUgc pugc){ - awwUGC.add(pugc); - //pugc.setParentID(this); - } + /** + * @param awwUgc + * the ugc to set + */ + public void setAwwUGC(Set awwUgc) { + this.awwUGC = awwUgc; + } - /** - * Override existing set method to modify any - * classes that use the dataURI as a foreign key - */ - public void setIdentifier(Object dataURI) - { + /** + * @param add + * AWW UGC to set + */ + public void addAwwUGC(AwwUgc pugc) { + awwUGC.add(pugc); + // pugc.setParentID(this); + } - this.identifier = dataURI; - - - - } + /** + * Override existing set method to modify any classes that use the dataURI + * as a foreign key + */ + @Override + public void setIdentifier(Object dataURI) { - /** - * @return the designator - */ - public String getDesignatorBBB() { - return designatorBBB; - } + this.identifier = dataURI; - /** - * @param designatorBBB to set - */ - public void setDesignatorBBB(String designatorBBB) { - this.designatorBBB = designatorBBB; - } + } - /** - * @return the attentionWFO - */ - public String getAttentionWFO() { - return attentionWFO; - } + /** + * @return the designator + */ + public String getDesignatorBBB() { + return designatorBBB; + } - /** - * @param attentionWFO to set - */ - public void setAttentionWFO(String attentionWFO) { - this.attentionWFO = attentionWFO; - } + /** + * @param designatorBBB + * to set + */ + public void setDesignatorBBB(String designatorBBB) { + this.designatorBBB = designatorBBB; + } - /** - * @return the watchNumber - */ - public String getWatchNumber() { - return watchNumber; - } + /** + * @return the attentionWFO + */ + public String getAttentionWFO() { + return attentionWFO; + } - /** - * @param watchNumber to set - */ - public void setWatchNumber(String watchNumber) { - this.watchNumber = watchNumber; - } + /** + * @param attentionWFO + * to set + */ + public void setAttentionWFO(String attentionWFO) { + this.attentionWFO = attentionWFO; + } - /** - * @return the bullMessage - */ - public String getBullMessage() { - return bullMessage; - } + /** + * @return the watchNumber + */ + public String getWatchNumber() { + return watchNumber; + } - /** - * @param bullMessage to set - */ - public void setBullMessage(String bullMessage) { - this.bullMessage = bullMessage; - } + /** + * @param watchNumber + * to set + */ + public void setWatchNumber(String watchNumber) { + this.watchNumber = watchNumber; + } - /** - * @return the issueOffice - */ - public String getIssueOffice() { - return issueOffice; - } + /** + * @return the bullMessage + */ + public String getBullMessage() { + return bullMessage; + } - /** - * @param issueOffice to set - */ - public void setIssueOffice(String issueOffice) { - this.issueOffice = issueOffice; - } + /** + * @param bullMessage + * to set + */ + public void setBullMessage(String bullMessage) { + this.bullMessage = bullMessage; + } - /** - * @return the mndTime - */ - public String getMndTime() { - return mndTime; - } + /** + * @return the issueOffice + */ + public String getIssueOffice() { + return issueOffice; + } - /** - * @param mndTime to set - */ - public void setMndTime(String mndTime) { - this.mndTime = mndTime; - } + /** + * @param issueOffice + * to set + */ + public void setIssueOffice(String issueOffice) { + this.issueOffice = issueOffice; + } + + /** + * @return the mndTime + */ + public String getMndTime() { + return mndTime; + } + + /** + * @param mndTime + * to set + */ + public void setMndTime(String mndTime) { + this.mndTime = mndTime; + } @Override @Column @@ -431,4 +411,9 @@ public class AwwRecord extends PluginDataObject{ public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "aww"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.convsigmet/src/gov/noaa/nws/ncep/common/dataplugin/convsigmet/ConvSigmetRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.convsigmet/src/gov/noaa/nws/ncep/common/dataplugin/convsigmet/ConvSigmetRecord.java index c5b4beda65..6799bf4f97 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.convsigmet/src/gov/noaa/nws/ncep/common/dataplugin/convsigmet/ConvSigmetRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.convsigmet/src/gov/noaa/nws/ncep/common/dataplugin/convsigmet/ConvSigmetRecord.java @@ -56,97 +56,91 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "convsigmet", - indexes = { - @Index(name = "convsigmet_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "convsigmet", indexes = { @Index(name = "convsigmet_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize -public class ConvSigmetRecord extends PluginDataObject{ +public class ConvSigmetRecord extends PluginDataObject { - /** + /** * */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - // reportType is "convective sigmet". - @Column(length=32) - @DataURI(position=1) - @DynamicSerializeElement - private String reportType; - - // WMO header - @Column(length=32) - @DataURI(position=2) - @DynamicSerializeElement - private String wmoHeader; - - // forecastRegion as: SIGW, SIGC, or SIGE - @Column(length=8) - @DataURI(position=3) - @DynamicSerializeElement - private String forecastRegion; - - // The issue office where the report from - @Column(length=32) - @DynamicSerializeElement - private String issueOffice; - - // Issue time of the report - @Column - @DynamicSerializeElement - private Calendar issueTime; - - // The designator - @Column(length=8) - @DynamicSerializeElement - private String designatorBBB; - - // CorrectionFlag is a flag indicating a cancellation (0 or 1) - @Column + // reportType is "convective sigmet". + @Column(length = 32) + @DataURI(position = 1) @DynamicSerializeElement - private Integer correctionFlag; - - // The entire report - @Column(length=15000) - @DynamicSerializeElement - private String bullMessage; + private String reportType; + // WMO header + @Column(length = 32) + @DataURI(position = 2) + @DynamicSerializeElement + private String wmoHeader; - /** - * Convsigmet section - */ - @DynamicSerializeElement - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - @JoinColumn(name = "parentID", nullable = false) + // forecastRegion as: SIGW, SIGC, or SIGE + @Column(length = 8) + @DataURI(position = 3) + @DynamicSerializeElement + private String forecastRegion; + + // The issue office where the report from + @Column(length = 32) + @DynamicSerializeElement + private String issueOffice; + + // Issue time of the report + @Column + @DynamicSerializeElement + private Calendar issueTime; + + // The designator + @Column(length = 8) + @DynamicSerializeElement + private String designatorBBB; + + // CorrectionFlag is a flag indicating a cancellation (0 or 1) + @Column + @DynamicSerializeElement + private Integer correctionFlag; + + // The entire report + @Column(length = 15000) + @DynamicSerializeElement + private String bullMessage; + + /** + * Convsigmet section + */ + @DynamicSerializeElement + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @JoinColumn(name = "parentID", nullable = false) @Index(name = "convSigmetSection_parentid_idex") - private Set convSigmetSection = new HashSet(); + private Set convSigmetSection = new HashSet(); - - /** + /** * Default Convstructor */ public ConvSigmetRecord() { - this.issueOffice=""; - this.wmoHeader=""; - this.bullMessage=""; - this.designatorBBB=""; - this.forecastRegion=""; - this.reportType=""; - this.correctionFlag=IDecoderConstantsN.INTEGER_MISSING; + this.issueOffice = ""; + this.wmoHeader = ""; + this.bullMessage = ""; + this.designatorBBB = ""; + this.forecastRegion = ""; + this.reportType = ""; + this.correctionFlag = IDecoderConstantsN.INTEGER_MISSING; } /** * Convstructs a consigmet record from a dataURI * - * @param uri The dataURI + * @param uri + * The dataURI */ public ConvSigmetRecord(String uri) { super(uri); } - @Override public IDecoderGettable getDecoderGettable() { // TODO Auto-generated method stub @@ -154,151 +148,159 @@ public class ConvSigmetRecord extends PluginDataObject{ } /** - * @return the issueOffice - */ - public String getIssueOffice(){ - return issueOffice; - } + * @return the issueOffice + */ + public String getIssueOffice() { + return issueOffice; + } - /** - * @param issueOffice to set - */ - public void setIssueOffice(String issueOffice){ - this.issueOffice=issueOffice; - } - - /** - * @return the wmoHeader - */ - public String getWmoHeader(){ - return wmoHeader; - } + /** + * @param issueOffice + * to set + */ + public void setIssueOffice(String issueOffice) { + this.issueOffice = issueOffice; + } - /** - * @param wnoHeader to set - */ - public void setWmoHeader(String wmoHeader){ - this.wmoHeader=wmoHeader; - } - - /** - * @return the issueTime - */ - public Calendar getIssueTime(){ - return issueTime; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param issueTime to set - */ - public void setIssueTime(Calendar issueTime){ - this.issueTime=issueTime; - } - - /** - * @return the reportType - */ - public String getReportType() { - return reportType; - } + /** + * @param wnoHeader + * to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * @param reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } + /** + * @return the issueTime + */ + public Calendar getIssueTime() { + return issueTime; + } - /** - * @return the designatorBBB - */ - public String getDesignatorBBB() { - return designatorBBB; - } + /** + * @param issueTime + * to set + */ + public void setIssueTime(Calendar issueTime) { + this.issueTime = issueTime; + } - /** - * @param designatorBBB to set - */ - public void setDesignatorBBB(String designatorBBB) { - this.designatorBBB = designatorBBB; - } + /** + * @return the reportType + */ + public String getReportType() { + return reportType; + } - /** - * @return the correctionFlag - */ - public Integer getCorrectionFlag() { - return correctionFlag; - } + /** + * @param reportType + * to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } - /** - * @param correctionFlag to set - */ - public void setCorrectionFlag(Integer correctionFlag) { - this.correctionFlag = correctionFlag; - } + /** + * @return the designatorBBB + */ + public String getDesignatorBBB() { + return designatorBBB; + } - /** - * @return the forecastRegion - */ - public String getForecastRegion() { - return forecastRegion; - } + /** + * @param designatorBBB + * to set + */ + public void setDesignatorBBB(String designatorBBB) { + this.designatorBBB = designatorBBB; + } - /** - * @param forecastRegion to set - */ - public void setForecastRegion(String forecastRegion) { - this.forecastRegion = forecastRegion; - } - - /** - * @return the bullMessage - */ - public String getBullMessage() { - return bullMessage; - } + /** + * @return the correctionFlag + */ + public Integer getCorrectionFlag() { + return correctionFlag; + } - /** - * @param bullMessage to set - */ - public void setBullMessage(String bullMessage) { - this.bullMessage = bullMessage; - } - - - /** - * @return the set of convective Sigmet section - */ - public Set getConvSigmetSection() { - return convSigmetSection; - } + /** + * @param correctionFlag + * to set + */ + public void setCorrectionFlag(Integer correctionFlag) { + this.correctionFlag = correctionFlag; + } - /** - * @param convsigmet the section to set - */ - public void setConvSigmetSection(Set convSection) { - this.convSigmetSection = convSection; - } + /** + * @return the forecastRegion + */ + public String getForecastRegion() { + return forecastRegion; + } - /** - * @param add convective Sigmet Section to set - */ - public void addConvSigmetSection(ConvSigmetSection psection){ - convSigmetSection.add(psection); - - } - - /** - * Override existing set method to modify any - * classes that use the dataURI as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) - { + /** + * @param forecastRegion + * to set + */ + public void setForecastRegion(String forecastRegion) { + this.forecastRegion = forecastRegion; + } - this.identifier = dataURI; - - } + /** + * @return the bullMessage + */ + public String getBullMessage() { + return bullMessage; + } + + /** + * @param bullMessage + * to set + */ + public void setBullMessage(String bullMessage) { + this.bullMessage = bullMessage; + } + + /** + * @return the set of convective Sigmet section + */ + public Set getConvSigmetSection() { + return convSigmetSection; + } + + /** + * @param convsigmet + * the section to set + */ + public void setConvSigmetSection(Set convSection) { + this.convSigmetSection = convSection; + } + + /** + * @param add + * convective Sigmet Section to set + */ + public void addConvSigmetSection(ConvSigmetSection psection) { + convSigmetSection.add(psection); + + } + + /** + * Override existing set method to modify any classes that use the dataURI + * as a foreign key + */ + @Override + public void setIdentifier(Object dataURI) { + + this.identifier = dataURI; + + } @Override @Column @@ -306,4 +308,9 @@ public class ConvSigmetRecord extends PluginDataObject{ public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "convsigmet"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ffg/src/gov/noaa/nws/ncep/common/dataplugin/ffg/FfgRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ffg/src/gov/noaa/nws/ncep/common/dataplugin/ffg/FfgRecord.java index f956a86c9e..bf9c24bf61 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ffg/src/gov/noaa/nws/ncep/common/dataplugin/ffg/FfgRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ffg/src/gov/noaa/nws/ncep/common/dataplugin/ffg/FfgRecord.java @@ -7,18 +7,21 @@ *
  * SOFTWARE HISTORY
  *
- * Date         Ticket#         Engineer    Description
- * ------------ ----------      ----------- --------------------------
- * 08/2008      14				T. Lee     	Initial coding
- * 12/2008		14				T. Lee		Initialized variable
- * 03/2009		14				T. Lee		Migration to TO10
- * 07/2009		14				T. Lee		Migration to TO11
- * 09/2011      				Chin Chen   changed to improve purge performance and
- * 										    removed xml serialization as well
- * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
- * Apr 12, 2013 1857            bgonzale    Added SequenceGenerator annotation.
- * May 07, 2013 1869            bsteffen    Remove dataURI column from
- *                                          PluginDataObject.
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 08/2008      14         T. Lee      Initial coding
+ * 12/2008      14         T. Lee      Initialized variable
+ * 03/2009      14         T. Lee      Migration to TO10
+ * 07/2009      14         T. Lee      Migration to TO11
+ * 09/2011                 Chin Chen   changed to improve purge performance
+ *                                     and  removed xml serialization as
+ *                                     well
+ * Apr 04, 2013 1846       bkowal      Added an index on refTime and
+ *                                     forecastTime
+ * Apr 12, 2013 1857       bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 1869       bsteffen    Remove dataURI column from
+ *                                     PluginDataObject.
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
  *
  * 
* @@ -59,240 +62,246 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ffg", - indexes = { - @Index(name = "ffg_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ffg", indexes = { @Index(name = "ffg_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class FfgRecord extends PluginDataObject { private static final long serialVersionUID = 1L; - + /** Report type */ - @Column(length=32) - @DynamicSerializeElement - @DataURI(position=2) + @Column(length = 32) + @DynamicSerializeElement + @DataURI(position = 2) private String reportType; /** FFG AWIPS identifier */ - @Column(length=32) - @DataURI(position=1) + @Column(length = 32) + @DataURI(position = 1) @DynamicSerializeElement private String awipsID; - + /** Bulletin insurance time */ - @Column + @Column @DynamicSerializeElement private Calendar issueTime; /** Station ID */ - @Column(length=32) + @Column(length = 32) @DynamicSerializeElement private String issueOffice; /** Designator BBB */ - @Column(length=8) + @Column(length = 8) @DynamicSerializeElement private String designatorBBB; /** Bulletin messages */ - @Column(length=10000) + @Column(length = 10000) @DynamicSerializeElement private String bullMessage; - + /** Mass News Disseminator (MND) */ - @Column(length=72) + @Column(length = 72) @DynamicSerializeElement private String mndTime; /** WMO header */ - @Column(length=32) + @Column(length = 32) @DynamicSerializeElement private String wmoHeader; - + /** FFG precipitation */ - @DynamicSerializeElement + @DynamicSerializeElement @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - @JoinColumn(name = "parentID", nullable = false) + @JoinColumn(name = "parentID", nullable = false) @Index(name = "ffgP_parentid_idex") - private Set ffgP = new HashSet(); - + private Set ffgP = new HashSet(); + /** * Default Constructor */ public FfgRecord() { - awipsID = ""; - issueTime = null; - issueOffice = ""; - wmoHeader = ""; - mndTime = ""; - bullMessage = ""; + awipsID = ""; + issueTime = null; + issueOffice = ""; + wmoHeader = ""; + mndTime = ""; + bullMessage = ""; } /** * Constructs a FFG record from a dataURI * - * @param uri: The dataURI + * @param uri + * : The dataURI */ public FfgRecord(String uri) { - super(uri); + super(uri); } - + @Override public IDecoderGettable getDecoderGettable() { - // TODO Auto-generated method stub - return null; + // TODO Auto-generated method stub + return null; } - - /** - * Return the reportType + + /** + * Return the reportType */ public String getReportType() { return reportType; } /** - * @param reportType the report type to set + * @param reportType + * the report type to set */ public void setReportType(String reportType) { this.reportType = reportType; } - + /** * @return the awipsID */ public String getAwipsID() { - return awipsID; + return awipsID; } /** - * @param awipsID the AWIPS identifier to set + * @param awipsID + * the AWIPS identifier to set */ public void setAwipsID(String awipsID) { - this.awipsID = awipsID; + this.awipsID = awipsID; } /** * @return the issueTime */ public Calendar getIssueTime() { - return issueTime; + return issueTime; } /** - * @param issueTime the issueTime to set + * @param issueTime + * the issueTime to set */ public void setIssueTime(Calendar issueTime) { - this.issueTime = issueTime; + this.issueTime = issueTime; } /** * @return the issueOffice */ public String getIssueOffice() { - return issueOffice; + return issueOffice; } /** - * @param issueOffice the issueOffice to set + * @param issueOffice + * the issueOffice to set */ public void setIssueOffice(String issueOffice) { - this.issueOffice = issueOffice; + this.issueOffice = issueOffice; } /** * @return the wmoHeader */ public String getWmoHeader() { - return wmoHeader; + return wmoHeader; } /** - * @param wmoHeader the wmoHeader to set + * @param wmoHeader + * the wmoHeader to set */ public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; + this.wmoHeader = wmoHeader; } /** * @return designatorBBB */ public String getDesignatorBBB() { - return designatorBBB; + return designatorBBB; } /** - * @param designatorBBB the designatorBBB to set + * @param designatorBBB + * the designatorBBB to set */ public void setDesignatorBBB(String designatorBBB) { - this.designatorBBB = designatorBBB; + this.designatorBBB = designatorBBB; } - + /** * @return the bullMessage */ public String getBullMessage() { - return bullMessage; - } - + return bullMessage; + } + /** - * @param bullMessage the bullMessage to set + * @param bullMessage + * the bullMessage to set */ public void setBullMessage(String bullMessage) { - this.bullMessage = bullMessage; + this.bullMessage = bullMessage; } - + /** * @return the MndTime */ public String getMndTime() { - return mndTime; + return mndTime; } /** - * @param mndTime the mndTime to set + * @param mndTime + * the mndTime to set */ public void setMndTime(String mndTime) { - this.mndTime = mndTime; + this.mndTime = mndTime; } - + /** * @return the set of precipitation (ffgP) */ public Set getFfgP() { - return ffgP; + return ffgP; } /** - * @param ffgP the set of precipitation to set + * @param ffgP + * the set of precipitation to set */ - public void setFfgP(Set ffgP ) { - this.ffgP = ffgP; + public void setFfgP(Set ffgP) { + this.ffgP = ffgP; } /** * Add FfgPrecip to set */ - public void addPrecip(FfgPrecip precip){ - ffgP.add(precip); - //precip.setParentID (this); - } + public void addPrecip(FfgPrecip precip) { + ffgP.add(precip); + // precip.setParentID (this); + } /** - * Override existing set method to modify any - * classes that use the dataURI as a foreign key + * Override existing set method to modify any classes that use the dataURI + * as a foreign key */ @Override public void setIdentifier(Object dataURI) { - - this.identifier = dataURI; - /*if (this.getFfgP() != null && this.getFfgP().size() > 0) { - for (Iterator iter = this.getFfgP().iterator(); iter.hasNext();) { - FfgPrecip fp = iter.next(); - //fp.setParentID(this); - } - }*/ + + this.identifier = dataURI; + /* + * if (this.getFfgP() != null && this.getFfgP().size() > 0) { for + * (Iterator iter = this.getFfgP().iterator(); + * iter.hasNext();) { FfgPrecip fp = iter.next(); + * //fp.setParentID(this); } } + */ } @Override @@ -301,4 +310,9 @@ public class FfgRecord extends PluginDataObject { public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "ffg"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.geomag/src/gov/noaa/nws/ncep/common/dataplugin/geomag/GeoMagRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.geomag/src/gov/noaa/nws/ncep/common/dataplugin/geomag/GeoMagRecord.java index e46fdaeb7a..f8b55fb5ea 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.geomag/src/gov/noaa/nws/ncep/common/dataplugin/geomag/GeoMagRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.geomag/src/gov/noaa/nws/ncep/common/dataplugin/geomag/GeoMagRecord.java @@ -28,9 +28,12 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ---------------- -------------------------- - * 03/27/2013 975 sgurung Initial creation. - * 05/26/2013 bhebbard Added SequenceGenerator annotation. - * 06/26/2013 989 qzhou Added lots of fields. + * Mar 27, 2013 975 sgurung Initial creation. + * May 26, 2013 bhebbard Added SequenceGenerator + * annotation. + * Jun 26, 2013 989 qzhou Added lots of fields. + * Jul 22, 2013 1977 rjpeter Added getDataURI and annotations. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author sgurung @@ -757,4 +760,9 @@ public class GeoMagRecord extends PersistablePluginDataObject { public IHDFFilePathProvider getHDFPathProvider() { return GeoMagPathProvider.getInstance(); } + + @Override + public String getPluginName() { + return "geomag"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.gpd/src/gov/noaa/nws/ncep/common/dataplugin/gpd/GenericPointDataRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.gpd/src/gov/noaa/nws/ncep/common/dataplugin/gpd/GenericPointDataRecord.java index 04fa3abd8f..9c8b4bd96e 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.gpd/src/gov/noaa/nws/ncep/common/dataplugin/gpd/GenericPointDataRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.gpd/src/gov/noaa/nws/ncep/common/dataplugin/gpd/GenericPointDataRecord.java @@ -49,264 +49,259 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.time.DataTime; @Entity -//@Table(name = "gpd", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) +// @Table(name = "gpd", uniqueConstraints = { @UniqueConstraint(columnNames = { +// "dataURI" }) }) @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "gpdseq") @Table(name = "gpd") @DynamicSerialize @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement -public class GenericPointDataRecord extends PersistablePluginDataObject implements -/*ISpatialEnabled,*/ IDecoderGettable, IPointData, IPersistable { +public class GenericPointDataRecord extends PersistablePluginDataObject + implements + /* ISpatialEnabled, */IDecoderGettable, IPointData, IPersistable { - private static final long serialVersionUID = 1L; - @ManyToOne - @PrimaryKeyJoinColumn - //@DataURI(position = 1, embedded = true) - @DynamicSerializeElement - @XmlElement - private GenericPointDataProductInfo productInfo; + private static final long serialVersionUID = 1L; - @ManyToOne + @ManyToOne + @PrimaryKeyJoinColumn + // @DataURI(position = 1, embedded = true) + @DynamicSerializeElement + @XmlElement + private GenericPointDataProductInfo productInfo; + + @ManyToOne @PrimaryKeyJoinColumn @DynamicSerializeElement @XmlElement - private ObStation location; - - @Column - @DynamicSerializeElement - @XmlAttribute - private float slat; + private ObStation location; - @Column - @DynamicSerializeElement - @XmlAttribute - private float slon; + @Column + @DynamicSerializeElement + @XmlAttribute + private float slat; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - /* TBM - chin...delete these later..not used? - @Column - @DynamicSerializeElement - @XmlAttribute - private int numLevel; - */ - - @Column - @DynamicSerializeElement - @XmlAttribute - //@DataURI(position = 2) - //product release version for product correction used only. - private int productVersion=0; - - - //list of master level values - @Transient - @XmlElement - private List levelValueLst = new ArrayList(); - - //one level of parameters value map. Key (String) = parameter name, value (double) = parameter value - //@Transient - //private HashMap Map_ParmToValue = new HashMap(); - - //Map of all levels of parameters value maps. Key (integer) = level value in levelValueLst, value = - // one level of parameter values = a Map_ParmToValue map). - //@Transient - //private HashMap> Map_LevelToParmValueMap = new HashMap >(); - - public GenericPointDataRecord() { - super(); - //System.out.println("GenericPointDataRecord() entered"); - - } + @Column + @DynamicSerializeElement + @XmlAttribute + private float slon; - public GenericPointDataRecord(String uri) { - super(uri); - //System.out.println("GenericPointDataRecord(String uri) entered"); - } + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - public GenericPointDataRecord(String uri, GenericPointDataProductInfo productInfo, - ObStation location, - float slat, float slon, PointDataView pointDataView) { - super(uri); - this.productInfo = productInfo; - this.location = location; - this.slat = slat; - this.slon = slon; - this.pointDataView = pointDataView; - this.pluginName ="gpd"; - //System.out.println("GenericPointDataRecord(3) entered"); - } - public GenericPointDataRecord(GenericPointDataProductInfo productInfo, - ObStation location, - float slat, float slon, PointDataView pointDataView, DataTime dataTime, - int productVersion) { - this.productInfo = productInfo; - this.location = location; - this.slat = slat; - this.slon = slon; - this.pointDataView = pointDataView; - this.dataTime = dataTime; - this.productVersion = productVersion; - this.pluginName ="gpd"; - //System.out.println("GenericPointDataRecord(4) entered"); - } - - /* TBM - chin...delete it later..not used? - public void constructTransientListAndMap(GenericPointDataStationProduct stnPd){ - setNumLevel(stnPd.getNumLevel()); - for(int i=0; i levelValueLst = new ArrayList(); - public void setProductInfo(GenericPointDataProductInfo productInfo) { - this.productInfo = productInfo; - } + // one level of parameters value map. Key (String) = parameter name, value + // (double) = parameter value + // @Transient + // private HashMap Map_ParmToValue = new HashMap(); - public float getSlat() { - return slat; - } + // Map of all levels of parameters value maps. Key (integer) = level value + // in levelValueLst, value = + // one level of parameter values = a Map_ParmToValue map). + // @Transient + // private HashMap> Map_LevelToParmValueMap = + // new HashMap >(); - public void setSlat(float slat) { - this.slat = slat; - } + public GenericPointDataRecord() { + super(); + // System.out.println("GenericPointDataRecord() entered"); - public float getSlon() { - return slon; - } + } - public void setSlon(float slon) { - this.slon = slon; - } + public GenericPointDataRecord(String uri) { + super(uri); + // System.out.println("GenericPointDataRecord(String uri) entered"); + } - @Override - public IDecoderGettable getDecoderGettable() { - // TODO Auto-generated method stub - return null; - } + public GenericPointDataRecord(String uri, + GenericPointDataProductInfo productInfo, ObStation location, + float slat, float slon, PointDataView pointDataView) { + super(uri); + this.productInfo = productInfo; + this.location = location; + this.slat = slat; + this.slon = slon; + this.pointDataView = pointDataView; + // System.out.println("GenericPointDataRecord(3) entered"); + } - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } + public GenericPointDataRecord(GenericPointDataProductInfo productInfo, + ObStation location, float slat, float slon, + PointDataView pointDataView, DataTime dataTime, int productVersion) { + this.productInfo = productInfo; + this.location = location; + this.slat = slat; + this.slon = slon; + this.pointDataView = pointDataView; + this.dataTime = dataTime; + this.productVersion = productVersion; + // System.out.println("GenericPointDataRecord(4) entered"); + } - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + /* + * TBM - chin...delete it later..not used? public void + * constructTransientListAndMap(GenericPointDataStationProduct stnPd){ + * setNumLevel(stnPd.getNumLevel()); for(int i=0; i getValues(String paramName) { - // TODO Auto-generated method stub - return null; - } + public void setProductInfo(GenericPointDataProductInfo productInfo) { + this.productInfo = productInfo; + } - @Override - public String getString(String paramName) { - // TODO Auto-generated method stub - return null; - } + public float getSlat() { + return slat; + } - @Override - public String[] getStrings(String paramName) { - // TODO Auto-generated method stub - return null; - } + public void setSlat(float slat) { + this.slat = slat; + } - - /*TBM - chin...delete these later..not used? - @Override - public void constructDataURI() throws PluginException { - // TODO Auto-generated method stub - super.constructDataURI(); - // ObStation class does not define dataUri component. Therefore, - // add stationId/longitude/latitude here to end of dataUri - if(this.location!=null){ - if(this.location.getStationId()!=null){ - this.dataURI = this.dataURI+DataURI.SEPARATOR+this.location.getStationId(); - } - else { - this.dataURI = this.dataURI+DataURI.SEPARATOR+"null"; - } - if(this.location.getStationGeom()!=null){ - this.dataURI = this.dataURI+DataURI.SEPARATOR+ - this.location.getStationGeom().getX()+ DataURI.SEPARATOR+ - this.location.getStationGeom().getY(); - } - else { - this.dataURI = this.dataURI+DataURI.SEPARATOR+"null"+DataURI.SEPARATOR+"null"; - } - } - }*/ + public float getSlon() { + return slon; + } - public ObStation getLocation() { - return location; - } + public void setSlon(float slon) { + this.slon = slon; + } - public void setLocation(ObStation location) { - this.location = location; - } + @Override + public IDecoderGettable getDecoderGettable() { + // TODO Auto-generated method stub + return null; + } - /* TBM - chin...delete these later..not used? - public int getNumLevel() { - return numLevel; - } + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } - public void setNumLevel(int numLevel) { - this.numLevel = numLevel; - } */ + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } - public List getLevelValueLst() { - return levelValueLst; - } + @Override + public Amount getValue(String paramName) { + // TODO Auto-generated method stub + return null; + } - public void setLevelValueLst(List levelValueLst) { - this.levelValueLst = levelValueLst; - } + @Override + public Collection getValues(String paramName) { + // TODO Auto-generated method stub + return null; + } - /* TBM - chin...delete these later..not used? - public HashMap getMap_ParmToValue() { - return Map_ParmToValue; - } + @Override + public String getString(String paramName) { + // TODO Auto-generated method stub + return null; + } - public void setMap_ParmToValue(HashMap map_ParmToValue) { - Map_ParmToValue = map_ParmToValue; - } + @Override + public String[] getStrings(String paramName) { + // TODO Auto-generated method stub + return null; + } - public HashMap> getMap_LevelToParmValueMap() { - return Map_LevelToParmValueMap; - } + /* + * TBM - chin...delete these later..not used? + * + * @Override public void constructDataURI() throws PluginException { // TODO + * Auto-generated method stub super.constructDataURI(); // ObStation class + * does not define dataUri component. Therefore, // add + * stationId/longitude/latitude here to end of dataUri + * if(this.location!=null){ if(this.location.getStationId()!=null){ + * this.dataURI = + * this.dataURI+DataURI.SEPARATOR+this.location.getStationId(); } else { + * this.dataURI = this.dataURI+DataURI.SEPARATOR+"null"; } + * if(this.location.getStationGeom()!=null){ this.dataURI = + * this.dataURI+DataURI.SEPARATOR+ this.location.getStationGeom().getX()+ + * DataURI.SEPARATOR+ this.location.getStationGeom().getY(); } else { + * this.dataURI = + * this.dataURI+DataURI.SEPARATOR+"null"+DataURI.SEPARATOR+"null"; } } } + */ - public void setMap_LevelToParmValueMap( - HashMap> map_LevelToParmValueMap) { - Map_LevelToParmValueMap = map_LevelToParmValueMap; - }*/ + public ObStation getLocation() { + return location; + } - public int getProductVersion() { - return productVersion; - } + public void setLocation(ObStation location) { + this.location = location; + } - public void setProductVersion(int productVersion) { - this.productVersion = productVersion; - } + /* + * TBM - chin...delete these later..not used? public int getNumLevel() { + * return numLevel; } + * + * public void setNumLevel(int numLevel) { this.numLevel = numLevel; } + */ + public List getLevelValueLst() { + return levelValueLst; + } + + public void setLevelValueLst(List levelValueLst) { + this.levelValueLst = levelValueLst; + } + + /* + * TBM - chin...delete these later..not used? public HashMap + * getMap_ParmToValue() { return Map_ParmToValue; } + * + * public void setMap_ParmToValue(HashMap map_ParmToValue) { + * Map_ParmToValue = map_ParmToValue; } + * + * public HashMap> + * getMap_LevelToParmValueMap() { return Map_LevelToParmValueMap; } + * + * public void setMap_LevelToParmValueMap( HashMap> map_LevelToParmValueMap) { Map_LevelToParmValueMap = + * map_LevelToParmValueMap; } + */ + + public int getProductVersion() { + return productVersion; + } + + public void setProductVersion(int productVersion) { + this.productVersion = productVersion; + } + + @Override + public String getPluginName() { + return "gpd"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.idft/src/gov/noaa/nws/ncep/common/dataplugin/idft/IdftRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.idft/src/gov/noaa/nws/ncep/common/dataplugin/idft/IdftRecord.java index 6a98caea32..bf9462fd61 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.idft/src/gov/noaa/nws/ncep/common/dataplugin/idft/IdftRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.idft/src/gov/noaa/nws/ncep/common/dataplugin/idft/IdftRecord.java @@ -1,30 +1,3 @@ -/** - * - * IdftRecord.java - * - * This java class performs the mapping to the database tables for the Ice Drift - * (IDFT) Decoder Plug-In. - * - *
- * 
- * SOFTWARE HISTORY
- * Date			Ticket#		Engineer		Description
- * ------------	----------- --------------	-----------------------------------
- * 05/21/09		   100		F. J. Yen		Initial creation
- * 12/08/09		   100		F. J. Yen		Modified for to11d6 from to11d3
- * 05/27/10		   100		F. J. Yen		Refactored from to11dr3 for tolldr11
- * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
- * Apr 12, 2013    1857     bgonzale        Added SequenceGenerator annotation.
- * 03/07/13        982      Archana         Updated getPointNum() to return an Integer
- * 
- * *
- * This code has been developed by the SIB for use in the AWIPS2 system.
- * 
- * - * @author F. J. Yen, SIB - * @version 1 - */ - package gov.noaa.nws.ncep.common.dataplugin.idft; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; @@ -52,19 +25,29 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; /** + * This java class performs the mapping to the database tables for the Ice Drift + * (IDFT) Decoder Plug-In. * - * + * This code has been developed by the SIB for use in the AWIPS2 system. + * *
  * 
  * SOFTWARE HISTORY
  * 
  * Date         Ticket#    Engineer    Description
- * ------------ ---------- ----------- --------------------------
- * 07/22/2013   1977       rjpeter     Added getDataURI and annotations.
- * 
+ * ------------ --------- ----------- --------------------------
+ * May 21, 2009 100       F. J. Yen   Initial creation
+ * Dec 08, 2009 100       F. J. Yen   Modified for to11d6 from to11d3
+ * May 27, 2010 100       F. J. Yen   Refactored from to11dr3 for tolldr11
+ * Apr 04, 2013 1846      bkowal      Added an index on refTime and forecastTime
+ * Apr 12, 2013 1857      bgonzale    Added SequenceGenerator annotation.
+ * Mar 07, 2013 982       Archana     Updated getPointNum() to return an Integer
+ * Jul 22, 2013 1977      rjpeter     Added getDataURI and annotations.
+ * Aug 30, 2013 2298      rjpeter     Make getPluginName abstract
  * 
+ * * - * @author rjpeter + * @author F. J. Yen, SIB * @version 1.0 */ @Entity @@ -222,4 +205,9 @@ public class IdftRecord extends PluginDataObject { public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "idft"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.intlsigmet/src/gov/noaa/nws/ncep/common/dataplugin/intlsigmet/IntlSigmetRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.intlsigmet/src/gov/noaa/nws/ncep/common/dataplugin/intlsigmet/IntlSigmetRecord.java index 4c622b792b..60b09f4e49 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.intlsigmet/src/gov/noaa/nws/ncep/common/dataplugin/intlsigmet/IntlSigmetRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.intlsigmet/src/gov/noaa/nws/ncep/common/dataplugin/intlsigmet/IntlSigmetRecord.java @@ -58,183 +58,174 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "intlsigmet", - indexes = { - @Index(name = "intlsigmet_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "intlsigmet", indexes = { @Index(name = "intlsigmet_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize +public class IntlSigmetRecord extends PluginDataObject { - -public class IntlSigmetRecord extends PluginDataObject{ - - /** + /** * */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - // reportType is "international sigmet". - @Column(length=32) - @DataURI(position=1) - @DynamicSerializeElement - private String reportType; - - // hazardType is weather phenomena. - @Column(length=48) - @DataURI(position=2) - @DynamicSerializeElement - private String hazardType; - - // WMO header - @Column(length=32) - @DynamicSerializeElement - private String wmoHeader; - - // The issue office where the report from - @Column(length=32) - @DynamicSerializeElement - private String issueOffice; - - // Issue time of the report - @Column - @DynamicSerializeElement - private Calendar issueTime; - - // Start time of the report - @Column - @DynamicSerializeElement - private Calendar startTime; - - // End time of the report - @Column - @DynamicSerializeElement - private Calendar endTime; - - // The message ID - @Column(length=16) - @DataURI(position=3) - @DynamicSerializeElement - private String messageID; - - // The sequence number - @Column(length=8) - @DataURI(position=4) - @DynamicSerializeElement - private String sequenceNumber; - - // The air traffic services unit - @Column(length=16) - @DynamicSerializeElement - private String atsu; - - // The location indicator of the meteorological watch office originator - @Column(length=16) - @DynamicSerializeElement - private String omwo; - - // Flight level 1 - @Column - @DynamicSerializeElement - private Integer flightlevel1; - - // Flight level 2 - @Column - @DynamicSerializeElement - private Integer flightlevel2; - - // Distance - @Column - @DynamicSerializeElement - private Integer distance; - - // Direction - @Column(length=16) - @DynamicSerializeElement - private String direction; - - // Speed - @Column - @DynamicSerializeElement - private Integer speed; - - /* - * the name of the storm, where applicable, or location of the - * volcano, where applicable, or the word, OTHER, for reports - * not from CONUS, Hawaii, Guam, Japan, UK, Tahiti, and Cuba - - */ - @Column(length=48) - @DynamicSerializeElement - private String nameLocation; - - /* - * remarks such as: correction, remarks, ...etc. - */ - @Column(length=32) + // reportType is "international sigmet". + @Column(length = 32) + @DataURI(position = 1) @DynamicSerializeElement - private String remarks; - - // The changes in intensity; using as "INTSF", "WKN", or "NC". - @Column(length=16) - @DynamicSerializeElement - private String intensity; - - // The polygon indicator as "WI", "WTN", "EITHER SIDE", or "E OF". - @Column(length=16) - @DynamicSerializeElement - private String polygonExtent; - - // The entire report - @Column(length=5000) - @DynamicSerializeElement - private String bullMessage; + private String reportType; + // hazardType is weather phenomena. + @Column(length = 48) + @DataURI(position = 2) + @DynamicSerializeElement + private String hazardType; - /** - * Intlsigmet location - */ - @DynamicSerializeElement - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - @JoinColumn(name = "parentID", nullable = false) + // WMO header + @Column(length = 32) + @DynamicSerializeElement + private String wmoHeader; + + // The issue office where the report from + @Column(length = 32) + @DynamicSerializeElement + private String issueOffice; + + // Issue time of the report + @Column + @DynamicSerializeElement + private Calendar issueTime; + + // Start time of the report + @Column + @DynamicSerializeElement + private Calendar startTime; + + // End time of the report + @Column + @DynamicSerializeElement + private Calendar endTime; + + // The message ID + @Column(length = 16) + @DataURI(position = 3) + @DynamicSerializeElement + private String messageID; + + // The sequence number + @Column(length = 8) + @DataURI(position = 4) + @DynamicSerializeElement + private String sequenceNumber; + + // The air traffic services unit + @Column(length = 16) + @DynamicSerializeElement + private String atsu; + + // The location indicator of the meteorological watch office originator + @Column(length = 16) + @DynamicSerializeElement + private String omwo; + + // Flight level 1 + @Column + @DynamicSerializeElement + private Integer flightlevel1; + + // Flight level 2 + @Column + @DynamicSerializeElement + private Integer flightlevel2; + + // Distance + @Column + @DynamicSerializeElement + private Integer distance; + + // Direction + @Column(length = 16) + @DynamicSerializeElement + private String direction; + + // Speed + @Column + @DynamicSerializeElement + private Integer speed; + + /* + * the name of the storm, where applicable, or location of the volcano, + * where applicable, or the word, OTHER, for reports not from CONUS, Hawaii, + * Guam, Japan, UK, Tahiti, and Cuba + */ + @Column(length = 48) + @DynamicSerializeElement + private String nameLocation; + + /* + * remarks such as: correction, remarks, ...etc. + */ + @Column(length = 32) + @DynamicSerializeElement + private String remarks; + + // The changes in intensity; using as "INTSF", "WKN", or "NC". + @Column(length = 16) + @DynamicSerializeElement + private String intensity; + + // The polygon indicator as "WI", "WTN", "EITHER SIDE", or "E OF". + @Column(length = 16) + @DynamicSerializeElement + private String polygonExtent; + + // The entire report + @Column(length = 5000) + @DynamicSerializeElement + private String bullMessage; + + /** + * Intlsigmet location + */ + @DynamicSerializeElement + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @JoinColumn(name = "parentID", nullable = false) @Index(name = "intlSigmetLocation_parentid_idex") - private Set intlSigmetLocation = new HashSet(); + private Set intlSigmetLocation = new HashSet(); - - /** + /** * Default Convstructor */ public IntlSigmetRecord() { - this.issueOffice=null; - this.wmoHeader=null; - this.bullMessage=null; - this.hazardType=null; - this.messageID=null; - this.reportType="INTLSIGMET"; - this.sequenceNumber=null; - this.atsu=null; - this.omwo=null; - this.nameLocation=null; - this.intensity=null; - this.remarks=null; - this.flightlevel1=IDecoderConstantsN.INTEGER_MISSING; - this.flightlevel2=IDecoderConstantsN.INTEGER_MISSING; - this.direction=null; - this.distance=IDecoderConstantsN.INTEGER_MISSING; - this.speed=IDecoderConstantsN.INTEGER_MISSING; - this.polygonExtent=null; + this.issueOffice = null; + this.wmoHeader = null; + this.bullMessage = null; + this.hazardType = null; + this.messageID = null; + this.reportType = "INTLSIGMET"; + this.sequenceNumber = null; + this.atsu = null; + this.omwo = null; + this.nameLocation = null; + this.intensity = null; + this.remarks = null; + this.flightlevel1 = IDecoderConstantsN.INTEGER_MISSING; + this.flightlevel2 = IDecoderConstantsN.INTEGER_MISSING; + this.direction = null; + this.distance = IDecoderConstantsN.INTEGER_MISSING; + this.speed = IDecoderConstantsN.INTEGER_MISSING; + this.polygonExtent = null; } /** * Convstructs a consigmet record from a dataURI * - * @param uri The dataURI + * @param uri + * The dataURI */ public IntlSigmetRecord(String uri) { super(uri); } - @Override public IDecoderGettable getDecoderGettable() { // TODO Auto-generated method stub @@ -242,338 +233,356 @@ public class IntlSigmetRecord extends PluginDataObject{ } /** - * @return the issueOffice - */ - public String getIssueOffice(){ - return issueOffice; - } + * @return the issueOffice + */ + public String getIssueOffice() { + return issueOffice; + } - /** - * @param issueOffice to set - */ - public void setIssueOffice(String issueOffice){ - this.issueOffice=issueOffice; - } - - /** - * @return the wmoHeader - */ - public String getWmoHeader(){ - return wmoHeader; - } + /** + * @param issueOffice + * to set + */ + public void setIssueOffice(String issueOffice) { + this.issueOffice = issueOffice; + } - /** - * @param wnoHeader to set - */ - public void setWmoHeader(String wmoHeader){ - this.wmoHeader=wmoHeader; - } - - /** - * @return the issueTime - */ - public Calendar getIssueTime(){ - return issueTime; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param issueTime to set - */ - public void setIssueTime(Calendar issueTime){ - this.issueTime=issueTime; - } - - /** - * @return the reportType - */ - public String getReportType() { - return reportType; - } + /** + * @param wnoHeader + * to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * @param reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } + /** + * @return the issueTime + */ + public Calendar getIssueTime() { + return issueTime; + } - /** - * @return the bullMessage - */ - public String getBullMessage() { - return bullMessage; - } + /** + * @param issueTime + * to set + */ + public void setIssueTime(Calendar issueTime) { + this.issueTime = issueTime; + } - /** - * @param bullMessage to set - */ - public void setBullMessage(String bullMessage) { - this.bullMessage = bullMessage; - } + /** + * @return the reportType + */ + public String getReportType() { + return reportType; + } - /** - * @return the set of hazard - */ - public String getHazardType() { - return hazardType; - } + /** + * @param reportType + * to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } - /** - * @param hazardType to set - */ - public void setHazardType(String hazardType) { - this.hazardType = hazardType; - } + /** + * @return the bullMessage + */ + public String getBullMessage() { + return bullMessage; + } - /** - * @return the startTime - */ - public Calendar getStartTime() { - return startTime; - } + /** + * @param bullMessage + * to set + */ + public void setBullMessage(String bullMessage) { + this.bullMessage = bullMessage; + } - /** - * @param startTime to set - */ - public void setStartTime(Calendar startTime) { - this.startTime = startTime; - } + /** + * @return the set of hazard + */ + public String getHazardType() { + return hazardType; + } - /** - * @return the endTime - */ - public Calendar getEndTime() { - return endTime; - } + /** + * @param hazardType + * to set + */ + public void setHazardType(String hazardType) { + this.hazardType = hazardType; + } - /** - * @param endTime to set - */ - public void setEndTime(Calendar endTime) { - this.endTime = endTime; - } + /** + * @return the startTime + */ + public Calendar getStartTime() { + return startTime; + } - public String getMessageID() { - return messageID; - } + /** + * @param startTime + * to set + */ + public void setStartTime(Calendar startTime) { + this.startTime = startTime; + } - /** - * @param messageID to set - */ - public void setMessageID(String messageID) { - this.messageID = messageID; - } + /** + * @return the endTime + */ + public Calendar getEndTime() { + return endTime; + } - /** - * @return the sequenceNumber - */ - public String getSequenceNumber() { - return sequenceNumber; - } + /** + * @param endTime + * to set + */ + public void setEndTime(Calendar endTime) { + this.endTime = endTime; + } - /** - * @param sequenceNumber to set - */ - public void setSequenceNumber(String sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } + public String getMessageID() { + return messageID; + } - /** - * @return the atsu - */ - public String getAtsu() { - return atsu; - } + /** + * @param messageID + * to set + */ + public void setMessageID(String messageID) { + this.messageID = messageID; + } - /** - * @param atsu to set - */ - public void setAtsu(String atsu) { - this.atsu = atsu; - } + /** + * @return the sequenceNumber + */ + public String getSequenceNumber() { + return sequenceNumber; + } - /** - * @return the omwo - */ - public String getOmwo() { - return omwo; - } + /** + * @param sequenceNumber + * to set + */ + public void setSequenceNumber(String sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } - /** - * @param omwo to set - */ - public void setOmwo(String omwo) { - this.omwo = omwo; - } + /** + * @return the atsu + */ + public String getAtsu() { + return atsu; + } - /** - * @return the flightLevel1 - */ - public Integer getFlightlevel1() { - return flightlevel1; - } + /** + * @param atsu + * to set + */ + public void setAtsu(String atsu) { + this.atsu = atsu; + } - /** - * @param flightLevel1 to set - */ - public void setFlightlevel1(Integer flightlevel1) { - this.flightlevel1 = flightlevel1; - } + /** + * @return the omwo + */ + public String getOmwo() { + return omwo; + } - /** - * @return flightLevel2 - */ - public Integer getFlightlevel2() { - return flightlevel2; - } + /** + * @param omwo + * to set + */ + public void setOmwo(String omwo) { + this.omwo = omwo; + } - /** - * @param flightLevel2 to set - */ - public void setFlightlevel2(Integer flightlevel2) { - this.flightlevel2 = flightlevel2; - } - - /** - * @return distacne - */ - public Integer getDistance() { - return distance; - } + /** + * @return the flightLevel1 + */ + public Integer getFlightlevel1() { + return flightlevel1; + } - /** - * @param distance to set - */ - public void setDistance(Integer distance) { - this.distance = distance; - } + /** + * @param flightLevel1 + * to set + */ + public void setFlightlevel1(Integer flightlevel1) { + this.flightlevel1 = flightlevel1; + } - /** - * @return direction - */ - public String getDirection() { - return direction; - } + /** + * @return flightLevel2 + */ + public Integer getFlightlevel2() { + return flightlevel2; + } - /** - * @param direction to set - */ - public void setDirection(String direction) { - this.direction = direction; - } + /** + * @param flightLevel2 + * to set + */ + public void setFlightlevel2(Integer flightlevel2) { + this.flightlevel2 = flightlevel2; + } - /** - * @return the speed - */ - public Integer getSpeed() { - return speed; - } + /** + * @return distacne + */ + public Integer getDistance() { + return distance; + } - /** - * @param speed to set - */ - public void setSpeed(Integer speed) { - this.speed = speed; - } + /** + * @param distance + * to set + */ + public void setDistance(Integer distance) { + this.distance = distance; + } - /** - * @return the nameLocation - */ - public String getNameLocation() { - return nameLocation; - } + /** + * @return direction + */ + public String getDirection() { + return direction; + } - /** - * @param nameLocation to set - */ - public void setNameLocation(String nameLocation) { - this.nameLocation = nameLocation; - } + /** + * @param direction + * to set + */ + public void setDirection(String direction) { + this.direction = direction; + } - /** - * @return the remarks - */ - public String getRemarks() { - return remarks; - } + /** + * @return the speed + */ + public Integer getSpeed() { + return speed; + } - /** - * @param remarks to set - */ - public void setRemarks(String remarks) { - this.remarks = remarks; - } + /** + * @param speed + * to set + */ + public void setSpeed(Integer speed) { + this.speed = speed; + } - /** - * @return the intensity - */ - public String getIntensity() { - return intensity; - } - - /** - * @param intensity to set - */ - public void setIntensity(String intensity) { - this.intensity = intensity; - } - - /** - * @return the polygonExtent - */ - public String getPolygonExtent() { - return polygonExtent; - } - - /** - * @param polygonExtent to set - */ - public void setPolygonExtent(String polygonExtent) { - this.polygonExtent = polygonExtent; - } + /** + * @return the nameLocation + */ + public String getNameLocation() { + return nameLocation; + } - /** - * @return the intlSigmetLocation - */ - public Set getIntlSigmetLocation() { - return intlSigmetLocation; - } + /** + * @param nameLocation + * to set + */ + public void setNameLocation(String nameLocation) { + this.nameLocation = nameLocation; + } - /** - * @param intlSigmetLocation to set - */ - public void setIntlSigmetLocation(Set intlSigmetLocation) { - this.intlSigmetLocation = intlSigmetLocation; - } + /** + * @return the remarks + */ + public String getRemarks() { + return remarks; + } - /** - * @return the serialVersionUID - */ - public static long getSerialVersionUID() { - return serialVersionUID; - } - - /** - * @param add international sigmet Location to set - */ - public void addIntlSigmetLocation(IntlSigmetLocation psection){ - intlSigmetLocation.add(psection); - - } - - /** - * Override existing set method to modify any - * classes that use the dataURI as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) - { + /** + * @param remarks + * to set + */ + public void setRemarks(String remarks) { + this.remarks = remarks; + } - this.identifier = dataURI; - - - - } + /** + * @return the intensity + */ + public String getIntensity() { + return intensity; + } + + /** + * @param intensity + * to set + */ + public void setIntensity(String intensity) { + this.intensity = intensity; + } + + /** + * @return the polygonExtent + */ + public String getPolygonExtent() { + return polygonExtent; + } + + /** + * @param polygonExtent + * to set + */ + public void setPolygonExtent(String polygonExtent) { + this.polygonExtent = polygonExtent; + } + + /** + * @return the intlSigmetLocation + */ + public Set getIntlSigmetLocation() { + return intlSigmetLocation; + } + + /** + * @param intlSigmetLocation + * to set + */ + public void setIntlSigmetLocation(Set intlSigmetLocation) { + this.intlSigmetLocation = intlSigmetLocation; + } + + /** + * @return the serialVersionUID + */ + public static long getSerialVersionUID() { + return serialVersionUID; + } + + /** + * @param add + * international sigmet Location to set + */ + public void addIntlSigmetLocation(IntlSigmetLocation psection) { + intlSigmetLocation.add(psection); + + } + + /** + * Override existing set method to modify any classes that use the dataURI + * as a foreign key + */ + @Override + public void setIdentifier(Object dataURI) { + this.identifier = dataURI; + } @Override @Column @@ -581,4 +590,9 @@ public class IntlSigmetRecord extends PluginDataObject{ public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "intlsigmet"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.mcidas/src/gov/noaa/nws/ncep/common/dataplugin/mcidas/McidasRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.mcidas/src/gov/noaa/nws/ncep/common/dataplugin/mcidas/McidasRecord.java index d5f3316c16..8395e52c8d 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.mcidas/src/gov/noaa/nws/ncep/common/dataplugin/mcidas/McidasRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.mcidas/src/gov/noaa/nws/ncep/common/dataplugin/mcidas/McidasRecord.java @@ -8,16 +8,18 @@ * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * 08/2009 144 T. Lee Created - * 11/2009 144 T. Lee Implemented area name and - * added file name - * 12/2009 144 T. Lee Added calType, satelliteId - * and imageTypeNumber - * 05/2010 144 L. Lin Migration to TO11DR11. - * 09/2012 B. Hebbard Merge out RTS changes from OB12.9.1 - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime + * 11/2009 144 T. Lee Implemented area name and added file + * name + * 12/2009 144 T. Lee Added calType, satelliteId and + * imageTypeNumber + * 05/2010 144 L. Lin Migration to TO11DR11. + * 09/2012 B. Hebbard Merge out RTS changes from OB12.9.1 + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -65,12 +67,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "mcidas", - indexes = { - @Index(name = "mcidas_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "mcidas", indexes = { @Index(name = "mcidas_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @@ -223,7 +221,6 @@ public class McidasRecord extends PersistablePluginDataObject implements super(uri); } - /** * Set the time to be used for the persistence time for this object. * @@ -379,4 +376,9 @@ public class McidasRecord extends PersistablePluginDataObject implements public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "mcidas"; + } } \ No newline at end of file diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncairep/src/gov/noaa/nws/ncep/common/dataplugin/ncairep/NcAirepPointDataTransform.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncairep/src/gov/noaa/nws/ncep/common/dataplugin/ncairep/NcAirepPointDataTransform.java index 41841d241f..1fcac9a8d6 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncairep/src/gov/noaa/nws/ncep/common/dataplugin/ncairep/NcAirepPointDataTransform.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncairep/src/gov/noaa/nws/ncep/common/dataplugin/ncairep/NcAirepPointDataTransform.java @@ -20,6 +20,8 @@ package gov.noaa.nws.ncep.common.dataplugin.ncairep; * further licensing information. **/ +import gov.noaa.nws.ncep.common.dataplugin.ncairep.dao.NcAirepDao; + import java.io.File; import java.util.ArrayList; import java.util.Date; @@ -27,7 +29,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import gov.noaa.nws.ncep.common.dataplugin.ncairep.dao.NcAirepDao; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataDescription; @@ -36,17 +37,21 @@ import com.raytheon.uf.common.pointdata.spatial.AircraftObsLocation; import com.raytheon.uf.common.time.DataTime; /** - * Provides a transform from NcAirepRecords to PointDataContainer and vice versa. + * Provides a transform from NcAirepRecords to PointDataContainer and vice + * versa. * *
  * 
  * SOFTWARE HISTORY
  * Date         Ticket#    Engineer    Description
  * ------------ ---------- ----------- --------------------------
- * 04/27/2011				F. J. Yen	Initial creation from MetarPointDataTransform
- * 06/28/2011				F. J. Yen	Updated for OB11.5
- * 09/19/2011    286       Q.Zhou      Modified populateRecord to add 8 new fields for TB, IC and SK.
- * 10/18/2011    286       Q.Zhou      Fixed datarui in db
+ * Apr 27, 2011            F. J. Yen   Initial creation from
+ *                                     MetarPointDataTransform
+ * Jun 28, 2011            F. J. Yen   Updated for OB11.5
+ * Sep 19, 2011 286        Q.Zhou      Modified populateRecord to add 8 new
+ *                                     fields for TB, IC and SK.
+ * Oct 18, 2011 286        Q.Zhou      Fixed datarui in db
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
  * 
* * @author f j yen @@ -68,9 +73,9 @@ public class NcAirepPointDataTransform { private static final String FLIGHT_HAZARD = "flightHazard"; private static final String FLIGHT_WEATHER = "flightWeather"; - + private static final String FLIGHT_CONDITIONS = "flightConditions"; - + // FLIGHT_HAZARD, FLIGHT_WEATHER, FLIGHT_CONDITIONS // ------------------ private static final String WMO_HEADER = "wmoHeader"; @@ -80,7 +85,7 @@ public class NcAirepPointDataTransform { private static final String REPORT_TYPE = "reportType"; private static final String TIME_OBS = "timeObs"; - + private static final String OBS_ID = "obsId"; // WMO_HEADER, STATION_ID, REPORT_TYPE, TIME_OBS, OBS_ID @@ -88,9 +93,9 @@ public class NcAirepPointDataTransform { private static final String LONGITUDE = "longitude"; private static final String LATITUDE = "latitude"; - + private static final String FLIGHT_LEVEL = "flightLevel"; - + // LONGITUDE, LATITUDE, FLIGHT_LEVEL // ------------------ private static final String CORRECTION_CODE = "correctionCode"; @@ -98,14 +103,23 @@ public class NcAirepPointDataTransform { private static final String DATAURI = "dataURI"; private static final String TURB_INTEN = "turbInten"; + private static final String TURB_TYPE = "turbType"; + private static final String TURB_FREQ = "turbFreq"; + private static final String ICE_INTEN = "iceInten"; + private static final String ICE_TYPE = "iceType"; + private static final String SKY_COVER = "skyCover"; + private static final String SKY_BASE_HEIGHT = "skyBaseHeight"; + private static final String SKY_TOP_HEIGHT = "skyTopHeight"; + private static final String SUSPECT_TIME_FLAG = "suspectTimeFlag"; + // CORRECTION_CODE, DATAURI, // ------------------ @@ -113,12 +127,12 @@ public class NcAirepPointDataTransform { * It is important to keep this up to date or risk breaking backwards * compatibility */ - private static final String[] ALL_PARAMS = { DATAURI, TIME_OBS, OBS_ID, REPORT_TYPE, - STATION_ID, WMO_HEADER, FLIGHT_HAZARD, FLIGHT_WEATHER, + private static final String[] ALL_PARAMS = { DATAURI, TIME_OBS, OBS_ID, + REPORT_TYPE, STATION_ID, WMO_HEADER, FLIGHT_HAZARD, FLIGHT_WEATHER, FLIGHT_CONDITIONS, LONGITUDE, LATITUDE, FLIGHT_LEVEL, - CORRECTION_CODE, TEMPERATURE, WIND_SPEED, WIND_DIR, - TURB_INTEN, TURB_TYPE, TURB_FREQ, ICE_INTEN, ICE_TYPE, SKY_COVER, - SKY_BASE_HEIGHT, SKY_TOP_HEIGHT, SUSPECT_TIME_FLAG}; + CORRECTION_CODE, TEMPERATURE, WIND_SPEED, WIND_DIR, TURB_INTEN, + TURB_TYPE, TURB_FREQ, ICE_INTEN, ICE_TYPE, SKY_COVER, + SKY_BASE_HEIGHT, SKY_TOP_HEIGHT, SUSPECT_TIME_FLAG }; public static final String ALL_PARAMS_LIST; static { @@ -150,60 +164,62 @@ public class NcAirepPointDataTransform { } public PluginDataObject[] toPointData(PluginDataObject[] pdo) { - - long t0 =System.currentTimeMillis(); - System.out.println("===============>toPointData"); // in NcAirepPointDataTransform t0=" + t0); + + long t0 = System.currentTimeMillis(); + System.out.println("===============>toPointData"); // in + // NcAirepPointDataTransform + // t0=" + t0); /* 999 */ - + if (pdo.length > 0) { Map pointMap = new HashMap(); - + for (PluginDataObject p : pdo) { - - if (!(p instanceof NcAirepRecord)) + + if (!(p instanceof NcAirepRecord)) { continue; - + } + File f = this.dao.getFullFilePath(p); - + PointDataContainer pdc = pointMap.get(f); if (pdc == null) { pdc = PointDataContainer.build(this.description); pointMap.put(f, pdc); - + } - - NcAirepRecord nar = (NcAirepRecord) p; - PointDataView pdv = buildView(pdc, nar); + + NcAirepRecord nar = (NcAirepRecord) p; + PointDataView pdv = buildView(pdc, nar); nar.setPointDataView(pdv); - + } } - - long t1 =System.currentTimeMillis(); - + + long t1 = System.currentTimeMillis(); + return pdo; } private PointDataView buildView(PointDataContainer container, NcAirepRecord record) { PointDataView pdv = container.append(); -// pdv.setString(STATION_ID, record.getStationId()); if (record.getCorIndicator() != null) { - pdv.setString(CORRECTION_CODE, record.getCorIndicator()); - }else{ - pdv.setString(CORRECTION_CODE," "); + pdv.setString(CORRECTION_CODE, record.getCorIndicator()); + } else { + pdv.setString(CORRECTION_CODE, " "); } - -// pdv.setFloat(LATITUDE, (float) record.getLatitude()); -// pdv.setFloat(LONGITUDE, (float) record.getLongitude()); + + // pdv.setFloat(LATITUDE, (float) record.getLatitude()); + // pdv.setFloat(LONGITUDE, (float) record.getLongitude()); pdv.setFloat(FLIGHT_LEVEL, record.getFlightLevel()); pdv.setLong(TIME_OBS, record.getDataTime().getRefTime().getTime()); -// pdv.setString(DATAURI, record.getDataURI()); -// pdv.setString(REPORT_TYPE, record.getReportType()); - pdv.setFloat(TEMPERATURE,(float) record.getTemp()); - pdv.setFloat(WIND_DIR, (float) record.getWindDirection()); - pdv.setFloat(WIND_SPEED, (float) record.getWindSpeed()); - + // pdv.setString(DATAURI, record.getDataURI()); + // pdv.setString(REPORT_TYPE, record.getReportType()); + pdv.setFloat(TEMPERATURE, record.getTemp()); + pdv.setFloat(WIND_DIR, record.getWindDirection()); + pdv.setFloat(WIND_SPEED, record.getWindSpeed()); + pdv.setString(TURB_INTEN, record.getTurbInten()); pdv.setString(TURB_TYPE, record.getTurbType()); pdv.setString(TURB_FREQ, record.getTurbFreq()); @@ -213,7 +229,7 @@ public class NcAirepPointDataTransform { pdv.setInt(SKY_BASE_HEIGHT, record.getSkyBaseHeight()); pdv.setInt(SKY_TOP_HEIGHT, record.getSkyTopHeight()); pdv.setString(SUSPECT_TIME_FLAG, record.getSuspectTimeFlag()); - + return pdv; } @@ -237,7 +253,6 @@ public class NcAirepPointDataTransform { nar.setTemp(pdv.getNumber(TEMPERATURE).floatValue()); - nar.setPluginName("ncairep"); nar.setFlightHazard(pdv.getInt(FLIGHT_HAZARD)); nar.setFlightWeather(pdv.getInt(FLIGHT_WEATHER)); nar.setFlightConditions(pdv.getInt(FLIGHT_CONDITIONS)); @@ -245,8 +260,8 @@ public class NcAirepPointDataTransform { // AIREP Wind data nar.setWindDirection(pdv.getNumber(WIND_DIR).floatValue()); nar.setWindSpeed(pdv.getNumber(WIND_SPEED).floatValue()); - //nar.setSuspectTimeFlag(pdv.getString(SUSPECT_TIME_FLAG)); - + // nar.setSuspectTimeFlag(pdv.getString(SUSPECT_TIME_FLAG)); + return nar; } @@ -260,4 +275,3 @@ public class NcAirepPointDataTransform { return records.toArray(new NcAirepRecord[records.size()]); } } - diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncairep/src/gov/noaa/nws/ncep/common/dataplugin/ncairep/NcAirepRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncairep/src/gov/noaa/nws/ncep/common/dataplugin/ncairep/NcAirepRecord.java index 3410c76c85..c35159c23b 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncairep/src/gov/noaa/nws/ncep/common/dataplugin/ncairep/NcAirepRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncairep/src/gov/noaa/nws/ncep/common/dataplugin/ncairep/NcAirepRecord.java @@ -60,19 +60,23 @@ import com.vividsolutions.jts.geom.Geometry; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20110421 F. J. Yen Initial creation from Raytheon's pirep. - * Change temp, windSpeed from Double to Float. - * Change windDirection from Integer to Float - * 08/30/2011 286 qzhou Use IDecoderConstantsN.INTEGER_MISSING instead -9999 in visibility. - * 08/31/2011 286 qzhou Moved this from ~edex.plugin.airep - * 9/20/2011 286 qzhou Change reportType to String - * 04/05/2012 420 dgilling Prevent NullPointerExceptions in + * Apr 21, 2011 F. J. Yen Initial creation from Raytheon's pirep. + * Change temp, windSpeed from Double to + * Float. Change windDirection from Integer + * to Float + * Aug 30, 2011 286 qzhou Use IDecoderConstantsN.INTEGER_MISSING + * instead -9999 in visibility. + * Aug 31, 2011 286 qzhou Moved this from ~edex.plugin.airep + * Sep 20, 2011 286 qzhou Change reportType to String + * Apr 05, 2012 420 dgilling Prevent NullPointerExceptions in * buildMessageData(). - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 04/08/13 1293 bkowal Removed references to hdffileid. - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -87,812 +91,804 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ncairep", - indexes = { - @Index(name = "ncairep_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ncairep", indexes = { @Index(name = "ncairep_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class NcAirepRecord extends PluginDataObject implements ISpatialEnabled, - IDecoderGettable, IPointData, IPersistable { + IDecoderGettable, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - // public static final String PLUGIN_NAME = "ncairep"; - // - // public static final String STATION_ID = "stationId"; + public static final Unit TEMPERATURE_UNIT = SI.CELSIUS; - public static final Unit TEMPERATURE_UNIT = SI.CELSIUS; + public static final Unit WIND_SPEED_UNIT = NonSI.KNOT; - public static final Unit WIND_SPEED_UNIT = NonSI.KNOT; + public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; - public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit ALTITUDE_UNIT = NonSI.FOOT; - public static final Unit ALTITUDE_UNIT = NonSI.FOOT; + public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; - public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; + private static UnitConverter ftToHft = NonSI.FOOT.getConverterTo(SI + .HECTO(NonSI.FOOT)); - private static UnitConverter ftToHft = NonSI.FOOT.getConverterTo(SI - .HECTO(NonSI.FOOT)); + private static final HashMap PARM_MAP = new HashMap(); - private static final HashMap PARM_MAP = new HashMap(); + // private static final HashMap WX_MAP = new + // HashMap(); - // private static final HashMap WX_MAP = new - // HashMap(); + static { + PARM_MAP.put("T", SFC_TEMP); + PARM_MAP.put("WS", SFC_WNDSPD); + PARM_MAP.put("WD", SFC_WNDDIR); + PARM_MAP.put("NLAT", STA_LAT); + PARM_MAP.put("NLON", STA_LON); + PARM_MAP.put("FLT_LVL", UA_FLTLVL); - static { - PARM_MAP.put("T", SFC_TEMP); - PARM_MAP.put("WS", SFC_WNDSPD); - PARM_MAP.put("WD", SFC_WNDDIR); - PARM_MAP.put("NLAT", STA_LAT); - PARM_MAP.put("NLON", STA_LON); - PARM_MAP.put("FLT_LVL", UA_FLTLVL); + // WX_MAP.put(0, "CLR"); + // WX_MAP.put(1, "SCT"); + // WX_MAP.put(2, "BKN"); + // WX_MAP.put(3, "CONT"); + // WX_MAP.put(4, "LIGHTNING"); + // WX_MAP.put(5, "DZRA"); + // WX_MAP.put(6, "CONT RA"); + // WX_MAP.put(7, "CONT SN"); + // WX_MAP.put(8, "SH"); + // WX_MAP.put(9, "TSRA"); + } - // WX_MAP.put(0, "CLR"); - // WX_MAP.put(1, "SCT"); - // WX_MAP.put(2, "BKN"); - // WX_MAP.put(3, "CONT"); - // WX_MAP.put(4, "LIGHTNING"); - // WX_MAP.put(5, "DZRA"); - // WX_MAP.put(6, "CONT RA"); - // WX_MAP.put(7, "CONT SN"); - // WX_MAP.put(8, "SH"); - // WX_MAP.put(9, "TSRA"); - } + @Transient + @DynamicSerializeElement + @XmlAttribute + private Integer obsId; - @Transient - @DynamicSerializeElement - @XmlAttribute - private Integer obsId; + // Time of the observation. + @Transient + @DynamicSerializeElement + @XmlAttribute + private Calendar timeObs; - // Time of the observation. - @Transient - @DynamicSerializeElement - @XmlAttribute - private Calendar timeObs; + // Time of the observation to the nearest hour. + @Column + @DynamicSerializeElement + @XmlAttribute + private Calendar refHour; - // Time of the observation to the nearest hour. - @Column - @DynamicSerializeElement - @XmlAttribute - private Calendar refHour; + // + @DataURI(position = 1) + @Column(length = 8) + @DynamicSerializeElement + @XmlAttribute + private String reportType; - // - @DataURI(position = 1) - @Column(length = 8) - @DynamicSerializeElement - @XmlAttribute - private String reportType; + // Text of the WMO header + @Transient + @DynamicSerializeElement + @XmlElement + private String wmoHeader; - // Text of the WMO header - @Transient - @DynamicSerializeElement - @XmlElement - private String wmoHeader; + // Correction indicator from wmo header + @DataURI(position = 2) + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String corIndicator; - // Correction indicator from wmo header - @DataURI(position = 2) - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String corIndicator; + // Observation air temperature in degrees Celsius. + // Decimal(5,2) + @Transient + @DynamicSerializeElement + @XmlElement + private Float temp; - // Observation air temperature in degrees Celsius. - // Decimal(5,2) - @Transient - @DynamicSerializeElement - @XmlElement - private Float temp; + // Observation wind direction in angular degrees. Integer + @Transient + @DynamicSerializeElement + @XmlElement + private Float windDirection; - // Observation wind direction in angular degrees. Integer - @Transient - @DynamicSerializeElement - @XmlElement - private Float windDirection; + // Observation wind speed in knots. + // Decimal(5,2) + @Transient + // @Column + @DynamicSerializeElement + @XmlElement + private Float windSpeed; - // Observation wind speed in knots. - // Decimal(5,2) - @Transient - // @Column - @DynamicSerializeElement - @XmlElement - private Float windSpeed; + @Transient + @DynamicSerializeElement + @XmlElement + private Integer flightHazard; - @Transient - @DynamicSerializeElement - @XmlElement - private Integer flightHazard; + @Transient + @DynamicSerializeElement + @XmlElement + private Integer flightWeather; - @Transient - @DynamicSerializeElement - @XmlElement - private Integer flightWeather; + @Transient + @DynamicSerializeElement + @XmlElement + private Integer flightConditions; - @Transient - @DynamicSerializeElement - @XmlElement - private Integer flightConditions; + // @Transient + // @DynamicSerializeElement + // @XmlElement + // private Float latitude; + // + // @Transient + // @DynamicSerializeElement + // @XmlElement + // private Float longitude; + // + // @Transient + // @DynamicSerializeElement + // @XmlElement + // private String stationId; - // @Transient - // @DynamicSerializeElement - // @XmlElement - // private Float latitude; - // - // @Transient - // @DynamicSerializeElement - // @XmlElement - // private Float longitude; - // - // @Transient - // @DynamicSerializeElement - // @XmlElement - // private String stationId; + // @Transient + // @DynamicSerializeElement + // @XmlElement + // private String dataURI; - // @Transient - // @DynamicSerializeElement - // @XmlElement - // private String dataURI; + @Transient + @DynamicSerializeElement + // @XmlElement + @XmlAttribute + private String turbInten; - @Transient - @DynamicSerializeElement - // @XmlElement - @XmlAttribute - private String turbInten; + @Transient + @DynamicSerializeElement + @XmlElement + private String iceInten; - @Transient - @DynamicSerializeElement - @XmlElement - private String iceInten; + @Transient + @DynamicSerializeElement + @XmlElement + private String skyCover; - @Transient - @DynamicSerializeElement - @XmlElement - private String skyCover; + @Transient + @DynamicSerializeElement + @XmlElement + private String turbType; - @Transient - @DynamicSerializeElement - @XmlElement - private String turbType; + @Transient + @DynamicSerializeElement + @XmlElement + private String iceType; - @Transient - @DynamicSerializeElement - @XmlElement - private String iceType; + @Transient + @DynamicSerializeElement + @XmlElement + private String turbFreq; - @Transient - @DynamicSerializeElement - @XmlElement - private String turbFreq; + @Transient + @DynamicSerializeElement + @XmlElement + private int skyBaseHeight; - @Transient - @DynamicSerializeElement - @XmlElement - private int skyBaseHeight; + @Transient + @DynamicSerializeElement + @XmlElement + private int skyTopHeight; - @Transient - @DynamicSerializeElement - @XmlElement - private int skyTopHeight; + @Transient + @DynamicSerializeElement + @XmlElement + private String suspectTimeFlag; - @Transient - @DynamicSerializeElement - @XmlElement - private String suspectTimeFlag; + @Embedded + @DataURI(position = 3, embedded = true) + @XmlElement + @DynamicSerializeElement + private AircraftObsLocation location; - @Embedded - @DataURI(position = 3, embedded = true) - @XmlElement - @DynamicSerializeElement - private AircraftObsLocation location; + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - /** + /** * */ - public NcAirepRecord() { - } - - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public NcAirepRecord(String uri) { - super(uri); - } - - public Integer getObsId() { - return obsId; - } - - public void setObsId(Integer obsId) { - this.obsId = obsId; - } - - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } - - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } - - /** - * Get the report correction indicator. - * - * @return The corIndicator - */ - public String getCorIndicator() { - return corIndicator; - } - - /** - * Set the report correction indicator. - * - * @param corIndicator - * The corIndicator. - */ - public void setCorIndicator(String corIndicator) { - this.corIndicator = corIndicator; - } - - /** - * Get the report data for this observation. - * - * @return The Report data. - */ - public String getReportData() { - String s = null; - if (messageData != null && messageData instanceof String) { - s = (String) messageData; - } else { - s = buildMessageData(); - } - return s; - } - - /** - * Set the report data for this observation. - * - * @param reportData - * The Report data. - */ - public void setReportData(String reportData) { - messageData = reportData; - } - - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } - - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } - - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } - - /** - * Boolean for whether location is defined in the spatial tables. - * - * @return true or false (Is location defined in the spatial tables?) - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } - - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } - - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getFlightLevel() { - return location.getFlightLevel(); - } - - /** - * @return the reportType - */ - public String getReportType() { - return reportType; - } - - /** - * @param reportType - * the reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } - - /** - * @return the timeObs - */ - public Calendar getTimeObs() { - if (this.dataTime == null) { - return null; - } - return this.dataTime.getRefTimeAsCalendar(); - } - - /** - * @param timeObs - * the timeObs to set - */ - public void setTimeObs(Calendar timeObs) { - this.timeObs = timeObs; - } - - /** - * @return the refHour - */ - public Calendar getRefHour() { - return refHour; - } - - /** - * @param refHour - * the refHour to set - */ - public void setRefHour(Calendar refHour) { - this.refHour = refHour; - } - - /** - * @return the temp - */ - public float getTemp() { - return temp; - } - - /** - * @param temp - * the temp to set - */ - public void setTemp(float temp) { - this.temp = temp; - } - - /** - * @return the windDirection - */ - public float getWindDirection() { - return windDirection; - } - - /** - * @param windDirection - * the windDirection to set - */ - public void setWindDirection(float windDirection) { - this.windDirection = windDirection; - } - - /** - * @return the windspeed - */ - public float getWindSpeed() { - return windSpeed; - } - - /** - * @param windspeed - * the windspeed to set - */ - public void setWindSpeed(float windSpeed) { - this.windSpeed = windSpeed; - } - - /** - * @return the flightHazard - */ - public Integer getFlightHazard() { - return flightHazard; - } - - /** - * @param flightHazard - * the wx_past_1 to set - */ - public void setFlightHazard(Integer flightHazard) { - this.flightHazard = flightHazard; - } - - /** - * @return the flightWeather - */ - public Integer getFlightWeather() { - return flightWeather; - } - - /** - * @param flightWeather - * the getFlightWeather to set - */ - public void setFlightWeather(Integer flightWeather) { - this.flightWeather = flightWeather; - } - - /** - * @return the flightConditions - */ - public Integer getFlightConditions() { - return flightConditions; - } - - /** - * @param flightConditions - * the flightConditions to set - */ - public void setFlightConditions(Integer flightConditions) { - this.flightConditions = flightConditions; - } - - /** - * @return the wmoHeader - */ - public String getTurbInten() { - return turbInten; - } - - public void setTurbInten(String turbInten) { - this.turbInten = turbInten; - } - - public String getIceInten() { - return iceInten; - } - - public void setIceInten(String iceInten) { - this.iceInten = iceInten; - } - - public String getSkyCover() { - return skyCover; - } - - public void setSkyCover(String skyCover) { - this.skyCover = skyCover; - } - - public String getTurbType() { - return turbType; - } - - public void setTurbType(String turbType) { - this.turbType = turbType; - } - - public String getIceType() { - return iceType; - } - - public void setIceType(String iceType) { - this.iceType = iceType; - } - - public String getTurbFreq() { - return turbFreq; - } - - public void setTurbFreq(String turbFreq) { - this.turbFreq = turbFreq; - } - - public int getSkyBaseHeight() { - return skyBaseHeight; - } - - public void setSkyBaseHeight(int skyBaseHeight) { - this.skyBaseHeight = skyBaseHeight; - } - - public int getSkyTopHeight() { - return skyTopHeight; - } - - public void setSkyTopHeight(int skyTopHeight) { - this.skyTopHeight = skyTopHeight; - } - - public String getSuspectTimeFlag() { - return suspectTimeFlag; - } - - public void setSuspectTimeFlag(String suspectTimeFlag) { - this.suspectTimeFlag = suspectTimeFlag; - } - - @Override - public void setDataURI(String dataURI) { - identifier = dataURI; - } - - /** - * Get the IDecoderGettable reference for this record. - * - * @return The IDecoderGettable reference for this record. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return this; - } - - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public String getString(String paramName) { - if ("STA".matches(paramName)) { - return this.getStationId(); - } - return null; - } - - /** - * Get the value and units of a named parameter within this observation. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return An Amount with value and units. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Amount getValue(String paramName) { - Amount a = null; - - String pName = PARM_MAP.get(paramName); - - if (SFC_TEMP.equals(pName) && (temp != null)) { - a = new Amount(temp, TEMPERATURE_UNIT); - } else if (SFC_WNDSPD.equals(pName) && (windSpeed != null)) { - a = new Amount(windSpeed, WIND_SPEED_UNIT); - } else if (SFC_WNDDIR.equals(pName) && (windDirection != null)) { - a = new Amount(windDirection, WIND_DIR_UNIT); - } else if (STA_LAT.equals(pName)) { - a = new Amount(this.getLatitude(), LOCATION_UNIT); - } else if (STA_LON.equals(pName)) { - a = new Amount(this.getLongitude(), LOCATION_UNIT); - } else if (UA_FLTLVL.equals(pName) && getFlightLevel() != null) { - a = new Amount(this.getFlightLevel().intValue(), ALTITUDE_UNIT); - - } - return a; - } - - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Collection getValues(String paramName) { - return null; - } - - @Override - public String[] getStrings(String paramName) { - if ("FLT_HZD".matches(paramName) && flightHazard != null) { - String[] flightHazards = { flightHazard.toString() }; - return flightHazards; - } - return null; - } - - @Override - public AircraftObsLocation getSpatialObject() { - return location; - } - - public AircraftObsLocation getLocation() { - return location; - } - - public void setLocation(AircraftObsLocation location) { - this.location = location; - } - - @Override - public String getMessageData() { - return getReportData(); - } - - private String buildMessageData() { - boolean validLocation = (location != null); - - StringBuilder messageData = new StringBuilder("ARP "); - if (validLocation && getStationId() != null) { - messageData.append(getStationId()); - } - messageData.append(' '); - - if ((validLocation) && (!Double.isNaN(getLatitude())) - && (!Double.isNaN(getLongitude()))) { - messageData.append(formatLatLon(getLatitude(), true)); - messageData.append(' '); - messageData.append(formatLatLon(getLongitude(), false)); - messageData.append(' '); - } - - if (timeObs != null) { - DateFormat df = new SimpleDateFormat("HHmm"); - messageData.append(df.format(timeObs.getTime())); - } - messageData.append(" F"); - - if (validLocation && getFlightLevel() != null) { - int flightLevel = (int) ftToHft.convert(getFlightLevel()); - messageData.append(flightLevel); - } - messageData.append(' '); - - if (temp != null) { - if (temp > 0) { - messageData.append('P'); - } else { - messageData.append('M'); - } - messageData.append(Math.abs(temp.intValue())); - } - messageData.append(' '); - - if ((windDirection != null) && (windSpeed != null)) { - messageData.append(windDirection.intValue()); - messageData.append('/'); - messageData.append(windSpeed.intValue()); - messageData.append("KT"); - } - messageData.append("TB"); - - return messageData.toString(); - } - - private String formatLatLon(double value, boolean isLatitude) { - char dir; - if (isLatitude) { - if (value > 0) { - dir = 'N'; - } else { - dir = 'S'; - } - } else { - if (value > 0) { - dir = 'E'; - } else { - dir = 'W'; - } - } - - DecimalFormat df = new DecimalFormat("###.000"); - df.setRoundingMode(RoundingMode.DOWN); - - return df.format(Math.abs(value)) + dir; - } - - /** - * Returns the hashCode for this object. This implementation returns the - * hashCode of the generated dataURI. - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result - + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); - return result; - } - - /** - * Checks if this record is equal to another by checking the generated - * dataURI. - * - * @param obj - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - NcAirepRecord other = (NcAirepRecord) obj; - if (getDataURI() == null) { - if (other.getDataURI() != null) { - return false; - } - } else if (!getDataURI().equals(other.getDataURI())) { - return false; - } - return true; - } - - @Override - public Date getPersistenceTime() { - return this.dataTime.getRefTime(); - } - - @Override - public void setPersistenceTime(Date persistTime) { - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() - */ - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon - * .uf.common.pointdata.PointDataView) - */ - @Override - public void setPointDataView(PointDataView pdv) { - this.pointDataView = pdv; - } + public NcAirepRecord() { + } + + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public NcAirepRecord(String uri) { + super(uri); + } + + public Integer getObsId() { + return obsId; + } + + public void setObsId(Integer obsId) { + this.obsId = obsId; + } + + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } + + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } + + /** + * Get the report correction indicator. + * + * @return The corIndicator + */ + public String getCorIndicator() { + return corIndicator; + } + + /** + * Set the report correction indicator. + * + * @param corIndicator + * The corIndicator. + */ + public void setCorIndicator(String corIndicator) { + this.corIndicator = corIndicator; + } + + /** + * Get the report data for this observation. + * + * @return The Report data. + */ + public String getReportData() { + String s = null; + if ((messageData != null) && (messageData instanceof String)) { + s = (String) messageData; + } else { + s = buildMessageData(); + } + return s; + } + + /** + * Set the report data for this observation. + * + * @param reportData + * The Report data. + */ + public void setReportData(String reportData) { + messageData = reportData; + } + + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } + + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } + + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } + + /** + * Boolean for whether location is defined in the spatial tables. + * + * @return true or false (Is location defined in the spatial tables?) + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } + + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } + + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getFlightLevel() { + return location.getFlightLevel(); + } + + /** + * @return the reportType + */ + public String getReportType() { + return reportType; + } + + /** + * @param reportType + * the reportType to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } + + /** + * @return the timeObs + */ + public Calendar getTimeObs() { + if (this.dataTime == null) { + return null; + } + return this.dataTime.getRefTimeAsCalendar(); + } + + /** + * @param timeObs + * the timeObs to set + */ + public void setTimeObs(Calendar timeObs) { + this.timeObs = timeObs; + } + + /** + * @return the refHour + */ + public Calendar getRefHour() { + return refHour; + } + + /** + * @param refHour + * the refHour to set + */ + public void setRefHour(Calendar refHour) { + this.refHour = refHour; + } + + /** + * @return the temp + */ + public float getTemp() { + return temp; + } + + /** + * @param temp + * the temp to set + */ + public void setTemp(float temp) { + this.temp = temp; + } + + /** + * @return the windDirection + */ + public float getWindDirection() { + return windDirection; + } + + /** + * @param windDirection + * the windDirection to set + */ + public void setWindDirection(float windDirection) { + this.windDirection = windDirection; + } + + /** + * @return the windspeed + */ + public float getWindSpeed() { + return windSpeed; + } + + /** + * @param windspeed + * the windspeed to set + */ + public void setWindSpeed(float windSpeed) { + this.windSpeed = windSpeed; + } + + /** + * @return the flightHazard + */ + public Integer getFlightHazard() { + return flightHazard; + } + + /** + * @param flightHazard + * the wx_past_1 to set + */ + public void setFlightHazard(Integer flightHazard) { + this.flightHazard = flightHazard; + } + + /** + * @return the flightWeather + */ + public Integer getFlightWeather() { + return flightWeather; + } + + /** + * @param flightWeather + * the getFlightWeather to set + */ + public void setFlightWeather(Integer flightWeather) { + this.flightWeather = flightWeather; + } + + /** + * @return the flightConditions + */ + public Integer getFlightConditions() { + return flightConditions; + } + + /** + * @param flightConditions + * the flightConditions to set + */ + public void setFlightConditions(Integer flightConditions) { + this.flightConditions = flightConditions; + } + + /** + * @return the wmoHeader + */ + public String getTurbInten() { + return turbInten; + } + + public void setTurbInten(String turbInten) { + this.turbInten = turbInten; + } + + public String getIceInten() { + return iceInten; + } + + public void setIceInten(String iceInten) { + this.iceInten = iceInten; + } + + public String getSkyCover() { + return skyCover; + } + + public void setSkyCover(String skyCover) { + this.skyCover = skyCover; + } + + public String getTurbType() { + return turbType; + } + + public void setTurbType(String turbType) { + this.turbType = turbType; + } + + public String getIceType() { + return iceType; + } + + public void setIceType(String iceType) { + this.iceType = iceType; + } + + public String getTurbFreq() { + return turbFreq; + } + + public void setTurbFreq(String turbFreq) { + this.turbFreq = turbFreq; + } + + public int getSkyBaseHeight() { + return skyBaseHeight; + } + + public void setSkyBaseHeight(int skyBaseHeight) { + this.skyBaseHeight = skyBaseHeight; + } + + public int getSkyTopHeight() { + return skyTopHeight; + } + + public void setSkyTopHeight(int skyTopHeight) { + this.skyTopHeight = skyTopHeight; + } + + public String getSuspectTimeFlag() { + return suspectTimeFlag; + } + + public void setSuspectTimeFlag(String suspectTimeFlag) { + this.suspectTimeFlag = suspectTimeFlag; + } + + @Override + public void setDataURI(String dataURI) { + identifier = dataURI; + } + + /** + * Get the IDecoderGettable reference for this record. + * + * @return The IDecoderGettable reference for this record. + */ + @Override + public IDecoderGettable getDecoderGettable() { + return this; + } + + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public String getString(String paramName) { + if ("STA".matches(paramName)) { + return this.getStationId(); + } + return null; + } + + /** + * Get the value and units of a named parameter within this observation. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return An Amount with value and units. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Amount getValue(String paramName) { + Amount a = null; + + String pName = PARM_MAP.get(paramName); + + if (SFC_TEMP.equals(pName) && (temp != null)) { + a = new Amount(temp, TEMPERATURE_UNIT); + } else if (SFC_WNDSPD.equals(pName) && (windSpeed != null)) { + a = new Amount(windSpeed, WIND_SPEED_UNIT); + } else if (SFC_WNDDIR.equals(pName) && (windDirection != null)) { + a = new Amount(windDirection, WIND_DIR_UNIT); + } else if (STA_LAT.equals(pName)) { + a = new Amount(this.getLatitude(), LOCATION_UNIT); + } else if (STA_LON.equals(pName)) { + a = new Amount(this.getLongitude(), LOCATION_UNIT); + } else if (UA_FLTLVL.equals(pName) && (getFlightLevel() != null)) { + a = new Amount(this.getFlightLevel().intValue(), ALTITUDE_UNIT); + + } + return a; + } + + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Collection getValues(String paramName) { + return null; + } + + @Override + public String[] getStrings(String paramName) { + if ("FLT_HZD".matches(paramName) && (flightHazard != null)) { + String[] flightHazards = { flightHazard.toString() }; + return flightHazards; + } + return null; + } + + @Override + public AircraftObsLocation getSpatialObject() { + return location; + } + + public AircraftObsLocation getLocation() { + return location; + } + + public void setLocation(AircraftObsLocation location) { + this.location = location; + } + + @Override + public String getMessageData() { + return getReportData(); + } + + private String buildMessageData() { + boolean validLocation = (location != null); + + StringBuilder messageData = new StringBuilder("ARP "); + if (validLocation && (getStationId() != null)) { + messageData.append(getStationId()); + } + messageData.append(' '); + + if ((validLocation) && (!Double.isNaN(getLatitude())) + && (!Double.isNaN(getLongitude()))) { + messageData.append(formatLatLon(getLatitude(), true)); + messageData.append(' '); + messageData.append(formatLatLon(getLongitude(), false)); + messageData.append(' '); + } + + if (timeObs != null) { + DateFormat df = new SimpleDateFormat("HHmm"); + messageData.append(df.format(timeObs.getTime())); + } + messageData.append(" F"); + + if (validLocation && (getFlightLevel() != null)) { + int flightLevel = (int) ftToHft.convert(getFlightLevel()); + messageData.append(flightLevel); + } + messageData.append(' '); + + if (temp != null) { + if (temp > 0) { + messageData.append('P'); + } else { + messageData.append('M'); + } + messageData.append(Math.abs(temp.intValue())); + } + messageData.append(' '); + + if ((windDirection != null) && (windSpeed != null)) { + messageData.append(windDirection.intValue()); + messageData.append('/'); + messageData.append(windSpeed.intValue()); + messageData.append("KT"); + } + messageData.append("TB"); + + return messageData.toString(); + } + + private String formatLatLon(double value, boolean isLatitude) { + char dir; + if (isLatitude) { + if (value > 0) { + dir = 'N'; + } else { + dir = 'S'; + } + } else { + if (value > 0) { + dir = 'E'; + } else { + dir = 'W'; + } + } + + DecimalFormat df = new DecimalFormat("###.000"); + df.setRoundingMode(RoundingMode.DOWN); + + return df.format(Math.abs(value)) + dir; + } + + /** + * Returns the hashCode for this object. This implementation returns the + * hashCode of the generated dataURI. + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = (prime * result) + + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); + return result; + } + + /** + * Checks if this record is equal to another by checking the generated + * dataURI. + * + * @param obj + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + NcAirepRecord other = (NcAirepRecord) obj; + if (getDataURI() == null) { + if (other.getDataURI() != null) { + return false; + } + } else if (!getDataURI().equals(other.getDataURI())) { + return false; + } + return true; + } + + @Override + public Date getPersistenceTime() { + return this.dataTime.getRefTime(); + } + + @Override + public void setPersistenceTime(Date persistTime) { + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() + */ + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon + * .uf.common.pointdata.PointDataView) + */ + @Override + public void setPointDataView(PointDataView pdv) { + this.pointDataView = pdv; + } @Override @Column @@ -900,4 +896,9 @@ public class NcAirepRecord extends PluginDataObject implements ISpatialEnabled, public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "ncairep"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncccfp/src/gov/noaa/nws/ncep/common/dataplugin/ncccfp/NcccfpRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncccfp/src/gov/noaa/nws/ncep/common/dataplugin/ncccfp/NcccfpRecord.java index 8c01720dbd..b1d0dc5817 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncccfp/src/gov/noaa/nws/ncep/common/dataplugin/ncccfp/NcccfpRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncccfp/src/gov/noaa/nws/ncep/common/dataplugin/ncccfp/NcccfpRecord.java @@ -1,4 +1,3 @@ - package gov.noaa.nws.ncep.common.dataplugin.ncccfp; import java.util.Calendar; @@ -31,15 +30,16 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * *
  * SOFTWARE HISTORY
- * Date         Ticket#     Engineer    Description
- * --------- ----------  ----------- --------------------------
- * 10/05/2009   155         F. J. Yen   From Raytheon's CCFP; mod for NC_CCFP
- * 26/05/2010	155			F. J. Yen	Refactored to dataplugin for migration to to11dr11
- * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
- * Apr 12, 2013 1857        bgonzale    Added SequenceGenerator annotation.
- * May 07, 2013 1869     bsteffen    Remove dataURI column from
+ * Date         Ticket#  Engineer    Description
+ * ------------ -------- ----------- --------------------------
+ * Oct 05, 2009 155      F. J. Yen   From Raytheon's CCFP; mod for NC_CCFP
+ * May 26, 2010 155      F. J. Yen   Refactored to dataplugin for
+ *                                   migration to to11dr11
+ * Apr 04, 2013 1846      bkowal     Added an index on refTime and forecastTime
+ * Apr 12, 2013 1857      bgonzale   Added SequenceGenerator annotation.
+ * May 07, 2013 1869      bsteffen   Remove dataURI column from
  *                                   PluginDataObject.
- * 
+ * Aug 30, 2013 2298      rjpeter    Make getPluginName abstract
  * 
* * @author F. J. Yen @@ -52,12 +52,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ncccfp", - indexes = { - @Index(name = "ncccfp_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ncccfp", indexes = { @Index(name = "ncccfp_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -76,7 +72,7 @@ public class NcccfpRecord extends PluginDataObject implements ISpatialEnabled { @XmlAttribute @DynamicSerializeElement private Calendar validtime; - + @Column(length = 8) @XmlAttribute @DynamicSerializeElement @@ -117,26 +113,26 @@ public class NcccfpRecord extends PluginDataObject implements ISpatialEnabled { @XmlAttribute @DynamicSerializeElement private Integer numPts; - + @Column @DynamicSerializeElement @XmlElement private Boolean canadaflag; /* - * locationUri contains up to the first seven coordinates. This is for making the dataURI - * unique. (It was suggested that it was highly unlikely that 7 coordinates would not - * be unique enough. The number of coordinates was reduced due to the limited length of - * the string dataURI) + * locationUri contains up to the first seven coordinates. This is for + * making the dataURI unique. (It was suggested that it was highly unlikely + * that 7 coordinates would not be unique enough. The number of coordinates + * was reduced due to the limited length of the string dataURI) */ @DataURI(position = 4) - @Column(length=150) + @Column(length = 150) @XmlElement @DynamicSerializeElement private String locationUri; - + private NcccfpLocation location; - + /** * Default Constructor */ @@ -299,8 +295,8 @@ public class NcccfpRecord extends PluginDataObject implements ISpatialEnabled { */ public void setDirection(Integer direction) { this.direction = direction; - } - + } + /** * @return the number of points */ @@ -315,6 +311,7 @@ public class NcccfpRecord extends PluginDataObject implements ISpatialEnabled { public void setNumPts(Integer numPts) { this.numPts = numPts; } + @Override public NcccfpLocation getSpatialObject() { return location; @@ -332,9 +329,9 @@ public class NcccfpRecord extends PluginDataObject implements ISpatialEnabled { return location; } - public void setLocation (NcccfpLocation location) { + public void setLocation(NcccfpLocation location) { this.location = location; - } + } @Override @Column @@ -343,4 +340,8 @@ public class NcccfpRecord extends PluginDataObject implements ISpatialEnabled { return super.getDataURI(); } + @Override + public String getPluginName() { + return "ncccfp"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncgrib/src/gov/noaa/nws/ncep/common/dataplugin/ncgrib/NcgribRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncgrib/src/gov/noaa/nws/ncep/common/dataplugin/ncgrib/NcgribRecord.java index c570367cfe..963efe9174 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncgrib/src/gov/noaa/nws/ncep/common/dataplugin/ncgrib/NcgribRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncgrib/src/gov/noaa/nws/ncep/common/dataplugin/ncgrib/NcgribRecord.java @@ -64,14 +64,17 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 4/7/09 1994 bphillip Initial Creation - * 10/13/10 276 llin Modified for NC GRIB. - * 03/07/12 606 ghull Added eventName to URI for NcInventory updating. - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 04/08/13 1293 bkowal Removed references to hdffileid. + * Apr 07, 2009 1994 bphillip Initial Creation + * Oct 13, 2010 276 llin Modified for NC GRIB. + * Mar 07, 2012 606 ghull Added eventName to URI for NcInventory + * updating. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -85,12 +88,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ncgrib", - indexes = { - @Index(name = "ncgrib_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ncgrib", indexes = { @Index(name = "ncgrib_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -105,36 +104,36 @@ public class NcgribRecord extends PersistablePluginDataObject implements @DynamicSerializeElement private int masterTableVersion; - /** + /** * Version number of GRIB local tables used to augment Master Tables (See * Table 1.1) 0 - local tables not used, only table entries and templates - * the current master table are valid. (Currently 1) + * the current master table are valid. (Currently 1) */ @Column @XmlAttribute @DynamicSerializeElement private int localTableVersion; - /** Significance of reference time (See Table 1.2) - * 0 for analysis, 1 for forecast, 2 for verifying time, - * and 3 for observation time + /** + * Significance of reference time (See Table 1.2) 0 for analysis, 1 for + * forecast, 2 for verifying time, and 3 for observation time */ @Column @XmlAttribute @DynamicSerializeElement private int refTimeSignificance; - /** Processed data type in this GRIB message (See Table 1.4) - * 0 for analysis, 1 for forecast, 2 for both, .... - * or PDT in table 4.3 - * This refers to PDT# in GEMPAK output + /** + * Processed data type in this GRIB message (See Table 1.4) 0 for analysis, + * 1 for forecast, 2 for both, .... or PDT in table 4.3 This refers to PDT# + * in GEMPAK output */ @Column @XmlAttribute @DynamicSerializeElement private int processedDataType; - - /** Denotes if local section is present (currently false)*/ + + /** Denotes if local section is present (currently false) */ @Column @XmlAttribute @DynamicSerializeElement @@ -179,7 +178,7 @@ public class NcgribRecord extends PersistablePluginDataObject implements @DynamicSerializeElement private float[] hybridCoordList; - /** The model information in ncgrib_models child table*/ + /** The model information in ncgrib_models child table */ @ManyToOne(cascade = { CascadeType.REFRESH }, fetch = FetchType.EAGER) @PrimaryKeyJoinColumn @Fetch(FetchMode.SELECT) @@ -190,13 +189,12 @@ public class NcgribRecord extends PersistablePluginDataObject implements private boolean isVector = false; - /** The short model name (i.e.NAM80) This should be interpreted from - * the generating process number and grid id : 96 for gfs, - * 114 for NAEFS, 84 for meso NAM 12KM, 86 for RUC, 81 for GFS analysis, - * 82 for analysis GDAS, etc... - * information form ON388 - table A - * Generating Process or Model from originating center 7 - * which is NCEP + /** + * The short model name (i.e.NAM80) This should be interpreted from the + * generating process number and grid id : 96 for gfs, 114 for NAEFS, 84 for + * meso NAM 12KM, 86 for RUC, 81 for GFS analysis, 82 for analysis GDAS, + * etc... information form ON388 - table A Generating Process or Model from + * originating center 7 which is NCEP */ @Column @XmlAttribute @@ -210,33 +208,35 @@ public class NcgribRecord extends PersistablePluginDataObject implements @DataURI(position = 3) private int gridVersion = 0; - /** The name of ingested file + /** + * The name of ingested file */ @Column @XmlAttribute @DynamicSerializeElement @DataURI(position = 4) private String fileName; - - /** The name of event such as Hurricane or - * Volcano + + /** + * The name of event such as Hurricane or Volcano */ @Column @XmlAttribute @DynamicSerializeElement @DataURI(position = 8) private String eventName; - - /** Type of Generating Process + + /** + * Type of Generating Process */ @Column @XmlAttribute @DynamicSerializeElement @DataURI(position = 7) private int processType; - - /** Resolution and componet flags - * (See Table 3.3) + + /** + * Resolution and componet flags (See Table 3.3) */ @Column @XmlAttribute @@ -244,10 +244,9 @@ public class NcgribRecord extends PersistablePluginDataObject implements private Integer resCompFlags; /** - * Indicate the discipline of the processed - * data contained within a GRIB message - - * 0 for Meteorological products in table 0.0 - * This refers to DIS# in GEMPAK output + * Indicate the discipline of the processed data contained within a GRIB + * message - 0 for Meteorological products in table 0.0 This refers to DIS# + * in GEMPAK output */ @Column @XmlAttribute @@ -255,8 +254,8 @@ public class NcgribRecord extends PersistablePluginDataObject implements private int discipline; /** - * Parameter category by product discipline - * 0 for temperature in table 4.1 by discipline 0 + * Parameter category by product discipline 0 for temperature in table 4.1 + * by discipline 0 */ @Column @XmlAttribute @@ -264,29 +263,27 @@ public class NcgribRecord extends PersistablePluginDataObject implements private int category; /** - * Parameter number by product discipline and parameter category - * 9 for temperature anomaly in table 4.2-0-0 for discipline 0 - * and category 0 - * This refers to ID# in GEMPAK output + * Parameter number by product discipline and parameter category 9 for + * temperature anomaly in table 4.2-0-0 for discipline 0 and category 0 This + * refers to ID# in GEMPAK output */ @Column @XmlAttribute @DynamicSerializeElement private int parameterId; - - /** pdt - Product definition template number. + + /** + * pdt - Product definition template number. */ @Column @XmlAttribute @DynamicSerializeElement private int pdt; - + /** - * Fixed surface types or vertical coordinate ID 1 - * 2 for cloud base level and 100 for isobaric surface - * in table 4.5 or VCRDGRID1.TBL for NCEP - * This refers to VCD# in GEMPAK output - * The location in pds[9] + * Fixed surface types or vertical coordinate ID 1 2 for cloud base level + * and 100 for isobaric surface in table 4.5 or VCRDGRID1.TBL for NCEP This + * refers to VCD# in GEMPAK output The location in pds[9] */ @Column @XmlAttribute @@ -294,11 +291,9 @@ public class NcgribRecord extends PersistablePluginDataObject implements private int vcrdId1; /** - * Fixed surface types or vertical coordinate ID 2 - * 2 for cloud base level and 100 for isobaric surface - * in table 4.5 or VCRDGRID1.TBL for NCEP - * This refers to VCD# in GEMPAK output - * The location in pds[12] + * Fixed surface types or vertical coordinate ID 2 2 for cloud base level + * and 100 for isobaric surface in table 4.5 or VCRDGRID1.TBL for NCEP This + * refers to VCD# in GEMPAK output The location in pds[12] */ @Column @XmlAttribute @@ -306,19 +301,19 @@ public class NcgribRecord extends PersistablePluginDataObject implements private int vcrdId2; /** - * Scaled value of first fixed surface in GRIB2- TEMPLATE 4.1 - * This refers to LEVEL1 in GEMPAK output + * Scaled value of first fixed surface in GRIB2- TEMPLATE 4.1 This refers to + * LEVEL1 in GEMPAK output */ @Column @XmlAttribute @DynamicSerializeElement private int glevel1; - + private float decodedLevel1; /** - * Scaled value of second fixed surface in GRIB2- TEMPLATE 4.1 - * This refers to LEVEL2 in GEMPAK output + * Scaled value of second fixed surface in GRIB2- TEMPLATE 4.1 This refers + * to LEVEL2 in GEMPAK output */ @Column @XmlAttribute @@ -335,7 +330,7 @@ public class NcgribRecord extends PersistablePluginDataObject implements @DynamicSerializeElement @DataURI(position = 6) private String vcord; - + /** * The gempak abbreviation grid name */ @@ -344,7 +339,7 @@ public class NcgribRecord extends PersistablePluginDataObject implements @DynamicSerializeElement @DataURI(position = 5) private String parm; - + /** * The gempak scale for decoding the grid field */ @@ -352,7 +347,7 @@ public class NcgribRecord extends PersistablePluginDataObject implements @XmlAttribute @DynamicSerializeElement private String scale; - + /** * The forecast interval */ @@ -360,7 +355,7 @@ public class NcgribRecord extends PersistablePluginDataObject implements @XmlAttribute @DynamicSerializeElement private int interval; - + /** * Creates an empty NcgribRecord */ @@ -392,7 +387,6 @@ public class NcgribRecord extends PersistablePluginDataObject implements this.insertTime = (Calendar) recordToCopy.insertTime.clone(); } this.messageData = recordToCopy.messageData; - this.pluginName = recordToCopy.pluginName; this.gridVersion = recordToCopy.gridVersion; if (recordToCopy.hybridCoordList != null) { this.hybridCoordList = Arrays.copyOf(recordToCopy.hybridCoordList, @@ -449,10 +443,10 @@ public class NcgribRecord extends PersistablePluginDataObject implements } /** - public void setSpatialObject(NcgridCoverage location) { - modelInfo.setLocation(location); - }*/ - + * public void setSpatialObject(NcgridCoverage location) { + * modelInfo.setLocation(location); } + */ + /** * Gets the model information * @@ -656,7 +650,7 @@ public class NcgribRecord extends PersistablePluginDataObject implements this.gridVersion = gridVersion; } - public Integer getResCompFlags() { + public Integer getResCompFlags() { return resCompFlags; } @@ -665,160 +659,162 @@ public class NcgribRecord extends PersistablePluginDataObject implements } public String getModelName() { - return modelName; - } + return modelName; + } - public void setModelName(String modelName) { - this.modelName = modelName; - } + public void setModelName(String modelName) { + this.modelName = modelName; + } - public int getDiscipline() { - return discipline; - } + public int getDiscipline() { + return discipline; + } - public void setDiscipline(int discipline) { - this.discipline = discipline; - } + public void setDiscipline(int discipline) { + this.discipline = discipline; + } - public int getCategory() { - return category; - } + public int getCategory() { + return category; + } - public void setCategory(int category) { - this.category = category; - } + public void setCategory(int category) { + this.category = category; + } - public int getParameterId() { - return parameterId; - } + public int getParameterId() { + return parameterId; + } - public void setParameterId(int parameterId) { - this.parameterId = parameterId; - } + public void setParameterId(int parameterId) { + this.parameterId = parameterId; + } - public int getPdt() { - return pdt; - } + public int getPdt() { + return pdt; + } - public void setPdt(int pdt) { - this.pdt = pdt; - } + public void setPdt(int pdt) { + this.pdt = pdt; + } - public String getFileName() { - return fileName; - } + public String getFileName() { + return fileName; + } - public void setFileName(String fileName) { - this.fileName = fileName; - } - - public String getEventName() { - return eventName; - } + public void setFileName(String fileName) { + this.fileName = fileName; + } - public void setEventName(String eventName) { - this.eventName = eventName; - } + public String getEventName() { + return eventName; + } - public int getProcessType() { - return processType; - } + public void setEventName(String eventName) { + this.eventName = eventName; + } - public void setProcessType(int processType) { - this.processType = processType; - } - - public int getVcrdId1() { - return vcrdId1; - } + public int getProcessType() { + return processType; + } - public void setVcrdId1(int vcrdId1) { - this.vcrdId1 = vcrdId1; - } + public void setProcessType(int processType) { + this.processType = processType; + } - public int getVcrdId2() { - return vcrdId2; - } + public int getVcrdId1() { + return vcrdId1; + } - public void setVcrdId2(int vcrdId2) { - this.vcrdId2 = vcrdId2; - } + public void setVcrdId1(int vcrdId1) { + this.vcrdId1 = vcrdId1; + } - public int getGlevel1() { - return glevel1; - } + public int getVcrdId2() { + return vcrdId2; + } - public void setGlevel1(int glevel1) { - this.glevel1 = glevel1; - } + public void setVcrdId2(int vcrdId2) { + this.vcrdId2 = vcrdId2; + } - public int getGlevel2() { - return glevel2; - } + public int getGlevel1() { + return glevel1; + } - public void setGlevel2(int glevel2) { - this.glevel2 = glevel2; - } + public void setGlevel1(int glevel1) { + this.glevel1 = glevel1; + } - public String getVcord() { - return vcord; - } + public int getGlevel2() { + return glevel2; + } - public void setVcord(String vcord) { - this.vcord = vcord; - } + public void setGlevel2(int glevel2) { + this.glevel2 = glevel2; + } - public String getParm() { - return parm; - } + public String getVcord() { + return vcord; + } - public void setParm(String parm) { - this.parm = parm; - } + public void setVcord(String vcord) { + this.vcord = vcord; + } - public String getScale() { - return scale; - } + public String getParm() { + return parm; + } - public void setScale(String scale) { - this.scale = scale; - } + public void setParm(String parm) { + this.parm = parm; + } - public int getInterval() { - return interval; - } + public String getScale() { + return scale; + } - public void setInterval(int interval) { - this.interval = interval; - } + public void setScale(String scale) { + this.scale = scale; + } - /** - * @return the decodedLevel1 - */ - public float getDecodedLevel1() { - return decodedLevel1; - } + public int getInterval() { + return interval; + } - /** - * @param decodedLevel1 the decodedLevel1 to set - */ - public void setDecodedLevel1(float decodedLevel1) { - this.decodedLevel1 = decodedLevel1; - } + public void setInterval(int interval) { + this.interval = interval; + } - /** - * @return the decodedLevel2 - */ - public float getDecodedLevel2() { - return decodedLevel2; - } + /** + * @return the decodedLevel1 + */ + public float getDecodedLevel1() { + return decodedLevel1; + } - /** - * @param decodedLevel2 the decodedLevel2 to set - */ - public void setDecodedLevel2(float decodedLevel2) { - this.decodedLevel2 = decodedLevel2; - } + /** + * @param decodedLevel1 + * the decodedLevel1 to set + */ + public void setDecodedLevel1(float decodedLevel1) { + this.decodedLevel1 = decodedLevel1; + } + + /** + * @return the decodedLevel2 + */ + public float getDecodedLevel2() { + return decodedLevel2; + } + + /** + * @param decodedLevel2 + * the decodedLevel2 to set + */ + public void setDecodedLevel2(float decodedLevel2) { + this.decodedLevel2 = decodedLevel2; + } @Override @Column @@ -827,4 +823,8 @@ public class NcgribRecord extends PersistablePluginDataObject implements return super.getDataURI(); } + @Override + public String getPluginName() { + return "ncgrib"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpafm/src/gov/noaa/nws/ncep/common/dataplugin/ncpafm/NcPafmRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpafm/src/gov/noaa/nws/ncep/common/dataplugin/ncpafm/NcPafmRecord.java index 5bcb47b33f..1063ca2c1b 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpafm/src/gov/noaa/nws/ncep/common/dataplugin/ncpafm/NcPafmRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpafm/src/gov/noaa/nws/ncep/common/dataplugin/ncpafm/NcPafmRecord.java @@ -1,24 +1,3 @@ -/* - * - * NcPafmRecord - * - * This class performs the mapping to the database tables for the Point/Area - * Forecast Matrices (PAFM) Decoder Plug-In - * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ----------- -------------- ----------------------------------- - * 08/05/2009 126 F. J. Yen Initial creation - * 01/06/2010 126 F. J. Yen Migrated and refactored from to11dr3 to to11dr11 - * * - * This code has been developed by the SIB for use in the AWIPS2 system. - * - * - * @author F. J. Yen, SIB - * @version 1 - - */ - package gov.noaa.nws.ncep.common.dataplugin.ncpafm; import java.util.Calendar; @@ -61,25 +40,33 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * SOFTWARE HISTORY * - * Date Ticket# Engineer Description + * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 30 Sep 2011 126 B. Hebbard Initial version in refactored NcPafm decoder. - * This new (fine-grain) PDO contains data associated - * with one location / forecast hour pair only, for - * efficiency of retrieval. It also implements - * IPointData -- that is, presents a PointDataView - * object suitable for HDF5 persistence. - * 10 Oct 2011 126 G. Hull replace stnid,lat&lon with the SurfaceObsLocation. - * 03 Feb 2012 606 G. Hull added reportType to the URI for inventory updating - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 08 Apr 2013 1293 bkowal Removed references to hdffileid. + * Aug 05, 2009 126 F. J. Yen Initial creation + * Jan 06, 2010 126 F. J. Yen Migrated and refactored from to11dr3 to + * to11dr11 + * 30 Sep 2011 126 B. Hebbard Initial version in refactored NcPafm + * decoder. This new (fine-grain) PDO + * contains data associated with one + * location / forecast hour pair only, for + * efficiency of retrieval. It also + * implements IPointData -- that is, + * presents a PointDataView object suitable + * for HDF5 persistence. + * 10 Oct 2011 126 G. Hull replace stnid,lat&lon with the + * SurfaceObsLocation. + * 03 Feb 2012 606 G. Hull added reportType to the URI for inventory + * updating + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * 08 Apr 2013 1293 bkowal Removed references to hdffileid. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. - * + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * - * @author B. Hebbard, SIB + * @author F. J. Yen, SIB * @version 1.0 */ @Entity @@ -89,326 +76,323 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ncpafm", - indexes = { - @Index(name = "ncpafm_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ncpafm", indexes = { @Index(name = "ncpafm_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class NcPafmRecord extends PersistablePluginDataObject implements // TODO: Make absolutely sure these are NO LONGER required... ISpatialEnabled, // IDecoderGettable, - IPointData, IPersistable { + IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - /** Report type */ - @Column(length = 32) - @DataURI(position=6) - @XmlElement - @DynamicSerializeElement - private String reportType; + /** Report type */ + @Column(length = 32) + @DataURI(position = 6) + @XmlElement + @DynamicSerializeElement + private String reportType; - // WMO header - @DataURI(position = 4) - @Column(length = 32) - @XmlElement - @DynamicSerializeElement - private String wmoHeader; + // WMO header + @DataURI(position = 4) + @Column(length = 32) + @XmlElement + @DynamicSerializeElement + private String wmoHeader; - // The issue office where the report from - @Column(length = 32) - @DataURI(position = 1) - @XmlElement - @DynamicSerializeElement - private String issueOffice; + // The issue office where the report from + @Column(length = 32) + @DataURI(position = 1) + @XmlElement + @DynamicSerializeElement + private String issueOffice; - @Column - @DataURI(position = 2) - @DynamicSerializeElement - @XmlElement - private Calendar issueTime; + @Column + @DataURI(position = 2) + @DynamicSerializeElement + @XmlElement + private Calendar issueTime; - // The stationId here is the FIPS code and not the issuing office - @Embedded - @DataURI(position = 3, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; + // The stationId here is the FIPS code and not the issuing office + @Embedded + @DataURI(position = 3, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String designatorBBB; + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String designatorBBB; - // The mndTime - @Column(length = 72) - @XmlElement - @DynamicSerializeElement - private String mndTime; + // The mndTime + @Column(length = 72) + @XmlElement + @DynamicSerializeElement + private String mndTime; - /** Matrix type */ - @DataURI(position = 5) - @Column(length = 32) - @XmlElement - @DynamicSerializeElement - private String matrixType; + /** Matrix type */ + @DataURI(position = 5) + @Column(length = 32) + @XmlElement + @DynamicSerializeElement + private String matrixType; - // The universal geographic code - @Column(length = 640) - @XmlElement - @DynamicSerializeElement - private String ugc; + // The universal geographic code + @Column(length = 640) + @XmlElement + @DynamicSerializeElement + private String ugc; - // The product purge time - @XmlElement - @DynamicSerializeElement - private Calendar prodPurgeTime; + // The product purge time + @XmlElement + @DynamicSerializeElement + private Calendar prodPurgeTime; - // Text information for this segment - // @Column(length=12000) - // @XmlElement - // @DynamicSerializeElement - private String segment; + // Text information for this segment + // @Column(length=12000) + // @XmlElement + // @DynamicSerializeElement + private String segment; - // // The county FIPS : this is the stationId in the SurfaceObsLocation - // @Column(length=16) - // @XmlElement - // @DynamicSerializeElement - // private String fips; + // // The county FIPS : this is the stationId in the SurfaceObsLocation + // @Column(length=16) + // @XmlElement + // @DynamicSerializeElement + // private String fips; - // The group of parameter values associated with the above combination. - @Transient - private NcPafmParameters pafmParms; + // The group of parameter values associated with the above combination. + @Transient + private NcPafmParameters pafmParms; - // The PointDataView representation of data associated with this PDO - // to be persisted as HDF5 - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + // The PointDataView representation of data associated with this PDO + // to be persisted as HDF5 + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - /** - * Default Constructor - */ - public NcPafmRecord() { - this.location = null; - this.issueOffice = null; - this.reportType = "PAFM"; - this.matrixType = " "; - this.issueTime = null; - this.wmoHeader = null; - this.designatorBBB = " "; - this.mndTime = null; - } + /** + * Default Constructor + */ + public NcPafmRecord() { + this.location = null; + this.issueOffice = null; + this.reportType = "PAFM"; + this.matrixType = " "; + this.issueTime = null; + this.wmoHeader = null; + this.designatorBBB = " "; + this.mndTime = null; + } - /** - * Constructs a pafm record from a dataURI - * - * @param uri - * The dataURI - */ - public NcPafmRecord(String uri) { - super(uri); - } + /** + * Constructs a pafm record from a dataURI + * + * @param uri + * The dataURI + */ + public NcPafmRecord(String uri) { + super(uri); + } - @Override - public IDecoderGettable getDecoderGettable() { - // TODO Auto-generated method stub - return null; - } + @Override + public IDecoderGettable getDecoderGettable() { + // TODO Auto-generated method stub + return null; + } - public String getReportType() { - return reportType; - } + public String getReportType() { + return reportType; + } - public void setReportType(String reportType) { - this.reportType = reportType; - } + public void setReportType(String reportType) { + this.reportType = reportType; + } - public String getMatrixType() { - return matrixType; - } + public String getMatrixType() { + return matrixType; + } - public void setMatrixType(String matrixType) { - this.matrixType = matrixType; - } + public void setMatrixType(String matrixType) { + this.matrixType = matrixType; + } - public String getWmoHeader() { - return wmoHeader; - } + public String getWmoHeader() { + return wmoHeader; + } - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - public String getIssueOffice() { - return issueOffice; - } + public String getIssueOffice() { + return issueOffice; + } - public void setIssueOffice(String issueOffice) { - this.issueOffice = issueOffice; - } + public void setIssueOffice(String issueOffice) { + this.issueOffice = issueOffice; + } - public Calendar getIssueTime() { - return issueTime; - } + public Calendar getIssueTime() { + return issueTime; + } - public void setIssueTime(Calendar issueTime) { - this.issueTime = issueTime; - } + public void setIssueTime(Calendar issueTime) { + this.issueTime = issueTime; + } - public String getDesignatorBBB() { - return designatorBBB; - } + public String getDesignatorBBB() { + return designatorBBB; + } - public void setDesignatorBBB(String designatorBBB) { - this.designatorBBB = designatorBBB; - } + public void setDesignatorBBB(String designatorBBB) { + this.designatorBBB = designatorBBB; + } - public String getMndTime() { - return mndTime; - } + public String getMndTime() { + return mndTime; + } - public void setMndTime(String mndTime) { - this.mndTime = mndTime; - } + public void setMndTime(String mndTime) { + this.mndTime = mndTime; + } - /** - * @return the ugc - */ - public String getUgc() { - return ugc; - } + /** + * @return the ugc + */ + public String getUgc() { + return ugc; + } - /** - * @param ugc - * to set - */ - public void setUgc(String ugc) { - this.ugc = ugc; - } + /** + * @param ugc + * to set + */ + public void setUgc(String ugc) { + this.ugc = ugc; + } - /** - * @return the prodPurgeTime - */ - public Calendar getProdPurgeTime() { - return prodPurgeTime; - } + /** + * @return the prodPurgeTime + */ + public Calendar getProdPurgeTime() { + return prodPurgeTime; + } - /** - * @param prodPurgeTime - * to set - */ - public void setProdPurgeTime(Calendar prodPurgeTime) { - this.prodPurgeTime = prodPurgeTime; - } + /** + * @param prodPurgeTime + * to set + */ + public void setProdPurgeTime(Calendar prodPurgeTime) { + this.prodPurgeTime = prodPurgeTime; + } - /** - * @return the segment - */ - public String getSegment() { - return segment; - } + /** + * @return the segment + */ + public String getSegment() { + return segment; + } - /** - * @param segment - * to set - */ - public void setSegment(String segment) { - this.segment = segment; - } + /** + * @param segment + * to set + */ + public void setSegment(String segment) { + this.segment = segment; + } - // public String getFips() { - // return fips; - // } + // public String getFips() { + // return fips; + // } - public String getStationId() { - return location.getStationId(); - } + public String getStationId() { + return location.getStationId(); + } - // if this needs to be an ISpatialObject - // @Override - // public SurfaceObsLocation getSpatialObject() { - // return location; - // } + // if this needs to be an ISpatialObject + // @Override + // public SurfaceObsLocation getSpatialObject() { + // return location; + // } - public SurfaceObsLocation getLocation() { - return location; - } + public SurfaceObsLocation getLocation() { + return location; + } - public void setLocation(SurfaceObsLocation obsLoc) { - this.location = obsLoc; - } + public void setLocation(SurfaceObsLocation obsLoc) { + this.location = obsLoc; + } - public double getLatitude() { - return location.getLatitude(); - } + public double getLatitude() { + return location.getLatitude(); + } - public double getLongitude() { - return location.getLongitude(); - } + public double getLongitude() { + return location.getLongitude(); + } - public Integer getElevation() { - return location.getElevation(); - } + public Integer getElevation() { + return location.getElevation(); + } - // public void setFips(String fips) { - // this.fips = fips; - // } + // public void setFips(String fips) { + // this.fips = fips; + // } - /** - * @return the set of Parameters - */ - public NcPafmParameters getPafmParms() { - return pafmParms; - } + /** + * @return the set of Parameters + */ + public NcPafmParameters getPafmParms() { + return pafmParms; + } - /** - * @param pafmParameters - * -the set of Parmameters to set - */ - public void setPafmParms(NcPafmParameters pafmParams) { - this.pafmParms = pafmParams; - } + /** + * @param pafmParameters + * -the set of Parmameters to set + */ + public void setPafmParms(NcPafmParameters pafmParams) { + this.pafmParms = pafmParams; + } - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() - */ - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() + */ + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon - * .uf.common.pointdata.PointDataView) - */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon + * .uf.common.pointdata.PointDataView) + */ + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } - @Override - public Date getPersistenceTime() { - // return this.dataTime.getRefTime(); - return null; - } + @Override + public Date getPersistenceTime() { + // return this.dataTime.getRefTime(); + return null; + } - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - public void setIdentifier(Object dataURI) { - this.identifier = dataURI; - } + /** + * Override existing set method to modify any classes that use the dataURI + * as a foreign key + */ + @Override + public void setIdentifier(Object dataURI) { + this.identifier = dataURI; + } @Override @Column @@ -417,4 +401,8 @@ public class NcPafmRecord extends PersistablePluginDataObject implements return super.getDataURI(); } + @Override + public String getPluginName() { + return "ncpafm"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpirep/src/gov/noaa/nws/ncep/common/dataplugin/ncpirep/NcPirepRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpirep/src/gov/noaa/nws/ncep/common/dataplugin/ncpirep/NcPirepRecord.java index 26d211133e..606409d6b6 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpirep/src/gov/noaa/nws/ncep/common/dataplugin/ncpirep/NcPirepRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncpirep/src/gov/noaa/nws/ncep/common/dataplugin/ncpirep/NcPirepRecord.java @@ -60,17 +60,22 @@ import com.vividsolutions.jts.geom.Geometry; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 20110421 F. J. Yen Initial creation from Raytheon's pirep. - * Change temp, windSpeed from Double to Float. - * Change windDirection from Integer to Float - * 08/30/2011 286 qzhou Use IDecoderConstantsN.INTEGER_MISSING instead -9999 in visibility. - * 08/31/2011 286 qzhou Created project and moved this from ~edex.plugin.pirep - * 09/19/2011 286 Q.Zhou Changed reportType to string, - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 04/08/2013 1293 bkowal Removed references to hdffileid. - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Apr 21, 2011 F. J. Yen Initial creation from Raytheon's pirep. + * Change temp, windSpeed from Double to + * Float. Change windDirection from Integer + * to Float + * Aug 30, 2011 286 qzhou Use IDecoderConstantsN.INTEGER_MISSING + * instead -9999 in visibility. + * Aug 31, 2011 286 qzhou Created project and moved this from + * ~edex.plugin.pirep + * Sep 19, 2011 286 Q.Zhou Changed reportType to string, + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -84,764 +89,764 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ncpirep", - indexes = { - @Index(name = "ncpirep_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ncpirep", indexes = { @Index(name = "ncpirep_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class NcPirepRecord extends PluginDataObject implements ISpatialEnabled, - IDecoderGettable, IPointData, IPersistable { + IDecoderGettable, IPointData, IPersistable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - public static final Unit TEMPERATURE_UNIT = SI.CELSIUS; + public static final Unit TEMPERATURE_UNIT = SI.CELSIUS; - public static final Unit ALTITUDE_UNIT = NonSI.FOOT; + public static final Unit ALTITUDE_UNIT = NonSI.FOOT; - public static final Unit WIND_SPEED_UNIT = NonSI.KNOT; + public static final Unit WIND_SPEED_UNIT = NonSI.KNOT; - public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit WIND_DIR_UNIT = NonSI.DEGREE_ANGLE; - public static final Unit PRESSURE_UNIT = SI.PASCAL; + public static final Unit PRESSURE_UNIT = SI.PASCAL; - public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; + public static final Unit LOCATION_UNIT = NonSI.DEGREE_ANGLE; - private static final HashMap PARM_MAP = new HashMap(); - private static final HashMap ICING_MAP = new HashMap(); - private static final HashMap TURB_MAP = new HashMap(); - static { - PARM_MAP.put("T", SFC_TEMP); - PARM_MAP.put("WS", SFC_WNDSPD); - PARM_MAP.put("WD", SFC_WNDDIR); - PARM_MAP.put("NLAT", STA_LAT); - PARM_MAP.put("NLON", STA_LON); - PARM_MAP.put("FLT_LVL", UA_FLTLVL); - PARM_MAP.put("ICT", UA_ICETYPE); - PARM_MAP.put("ICI", UA_ICEINTENSE); - PARM_MAP.put("TBF", UA_TURBFREQ); - PARM_MAP.put("TBI", UA_TURBINTENSE); - PARM_MAP.put("TOP_HGT", UA_TOPHGT); - PARM_MAP.put("BOT_HGT", UA_BOTHGT); + private static final HashMap PARM_MAP = new HashMap(); - ICING_MAP.put("", new Integer(0)); - ICING_MAP.put("NEG", new Integer(1)); - ICING_MAP.put("TRACE", new Integer(2)); - ICING_MAP.put("TRACELGT", new Integer(3)); - ICING_MAP.put("LGT", new Integer(4)); - ICING_MAP.put("LGTMOD", new Integer(5)); - ICING_MAP.put("MOD", new Integer(6)); - ICING_MAP.put("MODSEV", new Integer(7)); - ICING_MAP.put("SEV", new Integer(8)); + private static final HashMap ICING_MAP = new HashMap(); - TURB_MAP.put("", new Integer(0)); - TURB_MAP.put("NEG", new Integer(1)); - TURB_MAP.put("SMOOTHLGT", new Integer(2)); - TURB_MAP.put("LGT", new Integer(3)); - TURB_MAP.put("LGTMOD", new Integer(4)); - TURB_MAP.put("MOD", new Integer(5)); - TURB_MAP.put("MODSEV", new Integer(6)); - TURB_MAP.put("SEV", new Integer(7)); - TURB_MAP.put("EXTRM", new Integer(8)); - } + private static final HashMap TURB_MAP = new HashMap(); + static { + PARM_MAP.put("T", SFC_TEMP); + PARM_MAP.put("WS", SFC_WNDSPD); + PARM_MAP.put("WD", SFC_WNDDIR); + PARM_MAP.put("NLAT", STA_LAT); + PARM_MAP.put("NLON", STA_LON); + PARM_MAP.put("FLT_LVL", UA_FLTLVL); + PARM_MAP.put("ICT", UA_ICETYPE); + PARM_MAP.put("ICI", UA_ICEINTENSE); + PARM_MAP.put("TBF", UA_TURBFREQ); + PARM_MAP.put("TBI", UA_TURBINTENSE); + PARM_MAP.put("TOP_HGT", UA_TOPHGT); + PARM_MAP.put("BOT_HGT", UA_BOTHGT); - @Transient - private NcPirepLayerData maxPirepLayerData = null; + ICING_MAP.put("", new Integer(0)); + ICING_MAP.put("NEG", new Integer(1)); + ICING_MAP.put("TRACE", new Integer(2)); + ICING_MAP.put("TRACELGT", new Integer(3)); + ICING_MAP.put("LGT", new Integer(4)); + ICING_MAP.put("LGTMOD", new Integer(5)); + ICING_MAP.put("MOD", new Integer(6)); + ICING_MAP.put("MODSEV", new Integer(7)); + ICING_MAP.put("SEV", new Integer(8)); - @Transient - private boolean display = true; + TURB_MAP.put("", new Integer(0)); + TURB_MAP.put("NEG", new Integer(1)); + TURB_MAP.put("SMOOTHLGT", new Integer(2)); + TURB_MAP.put("LGT", new Integer(3)); + TURB_MAP.put("LGTMOD", new Integer(4)); + TURB_MAP.put("MOD", new Integer(5)); + TURB_MAP.put("MODSEV", new Integer(6)); + TURB_MAP.put("SEV", new Integer(7)); + TURB_MAP.put("EXTRM", new Integer(8)); + } - @Transient - @XmlAttribute - @DynamicSerializeElement - private Integer obsId; + @Transient + private NcPirepLayerData maxPirepLayerData = null; - // Time of the observation. - @Transient - @XmlAttribute - @DynamicSerializeElement - private Calendar timeObs; + @Transient + private boolean display = true; - // Time of the observation to the nearest hour. - @Column - @XmlElement - @DynamicSerializeElement - private Calendar refHour; + @Transient + @XmlAttribute + @DynamicSerializeElement + private Integer obsId; - // - @Column(length = 8) - @DataURI(position = 1) - @XmlAttribute - @DynamicSerializeElement - private String reportType; + // Time of the observation. + @Transient + @XmlAttribute + @DynamicSerializeElement + private Calendar timeObs; - // Text of the WMO header - @Transient - @XmlElement - @DynamicSerializeElement - private String wmoHeader; + // Time of the observation to the nearest hour. + @Column + @XmlElement + @DynamicSerializeElement + private Calendar refHour; - @Transient - @DynamicSerializeElement - @XmlElement - private String suspectTimeFlag; + // + @Column(length = 8) + @DataURI(position = 1) + @XmlAttribute + @DynamicSerializeElement + private String reportType; - // Correction indicator from wmo header - @Column(length = 8) - @DataURI(position = 2) - @XmlElement - @DynamicSerializeElement - private String corIndicator; + // Text of the WMO header + @Transient + @XmlElement + @DynamicSerializeElement + private String wmoHeader; - @Transient - @XmlElement - @DynamicSerializeElement - private String aircraftType; + @Transient + @DynamicSerializeElement + @XmlElement + private String suspectTimeFlag; - // Observation air temperature in degrees Celsius, if not converted. - // Observation air temperature in degrees Kelvin. - // Decimal(5,2) - @Transient - @XmlElement - @DynamicSerializeElement - // private Double temp; - private Float temp; + // Correction indicator from wmo header + @Column(length = 8) + @DataURI(position = 2) + @XmlElement + @DynamicSerializeElement + private String corIndicator; - // Observation wind direction in angular degrees. Integer - @Transient - @XmlElement - @DynamicSerializeElement - // private Integer windDirection; - private Float windDirection; + @Transient + @XmlElement + @DynamicSerializeElement + private String aircraftType; - // Observation wind speed in knots, if not converted. - // Observation wind speed in meters per second. - // Decimal(5,2) - @Transient - @XmlElement - @DynamicSerializeElement - // private Double windSpeed; - private Float windSpeed; + // Observation air temperature in degrees Celsius, if not converted. + // Observation air temperature in degrees Kelvin. + // Decimal(5,2) + @Transient + @XmlElement + @DynamicSerializeElement + // private Double temp; + private Float temp; - @Transient - @XmlElement - @DynamicSerializeElement - // private Integer horzVisibility; - private Integer horzVisibility = IDecoderConstantsN.INTEGER_MISSING; // -9999 + // Observation wind direction in angular degrees. Integer + @Transient + @XmlElement + @DynamicSerializeElement + // private Integer windDirection; + private Float windDirection; - @Transient - @XmlElement - @DynamicSerializeElement - private String obsText; + // Observation wind speed in knots, if not converted. + // Observation wind speed in meters per second. + // Decimal(5,2) + @Transient + @XmlElement + @DynamicSerializeElement + // private Double windSpeed; + private Float windSpeed; - // @Column(length = 16) - @Transient - @XmlElement - @DynamicSerializeElement - private String weatherGroup; + @Transient + @XmlElement + @DynamicSerializeElement + // private Integer horzVisibility; + private Integer horzVisibility = IDecoderConstantsN.INTEGER_MISSING; // -9999 - @DynamicSerializeElement - @XmlElement - // @OneToMany(cascade = CascadeType.ALL, mappedBy = "parent", fetch = - // FetchType.EAGER) - // private Set ancPirepData; - @Transient - private Set ancPirepData = new HashSet(); + @Transient + @XmlElement + @DynamicSerializeElement + private String obsText; - @Embedded - @DataURI(position = 3, embedded = true) - @XmlElement - @DynamicSerializeElement - private AircraftObsLocation location; + // @Column(length = 16) + @Transient + @XmlElement + @DynamicSerializeElement + private String weatherGroup; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + @DynamicSerializeElement + @XmlElement + // @OneToMany(cascade = CascadeType.ALL, mappedBy = "parent", fetch = + // FetchType.EAGER) + // private Set ancPirepData; + @Transient + private Set ancPirepData = new HashSet(); - /** + @Embedded + @DataURI(position = 3, embedded = true) + @XmlElement + @DynamicSerializeElement + private AircraftObsLocation location; + + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; + + /** * */ - public NcPirepRecord() { - } + public NcPirepRecord() { + } - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public NcPirepRecord(String uri) { - super(uri); - } + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public NcPirepRecord(String uri) { + super(uri); + } - public Integer getObsId() { - return obsId; - } + public Integer getObsId() { + return obsId; + } - public void setObsId(Integer obsId) { - this.obsId = obsId; - } + public void setObsId(Integer obsId) { + this.obsId = obsId; + } - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } - /** - * Get the report correction indicator. - * - * @return The corIndicator - */ - public String getCorIndicator() { - return corIndicator; - } + /** + * Get the report correction indicator. + * + * @return The corIndicator + */ + public String getCorIndicator() { + return corIndicator; + } - /** - * Set the report correction indicator. - * - * @param corIndicator - * The corIndicator. - */ - public void setCorIndicator(String corIndicator) { - this.corIndicator = corIndicator; - } + /** + * Set the report correction indicator. + * + * @param corIndicator + * The corIndicator. + */ + public void setCorIndicator(String corIndicator) { + this.corIndicator = corIndicator; + } - /** - * Get the report data for this observation. - * - * @return The Report data. - */ - public String getReportData() { - String s = null; - if (messageData instanceof String) { - s = (String) messageData; - } - return s; - } + /** + * Get the report data for this observation. + * + * @return The Report data. + */ + public String getReportData() { + String s = null; + if (messageData instanceof String) { + s = (String) messageData; + } + return s; + } - /** - * Set the report data for this observation. - * - * @param reportData - * The Report data. - */ - public void setReportData(String reportData) { - messageData = reportData; - } + /** + * Set the report data for this observation. + * + * @param reportData + * The Report data. + */ + public void setReportData(String reportData) { + messageData = reportData; + } - /** - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } + /** + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } - /** - * Is the location defined in the spatial tables. - * - * @return Is the location defined in the spatial tables. - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } + /** + * Is the location defined in the spatial tables. + * + * @return Is the location defined in the spatial tables. + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } - /** - * // * Get the elevation, in meters, of the observing platform or location. - * Get the elevation, in feet, of the observing platform or location. - * - * // * @return The observation elevation, in meters. - * - * @return The observation elevation, in feet. - */ - public Integer getFlightLevel() { - return location.getFlightLevel(); - } + /** + * Get the elevation, in feet, of the observing platform or location. + * + * @return The observation elevation, in feet. + */ + public Integer getFlightLevel() { + return location.getFlightLevel(); + } - /** - * @return the reportType - */ - public String getReportType() { - return reportType; - } + /** + * @return the reportType + */ + public String getReportType() { + return reportType; + } - /** - * @param reportType - * the reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } + /** + * @param reportType + * the reportType to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } - /** - * @return the timeObs - */ - public Calendar getTimeObs() { - if (this.dataTime == null) - return null; - return this.dataTime.getRefTimeAsCalendar(); - } + /** + * @return the timeObs + */ + public Calendar getTimeObs() { + if (this.dataTime == null) { + return null; + } + return this.dataTime.getRefTimeAsCalendar(); + } - /** - * @param timeObs - * the timeObs to set - */ - public void setTimeObs(Calendar timeObs) { - this.timeObs = timeObs; - } + /** + * @param timeObs + * the timeObs to set + */ + public void setTimeObs(Calendar timeObs) { + this.timeObs = timeObs; + } - /** - * @return the refHour - */ - public Calendar getRefHour() { - return refHour; - } + /** + * @return the refHour + */ + public Calendar getRefHour() { + return refHour; + } - /** - * @param refHour - * the refHour to set - */ - public void setRefHour(Calendar refHour) { - this.refHour = refHour; - } + /** + * @param refHour + * the refHour to set + */ + public void setRefHour(Calendar refHour) { + this.refHour = refHour; + } - public String getSuspectTimeFlag() { - return suspectTimeFlag; - } + public String getSuspectTimeFlag() { + return suspectTimeFlag; + } - public void setSuspectTimeFlag(String suspectTimeFlag) { - this.suspectTimeFlag = suspectTimeFlag; - } + public void setSuspectTimeFlag(String suspectTimeFlag) { + this.suspectTimeFlag = suspectTimeFlag; + } - /** - * @param aircraftType - * the aircraftType to set - */ - public void setAircraftType(String aircraftType) { - this.aircraftType = aircraftType; - } + /** + * @param aircraftType + * the aircraftType to set + */ + public void setAircraftType(String aircraftType) { + this.aircraftType = aircraftType; + } - /** - * @return the aircraftType - */ - public String getAircraftType() { - return aircraftType; - } + /** + * @return the aircraftType + */ + public String getAircraftType() { + return aircraftType; + } - /** - * @return the temp - */ - // public Double getTemp() { - public float getTemp() { - return temp; - } + /** + * @return the temp + */ + // public Double getTemp() { + public float getTemp() { + return temp; + } - /** - * @param temp - * the temp to set - */ - // public void setTemp(Double temp) { - public void setTemp(float temp) { - this.temp = temp; - } + /** + * @param temp + * the temp to set + */ + // public void setTemp(Double temp) { + public void setTemp(float temp) { + this.temp = temp; + } - /** - * @return the windDirection - */ - // public Integer getWindDirection() { - public float getWindDirection() { - return windDirection; - } + /** + * @return the windDirection + */ + // public Integer getWindDirection() { + public float getWindDirection() { + return windDirection; + } - /** - * @param windDirection - * the windDirection to set - */ - // public void setWindDirection(Integer windDirection) { - public void setWindDirection(float windDirection) { - this.windDirection = windDirection; - } + /** + * @param windDirection + * the windDirection to set + */ + // public void setWindDirection(Integer windDirection) { + public void setWindDirection(float windDirection) { + this.windDirection = windDirection; + } - /** - * @return the windspeed - */ - // public Double getWindSpeed() { - public float getWindSpeed() { - return windSpeed; - } + /** + * @return the windspeed + */ + // public Double getWindSpeed() { + public float getWindSpeed() { + return windSpeed; + } - /** - * @param windspeed - * the windspeed to set - */ - // public void setWindSpeed(Double windSpeed) { - public void setWindSpeed(float windSpeed) { - this.windSpeed = windSpeed; - } + /** + * @param windspeed + * the windspeed to set + */ + // public void setWindSpeed(Double windSpeed) { + public void setWindSpeed(float windSpeed) { + this.windSpeed = windSpeed; + } - /** - * @return the horzVisibility - */ - public Integer getHorzVisibility() { - return horzVisibility; - } + /** + * @return the horzVisibility + */ + public Integer getHorzVisibility() { + return horzVisibility; + } - /** - * @param horzVisibility - * the horzVisibility to set - */ - public void setHorzVisibility(Integer horzVisibility) { - this.horzVisibility = horzVisibility; - } + /** + * @param horzVisibility + * the horzVisibility to set + */ + public void setHorzVisibility(Integer horzVisibility) { + this.horzVisibility = horzVisibility; + } - /** - * @return the obsText - */ - public String getObsText() { - return obsText; - } + /** + * @return the obsText + */ + public String getObsText() { + return obsText; + } - /** - * @param obsText - * the obsText to set - */ - public void setObsText(String obsText) { - this.obsText = obsText; - } + /** + * @param obsText + * the obsText to set + */ + public void setObsText(String obsText) { + this.obsText = obsText; + } - /** - * @return the weatherGroup - */ - public String getWeatherGroup() { - return weatherGroup; - } + /** + * @return the weatherGroup + */ + public String getWeatherGroup() { + return weatherGroup; + } - /** - * @param weatherGroup - * the weatherGroup to set - */ - public void setWeatherGroup(String weatherGroup) { - this.weatherGroup = weatherGroup; - } + /** + * @param weatherGroup + * the weatherGroup to set + */ + public void setWeatherGroup(String weatherGroup) { + this.weatherGroup = weatherGroup; + } - /** - * @return the ancPirepData - */ - public Set getAncPirepData() { - return ancPirepData; - } + /** + * @return the ancPirepData + */ + public Set getAncPirepData() { + return ancPirepData; + } - /** - * @param ancPirepData - * the ancPirepData to set - */ - public void setAncPirepData(Set ancPirepData) { - this.ancPirepData = ancPirepData; - } + /** + * @param ancPirepData + * the ancPirepData to set + */ + public void setAncPirepData(Set ancPirepData) { + this.ancPirepData = ancPirepData; + } - /** - * - * @param cloud - */ - public void addLayer(NcPirepLayerData layer) { - layer.setParent(this); - if (ancPirepData == null) { - ancPirepData = new HashSet(); - } - ancPirepData.add(layer); - } + /** + * + * @param cloud + */ + public void addLayer(NcPirepLayerData layer) { + layer.setParent(this); + if (ancPirepData == null) { + ancPirepData = new HashSet(); + } + ancPirepData.add(layer); + } - @Override - public void setDataURI(String dataURI) { - identifier = dataURI; - } + @Override + public void setDataURI(String dataURI) { + identifier = dataURI; + } - /** - * Get the IDecoderGettable reference for this record. - * - * @return The IDecoderGettable reference for this record. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return this; - } + /** + * Get the IDecoderGettable reference for this record. + * + * @return The IDecoderGettable reference for this record. + */ + @Override + public IDecoderGettable getDecoderGettable() { + return this; + } - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public String getString(String paramName) { - String retData = null; - if ("STA".matches(paramName)) { - retData = getStationId(); - } else if ("TEXT".equals(paramName)) { - retData = obsText; - } - return retData; - } + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public String getString(String paramName) { + String retData = null; + if ("STA".matches(paramName)) { + retData = getStationId(); + } else if ("TEXT".equals(paramName)) { + retData = obsText; + } + return retData; + } - /** - * Get the value and units of a named parameter within this observation. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return An Amount with value and units. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Amount getValue(String paramName) { - Amount a = null; + /** + * Get the value and units of a named parameter within this observation. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return An Amount with value and units. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Amount getValue(String paramName) { + Amount a = null; - String pName = PARM_MAP.get(paramName); - if (display) { - if (SFC_TEMP.equals(pName) && (temp != null)) { - a = new Amount(temp, TEMPERATURE_UNIT); - } else if (SFC_WNDSPD.equals(pName) && (windSpeed != null)) { - a = new Amount(windSpeed, WIND_SPEED_UNIT); - } else if (SFC_WNDDIR.equals(pName) && (windDirection != null)) { - a = new Amount(windDirection, WIND_DIR_UNIT); - } else if (STA_LAT.equals(pName)) { - a = new Amount(this.getLatitude(), LOCATION_UNIT); - } else if (STA_LON.equals(pName)) { - a = new Amount(this.getLongitude(), LOCATION_UNIT); - } else if (UA_FLTLVL.equals(pName) && getFlightLevel() != null) { - a = new Amount(this.getFlightLevel().intValue(), ALTITUDE_UNIT); - // if used, need to modify raytheon code - // } else if (UA_TOPHGT.equals(pName) && maxPirepLayerData != - // null - // && maxPirepLayerData.getTopLayerHeight() != null) { - // a = new - // Amount(maxPirepLayerData.getTopLayerHeight().intValue(), - // ALTITUDE_UNIT); - // } else if (UA_BOTHGT.equals(pName) && maxPirepLayerData != - // null - // && maxPirepLayerData.getBaseLayerHeight() != null) { - // a = new - // Amount(maxPirepLayerData.getBaseLayerHeight().intValue(), - // ALTITUDE_UNIT); - } - } - return a; - } + String pName = PARM_MAP.get(paramName); + if (display) { + if (SFC_TEMP.equals(pName) && (temp != null)) { + a = new Amount(temp, TEMPERATURE_UNIT); + } else if (SFC_WNDSPD.equals(pName) && (windSpeed != null)) { + a = new Amount(windSpeed, WIND_SPEED_UNIT); + } else if (SFC_WNDDIR.equals(pName) && (windDirection != null)) { + a = new Amount(windDirection, WIND_DIR_UNIT); + } else if (STA_LAT.equals(pName)) { + a = new Amount(this.getLatitude(), LOCATION_UNIT); + } else if (STA_LON.equals(pName)) { + a = new Amount(this.getLongitude(), LOCATION_UNIT); + } else if (UA_FLTLVL.equals(pName) && (getFlightLevel() != null)) { + a = new Amount(this.getFlightLevel().intValue(), ALTITUDE_UNIT); + // if used, need to modify raytheon code + // } else if (UA_TOPHGT.equals(pName) && maxPirepLayerData != + // null + // && maxPirepLayerData.getTopLayerHeight() != null) { + // a = new + // Amount(maxPirepLayerData.getTopLayerHeight().intValue(), + // ALTITUDE_UNIT); + // } else if (UA_BOTHGT.equals(pName) && maxPirepLayerData != + // null + // && maxPirepLayerData.getBaseLayerHeight() != null) { + // a = new + // Amount(maxPirepLayerData.getBaseLayerHeight().intValue(), + // ALTITUDE_UNIT); + } + } + return a; + } - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Collection getValues(String paramName) { - return null; - } + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Collection getValues(String paramName) { + return null; + } - @Override - public String[] getStrings(String paramName) { - if ("ICI".matches(paramName)) { - int rank = -1; - String iceIntensity = null; - for (NcPirepLayerData layer : this.ancPirepData) { - String intensity = ""; - if (layer.getLayerType().equals( - NcPirepLayerData.LAYER_TYP_ICING)) { - if (layer.getIceInten() != null) { - intensity = layer.getIceInten(); - } - // if (layer.getSecondValue() != null) { - // intensity += layer.getSecondValue(); - // } + @Override + public String[] getStrings(String paramName) { + if ("ICI".matches(paramName)) { + int rank = -1; + String iceIntensity = null; + for (NcPirepLayerData layer : this.ancPirepData) { + String intensity = ""; + if (layer.getLayerType().equals( + NcPirepLayerData.LAYER_TYP_ICING)) { + if (layer.getIceInten() != null) { + intensity = layer.getIceInten(); + } + // if (layer.getSecondValue() != null) { + // intensity += layer.getSecondValue(); + // } - if (ICING_MAP.get(intensity).intValue() > rank) { - rank = ICING_MAP.get(intensity).intValue(); - iceIntensity = intensity; - maxPirepLayerData = layer; - } - } - } - if (iceIntensity != null) { - String[] maxIntensity = { iceIntensity }; - return maxIntensity; - } else { - display = false; - } - } else if ("ICT".matches(paramName) && maxPirepLayerData != null) { - String[] maxType = { maxPirepLayerData.getIceType() }; - return maxType; - } else if ("TBI".matches(paramName)) { - int rank = -1; - String turbIntensity = null; - for (NcPirepLayerData layer : this.ancPirepData) { - String intensity = ""; - if (layer.getLayerType().equals( - NcPirepLayerData.LAYER_TYP_TURBC)) { - if (layer.getTurbInten() != null) { - intensity = layer.getTurbInten(); - } - // if (layer.getSecondValue() != null) { - // intensity += layer.getSecondValue(); - // } + if (ICING_MAP.get(intensity).intValue() > rank) { + rank = ICING_MAP.get(intensity).intValue(); + iceIntensity = intensity; + maxPirepLayerData = layer; + } + } + } + if (iceIntensity != null) { + String[] maxIntensity = { iceIntensity }; + return maxIntensity; + } else { + display = false; + } + } else if ("ICT".matches(paramName) && (maxPirepLayerData != null)) { + String[] maxType = { maxPirepLayerData.getIceType() }; + return maxType; + } else if ("TBI".matches(paramName)) { + int rank = -1; + String turbIntensity = null; + for (NcPirepLayerData layer : this.ancPirepData) { + String intensity = ""; + if (layer.getLayerType().equals( + NcPirepLayerData.LAYER_TYP_TURBC)) { + if (layer.getTurbInten() != null) { + intensity = layer.getTurbInten(); + } + // if (layer.getSecondValue() != null) { + // intensity += layer.getSecondValue(); + // } - if (TURB_MAP.get(intensity).intValue() > rank) { - rank = TURB_MAP.get(intensity).intValue(); - turbIntensity = intensity; - maxPirepLayerData = layer; - } - } - } - if (turbIntensity != null) { - String[] maxIntensity = { turbIntensity }; - return maxIntensity; - } else { - display = false; - } - } else if ("TBT".matches(paramName) && maxPirepLayerData != null) { - String[] maxType = { maxPirepLayerData.getTurbType() }; - return maxType; - } else if ("TBF".matches(paramName) && maxPirepLayerData != null) { - // Turbulence Frequency Types do not get stored. - } - return null; - } + if (TURB_MAP.get(intensity).intValue() > rank) { + rank = TURB_MAP.get(intensity).intValue(); + turbIntensity = intensity; + maxPirepLayerData = layer; + } + } + } + if (turbIntensity != null) { + String[] maxIntensity = { turbIntensity }; + return maxIntensity; + } else { + display = false; + } + } else if ("TBT".matches(paramName) && (maxPirepLayerData != null)) { + String[] maxType = { maxPirepLayerData.getTurbType() }; + return maxType; + } else if ("TBF".matches(paramName) && (maxPirepLayerData != null)) { + // Turbulence Frequency Types do not get stored. + } + return null; + } - @Override - public AircraftObsLocation getSpatialObject() { - return location; - } + @Override + public AircraftObsLocation getSpatialObject() { + return location; + } - public AircraftObsLocation getLocation() { - return location; - } + public AircraftObsLocation getLocation() { + return location; + } - public void setLocation(AircraftObsLocation location) { - this.location = location; - } + public void setLocation(AircraftObsLocation location) { + this.location = location; + } - @Override - public String getMessageData() { - return getObsText(); - } + @Override + public String getMessageData() { + return getObsText(); + } - /** - * Returns the hashCode for this object. This implementation returns the - * hashCode of the generated dataURI. - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result - + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); - return result; - } + /** + * Returns the hashCode for this object. This implementation returns the + * hashCode of the generated dataURI. + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = (prime * result) + + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); + return result; + } - /** - * Checks if this record is equal to another by checking the generated - * dataURI. - * - * @param obj - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - NcPirepRecord other = (NcPirepRecord) obj; - if (getDataURI() == null) { - if (other.getDataURI() != null) { - return false; - } - } else if (!getDataURI().equals(other.getDataURI())) - return false; - return true; - } + /** + * Checks if this record is equal to another by checking the generated + * dataURI. + * + * @param obj + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + NcPirepRecord other = (NcPirepRecord) obj; + if (getDataURI() == null) { + if (other.getDataURI() != null) { + return false; + } + } else if (!getDataURI().equals(other.getDataURI())) { + return false; + } + return true; + } - @Override - public Date getPersistenceTime() { - return this.dataTime.getRefTime(); - } + @Override + public Date getPersistenceTime() { + return this.dataTime.getRefTime(); + } - @Override - public void setPersistenceTime(Date persistTime) { - } + @Override + public void setPersistenceTime(Date persistTime) { + } - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() - */ - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() + */ + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon - * .uf.common.pointdata.PointDataView) - */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon + * .uf.common.pointdata.PointDataView) + */ + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } @Override @Column @@ -849,4 +854,9 @@ public class NcPirepRecord extends PluginDataObject implements ISpatialEnabled, public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "ncpirep"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscat/src/gov/noaa/nws/ncep/common/dataplugin/ncscat/NcscatRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscat/src/gov/noaa/nws/ncep/common/dataplugin/ncscat/NcscatRecord.java index 3521a2192d..031199a14b 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscat/src/gov/noaa/nws/ncep/common/dataplugin/ncscat/NcscatRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscat/src/gov/noaa/nws/ncep/common/dataplugin/ncscat/NcscatRecord.java @@ -50,12 +50,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ncscat", - indexes = { - @Index(name = "ncscat_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ncscat", indexes = { @Index(name = "ncscat_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @@ -168,4 +164,9 @@ public class NcscatRecord extends PersistablePluginDataObject { public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "ncsat"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscd/src/gov/noaa/nws/ncep/common/dataplugin/ncscd/NcScdRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscd/src/gov/noaa/nws/ncep/common/dataplugin/ncscd/NcScdRecord.java index 826c596eb1..8b7473c804 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscd/src/gov/noaa/nws/ncep/common/dataplugin/ncscd/NcScdRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscd/src/gov/noaa/nws/ncep/common/dataplugin/ncscd/NcScdRecord.java @@ -1,34 +1,3 @@ -/** - * - * NcScdRecord - * - * This java class performs the mapping to the database tables for SCD. - * - *
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    	Engineer    Description
- * -------		-------	 	--------	-----------
- * 12/2008		41			T. Lee		Created
- * 04/2009		41			T. Lee		Migrated to TO10
- * 07/2009		41			T. Lee		Migrated to TO11
- * 11/2009		41			T. Lee		Migrated to TO11D6
- * 06/2011		41			F. J. Yen	Convert SCD to HDF5 (OB11.5).  Changed type
- * 										of suspectTimeFlag from Boolean to String
- * 										since undefined in PointDataDescription.
- * 09/2011      457         S. Gurung   Renamed H5 to Nc and h5 to nc
- * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
- * 04/2013      1293        bkowal      Removed references to hdffileid.
- * Apr 12, 2013 1857        bgonzale    Added SequenceGenerator annotation.
- * May 07, 2013 1869        bsteffen	Remove dataURI column from PluginDataObject.
- *
- * 
- * - * @author T.Lee - * @version 1.0 - * - */ - package gov.noaa.nws.ncep.common.dataplugin.ncscd; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; @@ -70,6 +39,36 @@ import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * + * NcScdRecord + * + * This java class performs the mapping to the database tables for SCD. + * + *
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#  Engineer  Description
+ * ------------ -------- --------- ----------------------------------
+ * 12/2008      41       T. Lee    Created
+ * 04/2009      41       T. Lee    Migrated to TO10
+ * 07/2009      41       T. Lee    Migrated to TO11
+ * 11/2009      41       T. Lee    Migrated to TO11D6
+ * 06/2011      41       F. J. Yen Convert SCD to HDF5 (OB11.5).  Changed type
+ *                                 of suspectTimeFlag from Boolean to String
+ *                                 since undefined in PointDataDescription.
+ * 09/2011      457      S. Gurung Renamed H5 to Nc and h5 to nc
+ * Apr 04, 2013 1846     bkowal    Added an index on refTime and forecastTime
+ * Apr 04, 2013 1293     bkowal    Removed references to hdffileid.
+ * Apr 12, 2013 1857     bgonzale  Added SequenceGenerator annotation.
+ * May 07, 2013 1869     bsteffen  Remove dataURI column from PluginDataObject.
+ * Aug 30, 2013 2298     rjpeter   Make getPluginName abstract
+ * 
+ * + * @author T.Lee + * @version 1.0 + * + */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "ncscdseq") @Table(name = "ncscd", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -77,483 +76,479 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ncscd", - indexes = { - @Index(name = "ncscd_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ncscd", indexes = { @Index(name = "ncscd_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class NcScdRecord extends PluginDataObject implements ISpatialEnabled, - IDecoderGettable, IPointData, IPersistable { - - private static final long serialVersionUID = 1L; - - public static final Unit TDXC_UNIT = SI.CELSIUS; - - public static final Unit PRECIP_UNIT = NonSI.INCH; - - /** Report type */ - @XmlElement - @DynamicSerializeElement - @Column - @DataURI(position = 1) - private String reportType; - - @Embedded - @DataURI(position = 2, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; - - /** Bulletin correction */ - @Column(length = 8) - @DataURI(position = 3) - @XmlElement - @DynamicSerializeElement - private String corIndicator; - - /** Bulletin observation time */ - @Transient - @XmlAttribute - @DynamicSerializeElement - private Calendar obsTime; - - /** Bulletin issuance time */ - @Column - @DataURI(position = 4) - @XmlElement - @DynamicSerializeElement - private Calendar issueTime; - - /** Maximum 24h temperature in Celsius */ - @Transient - @XmlElement - @DynamicSerializeElement - private float TDXC; - - /** Minimum 24h temperature in Celsius */ - @Transient - @XmlElement - @DynamicSerializeElement - private float TDNC; - - /** Six hour accumulated precipitation in inches */ - @Transient - @XmlElement - @DynamicSerializeElement - private float P06I; - - /** Twenty-four hour accumulated precipitation in inches */ - @Transient - @XmlElement - @DynamicSerializeElement - private float P24I; - - /** Character weather phenomenon */ - @Transient - @XmlElement - @DynamicSerializeElement - private String WTHR; - - /** Snow depth */ - @Transient - @XmlElement - @DynamicSerializeElement - private float SNOW; - - /** New snow depth on the ground */ - @Transient - @XmlElement - @DynamicSerializeElement - private float SNEW; - - /** Total snow depth in a Calendar day */ - @Transient - @XmlElement - @DynamicSerializeElement - private float S24I; - - /** Water equivalent of snow */ - @Transient - @XmlElement - @DynamicSerializeElement - private float WEQS; - - /** Duration of sunshine */ - @Transient - @XmlElement - @DynamicSerializeElement - private int MSUN; - - /** Low-level cloud genera from WMO Code 0513 */ - @Transient - @XmlElement - @DynamicSerializeElement - private int CTYL; - - /** Mid-level cloud genera from WMO Code 0513 */ - @Transient - @XmlElement - @DynamicSerializeElement - private int CTYM; - - /** High-level cloud genera from WMO Code 0513 */ - @Transient - @XmlElement - @DynamicSerializeElement - private int CTYH; - - /** Fraction of celestial dome covered by cloud from WMO Code 2700 */ - @Transient - @XmlElement - @DynamicSerializeElement - private int CFRT; - - /** - * Fraction of celestial dome covered by low or mid cloud from WMO Code 2700 - */ - @Transient - @XmlElement - @DynamicSerializeElement - private int CFRL; - - /** Cloud base height from WMO Code 1600 */ - @Transient - @XmlElement - @DynamicSerializeElement - private int CBAS; - - /** Suspect time flag */ - @Transient - @XmlElement - @DynamicSerializeElement - private String suspectTimeFlag; - - /** Raw report */ - @Transient - @XmlElement - @DynamicSerializeElement - private String report; - - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - /** - * Default constructor - * - */ - public NcScdRecord() { - this.location = null; - this.issueTime = null; - this.corIndicator = "REG"; - this.obsTime = null; - this.TDXC = IDecoderConstantsN.FLOAT_MISSING; - this.TDNC = IDecoderConstantsN.FLOAT_MISSING; - this.P06I = IDecoderConstantsN.FLOAT_MISSING; - this.P24I = IDecoderConstantsN.FLOAT_MISSING; - this.WTHR = ""; - this.SNOW = IDecoderConstantsN.FLOAT_MISSING; - this.SNEW = IDecoderConstantsN.FLOAT_MISSING; - this.S24I = IDecoderConstantsN.FLOAT_MISSING; - this.WEQS = IDecoderConstantsN.FLOAT_MISSING; - this.MSUN = IDecoderConstantsN.INTEGER_MISSING; - this.CTYL = IDecoderConstantsN.INTEGER_MISSING; - this.CTYM = IDecoderConstantsN.INTEGER_MISSING; - this.CTYH = IDecoderConstantsN.INTEGER_MISSING; - this.CFRT = IDecoderConstantsN.INTEGER_MISSING; - this.CFRL = IDecoderConstantsN.INTEGER_MISSING; - this.CBAS = IDecoderConstantsN.INTEGER_MISSING; - this.suspectTimeFlag = "false"; - this.report = ""; - } - - /** - * Constructs a SCD record from a dataURI - * - * @param uri - * The dataURI - */ - public NcScdRecord(String uri) { - super(uri); - } - - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - - public String getReportType() { - return reportType; - } - - public void setReportType(String reportType) { - this.reportType = reportType; - } - - public String getStationId() { - return location.getStationId(); - } - - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } - - public SurfaceObsLocation getLocation() { - return location; - } - - public void setLocation(SurfaceObsLocation obsLoc) { - this.location = obsLoc; - } - - public double getLatitude() { - return location.getLatitude(); - } - - public double getLongitude() { - return location.getLongitude(); - } - - public Integer getElevation() { - return location.getElevation(); - } - - public Calendar getIssueTime() { - return issueTime; - } - - public void setIssueTime(Calendar issueTime) { - this.issueTime = issueTime; - } - - public String getCorIndicator() { - return corIndicator; - } - - public void setCorIndicator(String corIndicator) { - this.corIndicator = corIndicator; - } - - public Calendar getObsTime() { - return obsTime; - } - - public void setObsTime(Calendar obsTime) { - this.obsTime = obsTime; - } - - public float getTDXC() { - return TDXC; - } - - public void setTDXC(float TDXC) { - this.TDXC = TDXC; - } - - public float getTDNC() { - return TDNC; - } - - public void setTDNC(float TDNC) { - this.TDNC = TDNC; - } - - public float getP06I() { - return P06I; - } - - public void setP06I(float P06I) { - this.P06I = P06I; - } - - public float getP24I() { - return P24I; - } - - public void setP24I(float P24I) { - this.P24I = P24I; - } + IDecoderGettable, IPointData, IPersistable { + + private static final long serialVersionUID = 1L; + + public static final Unit TDXC_UNIT = SI.CELSIUS; + + public static final Unit PRECIP_UNIT = NonSI.INCH; + + /** Report type */ + @XmlElement + @DynamicSerializeElement + @Column + @DataURI(position = 1) + private String reportType; + + @Embedded + @DataURI(position = 2, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; + + /** Bulletin correction */ + @Column(length = 8) + @DataURI(position = 3) + @XmlElement + @DynamicSerializeElement + private String corIndicator; + + /** Bulletin observation time */ + @Transient + @XmlAttribute + @DynamicSerializeElement + private Calendar obsTime; + + /** Bulletin issuance time */ + @Column + @DataURI(position = 4) + @XmlElement + @DynamicSerializeElement + private Calendar issueTime; + + /** Maximum 24h temperature in Celsius */ + @Transient + @XmlElement + @DynamicSerializeElement + private float TDXC; + + /** Minimum 24h temperature in Celsius */ + @Transient + @XmlElement + @DynamicSerializeElement + private float TDNC; + + /** Six hour accumulated precipitation in inches */ + @Transient + @XmlElement + @DynamicSerializeElement + private float P06I; + + /** Twenty-four hour accumulated precipitation in inches */ + @Transient + @XmlElement + @DynamicSerializeElement + private float P24I; + + /** Character weather phenomenon */ + @Transient + @XmlElement + @DynamicSerializeElement + private String WTHR; + + /** Snow depth */ + @Transient + @XmlElement + @DynamicSerializeElement + private float SNOW; + + /** New snow depth on the ground */ + @Transient + @XmlElement + @DynamicSerializeElement + private float SNEW; + + /** Total snow depth in a Calendar day */ + @Transient + @XmlElement + @DynamicSerializeElement + private float S24I; + + /** Water equivalent of snow */ + @Transient + @XmlElement + @DynamicSerializeElement + private float WEQS; + + /** Duration of sunshine */ + @Transient + @XmlElement + @DynamicSerializeElement + private int MSUN; + + /** Low-level cloud genera from WMO Code 0513 */ + @Transient + @XmlElement + @DynamicSerializeElement + private int CTYL; + + /** Mid-level cloud genera from WMO Code 0513 */ + @Transient + @XmlElement + @DynamicSerializeElement + private int CTYM; + + /** High-level cloud genera from WMO Code 0513 */ + @Transient + @XmlElement + @DynamicSerializeElement + private int CTYH; + + /** Fraction of celestial dome covered by cloud from WMO Code 2700 */ + @Transient + @XmlElement + @DynamicSerializeElement + private int CFRT; + + /** + * Fraction of celestial dome covered by low or mid cloud from WMO Code 2700 + */ + @Transient + @XmlElement + @DynamicSerializeElement + private int CFRL; + + /** Cloud base height from WMO Code 1600 */ + @Transient + @XmlElement + @DynamicSerializeElement + private int CBAS; + + /** Suspect time flag */ + @Transient + @XmlElement + @DynamicSerializeElement + private String suspectTimeFlag; + + /** Raw report */ + @Transient + @XmlElement + @DynamicSerializeElement + private String report; + + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; + + /** + * Default constructor + * + */ + public NcScdRecord() { + this.location = null; + this.issueTime = null; + this.corIndicator = "REG"; + this.obsTime = null; + this.TDXC = IDecoderConstantsN.FLOAT_MISSING; + this.TDNC = IDecoderConstantsN.FLOAT_MISSING; + this.P06I = IDecoderConstantsN.FLOAT_MISSING; + this.P24I = IDecoderConstantsN.FLOAT_MISSING; + this.WTHR = ""; + this.SNOW = IDecoderConstantsN.FLOAT_MISSING; + this.SNEW = IDecoderConstantsN.FLOAT_MISSING; + this.S24I = IDecoderConstantsN.FLOAT_MISSING; + this.WEQS = IDecoderConstantsN.FLOAT_MISSING; + this.MSUN = IDecoderConstantsN.INTEGER_MISSING; + this.CTYL = IDecoderConstantsN.INTEGER_MISSING; + this.CTYM = IDecoderConstantsN.INTEGER_MISSING; + this.CTYH = IDecoderConstantsN.INTEGER_MISSING; + this.CFRT = IDecoderConstantsN.INTEGER_MISSING; + this.CFRL = IDecoderConstantsN.INTEGER_MISSING; + this.CBAS = IDecoderConstantsN.INTEGER_MISSING; + this.suspectTimeFlag = "false"; + this.report = ""; + } + + /** + * Constructs a SCD record from a dataURI + * + * @param uri + * The dataURI + */ + public NcScdRecord(String uri) { + super(uri); + } + + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } + + public String getReportType() { + return reportType; + } + + public void setReportType(String reportType) { + this.reportType = reportType; + } + + public String getStationId() { + return location.getStationId(); + } + + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } + + public SurfaceObsLocation getLocation() { + return location; + } + + public void setLocation(SurfaceObsLocation obsLoc) { + this.location = obsLoc; + } + + public double getLatitude() { + return location.getLatitude(); + } + + public double getLongitude() { + return location.getLongitude(); + } + + public Integer getElevation() { + return location.getElevation(); + } + + public Calendar getIssueTime() { + return issueTime; + } + + public void setIssueTime(Calendar issueTime) { + this.issueTime = issueTime; + } + + public String getCorIndicator() { + return corIndicator; + } + + public void setCorIndicator(String corIndicator) { + this.corIndicator = corIndicator; + } + + public Calendar getObsTime() { + return obsTime; + } + + public void setObsTime(Calendar obsTime) { + this.obsTime = obsTime; + } + + public float getTDXC() { + return TDXC; + } + + public void setTDXC(float TDXC) { + this.TDXC = TDXC; + } + + public float getTDNC() { + return TDNC; + } + + public void setTDNC(float TDNC) { + this.TDNC = TDNC; + } + + public float getP06I() { + return P06I; + } + + public void setP06I(float P06I) { + this.P06I = P06I; + } + + public float getP24I() { + return P24I; + } + + public void setP24I(float P24I) { + this.P24I = P24I; + } - public String getWTHR() { - return WTHR; - } + public String getWTHR() { + return WTHR; + } - public void setWTHR(String WTHR) { - this.WTHR = WTHR; - } + public void setWTHR(String WTHR) { + this.WTHR = WTHR; + } - public float getSNOW() { - return SNOW; - } + public float getSNOW() { + return SNOW; + } - public void setSNOW(float SNOW) { - this.SNOW = SNOW; - } - - public float getSNEW() { - return SNEW; - } - - public void setSNEW(float SNEW) { - this.SNEW = SNEW; - } - - public float getS24I() { - return S24I; - } - - public void setS24I(float S24I) { - this.S24I = S24I; - } - - public float getWEQS() { - return WEQS; - } - - public void setWEQS(float WEQS) { - this.WEQS = WEQS; - } - - public int getMSUN() { - return MSUN; - } - - public void setMSUN(int MSUN) { - this.MSUN = MSUN; - } - - public int getCTYL() { - return CTYL; - } - - public void setCTYL(int CTYL) { - this.CTYL = CTYL; - } - - public int getCTYM() { - return CTYM; - } - - public void setCTYM(int CTYM) { - this.CTYM = CTYM; - } - - public int getCTYH() { - return CTYH; - } - - public void setCTYH(int CTYH) { - this.CTYH = CTYH; - } - - public int getCFRT() { - return CFRT; - } - - public void setCFRT(int CFRT) { - this.CFRT = CFRT; - } - - public int getCFRL() { - return CFRL; - } - - public void setCFRL(int CFRL) { - this.CFRL = CFRL; - } - - public int getCBAS() { - return CBAS; - } - - public void setCBAS(int CBAS) { - this.CBAS = CBAS; - } - - public String getReport() { - return report; - } - - public void setReport(String report) { - this.report = report; - } - - public String getSuspectTimeFlag() { - return suspectTimeFlag; - } - - public void setSuspectTimeFlag(String suspectTimeFlag) { - this.suspectTimeFlag = suspectTimeFlag; - } - - /** - * Get the value and units of a named parameter within this observation. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return An Amount with value and units. If the parameter is unknown, a - * null reference is returned. - */ - - @Override - public Date getPersistenceTime() { - return this.dataTime.getRefTime(); - } - - @Override - public void setPersistenceTime(Date persistTime) { - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() - */ - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon - * .uf.common.pointdata.PointDataView) - */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } - - @Override - public Amount getValue(String paramName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Collection getValues(String paramName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getString(String paramName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String[] getStrings(String paramName) { - // TODO Auto-generated method stub - return null; - } + public void setSNOW(float SNOW) { + this.SNOW = SNOW; + } + + public float getSNEW() { + return SNEW; + } + + public void setSNEW(float SNEW) { + this.SNEW = SNEW; + } + + public float getS24I() { + return S24I; + } + + public void setS24I(float S24I) { + this.S24I = S24I; + } + + public float getWEQS() { + return WEQS; + } + + public void setWEQS(float WEQS) { + this.WEQS = WEQS; + } + + public int getMSUN() { + return MSUN; + } + + public void setMSUN(int MSUN) { + this.MSUN = MSUN; + } + + public int getCTYL() { + return CTYL; + } + + public void setCTYL(int CTYL) { + this.CTYL = CTYL; + } + + public int getCTYM() { + return CTYM; + } + + public void setCTYM(int CTYM) { + this.CTYM = CTYM; + } + + public int getCTYH() { + return CTYH; + } + + public void setCTYH(int CTYH) { + this.CTYH = CTYH; + } + + public int getCFRT() { + return CFRT; + } + + public void setCFRT(int CFRT) { + this.CFRT = CFRT; + } + + public int getCFRL() { + return CFRL; + } + + public void setCFRL(int CFRL) { + this.CFRL = CFRL; + } + + public int getCBAS() { + return CBAS; + } + + public void setCBAS(int CBAS) { + this.CBAS = CBAS; + } + + public String getReport() { + return report; + } + + public void setReport(String report) { + this.report = report; + } + + public String getSuspectTimeFlag() { + return suspectTimeFlag; + } + + public void setSuspectTimeFlag(String suspectTimeFlag) { + this.suspectTimeFlag = suspectTimeFlag; + } + + /** + * Get the value and units of a named parameter within this observation. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return An Amount with value and units. If the parameter is unknown, a + * null reference is returned. + */ + + @Override + public Date getPersistenceTime() { + return this.dataTime.getRefTime(); + } + + @Override + public void setPersistenceTime(Date persistTime) { + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() + */ + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon + * .uf.common.pointdata.PointDataView) + */ + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + + @Override + public Amount getValue(String paramName) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Collection getValues(String paramName) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getString(String paramName) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String[] getStrings(String paramName) { + // TODO Auto-generated method stub + return null; + } @Override @Column @@ -561,4 +556,9 @@ public class NcScdRecord extends PluginDataObject implements ISpatialEnabled, public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "ncscd"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscd/src/gov/noaa/nws/ncep/common/dataplugin/ncscd/dao/NcScdPointDataTransform.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscd/src/gov/noaa/nws/ncep/common/dataplugin/ncscd/dao/NcScdPointDataTransform.java index 534cf3c6f8..b47f03347b 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscd/src/gov/noaa/nws/ncep/common/dataplugin/ncscd/dao/NcScdPointDataTransform.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncscd/src/gov/noaa/nws/ncep/common/dataplugin/ncscd/dao/NcScdPointDataTransform.java @@ -4,6 +4,8 @@ **/ package gov.noaa.nws.ncep.common.dataplugin.ncscd.dao; +import gov.noaa.nws.ncep.common.dataplugin.ncscd.NcScdRecord; + import java.io.File; import java.util.ArrayList; import java.util.Date; @@ -11,9 +13,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import gov.noaa.nws.ncep.common.dataplugin.ncscd.NcScdRecord; -import gov.noaa.nws.ncep.common.dataplugin.ncscd.dao.NcScdDao; - import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.common.pointdata.PointDataDescription; @@ -30,9 +29,10 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 06/29/2011 F. J. Yen Initial creation - * 09/08/2011 294 G. Hull Use SurfaceObsLocation to set lat/lon - * 09/13/2011 457 S. Gurung Renamed H5 to Nc and h5 to nc + * Jun 29, 2011 F. J. Yen Initial creation + * Sep 08, 2011 294 G. Hull Use SurfaceObsLocation to set lat/lon + * Sep 13, 2011 457 S. Gurung Renamed H5 to Nc and h5 to nc + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -55,70 +55,69 @@ public class NcScdPointDataTransform { private static final String LATITUDE = "latitude"; private static final String ELEVATION = "elevation"; - + private static final String ISSUE_TIME = "issueTime"; - + private static final String OBS_TIME = "obsTime"; // STATION_ID, REPORT_TYPE, ISSUE_TIME, OBS_TIME // ------------------ - + private static final String CORRECTION_CODE = "correctionCode"; private static final String DATAURI = "dataURI"; - + private static final String REPORT = "report"; // CORRECTION_CODE, DATAURI, REPORT // ------------------ - + private static final String TDXC = "TDXC"; private static final String TDNC = "TDNC"; - + private static final String P06I = "P06I"; - + private static final String P24I = "P24I"; private static final String WTHR = "WTHR"; - + private static final String SNOW = "SNOW"; - + private static final String SNEW = "SNEW"; - + private static final String S24I = "S24I"; private static final String WEQS = "WEQS"; - + private static final String MSUN = "MSUN"; - + private static final String CTYL = "CTYL"; private static final String CTYM = "CTYM"; - + private static final String CTYH = "CTYH"; - + private static final String CFRT = "CFRT"; private static final String CFRL = "CFRL"; - - private static final String CBAS = "CBAS"; - - private static final String SUSPECT_TIME_FLAG = "suspectTimeFlag"; - - // TDXC, TDNC, P06I, P24I, WTHR, SNOW, SNEW, S24I, WEQS, MSUN, - // CTYL, CTYM, CTYH, CFRT, CFRL, CBAS, SUSPECT_TIME_FLAG - // ------------------ + private static final String CBAS = "CBAS"; + + private static final String SUSPECT_TIME_FLAG = "suspectTimeFlag"; + + // TDXC, TDNC, P06I, P24I, WTHR, SNOW, SNEW, S24I, WEQS, MSUN, + // CTYL, CTYM, CTYH, CFRT, CFRL, CBAS, SUSPECT_TIME_FLAG + // ------------------ /** * It is important to keep this up to date or risk breaking backwards * compatibility */ - private static final String[] ALL_PARAMS = { STATION_ID, REPORT_TYPE, - ISSUE_TIME, OBS_TIME, CORRECTION_CODE, REPORT, DATAURI, TDXC, - TDNC, P06I, P24I, WTHR, SNOW, SNEW, S24I, WEQS, MSUN, CTYL, - CTYM, CTYH, CFRT, CFRL, CBAS, SUSPECT_TIME_FLAG,}; + private static final String[] ALL_PARAMS = { STATION_ID, REPORT_TYPE, + ISSUE_TIME, OBS_TIME, CORRECTION_CODE, REPORT, DATAURI, TDXC, TDNC, + P06I, P24I, WTHR, SNOW, SNEW, S24I, WEQS, MSUN, CTYL, CTYM, CTYH, + CFRT, CFRL, CBAS, SUSPECT_TIME_FLAG, }; public static final String ALL_PARAMS_LIST; static { @@ -154,8 +153,9 @@ public class NcScdPointDataTransform { if (pdo.length > 0) { Map pointMap = new HashMap(); for (PluginDataObject p : pdo) { - if (!(p instanceof NcScdRecord)) + if (!(p instanceof NcScdRecord)) { continue; + } File f = this.dao.getFullFilePath(p); PointDataContainer pdc = pointMap.get(f); if (pdc == null) { @@ -206,21 +206,19 @@ public class NcScdPointDataTransform { nar.setDataURI(pdv.getString(DATAURI)); nar.setReport(pdv.getString(REPORT)); nar.setReportType(pdv.getString(REPORT_TYPE)); - + SurfaceObsLocation loc = new SurfaceObsLocation( pdv.getString(STATION_NAME)); Double lat = pdv.getNumber(LATITUDE).doubleValue(); Double lon = pdv.getNumber(LONGITUDE).doubleValue(); loc.assignLocation(lat, lon); loc.setElevation(pdv.getNumber(ELEVATION).intValue()); - + long tmptime = pdv.getNumber(ISSUE_TIME).longValue(); nar.setIssueTime(TimeTools.newCalendar(tmptime)); tmptime = pdv.getNumber(OBS_TIME).longValue(); nar.setObsTime(TimeTools.newCalendar(tmptime)); - nar.setPluginName("ncscd"); - nar.setTDXC(pdv.getNumber(TDXC).floatValue()); nar.setTDNC(pdv.getNumber(TDNC).floatValue()); nar.setP06I(pdv.getNumber(P06I).floatValue()); @@ -230,11 +228,11 @@ public class NcScdPointDataTransform { nar.setSNEW(pdv.getNumber(SNEW).floatValue()); nar.setS24I(pdv.getNumber(S24I).floatValue()); nar.setWEQS(pdv.getNumber(WEQS).floatValue()); - + nar.setMSUN(pdv.getInt(MSUN)); nar.setCTYL(pdv.getInt(CTYL)); nar.setCTYM(pdv.getInt(CTYM)); - nar.setCTYH(pdv.getInt(CTYH)); + nar.setCTYH(pdv.getInt(CTYH)); nar.setCFRT(pdv.getInt(CFRT)); nar.setCFRL(pdv.getInt(CFRL)); nar.setCBAS(pdv.getInt(CBAS)); diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.nctaf/src/gov/noaa/nws/ncep/common/dataplugin/nctaf/NcTafRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.nctaf/src/gov/noaa/nws/ncep/common/dataplugin/nctaf/NcTafRecord.java index 50f2d9eabb..b26e3018a8 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.nctaf/src/gov/noaa/nws/ncep/common/dataplugin/nctaf/NcTafRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.nctaf/src/gov/noaa/nws/ncep/common/dataplugin/nctaf/NcTafRecord.java @@ -59,20 +59,25 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 09/20/2011 458 sgurung Main pdo class - * 09/23/2011 458 sgurung Converted to HDF5 - * 09/29/2011 sgurung Added reportType - * 10/19/2011 sgurung Set dataTime with correct valid period - * 10/26/2011 sgurung Added probable parameters (for TEMPO/PROB groups). - * Split change groups into hourly records. - * 11/03/2011 sgurung Added probable weather and method to calculate ceiling. - * 11/04/2011 sgurung Sort sky_cover before calculating ceiling. - * Change startRefTime to nearest hour to get hourly refTimes - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * 04/08/2013 1293 bkowal Removed references to hdffileid. + * Sep 20, 2011 458 sgurung Main pdo class + * Sep 23, 2011 458 sgurung Converted to HDF5 + * Sep 29, 2011 sgurung Added reportType + * Oct 19, 2011 sgurung Set dataTime with correct valid period + * Oct 26, 2011 sgurung Added probable parameters (for + * TEMPO/PROB groups). Split change groups + * into hourly records. + * Nov 03, 2011 sgurung Added probable weather and method to + * calculate ceiling. + * Nov 04, 2011 sgurung Sort sky_cover before calculating + * ceiling. Change startRefTime to nearest + * hour to get hourly refTimes + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 08, 2013 1293 bkowal Removed references to hdffileid. * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -86,1531 +91,1552 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "nctaf", - indexes = { - @Index(name = "nctaf_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "nctaf", indexes = { @Index(name = "nctaf_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize @XmlAccessorType(XmlAccessType.NONE) @XmlRootElement public class NcTafRecord extends PluginDataObject implements ISpatialEnabled, - IDecoderGettable, IPointData, IPersistable { - - private static final long serialVersionUID = 1L; - - @DynamicSerializeElement - @XmlElement - @Column - private String wmoHeader; - - @DynamicSerializeElement - @XmlElement - // @Column(length = 1024) - @Transient - private String tafText; - - // The observation report type. - @DataURI(position = 1) - @Column - @XmlElement - @DynamicSerializeElement - private String reportType; - - @Embedded - @DataURI(position = 2, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; - - // Station Identifier for the data - @DynamicSerializeElement - @XmlElement - @Transient - // @Index(name = "nctaf_stationIndex") - private String stationId; - - @DynamicSerializeElement - @XmlElement - @Column - @DataURI(position = 3) - private String corIndicator; - - @DynamicSerializeElement - @XmlElement - @Column - @DataURI(position = 4) - private String amdIndicator; - - /** Issue date */ - @DynamicSerializeElement - @XmlElement - @Column - // @DataURI(position = 4) - private Date issue_time; - - /** Issue date string */ - @DynamicSerializeElement - @XmlElement - @Column - @DataURI(position = 5) - private String issue_timeString; - - /** Bulletin issuance time */ - @DynamicSerializeElement - @XmlElement - @Transient - private Date bulletin_time; - - /** Any remarks contained in the TAF record */ - @DynamicSerializeElement - @XmlElement - @Transient - private String remarks; - - /** A String containing the change group */ - @DynamicSerializeElement - @XmlElement - // @Column - @Transient - private String changeGroup; - - /** The period for which the TAF is valid */ - @DynamicSerializeElement - @XmlElement - @Embedded - @Transient - private NcTafPeriod tafChangePeriod; - - /** - * The forecast valid starting date - */ - @DynamicSerializeElement - @XmlElement - @Transient - private Calendar startDate; - - // This time is only used for BECMG groups. It marks the end time of the - // BECMG transition period. - @DynamicSerializeElement - @XmlElement - @Transient - private Calendar transitionEndDate; - - /** - * The forecast valid ending date - */ - @DynamicSerializeElement - @XmlElement - @Transient - private Calendar endDate; - - /** - * The sequence id is used to physically order a collection of ChangeGroups. - * This is required because the start times may be ambiguous i.e. A BECMG - * and TEMPO change group could share the same start time. - */ - @DynamicSerializeElement - @XmlElement - @Column - @DataURI(position = 6) - private Integer sequenceId; - - /** - * The change group indicator i.e. BECMG, FM, TEMPO, etc - */ - @DynamicSerializeElement - @XmlElement - @Column - @DataURI(position = 7) - private String change_indicator; - - /** - * The probability percentage for PROB and PROB TEMPO change groups. - */ - @DynamicSerializeElement - @XmlElement - @Transient - private Integer probability; - - /** Wind direction in degrees */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float wind_dir_degrees; - - /** Wind speed in knots */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float wind_speed_kt; - - /** Wind gust in knots */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float wind_gust_kt; - - /** Wind shear height above ground level */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float wind_shear_hgt_ft_agl; - - /** Wind shear direction in degrees */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float wind_shear_dir_degrees; - - /** Wind shear speed in knots */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float wind_shear_speed_kt; - - /** Visibility (horizontal) in miles */ - @DynamicSerializeElement - @XmlElement - @Column - private Float visibility_mi; - - /** Altimeter reading in inches of mercury */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float altim_in_hg; - - /** Vertical visibility */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float vert_vis_ft; - - /** Maximum temperature */ - @DynamicSerializeElement - @XmlElement - @Transient - private Integer max_temp_c; - - /** Minimum temperature */ - @DynamicSerializeElement - @XmlElement - @Transient - private Integer min_temp_c; - - /** Wind direction in degrees (TEMPO/PROB) */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float probable_wind_dir_degrees; - - /** Wind speed in knots (TEMPO/PROB) */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float probable_wind_speed_kt; - - /** Wind gust in knots (TEMPO/PROB) */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float probable_wind_gust_kt; - - /** Wind shear height above ground level (TEMPO/PROB) */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float probable_wind_shear_hgt_ft_agl; - - /** Wind shear direction in degrees (TEMPO/PROB) */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float probable_wind_shear_dir_degrees; - - /** Wind shear speed in knots (TEMPO/PROB) */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float probable_wind_shear_speed_kt; - - /** Visibility (horizontal) in miles (TEMPO/PROB) */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float probable_visibility_mi; - - /** Vertical visibility (TEMPO/PROB) */ - @DynamicSerializeElement - @XmlElement - @Transient - private Float probable_vert_vis_ft; - - /** - * The valid period for the TAF record. - */ - @DynamicSerializeElement - @XmlElement - private NcTafPeriod tafValidPeriod; - - /** - * Weather and obscurations - */ - @DynamicSerializeElement - @XmlElement - @Transient - private Set weather; - - /** - * (TEMPO/PROB) Weather and obscurations - */ - @DynamicSerializeElement - @XmlElement - @Transient - private Set probable_weather; - - /** Sky coverage */ - @DynamicSerializeElement - @XmlElement - @Transient - private Set sky_cover; - - /** (TEMPO/PROB) Sky coverage */ - @DynamicSerializeElement - @XmlElement - @Transient - private Set probable_sky_cover; - - /** The turbulence layers */ - @DynamicSerializeElement - @XmlElement - @Transient - private Set turbulence_layers; - - /** The icing layers */ - @DynamicSerializeElement - @XmlElement - @Transient - private Set icing_layers; - - /** The temperature forecasts */ - @DynamicSerializeElement - @XmlElement - @Transient - private Set temp_forecasts; - - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - // private Integer hdfFileId; - - public NcTafRecord() { - wmoHeader = " "; - tafText = " "; - reportType = "TAF"; - stationId = " "; - bulletin_time = null; - corIndicator = " "; - amdIndicator = " "; - issue_timeString = " "; - remarks = " "; - changeGroup = " "; - altim_in_hg = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - change_indicator = " "; - max_temp_c = IDecoderConstantsN.NEGATIVE_INTEGER_MISSING; - min_temp_c = IDecoderConstantsN.NEGATIVE_INTEGER_MISSING; - probability = IDecoderConstantsN.NEGATIVE_INTEGER_MISSING; - remarks = " "; - sequenceId = IDecoderConstantsN.NEGATIVE_INTEGER_MISSING; - vert_vis_ft = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - visibility_mi = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - wind_dir_degrees = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - wind_gust_kt = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - wind_speed_kt = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - wind_shear_hgt_ft_agl = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - wind_shear_dir_degrees = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - wind_shear_speed_kt = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - startDate = null; - endDate = null; - transitionEndDate = null; - location = null; - probable_vert_vis_ft = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - probable_visibility_mi = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - probable_wind_dir_degrees = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - probable_wind_gust_kt = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - probable_wind_speed_kt = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - probable_wind_shear_hgt_ft_agl = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - probable_wind_shear_dir_degrees = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - probable_wind_shear_speed_kt = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - } - - /** - * Constructs a taf record from a dataURI - * - * @param uri - * The dataURI - * @param tableDef - * The table definition associated with this class - */ - public NcTafRecord(String uri) { - super(uri); - } - - /** - * Get the WMO header for the enclosing WMO message. - * - * @return The wmoHeader. - */ - public String getWmoHeader() { - return wmoHeader; - } - - /** - * Set the WMO header for the enclosing WMO message. - * - * @param wmoHeader - * The WMOHeader to set. - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } - - /** - * Get the text of this terminal forecast. - * - * @return The terminal forecast text. - */ - public String getTafText() { - return tafText; - } - - /** - * Set the text of this terminal forecast. - * - * @param tafText - * The terminal forecast text. - */ - public void setTafText(String tafText) { - this.tafText = tafText; - } - - /** - * Get the observation report type. - * - * @return the reportType - */ - public String getReportType() { - return reportType; - } - - /** - * Set the observation report type. - * - * @param reportType - * the reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } - - /** - * - * @return - */ - public String getStationId() { - return stationId; - } - - /** - * - * @param stationID - */ - public void setStationId(String stationID) { - stationId = stationID; - } - - /** - * - * @return the corIndicator - */ - public String getCorIndicator() { - return corIndicator; - } - - /** - * - * @param corIndicator - * the corIndicator to set - */ - public void setCorIndicator(String corIndicator) { - this.corIndicator = corIndicator; - } - - /** - * - * @return the amdIndicator - */ - public String getAmdIndicator() { - return amdIndicator; - } - - /** - * - * @param amdIndicator - * the amdIndicator to set - */ - public void setAmdIndicator(String amdIndicator) { - this.amdIndicator = amdIndicator; - } - - /** - * - * @return the bulletin_time - */ - public Date getBulletin_time() { - return bulletin_time; - } - - /** - * - * @param bulletin_time - * the bulletin_time to set - */ - public void setBulletin_time(Date bulletin_time) { - this.bulletin_time = bulletin_time; - } - - /** - * @return the issue_time - */ - public Date getIssue_time() { - return issue_time; - } - - /** - * @param issue_time - * the issue_time to set - */ - public void setIssue_time(Date issue_time) { - this.issue_time = issue_time; - } - - /** - * @return the issue_timeString - */ - public String getIssue_timeString() { - return issue_timeString; - } - - /** - * @param issue_timeString - * the issue_time to set - */ - public void setIssue_timeString(String issue_timeString) { - this.issue_timeString = issue_timeString; - } - - @Override - public void setIdentifier(Object dataURI) { - - this.identifier = dataURI; - - } - - /** - * Get the IDecoderGettable reference for this record. - * - * @return The IDecoderGettable reference for this record. Null for this - * class. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } - - public SurfaceObsLocation getLocation() { - return location; - } - - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } - - public double getLatitude() { - return location.getLatitude(); - } - - public double getLongitude() { - return location.getLongitude(); - } - - public Integer getElevation() { - return location.getElevation(); - } - - /** - * Returns the hashCode for this object. This implementation returns the - * hashCode of the generated dataURI. - * - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result - + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); - return result; - } - - /** - * Checks if this record is equal to another by checking the generated - * dataURI. - * - * @param obj - * @see java.lang.Object#equals(java.lang.Object) - */ - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - NcTafRecord other = (NcTafRecord) obj; - if (getDataURI() == null) { - if (other.getDataURI() != null) { - return false; - } - } else if (!getDataURI().equals(other.getDataURI())) - return false; - return true; - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() - */ - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon - * .uf.common.pointdata.PointDataView) - */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } - - /** - * Get the time to use for persisting this data. - * - * @return The persistence time for this data. - */ - @Override - public Date getPersistenceTime() { - if (getInsertTime() == null) - return null; - else - return getInsertTime().getTime(); - } - - /** - * Set the time to be used for the persistence time for this object. - * - * @param persistTime - * The persistence time to be used. - */ - @Override - public void setPersistenceTime(Date persistTime) { - Calendar insertTime = Calendar.getInstance(); - insertTime.setTime(persistTime); - setInsertTime(insertTime); - } - - @Override - public Amount getValue(String paramName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Collection getValues(String paramName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getString(String paramName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String[] getStrings(String paramName) { - // TODO Auto-generated method stub - return null; - } - - /** - * - * @return The string containing the change group text - */ - public String getChangeGroup() { - return this.changeGroup; - } - - public void setChangeGroup(String changeGroup) { - this.changeGroup = changeGroup; - } - - public NcTafPeriod getTafChangePeriod() { - return tafChangePeriod; - } - - public void setTafChangePeriod(NcTafPeriod tafChangePeriod) { - this.tafChangePeriod = tafChangePeriod; - } - - public Float getWind_dir_degrees() { - return wind_dir_degrees; - } - - public void setWind_dir_degrees(Float wind_dir_degrees) { - this.wind_dir_degrees = wind_dir_degrees; - } - - public Float getWind_speed_kt() { - return wind_speed_kt; - } - - public void setWind_speed_kt(Float wind_speed_kt) { - this.wind_speed_kt = wind_speed_kt; - } - - public Float getWind_gust_kt() { - return wind_gust_kt; - } - - public void setWind_gust_kt(Float wind_gust_kt) { - this.wind_gust_kt = wind_gust_kt; - } - - public Float getWind_shear_hgt_ft_agl() { - return wind_shear_hgt_ft_agl; - } - - public void setWind_shear_hgt_ft_agl(Float wind_shear_hgt_ft_agl) { - this.wind_shear_hgt_ft_agl = wind_shear_hgt_ft_agl; - } - - public Float getWind_shear_dir_degrees() { - return wind_shear_dir_degrees; - } - - public void setWind_shear_dir_degrees(Float wind_shear_dir_degrees) { - this.wind_shear_dir_degrees = wind_shear_dir_degrees; - } - - public Float getWind_shear_speed_kt() { - return wind_shear_speed_kt; - } - - public void setWind_shear_speed_kt(Float wind_shear_speed_kt) { - this.wind_shear_speed_kt = wind_shear_speed_kt; - } - - public Float getVisibility_mi() { - return visibility_mi; - } - - public void setVisibility_mi(Float visibility_mi) { - this.visibility_mi = visibility_mi; - } - - public float getAltim_in_hg() { - return altim_in_hg; - } - - public void setAltim_in_hg(float altim_in_hg) { - this.altim_in_hg = altim_in_hg; - } - - public float getVert_vis_ft() { - return probable_vert_vis_ft; - } - - public void setVert_vis_ft(float vert_vis_ft) { - this.probable_vert_vis_ft = vert_vis_ft; - } - - public float getProbable_wind_dir_degrees() { - return probable_wind_dir_degrees; - } - - public void setProbable_wind_dir_degrees(float wind_dir_degrees) { - this.probable_wind_dir_degrees = wind_dir_degrees; - } - - public float getProbable_wind_speed_kt() { - return probable_wind_speed_kt; - } - - public void setProbable_wind_speed_kt(float wind_speed_kt) { - this.probable_wind_speed_kt = wind_speed_kt; - } - - public float getProbable_wind_gust_kt() { - return probable_wind_gust_kt; - } - - public void setProbable_wind_gust_kt(float wind_gust_kt) { - this.probable_wind_gust_kt = wind_gust_kt; - } - - public float getProbable_wind_shear_hgt_ft_agl() { - return probable_wind_shear_hgt_ft_agl; - } - - public void setProbable_wind_shear_hgt_ft_agl(float wind_shear_hgt_ft_agl) { - this.probable_wind_shear_hgt_ft_agl = wind_shear_hgt_ft_agl; - } - - public float getProbable_wind_shear_dir_degrees() { - return probable_wind_shear_dir_degrees; - } - - public void setProbable_wind_shear_dir_degrees(float wind_shear_dir_degrees) { - this.probable_wind_shear_dir_degrees = wind_shear_dir_degrees; - } - - public float getProbable_wind_shear_speed_kt() { - return probable_wind_shear_speed_kt; - } - - public void setProbable_wind_shear_speed_kt(float wind_shear_speed_kt) { - this.probable_wind_shear_speed_kt = wind_shear_speed_kt; - } - - public float getProbable_visibility_mi() { - return probable_visibility_mi; - } - - public void setProbable_visibility_mi(float visibility_mi) { - this.probable_visibility_mi = visibility_mi; - } - - public float getProbable_vert_vis_ft() { - return probable_vert_vis_ft; - } - - public void setProbable_vert_vis_ft(float vert_vis_ft) { - this.probable_vert_vis_ft = vert_vis_ft; - } - - public Integer getMax_temp_c() { - return max_temp_c; - } - - public void setMax_temp_c(Integer max_temp_c) { - this.max_temp_c = max_temp_c; - } - - public Integer getMin_temp_c() { - return min_temp_c; - } - - public void setMin_temp_c(Integer min_temp_c) { - this.min_temp_c = min_temp_c; - } - - public Integer getProbability() { - return probability; - } - - public void setProbability(Integer probability) { - this.probability = probability; - } - - /** - * @return the sequenceId - */ - public Integer getSequenceId() { - return sequenceId; - } - - /** - * @param sequenceId - * the sequenceId to set - */ - public void setSequenceId(Integer sequenceId) { - this.sequenceId = sequenceId; - } - - /** - * @return the remarks - */ - public String getRemarks() { - return remarks; - } - - /** - * @param remarks - * the remarks to set - */ - public void setRemarks(String remarks) { - this.remarks = remarks; - } - - public String getChange_indicator() { - return change_indicator; - } - - public void setChange_indicator(String change_indicator) { - this.change_indicator = change_indicator; - } - - public NcTafPeriod getTafValidPeriod() { - return tafValidPeriod; - } - - public void setTafValidPeriod(NcTafPeriod tafValidPeriod) { - this.tafValidPeriod = tafValidPeriod; - } - - public Set getTurbulence_layers() { - return turbulence_layers; - } - - public void setTurbulence_layers(Set turbulence_layers) { - this.turbulence_layers = turbulence_layers; - } - - /** - * @param add - * taf turbulence layer to set - */ - public void addTurbulence_layer(NcTafTurbulenceLayer turb) { - turbulence_layers.add(turb); - } - - public Set getIcing_layers() { - return icing_layers; - } - - public void setIcing_layers(Set icing_layers) { - this.icing_layers = icing_layers; - } - - /** - * @param add - * taf icing layer to set - */ - public void addIcing_layer(NcTafIcingLayer icng) { - icing_layers.add(icng); - } - - public Set getTemp_forecasts() { - return temp_forecasts; - } - - public void setTemp_forecasts(Set temp_forecasts) { - this.temp_forecasts = temp_forecasts; - } - - /** - * @param add - * taf temp forecast to set - */ - public void addTemp_forecast(NcTafTemperatureForecast tempFcst) { - temp_forecasts.add(tempFcst); - } - - public Set getWeather() { - return weather; - } - - public void setWeather(Set weather) { - this.weather = weather; - } - - /** - * @param add - * taf weather condition to set - */ - public void addWeather(NcTafWeatherCondition wthrCond) { - weather.add(wthrCond); - } - - public Set getProbable_weather() { - return probable_weather; - } - - public void setProbable_weather(Set weather) { - this.probable_weather = weather; - } - - /** - * @param add - * probable taf weather condition to set - */ - public void addProbable_weather(NcTafWeatherCondition wthrCond) { - probable_weather.add(wthrCond); - } - - public Set getSky_cover() { - return sky_cover; - } - - public void setSky_cover(Set sky_cover) { - this.sky_cover = sky_cover; - } - - /** - * @param add - * taf sky cover to set - */ - public void addSky_cover(NcTafSkyCover skyCvr) { - sky_cover.add(skyCvr); - } - - /** - * @param add - * probable taf sky cover to set - */ - public void addProbable_sky_cover(NcTafSkyCover skyCvr) { - probable_sky_cover.add(skyCvr); - } - - public Set getProbable_sky_cover() { - return probable_sky_cover; - } - - public void setProbable_sky_cover(Set sky_cover) { - this.probable_sky_cover = sky_cover; - } - - /** - * @return the theStartDate - */ - public Calendar getStartDate() { - return startDate; - } - - /** - * @param theStartDate - * the theStartDate to set - */ - public void setStartDate(Calendar start) { - startDate = start; - } - - /** - * @return the transitionEndDate - */ - public Calendar getTransitionEndDate() { - return transitionEndDate; - } - - /** - * @param transitionEndDate - * the transitionEndDate to set - */ - public void setTransitionEndDate(Calendar transitionEndDate) { - this.transitionEndDate = transitionEndDate; - } - - /** - * @return the theEndDate - */ - public Calendar getEndDate() { - return endDate; - } - - /** - * @param theEndDate - * the theEndDate to set - */ - public void setEndDate(Calendar end) { - endDate = end; - } - - public static String formatDate(Calendar dateTime) { - return String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", dateTime); - } - - /** - * This method determines the ceiling value of a TAF. - */ - public static float getCeiling(Set skyCov, float vertVis) { - - // If a vertical visibility has been reported, the sky is obscured - // and the vertical visibility becomes the ceiling. - if (vertVis >= 0 && vertVis < 1e20f) { - return vertVis; - } else { - // Otherwise, determine the ceiling value. - return findTafCeilingFromLayers(sortSkyCover(skyCov)); - } - } - - public static Set sortSkyCover(Set skySet) { - if (skySet != null) { - SortedSet skSet = new TreeSet(); - for (NcTafSkyCover sc : skySet) { - skSet.add(sc); - } - return skSet; - } else { - return new HashSet(); - } - } - - /** - * This method calculates a floating point number representing the ceiling. - * By definition, the ceiling is the lowest overcast or broken cloud layer, - * so the method looks for the lowest layer that matches a BKN or OVC - * condition, and returns that layer. - * - * @param skyCov - * -- the set of sky coverage data - * @return -- the ceiling - */ - public static float findTafCeilingFromLayers(Set skyCov) { - float ceiling = 1e20f; - // Find a ceiling in a TAF report. - try { - for (NcTafSkyCover sc : skyCov) { - if (sc.getType().equals("CLR") || sc.getType().equals("SKC")) { - ceiling = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; - break; - } else if ((sc.getType().equals("BKN")) - || (sc.getType().equals("OVC"))) { - if (sc.getHeight() != null) { - ceiling = sc.getHeight(); - break; - } - } - - } - } catch (RuntimeException e) { - // ignore cloud cover that is null - } - return ceiling >= 1e20f ? IDecoderConstantsN.NEGATIVE_FLOAT_MISSING - : ceiling; - } - - /** - * Constructs an array of NcTafRecord PDOs given one or more bulletin - * records. (The bulletin records each contain data from a whole bulletin, - * while each NcTafRecord is more fine-grained -- representing the values - * for a single NcTafChangeGroup of the entire bulletin [NcTafBulletin]). We - * do this "reshuffle" because the - * NcTafBulletin/NcTafChangeGroup/NcTafSkyCover (same for - * NcTafTemperatureForecase, NcTafTurbulenceLayer, NcTafSkyCover, - * NcTafWeatherCondition) hierarchy efficiently represents the original - * structure as parsed from the text, but we want the persistent PDO - * (NcTafRecord) to be optimized for efficient access. - * - * @param bulletin - * the bulletin record to split - * @return NcTafRecord[] the array of NcTafRecord PDOs - */ - public static NcTafRecord[] split(NcTafBulletinRecord bulletin) { - List records = new ArrayList(); - if (bulletin.getChangeGroups() != null) { - Iterator chgGrps = bulletin.getChangeGroups() - .iterator(); - if (chgGrps != null) { - while (chgGrps.hasNext()) { - - NcTafRecord tfr = new NcTafRecord(); - - NcTafChangeGroup chgGrp = chgGrps.next(); - - tfr.setPersistenceTime(new Date()); - - NcTafPeriod validPeriod = chgGrp.getTafChangePeriod(); - Calendar cStart = TimeTools - .copy(validPeriod.getStartDate()); - - TimeRange range = new TimeRange(cStart, - validPeriod.getEndDate()); - DataTime tafPeriod = new DataTime(cStart, range); - - tfr.setDataTime(tafPeriod); - - if (bulletin.getTafValidPeriod() != null) - tfr.setTafValidPeriod(bulletin.getTafValidPeriod()); - - if (chgGrp.getTafChangePeriod() != null) - tfr.setTafChangePeriod(chgGrp.getTafChangePeriod()); - - if (chgGrp.getTafChangePeriod().getEndDate() != null) - tfr.setEndDate(chgGrp.getTafChangePeriod().getEndDate()); - - if (chgGrp.getTafChangePeriod().getStartDate() != null) - tfr.setStartDate(chgGrp.getTafChangePeriod() - .getStartDate()); - - if (chgGrp.getTafChangePeriod().getTransitionEndDate() != null) - tfr.setTransitionEndDate(chgGrp.getTafChangePeriod() - .getTransitionEndDate()); - - if (bulletin.getWmoHeader() != null) - tfr.setWmoHeader(bulletin.getWmoHeader()); - - if (bulletin.getTafText() != null) - tfr.setTafText(bulletin.getTafText()); - - if (bulletin.getReportType() != null) - tfr.setReportType(bulletin.getReportType()); - - if (bulletin.getStationId() != null) - tfr.setStationId(bulletin.getStationId()); - - if (bulletin.getCorIndicator() != null) { - tfr.setCorIndicator(bulletin.getCorIndicator()); - } else { - tfr.setCorIndicator(""); - } - - if (bulletin.getAmdIndicator() != null) { - tfr.setAmdIndicator(bulletin.getAmdIndicator()); - } else { - tfr.setAmdIndicator(""); - } - - if (bulletin.getIssue_time() != null) - tfr.setIssue_time(bulletin.getIssue_time()); - - if (bulletin.getIssue_timeString() != null) - tfr.setIssue_timeString(bulletin.getIssue_timeString()); - - if (bulletin.getBulletin_time() != null) - tfr.setBulletin_time(bulletin.getBulletin_time()); - - if (bulletin.getLocation() != null) - tfr.setLocation(bulletin.getLocation()); - - if (chgGrp.getChange_indicator() != null) - tfr.setChange_indicator(chgGrp.getChange_indicator()); - - if (chgGrp.getChangeGroup() != null) - tfr.setChangeGroup(chgGrp.getChangeGroup()); - - if (chgGrp.getProbability() != null) - tfr.setProbability(chgGrp.getProbability()); - - if (chgGrp.getMax_temp_c() != null) - tfr.setMax_temp_c(chgGrp.getMax_temp_c()); - - if (chgGrp.getMin_temp_c() != null) - tfr.setMin_temp_c(chgGrp.getMin_temp_c()); - - if (chgGrp.getAltim_in_hg() != null - && (chgGrp.getAltim_in_hg().trim().length() > 0)) { - tfr.setAltim_in_hg(Float.parseFloat(chgGrp - .getAltim_in_hg())); - } else { - tfr.setAltim_in_hg(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getRemarks() != null) - tfr.setRemarks(chgGrp.getRemarks()); - - if (chgGrp.getSequenceId() != null) - tfr.setSequenceId(chgGrp.getSequenceId()); - - VisibilityParser parser = new VisibilityParser(); - if (chgGrp.getVisibility_mi() != null - && parser.decode(chgGrp.getVisibility_mi() + "SM")) { - float val = (float) parser.getPrevail_vsbySM(); - tfr.setVisibility_mi(val); - } else { - tfr.setVisibility_mi(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getVert_vis_ft() != null - && (chgGrp.getVert_vis_ft().trim().length() > 0)) { - tfr.setVert_vis_ft(Float.parseFloat(chgGrp - .getVert_vis_ft())); - } else { - tfr.setVert_vis_ft(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getWind_dir_degrees() != null - && !chgGrp.getWind_dir_degrees().equalsIgnoreCase( - "VRB")) { - tfr.setWind_dir_degrees(Float.parseFloat(chgGrp - .getWind_dir_degrees())); - } else { - tfr.setWind_dir_degrees(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getWind_gust_kt() != null) { - tfr.setWind_gust_kt(new Float(chgGrp.getWind_gust_kt())); - } else { - tfr.setWind_gust_kt(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getWind_speed_kt() != null) { - tfr.setWind_speed_kt(new Float(chgGrp - .getWind_speed_kt())); - } else { - tfr.setWind_speed_kt(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getWind_shear_dir_degrees() != null) { - tfr.setWind_shear_dir_degrees(new Float(chgGrp - .getWind_shear_dir_degrees())); - } else { - tfr.setWind_shear_dir_degrees(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getWind_shear_speed_kt() != null) { - tfr.setWind_shear_speed_kt(new Float(chgGrp - .getWind_shear_speed_kt())); - } else { - tfr.setWind_shear_speed_kt(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getWind_shear_hgt_ft_agl() != null) { - tfr.setWind_shear_hgt_ft_agl(new Float(chgGrp - .getWind_shear_hgt_ft_agl())); - } else { - tfr.setWind_shear_hgt_ft_agl(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getProbable_visibility_mi() != null - && parser.decode(chgGrp.getProbable_visibility_mi() - + "SM")) { - float val = (float) parser.getPrevail_vsbySM(); - tfr.setProbable_visibility_mi(val); - } else { - tfr.setProbable_visibility_mi(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getProbable_vert_vis_ft() != null - && (chgGrp.getProbable_vert_vis_ft().trim() - .length() > 0)) { - tfr.setProbable_vert_vis_ft(Float.parseFloat(chgGrp - .getProbable_vert_vis_ft())); - } else { - tfr.setProbable_vert_vis_ft(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getProbable_wind_dir_degrees() != null - && !chgGrp.getProbable_wind_dir_degrees() - .equalsIgnoreCase("VRB")) { - tfr.setProbable_wind_dir_degrees(Float - .parseFloat(chgGrp - .getProbable_wind_dir_degrees())); - } else { - tfr.setProbable_wind_dir_degrees(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getProbable_wind_gust_kt() != null) { - tfr.setProbable_wind_gust_kt(new Float(chgGrp - .getProbable_wind_gust_kt())); - } else { - tfr.setProbable_wind_gust_kt(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getProbable_wind_speed_kt() != null) { - tfr.setProbable_wind_speed_kt(new Float(chgGrp - .getProbable_wind_speed_kt())); - } else { - tfr.setProbable_wind_speed_kt(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getProbable_wind_shear_dir_degrees() != null) { - tfr.setProbable_wind_speed_kt(new Float(chgGrp - .getProbable_wind_shear_dir_degrees())); - } else { - tfr.setWind_shear_dir_degrees(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getProbable_wind_shear_speed_kt() != null) { - tfr.setWind_shear_speed_kt(new Float(chgGrp - .getProbable_wind_shear_speed_kt())); - } else { - tfr.setWind_shear_speed_kt(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getProbable_wind_shear_hgt_ft_agl() != null) { - tfr.setProbable_wind_shear_hgt_ft_agl(new Float(chgGrp - .getProbable_wind_shear_hgt_ft_agl())); - } else { - tfr.setProbable_wind_shear_hgt_ft_agl(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); - } - - if (chgGrp.getIcing_layers() != null) { - tfr.setIcing_layers(chgGrp.getIcing_layers()); - } - - if (chgGrp.getSky_cover() != null) { - tfr.setSky_cover(chgGrp.getSky_cover()); - } - - if (chgGrp.getProbable_sky_cover() != null) { - tfr.setProbable_sky_cover(chgGrp - .getProbable_sky_cover()); - } - - if (chgGrp.getTemp_forecasts() != null) { - tfr.setTemp_forecasts(chgGrp.getTemp_forecasts()); - } - - if (chgGrp.getTurbulence_layers() != null) { - tfr.setTurbulence_layers(chgGrp.getTurbulence_layers()); - } - - if (chgGrp.getWeather() != null) { - tfr.setWeather(chgGrp.getWeather()); - } - - records.add(tfr); - } - - } - } - - List hourlyRecords = splitToHourlyRecords(records); - - return hourlyRecords.toArray(new NcTafRecord[0]); - } - - public static List splitToHourlyRecords( - List records) { - List newRecords = new ArrayList(); - int recordsSize = (records != null) ? records.size() : 0; - - if (recordsSize > 0) { - - for (int i = 0; i < recordsSize; i++) { - - NcTafRecord record = records.get(i); - - Calendar startRefTime = record.getStartDate(); - Calendar endRefTime = record.getEndDate(); - - // add 1 minute so that 12:30 becomes 12:31 and hence is rounded - // to 13:00 and not 12:00 - startRefTime.add(Calendar.MINUTE, 1); - Date nearestHour = DateUtils.round(startRefTime.getTime(), - Calendar.HOUR); - startRefTime.setTime(nearestHour); - - nearestHour = DateUtils.round(endRefTime.getTime(), - Calendar.HOUR); - endRefTime.setTime(nearestHour); - - long milliseconds1 = startRefTime.getTimeInMillis(); - long milliseconds2 = endRefTime.getTimeInMillis(); - long diff = milliseconds2 - milliseconds1; - long diffHours = diff / (60 * 60 * 1000); - - for (int hour = 0; hour < diffHours; hour++) { - - NcTafRecord tfr = new NcTafRecord(); - - tfr.setPersistenceTime(new Date()); - tfr.setDataTime(new DataTime(startRefTime)); - tfr.setTafValidPeriod(record.getTafValidPeriod()); - tfr.setTafChangePeriod(record.getTafChangePeriod()); - tfr.setEndDate(record.getTafChangePeriod().getEndDate()); - tfr.setStartDate(record.getTafChangePeriod().getStartDate()); - tfr.setTransitionEndDate(record.getTafChangePeriod() - .getTransitionEndDate()); - tfr.setWmoHeader(record.getWmoHeader()); - if (record.getTafText() != null - && record.getTafText().length() > 1024) { - tfr.setTafText(record.getTafText().substring(0, 1024)); - } else { - tfr.setTafText(record.getTafText()); - } - tfr.setTafText(record.getTafText()); - tfr.setReportType(record.getReportType()); - tfr.setStationId(record.getStationId()); - tfr.setCorIndicator(record.getCorIndicator()); - tfr.setAmdIndicator(record.getAmdIndicator()); - tfr.setIssue_time(record.getIssue_time()); - tfr.setIssue_timeString(record.getIssue_timeString()); - tfr.setBulletin_time(record.getBulletin_time()); - tfr.setLocation(record.getLocation()); - tfr.setChange_indicator(record.getChange_indicator()); - if (record.getChangeGroup() != null - && record.getChangeGroup().length() > 128) { - tfr.setChangeGroup(record.getChangeGroup().substring(0, - 128)); - } else { - tfr.setChangeGroup(record.getChangeGroup()); - } - tfr.setChangeGroup(record.getChangeGroup()); - tfr.setProbability(record.getProbability()); - tfr.setMax_temp_c(record.getMax_temp_c()); - tfr.setMin_temp_c(record.getMin_temp_c()); - tfr.setAltim_in_hg(record.getAltim_in_hg()); - tfr.setRemarks(record.getRemarks()); - tfr.setSequenceId(record.getSequenceId()); - tfr.setVisibility_mi(record.getVisibility_mi()); - tfr.setVert_vis_ft(record.getVert_vis_ft()); - tfr.setWind_dir_degrees(record.getWind_dir_degrees()); - tfr.setWind_gust_kt(record.getWind_gust_kt()); - tfr.setWind_speed_kt(record.getWind_speed_kt()); - tfr.setWind_shear_dir_degrees(record - .getWind_shear_dir_degrees()); - tfr.setWind_shear_speed_kt(record.getWind_shear_speed_kt()); - tfr.setWind_shear_hgt_ft_agl(record - .getWind_shear_hgt_ft_agl()); - tfr.setProbable_visibility_mi(record - .getProbable_visibility_mi()); - tfr.setProbable_vert_vis_ft(record - .getProbable_vert_vis_ft()); - tfr.setProbable_wind_dir_degrees(record - .getProbable_wind_dir_degrees()); - tfr.setProbable_wind_gust_kt(record - .getProbable_wind_gust_kt()); - tfr.setProbable_wind_speed_kt(record - .getProbable_wind_speed_kt()); - tfr.setWind_shear_dir_degrees(record - .getProbable_wind_shear_dir_degrees()); - tfr.setWind_shear_speed_kt(record - .getProbable_wind_shear_speed_kt()); - tfr.setProbable_wind_shear_hgt_ft_agl(record - .getProbable_wind_shear_hgt_ft_agl()); - tfr.setIcing_layers(record.getIcing_layers()); - tfr.setSky_cover(record.getSky_cover()); - tfr.setProbable_sky_cover(record.getProbable_sky_cover()); - tfr.setTemp_forecasts(record.getTemp_forecasts()); - tfr.setTurbulence_layers(record.getTurbulence_layers()); - tfr.setWeather(record.getWeather()); - tfr.setProbable_weather(record.getWeather()); - newRecords.add(tfr); - startRefTime.add(Calendar.HOUR_OF_DAY, 1); - } - } - } - - return newRecords; - } + IDecoderGettable, IPointData, IPersistable { + + private static final long serialVersionUID = 1L; + + @DynamicSerializeElement + @XmlElement + @Column + private String wmoHeader; + + @DynamicSerializeElement + @XmlElement + // @Column(length = 1024) + @Transient + private String tafText; + + // The observation report type. + @DataURI(position = 1) + @Column + @XmlElement + @DynamicSerializeElement + private String reportType; + + @Embedded + @DataURI(position = 2, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; + + // Station Identifier for the data + @DynamicSerializeElement + @XmlElement + @Transient + // @Index(name = "nctaf_stationIndex") + private String stationId; + + @DynamicSerializeElement + @XmlElement + @Column + @DataURI(position = 3) + private String corIndicator; + + @DynamicSerializeElement + @XmlElement + @Column + @DataURI(position = 4) + private String amdIndicator; + + /** Issue date */ + @DynamicSerializeElement + @XmlElement + @Column + // @DataURI(position = 4) + private Date issue_time; + + /** Issue date string */ + @DynamicSerializeElement + @XmlElement + @Column + @DataURI(position = 5) + private String issue_timeString; + + /** Bulletin issuance time */ + @DynamicSerializeElement + @XmlElement + @Transient + private Date bulletin_time; + + /** Any remarks contained in the TAF record */ + @DynamicSerializeElement + @XmlElement + @Transient + private String remarks; + + /** A String containing the change group */ + @DynamicSerializeElement + @XmlElement + // @Column + @Transient + private String changeGroup; + + /** The period for which the TAF is valid */ + @DynamicSerializeElement + @XmlElement + @Embedded + @Transient + private NcTafPeriod tafChangePeriod; + + /** + * The forecast valid starting date + */ + @DynamicSerializeElement + @XmlElement + @Transient + private Calendar startDate; + + // This time is only used for BECMG groups. It marks the end time of the + // BECMG transition period. + @DynamicSerializeElement + @XmlElement + @Transient + private Calendar transitionEndDate; + + /** + * The forecast valid ending date + */ + @DynamicSerializeElement + @XmlElement + @Transient + private Calendar endDate; + + /** + * The sequence id is used to physically order a collection of ChangeGroups. + * This is required because the start times may be ambiguous i.e. A BECMG + * and TEMPO change group could share the same start time. + */ + @DynamicSerializeElement + @XmlElement + @Column + @DataURI(position = 6) + private Integer sequenceId; + + /** + * The change group indicator i.e. BECMG, FM, TEMPO, etc + */ + @DynamicSerializeElement + @XmlElement + @Column + @DataURI(position = 7) + private String change_indicator; + + /** + * The probability percentage for PROB and PROB TEMPO change groups. + */ + @DynamicSerializeElement + @XmlElement + @Transient + private Integer probability; + + /** Wind direction in degrees */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float wind_dir_degrees; + + /** Wind speed in knots */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float wind_speed_kt; + + /** Wind gust in knots */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float wind_gust_kt; + + /** Wind shear height above ground level */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float wind_shear_hgt_ft_agl; + + /** Wind shear direction in degrees */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float wind_shear_dir_degrees; + + /** Wind shear speed in knots */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float wind_shear_speed_kt; + + /** Visibility (horizontal) in miles */ + @DynamicSerializeElement + @XmlElement + @Column + private Float visibility_mi; + + /** Altimeter reading in inches of mercury */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float altim_in_hg; + + /** Vertical visibility */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float vert_vis_ft; + + /** Maximum temperature */ + @DynamicSerializeElement + @XmlElement + @Transient + private Integer max_temp_c; + + /** Minimum temperature */ + @DynamicSerializeElement + @XmlElement + @Transient + private Integer min_temp_c; + + /** Wind direction in degrees (TEMPO/PROB) */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float probable_wind_dir_degrees; + + /** Wind speed in knots (TEMPO/PROB) */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float probable_wind_speed_kt; + + /** Wind gust in knots (TEMPO/PROB) */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float probable_wind_gust_kt; + + /** Wind shear height above ground level (TEMPO/PROB) */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float probable_wind_shear_hgt_ft_agl; + + /** Wind shear direction in degrees (TEMPO/PROB) */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float probable_wind_shear_dir_degrees; + + /** Wind shear speed in knots (TEMPO/PROB) */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float probable_wind_shear_speed_kt; + + /** Visibility (horizontal) in miles (TEMPO/PROB) */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float probable_visibility_mi; + + /** Vertical visibility (TEMPO/PROB) */ + @DynamicSerializeElement + @XmlElement + @Transient + private Float probable_vert_vis_ft; + + /** + * The valid period for the TAF record. + */ + @DynamicSerializeElement + @XmlElement + private NcTafPeriod tafValidPeriod; + + /** + * Weather and obscurations + */ + @DynamicSerializeElement + @XmlElement + @Transient + private Set weather; + + /** + * (TEMPO/PROB) Weather and obscurations + */ + @DynamicSerializeElement + @XmlElement + @Transient + private Set probable_weather; + + /** Sky coverage */ + @DynamicSerializeElement + @XmlElement + @Transient + private Set sky_cover; + + /** (TEMPO/PROB) Sky coverage */ + @DynamicSerializeElement + @XmlElement + @Transient + private Set probable_sky_cover; + + /** The turbulence layers */ + @DynamicSerializeElement + @XmlElement + @Transient + private Set turbulence_layers; + + /** The icing layers */ + @DynamicSerializeElement + @XmlElement + @Transient + private Set icing_layers; + + /** The temperature forecasts */ + @DynamicSerializeElement + @XmlElement + @Transient + private Set temp_forecasts; + + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; + + // private Integer hdfFileId; + + public NcTafRecord() { + wmoHeader = " "; + tafText = " "; + reportType = "TAF"; + stationId = " "; + bulletin_time = null; + corIndicator = " "; + amdIndicator = " "; + issue_timeString = " "; + remarks = " "; + changeGroup = " "; + altim_in_hg = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + change_indicator = " "; + max_temp_c = IDecoderConstantsN.NEGATIVE_INTEGER_MISSING; + min_temp_c = IDecoderConstantsN.NEGATIVE_INTEGER_MISSING; + probability = IDecoderConstantsN.NEGATIVE_INTEGER_MISSING; + remarks = " "; + sequenceId = IDecoderConstantsN.NEGATIVE_INTEGER_MISSING; + vert_vis_ft = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + visibility_mi = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + wind_dir_degrees = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + wind_gust_kt = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + wind_speed_kt = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + wind_shear_hgt_ft_agl = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + wind_shear_dir_degrees = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + wind_shear_speed_kt = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + startDate = null; + endDate = null; + transitionEndDate = null; + location = null; + probable_vert_vis_ft = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + probable_visibility_mi = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + probable_wind_dir_degrees = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + probable_wind_gust_kt = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + probable_wind_speed_kt = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + probable_wind_shear_hgt_ft_agl = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + probable_wind_shear_dir_degrees = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + probable_wind_shear_speed_kt = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + } + + /** + * Constructs a taf record from a dataURI + * + * @param uri + * The dataURI + * @param tableDef + * The table definition associated with this class + */ + public NcTafRecord(String uri) { + super(uri); + } + + /** + * Get the WMO header for the enclosing WMO message. + * + * @return The wmoHeader. + */ + public String getWmoHeader() { + return wmoHeader; + } + + /** + * Set the WMO header for the enclosing WMO message. + * + * @param wmoHeader + * The WMOHeader to set. + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } + + /** + * Get the text of this terminal forecast. + * + * @return The terminal forecast text. + */ + public String getTafText() { + return tafText; + } + + /** + * Set the text of this terminal forecast. + * + * @param tafText + * The terminal forecast text. + */ + public void setTafText(String tafText) { + this.tafText = tafText; + } + + /** + * Get the observation report type. + * + * @return the reportType + */ + public String getReportType() { + return reportType; + } + + /** + * Set the observation report type. + * + * @param reportType + * the reportType to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } + + /** + * + * @return + */ + public String getStationId() { + return stationId; + } + + /** + * + * @param stationID + */ + public void setStationId(String stationID) { + stationId = stationID; + } + + /** + * + * @return the corIndicator + */ + public String getCorIndicator() { + return corIndicator; + } + + /** + * + * @param corIndicator + * the corIndicator to set + */ + public void setCorIndicator(String corIndicator) { + this.corIndicator = corIndicator; + } + + /** + * + * @return the amdIndicator + */ + public String getAmdIndicator() { + return amdIndicator; + } + + /** + * + * @param amdIndicator + * the amdIndicator to set + */ + public void setAmdIndicator(String amdIndicator) { + this.amdIndicator = amdIndicator; + } + + /** + * + * @return the bulletin_time + */ + public Date getBulletin_time() { + return bulletin_time; + } + + /** + * + * @param bulletin_time + * the bulletin_time to set + */ + public void setBulletin_time(Date bulletin_time) { + this.bulletin_time = bulletin_time; + } + + /** + * @return the issue_time + */ + public Date getIssue_time() { + return issue_time; + } + + /** + * @param issue_time + * the issue_time to set + */ + public void setIssue_time(Date issue_time) { + this.issue_time = issue_time; + } + + /** + * @return the issue_timeString + */ + public String getIssue_timeString() { + return issue_timeString; + } + + /** + * @param issue_timeString + * the issue_time to set + */ + public void setIssue_timeString(String issue_timeString) { + this.issue_timeString = issue_timeString; + } + + @Override + public void setIdentifier(Object dataURI) { + + this.identifier = dataURI; + + } + + /** + * Get the IDecoderGettable reference for this record. + * + * @return The IDecoderGettable reference for this record. Null for this + * class. + */ + @Override + public IDecoderGettable getDecoderGettable() { + return null; + } + + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } + + public SurfaceObsLocation getLocation() { + return location; + } + + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } + + public double getLatitude() { + return location.getLatitude(); + } + + public double getLongitude() { + return location.getLongitude(); + } + + public Integer getElevation() { + return location.getElevation(); + } + + /** + * Returns the hashCode for this object. This implementation returns the + * hashCode of the generated dataURI. + * + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = (prime * result) + + ((getDataURI() == null) ? 0 : getDataURI().hashCode()); + return result; + } + + /** + * Checks if this record is equal to another by checking the generated + * dataURI. + * + * @param obj + * @see java.lang.Object#equals(java.lang.Object) + */ + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + NcTafRecord other = (NcTafRecord) obj; + if (getDataURI() == null) { + if (other.getDataURI() != null) { + return false; + } + } else if (!getDataURI().equals(other.getDataURI())) { + return false; + } + return true; + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() + */ + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon + * .uf.common.pointdata.PointDataView) + */ + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + + /** + * Get the time to use for persisting this data. + * + * @return The persistence time for this data. + */ + @Override + public Date getPersistenceTime() { + if (getInsertTime() == null) { + return null; + } else { + return getInsertTime().getTime(); + } + } + + /** + * Set the time to be used for the persistence time for this object. + * + * @param persistTime + * The persistence time to be used. + */ + @Override + public void setPersistenceTime(Date persistTime) { + Calendar insertTime = Calendar.getInstance(); + insertTime.setTime(persistTime); + setInsertTime(insertTime); + } + + @Override + public Amount getValue(String paramName) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Collection getValues(String paramName) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getString(String paramName) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String[] getStrings(String paramName) { + // TODO Auto-generated method stub + return null; + } + + /** + * + * @return The string containing the change group text + */ + public String getChangeGroup() { + return this.changeGroup; + } + + public void setChangeGroup(String changeGroup) { + this.changeGroup = changeGroup; + } + + public NcTafPeriod getTafChangePeriod() { + return tafChangePeriod; + } + + public void setTafChangePeriod(NcTafPeriod tafChangePeriod) { + this.tafChangePeriod = tafChangePeriod; + } + + public Float getWind_dir_degrees() { + return wind_dir_degrees; + } + + public void setWind_dir_degrees(Float wind_dir_degrees) { + this.wind_dir_degrees = wind_dir_degrees; + } + + public Float getWind_speed_kt() { + return wind_speed_kt; + } + + public void setWind_speed_kt(Float wind_speed_kt) { + this.wind_speed_kt = wind_speed_kt; + } + + public Float getWind_gust_kt() { + return wind_gust_kt; + } + + public void setWind_gust_kt(Float wind_gust_kt) { + this.wind_gust_kt = wind_gust_kt; + } + + public Float getWind_shear_hgt_ft_agl() { + return wind_shear_hgt_ft_agl; + } + + public void setWind_shear_hgt_ft_agl(Float wind_shear_hgt_ft_agl) { + this.wind_shear_hgt_ft_agl = wind_shear_hgt_ft_agl; + } + + public Float getWind_shear_dir_degrees() { + return wind_shear_dir_degrees; + } + + public void setWind_shear_dir_degrees(Float wind_shear_dir_degrees) { + this.wind_shear_dir_degrees = wind_shear_dir_degrees; + } + + public Float getWind_shear_speed_kt() { + return wind_shear_speed_kt; + } + + public void setWind_shear_speed_kt(Float wind_shear_speed_kt) { + this.wind_shear_speed_kt = wind_shear_speed_kt; + } + + public Float getVisibility_mi() { + return visibility_mi; + } + + public void setVisibility_mi(Float visibility_mi) { + this.visibility_mi = visibility_mi; + } + + public float getAltim_in_hg() { + return altim_in_hg; + } + + public void setAltim_in_hg(float altim_in_hg) { + this.altim_in_hg = altim_in_hg; + } + + public float getVert_vis_ft() { + return probable_vert_vis_ft; + } + + public void setVert_vis_ft(float vert_vis_ft) { + this.probable_vert_vis_ft = vert_vis_ft; + } + + public float getProbable_wind_dir_degrees() { + return probable_wind_dir_degrees; + } + + public void setProbable_wind_dir_degrees(float wind_dir_degrees) { + this.probable_wind_dir_degrees = wind_dir_degrees; + } + + public float getProbable_wind_speed_kt() { + return probable_wind_speed_kt; + } + + public void setProbable_wind_speed_kt(float wind_speed_kt) { + this.probable_wind_speed_kt = wind_speed_kt; + } + + public float getProbable_wind_gust_kt() { + return probable_wind_gust_kt; + } + + public void setProbable_wind_gust_kt(float wind_gust_kt) { + this.probable_wind_gust_kt = wind_gust_kt; + } + + public float getProbable_wind_shear_hgt_ft_agl() { + return probable_wind_shear_hgt_ft_agl; + } + + public void setProbable_wind_shear_hgt_ft_agl(float wind_shear_hgt_ft_agl) { + this.probable_wind_shear_hgt_ft_agl = wind_shear_hgt_ft_agl; + } + + public float getProbable_wind_shear_dir_degrees() { + return probable_wind_shear_dir_degrees; + } + + public void setProbable_wind_shear_dir_degrees(float wind_shear_dir_degrees) { + this.probable_wind_shear_dir_degrees = wind_shear_dir_degrees; + } + + public float getProbable_wind_shear_speed_kt() { + return probable_wind_shear_speed_kt; + } + + public void setProbable_wind_shear_speed_kt(float wind_shear_speed_kt) { + this.probable_wind_shear_speed_kt = wind_shear_speed_kt; + } + + public float getProbable_visibility_mi() { + return probable_visibility_mi; + } + + public void setProbable_visibility_mi(float visibility_mi) { + this.probable_visibility_mi = visibility_mi; + } + + public float getProbable_vert_vis_ft() { + return probable_vert_vis_ft; + } + + public void setProbable_vert_vis_ft(float vert_vis_ft) { + this.probable_vert_vis_ft = vert_vis_ft; + } + + public Integer getMax_temp_c() { + return max_temp_c; + } + + public void setMax_temp_c(Integer max_temp_c) { + this.max_temp_c = max_temp_c; + } + + public Integer getMin_temp_c() { + return min_temp_c; + } + + public void setMin_temp_c(Integer min_temp_c) { + this.min_temp_c = min_temp_c; + } + + public Integer getProbability() { + return probability; + } + + public void setProbability(Integer probability) { + this.probability = probability; + } + + /** + * @return the sequenceId + */ + public Integer getSequenceId() { + return sequenceId; + } + + /** + * @param sequenceId + * the sequenceId to set + */ + public void setSequenceId(Integer sequenceId) { + this.sequenceId = sequenceId; + } + + /** + * @return the remarks + */ + public String getRemarks() { + return remarks; + } + + /** + * @param remarks + * the remarks to set + */ + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public String getChange_indicator() { + return change_indicator; + } + + public void setChange_indicator(String change_indicator) { + this.change_indicator = change_indicator; + } + + public NcTafPeriod getTafValidPeriod() { + return tafValidPeriod; + } + + public void setTafValidPeriod(NcTafPeriod tafValidPeriod) { + this.tafValidPeriod = tafValidPeriod; + } + + public Set getTurbulence_layers() { + return turbulence_layers; + } + + public void setTurbulence_layers(Set turbulence_layers) { + this.turbulence_layers = turbulence_layers; + } + + /** + * @param add + * taf turbulence layer to set + */ + public void addTurbulence_layer(NcTafTurbulenceLayer turb) { + turbulence_layers.add(turb); + } + + public Set getIcing_layers() { + return icing_layers; + } + + public void setIcing_layers(Set icing_layers) { + this.icing_layers = icing_layers; + } + + /** + * @param add + * taf icing layer to set + */ + public void addIcing_layer(NcTafIcingLayer icng) { + icing_layers.add(icng); + } + + public Set getTemp_forecasts() { + return temp_forecasts; + } + + public void setTemp_forecasts(Set temp_forecasts) { + this.temp_forecasts = temp_forecasts; + } + + /** + * @param add + * taf temp forecast to set + */ + public void addTemp_forecast(NcTafTemperatureForecast tempFcst) { + temp_forecasts.add(tempFcst); + } + + public Set getWeather() { + return weather; + } + + public void setWeather(Set weather) { + this.weather = weather; + } + + /** + * @param add + * taf weather condition to set + */ + public void addWeather(NcTafWeatherCondition wthrCond) { + weather.add(wthrCond); + } + + public Set getProbable_weather() { + return probable_weather; + } + + public void setProbable_weather(Set weather) { + this.probable_weather = weather; + } + + /** + * @param add + * probable taf weather condition to set + */ + public void addProbable_weather(NcTafWeatherCondition wthrCond) { + probable_weather.add(wthrCond); + } + + public Set getSky_cover() { + return sky_cover; + } + + public void setSky_cover(Set sky_cover) { + this.sky_cover = sky_cover; + } + + /** + * @param add + * taf sky cover to set + */ + public void addSky_cover(NcTafSkyCover skyCvr) { + sky_cover.add(skyCvr); + } + + /** + * @param add + * probable taf sky cover to set + */ + public void addProbable_sky_cover(NcTafSkyCover skyCvr) { + probable_sky_cover.add(skyCvr); + } + + public Set getProbable_sky_cover() { + return probable_sky_cover; + } + + public void setProbable_sky_cover(Set sky_cover) { + this.probable_sky_cover = sky_cover; + } + + /** + * @return the theStartDate + */ + public Calendar getStartDate() { + return startDate; + } + + /** + * @param theStartDate + * the theStartDate to set + */ + public void setStartDate(Calendar start) { + startDate = start; + } + + /** + * @return the transitionEndDate + */ + public Calendar getTransitionEndDate() { + return transitionEndDate; + } + + /** + * @param transitionEndDate + * the transitionEndDate to set + */ + public void setTransitionEndDate(Calendar transitionEndDate) { + this.transitionEndDate = transitionEndDate; + } + + /** + * @return the theEndDate + */ + public Calendar getEndDate() { + return endDate; + } + + /** + * @param theEndDate + * the theEndDate to set + */ + public void setEndDate(Calendar end) { + endDate = end; + } + + public static String formatDate(Calendar dateTime) { + return String.format("%1$tY%1$tm%1$td%1$tH%1$tM%1$tS", dateTime); + } + + /** + * This method determines the ceiling value of a TAF. + */ + public static float getCeiling(Set skyCov, float vertVis) { + + // If a vertical visibility has been reported, the sky is obscured + // and the vertical visibility becomes the ceiling. + if ((vertVis >= 0) && (vertVis < 1e20f)) { + return vertVis; + } else { + // Otherwise, determine the ceiling value. + return findTafCeilingFromLayers(sortSkyCover(skyCov)); + } + } + + public static Set sortSkyCover(Set skySet) { + if (skySet != null) { + SortedSet skSet = new TreeSet(); + for (NcTafSkyCover sc : skySet) { + skSet.add(sc); + } + return skSet; + } else { + return new HashSet(); + } + } + + /** + * This method calculates a floating point number representing the ceiling. + * By definition, the ceiling is the lowest overcast or broken cloud layer, + * so the method looks for the lowest layer that matches a BKN or OVC + * condition, and returns that layer. + * + * @param skyCov + * -- the set of sky coverage data + * @return -- the ceiling + */ + public static float findTafCeilingFromLayers(Set skyCov) { + float ceiling = 1e20f; + // Find a ceiling in a TAF report. + try { + for (NcTafSkyCover sc : skyCov) { + if (sc.getType().equals("CLR") || sc.getType().equals("SKC")) { + ceiling = IDecoderConstantsN.NEGATIVE_FLOAT_MISSING; + break; + } else if ((sc.getType().equals("BKN")) + || (sc.getType().equals("OVC"))) { + if (sc.getHeight() != null) { + ceiling = sc.getHeight(); + break; + } + } + + } + } catch (RuntimeException e) { + // ignore cloud cover that is null + } + return ceiling >= 1e20f ? IDecoderConstantsN.NEGATIVE_FLOAT_MISSING + : ceiling; + } + + /** + * Constructs an array of NcTafRecord PDOs given one or more bulletin + * records. (The bulletin records each contain data from a whole bulletin, + * while each NcTafRecord is more fine-grained -- representing the values + * for a single NcTafChangeGroup of the entire bulletin [NcTafBulletin]). We + * do this "reshuffle" because the + * NcTafBulletin/NcTafChangeGroup/NcTafSkyCover (same for + * NcTafTemperatureForecase, NcTafTurbulenceLayer, NcTafSkyCover, + * NcTafWeatherCondition) hierarchy efficiently represents the original + * structure as parsed from the text, but we want the persistent PDO + * (NcTafRecord) to be optimized for efficient access. + * + * @param bulletin + * the bulletin record to split + * @return NcTafRecord[] the array of NcTafRecord PDOs + */ + public static NcTafRecord[] split(NcTafBulletinRecord bulletin) { + List records = new ArrayList(); + if (bulletin.getChangeGroups() != null) { + Iterator chgGrps = bulletin.getChangeGroups() + .iterator(); + if (chgGrps != null) { + while (chgGrps.hasNext()) { + + NcTafRecord tfr = new NcTafRecord(); + + NcTafChangeGroup chgGrp = chgGrps.next(); + + tfr.setPersistenceTime(new Date()); + + NcTafPeriod validPeriod = chgGrp.getTafChangePeriod(); + Calendar cStart = TimeTools + .copy(validPeriod.getStartDate()); + + TimeRange range = new TimeRange(cStart, + validPeriod.getEndDate()); + DataTime tafPeriod = new DataTime(cStart, range); + + tfr.setDataTime(tafPeriod); + + if (bulletin.getTafValidPeriod() != null) { + tfr.setTafValidPeriod(bulletin.getTafValidPeriod()); + } + + if (chgGrp.getTafChangePeriod() != null) { + tfr.setTafChangePeriod(chgGrp.getTafChangePeriod()); + } + + if (chgGrp.getTafChangePeriod().getEndDate() != null) { + tfr.setEndDate(chgGrp.getTafChangePeriod().getEndDate()); + } + + if (chgGrp.getTafChangePeriod().getStartDate() != null) { + tfr.setStartDate(chgGrp.getTafChangePeriod() + .getStartDate()); + } + + if (chgGrp.getTafChangePeriod().getTransitionEndDate() != null) { + tfr.setTransitionEndDate(chgGrp.getTafChangePeriod() + .getTransitionEndDate()); + } + + if (bulletin.getWmoHeader() != null) { + tfr.setWmoHeader(bulletin.getWmoHeader()); + } + + if (bulletin.getTafText() != null) { + tfr.setTafText(bulletin.getTafText()); + } + + if (bulletin.getReportType() != null) { + tfr.setReportType(bulletin.getReportType()); + } + + if (bulletin.getStationId() != null) { + tfr.setStationId(bulletin.getStationId()); + } + + if (bulletin.getCorIndicator() != null) { + tfr.setCorIndicator(bulletin.getCorIndicator()); + } else { + tfr.setCorIndicator(""); + } + + if (bulletin.getAmdIndicator() != null) { + tfr.setAmdIndicator(bulletin.getAmdIndicator()); + } else { + tfr.setAmdIndicator(""); + } + + if (bulletin.getIssue_time() != null) { + tfr.setIssue_time(bulletin.getIssue_time()); + } + + if (bulletin.getIssue_timeString() != null) { + tfr.setIssue_timeString(bulletin.getIssue_timeString()); + } + + if (bulletin.getBulletin_time() != null) { + tfr.setBulletin_time(bulletin.getBulletin_time()); + } + + if (bulletin.getLocation() != null) { + tfr.setLocation(bulletin.getLocation()); + } + + if (chgGrp.getChange_indicator() != null) { + tfr.setChange_indicator(chgGrp.getChange_indicator()); + } + + if (chgGrp.getChangeGroup() != null) { + tfr.setChangeGroup(chgGrp.getChangeGroup()); + } + + if (chgGrp.getProbability() != null) { + tfr.setProbability(chgGrp.getProbability()); + } + + if (chgGrp.getMax_temp_c() != null) { + tfr.setMax_temp_c(chgGrp.getMax_temp_c()); + } + + if (chgGrp.getMin_temp_c() != null) { + tfr.setMin_temp_c(chgGrp.getMin_temp_c()); + } + + if ((chgGrp.getAltim_in_hg() != null) + && (chgGrp.getAltim_in_hg().trim().length() > 0)) { + tfr.setAltim_in_hg(Float.parseFloat(chgGrp + .getAltim_in_hg())); + } else { + tfr.setAltim_in_hg(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if (chgGrp.getRemarks() != null) { + tfr.setRemarks(chgGrp.getRemarks()); + } + + if (chgGrp.getSequenceId() != null) { + tfr.setSequenceId(chgGrp.getSequenceId()); + } + + VisibilityParser parser = new VisibilityParser(); + if ((chgGrp.getVisibility_mi() != null) + && parser.decode(chgGrp.getVisibility_mi() + "SM")) { + float val = (float) parser.getPrevail_vsbySM(); + tfr.setVisibility_mi(val); + } else { + tfr.setVisibility_mi(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if ((chgGrp.getVert_vis_ft() != null) + && (chgGrp.getVert_vis_ft().trim().length() > 0)) { + tfr.setVert_vis_ft(Float.parseFloat(chgGrp + .getVert_vis_ft())); + } else { + tfr.setVert_vis_ft(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if ((chgGrp.getWind_dir_degrees() != null) + && !chgGrp.getWind_dir_degrees().equalsIgnoreCase( + "VRB")) { + tfr.setWind_dir_degrees(Float.parseFloat(chgGrp + .getWind_dir_degrees())); + } else { + tfr.setWind_dir_degrees(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if (chgGrp.getWind_gust_kt() != null) { + tfr.setWind_gust_kt(new Float(chgGrp.getWind_gust_kt())); + } else { + tfr.setWind_gust_kt(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if (chgGrp.getWind_speed_kt() != null) { + tfr.setWind_speed_kt(new Float(chgGrp + .getWind_speed_kt())); + } else { + tfr.setWind_speed_kt(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if (chgGrp.getWind_shear_dir_degrees() != null) { + tfr.setWind_shear_dir_degrees(new Float(chgGrp + .getWind_shear_dir_degrees())); + } else { + tfr.setWind_shear_dir_degrees(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if (chgGrp.getWind_shear_speed_kt() != null) { + tfr.setWind_shear_speed_kt(new Float(chgGrp + .getWind_shear_speed_kt())); + } else { + tfr.setWind_shear_speed_kt(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if (chgGrp.getWind_shear_hgt_ft_agl() != null) { + tfr.setWind_shear_hgt_ft_agl(new Float(chgGrp + .getWind_shear_hgt_ft_agl())); + } else { + tfr.setWind_shear_hgt_ft_agl(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if ((chgGrp.getProbable_visibility_mi() != null) + && parser.decode(chgGrp.getProbable_visibility_mi() + + "SM")) { + float val = (float) parser.getPrevail_vsbySM(); + tfr.setProbable_visibility_mi(val); + } else { + tfr.setProbable_visibility_mi(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if ((chgGrp.getProbable_vert_vis_ft() != null) + && (chgGrp.getProbable_vert_vis_ft().trim() + .length() > 0)) { + tfr.setProbable_vert_vis_ft(Float.parseFloat(chgGrp + .getProbable_vert_vis_ft())); + } else { + tfr.setProbable_vert_vis_ft(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if ((chgGrp.getProbable_wind_dir_degrees() != null) + && !chgGrp.getProbable_wind_dir_degrees() + .equalsIgnoreCase("VRB")) { + tfr.setProbable_wind_dir_degrees(Float + .parseFloat(chgGrp + .getProbable_wind_dir_degrees())); + } else { + tfr.setProbable_wind_dir_degrees(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if (chgGrp.getProbable_wind_gust_kt() != null) { + tfr.setProbable_wind_gust_kt(new Float(chgGrp + .getProbable_wind_gust_kt())); + } else { + tfr.setProbable_wind_gust_kt(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if (chgGrp.getProbable_wind_speed_kt() != null) { + tfr.setProbable_wind_speed_kt(new Float(chgGrp + .getProbable_wind_speed_kt())); + } else { + tfr.setProbable_wind_speed_kt(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if (chgGrp.getProbable_wind_shear_dir_degrees() != null) { + tfr.setProbable_wind_speed_kt(new Float(chgGrp + .getProbable_wind_shear_dir_degrees())); + } else { + tfr.setWind_shear_dir_degrees(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if (chgGrp.getProbable_wind_shear_speed_kt() != null) { + tfr.setWind_shear_speed_kt(new Float(chgGrp + .getProbable_wind_shear_speed_kt())); + } else { + tfr.setWind_shear_speed_kt(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if (chgGrp.getProbable_wind_shear_hgt_ft_agl() != null) { + tfr.setProbable_wind_shear_hgt_ft_agl(new Float(chgGrp + .getProbable_wind_shear_hgt_ft_agl())); + } else { + tfr.setProbable_wind_shear_hgt_ft_agl(IDecoderConstantsN.NEGATIVE_FLOAT_MISSING); + } + + if (chgGrp.getIcing_layers() != null) { + tfr.setIcing_layers(chgGrp.getIcing_layers()); + } + + if (chgGrp.getSky_cover() != null) { + tfr.setSky_cover(chgGrp.getSky_cover()); + } + + if (chgGrp.getProbable_sky_cover() != null) { + tfr.setProbable_sky_cover(chgGrp + .getProbable_sky_cover()); + } + + if (chgGrp.getTemp_forecasts() != null) { + tfr.setTemp_forecasts(chgGrp.getTemp_forecasts()); + } + + if (chgGrp.getTurbulence_layers() != null) { + tfr.setTurbulence_layers(chgGrp.getTurbulence_layers()); + } + + if (chgGrp.getWeather() != null) { + tfr.setWeather(chgGrp.getWeather()); + } + + records.add(tfr); + } + + } + } + + List hourlyRecords = splitToHourlyRecords(records); + + return hourlyRecords.toArray(new NcTafRecord[0]); + } + + public static List splitToHourlyRecords( + List records) { + List newRecords = new ArrayList(); + int recordsSize = (records != null) ? records.size() : 0; + + if (recordsSize > 0) { + + for (int i = 0; i < recordsSize; i++) { + + NcTafRecord record = records.get(i); + + Calendar startRefTime = record.getStartDate(); + Calendar endRefTime = record.getEndDate(); + + // add 1 minute so that 12:30 becomes 12:31 and hence is rounded + // to 13:00 and not 12:00 + startRefTime.add(Calendar.MINUTE, 1); + Date nearestHour = DateUtils.round(startRefTime.getTime(), + Calendar.HOUR); + startRefTime.setTime(nearestHour); + + nearestHour = DateUtils.round(endRefTime.getTime(), + Calendar.HOUR); + endRefTime.setTime(nearestHour); + + long milliseconds1 = startRefTime.getTimeInMillis(); + long milliseconds2 = endRefTime.getTimeInMillis(); + long diff = milliseconds2 - milliseconds1; + long diffHours = diff / (60 * 60 * 1000); + + for (int hour = 0; hour < diffHours; hour++) { + + NcTafRecord tfr = new NcTafRecord(); + + tfr.setPersistenceTime(new Date()); + tfr.setDataTime(new DataTime(startRefTime)); + tfr.setTafValidPeriod(record.getTafValidPeriod()); + tfr.setTafChangePeriod(record.getTafChangePeriod()); + tfr.setEndDate(record.getTafChangePeriod().getEndDate()); + tfr.setStartDate(record.getTafChangePeriod().getStartDate()); + tfr.setTransitionEndDate(record.getTafChangePeriod() + .getTransitionEndDate()); + tfr.setWmoHeader(record.getWmoHeader()); + if ((record.getTafText() != null) + && (record.getTafText().length() > 1024)) { + tfr.setTafText(record.getTafText().substring(0, 1024)); + } else { + tfr.setTafText(record.getTafText()); + } + tfr.setTafText(record.getTafText()); + tfr.setReportType(record.getReportType()); + tfr.setStationId(record.getStationId()); + tfr.setCorIndicator(record.getCorIndicator()); + tfr.setAmdIndicator(record.getAmdIndicator()); + tfr.setIssue_time(record.getIssue_time()); + tfr.setIssue_timeString(record.getIssue_timeString()); + tfr.setBulletin_time(record.getBulletin_time()); + tfr.setLocation(record.getLocation()); + tfr.setChange_indicator(record.getChange_indicator()); + if ((record.getChangeGroup() != null) + && (record.getChangeGroup().length() > 128)) { + tfr.setChangeGroup(record.getChangeGroup().substring(0, + 128)); + } else { + tfr.setChangeGroup(record.getChangeGroup()); + } + tfr.setChangeGroup(record.getChangeGroup()); + tfr.setProbability(record.getProbability()); + tfr.setMax_temp_c(record.getMax_temp_c()); + tfr.setMin_temp_c(record.getMin_temp_c()); + tfr.setAltim_in_hg(record.getAltim_in_hg()); + tfr.setRemarks(record.getRemarks()); + tfr.setSequenceId(record.getSequenceId()); + tfr.setVisibility_mi(record.getVisibility_mi()); + tfr.setVert_vis_ft(record.getVert_vis_ft()); + tfr.setWind_dir_degrees(record.getWind_dir_degrees()); + tfr.setWind_gust_kt(record.getWind_gust_kt()); + tfr.setWind_speed_kt(record.getWind_speed_kt()); + tfr.setWind_shear_dir_degrees(record + .getWind_shear_dir_degrees()); + tfr.setWind_shear_speed_kt(record.getWind_shear_speed_kt()); + tfr.setWind_shear_hgt_ft_agl(record + .getWind_shear_hgt_ft_agl()); + tfr.setProbable_visibility_mi(record + .getProbable_visibility_mi()); + tfr.setProbable_vert_vis_ft(record + .getProbable_vert_vis_ft()); + tfr.setProbable_wind_dir_degrees(record + .getProbable_wind_dir_degrees()); + tfr.setProbable_wind_gust_kt(record + .getProbable_wind_gust_kt()); + tfr.setProbable_wind_speed_kt(record + .getProbable_wind_speed_kt()); + tfr.setWind_shear_dir_degrees(record + .getProbable_wind_shear_dir_degrees()); + tfr.setWind_shear_speed_kt(record + .getProbable_wind_shear_speed_kt()); + tfr.setProbable_wind_shear_hgt_ft_agl(record + .getProbable_wind_shear_hgt_ft_agl()); + tfr.setIcing_layers(record.getIcing_layers()); + tfr.setSky_cover(record.getSky_cover()); + tfr.setProbable_sky_cover(record.getProbable_sky_cover()); + tfr.setTemp_forecasts(record.getTemp_forecasts()); + tfr.setTurbulence_layers(record.getTurbulence_layers()); + tfr.setWeather(record.getWeather()); + tfr.setProbable_weather(record.getWeather()); + newRecords.add(tfr); + startRefTime.add(Calendar.HOUR_OF_DAY, 1); + } + } + } + + return newRecords; + } @Override @Column @@ -1619,65 +1645,69 @@ public class NcTafRecord extends PluginDataObject implements ISpatialEnabled, return super.getDataURI(); } - /** - * - * @param args - */ - public static final void main(String[] args) { + /** + * + * @param args + */ + public static final void main(String[] args) { - Set skyCovers = new HashSet(); + Set skyCovers = new HashSet(); - NcTafSkyCover cover = new NcTafSkyCover(); - cover.setGenus(""); - cover.setType("OVC"); - cover.setHeight(1800); - skyCovers.add(cover); + NcTafSkyCover cover = new NcTafSkyCover(); + cover.setGenus(""); + cover.setType("OVC"); + cover.setHeight(1800); + skyCovers.add(cover); - cover = new NcTafSkyCover(); - cover.setGenus(""); - cover.setType("BKN"); - cover.setHeight(1000); - skyCovers.add(cover); + cover = new NcTafSkyCover(); + cover.setGenus(""); + cover.setType("BKN"); + cover.setHeight(1000); + skyCovers.add(cover); - cover = new NcTafSkyCover(); - cover.setGenus(""); - cover.setType("SCT"); - cover.setHeight(800); - skyCovers.add(cover); + cover = new NcTafSkyCover(); + cover.setGenus(""); + cover.setType("SCT"); + cover.setHeight(800); + skyCovers.add(cover); - for (NcTafSkyCover s : skyCovers) { - System.out.println(s); - } + for (NcTafSkyCover s : skyCovers) { + System.out.println(s); + } - System.out.println(getCeiling(skyCovers, 8)); + System.out.println(getCeiling(skyCovers, 8)); - System.out.println(getCeiling(skyCovers, -1)); + System.out.println(getCeiling(skyCovers, -1)); - Calendar startRefTime = Calendar.getInstance(); - startRefTime.set(2011, 11, 04, 12, 30); - startRefTime.add(Calendar.MINUTE, 1); - Calendar endRefTime = Calendar.getInstance(); - endRefTime.set(2011, 11, 04, 14, 30); + Calendar startRefTime = Calendar.getInstance(); + startRefTime.set(2011, 11, 04, 12, 30); + startRefTime.add(Calendar.MINUTE, 1); + Calendar endRefTime = Calendar.getInstance(); + endRefTime.set(2011, 11, 04, 14, 30); - Date nearestHour = DateUtils.round(startRefTime.getTime(), - Calendar.HOUR); - startRefTime.setTime(nearestHour); + Date nearestHour = DateUtils.round(startRefTime.getTime(), + Calendar.HOUR); + startRefTime.setTime(nearestHour); - nearestHour = DateUtils.round(endRefTime.getTime(), Calendar.HOUR); - endRefTime.setTime(nearestHour); + nearestHour = DateUtils.round(endRefTime.getTime(), Calendar.HOUR); + endRefTime.setTime(nearestHour); - long milliseconds1 = startRefTime.getTimeInMillis(); - long milliseconds2 = endRefTime.getTimeInMillis(); - long diff = milliseconds2 - milliseconds1; - long diffHours = diff / (60 * 60 * 1000); + long milliseconds1 = startRefTime.getTimeInMillis(); + long milliseconds2 = endRefTime.getTimeInMillis(); + long diff = milliseconds2 - milliseconds1; + long diffHours = diff / (60 * 60 * 1000); - System.out.println(" diffHours = " + diffHours); + System.out.println(" diffHours = " + diffHours); - for (int hour = 0; hour < diffHours; hour++) { - System.out.println(" startRefTime = " - + startRefTime.getTime().toString()); - startRefTime.add(Calendar.HOUR_OF_DAY, 1); - } - } + for (int hour = 0; hour < diffHours; hour++) { + System.out.println(" startRefTime = " + + startRefTime.getTime().toString()); + startRefTime.add(Calendar.HOUR_OF_DAY, 1); + } + } + @Override + public String getPluginName() { + return "nctaf"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncuair/src/gov/noaa/nws/ncep/common/dataplugin/ncuair/NcUairRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncuair/src/gov/noaa/nws/ncep/common/dataplugin/ncuair/NcUairRecord.java index 27ba1eddb6..6a023c45eb 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ncuair/src/gov/noaa/nws/ncep/common/dataplugin/ncuair/NcUairRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ncuair/src/gov/noaa/nws/ncep/common/dataplugin/ncuair/NcUairRecord.java @@ -67,504 +67,501 @@ import com.vividsolutions.jts.geom.Geometry; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ncuair", - indexes = { - @Index(name = "ncuair_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ncuair", indexes = { @Index(name = "ncuair_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class NcUairRecord extends PersistablePluginDataObject implements - ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { - - private static final long serialVersionUID = 1L; - public static final String PLUGIN_NAME = "ncuair"; - - // Time of the UTC - @DataURI(position = 4) - @Column - @DynamicSerializeElement - private int UTC; - - // The observation report type. - @DataURI(position = 1) - @Column - @DynamicSerializeElement - private String reportType; - - // Issue time for the bulletin - @Column - @DynamicSerializeElement - private Calendar issueTime; - - // Observation time for the bulletin - @Column - @DynamicSerializeElement - private Calendar obsTime; - - // Synoptic time for the bulletin - // Time of the observation to the nearest hour. - @Column - @DynamicSerializeElement - private Calendar synopticTime; - - // Type of data such as TTAA/BB/CC/DD or PP... - @DataURI(position = 3) - @Column - @DynamicSerializeElement - private String dataType; - - // Correction indicator from wmo header - @DataURI(position = 5) - @Column - @DynamicSerializeElement - private String corr; - - // Text of the WMO header - @Column - @DynamicSerializeElement - private String wmoHeader; - - // Station number - // @DataURI(position = 2) - @Column - @DynamicSerializeElement - private String stnum; - - @Embedded - @DataURI(position = 2, embedded = true) - @XmlElement - @DynamicSerializeElement - private SurfaceObsLocation location; - - // Yes if report is a NIL. - @Column - @DynamicSerializeElement - private Boolean nil; - - // bulletin message - @Transient - @DynamicSerializeElement - private String bullMessage; - - /** - * Uair observation levels - */ - @DynamicSerializeElement - @Transient - private Set obsLevels = new HashSet(); - - /** - * Uair tropopause data - */ - @DynamicSerializeElement - @Transient - private Set tropopause = new HashSet(); - - /** - * Uair maxwind data - */ - @DynamicSerializeElement - @Transient - private Set maxwind = new HashSet(); - - /** - * Uair lifted index data - */ - @DynamicSerializeElement - @Transient - private Set liftedindex = new HashSet(); - - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - /** - * Empty constructor. - */ - public NcUairRecord() { - this.nil = false; - this.stnum = ""; - this.wmoHeader = ""; - // this.stid=""; - this.corr = ""; - this.dataType = ""; - } - - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - * @param tableDef - * The table definitions for this class. - */ - public NcUairRecord(String uri) { - super(uri); - if (location != null) { - String staId = location.getStationId(); - location.setStationId("null".equals(staId) ? null : staId); - } - } - - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } - - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } - - /** - * Get the report correction indicator. - * - * @return The corr - */ - public String getCorr() { - return corr; - } - - /** - * Set the report correction indicator. - * - * @param corr - * The corr. - */ - public void setCorr(String corr) { - this.corr = corr; - } - - /** - * Get the observation report type. - * - * @return the reportType - */ - public String getReportType() { - return reportType; - } - - /** - * Set the observation report type. - * - * @param reportType - * the reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } - - public String getStnum() { - return stnum; - } - - public void setStnum(String stnum) { - this.stnum = stnum; - } - - /* - * Get this observation's geometry. - * - * @return The geometry for this observation. - */ - public Geometry getGeometry() { - return location.getGeometry(); - } - - /** - * Get the geometry latitude. - * - * @return The geometry latitude. - */ - public double getLatitude() { - return location.getLatitude(); - } - - /** - * Get the geometry longitude. - * - * @return The geometry longitude. - */ - public double getLongitude() { - return location.getLongitude(); - } - - /** - * Get the station identifier for this observation. - * - * @return the stationId - */ - public String getStationId() { - return location.getStationId(); - } - - /** - * Get the elevation, in meters, of the observing platform or location. - * - * @return The observation elevation, in meters. - */ - public Integer getElevation() { - return location.getElevation(); - } - - /** - * Get whether the location for this observation is defined. - * - * @return Is this location defined. - */ - public Boolean getLocationDefined() { - return location.getLocationDefined(); - } - - public Calendar getObsTime() { - return obsTime; - } - - public void setObsTime(Calendar obsTime) { - this.obsTime = obsTime; - } - - public Calendar getSynopticTime() { - return synopticTime; - } - - public void setSynopticTime(Calendar synopticTime) { - this.synopticTime = synopticTime; - } - - public String getBullMessage() { - return bullMessage; - } - - public void setBullMessage(String bullMessage) { - this.bullMessage = bullMessage; - } - - public Calendar getIssueTime() { - return issueTime; - } - - public void setIssueTime(Calendar issueTime) { - this.issueTime = issueTime; - } - - public String getDataType() { - return dataType; - } - - public void setDataType(String dataType) { - this.dataType = dataType; - } - - public int getUTC() { - return UTC; - } - - public void setUTC(int utc) { - UTC = utc; - } - - public Boolean getNil() { - return nil; - } - - public void setNil(Boolean nil) { - this.nil = nil; - } - - @Override - public IDecoderGettable getDecoderGettable() { - // TODO Auto-generated method stub - return null; - } - - /** - * @return the set of uair observation levels - */ - public Set getObsLevels() { - return obsLevels; - } - - /** - * @param uair - * observation levels to set - */ - public void setObsLevels(Set uairLevel) { - this.obsLevels = uairLevel; - } - - /** - * @param add - * uair observation levels to set - */ - public void addObsLevels(NcUairObsLevels plevel) { - obsLevels.add(plevel); - // plevel.setParentID(this); - } - - /** - * @return the set of uair observation levels - */ - public Set getTropopause() { - return tropopause; - } - - /** - * @param uair - * observation levels to set - */ - public void setTropopause(Set trop) { - this.tropopause = trop; - } - - /** - * @param add - * uair observation levels to set - */ - public void addTropopause(NcUairTropopause trop) { - tropopause.add(trop); - // trop.setParentID(this); - } - - /** - * @return the set of uair maximum wind - */ - public Set getMaxWind() { - return maxwind; - } - - /** - * @param uair - * maximum wind to set - */ - public void setMaxWind(Set mwind) { - this.maxwind = mwind; - } - - /** - * @param add - * uair maximum wind to set - */ - public void addMaxWind(NcUairMaxWind mwind) { - maxwind.add(mwind); - // mwind.setParentID(this); - } - - /** - * @return the set of uair lifted index - */ - public Set getLiftedIndex() { - return liftedindex; - } - - /** - * @param uair - * lifted index to set - */ - public void setLiftedIndex(Set li) { - this.liftedindex = li; - } - - /** - * @param add - * uair lifted index to set - */ - public void addLiftedIndex(NcUairLiftedIndex li) { - liftedindex.add(li); - // li.setParentID(this); - } - - /** - * Override existing set method to modify any classes that use the dataURI - * as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - - this.identifier = dataURI; - - } - - @Override - public SurfaceObsLocation getSpatialObject() { - return location; - } - - public SurfaceObsLocation getLocation() { - if (location == null) { - location = new SurfaceObsLocation(); - } - return location; - } - - public void setLocation(SurfaceObsLocation location) { - this.location = location; - } - - /* - * (non-Javadoc) - * - * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() - */ - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } - - /* - * (non-Javadoc) - * - * @see - * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon - * .uf.common.pointdata.PointDataView) - */ - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } - - @Override - public Date getPersistenceTime() { - // return this.dataTime.getRefTime(); - return null; - } - - @Override - public void setPersistenceTime(Date persistTime) { - // TODO Auto-generated method stub - - } - - @Override - public Amount getValue(String paramName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Collection getValues(String paramName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getString(String paramName) { - // TODO Auto-generated method stub - return null; - } - - @Override - public String[] getStrings(String paramName) { - // TODO Auto-generated method stub - return null; - } + ISpatialEnabled, IDecoderGettable, IPointData, IPersistable { + + private static final long serialVersionUID = 1L; + + public static final String PLUGIN_NAME = "ncuair"; + + // Time of the UTC + @DataURI(position = 4) + @Column + @DynamicSerializeElement + private int UTC; + + // The observation report type. + @DataURI(position = 1) + @Column + @DynamicSerializeElement + private String reportType; + + // Issue time for the bulletin + @Column + @DynamicSerializeElement + private Calendar issueTime; + + // Observation time for the bulletin + @Column + @DynamicSerializeElement + private Calendar obsTime; + + // Synoptic time for the bulletin + // Time of the observation to the nearest hour. + @Column + @DynamicSerializeElement + private Calendar synopticTime; + + // Type of data such as TTAA/BB/CC/DD or PP... + @DataURI(position = 3) + @Column + @DynamicSerializeElement + private String dataType; + + // Correction indicator from wmo header + @DataURI(position = 5) + @Column + @DynamicSerializeElement + private String corr; + + // Text of the WMO header + @Column + @DynamicSerializeElement + private String wmoHeader; + + // Station number + // @DataURI(position = 2) + @Column + @DynamicSerializeElement + private String stnum; + + @Embedded + @DataURI(position = 2, embedded = true) + @XmlElement + @DynamicSerializeElement + private SurfaceObsLocation location; + + // Yes if report is a NIL. + @Column + @DynamicSerializeElement + private Boolean nil; + + // bulletin message + @Transient + @DynamicSerializeElement + private String bullMessage; + + /** + * Uair observation levels + */ + @DynamicSerializeElement + @Transient + private Set obsLevels = new HashSet(); + + /** + * Uair tropopause data + */ + @DynamicSerializeElement + @Transient + private Set tropopause = new HashSet(); + + /** + * Uair maxwind data + */ + @DynamicSerializeElement + @Transient + private Set maxwind = new HashSet(); + + /** + * Uair lifted index data + */ + @DynamicSerializeElement + @Transient + private Set liftedindex = new HashSet(); + + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; + + /** + * Empty constructor. + */ + public NcUairRecord() { + this.nil = false; + this.stnum = ""; + this.wmoHeader = ""; + // this.stid=""; + this.corr = ""; + this.dataType = ""; + } + + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + * @param tableDef + * The table definitions for this class. + */ + public NcUairRecord(String uri) { + super(uri); + if (location != null) { + String staId = location.getStationId(); + location.setStationId("null".equals(staId) ? null : staId); + } + } + + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } + + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } + + /** + * Get the report correction indicator. + * + * @return The corr + */ + public String getCorr() { + return corr; + } + + /** + * Set the report correction indicator. + * + * @param corr + * The corr. + */ + public void setCorr(String corr) { + this.corr = corr; + } + + /** + * Get the observation report type. + * + * @return the reportType + */ + public String getReportType() { + return reportType; + } + + /** + * Set the observation report type. + * + * @param reportType + * the reportType to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } + + public String getStnum() { + return stnum; + } + + public void setStnum(String stnum) { + this.stnum = stnum; + } + + /* + * Get this observation's geometry. + * + * @return The geometry for this observation. + */ + public Geometry getGeometry() { + return location.getGeometry(); + } + + /** + * Get the geometry latitude. + * + * @return The geometry latitude. + */ + public double getLatitude() { + return location.getLatitude(); + } + + /** + * Get the geometry longitude. + * + * @return The geometry longitude. + */ + public double getLongitude() { + return location.getLongitude(); + } + + /** + * Get the station identifier for this observation. + * + * @return the stationId + */ + public String getStationId() { + return location.getStationId(); + } + + /** + * Get the elevation, in meters, of the observing platform or location. + * + * @return The observation elevation, in meters. + */ + public Integer getElevation() { + return location.getElevation(); + } + + /** + * Get whether the location for this observation is defined. + * + * @return Is this location defined. + */ + public Boolean getLocationDefined() { + return location.getLocationDefined(); + } + + public Calendar getObsTime() { + return obsTime; + } + + public void setObsTime(Calendar obsTime) { + this.obsTime = obsTime; + } + + public Calendar getSynopticTime() { + return synopticTime; + } + + public void setSynopticTime(Calendar synopticTime) { + this.synopticTime = synopticTime; + } + + public String getBullMessage() { + return bullMessage; + } + + public void setBullMessage(String bullMessage) { + this.bullMessage = bullMessage; + } + + public Calendar getIssueTime() { + return issueTime; + } + + public void setIssueTime(Calendar issueTime) { + this.issueTime = issueTime; + } + + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } + + public int getUTC() { + return UTC; + } + + public void setUTC(int utc) { + UTC = utc; + } + + public Boolean getNil() { + return nil; + } + + public void setNil(Boolean nil) { + this.nil = nil; + } + + @Override + public IDecoderGettable getDecoderGettable() { + // TODO Auto-generated method stub + return null; + } + + /** + * @return the set of uair observation levels + */ + public Set getObsLevels() { + return obsLevels; + } + + /** + * @param uair + * observation levels to set + */ + public void setObsLevels(Set uairLevel) { + this.obsLevels = uairLevel; + } + + /** + * @param add + * uair observation levels to set + */ + public void addObsLevels(NcUairObsLevels plevel) { + obsLevels.add(plevel); + // plevel.setParentID(this); + } + + /** + * @return the set of uair observation levels + */ + public Set getTropopause() { + return tropopause; + } + + /** + * @param uair + * observation levels to set + */ + public void setTropopause(Set trop) { + this.tropopause = trop; + } + + /** + * @param add + * uair observation levels to set + */ + public void addTropopause(NcUairTropopause trop) { + tropopause.add(trop); + // trop.setParentID(this); + } + + /** + * @return the set of uair maximum wind + */ + public Set getMaxWind() { + return maxwind; + } + + /** + * @param uair + * maximum wind to set + */ + public void setMaxWind(Set mwind) { + this.maxwind = mwind; + } + + /** + * @param add + * uair maximum wind to set + */ + public void addMaxWind(NcUairMaxWind mwind) { + maxwind.add(mwind); + // mwind.setParentID(this); + } + + /** + * @return the set of uair lifted index + */ + public Set getLiftedIndex() { + return liftedindex; + } + + /** + * @param uair + * lifted index to set + */ + public void setLiftedIndex(Set li) { + this.liftedindex = li; + } + + /** + * @param add + * uair lifted index to set + */ + public void addLiftedIndex(NcUairLiftedIndex li) { + liftedindex.add(li); + // li.setParentID(this); + } + + /** + * Override existing set method to modify any classes that use the dataURI + * as a foreign key + */ + @Override + public void setIdentifier(Object dataURI) { + + this.identifier = dataURI; + + } + + @Override + public SurfaceObsLocation getSpatialObject() { + return location; + } + + public SurfaceObsLocation getLocation() { + if (location == null) { + location = new SurfaceObsLocation(); + } + return location; + } + + public void setLocation(SurfaceObsLocation location) { + this.location = location; + } + + /* + * (non-Javadoc) + * + * @see com.raytheon.uf.common.pointdata.IPointData#getPointDataView() + */ + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.pointdata.IPointData#setPointDataView(com.raytheon + * .uf.common.pointdata.PointDataView) + */ + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } + + @Override + public Date getPersistenceTime() { + // return this.dataTime.getRefTime(); + return null; + } + + @Override + public void setPersistenceTime(Date persistTime) { + // TODO Auto-generated method stub + + } + + @Override + public Amount getValue(String paramName) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Collection getValues(String paramName) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getString(String paramName) { + // TODO Auto-generated method stub + return null; + } + + @Override + public String[] getStrings(String paramName) { + // TODO Auto-generated method stub + return null; + } @Override @Column @@ -573,4 +570,8 @@ public class NcUairRecord extends PersistablePluginDataObject implements return super.getDataURI(); } + @Override + public String getPluginName() { + return "ncuair"; + } } \ No newline at end of file diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.nonconvsigmet/src/gov/noaa/nws/ncep/common/dataplugin/nonconvsigmet/NonConvSigmetRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.nonconvsigmet/src/gov/noaa/nws/ncep/common/dataplugin/nonconvsigmet/NonConvSigmetRecord.java index c08cd7a97d..ffd2bd171c 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.nonconvsigmet/src/gov/noaa/nws/ncep/common/dataplugin/nonconvsigmet/NonConvSigmetRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.nonconvsigmet/src/gov/noaa/nws/ncep/common/dataplugin/nonconvsigmet/NonConvSigmetRecord.java @@ -52,512 +52,484 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "nonconvsigmet", - indexes = { - @Index(name = "nonconvsigmet_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "nonconvsigmet", indexes = { @Index(name = "nonconvsigmet_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize +public class NonConvSigmetRecord extends PluginDataObject { - -public class NonConvSigmetRecord extends PluginDataObject{ - - /** + /** * */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; - // reportType is "non-convective sigmet". - @Column(length=32) - @DataURI(position=5) - @DynamicSerializeElement - private String reportType; - - // WMO header - @Column(length=32) - @DynamicSerializeElement - private String wmoHeader; - - // forecastRegion as: SL - @Column(length=8) - @DataURI(position=2) - @DynamicSerializeElement - private String forecastRegion; - - // The issue office where the report from - @Column(length=32) - @DataURI(position=1) - @DynamicSerializeElement - private String issueOffice; - - // Issue time of the report - @Column - @DataURI(position=3) - @DynamicSerializeElement - private Calendar issueTime; - - // The designator - @Column(length=8) - @DynamicSerializeElement - private String designatorBBB; - - // CorrectionFlag is a flag with values (1 or 2 or 3) - @Column(length=8) + // reportType is "non-convective sigmet". + @Column(length = 32) + @DataURI(position = 5) @DynamicSerializeElement - private String correctionRemarks; - - // The awipsId from the report - @Column(length=32) - @DataURI(position=4) - @DynamicSerializeElement - private String awipsId; - - // The state list from the report - @Column(length=256) - @DynamicSerializeElement - private String stateList; - - // Start time of the report - @Column - @DynamicSerializeElement - private Calendar startTime; - - // End time of the report - @Column - @DynamicSerializeElement - private Calendar endTime; - - // The type of the hazard from the report - @Column(length=16) - @DynamicSerializeElement - private String hazardType; - - // The intensity of the hazard from the report - @Column(length=64) - @DynamicSerializeElement - private String hazardIntensity; - - // The cause for the hazard from the report - @Column(length=128) - @DynamicSerializeElement - private String hazardCause; - - // The conditions stated about the hazard from the report - @Column(length=128) - @DynamicSerializeElement - private String hazardCondition; - - // The lower flight level from the report - @Column - @DynamicSerializeElement - private int flightLevel1; - - // The upper flight level from the report - @Column - @DynamicSerializeElement - private int flightLevel2; - - // The sigmet Identifier from the report - @Column(length=32) - @DynamicSerializeElement - private String sigmetId; - - // The entire report - @Column(length=3000) - @DynamicSerializeElement - private String bullMessage; + private String reportType; - - /** - * Convsigmet location - */ - @DynamicSerializeElement - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - @JoinColumn(name = "parentID", nullable = false) + // WMO header + @Column(length = 32) + @DynamicSerializeElement + private String wmoHeader; + + // forecastRegion as: SL + @Column(length = 8) + @DataURI(position = 2) + @DynamicSerializeElement + private String forecastRegion; + + // The issue office where the report from + @Column(length = 32) + @DataURI(position = 1) + @DynamicSerializeElement + private String issueOffice; + + // Issue time of the report + @Column + @DataURI(position = 3) + @DynamicSerializeElement + private Calendar issueTime; + + // The designator + @Column(length = 8) + @DynamicSerializeElement + private String designatorBBB; + + // CorrectionFlag is a flag with values (1 or 2 or 3) + @Column(length = 8) + @DynamicSerializeElement + private String correctionRemarks; + + // The awipsId from the report + @Column(length = 32) + @DataURI(position = 4) + @DynamicSerializeElement + private String awipsId; + + // The state list from the report + @Column(length = 256) + @DynamicSerializeElement + private String stateList; + + // Start time of the report + @Column + @DynamicSerializeElement + private Calendar startTime; + + // End time of the report + @Column + @DynamicSerializeElement + private Calendar endTime; + + // The type of the hazard from the report + @Column(length = 16) + @DynamicSerializeElement + private String hazardType; + + // The intensity of the hazard from the report + @Column(length = 64) + @DynamicSerializeElement + private String hazardIntensity; + + // The cause for the hazard from the report + @Column(length = 128) + @DynamicSerializeElement + private String hazardCause; + + // The conditions stated about the hazard from the report + @Column(length = 128) + @DynamicSerializeElement + private String hazardCondition; + + // The lower flight level from the report + @Column + @DynamicSerializeElement + private int flightLevel1; + + // The upper flight level from the report + @Column + @DynamicSerializeElement + private int flightLevel2; + + // The sigmet Identifier from the report + @Column(length = 32) + @DynamicSerializeElement + private String sigmetId; + + // The entire report + @Column(length = 3000) + @DynamicSerializeElement + private String bullMessage; + + /** + * Convsigmet location + */ + @DynamicSerializeElement + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @JoinColumn(name = "parentID", nullable = false) @Index(name = "nonConvSigmetLocation_parentid_idex") - private Set nonConvSigmetLocation = new HashSet(); + private Set nonConvSigmetLocation = new HashSet(); - - /** + /** * Default Constructor */ public NonConvSigmetRecord() { - this.issueOffice =""; - this.wmoHeader =""; - this.bullMessage =""; - this.designatorBBB =""; - this.forecastRegion =""; - this.reportType =""; - this.correctionRemarks =""; - this.awipsId =""; - this.flightLevel1 =IDecoderConstantsN.INTEGER_MISSING; - this.flightLevel2 =IDecoderConstantsN.INTEGER_MISSING; - this.hazardCause =""; - this.hazardCondition =""; - this.hazardIntensity =""; - this.hazardType ="UNKNOWN"; - this.stateList =""; - this.sigmetId =""; + this.issueOffice = ""; + this.wmoHeader = ""; + this.bullMessage = ""; + this.designatorBBB = ""; + this.forecastRegion = ""; + this.reportType = ""; + this.correctionRemarks = ""; + this.awipsId = ""; + this.flightLevel1 = IDecoderConstantsN.INTEGER_MISSING; + this.flightLevel2 = IDecoderConstantsN.INTEGER_MISSING; + this.hazardCause = ""; + this.hazardCondition = ""; + this.hazardIntensity = ""; + this.hazardType = "UNKNOWN"; + this.stateList = ""; + this.sigmetId = ""; } /** * Convstructs a non-consigmet record from a dataURI * - * @param uri The dataURI + * @param uri + * The dataURI */ public NonConvSigmetRecord(String uri) { super(uri); } - - @Override - public IDecoderGettable getDecoderGettable() { - // TODO Auto-generated method stub - return null; - } - - - /** - * @return the reportType - */ - public String getReportType() { - return reportType; - } - - - /** - * @param reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } - - - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } - - - /** - * @param wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } - - - /** - * @return the forecastRegion - */ - public String getForecastRegion() { - return forecastRegion; - } - - - /** - * @param forecastRegion to set - */ - public void setForecastRegion(String forecastRegion) { - this.forecastRegion = forecastRegion; - } - - - /** - * @return the issueOffice - */ - public String getIssueOffice() { - return issueOffice; - } - - - /** - * @param issueOffice to set - */ - public void setIssueOffice(String issueOffice) { - this.issueOffice = issueOffice; - } - - - /** - * @return the issueTime - */ - public Calendar getIssueTime() { - return issueTime; - } - - - /** - * @param issueTime to set - */ - public void setIssueTime(Calendar issueTime) { - this.issueTime = issueTime; - } - - - /** - * @return the designatorBBB - */ - public String getDesignatorBBB() { - return designatorBBB; - } - - - /** - * @param designatorBBB to set - */ - public void setDesignatorBBB(String designatorBBB) { - this.designatorBBB = designatorBBB; - } - - - /** - * @return the correctionFlag - */ - public String getCorrectionRemarks() { - return correctionRemarks; - } - - - /** - * @param correctionFlag to set - */ - public void setCorrectionRemarks(String correctionRemarks) { - this.correctionRemarks = correctionRemarks; - } - - - /** - * @return the awipsId - */ - public String getAwipsId() { - return awipsId; - } - - - /** - * @param awipsId to set - */ - public void setAwipsId(String awipsId) { - this.awipsId = awipsId; - } - - - /** - * @return the stateList - */ - public String getStateList() { - return stateList; - } - - - /** - * @param stateList to set - */ - public void setStateList(String stateList) { - this.stateList = stateList; - } - - - /** - * @return the startTime - */ - public Calendar getStartTime() { - return startTime; - } - - - /** - * @param startTime to set - */ - public void setStartTime(Calendar startTime) { - this.startTime = startTime; - } - - - /** - * @return the endTime - */ - public Calendar getEndTime() { - return endTime; - } - - - /** - * @param endTime to set - */ - public void setEndTime(Calendar endTime) { - this.endTime = endTime; - } - - - /** - * @return the hazardType - */ - public String getHazardType() { - return hazardType; - } - - - /** - * @param hazardType to set - */ - public void setHazardType(String hazardType) { - this.hazardType = hazardType; - } - - - /** - * @return the hazardIntensity - */ - public String getHazardIntensity() { - return hazardIntensity; - } - - - /** - * @param hazardIntensity to set - */ - public void setHazardIntensity(String hazardIntensity) { - this.hazardIntensity = hazardIntensity; - } + @Override + public IDecoderGettable getDecoderGettable() { + // TODO Auto-generated method stub + return null; + } /** - * @return the hazardCause - */ - public String getHazardCause() { - return hazardCause; - } - - - /** - * @param hazardCause to set - */ - public void setHazardCause(String hazardCause) { - this.hazardCause = hazardCause; - } - + * @return the reportType + */ + public String getReportType() { + return reportType; + } /** - * @return the hazardCondition - */ - public String getHazardCondition() { - return hazardCondition; - } - - - /** - * @param hazardCondition to set - */ - public void setHazardCondition(String hazardCondition) { - this.hazardCondition = hazardCondition; - } - + * @param reportType + * to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } /** - * @return the flightLevel1 - */ - public int getFlightLevel1() { - return flightLevel1; - } - - - /** - * @param flightLevel1 to set - */ - public void setFlightLevel1(int flightLevel1) { - this.flightLevel1 = flightLevel1; - } - + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } /** - * @return the flightLevel2 - */ - public int getFlightLevel2() { - return flightLevel2; - } - - - /** - * @param flightLevel2 to set - */ - public void setFlightLevel2(int flightLevel2) { - this.flightLevel2 = flightLevel2; - } - + * @param wmoHeader + * to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } /** - * @return the sigmetId - */ - public String getSigmetId() { - return sigmetId; - } - - - /** - * @param sigmetId to set - */ - public void setSigmetId(String sigmetId) { - this.sigmetId = sigmetId; - } - + * @return the forecastRegion + */ + public String getForecastRegion() { + return forecastRegion; + } /** - * @return the bullMessage - */ - public String getBullMessage() { - return bullMessage; - } + * @param forecastRegion + * to set + */ + public void setForecastRegion(String forecastRegion) { + this.forecastRegion = forecastRegion; + } + /** + * @return the issueOffice + */ + public String getIssueOffice() { + return issueOffice; + } - /** - * @param bullMessage to set - */ - public void setBullMessage(String bullMessage) { - this.bullMessage = bullMessage; - } + /** + * @param issueOffice + * to set + */ + public void setIssueOffice(String issueOffice) { + this.issueOffice = issueOffice; + } + /** + * @return the issueTime + */ + public Calendar getIssueTime() { + return issueTime; + } - /** - * @return the set of nonconvective sigmet location - */ - public Set getNonConvSigmetLocation() { - return nonConvSigmetLocation; - } + /** + * @param issueTime + * to set + */ + public void setIssueTime(Calendar issueTime) { + this.issueTime = issueTime; + } - /** - * @param nonconvsigmet the location to set - */ - public void setNonConvSigmetLocation(Set nonConvLocation) { - this.nonConvSigmetLocation = nonConvLocation; - } + /** + * @return the designatorBBB + */ + public String getDesignatorBBB() { + return designatorBBB; + } - /** - * @param add conv Sigmet location to set - */ - public void addNonConvSigmetLocation(NonConvSigmetLocation pLocation){ - nonConvSigmetLocation.add(pLocation); - - } - - - /** - * Override existing set method to modify any - * classes that use the dataURI as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) - { + /** + * @param designatorBBB + * to set + */ + public void setDesignatorBBB(String designatorBBB) { + this.designatorBBB = designatorBBB; + } + + /** + * @return the correctionFlag + */ + public String getCorrectionRemarks() { + return correctionRemarks; + } + + /** + * @param correctionFlag + * to set + */ + public void setCorrectionRemarks(String correctionRemarks) { + this.correctionRemarks = correctionRemarks; + } + + /** + * @return the awipsId + */ + public String getAwipsId() { + return awipsId; + } + + /** + * @param awipsId + * to set + */ + public void setAwipsId(String awipsId) { + this.awipsId = awipsId; + } + + /** + * @return the stateList + */ + public String getStateList() { + return stateList; + } + + /** + * @param stateList + * to set + */ + public void setStateList(String stateList) { + this.stateList = stateList; + } + + /** + * @return the startTime + */ + public Calendar getStartTime() { + return startTime; + } + + /** + * @param startTime + * to set + */ + public void setStartTime(Calendar startTime) { + this.startTime = startTime; + } + + /** + * @return the endTime + */ + public Calendar getEndTime() { + return endTime; + } + + /** + * @param endTime + * to set + */ + public void setEndTime(Calendar endTime) { + this.endTime = endTime; + } + + /** + * @return the hazardType + */ + public String getHazardType() { + return hazardType; + } + + /** + * @param hazardType + * to set + */ + public void setHazardType(String hazardType) { + this.hazardType = hazardType; + } + + /** + * @return the hazardIntensity + */ + public String getHazardIntensity() { + return hazardIntensity; + } + + /** + * @param hazardIntensity + * to set + */ + public void setHazardIntensity(String hazardIntensity) { + this.hazardIntensity = hazardIntensity; + } + + /** + * @return the hazardCause + */ + public String getHazardCause() { + return hazardCause; + } + + /** + * @param hazardCause + * to set + */ + public void setHazardCause(String hazardCause) { + this.hazardCause = hazardCause; + } + + /** + * @return the hazardCondition + */ + public String getHazardCondition() { + return hazardCondition; + } + + /** + * @param hazardCondition + * to set + */ + public void setHazardCondition(String hazardCondition) { + this.hazardCondition = hazardCondition; + } + + /** + * @return the flightLevel1 + */ + public int getFlightLevel1() { + return flightLevel1; + } + + /** + * @param flightLevel1 + * to set + */ + public void setFlightLevel1(int flightLevel1) { + this.flightLevel1 = flightLevel1; + } + + /** + * @return the flightLevel2 + */ + public int getFlightLevel2() { + return flightLevel2; + } + + /** + * @param flightLevel2 + * to set + */ + public void setFlightLevel2(int flightLevel2) { + this.flightLevel2 = flightLevel2; + } + + /** + * @return the sigmetId + */ + public String getSigmetId() { + return sigmetId; + } + + /** + * @param sigmetId + * to set + */ + public void setSigmetId(String sigmetId) { + this.sigmetId = sigmetId; + } + + /** + * @return the bullMessage + */ + public String getBullMessage() { + return bullMessage; + } + + /** + * @param bullMessage + * to set + */ + public void setBullMessage(String bullMessage) { + this.bullMessage = bullMessage; + } + + /** + * @return the set of nonconvective sigmet location + */ + public Set getNonConvSigmetLocation() { + return nonConvSigmetLocation; + } + + /** + * @param nonconvsigmet + * the location to set + */ + public void setNonConvSigmetLocation( + Set nonConvLocation) { + this.nonConvSigmetLocation = nonConvLocation; + } + + /** + * @param add + * conv Sigmet location to set + */ + public void addNonConvSigmetLocation(NonConvSigmetLocation pLocation) { + nonConvSigmetLocation.add(pLocation); + + } + + /** + * Override existing set method to modify any classes that use the dataURI + * as a foreign key + */ + @Override + public void setIdentifier(Object dataURI) { + + this.identifier = dataURI; + + } - this.identifier = dataURI; - - - - } - @Override @Column @Access(AccessType.PROPERTY) @@ -565,4 +537,8 @@ public class NonConvSigmetRecord extends PluginDataObject{ return super.getDataURI(); } + @Override + public String getPluginName() { + return "nonconvsigmet"; + } } \ No newline at end of file diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ntrans/src/gov/noaa/nws/ncep/common/dataplugin/ntrans/NtransRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ntrans/src/gov/noaa/nws/ncep/common/dataplugin/ntrans/NtransRecord.java index cc9f7d5f39..179a35f666 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ntrans/src/gov/noaa/nws/ncep/common/dataplugin/ntrans/NtransRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ntrans/src/gov/noaa/nws/ncep/common/dataplugin/ntrans/NtransRecord.java @@ -18,8 +18,6 @@ package gov.noaa.nws.ncep.common.dataplugin.ntrans; -import java.util.Calendar; - import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.Column; @@ -52,50 +50,46 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ntrans", - indexes = { - @Index(name = "ntrans_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ntrans", indexes = { @Index(name = "ntrans_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class NtransRecord extends PersistablePluginDataObject { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1L; @Column - @DataURI(position=1) + @DataURI(position = 1) @XmlElement @DynamicSerializeElement private String modelName; @Column - @DataURI(position=2) + @DataURI(position = 2) @XmlElement @DynamicSerializeElement - private String metafileName ; + private String metafileName; @Column - @DataURI(position=3) + @DataURI(position = 3) @XmlElement @DynamicSerializeElement private String productName; - @Column + @Column @XmlElement @DynamicSerializeElement private String validTimeString; - - @Column - @XmlElement - @DynamicSerializeElement - private String reportType; - - @Transient - private byte[] imageData; + + @Column + @XmlElement + @DynamicSerializeElement + private String reportType; + + @Transient + private byte[] imageData; @Column @XmlElement @@ -121,131 +115,130 @@ public class NtransRecord extends PersistablePluginDataObject { @XmlElement @DynamicSerializeElement private int totalFramesInFile; - - /** - * Default Constructor - */ - public NtransRecord() { - } - /** - * Constructs an NTRANS record from a dataURI - * + /** + * Default Constructor + */ + public NtransRecord() { + } + + /** + * Constructs an NTRANS record from a dataURI + * * @param uri * The dataURI - */ - public NtransRecord(String uri) { - super(uri); - } + */ + public NtransRecord(String uri) { + super(uri); + } - public String getModelName() { - return modelName; - } + public String getModelName() { + return modelName; + } - public void setModelName(String model) { - this.modelName = model; - } + public void setModelName(String model) { + this.modelName = model; + } - public String getMetafileName() { - return metafileName; - } + public String getMetafileName() { + return metafileName; + } - public void setMetafileName(String inputMetaFileName) { - this.metafileName = inputMetaFileName; - } + public void setMetafileName(String inputMetaFileName) { + this.metafileName = inputMetaFileName; + } - public String getValidTimeString() { - return validTimeString; - } + public String getValidTimeString() { + return validTimeString; + } - public void setValidTimeString(String validTimeString) { - this.validTimeString = validTimeString; - } + public void setValidTimeString(String validTimeString) { + this.validTimeString = validTimeString; + } - public String getProductName() { - return productName; - } + public String getProductName() { + return productName; + } - public void setProductName(String productNameString) { - this.productName = productNameString; - } + public void setProductName(String productNameString) { + this.productName = productNameString; + } - public String getReportType() { - return reportType; - } + public String getReportType() { + return reportType; + } - public void setReportType(String reportType) { - this.reportType = reportType; - } + public void setReportType(String reportType) { + this.reportType = reportType; + } - public byte[] getImageData() { - return imageData; - } + public byte[] getImageData() { + return imageData; + } - public void setImageData(byte[] imageData) { - this.imageData = imageData; - } + public void setImageData(byte[] imageData) { + this.imageData = imageData; + } - public int getImageSizeX() { - return imageSizeX; - } + public int getImageSizeX() { + return imageSizeX; + } - public void setImageSizeX(int imageSizeX) { - this.imageSizeX = imageSizeX; - } + public void setImageSizeX(int imageSizeX) { + this.imageSizeX = imageSizeX; + } - public int getImageSizeY() { - return imageSizeY; - } + public int getImageSizeY() { + return imageSizeY; + } - public void setImageSizeY(int imageSizeY) { - this.imageSizeY = imageSizeY; - } + public void setImageSizeY(int imageSizeY) { + this.imageSizeY = imageSizeY; + } - public int getImageByteCount() { - return imageByteCount; - } + public int getImageByteCount() { + return imageByteCount; + } - public void setImageByteCount(int imageByteCount) { - this.imageByteCount = imageByteCount; - } + public void setImageByteCount(int imageByteCount) { + this.imageByteCount = imageByteCount; + } - public int getFrameNumberInFile() { - return frameNumberInFile; - } + public int getFrameNumberInFile() { + return frameNumberInFile; + } - public void setFrameNumberInFile(int frameNumberInFile) { - this.frameNumberInFile = frameNumberInFile; - } + public void setFrameNumberInFile(int frameNumberInFile) { + this.frameNumberInFile = frameNumberInFile; + } - public int getTotalFramesInFile() { - return totalFramesInFile; - } + public int getTotalFramesInFile() { + return totalFramesInFile; + } - public void setTotalFramesInFile(int totalFramesInFile) { - this.totalFramesInFile = totalFramesInFile; - } + public void setTotalFramesInFile(int totalFramesInFile) { + this.totalFramesInFile = totalFramesInFile; + } - - @Override - public IDecoderGettable getDecoderGettable() { - // TODO Auto-generated method stub - return null; - } - - @Override + @Override + public IDecoderGettable getDecoderGettable() { + // TODO Auto-generated method stub + return null; + } + + @Override public IHDFFilePathProvider getHDFPathProvider() { return NtransPathProvider.getInstance(); } - public static long getSerialVersionUID() { - return serialVersionUID; - } + public static long getSerialVersionUID() { + return serialVersionUID; + } - @Override + @Override public void setIdentifier(Object dataURI) { - this.identifier = dataURI; - } + this.identifier = dataURI; + } @Override @Column @@ -253,4 +246,9 @@ public class NtransRecord extends PersistablePluginDataObject { public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "ntrans"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.pgen/src/gov/noaa/nws/ncep/common/dataplugin/pgen/PgenRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.pgen/src/gov/noaa/nws/ncep/common/dataplugin/pgen/PgenRecord.java index c7f1b9d8c4..be7d03d2dc 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.pgen/src/gov/noaa/nws/ncep/common/dataplugin/pgen/PgenRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.pgen/src/gov/noaa/nws/ncep/common/dataplugin/pgen/PgenRecord.java @@ -30,9 +30,10 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Apr 22, 2013 sgilbert Initial creation - * Jun 26, 2013 bhebbard Added SequenceGenerator annotation - * Jul 22, 2013 1977 rjpeter Added getDataURI and annotations. + * Apr 22, 2013 sgilbert Initial creation + * Jun 26, 2013 bhebbard Added SequenceGenerator annotation + * Jul 22, 2013 1977 rjpeter Added getDataURI and annotations. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author sgilbert @@ -270,4 +271,9 @@ public class PgenRecord extends PersistablePluginDataObject { public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "pgen"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.sgwh/src/gov/noaa/nws/ncep/common/dataplugin/sgwh/SgwhRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.sgwh/src/gov/noaa/nws/ncep/common/dataplugin/sgwh/SgwhRecord.java index 59459131cb..90bf018bd1 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.sgwh/src/gov/noaa/nws/ncep/common/dataplugin/sgwh/SgwhRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.sgwh/src/gov/noaa/nws/ncep/common/dataplugin/sgwh/SgwhRecord.java @@ -1,26 +1,3 @@ -/** - * SgwhRecord - * This java class performs the mapping to the database for BUFR Sgwh. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date			Ticket#		Engineer	Description
- * ------------ -----------	----------- --------------------------
- * Aug17 2011	   		    Chin Chen	Initial Coding (Following BufrsgwhRecord to refactor for 
- * 										saving data to HDF5)
- * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
- * Apr 8, 2013  1293        bkowal      Removed references to hdffileid.
- * Apr 12, 2013 1857        bgonzale    Added SequenceGenerator annotation.
- * May 07, 2013 1869       	bsteffen    Remove dataURI column from
- *                                      PluginDataObject.
- *
- * 
- * - * @author chin chen - * @version 1.0 - */ package gov.noaa.nws.ncep.common.dataplugin.sgwh; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; @@ -50,6 +27,30 @@ import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * SgwhRecord This java class performs the mapping to the database for BUFR + * Sgwh. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------- ----------- --------------------------
+ * Aug17 2011               Chin Chen   Initial Coding (Following BufrsgwhRecord
+ *                                      to refactor for  saving data to HDF5)
+ * Apr 04, 2013 1846        bkowal      Added an index on refTime and
+ *                                      forecastTime
+ * Apr 08, 2013 1293        bkowal      Removed references to hdffileid.
+ * Apr 12, 2013 1857        bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 1869        bsteffen    Remove dataURI column from
+ *                                      PluginDataObject.
+ * Aug 30, 2013 2298        rjpeter     Make getPluginName abstract
+ * 
+ * + * @author chin chen + * @version 1.0 + */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "sgwhseq") @Table(name = "sgwh", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -57,1674 +58,1613 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "sgwh", - indexes = { - @Index(name = "sgwh_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "sgwh", indexes = { @Index(name = "sgwh_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class SgwhRecord extends PluginDataObject implements IDecoderGettable, - IPointData, IPersistable { - private static final long serialVersionUID = 1L; - - /** Satellite Identification */ - @Column - @DataURI(position = 1) - @DynamicSerializeElement - private Long said; - - /** Software Identification */ - @Column - @DynamicSerializeElement - private Long swid; - - /** Identification of the originating/generating center */ - @Column - @DynamicSerializeElement - private Long ogce; - - /** Satellite sensor indicator, first occurrence */ - @Column - @DynamicSerializeElement - private Long ssin1; - - /** Satellite sensor indicator, second occurrence */ - @Column - @DynamicSerializeElement - private Long ssin2; - - /** Orbit Number */ - @Column - @DataURI(position = 2) - @DynamicSerializeElement - private Long orbn; - - /** Height of station in meters */ - @Column - @DynamicSerializeElement - private Double selv = IDecoderConstantsN.DOUBLE_MISSING; - - /** Height increment in meters */ - @Column - @DynamicSerializeElement - private Double hinc = IDecoderConstantsN.DOUBLE_MISSING; - - /** Observation time */ - @Column - @DataURI(position = 3) - @DynamicSerializeElement - private Calendar obsTime; - - /** Latitude */ - @Column - @DataURI(position = 4) - @DynamicSerializeElement - private Double clath = IDecoderConstantsN.DOUBLE_MISSING; - - /** Longitude */ - @Column - @DataURI(position = 5) - @DynamicSerializeElement - private Double clonh = IDecoderConstantsN.DOUBLE_MISSING; - - /** Remotely sensed surface type */ - @Transient - @DynamicSerializeElement - private Long rsst; - - /** Altimeter echo type */ - @Transient - @DynamicSerializeElement - private Long aetp; - - /** Land/Sea qualifier */ - @Transient - @DynamicSerializeElement - private Long lsql; - - /** Altimeter state flag */ - @Transient - @DynamicSerializeElement - private Long asfl; - - /** Radiometer state flag */ - @Transient - @DynamicSerializeElement - private Long rsfl; - - /** 3D error estimate of the navigator orbit */ - @Transient - @DynamicSerializeElement - private Long eeno; - - /** Associated field significance for sgwh */ - @Transient - @DynamicSerializeElement - private Long afssgwh; - - /** Significant wave height in meters */ - @Transient - @DynamicSerializeElement - private Double sgwh = IDecoderConstantsN.DOUBLE_MISSING; - - /** First order statistics */ - @Transient - @DynamicSerializeElement - private Long fostsgwh; - - /** Significant wave height (standard deviation) in meters */ - @Transient - @DynamicSerializeElement - private Double sgwhstd = IDecoderConstantsN.DOUBLE_MISSING; - - /** Number of valid points per second used to derive previous parameters */ - @Transient - @DynamicSerializeElement - private Long nvpp; - - /** Type of Band for 1st replication */ - @Transient - @DynamicSerializeElement - private Long tobdg1r1; - - /** Type of Band for 2nd replication */ - @Transient - @DynamicSerializeElement - private Long tobdg1r2; - - /** - * Associated field significance for group 1, replication 1, first - * occurrence - */ - @Transient - @DynamicSerializeElement - private Long afsbkstg1r1; - - /** - * Associated field significance for group 1, replication 2, first - * occurrence - */ - @Transient - @DynamicSerializeElement - private Long afsbkstg1r2; - - /** Backscatter in decibels for group 1 rep 1 */ - @Transient - @DynamicSerializeElement - private Double bkstg1r1 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Backscatter in decibels for group 1 rep 2 */ - @Transient - @DynamicSerializeElement - private Double bkstg1r2 = IDecoderConstantsN.DOUBLE_MISSING; - - /** fost for bkst for group 1, replication 1, first fost occurrence */ - @Transient - @DynamicSerializeElement - private Long fostbkstg1r1; - - /** fost for bkst for group 1, replication 2, first fost occurrence */ - @Transient - @DynamicSerializeElement - private Long fostbkstg1r2; - - /** Backscatter Standard Deviation in decibels for group 1 rep 1 */ - @Transient - @DynamicSerializeElement - private Double bkststdg1r1 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Backscatter Standard Deviation in decibels for group 1 rep 2 */ - @Transient - @DynamicSerializeElement - private Double bkststdg1r2 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Square of the off-nadir angle in degrees squared */ - @Transient - @DynamicSerializeElement - private Double sona; - - /** - * Associated Field Significance for Square of the off-nadir angle in - * degrees squared - */ - @Transient - @DynamicSerializeElement - private Long afssona; - - /** Radiometer water vapor content in kg per square meter */ - @Transient - @DynamicSerializeElement - private Double rwvc = IDecoderConstantsN.DOUBLE_MISSING; - - /** Radiometer liquid content in kg per square meter */ - @Transient - @DynamicSerializeElement - private Double rlqc = IDecoderConstantsN.DOUBLE_MISSING; - - /** - * Associated field significance for group 1, replication 1, second - * occurrence - */ - @Transient - @DynamicSerializeElement - private Long afsselvg1r1; - - /** - * Associated field significance for group 1, replication 2, second - * occurrence - */ - @Transient - @DynamicSerializeElement - private Long afsselvg1r2; - - /** Height of station for 1st replication */ - @Transient - @DynamicSerializeElement - private Double selvg1r1 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Height of station for 2nd replication */ - @Transient - @DynamicSerializeElement - private Double selvg1r2 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Height increment in meters for 1st replication */ - @Transient - @DynamicSerializeElement - private Double hincg1r1 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Height increment in meters for snd replication */ - @Transient - @DynamicSerializeElement - private Double hincg1r2 = IDecoderConstantsN.DOUBLE_MISSING; - - /** fost for selv for group 1, replication 1, second fost occurrence */ - @Transient - @DynamicSerializeElement - private Long fostselvg1r1; - - /** fost for selv for group 1, replication 2, second fost occurrence */ - @Transient - @DynamicSerializeElement - private Long fostselvg1r2; - - /** Std of Height of station for 1st replication */ - @Transient - @DynamicSerializeElement - private Double selvstdg1r1 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Std of Height of station for 2nd replication */ - @Transient - @DynamicSerializeElement - private Double selvstdg1r2 = IDecoderConstantsN.DOUBLE_MISSING; - - /** - * Number of valid points per second used to derive previous parameters for - * 1st replication - */ - @Transient - @DynamicSerializeElement - private Long nvppg1r1; - - /** - * Number of valid points per second used to derive previous parameters for - * 2nd replication - */ - @Transient - @DynamicSerializeElement - private Long nvppg1r2; - - /** MEFR Mean Frequency for group 2 for 1st replication */ - @Transient - @DynamicSerializeElement - private Double mefrg2r1 = IDecoderConstantsN.DOUBLE_MISSING; - - /** mefr Mean Frequency for group 2 for 2nd replication */ - @Transient - @DynamicSerializeElement - private Double mefrg2r2 = IDecoderConstantsN.DOUBLE_MISSING; - - /** mefr Mean Frequency for group 2 for 3rd replication */ - @Transient - @DynamicSerializeElement - private Double mefrg2r3 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Associated field significance for tmbr for group 2, replication 1 */ - @Transient - @DynamicSerializeElement - private Long afstmbrg2r1; - - /** Associated field significance for tmbr for group 2, replication 2 */ - @Transient - @DynamicSerializeElement - private Long afstmbrg2r2; - - /** Associated field significance for tmbr for group 2, replication 3 */ - @Transient - @DynamicSerializeElement - private Long afstmbrg2r3; - - /** Brightness temperature tmbrg2r1 in K for group 2, rep 1 */ - @Transient - @DynamicSerializeElement - private Double tmbrg2r1 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Brightness temperature tmbrg2r2 in K for group 2 rep 2 */ - @Transient - @DynamicSerializeElement - private Double tmbrg2r2 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Brightness temperature tmbrg2r3 in K for group 2 rep 3 */ - @Transient - @DynamicSerializeElement - private Double tmbrg2r3 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Satellite-derived wind computation method swcmg3r1 for group 3 rep 1 */ - @Transient - @DynamicSerializeElement - private Long swcmg3r1; - - /** Satellite-derived wind computation method swcmg3r1 for group 3 rep 2 */ - @Transient - @DynamicSerializeElement - private Long swcmg3r2; - - /** Wind speed at 10 m; in meters per second; for group 3 rep 1 */ - @Transient - @DynamicSerializeElement - private Double ws10g3r1 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Wind speed at 10 m; in meters per second; for group 3 rep 2 */ - @Transient - @DynamicSerializeElement - private Double ws10g3r2 = IDecoderConstantsN.DOUBLE_MISSING; - - /** Report type */ - // @Column(length=8) - @Transient - @DynamicSerializeElement - @DataURI(position=6) - private String reportType; - - /** Text of the WMO header */ - @Column(length = 32) - @DynamicSerializeElement - private String wmoHeader; - - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - /** - * Empty constructor. - */ - public SgwhRecord() { - } - - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - */ - public SgwhRecord(String uri) { - super(uri); - } - - /** - * Get the observation report type. - * - * @return the reportType - */ - public String getReportType() { - return reportType; - } - - /** - * Set the observation report type. - * - * @param reportType - * the reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } - - /** - * Get the Satellite Identifier. - * - * @return the Satellite ID - */ - public Long getSaid() { - return said; - } - - /** - * Set the Satellite Identifier. - * - * @param said - * the Satellite ID to set - */ - public void setSaid(Long said) { - this.said = said; - } - - /** - * @param swid - * the Software Identification to get - */ - /** - * @return the swid - */ - public Long getSwid() { - return swid; - } - - /** - * @param swid - * the Software Identification to set - */ - public void setSwid(Long swid) { - this.swid = swid; - } - - /** - * @param ogce - * the Identification of originating/generating center to return - */ - /** - * @return the ogce - */ - public Long getOgce() { - return ogce; - } - - /** - * @param ogce - * the Identification of originating/generating center to set - */ - public void setOgce(Long ogce) { - this.ogce = ogce; - } - - /** - * @param ssin1 - * the Satellite Sensor Indicator 1 to return - */ - /** - * @return the ssin1 - */ - public Long getSsin1() { - return ssin1; - } - - /** - * @param ssin - * the Satellite Sensor Indicator 1 to set - */ - public void setSsin1(Long ssin1) { - this.ssin1 = ssin1; - } - - /** - * @param ssin - * the Satellite Sensor Indicator 2 to return - */ - /** - * @return the ssin2 - */ - public Long getSsin2() { - return ssin2; - } - - /** - * @param ssin2 - * the Satellite Sensor Indicator 2 to set - */ - public void setSsin2(Long ssin2) { - this.ssin2 = ssin2; - } - - /** - * @param orbn - * the Orbit number to return - */ - /** - * @return the orbn - */ - public Long getOrbn() { - return orbn; - } - - /** - * @param orbn - * the Orbit number to set - */ - public void setOrbn(Long orbn) { - this.orbn = orbn; - } - - /** - * @param selv - * height of station to return - */ - /** - * @return the selv - */ - public Double getSelv() { - return selv; - } - - /** - * @param selv - * the height of elevation to set - */ - public void setSelv(Double selv) { - this.selv = selv; - } - - /** - * @param hinc - * height increment to return - */ - /** - * @return the hinc - */ - public Double getHinc() { - return hinc; - } - - /** - * @param hinc - * the height increment to set - */ - public void setHinc(Double hinc) { - this.hinc = hinc; - } - - /** - * @return the clath - */ - public Double getClath() { - return clath; - } - - /** - * @param clath - * the clath to set - */ - public void setClath(Double clath) { - this.clath = clath; - } - - /** - * @return the clonh - */ - public Double getClonh() { - return clonh; - } - - /** - * @param clonh - * the clonh to set - */ - public void setClonh(Double clonh) { - this.clonh = clonh; - } - - /** - * @param rsst - * remotely sensed surface type to return - */ - /** - * @return the rsst - */ - public Long getRsst() { - return rsst; - } - - /** - * @param rsst - * the remotely sensed surface type to set - */ - public void setRsst(Long rsst) { - this.rsst = rsst; - } - - /** - * @param aetp - * remotely sensed surface type to return - */ - /** - * @return the aetp - */ - public Long getAetp() { - return aetp; - } - - /** - * @param aetp - * the remotely sensed surface type to set - */ - public void setAetp(Long aetp) { - this.aetp = aetp; - } - - /** - * @param lsql - * land/sea qualifier to return - */ - /** - * @return the lsql - */ - public Long getLsql() { - return lsql; - } - - /** - * @param lsql - * land/sea qualifer to set - */ - public void setLsql(Long lsql) { - this.lsql = lsql; - } - - /** - * @param asfl - * altimeter state flag to return - */ - /** - * @return the asfl - */ - public Long getAsfl() { - return asfl; - } - - /** - * @param asfl - * the altimeter state flag to set - */ - public void setAsfl(Long asfl) { - this.asfl = asfl; - } - - /** - * @param rsfl - * radiometer state flag to return - */ - /** - * @return the rsfl - */ - public Long getRsfl() { - return rsfl; - } - - /** - * @param rsfl - * the radiometer state flag to set - */ - public void setRsfl(Long rsfl) { - this.rsfl = rsfl; - } - - /** - * @param eeno - * three dimensional error estimate of the navigator orbit to - * return - */ - /** - * @return the eeno - */ - public Long getEeno() { - return eeno; - } - - /** - * @param eeno - * three dimensional error estimate of the navigator orbit to set - */ - public void setEeno(Long eeno) { - this.eeno = eeno; - } - - /** - * @param afssgwh - * associated field significance for sgwh to return - */ - /** - * @return the afssgwh - */ - public Long getAfssgwh() { - return afssgwh; - } - - /** - * @param afssgwh - * associated field significance for sgwh to set - */ - public void setAfssgwh(Long afssgwh) { - this.afssgwh = afssgwh; - } - - /** - * @param sgwh - * significant wave height to return - */ - /** - * @return the sgwh - */ - public Double getSgwh() { - return sgwh; - } - - /** - * @param sgwh - * significant wave height to set - */ - public void setSgwh(Double sgwh) { - this.sgwh = sgwh; - } - - /** - * @param sgwh - * significant wave height (standard deviation) to return - */ - /** - * @return the sgwhStd - */ - public Double getSgwhstd() { - return sgwhstd; - } - - /** - * @param sgwh - * significant wave height to set - */ - public void setSgwhstd(Double sgwhstd) { - this.sgwhstd = sgwhstd; - } - - /** - * @param fostsgwh - * first order statistics for sgwh to return - */ - /** - * @return the fostsgwh - */ - public Long getFostsgwh() { - return fostsgwh; - } - - /** - * @param fostsgwh - * first order statistics for sgwh to set - */ - public void setFostsgwh(Long fostsgwh) { - this.fostsgwh = fostsgwh; - } - - /** - * @param nvpp - * number of valid points per sec used to derive previous - * parameters to return - */ - /** - * @return the nvpp - */ - public Long getNvpp() { - return nvpp; - } - - /** - * @param nvpp - * number of valid points per sec used to derive previous - * parameters to set - */ - public void setNvpp(Long nvpp) { - this.nvpp = nvpp; - } - - /** - * @param tobdg1r1 - * type of band for 1st replication to return - */ - /** - * @return the tobdg1r1 - */ - public Long getTobdg1r1() { - return tobdg1r1; - } - - /** - * @param tbnd - * type of band for 1st replication to set - */ - public void setTobdg1r1(Long tobdg1r1) { - this.tobdg1r1 = tobdg1r1; - } - - /** - * @param tobdg1r2 - * type of band for 2nd replication to return - */ - /** - * @return the tobdg1r2 - */ - public Long getTobdg1r2() { - return tobdg1r2; - } - - /** - * @param tobdg1r2 - * type of band for 2nd replication to set - */ - public void setTobdg1r2(Long tobdg1r2) { - this.tobdg1r2 = tobdg1r2; - } - - /** - * @param afsbkstg1r1 - * associated field sig. bkst in group1, 1st replication to - * return - */ - /** - * @return the afsbkstg1r1 - */ - public Long getAfsbkstg1r1() { - return afsbkstg1r1; - } - - /** - * @param afsbkstg1r1 - * associated field sig. for bkst in group 1, 1st replication to - * set - */ - public void setAfsbkstg1r1(Long afsbkstg1r1) { - this.afsbkstg1r1 = afsbkstg1r1; - } - - /** - * @param afsbkstg1r2 - * associated field sig for bkst in group 1, 2nd replication to - * return - */ - /** - * @return the afsbkstg1r2 - */ - public Long getAfsbkstg1r2() { - return afsbkstg1r2; - } - - /** - * @param afsbkstg1r2 - * associated field sig for bkst in group 1, 2nd replication to - * set - */ - public void setAfsbkstg1r2(Long afsbkstg1r2) { - this.afsbkstg1r2 = afsbkstg1r2; - } - - /** - * @param afsselvg1r1 - * associated field sig for selv in group 1, 1st replication to - * return - */ - /** - * @return the afsselvg1r1 - */ - public Long getAfsselvg1r1() { - return afsselvg1r1; - } - - /** - * @param afsselvg1r1 - * associated field sig for selv in group 1, 1st replication to - * set - */ - public void setAfsselvg1r1(Long afsselvg1r1) { - this.afsselvg1r1 = afsselvg1r1; - } - - /** - * @param afsselvg1r2b - * associated field sig for selv in group 1, 2nd replication to - * return - */ - /** - * @return the afsselvg1r2 - */ - public Long getAfsselvg1r2() { - return afsselvg1r2; - } - - /** - * @param afsselvg1r2b - * associated field sig for selv in group 1 for 2nd replication - * to set - */ - public void setAfsselvg1r2(Long afsselvg1r2) { - this.afsselvg1r2 = afsselvg1r2; - } - - /** - * @param fostbkstg1r1 - * fost for bkst for group 1, 1st replication to return - */ - /** - * @return the fostbkstg1r1 - */ - public Long getFostbkstg1r1() { - return fostbkstg1r1; - } - - /** - * @param fostbkstg1r1 - * fost for bkst for group 1, 1st replication to set - */ - public void setFostbkstg1r1(Long fostbkstg1r1) { - this.fostbkstg1r1 = fostbkstg1r1; - } - - /** - * @param fostbkstg1r2 - * fost for bkst for group 1, 2nd replication to return - */ - /** - * @return the fostbkstg1r2 fost for bkst for group 1, 2nd replication to - * set - */ - public Long getFostbkstg1r2() { - return fostbkstg1r2; - } - - /** - * @param afsg1r2 - * associated field sig for 1st occurrence in group 1, 2nd - * replication to set - */ - public void setFostbkstg1r2(Long fostbkstg1r2) { - this.fostbkstg1r2 = fostbkstg1r2; - } - - /** - * @param bkstg1r1 - * backscatter to return - */ - /** - * @return the bkstg1r1 - */ - public Double getBkstg1r1() { - return bkstg1r1; - } - - /** - * @param bkst - * backscatter to set - */ - public void setBkstg1r1(Double bkstg1r1) { - this.bkstg1r1 = bkstg1r1; - } - - /** - * @param bkststdg1r1 - * backscatter standard deviation to return - */ - /** - * @return the bkststdg1r1 - */ - public Double getBkststdg1r1() { - return bkststdg1r1; - } - - /** - * @param bkststdg1r1 - * backscatter standard deviation to set - */ - public void setBkststdg1r1(Double bkststdg1r1) { - this.bkststdg1r1 = bkststdg1r1; - } - - /** - * @param bkstg1r2 - * backscatter to return - */ - /** - * @return the bkstg1r2 - */ - public Double getBkstg1r2() { - return bkstg1r2; - } - - /** - * @param bkstg1r2 - * backscatter to set - */ - public void setBkstg1r2(Double bkstg1r2) { - this.bkstg1r2 = bkstg1r2; - } - - /** - * @param bkststdg1r2 - * backscatter standard deviation to return - */ - /** - * @return the bkststdg1r2 - */ - public Double getBkststdg1r2() { - return bkststdg1r2; - } - - /** - * @param bkststdg1r - * backscatter standard deviation to set - */ - public void setBkststdg1r2(Double bkststdg1r2) { - this.bkststdg1r2 = bkststdg1r2; - } - - /** - * @param fostselvg1r1 - * fost for selv for group 1, 1st replication to return - */ - /** - * @return the fostselvg1r1 - */ - public Long getFostselvg1r1() { - return fostselvg1r1; - } - - /** - * @param fostselvg1r1 - * fost for selv for group 1, 1st replication to set - */ - public void setFostselvg1r1(Long fostselvg1r1) { - this.fostselvg1r1 = fostselvg1r1; - } - - /** - * @param fostselvg1r2 - * fost for selv for group 1, 2nd replication to return - */ - /** - * @return the fostselvg1r2 - */ - public Long getFostselvg1r2() { - return fostselvg1r2; - } - - /** - * @param fostselvg1r2 - * fost for selv for 1st occurrence in group 1, 2nd replication - * to set - */ - public void setFostselvg1r2(Long fostselvg1r2) { - this.fostselvg1r2 = fostselvg1r2; - } - - /** - * @param selvg1r1 - * elevation of satellite in group 1 replication 1 to return - */ - /** - * @return the selvg1r1 - */ - public Double getSelvg1r1() { - return selvg1r1; - } - - /** - * @param selv - * elevation of satellite in group 1 replication 1 to set - */ - public void setSelvg1r1(Double selvg1r1) { - this.selvg1r1 = selvg1r1; - } - - /** - * @param selvg1r2 - * elevation of satellite in group 1 replication 2 to return - */ - /** - * @return the selvg1r2 - */ - public Double getSelvg1r2() { - return selvg1r2; - } - - /** - * @param selvg1r2 - * elevation of satellite in group 1 replication 2 to set - */ - public void setSelvg1r2(Double selvg1r2) { - this.selvg1r2 = selvg1r2; - } - - /** - * @param hincg1r1 - * height increment in group 1 replication 1 to return - */ - /** - * @return the hincg1r1 - */ - public Double getHincg1r1() { - return hincg1r1; - } - - /** - * @param hincg1r1 - * height increment in group 1 replication 1 to set - */ - public void setHincg1r1(Double hincg1r1) { - this.hincg1r1 = hincg1r1; - } - - /** - * @param hincg1r2 - * height increment in group 1 replication 2 to return - */ - /** - * @return the hincg1r2 - */ - public Double getHincg1r2() { - return hincg1r2; - } - - /** - * @param hincg1r1 - * height increment in group 1 replication 2 to set - */ - public void setHincg1r2(Double hincg1r2) { - this.hincg1r2 = hincg1r2; - } - - /** - * @param selvstdg1r1 - * std of elevation of satellite in group 1 replication 1 to - * return - */ - /** - * @return the selvstdg1r1 - */ - public Double getSelvstdg1r1() { - return selvstdg1r1; - } - - /** - * @param selvstdg1r1 - * elevation of satellite in group 1 replication 2 to set - */ - public void setSelvstdg1r1(Double selvstdg1r1) { - this.selvstdg1r1 = selvstdg1r1; - } - - /** - * @param selvstdg1r2 - * std of elevation of satellite in group 1 replication 1 to - * return - */ - /** - * @return the selvstdg1r2 - */ - public Double getSelvstdg1r2() { - return selvstdg1r2; - } - - /** - * @param selvstdg1r2 - * elevation of satellite in group 1 replication 2 to set - */ - public void setSelvstdg1r2(Double selvstdg1r2) { - this.selvstdg1r2 = selvstdg1r2; - } - - /** - * @param nvppg1r1 - * number of valid points per sec used to derive previous - * parameters in group 1 replication 1 to return - */ - /** - * @return the nvppg1r1 - */ - public Long getNvppg1r1() { - return nvppg1r1; - } - - /** - * @param nvppg1r1 - * number of valid points per sec used to derive previous - * parameters in group 1 replication 1 to set - */ - public void setNvppg1r1(Long nvppg1r1) { - this.nvppg1r1 = nvppg1r1; - } - - /** - * @param nvppg1r2 - * number of valid points per sec used to derive previous - * parameters in group 1 replication 2 to return - */ - /** - * @return the nvppg1r1 - */ - public Long getNvppg1r2() { - return nvppg1r2; - } - - /** - * @param nvppg1r2 - * number of valid points per sec used to derive previous - * parameters in group 1 replication 2 to set - */ - public void setNvppg1r2(Long nvppg1r2) { - this.nvppg1r2 = nvppg1r2; - } - - /** - * @param afssona - * Associated Field Significance of Square of the off-nadir angle - * to return - */ - /** - * @return the afssona - */ - public Long getAfssona() { - return afssona; - } - - /** - * @param afssona - * Assocaited Field Significance of sona to set - */ - public void setAfssona(Long afssona) { - this.afssona = afssona; - } - - /** - * @param sona - * Square of the off-nadir angle to return - */ - /** - * @return the sona - */ - public Double getSona() { - return sona; - } - - /** - * @param sona - * Square of the off-nadir angle to set - */ - public void setSona(Double sona) { - this.sona = sona; - } - - /** - * @param mefrg2r1 - * mean frequency in hz for group 2 rep 1 to return - */ - /** - * @return the mefrg2r1 - */ - public Double getMefrg2r1() { - return mefrg2r1; - } - - /** - * @param mefrg2r1 - * mean frequency for group 2 rep 1 to set - */ - public void setMefrg2r1(Double mefrg2r1) { - this.mefrg2r1 = mefrg2r1; - } - - /** - * @param mefrg2r2 - * mean frequency in hz for group 2 rep 2 to return - */ - /** - * @return the mefrg2r2 - */ - public Double getMefrg2r2() { - return mefrg2r2; - } - - /** - * @param mefrg2r2 - * mean frequency for group 2 rep 2 to set - */ - public void setMefrg2r2(Double mefrg2r2) { - this.mefrg2r2 = mefrg2r2; - } - - /** - * @param mefrg2r3 - * mean frequency in hz for group 2 rep 3 to return - */ - /** - * @return the mefrg2r3 - */ - public Double getMefrg2r3() { - return mefrg2r3; - } - - /** - * @param mefrg2r3 - * mean frequency for group 2 rep 3 to set - */ - public void setMefrg2r3(Double mefrg2r3) { - this.mefrg2r3 = mefrg2r3; - } - - /** - * @param afstmbrg2r1 - * associated field sig for tmbr in group 2, 1st replication to - * return - */ - /** - * @return the afstmbrg2r1 - */ - public Long getAfstmbrg2r1() { - return afstmbrg2r1; - } - - /** - * @param afstmbrg2r1 - * associated field sig for tmbr in group 2, 1st replication to - * set - */ - public void setAfstmbrg2r1(Long afstmbrg2r1) { - this.afstmbrg2r1 = afstmbrg2r1; - } - - /** - * @param afstmbrg2r2b - * associated field sig for tmbr in group 2, 2nd replication to - * return - */ - /** - * @return the afstmbrg2r2 - */ - public Long getAfstmbrg2r2() { - return afstmbrg2r2; - } - - /** - * @param afstmbrg2r2b - * associated field sig for tmbr in group 2 for 2nd replication - * to set - */ - public void setAfstmbrg2r2(Long afstmbrg2r2) { - this.afstmbrg2r2 = afstmbrg2r2; - } - - /** - * @param afstmbrg2r3 - * associated field sig for tmbr in group 2, 3rd replication to - * return - */ - /** - * @return the afstmbrg2r3 - */ - public Long getAfstmbrg2r3() { - return afstmbrg2r3; - } - - /** - * @param afstmbrg2r3 - * associated field sig for tmbr in group 2, 3rd replication to - * set - */ - public void setAfstmbrg2r3(Long afstmbrg2r3) { - this.afstmbrg2r3 = afstmbrg2r3; - } - - /** - * @param tmbrg2r1 - * brightness temperature in K for group 2 rep 1 to return - */ - /** - * @return the tmbrg2r1 - */ - public Double getTmbrg2r1() { - return tmbrg2r1; - } - - /** - * @param tmbrg2r1 - * brightness temperaturefor group 2 rep 1 to set - */ - public void setTmbrg2r1(Double tmbrg2r1) { - this.tmbrg2r1 = tmbrg2r1; - } - - /** - * @param tmbrg2r2 - * brightness temperature in K for group 2 rep 2 to return - */ - /** - * @return the tmbrg2r2 - */ - public Double getTmbrg2r2() { - return tmbrg2r2; - } - - /** - * @param tmbrg2r2 - * brightness temperaturefor group 2 rep 2 to set - */ - public void setTmbrg2r2(Double tmbrg2r2) { - this.tmbrg2r2 = tmbrg2r2; - } - - /** - * @param tmbrg2r3 - * brightness temperature in K for group 2 rep 3 to return - */ - /** - * @return the tmbrg2r3 - */ - public Double getTmbrg2r3() { - return tmbrg2r3; - } - - /** - * @param tmbrg2r3 - * mean frequency for group 2 rep 3 to set - */ - public void setTmbrg2r3(Double tmbrg2r3) { - this.tmbrg2r3 = tmbrg2r3; - } - - /** - * @param swcmg3r1 - * satellite-derived wind computation method for group 3 rep 1 to - * return - */ - /** - * @return the swcmg3r1 - */ - public Long getSwcmg3r1() { - return swcmg3r1; - } - - /** - * @param swcmg3r1 - * satellite-derived wind computation method for group 3 rep 1 to - * set - */ - public void setSwcmg3r1(Long swcmg3r1) { - this.swcmg3r1 = swcmg3r1; - } - - /** - * @param swcmg3r2 - * satellite-derived wind computation method for group 3 rep 2 to - * return - */ - /** - * @return the swcmg3r2 - */ - public Long getSwcmg3r2() { - return swcmg3r2; - } - - /** - * @param swcmg3r2 - * satellite-derived wind computation method for group 3 rep 2 to - * set - */ - public void setSwcmg3r2(Long swcmg3r2) { - this.swcmg3r2 = swcmg3r2; - } - - /** - * @param ws10g3r1 - * wind speed at 10 m for group 3 rep 1 to return - */ - /** - * @return the ws10g3r1 - */ - public Double getWs10g3r1() { - return ws10g3r1; - } - - /** - * @param ws10g3r1 - * wind speed at 10 m to set - */ - public void setWs10g3r1(Double ws10g3r1) { - this.ws10g3r1 = ws10g3r1; - } - - /** - * @param ws10g3r1 - * wind speed at 10 m for group 3 rep 2 to return - */ - /** - * @return the ws10g3r2 - */ - public Double getWs10g3r2() { - return ws10g3r2; - } - - /** - * @param ws10g3r1 - * wind speed at 10 m to set - */ - public void setWs10g3r2(Double ws10g3r2) { - this.ws10g3r2 = ws10g3r2; - } - - /** - * @param rwvc - * radiometer liquid content to return - */ - /** - * @return the rwvc - */ - public Double getRwvc() { - return rwvc; - } - - /** - * @param rwvc - * radiometer liquid content to set - */ - public void setRwvc(Double rwvc) { - this.rwvc = rwvc; - } - - /** - * @param rlqc - * radiometer liquid content to return - */ - /** - * @return the rlqc - */ - public Double getRlqc() { - return rlqc; - } - - /** - * @param rlqc - * radiometer liquid content to set - */ - public void setRlqc(Double rlqc) { - this.rlqc = rlqc; - } - - /** - * @return the wmoHeader - */ - public String getWmoHeader() { - return wmoHeader; - } - - /** - * @param wmoHeader - * the wmoHeader to set - */ - public void setWmoHeader(String wmoHeader) { - this.wmoHeader = wmoHeader; - } - - /** - * @return the obsTime - */ - public Calendar getObsTime() { - return obsTime; - } - - /** - * @param obsTime - * the obsTime to set - */ - public void setObsTime(Calendar obsTime) { - this.obsTime = obsTime; - } - - /** - * Get the value and units of a named parameter within this observation. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return An Amount with value and units. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Amount getValue(String paramName) { - return null; - } - - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public String getString(String paramName) { - return null; - } - - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Collection getValues(String paramName) { - return null; - } - - /** - * Get the IDecoderGettable reference for this record. - * - * @return The IDecoderGettable reference for this record. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return this; - } - - @Override - public void setDataURI(String dataURI) { - identifier = dataURI; - } - - @Override - public String[] getStrings(String paramName) { - return null; - } - - @Override - public Date getPersistenceTime() { - return this.dataTime.getRefTime(); - - } - - @Override - public void setPersistenceTime(Date persistTime) { - // TODO Auto-generated method stub - - } - - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } - - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - - } + IPointData, IPersistable { + private static final long serialVersionUID = 1L; + + /** Satellite Identification */ + @Column + @DataURI(position = 1) + @DynamicSerializeElement + private Long said; + + /** Software Identification */ + @Column + @DynamicSerializeElement + private Long swid; + + /** Identification of the originating/generating center */ + @Column + @DynamicSerializeElement + private Long ogce; + + /** Satellite sensor indicator, first occurrence */ + @Column + @DynamicSerializeElement + private Long ssin1; + + /** Satellite sensor indicator, second occurrence */ + @Column + @DynamicSerializeElement + private Long ssin2; + + /** Orbit Number */ + @Column + @DataURI(position = 2) + @DynamicSerializeElement + private Long orbn; + + /** Height of station in meters */ + @Column + @DynamicSerializeElement + private Double selv = IDecoderConstantsN.DOUBLE_MISSING; + + /** Height increment in meters */ + @Column + @DynamicSerializeElement + private Double hinc = IDecoderConstantsN.DOUBLE_MISSING; + + /** Observation time */ + @Column + @DataURI(position = 3) + @DynamicSerializeElement + private Calendar obsTime; + + /** Latitude */ + @Column + @DataURI(position = 4) + @DynamicSerializeElement + private Double clath = IDecoderConstantsN.DOUBLE_MISSING; + + /** Longitude */ + @Column + @DataURI(position = 5) + @DynamicSerializeElement + private Double clonh = IDecoderConstantsN.DOUBLE_MISSING; + + /** Remotely sensed surface type */ + @Transient + @DynamicSerializeElement + private Long rsst; + + /** Altimeter echo type */ + @Transient + @DynamicSerializeElement + private Long aetp; + + /** Land/Sea qualifier */ + @Transient + @DynamicSerializeElement + private Long lsql; + + /** Altimeter state flag */ + @Transient + @DynamicSerializeElement + private Long asfl; + + /** Radiometer state flag */ + @Transient + @DynamicSerializeElement + private Long rsfl; + + /** 3D error estimate of the navigator orbit */ + @Transient + @DynamicSerializeElement + private Long eeno; + + /** Associated field significance for sgwh */ + @Transient + @DynamicSerializeElement + private Long afssgwh; + + /** Significant wave height in meters */ + @Transient + @DynamicSerializeElement + private Double sgwh = IDecoderConstantsN.DOUBLE_MISSING; + + /** First order statistics */ + @Transient + @DynamicSerializeElement + private Long fostsgwh; + + /** Significant wave height (standard deviation) in meters */ + @Transient + @DynamicSerializeElement + private Double sgwhstd = IDecoderConstantsN.DOUBLE_MISSING; + + /** Number of valid points per second used to derive previous parameters */ + @Transient + @DynamicSerializeElement + private Long nvpp; + + /** Type of Band for 1st replication */ + @Transient + @DynamicSerializeElement + private Long tobdg1r1; + + /** Type of Band for 2nd replication */ + @Transient + @DynamicSerializeElement + private Long tobdg1r2; + + /** + * Associated field significance for group 1, replication 1, first + * occurrence + */ + @Transient + @DynamicSerializeElement + private Long afsbkstg1r1; + + /** + * Associated field significance for group 1, replication 2, first + * occurrence + */ + @Transient + @DynamicSerializeElement + private Long afsbkstg1r2; + + /** Backscatter in decibels for group 1 rep 1 */ + @Transient + @DynamicSerializeElement + private Double bkstg1r1 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Backscatter in decibels for group 1 rep 2 */ + @Transient + @DynamicSerializeElement + private Double bkstg1r2 = IDecoderConstantsN.DOUBLE_MISSING; + + /** fost for bkst for group 1, replication 1, first fost occurrence */ + @Transient + @DynamicSerializeElement + private Long fostbkstg1r1; + + /** fost for bkst for group 1, replication 2, first fost occurrence */ + @Transient + @DynamicSerializeElement + private Long fostbkstg1r2; + + /** Backscatter Standard Deviation in decibels for group 1 rep 1 */ + @Transient + @DynamicSerializeElement + private Double bkststdg1r1 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Backscatter Standard Deviation in decibels for group 1 rep 2 */ + @Transient + @DynamicSerializeElement + private Double bkststdg1r2 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Square of the off-nadir angle in degrees squared */ + @Transient + @DynamicSerializeElement + private Double sona; + + /** + * Associated Field Significance for Square of the off-nadir angle in + * degrees squared + */ + @Transient + @DynamicSerializeElement + private Long afssona; + + /** Radiometer water vapor content in kg per square meter */ + @Transient + @DynamicSerializeElement + private Double rwvc = IDecoderConstantsN.DOUBLE_MISSING; + + /** Radiometer liquid content in kg per square meter */ + @Transient + @DynamicSerializeElement + private Double rlqc = IDecoderConstantsN.DOUBLE_MISSING; + + /** + * Associated field significance for group 1, replication 1, second + * occurrence + */ + @Transient + @DynamicSerializeElement + private Long afsselvg1r1; + + /** + * Associated field significance for group 1, replication 2, second + * occurrence + */ + @Transient + @DynamicSerializeElement + private Long afsselvg1r2; + + /** Height of station for 1st replication */ + @Transient + @DynamicSerializeElement + private Double selvg1r1 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Height of station for 2nd replication */ + @Transient + @DynamicSerializeElement + private Double selvg1r2 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Height increment in meters for 1st replication */ + @Transient + @DynamicSerializeElement + private Double hincg1r1 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Height increment in meters for snd replication */ + @Transient + @DynamicSerializeElement + private Double hincg1r2 = IDecoderConstantsN.DOUBLE_MISSING; + + /** fost for selv for group 1, replication 1, second fost occurrence */ + @Transient + @DynamicSerializeElement + private Long fostselvg1r1; + + /** fost for selv for group 1, replication 2, second fost occurrence */ + @Transient + @DynamicSerializeElement + private Long fostselvg1r2; + + /** Std of Height of station for 1st replication */ + @Transient + @DynamicSerializeElement + private Double selvstdg1r1 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Std of Height of station for 2nd replication */ + @Transient + @DynamicSerializeElement + private Double selvstdg1r2 = IDecoderConstantsN.DOUBLE_MISSING; + + /** + * Number of valid points per second used to derive previous parameters for + * 1st replication + */ + @Transient + @DynamicSerializeElement + private Long nvppg1r1; + + /** + * Number of valid points per second used to derive previous parameters for + * 2nd replication + */ + @Transient + @DynamicSerializeElement + private Long nvppg1r2; + + /** MEFR Mean Frequency for group 2 for 1st replication */ + @Transient + @DynamicSerializeElement + private Double mefrg2r1 = IDecoderConstantsN.DOUBLE_MISSING; + + /** mefr Mean Frequency for group 2 for 2nd replication */ + @Transient + @DynamicSerializeElement + private Double mefrg2r2 = IDecoderConstantsN.DOUBLE_MISSING; + + /** mefr Mean Frequency for group 2 for 3rd replication */ + @Transient + @DynamicSerializeElement + private Double mefrg2r3 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Associated field significance for tmbr for group 2, replication 1 */ + @Transient + @DynamicSerializeElement + private Long afstmbrg2r1; + + /** Associated field significance for tmbr for group 2, replication 2 */ + @Transient + @DynamicSerializeElement + private Long afstmbrg2r2; + + /** Associated field significance for tmbr for group 2, replication 3 */ + @Transient + @DynamicSerializeElement + private Long afstmbrg2r3; + + /** Brightness temperature tmbrg2r1 in K for group 2, rep 1 */ + @Transient + @DynamicSerializeElement + private Double tmbrg2r1 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Brightness temperature tmbrg2r2 in K for group 2 rep 2 */ + @Transient + @DynamicSerializeElement + private Double tmbrg2r2 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Brightness temperature tmbrg2r3 in K for group 2 rep 3 */ + @Transient + @DynamicSerializeElement + private Double tmbrg2r3 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Satellite-derived wind computation method swcmg3r1 for group 3 rep 1 */ + @Transient + @DynamicSerializeElement + private Long swcmg3r1; + + /** Satellite-derived wind computation method swcmg3r1 for group 3 rep 2 */ + @Transient + @DynamicSerializeElement + private Long swcmg3r2; + + /** Wind speed at 10 m; in meters per second; for group 3 rep 1 */ + @Transient + @DynamicSerializeElement + private Double ws10g3r1 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Wind speed at 10 m; in meters per second; for group 3 rep 2 */ + @Transient + @DynamicSerializeElement + private Double ws10g3r2 = IDecoderConstantsN.DOUBLE_MISSING; + + /** Report type */ + // @Column(length=8) + @Transient + @DynamicSerializeElement + @DataURI(position = 6) + private String reportType; + + /** Text of the WMO header */ + @Column(length = 32) + @DynamicSerializeElement + private String wmoHeader; + + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; + + /** + * Empty constructor. + */ + public SgwhRecord() { + } + + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + */ + public SgwhRecord(String uri) { + super(uri); + } + + /** + * Get the observation report type. + * + * @return the reportType + */ + public String getReportType() { + return reportType; + } + + /** + * Set the observation report type. + * + * @param reportType + * the reportType to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } + + /** + * Get the Satellite Identifier. + * + * @return the Satellite ID + */ + public Long getSaid() { + return said; + } + + /** + * Set the Satellite Identifier. + * + * @param said + * the Satellite ID to set + */ + public void setSaid(Long said) { + this.said = said; + } + + /** + * @param swid + * the Software Identification to get + * + * @return the swid + */ + public Long getSwid() { + return swid; + } + + /** + * @param swid + * the Software Identification to set + */ + public void setSwid(Long swid) { + this.swid = swid; + } + + /** + * @param ogce + * the Identification of originating/generating center to return + * + * @return the ogce + */ + public Long getOgce() { + return ogce; + } + + /** + * @param ogce + * the Identification of originating/generating center to set + */ + public void setOgce(Long ogce) { + this.ogce = ogce; + } + + /** + * @param ssin1 + * the Satellite Sensor Indicator 1 to return + * + * @return the ssin1 + */ + public Long getSsin1() { + return ssin1; + } + + /** + * @param ssin + * the Satellite Sensor Indicator 1 to set + */ + public void setSsin1(Long ssin1) { + this.ssin1 = ssin1; + } + + /** + * @param ssin + * the Satellite Sensor Indicator 2 to return + * + * @return the ssin2 + */ + public Long getSsin2() { + return ssin2; + } + + /** + * @param ssin2 + * the Satellite Sensor Indicator 2 to set + */ + public void setSsin2(Long ssin2) { + this.ssin2 = ssin2; + } + + /** + * @param orbn + * the Orbit number to return + * + * @return the orbn + */ + public Long getOrbn() { + return orbn; + } + + /** + * @param orbn + * the Orbit number to set + */ + public void setOrbn(Long orbn) { + this.orbn = orbn; + } + + /** + * @param selv + * height of station to return + * + * @return the selv + */ + public Double getSelv() { + return selv; + } + + /** + * @param selv + * the height of elevation to set + */ + public void setSelv(Double selv) { + this.selv = selv; + } + + /** + * @param hinc + * height increment to return + * + * @return the hinc + */ + public Double getHinc() { + return hinc; + } + + /** + * @param hinc + * the height increment to set + */ + public void setHinc(Double hinc) { + this.hinc = hinc; + } + + /** + * @return the clath + */ + public Double getClath() { + return clath; + } + + /** + * @param clath + * the clath to set + */ + public void setClath(Double clath) { + this.clath = clath; + } + + /** + * @return the clonh + */ + public Double getClonh() { + return clonh; + } + + /** + * @param clonh + * the clonh to set + */ + public void setClonh(Double clonh) { + this.clonh = clonh; + } + + /** + * @param rsst + * remotely sensed surface type to return + * + * @return the rsst + */ + public Long getRsst() { + return rsst; + } + + /** + * @param rsst + * the remotely sensed surface type to set + */ + public void setRsst(Long rsst) { + this.rsst = rsst; + } + + /** + * @param aetp + * remotely sensed surface type to return + * + * @return the aetp + */ + public Long getAetp() { + return aetp; + } + + /** + * @param aetp + * the remotely sensed surface type to set + */ + public void setAetp(Long aetp) { + this.aetp = aetp; + } + + /** + * @param lsql + * land/sea qualifier to return + * + * @return the lsql + */ + public Long getLsql() { + return lsql; + } + + /** + * @param lsql + * land/sea qualifer to set + */ + public void setLsql(Long lsql) { + this.lsql = lsql; + } + + /** + * @param asfl + * altimeter state flag to return + * + * @return the asfl + */ + public Long getAsfl() { + return asfl; + } + + /** + * @param asfl + * the altimeter state flag to set + */ + public void setAsfl(Long asfl) { + this.asfl = asfl; + } + + /** + * @param rsfl + * radiometer state flag to return + * + * @return the rsfl + */ + public Long getRsfl() { + return rsfl; + } + + /** + * @param rsfl + * the radiometer state flag to set + */ + public void setRsfl(Long rsfl) { + this.rsfl = rsfl; + } + + /** + * @param eeno + * three dimensional error estimate of the navigator orbit to + * return + * + * @return the eeno + */ + public Long getEeno() { + return eeno; + } + + /** + * @param eeno + * three dimensional error estimate of the navigator orbit to set + */ + public void setEeno(Long eeno) { + this.eeno = eeno; + } + + /** + * @param afssgwh + * associated field significance for sgwh to return + * + * @return the afssgwh + */ + public Long getAfssgwh() { + return afssgwh; + } + + /** + * @param afssgwh + * associated field significance for sgwh to set + */ + public void setAfssgwh(Long afssgwh) { + this.afssgwh = afssgwh; + } + + /** + * @param sgwh + * significant wave height to return + * + * @return the sgwh + */ + public Double getSgwh() { + return sgwh; + } + + /** + * @param sgwh + * significant wave height to set + */ + public void setSgwh(Double sgwh) { + this.sgwh = sgwh; + } + + /** + * @param sgwh + * significant wave height (standard deviation) to return + * + * @return the sgwhStd + */ + public Double getSgwhstd() { + return sgwhstd; + } + + /** + * @param sgwh + * significant wave height to set + */ + public void setSgwhstd(Double sgwhstd) { + this.sgwhstd = sgwhstd; + } + + /** + * @param fostsgwh + * first order statistics for sgwh to return + * + * @return the fostsgwh + */ + public Long getFostsgwh() { + return fostsgwh; + } + + /** + * @param fostsgwh + * first order statistics for sgwh to set + */ + public void setFostsgwh(Long fostsgwh) { + this.fostsgwh = fostsgwh; + } + + /** + * @param nvpp + * number of valid points per sec used to derive previous + * parameters to return + * + * @return the nvpp + */ + public Long getNvpp() { + return nvpp; + } + + /** + * @param nvpp + * number of valid points per sec used to derive previous + * parameters to set + */ + public void setNvpp(Long nvpp) { + this.nvpp = nvpp; + } + + /** + * @param tobdg1r1 + * type of band for 1st replication to return + * + * @return the tobdg1r1 + */ + public Long getTobdg1r1() { + return tobdg1r1; + } + + /** + * @param tbnd + * type of band for 1st replication to set + */ + public void setTobdg1r1(Long tobdg1r1) { + this.tobdg1r1 = tobdg1r1; + } + + /** + * @param tobdg1r2 + * type of band for 2nd replication to return + * + * @return the tobdg1r2 + */ + public Long getTobdg1r2() { + return tobdg1r2; + } + + /** + * @param tobdg1r2 + * type of band for 2nd replication to set + */ + public void setTobdg1r2(Long tobdg1r2) { + this.tobdg1r2 = tobdg1r2; + } + + /** + * @param afsbkstg1r1 + * associated field sig. bkst in group1, 1st replication to + * return + * + * @return the afsbkstg1r1 + */ + public Long getAfsbkstg1r1() { + return afsbkstg1r1; + } + + /** + * @param afsbkstg1r1 + * associated field sig. for bkst in group 1, 1st replication to + * set + */ + public void setAfsbkstg1r1(Long afsbkstg1r1) { + this.afsbkstg1r1 = afsbkstg1r1; + } + + /** + * @param afsbkstg1r2 + * associated field sig for bkst in group 1, 2nd replication to + * return + * + * @return the afsbkstg1r2 + */ + public Long getAfsbkstg1r2() { + return afsbkstg1r2; + } + + /** + * @param afsbkstg1r2 + * associated field sig for bkst in group 1, 2nd replication to + * set + */ + public void setAfsbkstg1r2(Long afsbkstg1r2) { + this.afsbkstg1r2 = afsbkstg1r2; + } + + /** + * @param afsselvg1r1 + * associated field sig for selv in group 1, 1st replication to + * return + * + * @return the afsselvg1r1 + */ + public Long getAfsselvg1r1() { + return afsselvg1r1; + } + + /** + * @param afsselvg1r1 + * associated field sig for selv in group 1, 1st replication to + * set + */ + public void setAfsselvg1r1(Long afsselvg1r1) { + this.afsselvg1r1 = afsselvg1r1; + } + + /** + * @param afsselvg1r2b + * associated field sig for selv in group 1, 2nd replication to + * return + * + * @return the afsselvg1r2 + */ + public Long getAfsselvg1r2() { + return afsselvg1r2; + } + + /** + * @param afsselvg1r2b + * associated field sig for selv in group 1 for 2nd replication + * to set + */ + public void setAfsselvg1r2(Long afsselvg1r2) { + this.afsselvg1r2 = afsselvg1r2; + } + + /** + * @param fostbkstg1r1 + * fost for bkst for group 1, 1st replication to return + * + * @return the fostbkstg1r1 + */ + public Long getFostbkstg1r1() { + return fostbkstg1r1; + } + + /** + * @param fostbkstg1r1 + * fost for bkst for group 1, 1st replication to set + */ + public void setFostbkstg1r1(Long fostbkstg1r1) { + this.fostbkstg1r1 = fostbkstg1r1; + } + + /** + * @param fostbkstg1r2 + * fost for bkst for group 1, 2nd replication to return + * + * @return the fostbkstg1r2 fost for bkst for group 1, 2nd replication to + * set + */ + public Long getFostbkstg1r2() { + return fostbkstg1r2; + } + + /** + * @param afsg1r2 + * associated field sig for 1st occurrence in group 1, 2nd + * replication to set + */ + public void setFostbkstg1r2(Long fostbkstg1r2) { + this.fostbkstg1r2 = fostbkstg1r2; + } + + /** + * @param bkstg1r1 + * backscatter to return + * + * @return the bkstg1r1 + */ + public Double getBkstg1r1() { + return bkstg1r1; + } + + /** + * @param bkst + * backscatter to set + */ + public void setBkstg1r1(Double bkstg1r1) { + this.bkstg1r1 = bkstg1r1; + } + + /** + * @param bkststdg1r1 + * backscatter standard deviation to return + * + * @return the bkststdg1r1 + */ + public Double getBkststdg1r1() { + return bkststdg1r1; + } + + /** + * @param bkststdg1r1 + * backscatter standard deviation to set + */ + public void setBkststdg1r1(Double bkststdg1r1) { + this.bkststdg1r1 = bkststdg1r1; + } + + /** + * @param bkstg1r2 + * backscatter to return + * + * @return the bkstg1r2 + */ + public Double getBkstg1r2() { + return bkstg1r2; + } + + /** + * @param bkstg1r2 + * backscatter to set + */ + public void setBkstg1r2(Double bkstg1r2) { + this.bkstg1r2 = bkstg1r2; + } + + /** + * @param bkststdg1r2 + * backscatter standard deviation to return + * + * @return the bkststdg1r2 + */ + public Double getBkststdg1r2() { + return bkststdg1r2; + } + + /** + * @param bkststdg1r + * backscatter standard deviation to set + */ + public void setBkststdg1r2(Double bkststdg1r2) { + this.bkststdg1r2 = bkststdg1r2; + } + + /** + * @param fostselvg1r1 + * fost for selv for group 1, 1st replication to return + * + * @return the fostselvg1r1 + */ + public Long getFostselvg1r1() { + return fostselvg1r1; + } + + /** + * @param fostselvg1r1 + * fost for selv for group 1, 1st replication to set + */ + public void setFostselvg1r1(Long fostselvg1r1) { + this.fostselvg1r1 = fostselvg1r1; + } + + /** + * @param fostselvg1r2 + * fost for selv for group 1, 2nd replication to return + * + * @return the fostselvg1r2 + */ + public Long getFostselvg1r2() { + return fostselvg1r2; + } + + /** + * @param fostselvg1r2 + * fost for selv for 1st occurrence in group 1, 2nd replication + * to set + */ + public void setFostselvg1r2(Long fostselvg1r2) { + this.fostselvg1r2 = fostselvg1r2; + } + + /** + * @param selvg1r1 + * elevation of satellite in group 1 replication 1 to return + * + * @return the selvg1r1 + */ + public Double getSelvg1r1() { + return selvg1r1; + } + + /** + * @param selv + * elevation of satellite in group 1 replication 1 to set + */ + public void setSelvg1r1(Double selvg1r1) { + this.selvg1r1 = selvg1r1; + } + + /** + * @param selvg1r2 + * elevation of satellite in group 1 replication 2 to return + * + * @return the selvg1r2 + */ + public Double getSelvg1r2() { + return selvg1r2; + } + + /** + * @param selvg1r2 + * elevation of satellite in group 1 replication 2 to set + */ + public void setSelvg1r2(Double selvg1r2) { + this.selvg1r2 = selvg1r2; + } + + /** + * @param hincg1r1 + * height increment in group 1 replication 1 to return + * + * @return the hincg1r1 + */ + public Double getHincg1r1() { + return hincg1r1; + } + + /** + * @param hincg1r1 + * height increment in group 1 replication 1 to set + */ + public void setHincg1r1(Double hincg1r1) { + this.hincg1r1 = hincg1r1; + } + + /** + * @param hincg1r2 + * height increment in group 1 replication 2 to return + * + * @return the hincg1r2 + */ + public Double getHincg1r2() { + return hincg1r2; + } + + /** + * @param hincg1r1 + * height increment in group 1 replication 2 to set + */ + public void setHincg1r2(Double hincg1r2) { + this.hincg1r2 = hincg1r2; + } + + /** + * @param selvstdg1r1 + * std of elevation of satellite in group 1 replication 1 to + * return + * + * @return the selvstdg1r1 + */ + public Double getSelvstdg1r1() { + return selvstdg1r1; + } + + /** + * @param selvstdg1r1 + * elevation of satellite in group 1 replication 2 to set + */ + public void setSelvstdg1r1(Double selvstdg1r1) { + this.selvstdg1r1 = selvstdg1r1; + } + + /** + * @param selvstdg1r2 + * std of elevation of satellite in group 1 replication 1 to + * return + * + * @return the selvstdg1r2 + */ + public Double getSelvstdg1r2() { + return selvstdg1r2; + } + + /** + * @param selvstdg1r2 + * elevation of satellite in group 1 replication 2 to set + */ + public void setSelvstdg1r2(Double selvstdg1r2) { + this.selvstdg1r2 = selvstdg1r2; + } + + /** + * @param nvppg1r1 + * number of valid points per sec used to derive previous + * parameters in group 1 replication 1 to return + * + * @return the nvppg1r1 + */ + public Long getNvppg1r1() { + return nvppg1r1; + } + + /** + * @param nvppg1r1 + * number of valid points per sec used to derive previous + * parameters in group 1 replication 1 to set + */ + public void setNvppg1r1(Long nvppg1r1) { + this.nvppg1r1 = nvppg1r1; + } + + /** + * @param nvppg1r2 + * number of valid points per sec used to derive previous + * parameters in group 1 replication 2 to return + * + * @return the nvppg1r1 + */ + public Long getNvppg1r2() { + return nvppg1r2; + } + + /** + * @param nvppg1r2 + * number of valid points per sec used to derive previous + * parameters in group 1 replication 2 to set + */ + public void setNvppg1r2(Long nvppg1r2) { + this.nvppg1r2 = nvppg1r2; + } + + /** + * @param afssona + * Associated Field Significance of Square of the off-nadir angle + * to return + * + * @return the afssona + */ + public Long getAfssona() { + return afssona; + } + + /** + * @param afssona + * Assocaited Field Significance of sona to set + */ + public void setAfssona(Long afssona) { + this.afssona = afssona; + } + + /** + * @param sona + * Square of the off-nadir angle to return + * + * @return the sona + */ + public Double getSona() { + return sona; + } + + /** + * @param sona + * Square of the off-nadir angle to set + */ + public void setSona(Double sona) { + this.sona = sona; + } + + /** + * @param mefrg2r1 + * mean frequency in hz for group 2 rep 1 to return + * + * @return the mefrg2r1 + */ + public Double getMefrg2r1() { + return mefrg2r1; + } + + /** + * @param mefrg2r1 + * mean frequency for group 2 rep 1 to set + */ + public void setMefrg2r1(Double mefrg2r1) { + this.mefrg2r1 = mefrg2r1; + } + + /** + * @param mefrg2r2 + * mean frequency in hz for group 2 rep 2 to return + * + * @return the mefrg2r2 + */ + public Double getMefrg2r2() { + return mefrg2r2; + } + + /** + * @param mefrg2r2 + * mean frequency for group 2 rep 2 to set + */ + public void setMefrg2r2(Double mefrg2r2) { + this.mefrg2r2 = mefrg2r2; + } + + /** + * @param mefrg2r3 + * mean frequency in hz for group 2 rep 3 to return + * + * @return the mefrg2r3 + */ + public Double getMefrg2r3() { + return mefrg2r3; + } + + /** + * @param mefrg2r3 + * mean frequency for group 2 rep 3 to set + */ + public void setMefrg2r3(Double mefrg2r3) { + this.mefrg2r3 = mefrg2r3; + } + + /** + * @param afstmbrg2r1 + * associated field sig for tmbr in group 2, 1st replication to + * return + * + * @return the afstmbrg2r1 + */ + public Long getAfstmbrg2r1() { + return afstmbrg2r1; + } + + /** + * @param afstmbrg2r1 + * associated field sig for tmbr in group 2, 1st replication to + * set + */ + public void setAfstmbrg2r1(Long afstmbrg2r1) { + this.afstmbrg2r1 = afstmbrg2r1; + } + + /** + * @param afstmbrg2r2b + * associated field sig for tmbr in group 2, 2nd replication to + * return + * + * @return the afstmbrg2r2 + */ + public Long getAfstmbrg2r2() { + return afstmbrg2r2; + } + + /** + * @param afstmbrg2r2b + * associated field sig for tmbr in group 2 for 2nd replication + * to set + */ + public void setAfstmbrg2r2(Long afstmbrg2r2) { + this.afstmbrg2r2 = afstmbrg2r2; + } + + /** + * @param afstmbrg2r3 + * associated field sig for tmbr in group 2, 3rd replication to + * return + * + * @return the afstmbrg2r3 + */ + public Long getAfstmbrg2r3() { + return afstmbrg2r3; + } + + /** + * @param afstmbrg2r3 + * associated field sig for tmbr in group 2, 3rd replication to + * set + */ + public void setAfstmbrg2r3(Long afstmbrg2r3) { + this.afstmbrg2r3 = afstmbrg2r3; + } + + /** + * @param tmbrg2r1 + * brightness temperature in K for group 2 rep 1 to return + * + * @return the tmbrg2r1 + */ + public Double getTmbrg2r1() { + return tmbrg2r1; + } + + /** + * @param tmbrg2r1 + * brightness temperaturefor group 2 rep 1 to set + */ + public void setTmbrg2r1(Double tmbrg2r1) { + this.tmbrg2r1 = tmbrg2r1; + } + + /** + * @param tmbrg2r2 + * brightness temperature in K for group 2 rep 2 to return + * + * @return the tmbrg2r2 + */ + public Double getTmbrg2r2() { + return tmbrg2r2; + } + + /** + * @param tmbrg2r2 + * brightness temperaturefor group 2 rep 2 to set + */ + public void setTmbrg2r2(Double tmbrg2r2) { + this.tmbrg2r2 = tmbrg2r2; + } + + /** + * @param tmbrg2r3 + * brightness temperature in K for group 2 rep 3 to return + * + * @return the tmbrg2r3 + */ + public Double getTmbrg2r3() { + return tmbrg2r3; + } + + /** + * @param tmbrg2r3 + * mean frequency for group 2 rep 3 to set + */ + public void setTmbrg2r3(Double tmbrg2r3) { + this.tmbrg2r3 = tmbrg2r3; + } + + /** + * @param swcmg3r1 + * satellite-derived wind computation method for group 3 rep 1 to + * return + * + * @return the swcmg3r1 + */ + public Long getSwcmg3r1() { + return swcmg3r1; + } + + /** + * @param swcmg3r1 + * satellite-derived wind computation method for group 3 rep 1 to + * set + */ + public void setSwcmg3r1(Long swcmg3r1) { + this.swcmg3r1 = swcmg3r1; + } + + /** + * @param swcmg3r2 + * satellite-derived wind computation method for group 3 rep 2 to + * return + * + * @return the swcmg3r2 + */ + public Long getSwcmg3r2() { + return swcmg3r2; + } + + /** + * @param swcmg3r2 + * satellite-derived wind computation method for group 3 rep 2 to + * set + */ + public void setSwcmg3r2(Long swcmg3r2) { + this.swcmg3r2 = swcmg3r2; + } + + /** + * @param ws10g3r1 + * wind speed at 10 m for group 3 rep 1 to return + * + * @return the ws10g3r1 + */ + public Double getWs10g3r1() { + return ws10g3r1; + } + + /** + * @param ws10g3r1 + * wind speed at 10 m to set + */ + public void setWs10g3r1(Double ws10g3r1) { + this.ws10g3r1 = ws10g3r1; + } + + /** + * @param ws10g3r1 + * wind speed at 10 m for group 3 rep 2 to return + * + * @return the ws10g3r2 + */ + public Double getWs10g3r2() { + return ws10g3r2; + } + + /** + * @param ws10g3r1 + * wind speed at 10 m to set + */ + public void setWs10g3r2(Double ws10g3r2) { + this.ws10g3r2 = ws10g3r2; + } + + /** + * @param rwvc + * radiometer liquid content to return + * + * @return the rwvc + */ + public Double getRwvc() { + return rwvc; + } + + /** + * @param rwvc + * radiometer liquid content to set + */ + public void setRwvc(Double rwvc) { + this.rwvc = rwvc; + } + + /** + * @param rlqc + * radiometer liquid content to return + * + * @return the rlqc + */ + public Double getRlqc() { + return rlqc; + } + + /** + * @param rlqc + * radiometer liquid content to set + */ + public void setRlqc(Double rlqc) { + this.rlqc = rlqc; + } + + /** + * @return the wmoHeader + */ + public String getWmoHeader() { + return wmoHeader; + } + + /** + * @param wmoHeader + * the wmoHeader to set + */ + public void setWmoHeader(String wmoHeader) { + this.wmoHeader = wmoHeader; + } + + /** + * @return the obsTime + */ + public Calendar getObsTime() { + return obsTime; + } + + /** + * @param obsTime + * the obsTime to set + */ + public void setObsTime(Calendar obsTime) { + this.obsTime = obsTime; + } + + /** + * Get the value and units of a named parameter within this observation. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return An Amount with value and units. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Amount getValue(String paramName) { + return null; + } + + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public String getString(String paramName) { + return null; + } + + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Collection getValues(String paramName) { + return null; + } + + /** + * Get the IDecoderGettable reference for this record. + * + * @return The IDecoderGettable reference for this record. + */ + @Override + public IDecoderGettable getDecoderGettable() { + return this; + } + + @Override + public void setDataURI(String dataURI) { + identifier = dataURI; + } + + @Override + public String[] getStrings(String paramName) { + return null; + } + + @Override + public Date getPersistenceTime() { + return this.dataTime.getRefTime(); + + } + + @Override + public void setPersistenceTime(Date persistTime) { + // TODO Auto-generated method stub + + } + + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } + + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + + } @Override @Column @@ -1733,4 +1673,8 @@ public class SgwhRecord extends PluginDataObject implements IDecoderGettable, return super.getDataURI(); } + @Override + public String getPluginName() { + return "sgwh"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.sgwhv/src/gov/noaa/nws/ncep/common/dataplugin/sgwhv/SgwhvRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.sgwhv/src/gov/noaa/nws/ncep/common/dataplugin/sgwhv/SgwhvRecord.java index a85a13e802..9ff61d069f 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.sgwhv/src/gov/noaa/nws/ncep/common/dataplugin/sgwhv/SgwhvRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.sgwhv/src/gov/noaa/nws/ncep/common/dataplugin/sgwhv/SgwhvRecord.java @@ -1,26 +1,3 @@ -/** - * SgwhvRecord - * This java class performs the mapping to the database for BUFR Sgwhv. - * - *
- * 
- * SOFTWARE HISTORY
- * 
- * Date			Ticket#		Engineer	Description
- * ------------ -----------	----------- --------------------------
- * Aug23 2011	   		    Chin Chen	Initial Coding (Following BufrsgwhvRecord to refactor for 
- * 										saving data to HDF5)
- * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
- * Apr 8, 2013   1293       bkowal      Removed references to hdffileid.
- * Apr 12, 2013 1857        bgonzale    Added SequenceGenerator annotation.
- * May 07, 2013 1869       	bsteffen    Remove dataURI column from
- *                                      PluginDataObject.
- *
- * 
- * - * @author chin chen - * @version 1.0 - */ package gov.noaa.nws.ncep.common.dataplugin.sgwhv; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; @@ -50,6 +27,31 @@ import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * SgwhvRecord + * This java class performs the mapping to the database for BUFR Sgwhv. + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ ----------- ----------- --------------------------
+ * Aug23 2011               Chin Chen   Initial Coding (Following
+ *                                      BufrsgwhvRecord to refactor for  saving
+ *                                      data to HDF5)
+ * Apr 04, 2013 1846        bkowal      Added an index on refTime and
+ *                                      forecastTime
+ * Apr 08, 2013 1293        bkowal      Removed references to hdffileid.
+ * Apr 12, 2013 1857        bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 1869        bsteffen    Remove dataURI column from
+ *                                      PluginDataObject.
+ * Aug 30, 2013 2298        rjpeter     Make getPluginName abstract
+ * 
+ * + * @author chin chen + * @version 1.0 + */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "sgwhvseq") @Table(name = "sgwhv", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -57,486 +59,484 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "sgwhv", - indexes = { - @Index(name = "sgwhv_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "sgwhv", indexes = { @Index(name = "sgwhv_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class SgwhvRecord extends PluginDataObject implements IDecoderGettable, - IPointData, IPersistable { - private static final long serialVersionUID = 1L; - private static final float RMISSD = IDecoderConstantsN.FLOAT_MISSING; - private static final Integer IMISSD = IDecoderConstantsN.INTEGER_MISSING; + IPointData, IPersistable { + private static final long serialVersionUID = 1L; - /** Satellite Identification */ - @Column - /* - * Height of waves are from blended TOPEX/Poseidon, Jason-1, ERS 1, ERS 2m - * GPO and Envisat ocean altimetry satellites, therefore satelliteId should - * be a primary key. Data is from Navoceano. SGWH is from Jason-1 and has - * satelliteID of 260. SGWH2 is from Jason-2 and has satelliteId of 261. - * SGWHE is from Envisat and has satelliteId of 60. - */ - @DataURI(position = 4) - @DynamicSerializeElement - private Long satelliteId; + private static final float RMISSD = IDecoderConstantsN.FLOAT_MISSING; - /** Observation time */ - @Column - @DataURI(position = 1) - @DynamicSerializeElement - private Calendar obsTime; + private static final Integer IMISSD = IDecoderConstantsN.INTEGER_MISSING; - /** Latitude */ - @Column - @DataURI(position = 2) - @DynamicSerializeElement - private Double lat; + /** Satellite Identification */ + @Column + /* + * Height of waves are from blended TOPEX/Poseidon, Jason-1, ERS 1, ERS 2m + * GPO and Envisat ocean altimetry satellites, therefore satelliteId should + * be a primary key. Data is from Navoceano. SGWH is from Jason-1 and has + * satelliteID of 260. SGWH2 is from Jason-2 and has satelliteId of 261. + * SGWHE is from Envisat and has satelliteId of 60. + */ + @DataURI(position = 4) + @DynamicSerializeElement + private Long satelliteId; - /** Longitude */ - @Column - @DataURI(position = 3) - @DynamicSerializeElement - private Double lon; + /** Observation time */ + @Column + @DataURI(position = 1) + @DynamicSerializeElement + private Calendar obsTime; - /** Wind speed at 10 m (m/s) */ - @Transient - @DynamicSerializeElement - private Double wspd10; + /** Latitude */ + @Column + @DataURI(position = 2) + @DynamicSerializeElement + private Double lat; - /** Height of waves (m) */ - @Transient - @DynamicSerializeElement - private Double htwaves; + /** Longitude */ + @Column + @DataURI(position = 3) + @DynamicSerializeElement + private Double lon; - /** Standard Deviation of significant wave height (m) */ - @Transient - @DynamicSerializeElement - private Double sgwhSd; + /** Wind speed at 10 m (m/s) */ + @Transient + @DynamicSerializeElement + private Double wspd10; - /** Altitude (Platform to ellipsoid) (m) */ - @Transient - @DynamicSerializeElement - private Double altitude; + /** Height of waves (m) */ + @Transient + @DynamicSerializeElement + private Double htwaves; - /** Number of valid points per second used to derive previous parameters */ - @Transient - @DynamicSerializeElement - private Long peak; + /** Standard Deviation of significant wave height (m) */ + @Transient + @DynamicSerializeElement + private Double sgwhSd; - /** Altitude correction (ionosphere) */ - @Transient - @DynamicSerializeElement - private Double altCorrI; + /** Altitude (Platform to ellipsoid) (m) */ + @Transient + @DynamicSerializeElement + private Double altitude; - /** Altitude correction (dry troposphere) */ - @Transient - @DynamicSerializeElement - private Double altCorrD; + /** Number of valid points per second used to derive previous parameters */ + @Transient + @DynamicSerializeElement + private Long peak; - /** Altitude correction (wet troposphere) */ - @Transient - @DynamicSerializeElement - private Double altCorrW; + /** Altitude correction (ionosphere) */ + @Transient + @DynamicSerializeElement + private Double altCorrI; - /** Open loop correction (auto gain control) in decibels for group 1 rep 2 */ - @Transient - @DynamicSerializeElement - private Double loopCorr; + /** Altitude correction (dry troposphere) */ + @Transient + @DynamicSerializeElement + private Double altCorrD; - /** Backscatter in decibels */ - @Transient - @DynamicSerializeElement - private Double bkst; + /** Altitude correction (wet troposphere) */ + @Transient + @DynamicSerializeElement + private Double altCorrW; - /** Report type */ - // @Column(length=8) - @Transient - @DynamicSerializeElement - @DataURI(position=5) - private String reportType; + /** Open loop correction (auto gain control) in decibels for group 1 rep 2 */ + @Transient + @DynamicSerializeElement + private Double loopCorr; - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; + /** Backscatter in decibels */ + @Transient + @DynamicSerializeElement + private Double bkst; - /** - * Default constructor. - */ - public SgwhvRecord() { - Double doubleRmissd = Double.parseDouble(String.valueOf(RMISSD)); - Long longImissd = Long.parseLong(String.valueOf(IMISSD)); - this.reportType = "BUFRSGWHV"; - this.satelliteId = longImissd; - this.lat = doubleRmissd; - this.lon = doubleRmissd; - this.altCorrD = doubleRmissd; - this.wspd10 = doubleRmissd; - this.htwaves = doubleRmissd; - this.sgwhSd = doubleRmissd; - this.altitude = doubleRmissd; - this.altCorrI = doubleRmissd; - this.altCorrD = doubleRmissd; - this.altCorrW = doubleRmissd; - this.loopCorr = doubleRmissd; - this.bkst = doubleRmissd; - this.peak = longImissd; - } + /** Report type */ + // @Column(length=8) + @Transient + @DynamicSerializeElement + @DataURI(position = 5) + private String reportType; - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - */ - public SgwhvRecord(String uri) { - super(uri); - } + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; - /** - * Get the observation report type. - * - * @return the reportType - */ - public String getReportType() { - return reportType; - } + /** + * Default constructor. + */ + public SgwhvRecord() { + Double doubleRmissd = Double.parseDouble(String.valueOf(RMISSD)); + Long longImissd = Long.parseLong(String.valueOf(IMISSD)); + this.reportType = "BUFRSGWHV"; + this.satelliteId = longImissd; + this.lat = doubleRmissd; + this.lon = doubleRmissd; + this.altCorrD = doubleRmissd; + this.wspd10 = doubleRmissd; + this.htwaves = doubleRmissd; + this.sgwhSd = doubleRmissd; + this.altitude = doubleRmissd; + this.altCorrI = doubleRmissd; + this.altCorrD = doubleRmissd; + this.altCorrW = doubleRmissd; + this.loopCorr = doubleRmissd; + this.bkst = doubleRmissd; + this.peak = longImissd; + } - /** - * Set the observation report type. - * - * @param reportType - * the reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + */ + public SgwhvRecord(String uri) { + super(uri); + } - /** - * Get the Satellite Identifier. - * - * @return the Satellite ID - */ - public Long getSatelliteId() { - return satelliteId; - } + /** + * Get the observation report type. + * + * @return the reportType + */ + public String getReportType() { + return reportType; + } - /** - * @param satelliteId - * the Satellite Identifier to set - */ - public void setSatelliteId(Long satelliteId) { - this.satelliteId = satelliteId; - } + /** + * Set the observation report type. + * + * @param reportType + * the reportType to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } - /** - * @return the lat - */ - public Double getLat() { - return lat; - } + /** + * Get the Satellite Identifier. + * + * @return the Satellite ID + */ + public Long getSatelliteId() { + return satelliteId; + } - /** - * @param lat - * the latitude (coarse) to set - */ - public void setLat(Double lat) { - this.lat = lat; - } + /** + * @param satelliteId + * the Satellite Identifier to set + */ + public void setSatelliteId(Long satelliteId) { + this.satelliteId = satelliteId; + } - /** - * @return the lon - */ - public Double getLon() { - return lon; - } + /** + * @return the lat + */ + public Double getLat() { + return lat; + } - /** - * @param lon - * the longitude (coarse) to set - */ - public void setLon(Double lon) { - this.lon = lon; - } + /** + * @param lat + * the latitude (coarse) to set + */ + public void setLat(Double lat) { + this.lat = lat; + } - /** - * @param wspd10 - * wind speed at 10 m to return - */ - public Double getWspd10() { - return wspd10; - } + /** + * @return the lon + */ + public Double getLon() { + return lon; + } - /** - * @param wspd10 - * wind speed at 10 m to set - */ - public void setWspd10(Double wspd10) { - this.wspd10 = wspd10; - } + /** + * @param lon + * the longitude (coarse) to set + */ + public void setLon(Double lon) { + this.lon = lon; + } - /** - * @param htwaves - * height of waves to return - */ - public Double getHtwaves() { - return htwaves; - } + /** + * @param wspd10 + * wind speed at 10 m to return + */ + public Double getWspd10() { + return wspd10; + } - /** - * @param htwaves - * height of waves to set - */ - public void setHtwaves(Double htwaves) { - this.htwaves = htwaves; - } + /** + * @param wspd10 + * wind speed at 10 m to set + */ + public void setWspd10(Double wspd10) { + this.wspd10 = wspd10; + } - /** - * @param SgwhSd - * SGWH standard deviation to return - */ - /** - * @return the SgwhSd - */ - public Double getSgwhSd() { - return sgwhSd; - } + /** + * @param htwaves + * height of waves to return + */ + public Double getHtwaves() { + return htwaves; + } - /** - * @param SgwhSd - * SGWH standard deviation to set - */ - public void setSgwhSd(Double sgwhSd) { - this.sgwhSd = sgwhSd; - } + /** + * @param htwaves + * height of waves to set + */ + public void setHtwaves(Double htwaves) { + this.htwaves = htwaves; + } - /** - * @param altitude - * altitude (platform to ellipsoid) m - */ - public Double getAltitude() { - return altitude; - } + /** + * @param SgwhSd + * SGWH standard deviation to return + */ + /** + * @return the SgwhSd + */ + public Double getSgwhSd() { + return sgwhSd; + } - /** - * @param altitude - * altitude to set - */ - public void setAltitude(Double altitude) { - this.altitude = altitude; - } + /** + * @param SgwhSd + * SGWH standard deviation to set + */ + public void setSgwhSd(Double sgwhSd) { + this.sgwhSd = sgwhSd; + } - /** - * @param peak - * peakiness to return - */ - /** - * @return the peak - */ - public Long getPeak() { - return peak; - } + /** + * @param altitude + * altitude (platform to ellipsoid) m + */ + public Double getAltitude() { + return altitude; + } - /** - * @param peak - * peakiness to set - */ - public void setPeak(Long peak) { - this.peak = peak; - } + /** + * @param altitude + * altitude to set + */ + public void setAltitude(Double altitude) { + this.altitude = altitude; + } - /** - * @param altCorrI - * altitude correction (ionosphere) to return - */ - /** - * @return the altCorrI - */ - public Double getAltCorrI() { - return altCorrI; - } + /** + * @param peak + * peakiness to return + */ + /** + * @return the peak + */ + public Long getPeak() { + return peak; + } - /** - * @param altCorrI - * altitude correction (ionosphere) (m) to set - */ - public void setAltCorrI(Double altCorrI) { - this.altCorrI = altCorrI; - } + /** + * @param peak + * peakiness to set + */ + public void setPeak(Long peak) { + this.peak = peak; + } - /** - * @param altCorrD - * altitude correction (dry troposphere) to return - */ - /** - * @return the altCorrD - */ - public Double getAltCorrD() { - return altCorrD; - } + /** + * @param altCorrI + * altitude correction (ionosphere) to return + */ + /** + * @return the altCorrI + */ + public Double getAltCorrI() { + return altCorrI; + } - /** - * @param altCorrD - * altitude correction (dry troposphere) (m) to set - */ - public void setAltCorrD(Double altCorrD) { - this.altCorrD = altCorrD; - } + /** + * @param altCorrI + * altitude correction (ionosphere) (m) to set + */ + public void setAltCorrI(Double altCorrI) { + this.altCorrI = altCorrI; + } - /** - * @param altCorrW - * altitude correction (wet troposphere) to return - */ - /** - * @return the altCorrW - */ - public Double getAltCorrW() { - return altCorrW; - } + /** + * @param altCorrD + * altitude correction (dry troposphere) to return + */ + /** + * @return the altCorrD + */ + public Double getAltCorrD() { + return altCorrD; + } - /** - * @param altCorrI - * altitude correction (wet troposphere) (m) to set - */ - public void setAltCorrW(Double altCorrW) { - this.altCorrW = altCorrW; - } + /** + * @param altCorrD + * altitude correction (dry troposphere) (m) to set + */ + public void setAltCorrD(Double altCorrD) { + this.altCorrD = altCorrD; + } - /** - * @param loopCorr - * open loop correction (auto gain control) (db) to return - */ - /** - * @return the loopCorr - */ - public Double getLoopCorr() { - return loopCorr; - } + /** + * @param altCorrW + * altitude correction (wet troposphere) to return + */ + /** + * @return the altCorrW + */ + public Double getAltCorrW() { + return altCorrW; + } - /** - * @param loopCorr - * open loop correction (auto gain control) (db) to set - */ - public void setLoopCorr(Double loopCorr) { - this.loopCorr = loopCorr; - } + /** + * @param altCorrI + * altitude correction (wet troposphere) (m) to set + */ + public void setAltCorrW(Double altCorrW) { + this.altCorrW = altCorrW; + } - /** - * @param bkst - * backscatter to return - */ - /** - * @return the bkst - */ - public Double getBkst() { - return bkst; - } + /** + * @param loopCorr + * open loop correction (auto gain control) (db) to return + */ + /** + * @return the loopCorr + */ + public Double getLoopCorr() { + return loopCorr; + } - /** - * @param bkst - * backscatter to set - */ - public void setBkst(Double bkst) { - this.bkst = bkst; - } + /** + * @param loopCorr + * open loop correction (auto gain control) (db) to set + */ + public void setLoopCorr(Double loopCorr) { + this.loopCorr = loopCorr; + } - /** - * @return the obsTime - */ - public Calendar getObsTime() { - return obsTime; - } + /** + * @param bkst + * backscatter to return + */ + /** + * @return the bkst + */ + public Double getBkst() { + return bkst; + } - /** - * @param obsTime - * the obsTime to set - */ - public void setObsTime(Calendar obsTime) { - this.obsTime = obsTime; - } + /** + * @param bkst + * backscatter to set + */ + public void setBkst(Double bkst) { + this.bkst = bkst; + } - /** - * Get the value and units of a named parameter within this observation. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return An Amount with value and units. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Amount getValue(String paramName) { - return null; - } + /** + * @return the obsTime + */ + public Calendar getObsTime() { + return obsTime; + } - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public String getString(String paramName) { - return null; - } + /** + * @param obsTime + * the obsTime to set + */ + public void setObsTime(Calendar obsTime) { + this.obsTime = obsTime; + } - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Collection getValues(String paramName) { - return null; - } + /** + * Get the value and units of a named parameter within this observation. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return An Amount with value and units. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Amount getValue(String paramName) { + return null; + } - /** - * Get the IDecoderGettable reference for this record. - * - * @return The IDecoderGettable reference for this record. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return this; - } + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public String getString(String paramName) { + return null; + } - @Override - public void setDataURI(String dataURI) { - identifier = dataURI; - } + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Collection getValues(String paramName) { + return null; + } - @Override - public String[] getStrings(String paramName) { - return null; - } + /** + * Get the IDecoderGettable reference for this record. + * + * @return The IDecoderGettable reference for this record. + */ + @Override + public IDecoderGettable getDecoderGettable() { + return this; + } - @Override - public Date getPersistenceTime() { - return this.dataTime.getRefTime(); - } + @Override + public void setDataURI(String dataURI) { + identifier = dataURI; + } - @Override - public void setPersistenceTime(Date persistTime) { - // TODO Auto-generated method stub + @Override + public String[] getStrings(String paramName) { + return null; + } - } + @Override + public Date getPersistenceTime() { + return this.dataTime.getRefTime(); + } - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } + @Override + public void setPersistenceTime(Date persistTime) { + // TODO Auto-generated method stub - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - } + } + + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } + + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + } @Override @Column @@ -544,4 +544,9 @@ public class SgwhvRecord extends PluginDataObject implements IDecoderGettable, public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "sgwhv"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.solarimage/src/gov/noaa/nws/ncep/common/dataplugin/solarimage/SolarImageRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.solarimage/src/gov/noaa/nws/ncep/common/dataplugin/solarimage/SolarImageRecord.java index 4f118d329d..95fe8e1e43 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.solarimage/src/gov/noaa/nws/ncep/common/dataplugin/solarimage/SolarImageRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.solarimage/src/gov/noaa/nws/ncep/common/dataplugin/solarimage/SolarImageRecord.java @@ -32,13 +32,17 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ---------------- -------------------------- - * 12/05/2012 865 sgurung, qzhou Initial creation. - * 01/07/2013 865 qzhou Added "Site" for Halpha. - * 01/28/2013 865 qzhou Changed float to double for intTime. - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * Dec 05, 2012 865 sgurung, qzhou Initial creation. + * Jan 07, 2013 865 qzhou Added "Site" for Halpha. + * Jan 28, 2013 865 qzhou Changed float to double for + * intTime. + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator + * annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -53,12 +57,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "solarimage", - indexes = { - @Index(name = "solarimage_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "solarimage", indexes = { @Index(name = "solarimage_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize @@ -103,7 +103,7 @@ public class SolarImageRecord extends PersistablePluginDataObject { @DynamicSerializeElement @XmlAttribute private Double intTime; - + /** * Site */ @@ -112,7 +112,7 @@ public class SolarImageRecord extends PersistablePluginDataObject { @DynamicSerializeElement @XmlAttribute private String site; - + /** * hdu containing image data */ @@ -120,16 +120,16 @@ public class SolarImageRecord extends PersistablePluginDataObject { @DynamicSerializeElement @XmlAttribute private int imageHDUNum; - + /** * report type */ @DataURI(position = 6) - @Column + @Column @DynamicSerializeElement @XmlAttribute private String reportType; - + /** * raw data */ @@ -167,7 +167,6 @@ public class SolarImageRecord extends PersistablePluginDataObject { public void setInstrument(String instrument) { this.instrument = instrument; } - /** * @return the satellite @@ -198,7 +197,7 @@ public class SolarImageRecord extends PersistablePluginDataObject { public void setWavelength(String wavelength) { this.wavelength = wavelength; } - + /** * @return the intTime */ @@ -213,7 +212,7 @@ public class SolarImageRecord extends PersistablePluginDataObject { public void setIntTime(Double intTime) { this.intTime = intTime; } - + /** * @return the site */ @@ -228,7 +227,7 @@ public class SolarImageRecord extends PersistablePluginDataObject { public void setSite(String site) { this.site = site; } - + /** * @return the reportType */ @@ -250,20 +249,20 @@ public class SolarImageRecord extends PersistablePluginDataObject { public int getImageHDUNum() { return imageHDUNum; } - + /** * @param imageHDUNum * the hdu containing image data */ public void setImageHDUNum(int hduId) { this.imageHDUNum = hduId; - } - + } + @Override public IDecoderGettable getDecoderGettable() { return null; } - + /** * @return the raw_data */ @@ -280,24 +279,29 @@ public class SolarImageRecord extends PersistablePluginDataObject { } public void retrieveFromDataStore(IDataStore dataStore) { - + try { IDataRecord[] dataRec = dataStore.retrieve(getDataURI()); - for (int i = 0; i < dataRec.length; i++) { - if (dataRec[i].getName().equals(SolarImageRecord.RAW_DATA)) { - raw_data = (((ByteDataRecord) dataRec[i]).getByteData()); - } + for (IDataRecord element : dataRec) { + if (element.getName().equals(SolarImageRecord.RAW_DATA)) { + raw_data = (((ByteDataRecord) element).getByteData()); + } } } catch (Exception se) { se.printStackTrace(); } } - + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "solarimage"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.ssha/src/gov/noaa/nws/ncep/common/dataplugin/ssha/SshaRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.ssha/src/gov/noaa/nws/ncep/common/dataplugin/ssha/SshaRecord.java index 5ca4bcd6ae..c659918d9a 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.ssha/src/gov/noaa/nws/ncep/common/dataplugin/ssha/SshaRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.ssha/src/gov/noaa/nws/ncep/common/dataplugin/ssha/SshaRecord.java @@ -1,26 +1,3 @@ -/** - * - * SshaRecord - * - * This java class performs the mapping to the database for Ssha. - * - *
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    	Engineer    Description
- * ------- 		------- 	--------	-----------
- * Sep 2011	   		        Chin Chen	Initial Coding (Following BufrsshaRecord to refactor for 
- * 										saving data to HDF5)
- * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
- * Apr 12, 2013    1857     bgonzale    Added SequenceGenerator annotation.
- * May 07, 2013 1869        bsteffen	Remove dataURI column from PluginDataObject.
- *
- * 
- * - * @author Chin Chen - * @version 1.0 - * - */ package gov.noaa.nws.ncep.common.dataplugin.ssha; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; @@ -51,6 +28,30 @@ import com.raytheon.uf.common.pointdata.PointDataView; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * SshaRecord + * + * This java class performs the mapping to the database for Ssha. + * + *
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#     Engineer    Description
+ * ------------ --------    --------    ----------------------------------------------
+ * Sep 2011                 Chin Chen   Initial Coding (Following BufrsshaRecord
+ *                                      to refactor for  saving data to HDF5)
+ * Apr 04, 2013 1846        bkowal      Added an index on refTime and
+ *                                      forecastTime
+ * Apr 12, 2013 1857        bgonzale    Added SequenceGenerator annotation.
+ * May 07, 2013 1869        bsteffen    Remove dataURI column from
+ *                                      PluginDataObject.
+ * Aug 30, 2013 2298        rjpeter     Make getPluginName abstract
+ * 
+ * + * @author Chin Chen + * @version 1.0 + * + */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "sshaseq") @Table(name = "ssha", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -58,2511 +59,2509 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "ssha", - indexes = { - @Index(name = "ssha_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "ssha", indexes = { @Index(name = "ssha_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize public class SshaRecord extends PersistablePluginDataObject implements - IDecoderGettable, IPointData, IPersistable { - private static final long serialVersionUID = 1L; - private static final float RMISSD = IDecoderConstantsN.FLOAT_MISSING; - private static final Integer IMISSD = IDecoderConstantsN.INTEGER_MISSING; - - /** Satellite Identification */ - @Column - /* - * Sea surface height anomalies are from blended TOPEX/Poseidon, Jason-1, - * ERS 1, ERS 2m GPO and Envisat ocean altimetry satellites, therefore said - * should be a primary key. - */ - @DataURI(position = 4) - @DynamicSerializeElement - private Long said; - - /** Satellite Instruments */ - @Column - @DynamicSerializeElement - private Long siid; - - /** Station Acquisition */ - @Column(length = 20) - @DynamicSerializeElement - private String staq; - - /** Software Identification and Version Number */ - @Column(length = 12) - @DynamicSerializeElement - private String softv; - - /** Satellite Cycle Number */ - @Column - @DynamicSerializeElement - private Long sacyln; - - /** Orbit Number */ - @Column - @DataURI(position = 5) - @DynamicSerializeElement - private Long orbn; - - /** Numerical Model Identifier */ - @Column(length = 16) - @DynamicSerializeElement - private String numid; - - /** Observation time */ - @Column - @DataURI(position = 1) - @DynamicSerializeElement - private Calendar obsTime; - - /** Latitude */ - @Column - @DataURI(position = 2) - @DynamicSerializeElement - private Double clath; - - /** Longitude */ - @Column - @DataURI(position = 3) - @DynamicSerializeElement - private Double clonh; - - /** Remotely Sensed Surface Type */ - @Transient - @DynamicSerializeElement - private Long rsst; - - /** Altimeter Echo Type */ - @Transient - @DynamicSerializeElement - private Long aetp; - - /** Radiometer Sensed Surface Type */ - @Transient - @DynamicSerializeElement - private Long dsst; - - /** Interpolation Flag */ - @Transient - @DynamicSerializeElement - private Long intf; - - /** Three-dimensional Error Estimate of the Navigator Orbit */ - @Transient - @DynamicSerializeElement - private Long eeno; - - /** Altimeter State Flag */ - @Transient - @DynamicSerializeElement - private Long asfl; - - /** Altimeter Data Quality Flag */ - @Transient - @DynamicSerializeElement - private Long adqf; - - /** Altimeter Correction Quality Flag */ - @Transient - @DynamicSerializeElement - private Long arqf; - - /** Altimeter Rain Flag */ - @Transient - @DynamicSerializeElement - private Long alrf; - - /** Radioimeter State Flag */ - @Transient - @DynamicSerializeElement - private Long rsfl; - - /** Radioimeter Data Quality Flag */ - @Transient - @DynamicSerializeElement - private Long rdqf; - - /** Radioimeter Brightness Temperature Interpretation */ - @Transient - @DynamicSerializeElement - private Long rbif; - - /** Ice Presence Indicator */ - @Transient - @DynamicSerializeElement - private Long ipin; - - /** Auxilliary Altimeter State Flags */ - @Transient - @DynamicSerializeElement - private Long aasf; - - /** Meteorological Map Availability */ - @Transient - @DynamicSerializeElement - private Long mmap; - - /** Interpolation Flag For Mean Diurnal Tide */ - @Transient - @DynamicSerializeElement - private Long ifdt; - - /** Ku Band Ocean Range (m) */ - @Transient - @DynamicSerializeElement - private Double kbor; - - /** RMS of 20 Hz Ku Band Ocean Range (m) */ - @Transient - @DynamicSerializeElement - private Double rkbor; - - /** Number of 20 Hz valid points for Ku Band */ - @Transient - @DynamicSerializeElement - private Long nvpk2; - - /** Ku Band net instrumental Correction (m) */ - @Transient - @DynamicSerializeElement - private Double kbic; - - /** Sea State Bias Correction On Ku Band (m) */ - @Transient - @DynamicSerializeElement - private Double sbck; - - /** Ku Band Significant Wave Height (m) */ - @Transient - @DynamicSerializeElement - private Double kbsw; - - /** RMS 20 Hz Ku Band Significant Wave Height (m) */ - @Transient - @DynamicSerializeElement - private Double rksw; - - /** Number of 20 Hz valid points for Ku Band Significant Wave Height */ - @Transient - @DynamicSerializeElement - private Long nvksw; - - /** - * 20 Hz RMS Ku Band Net Instrumental Correction For Significant Wave Height - * (m) - */ - @Transient - @DynamicSerializeElement - private Double kncs; - - /** Ku Band Corrected Ocean Backscatter coefficient (kb) */ - @Transient - @DynamicSerializeElement - private Double kobc; - - /** STD Ku Band Corrected Ocean Backscatter coefficient (kb) */ - @Transient - @DynamicSerializeElement - private Double skobc; - - /** Number of valid points for Ku Band Backscatter */ - @Transient - @DynamicSerializeElement - private Long nvpkb; - - /** Ku band net instrumental correction for AGC (db) */ - @Transient - @DynamicSerializeElement - private Double knic; - - /** Attenuation Correction 1 On Sigma-0 (db) */ - @Transient - @DynamicSerializeElement - private Double acrs1; - - /** Attenuation Correction 2 On Sigma-0 (db) */ - @Transient - @DynamicSerializeElement - private Double acrs2; - - /** Ku Band Automatic Gain Control (db) */ - @Transient - @DynamicSerializeElement - private Double kagc; - - /** RMS Ku Band Automatic Gain Control (db) */ - @Transient - @DynamicSerializeElement - private Double rkagc; - - /** Number of valid points for Ku Band Automatic Gain Control */ - @Transient - @DynamicSerializeElement - private Long nvkg; - - /** C Band Ocean Range (m) */ - @Transient - @DynamicSerializeElement - private Double cbor; - - /** RMS of C Band Ocean Range (m) */ - @Transient - @DynamicSerializeElement - private Double rcbor; - - /** Number of 20 Hz valid points for C band */ - @Transient - @DynamicSerializeElement - private Long nvpc; - - /** C band net instrumental correction (m) */ - @Transient - @DynamicSerializeElement - private Double cbic; - - /** Sea state bias correction on C band (m) */ - @Transient - @DynamicSerializeElement - private Double sbcc; - - /** C band significant wave height (m) */ - @Transient - @DynamicSerializeElement - private Double cbsw; - - /** RMS 20 Hz C band significant wave height (m) */ - @Transient - @DynamicSerializeElement - private Double rcsw; - - /** Number of 20 Hz valid points for C band significance */ - @Transient - @DynamicSerializeElement - private Long nvcsw; - - /** C band net instrumental correction for significance (m) */ - @Transient - @DynamicSerializeElement - private Double cncs; - - /** C band corrected ocean backscatter coefficient (db) */ - @Transient - @DynamicSerializeElement - private Double ccob; - - /** RMS C band corrected ocean backscatter coefficient (db) */ - @Transient - @DynamicSerializeElement - private Double rccob; - - /** Number of valid points for C band backscatter */ - @Transient - @DynamicSerializeElement - private Long nvpcb; - - /** C band net instrumental correction for AGC (db) */ - @Transient - @DynamicSerializeElement - private Double cnia; - - /** C band automatic gain control (db) */ - @Transient - @DynamicSerializeElement - private Double cagc; - - /** RMS C band automatic gain control (db) */ - @Transient - @DynamicSerializeElement - private Double rcagc; - - /** Number of valid points for C band automatic gain */ - @Transient - @DynamicSerializeElement - private Long nvpca; - - /** Satellite channel center frequency 1 (hz) */ - @Transient - @DynamicSerializeElement - private Double sccf1; - - /** Satellite channel center frequency 2 (hz) */ - @Transient - @DynamicSerializeElement - private Double sccf2; - - /** Satellite channel center frequency 3 (hz) */ - @Transient - @DynamicSerializeElement - private Double sccf3; - - /** Brightness temperature 1 (k) */ - @Transient - @DynamicSerializeElement - private Double tmbrst1; - - /** Brightness temperature 2 (k) */ - @Transient - @DynamicSerializeElement - private Double tmbrst2; - - /** Brightness temperature 3 (k) */ - @Transient - @DynamicSerializeElement - private Double tmbrst3; - - /** Radiometer water vapor content (kg/m**2) */ - @Transient - @DynamicSerializeElement - private Double rwvc; - - /** Radiometer liquid content (kg/m**) */ - @Transient - @DynamicSerializeElement - private Double rlqc; - - /** Height or altitude 1 (m) */ - @Transient - @DynamicSerializeElement - private Double hmsl1; - - /** Height or altitude 2 (m) */ - @Transient - @DynamicSerializeElement - private Double hmsl2; - - /** Wind speed from altimeter (m/s) */ - @Transient - @DynamicSerializeElement - private Double wspa; - - /** Wind speed from radiometer (m/s) */ - @Transient - @DynamicSerializeElement - private Double wspr; - - /** u-component of the model wind vector (m/s) */ - @Transient - @DynamicSerializeElement - private Double umwv; - - /** v-component of the model wind vector (m/s) */ - @Transient - @DynamicSerializeElement - private Double vwmv; - - /** Mean dynamic topography (m) */ - @Transient - @DynamicSerializeElement - private Double mdyt; - - /** Altitude of COG above reference ellipsoid (m) */ - @Transient - @DynamicSerializeElement - private Double alre; - - /** Instantaneous altitude rate (m/s) */ - @Transient - @DynamicSerializeElement - private Double ialr; - - /** Squared off nadir angle of the satellite from platform data (degree**2) */ - @Transient - @DynamicSerializeElement - private Double onap; - - /** Squared off nadir angle of the satellite from waveform data (degree**2) */ - @Transient - @DynamicSerializeElement - private Double sonaw; - - /** Ionospheric correction from model on Ku band (m) */ - @Transient - @DynamicSerializeElement - private Double icmk; - - /** Altimeter ionospheric correction on Ku band (m) */ - @Transient - @DynamicSerializeElement - private Double aick; - - /** Model dry tropospheric correction (m) */ - @Transient - @DynamicSerializeElement - private Double mdtc; - - /** Model wet tropospheric correction (m) */ - @Transient - @DynamicSerializeElement - private Double mwtc; - - /** Radiometer wet tropospheric correction (m) */ - @Transient - @DynamicSerializeElement - private Double rwtc; - - /** Mean sea-surface height (m) */ - @Transient - @DynamicSerializeElement - private Double mssh; - - /** Mean sea surface height from altimeter only (m) */ - @Transient - @DynamicSerializeElement - private Double msha; - - /** Geoid's height (m) */ - @Transient - @DynamicSerializeElement - private Double geodh; - - /** Ocean depth/land elevation (m) */ - @Transient - @DynamicSerializeElement - private Double odle; - - /** Solid earth tide height (m) */ - @Transient - @DynamicSerializeElement - private Double seth; - - /** Total geocentric ocean tide height solution 1 (m) */ - @Transient - @DynamicSerializeElement - private Double tgoth1; - - /** Total geocentric ocean tide height solution 2 (m) */ - @Transient - @DynamicSerializeElement - private Double tgoth2; - - /** Loading tide height geocentric ocean tide solution 1 (m) */ - @Transient - @DynamicSerializeElement - private Double lths1; - - /** Loading tide height geocentric ocean tide solution 2 (m) */ - @Transient - @DynamicSerializeElement - private Double lths2; - - /** Long period tide height (m) */ - @Transient - @DynamicSerializeElement - private Double lpth; - - /** Non-equilibrium long period tide height (m) */ - @Transient - @DynamicSerializeElement - private Double nlth; - - /** Geocentric pole tide height (m) */ - @Transient - @DynamicSerializeElement - private Double gpth; - - /* Inverted barometer correction (m) */ - @Transient - @DynamicSerializeElement - private Double ibco; - - /* High frequency fluctuations of the sea surface topography correction (m) */ - @Transient - @DynamicSerializeElement - private Double hfstc; - - /** Sea Surface Height Anomoly (m) */ - @Transient - @DynamicSerializeElement - private Double ssha; - - /** Report type */ - @Transient - @DynamicSerializeElement - @DataURI(position=6) - private String reportType; - - @Embedded - @DynamicSerializeElement - private PointDataView pointDataView; - - /** - * Default constructor. - */ - public SshaRecord() { - Double doubleRmissd = Double.parseDouble(String.valueOf(RMISSD)); - Long longImissd = Long.parseLong(String.valueOf(IMISSD)); - this.reportType = "BUFRSSHA"; - this.said = longImissd; - this.siid = longImissd; - this.staq = " "; - this.softv = " "; - this.sacyln = longImissd; - this.orbn = longImissd; - this.numid = " "; - this.clath = doubleRmissd; - this.clonh = doubleRmissd; - this.rsst = longImissd; - this.aetp = longImissd; - this.dsst = longImissd; - this.intf = longImissd; - this.eeno = longImissd; - this.asfl = longImissd; - this.adqf = longImissd; - this.arqf = longImissd; - this.alrf = longImissd; - this.rsfl = longImissd; - this.rdqf = longImissd; - this.rbif = longImissd; - this.ipin = longImissd; - this.aasf = longImissd; - this.mmap = longImissd; - this.ifdt = longImissd; - this.kbor = doubleRmissd; - this.rkbor = doubleRmissd; - this.nvpk2 = longImissd; - this.kbic = doubleRmissd; - this.sbck = doubleRmissd; - this.kbsw = doubleRmissd; - this.rksw = doubleRmissd; - this.nvksw = longImissd; - this.kncs = doubleRmissd; - this.kobc = doubleRmissd; - this.skobc = doubleRmissd; - this.nvpkb = longImissd; - this.knic = doubleRmissd; - this.acrs1 = doubleRmissd; - this.acrs2 = doubleRmissd; - this.kagc = doubleRmissd; - this.rkagc = doubleRmissd; - this.nvkg = longImissd; - this.cbor = doubleRmissd; - this.rcbor = doubleRmissd; - this.nvpc = longImissd; - this.cbic = doubleRmissd; - this.sbcc = doubleRmissd; - this.cbsw = doubleRmissd; - this.rcsw = doubleRmissd; - this.nvcsw = longImissd; - this.cncs = doubleRmissd; - this.ccob = doubleRmissd; - this.rccob = doubleRmissd; - this.nvpcb = longImissd; - this.cnia = doubleRmissd; - this.cagc = doubleRmissd; - this.rcagc = doubleRmissd; - this.nvpca = longImissd; - this.sccf1 = doubleRmissd; - this.sccf2 = doubleRmissd; - this.sccf3 = doubleRmissd; - this.tmbrst1 = doubleRmissd; - this.tmbrst2 = doubleRmissd; - this.tmbrst3 = doubleRmissd; - this.rwvc = doubleRmissd; - this.rlqc = doubleRmissd; - this.hmsl1 = doubleRmissd; - this.hmsl2 = doubleRmissd; - this.wspa = doubleRmissd; - this.wspr = doubleRmissd; - this.umwv = doubleRmissd; - this.vwmv = doubleRmissd; - this.mdyt = doubleRmissd; - this.alre = doubleRmissd; - this.ialr = doubleRmissd; - this.onap = doubleRmissd; - this.sonaw = doubleRmissd; - this.icmk = doubleRmissd; - this.aick = doubleRmissd; - this.mdtc = doubleRmissd; - this.mwtc = doubleRmissd; - this.rwtc = doubleRmissd; - this.mssh = doubleRmissd; - this.msha = doubleRmissd; - this.geodh = doubleRmissd; - this.odle = doubleRmissd; - this.seth = doubleRmissd; - this.tgoth1 = doubleRmissd; - this.tgoth2 = doubleRmissd; - this.lths1 = doubleRmissd; - this.lths2 = doubleRmissd; - this.lpth = doubleRmissd; - this.nlth = doubleRmissd; - this.gpth = doubleRmissd; - this.ibco = doubleRmissd; - this.hfstc = doubleRmissd; - this.ssha = doubleRmissd; - } - - /** - * Constructor for DataURI construction through base class. This is used by - * the notification service. - * - * @param uri - * A data uri applicable to this class. - */ - public SshaRecord(String uri) { - super(uri); - } - - /** - * Get the observation report type. - * - * @return the reportType - */ - public String getReportType() { - return reportType; - } - - /** - * Set the observation report type. - * - * @param reportType - * the reportType to set - */ - public void setReportType(String reportType) { - this.reportType = reportType; - } - - /** - * Get the Satellite Identifier. - * - * @return the Satellite ID - */ - public Long getSaid() { - return said; - } - - /** - * @param said - * the Satellite Identifier to set - */ - public void setSaid(Long said) { - this.said = said; - } - - /** - * Get the Satellite Instruments. - * - * @return the Satellite Instruments - */ - public Long getSiid() { - return siid; - } - - /** - * @param siid - * the Satellite Instruments to set - */ - public void setSiid(Long siid) { - this.siid = siid; - } - - /** - * Get the Station Acquisition. - * - * @return the Station Acquisition - */ - public String getStaq() { - return staq; - } - - /** - * @param staq - * the Station Acquisition to set - */ - public void setStaq(String staq) { - this.staq = staq; - } - - /** - * Get the Software Identification and Version. - * - * @return the Software Id and Version - */ - public String getSoftv() { - return softv; - } - - /** - * @param softv - * the Software Id and Version to set - */ - public void setSoftv(String softv) { - this.softv = softv; - } - - /** - * Get the Satellite Cycle Number. - * - * @return the Satellite Cycle Number - */ - public Long getSacyln() { - return sacyln; - } - - /** - * @param sacyln - * the Satellite Cycle Number to set - */ - public void setSacyln(Long sacyln) { - this.sacyln = sacyln; - } - - /** - * Get the Orbit Number. - * - * @return the Orbit Number - */ - public Long getOrbn() { - return orbn; - } - - /** - * @param orbn - * the Orbit Number to set - */ - public void setOrbn(Long orbn) { - this.orbn = orbn; - } - - /** - * Get the Numerical Model Identifier. - * - * @return the Numerical Model Identifier - */ - public String getNumid() { - return numid; - } - - /** - * @param numid - * the Numerical Model Identifier to set - */ - public void setNumid(String numid) { - this.numid = numid; - } - - /** - * @return the clath - */ - public Double getClath() { - return clath; - } - - /** - * @param clath - * the latitude to set - */ - public void setClath(Double clath) { - this.clath = clath; - } - - /** - * @return the clonh - */ - public Double getClonh() { - return clonh; - } - - /** - * @param clonh - * the longitude to set - */ - public void setClonh(Double clonh) { - this.clonh = clonh; - } - - /** - * Get the Remote Sensed Surface Type. - * - * @return the Remote Sensed Surface Type - */ - public Long getRsst() { - return rsst; - } - - /** - * @param rsst - * the Remote Sensed Surface Type to set - */ - public void setRsst(Long rsst) { - this.rsst = rsst; - } - - /** - * Get the Altimeter Echo Type. - * - * @return the Altimeter Echo Type - */ - public Long getAetp() { - return aetp; - } - - /** - * @param aetp - * the Altimeter Echo Type to set - */ - public void setAetp(Long aetp) { - this.aetp = aetp; - } - - /** - * Get the Radiometer Sensed Surface Type. - * - * @return the Remote Sensed Surface Type - */ - public Long getDsst() { - return dsst; - } - - /** - * @param dsst - * the Radiometer Sensed Surface Type to set - */ - public void setDsst(Long dsst) { - this.dsst = dsst; - } - - /** - * Get the Interpolation Flag. - * - * @return the Interpolation Flag - */ - public Long getIntf() { - return intf; - } - - /** - * @param intf - * the Interpolation Flag to set - */ - public void setIntf(Long intf) { - this.intf = intf; - } - - /** - * Get the Three-dimensional Error Estimate of the Navigator Orbit. - * - * @return the Three-dimensional Error Estimate of the Navigator Orbit - */ - public Long getEeno() { - return eeno; - } - - /** - * @param eeno - * the Three-dimensional Error Estimate of the Navigator Orbit to - * set - */ - public void setEeno(Long eeno) { - this.eeno = eeno; - } - - /** - * Get the Altimeter State Flag. - * - * @return the Altimeter State Flag - */ - public Long getAsfl() { - return asfl; - } - - /** - * @param asfl - * the Altimeter State Flag to set - */ - public void setAsfl(Long asfl) { - this.asfl = asfl; - } - - /** - * Get the Altimeter Data Quality Flag. - * - * @return the Altimeter Data Quality Flag - */ - public Long getAdqf() { - return adqf; - } - - /** - * @param adqf - * the Altimeter Data Quality Flag to set - */ - public void setAdqf(Long adqf) { - this.adqf = adqf; - } - - /** - * Get the Altimeter Correction Quality Flag. - * - * @return the Altimeter Correction Quality Flag - */ - public Long getArqf() { - return arqf; - } - - /** - * @param arqf - * the Altimeter Correction Quality Flag to set - */ - public void setArqf(Long arqf) { - this.arqf = arqf; - } - - /** - * Get the Altimeter Rain Flag. - * - * @return the Altimeter Rain Flag - */ - public Long getAlrf() { - return alrf; - } - - /** - * @param alrf - * the Altimeter Rain Flag to set - */ - public void setAlrf(Long alrf) { - this.alrf = alrf; - } - - /** - * Get the Radiometer State Flag. - * - * @return the Radiometer State Flag - */ - public Long getRsfl() { - return rsfl; - } - - /** - * @param rsfl - * the Radiometer State Flag to set - */ - public void setRsfl(Long rsfl) { - this.rsfl = rsfl; - } - - /** - * Get the Radiometer Data Quality Flag. - * - * @return the Radiometer Data Quality Flag - */ - public Long getRdqf() { - return rdqf; - } - - /** - * @param rdqf - * the Radiometer Data Quality Flag to set - */ - public void setRdqf(Long rdqf) { - this.rdqf = rdqf; - } - - /** - * Get the Radiometer Brightness Temperature Interpretation. - * - * @return the Radiometer Brightness Temperature Interpretation - */ - public Long getRbif() { - return rbif; - } - - /** - * @param rbif - * the Radiometer Brightness Temperature Interpretation to set - */ - public void setRbif(Long rbif) { - this.rbif = rbif; - } - - /** - * Get the Ice Presence Indicator. - * - * @return the Ice Presence Indicator - */ - public Long getIpin() { - return ipin; - } - - /** - * @param ipin - * the Ice Presence Indicator to set - */ - public void setIpin(Long ipin) { - this.ipin = ipin; - } - - /** - * Get the Auxillliary Altimeter State Flags. - * - * @return the Auxillliary Altimeter State Flags - */ - public Long getAasf() { - return aasf; - } - - /** - * @param aasf - * the Auxillliary Altimeter State Flags to set - */ - public void setAasf(Long aasf) { - this.aasf = aasf; - } - - /** - * Get the Meteorological Map Availablity. - * - * @return the Meteorological Map Availablity - */ - public Long getMmap() { - return mmap; - } - - /** - * @param mmap - * the Meteorological Map Availablity to set - */ - public void setMmap(Long mmap) { - this.mmap = mmap; - } - - /** - * Get the Interpolation Flag For Mean Diurnal Tide. - * - * @return the Interpolation Flag For Mean Diurnal Tide - */ - public Long getIfdt() { - return ifdt; - } - - /** - * @param ifdt - * the Interpolation Flag For Mean Diurnal Tide to set - */ - public void setIfdt(Long ifdt) { - this.ifdt = ifdt; - } - - /** - * Get the Ku Band Ocean Range - * - * @param kbor - * Ku Band Ocean Range to return - */ - public Double getKbor() { - return kbor; - } - - /** - * @param kbor - * Ku Band Ocean Range to set - */ - public void setKbor(Double kbor) { - this.kbor = kbor; - } - - /** - * Get the RMS of 20 Hz Ku Band Ocean Range - * - * @param rkbor - * RMS of 20 Hz Ku Band Ocean Range to return - */ - public Double getRkbor() { - return rkbor; - } - - /** - * @param rkbor - * RMS of 20 Hz Ku Band Ocean Range to set - */ - public void setRkbor(Double rkbor) { - this.rkbor = rkbor; - } - - /** - * Get the Number of 20 Hz valid points for Ku Band. - * - * @return the Number of 20 Hz valid points for Ku Band - */ - public Long getNvpk2() { - return nvpk2; - } - - /** - * @param nvpk2 - * the Number of 20 Hz valid points for Ku Band to set - */ - public void setNvpk2(Long nvpk2) { - this.nvpk2 = nvpk2; - } - - /** - * Get the Ku Band Net Instrumental Correction - * - * @param kbic - * Ku Band Net Instrumental Correction to return - */ - public Double getKbic() { - return kbic; - } - - /** - * @param kbic - * Ku Band Net Instrumental Correction to set - */ - public void setKbic(Double kbic) { - this.kbic = kbic; - } - - /** - * Get the Sea State Bias Correction On Ku Band - * - * @param sbck - * Sea State Bias Correction On Ku Band to return - */ - public Double getSbck() { - return sbck; - } - - /** - * @param sbck - * Sea State Bias Correction On Ku Band to set - */ - public void setSbck(Double sbck) { - this.sbck = sbck; - } - - /** - * Get Ku Band Significant Wave Height - * - * @param kbsw - * Ku Band Significant Wave Height to return - */ - public Double getKbsw() { - return kbsw; - } - - /** - * @param kbsw - * Ku Band Significant Wave Height to set - */ - public void setKbsw(Double kbsw) { - this.kbsw = kbsw; - } - - /** - * RMS 20 Hz Ku Band Significant Wave Height - * - * @param rksw - * RMS 20 Hz Ku Band Significant Wave Height - */ - public Double getRksw() { - return rksw; - } - - /** - * @param rksw - * 20 Hz RMS Ku Band Significant Wave Height to set - */ - public void setRksw(Double rksw) { - this.rksw = rksw; - } - - /** - * Get the Number of 20 Hz valid points for Ku Band Significant Wave Height. - * - * @return the Number of 20 Hz valid points for Ku Band Significant Wave - * Height - */ - public Long getNvksw() { - return nvksw; - } - - /** - * @param nvksw - * the Number of 20 Hz valid points for Ku Band Significant Wave - * Height to set - */ - public void setNvksw(Long nvksw) { - this.nvksw = nvksw; - } - - /** - * RMS 20 Hz Ku Band Net Instrumental Correction For Significant Wave Height - * - * @param kncs - * RMS 20 Hz Ku Band Net Instrumental Correction For Significant - * Wave Height - */ - public Double getKncs() { - return kncs; - } - - /** - * @param kncs - * 20 Hz RMS Ku Band Net Instrumental Correction For Significant - * Wave Height to set - */ - public void setKncs(Double kncs) { - this.kncs = kncs; - } - - /** - * Ku Band Corrected Ocean Backscatter coefficient - * - * @param kobc - * Ku Band Corrected Ocean Backscatter coefficient - */ - public Double getKobc() { - return kobc; - } - - /** - * @param kobc - * Ku Band Corrected Ocean Backscatter coefficient to set - */ - public void setKobc(Double kobc) { - this.kobc = kobc; - } - - /** - * STD Ku Band Corrected Ocean Backscatter coefficient - * - * @param kobc - * STD Ku Band Corrected Ocean Backscatter coefficient - */ - public Double getSkobc() { - return skobc; - } - - /** - * @param skobc - * STD Ku Band Corrected Ocean Backscatter coefficient to set - */ - public void setSkobc(Double skobc) { - this.skobc = skobc; - } - - /** - * Get the Number of valid points for Ku Band Backscatter. - * - * @return the Number of valid points for Ku Band Backscatter - */ - public Long getNvpkb() { - return nvpkb; - } - - /** - * @param nvpkb - * the Number of valid points for Ku Band Backscatter to set - */ - public void setNvpkb(Long nvpkb) { - this.nvpkb = nvpkb; - } - - /** - * Ku band net instrumental correction for AGC - * - * @param knic - * Ku band net instrumental correction for AGC - */ - public Double getKnic() { - return knic; - } - - /** - * @param knic - * Ku band net instrumental correction for AGC to set - */ - public void setKnic(Double knic) { - this.knic = knic; - } - - /** - * Attenuation Correction 1 On Sigma-0 - * - * @param acrs1 - * Attenuation 1 Correction On Sigma-0 - */ - public Double getAcrs1() { - return acrs1; - } - - /** - * @param acrs1 - * Attenuation Correction 1 On Sigma-0 - */ - public void setAcrs1(Double acrs1) { - this.acrs1 = acrs1; - } - - /** - * Attenuation Correction 2 On Sigma-0 - * - * @param acrs2 - * Attenuation Correction 2 On Sigma-0 - */ - public Double getAcrs2() { - return acrs2; - } - - /** - * @param acrs2 - * Attenuation Correction 2 On Sigma-0 - */ - public void setAcrs2(Double acrs2) { - this.acrs2 = acrs2; - } - - /** - * Ku Band Automatic Gain Control - * - * @param kagc - * Ku Band Automatic Gain Control - */ - public Double getKagc() { - return kagc; - } - - /** - * @param kagc - * Ku Band Automatic Gain Control - */ - public void setKagc(Double kagc) { - this.kagc = kagc; - } - - /** - * RMS Ku Band Automatic Gain Control - * - * @param rkagc - * RMS Ku Band Automatic Gain Control - */ - public Double getRkagc() { - return rkagc; - } - - /** - * @param rkagc - * RMS Ku Band Automatic Gain Control - */ - public void setRkagc(Double rkagc) { - this.rkagc = rkagc; - } - - /** - * Get the Number of valid points for Ku Band Automatic Gain Control. - * - * @return nvkg the Number of valid points for Ku Band Automatic Gain - * Control - */ - public Long getNvkg() { - return nvkg; - } - - /** - * @param nvkg - * the Number of valid points for Ku Band Automatic Gain Control - * to set - */ - public void setNvkg(Long nvkg) { - this.nvkg = nvkg; - } - - /** - * C Band Ocean Range - * - * @param cbor - * C Band Ocean Range to return - */ - public Double getCbor() { - return cbor; - } - - /** - * @param cbor - * C Band Ocean Range to set - */ - public void setCbor(Double cbor) { - this.cbor = cbor; - } - - /** - * RMS of C Band Ocean Range - * - * @param rcbor - * RMS of C Band Ocean Range to return - */ - public Double getRcbor() { - return rcbor; - } - - /** - * @param rcbor - * RMS of C Band Ocean Range to set - */ - public void setRcbor(Double rcbor) { - this.rcbor = rcbor; - } - - /** - * Get the Number of Number of 20 Hz valid points for C band - * - * @return nvpc the Number of 20 Hz valid points for C band - */ - public Long getNvpc() { - return nvpc; - } - - /** - * @param nvpc - * the Number of 20 Hz valid points for C band to set - */ - public void setNvpc(Long nvpc) { - this.nvpc = nvpc; - } - - /** - * C Band net instrumental correction - * - * @param cbic - * C band net instrumental correction to return - */ - public Double getCbic() { - return cbic; - } - - /** - * @param cbic - * C band net instrumental correction to set - */ - public void setCbic(Double cbic) { - this.cbic = cbic; - } - - /** - * Sea state bias correction on C band - * - * @param sbcc - * Sea state bias correction on C band to return - */ - public Double getSbcc() { - return sbcc; - } - - /** - * @param sbcc - * Sea state bias correction on C band to set - */ - public void setSbcc(Double sbcc) { - this.sbcc = sbcc; - } - - /** - * C band significant wave height - * - * @param cbsw - * C band significant wave height to return - */ - public Double getCbsw() { - return cbsw; - } - - /** - * @param cbsw - * C band significant wave height to set - */ - public void setCbsw(Double cbsw) { - this.cbsw = cbsw; - } - - /** - * RMS 20 Hz C band significant wave height - * - * @param rcsw - * RMS 20 Hz C band significant wave height to return - */ - public Double getRcsw() { - return rcsw; - } - - /** - * @param rcsw - * RMS 20 Hz C band significant wave height to set - */ - public void setRcsw(Double rcsw) { - this.rcsw = rcsw; - } - - /** - * Get the Number of 20 Hz valid points for C band significance - * - * @return nvcsw the Number of 20 Hz valid points for C band significance - */ - public Long getNvcsw() { - return nvcsw; - } - - /** - * @param nvcsw - * the Number of 20 Hz valid points for C band significance to - * set - */ - public void setNvcsw(Long nvcsw) { - this.nvcsw = nvcsw; - } - - /** - * C band net instrumental correction for significance - * - * @param cncs - * C band net instrumental correction for significance to return - */ - public Double getCncs() { - return cncs; - } - - /** - * @param cncs - * C band net instrumental correction for significance to set - */ - public void setCncs(Double cncs) { - this.cncs = cncs; - } - - /** - * C band corrected ocean backscatter coefficient - * - * @param ccob - * C band corrected ocean backscatter coefficient to return - */ - public Double getCcob() { - return ccob; - } - - /** - * @param ccob - * C band corrected ocean backscatter coefficient to set - */ - public void setCcob(Double ccob) { - this.ccob = ccob; - } - - /** - * RMS C band corrected ocean backscatter coefficient - * - * @param rccob - * RMS C band corrected ocean backscatter coefficient to return - */ - public Double getRccob() { - return rccob; - } - - /** - * @param rccob - * RMS C band corrected ocean backscatter coefficient to set - */ - public void setRccob(Double rccob) { - this.rccob = rccob; - } - - /** - * Get the Number of valid points for C band backscatter - * - * @return nvpcb the Number of valid points for C band backscatter - */ - public Long getNvpcb() { - return nvpcb; - } - - /** - * @param nvpcb - * the Number of valid points for C band backscatter to set - */ - public void setNvpcb(Long nvpcb) { - this.nvpcb = nvpcb; - } - - /** - * RMS C band net instrumental correction for AGC - * - * @param cnia - * C band net instrumental correction for AGC to return - */ - public Double getCnia() { - return cnia; - } - - /** - * @param cnia - * C band net instrumental correction for AGC to set - */ - public void setCnia(Double cnia) { - this.cnia = cnia; - } - - /** - * C band automatic gain control - * - * @param cagc - * C band automatic gain control to return - */ - public Double getCagc() { - return cagc; - } - - /** - * @param cagc - * C band automatic gain control to set - */ - public void setCagc(Double cagc) { - this.cagc = cagc; - } - - /** - * RMS C band automatic gain control - * - * @param rcagc - * RMS C band automatic gain control to return - */ - public Double getRcagc() { - return rcagc; - } - - /** - * @param rcagc - * RMS C band automatic gain control to set - */ - public void setRcagc(Double rcagc) { - this.rcagc = rcagc; - } - - /** - * Get the Number of valid points for C band automatic gain - * - * @return nvpca the Number of valid points for C band automatic gain - */ - public Long getNvpca() { - return nvpca; - } - - /** - * @param nvpca - * the Number of valid points for C band automatic gain to set - */ - public void setNvpca(Long nvpca) { - this.nvpca = nvpca; - } - - /** - * Satellite channel center frequency 1 - * - * @param sccf1 - * Satellite channel center frequency 1 - */ - public Double getSccf1() { - return sccf1; - } - - /** - * @param sccf1 - * Satellite channel center frequency 1 - */ - public void setSccf1(Double sccf1) { - this.sccf1 = sccf1; - } - - /** - * Satellite channel center frequency 1 - * - * @param sccf2 - * Satellite channel center frequency 2 - */ - public Double getSccf2() { - return sccf2; - } - - /** - * @param sccf2 - * Satellite channel center frequency 2 - */ - public void setSccf2(Double sccf2) { - this.sccf2 = sccf2; - } - - /** - * Satellite channel center frequency 3 - * - * @param sccf1 - * Satellite channel center frequency 3 - */ - public Double getSccf3() { - return sccf3; - } - - /** - * @param sccf3 - * Satellite channel center frequency 3 - */ - public void setSccf3(Double sccf3) { - this.sccf3 = sccf3; - } - - /** - * Brightness temperature 1 - * - * @param tmbrst1 - * Brightness temperature 1 - */ - public Double getTmbrst1() { - return tmbrst1; - } - - /** - * @param tmbrst1 - * Brightness temperature 1 - */ - public void setTmbrst1(Double tmbrst1) { - this.tmbrst1 = tmbrst1; - } - - /** - * Brightness temperature 2 - * - * @param tmbrst2 - * Brightness temperature 2 - */ - public Double getTmbrst2() { - return tmbrst2; - } - - /** - * @param tmbrst2 - * Brightness temperature 2 - */ - public void setTmbrst2(Double tmbrst2) { - this.tmbrst2 = tmbrst2; - } - - /** - * Brightness temperature 3 - * - * @param tmbrst3 - * Brightness temperature 3 - */ - public Double getTmbrst3() { - return tmbrst3; - } - - /** - * @param tmbrst3 - * Brightness temperature 3 - */ - public void setTmbrst3(Double tmbrst3) { - this.tmbrst3 = tmbrst3; - } - - /** - * Radiometer water vapor content - * - * @param rwvc - * Radiometer water vapor content to return - */ - public Double getRwvc() { - return rwvc; - } - - /** - * @param rwvc - * Radiometer water vapor content to set - */ - public void setRwvc(Double rwvc) { - this.rwvc = rwvc; - } - - /** - * Radiometer liquid content - * - * @param rlqc - * Radiometer liquid content to return - */ - public Double getRlqc() { - return rlqc; - } - - /** - * @param rlqc - * Radiometer liquid content to set - */ - public void setRlqc(Double rlqc) { - this.rlqc = rlqc; - } - - /** - * Height or altitude 1 - * - * @param hmsl - * Height or altitude 1 to return - */ - public Double getHmsl1() { - return hmsl1; - } - - /** - * @param hmsl - * Height or altitude 1 to set - */ - public void setHmsl1(Double hmsl1) { - this.hmsl1 = hmsl1; - } - - /** - * Height or altitude 2 - * - * @param hmsl - * Height or altitude 2 to return - */ - public Double getHmsl2() { - return hmsl2; - } - - /** - * @param hmsl - * Height or altitude 2 to set - */ - public void setHmsl2(Double hmsl2) { - this.hmsl2 = hmsl2; - } - - /** - * Wind speed from altimeter (m/s) - * - * @param wspa - * Wind speed from altimeter to return - */ - public Double getWspa() { - return wspa; - } - - /** - * @param wspa - * Wind speed from altimeter to set - */ - public void setWspa(Double wspa) { - this.wspa = wspa; - } - - /** - * Wind speed from radiometer (m/s) - * - * @param wspr - * Wind speed from radiometer to return - */ - public Double getWspr() { - return wspr; - } - - /** - * @param wspr - * Wind speed from radiometer to set - */ - public void setWspr(Double wspr) { - this.wspr = wspr; - } - - /** - * u-component of the model wind vector (m/s) - * - * @param umwv - * u-component of the model wind vector to return - */ - public Double getUmwv() { - return umwv; - } - - /** - * @param umwv - * u-component of the model wind vector to set - */ - public void setUmwv(Double umwv) { - this.umwv = umwv; - } - - /** - * u-component of the model wind vector (m/s) - * - * @param vwmv - * u-component of the model wind vector to return - */ - public Double getVwmv() { - return vwmv; - } - - /** - * @param vwmv - * u-component of the model wind vector to set - */ - public void setVwmv(Double vwmv) { - this.vwmv = vwmv; - } - - /** - * Mean dynamic topography (m) - * - * @param 1G Mean dynamic topography to return - */ - public Double getMdyt() { - return mdyt; - } - - /** - * @param mdyt - * Mean dynamic topography to set - */ - public void setMdyt(Double mdyt) { - this.mdyt = mdyt; - } - - /** - * Altitude of COG above reference ellipsoid (m) - * - * @param alre - * Altitude of COG above reference ellipsoid - */ - public Double getAlre() { - return alre; - } - - /** - * @param alre - * Altitude of COG above reference ellipsoid to set - */ - public void setAlre(Double alre) { - this.alre = alre; - } - - /** - * Instantaneous altitude rate (m/s) - * - * @param ialr - * Instantaneous altitude rate to return - */ - public Double getIalr() { - return ialr; - } - - /** - * @param ialr - * Instantaneous altitude rate to set - */ - public void setIalr(Double ialr) { - this.ialr = ialr; - } - - /** - * Squared off nadir angle of the satellite from platform data (degree**2) - * - * @param onap - * Squared off nadir angle of the satellite from platform data to - * set - */ - public Double getOnap() { - return onap; - } - - /** - * @param onap - * Squared off nadir angle of the satellite from platform data to - * set - */ - public void setOnap(Double onap) { - this.onap = onap; - } - - /** - * Squared off nadir angle of the satellite from waveform data (degree**2) - * - * @param sonaw - * Squared off nadir angle of the satellite from waveform data to - * return - */ - public Double getSonaw() { - return sonaw; - } - - /** - * @param sonaw - * Squared off nadir angle of the satellite from waveform data to - * set - */ - public void setSonaw(Double sonaw) { - this.sonaw = sonaw; - } - - /** - * Ionospheric correction from model on Ku band (m) - * - * @param icmk - * Ionospheric correction from model on Ku band to return - */ - public Double getIcmk() { - return icmk; - } - - /** - * @param icmk - * Ionospheric correction from model on Ku band to set - */ - public void setIcmk(Double icmk) { - this.icmk = icmk; - } - - /** - * Ionospheric correction from model on Ku band (m) - * - * @param aick - * Ionospheric correction from model on Ku band to return - */ - public Double getAick() { - return aick; - } - - /** - * @param aick - * Ionospheric correction from model on Ku band to set - */ - public void setAick(Double aick) { - this.aick = aick; - } - - /** - * Model dry tropospheric correction (m) - * - * @param mdtc - * Model dry tropospheric correction to return - */ - public Double getMdtc() { - return mdtc; - } - - /** - * @param mdtc - * Model dry tropospheric correction to set - */ - public void setMdtc(Double mdtc) { - this.mdtc = mdtc; - } - - /** - * Model wet tropospheric correction (m) - * - * @param mwtc - * Model wet tropospheric correction to return - */ - public Double getMwtc() { - return mwtc; - } - - /** - * @param mwtc - * Model wet tropospheric correction to set - */ - public void setMwtc(Double mwtc) { - this.mwtc = mwtc; - } - - /** - * Radiometer wet tropospheric correction (m) - * - * @param rwtc - * Radiometer wet tropospheric correction to return - */ - public Double getRwtc() { - return rwtc; - } - - /** - * @param rwtc - * Radiometer wet tropospheric correction to set - */ - public void setRwtc(Double rwtc) { - this.rwtc = rwtc; - } - - /** - * Mean sea-surface height (m) - * - * @param mssh - * Mean sea-surface height to return - */ - public Double getMssh() { - return mssh; - } - - /** - * @param mssh - * Mean sea-surface height to set - */ - public void setMssh(Double mssh) { - this.mssh = mssh; - } - - /** - * Mean sea-surface height from altimeter only (m) - * - * @param msha - * Mean sea-surface height from altimeter only to return - */ - public Double getMsha() { - return msha; - } - - /** - * @param msha - * Mean sea-surface height from altimeter only to set - */ - public void setMsha(Double msha) { - this.msha = msha; - } - - /** - * Geoid's height (m) - * - * @param geodh - * Geoid's height to return - */ - public Double getGeodh() { - return geodh; - } - - /** - * @param odle - * Ocean depth/land elevation (m) - */ - public void setGeodh(Double geodh) { - this.geodh = geodh; - } - - /** - * Ocean depth/land elevation (m) - * - * @param odle - * Ocean depth/land elevation to return - */ - public Double getOdle() { - return odle; - } - - /** - * @param odle - * Ocean depth/land elevation to set - */ - public void setOdle(Double odle) { - this.odle = odle; - } - - /** - * Solid earth tide height (m) - * - * @param seth - * Solid earth tide height to return - */ - public Double getSeth() { - return seth; - } - - /** - * @param seth - * Solid earth tide height to set - */ - public void setSeth(Double seth) { - this.seth = seth; - } - - /** - * Total geocentric ocean tide height solution 1 (m) - * - * @param tgoth1 - * Total geocentric ocean tide height solution 1 to return - */ - public Double getTgoth1() { - return tgoth1; - } - - /** - * @param tgoth1 - * Total geocentric ocean tide height solution 1 to set - */ - public void setTgoth1(Double tgoth1) { - this.tgoth1 = tgoth1; - } - - /** - * Total geocentric ocean tide height solution 2 (m) - * - * @param tgoth2 - * Total geocentric ocean tide height solution 2 to return - */ - public Double getTgoth2() { - return tgoth2; - } - - /** - * @param tgoth2 - * Total geocentric ocean tide height solution 2 to set - */ - public void setTgoth2(Double tgoth2) { - this.tgoth2 = tgoth2; - } - - /** - * Loading tide height geocentric ocean tide solution 1 (m) - * - * @param lths1 - * Loading tide height geocentric ocean tide solution 1 to return - */ - public Double getLths1() { - return lths1; - } - - /** - * @param lths1 - * Loading tide height geocentric ocean tide solution 1 to set - */ - public void setLths1(Double lths1) { - this.lths1 = lths1; - } - - /** - * Loading tide height geocentric ocean tide solution 2 (m) - * - * @param lths2 - * Loading tide height geocentric ocean tide solution 2 to return - */ - public Double getLths2() { - return lths2; - } - - /** - * @param lths2 - * Loading tide height geocentric ocean tide solution 2 to set - */ - public void setLths2(Double lths2) { - this.lths2 = lths2; - } - - /** - * Long period tide height (m) - * - * @param lpth - * Long period tide height to return - */ - public Double getLpth() { - return lpth; - } - - /** - * @param lpth - * Long period tide height to set - */ - public void setLpth(Double lpth) { - this.lpth = lpth; - } - - /** - * Non-equilibrium long period tide height (m) - * - * @param nlth - * Non-equilibrium long period tide height to return - */ - public Double getNlth() { - return nlth; - } - - /** - * @param nlth - * Non-equilibrium long period tide height to set - */ - public void setNlth(Double nlth) { - this.nlth = nlth; - } - - /** - * Geocentric pole tide height (m) - * - * @param gpth - * Geocentric pole tide height to return - */ - public Double getGpth() { - return gpth; - } - - /** - * @param gpth - * Geocentric pole tide height to set - */ - public void setGpth(Double gpth) { - this.gpth = gpth; - } - - /** - * Inverted barometer correction (m) - * - * @param ibco - * Inverted barometer correction to return - */ - public Double getIbco() { - return ibco; - } - - /** - * @param ibco - * Inverted barometer correction to set - */ - public void setIbco(Double ibco) { - this.ibco = ibco; - } - - /** - * High frequency fluctuations of the sea surface topography correction (m) - * - * @param hfstc - * High frequency fluctuations of the sea surface topography - * correction - * - */ - public Double getHfstc() { - return hfstc; - } - - /** - * @param hfstc - * High frequency fluctuations of the sea surface topography - * correction to set - */ - public void setHfstc(Double hfstc) { - this.hfstc = hfstc; - } - - /** - * Sea Surface Height Anomoly - * - * @param ssha - * Sea Surface Height Anomoly to return - */ - public Double getSsha() { - return ssha; - } - - /** - * @param ssha - * Sea Surface Height Anomoly to set - */ - public void setSsha(Double ssha) { - this.ssha = ssha; - } - - /** - * @return the obsTime - */ - public Calendar getObsTime() { - return obsTime; - } - - /** - * @param obsTime - * the obsTime to set - */ - public void setObsTime(Calendar obsTime) { - this.obsTime = obsTime; - } - - /** - * Get the value and units of a named parameter within this observation. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return An Amount with value and units. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Amount getValue(String paramName) { - return null; - } - - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public String getString(String paramName) { - return null; - } - - /** - * Get the value of a parameter that is represented as a String. - * - * @param paramName - * The name of the parameter value to retrieve. - * @return The String value of the parameter. If the parameter is unknown, a - * null reference is returned. - */ - @Override - public Collection getValues(String paramName) { - return null; - } - - /** - * Get the IDecoderGettable reference for this record. - * - * @return The IDecoderGettable reference for this record. - */ - @Override - public IDecoderGettable getDecoderGettable() { - return this; - } - - @Override - public void setDataURI(String dataURI) { - identifier = dataURI; - } - - @Override - public String[] getStrings(String paramName) { - return null; - } - - @Override - public Date getPersistenceTime() { - return this.dataTime.getRefTime(); - - } - - @Override - public void setPersistenceTime(Date persistTime) { - // TODO Auto-generated method stub - - } - - @Override - public PointDataView getPointDataView() { - return this.pointDataView; - } - - @Override - public void setPointDataView(PointDataView pointDataView) { - this.pointDataView = pointDataView; - - } + IDecoderGettable, IPointData, IPersistable { + private static final long serialVersionUID = 1L; + + private static final float RMISSD = IDecoderConstantsN.FLOAT_MISSING; + + private static final Integer IMISSD = IDecoderConstantsN.INTEGER_MISSING; + + /** Satellite Identification */ + @Column + /* + * Sea surface height anomalies are from blended TOPEX/Poseidon, Jason-1, + * ERS 1, ERS 2m GPO and Envisat ocean altimetry satellites, therefore said + * should be a primary key. + */ + @DataURI(position = 4) + @DynamicSerializeElement + private Long said; + + /** Satellite Instruments */ + @Column + @DynamicSerializeElement + private Long siid; + + /** Station Acquisition */ + @Column(length = 20) + @DynamicSerializeElement + private String staq; + + /** Software Identification and Version Number */ + @Column(length = 12) + @DynamicSerializeElement + private String softv; + + /** Satellite Cycle Number */ + @Column + @DynamicSerializeElement + private Long sacyln; + + /** Orbit Number */ + @Column + @DataURI(position = 5) + @DynamicSerializeElement + private Long orbn; + + /** Numerical Model Identifier */ + @Column(length = 16) + @DynamicSerializeElement + private String numid; + + /** Observation time */ + @Column + @DataURI(position = 1) + @DynamicSerializeElement + private Calendar obsTime; + + /** Latitude */ + @Column + @DataURI(position = 2) + @DynamicSerializeElement + private Double clath; + + /** Longitude */ + @Column + @DataURI(position = 3) + @DynamicSerializeElement + private Double clonh; + + /** Remotely Sensed Surface Type */ + @Transient + @DynamicSerializeElement + private Long rsst; + + /** Altimeter Echo Type */ + @Transient + @DynamicSerializeElement + private Long aetp; + + /** Radiometer Sensed Surface Type */ + @Transient + @DynamicSerializeElement + private Long dsst; + + /** Interpolation Flag */ + @Transient + @DynamicSerializeElement + private Long intf; + + /** Three-dimensional Error Estimate of the Navigator Orbit */ + @Transient + @DynamicSerializeElement + private Long eeno; + + /** Altimeter State Flag */ + @Transient + @DynamicSerializeElement + private Long asfl; + + /** Altimeter Data Quality Flag */ + @Transient + @DynamicSerializeElement + private Long adqf; + + /** Altimeter Correction Quality Flag */ + @Transient + @DynamicSerializeElement + private Long arqf; + + /** Altimeter Rain Flag */ + @Transient + @DynamicSerializeElement + private Long alrf; + + /** Radioimeter State Flag */ + @Transient + @DynamicSerializeElement + private Long rsfl; + + /** Radioimeter Data Quality Flag */ + @Transient + @DynamicSerializeElement + private Long rdqf; + + /** Radioimeter Brightness Temperature Interpretation */ + @Transient + @DynamicSerializeElement + private Long rbif; + + /** Ice Presence Indicator */ + @Transient + @DynamicSerializeElement + private Long ipin; + + /** Auxilliary Altimeter State Flags */ + @Transient + @DynamicSerializeElement + private Long aasf; + + /** Meteorological Map Availability */ + @Transient + @DynamicSerializeElement + private Long mmap; + + /** Interpolation Flag For Mean Diurnal Tide */ + @Transient + @DynamicSerializeElement + private Long ifdt; + + /** Ku Band Ocean Range (m) */ + @Transient + @DynamicSerializeElement + private Double kbor; + + /** RMS of 20 Hz Ku Band Ocean Range (m) */ + @Transient + @DynamicSerializeElement + private Double rkbor; + + /** Number of 20 Hz valid points for Ku Band */ + @Transient + @DynamicSerializeElement + private Long nvpk2; + + /** Ku Band net instrumental Correction (m) */ + @Transient + @DynamicSerializeElement + private Double kbic; + + /** Sea State Bias Correction On Ku Band (m) */ + @Transient + @DynamicSerializeElement + private Double sbck; + + /** Ku Band Significant Wave Height (m) */ + @Transient + @DynamicSerializeElement + private Double kbsw; + + /** RMS 20 Hz Ku Band Significant Wave Height (m) */ + @Transient + @DynamicSerializeElement + private Double rksw; + + /** Number of 20 Hz valid points for Ku Band Significant Wave Height */ + @Transient + @DynamicSerializeElement + private Long nvksw; + + /** + * 20 Hz RMS Ku Band Net Instrumental Correction For Significant Wave Height + * (m) + */ + @Transient + @DynamicSerializeElement + private Double kncs; + + /** Ku Band Corrected Ocean Backscatter coefficient (kb) */ + @Transient + @DynamicSerializeElement + private Double kobc; + + /** STD Ku Band Corrected Ocean Backscatter coefficient (kb) */ + @Transient + @DynamicSerializeElement + private Double skobc; + + /** Number of valid points for Ku Band Backscatter */ + @Transient + @DynamicSerializeElement + private Long nvpkb; + + /** Ku band net instrumental correction for AGC (db) */ + @Transient + @DynamicSerializeElement + private Double knic; + + /** Attenuation Correction 1 On Sigma-0 (db) */ + @Transient + @DynamicSerializeElement + private Double acrs1; + + /** Attenuation Correction 2 On Sigma-0 (db) */ + @Transient + @DynamicSerializeElement + private Double acrs2; + + /** Ku Band Automatic Gain Control (db) */ + @Transient + @DynamicSerializeElement + private Double kagc; + + /** RMS Ku Band Automatic Gain Control (db) */ + @Transient + @DynamicSerializeElement + private Double rkagc; + + /** Number of valid points for Ku Band Automatic Gain Control */ + @Transient + @DynamicSerializeElement + private Long nvkg; + + /** C Band Ocean Range (m) */ + @Transient + @DynamicSerializeElement + private Double cbor; + + /** RMS of C Band Ocean Range (m) */ + @Transient + @DynamicSerializeElement + private Double rcbor; + + /** Number of 20 Hz valid points for C band */ + @Transient + @DynamicSerializeElement + private Long nvpc; + + /** C band net instrumental correction (m) */ + @Transient + @DynamicSerializeElement + private Double cbic; + + /** Sea state bias correction on C band (m) */ + @Transient + @DynamicSerializeElement + private Double sbcc; + + /** C band significant wave height (m) */ + @Transient + @DynamicSerializeElement + private Double cbsw; + + /** RMS 20 Hz C band significant wave height (m) */ + @Transient + @DynamicSerializeElement + private Double rcsw; + + /** Number of 20 Hz valid points for C band significance */ + @Transient + @DynamicSerializeElement + private Long nvcsw; + + /** C band net instrumental correction for significance (m) */ + @Transient + @DynamicSerializeElement + private Double cncs; + + /** C band corrected ocean backscatter coefficient (db) */ + @Transient + @DynamicSerializeElement + private Double ccob; + + /** RMS C band corrected ocean backscatter coefficient (db) */ + @Transient + @DynamicSerializeElement + private Double rccob; + + /** Number of valid points for C band backscatter */ + @Transient + @DynamicSerializeElement + private Long nvpcb; + + /** C band net instrumental correction for AGC (db) */ + @Transient + @DynamicSerializeElement + private Double cnia; + + /** C band automatic gain control (db) */ + @Transient + @DynamicSerializeElement + private Double cagc; + + /** RMS C band automatic gain control (db) */ + @Transient + @DynamicSerializeElement + private Double rcagc; + + /** Number of valid points for C band automatic gain */ + @Transient + @DynamicSerializeElement + private Long nvpca; + + /** Satellite channel center frequency 1 (hz) */ + @Transient + @DynamicSerializeElement + private Double sccf1; + + /** Satellite channel center frequency 2 (hz) */ + @Transient + @DynamicSerializeElement + private Double sccf2; + + /** Satellite channel center frequency 3 (hz) */ + @Transient + @DynamicSerializeElement + private Double sccf3; + + /** Brightness temperature 1 (k) */ + @Transient + @DynamicSerializeElement + private Double tmbrst1; + + /** Brightness temperature 2 (k) */ + @Transient + @DynamicSerializeElement + private Double tmbrst2; + + /** Brightness temperature 3 (k) */ + @Transient + @DynamicSerializeElement + private Double tmbrst3; + + /** Radiometer water vapor content (kg/m**2) */ + @Transient + @DynamicSerializeElement + private Double rwvc; + + /** Radiometer liquid content (kg/m**) */ + @Transient + @DynamicSerializeElement + private Double rlqc; + + /** Height or altitude 1 (m) */ + @Transient + @DynamicSerializeElement + private Double hmsl1; + + /** Height or altitude 2 (m) */ + @Transient + @DynamicSerializeElement + private Double hmsl2; + + /** Wind speed from altimeter (m/s) */ + @Transient + @DynamicSerializeElement + private Double wspa; + + /** Wind speed from radiometer (m/s) */ + @Transient + @DynamicSerializeElement + private Double wspr; + + /** u-component of the model wind vector (m/s) */ + @Transient + @DynamicSerializeElement + private Double umwv; + + /** v-component of the model wind vector (m/s) */ + @Transient + @DynamicSerializeElement + private Double vwmv; + + /** Mean dynamic topography (m) */ + @Transient + @DynamicSerializeElement + private Double mdyt; + + /** Altitude of COG above reference ellipsoid (m) */ + @Transient + @DynamicSerializeElement + private Double alre; + + /** Instantaneous altitude rate (m/s) */ + @Transient + @DynamicSerializeElement + private Double ialr; + + /** Squared off nadir angle of the satellite from platform data (degree**2) */ + @Transient + @DynamicSerializeElement + private Double onap; + + /** Squared off nadir angle of the satellite from waveform data (degree**2) */ + @Transient + @DynamicSerializeElement + private Double sonaw; + + /** Ionospheric correction from model on Ku band (m) */ + @Transient + @DynamicSerializeElement + private Double icmk; + + /** Altimeter ionospheric correction on Ku band (m) */ + @Transient + @DynamicSerializeElement + private Double aick; + + /** Model dry tropospheric correction (m) */ + @Transient + @DynamicSerializeElement + private Double mdtc; + + /** Model wet tropospheric correction (m) */ + @Transient + @DynamicSerializeElement + private Double mwtc; + + /** Radiometer wet tropospheric correction (m) */ + @Transient + @DynamicSerializeElement + private Double rwtc; + + /** Mean sea-surface height (m) */ + @Transient + @DynamicSerializeElement + private Double mssh; + + /** Mean sea surface height from altimeter only (m) */ + @Transient + @DynamicSerializeElement + private Double msha; + + /** Geoid's height (m) */ + @Transient + @DynamicSerializeElement + private Double geodh; + + /** Ocean depth/land elevation (m) */ + @Transient + @DynamicSerializeElement + private Double odle; + + /** Solid earth tide height (m) */ + @Transient + @DynamicSerializeElement + private Double seth; + + /** Total geocentric ocean tide height solution 1 (m) */ + @Transient + @DynamicSerializeElement + private Double tgoth1; + + /** Total geocentric ocean tide height solution 2 (m) */ + @Transient + @DynamicSerializeElement + private Double tgoth2; + + /** Loading tide height geocentric ocean tide solution 1 (m) */ + @Transient + @DynamicSerializeElement + private Double lths1; + + /** Loading tide height geocentric ocean tide solution 2 (m) */ + @Transient + @DynamicSerializeElement + private Double lths2; + + /** Long period tide height (m) */ + @Transient + @DynamicSerializeElement + private Double lpth; + + /** Non-equilibrium long period tide height (m) */ + @Transient + @DynamicSerializeElement + private Double nlth; + + /** Geocentric pole tide height (m) */ + @Transient + @DynamicSerializeElement + private Double gpth; + + /* Inverted barometer correction (m) */ + @Transient + @DynamicSerializeElement + private Double ibco; + + /* High frequency fluctuations of the sea surface topography correction (m) */ + @Transient + @DynamicSerializeElement + private Double hfstc; + + /** Sea Surface Height Anomoly (m) */ + @Transient + @DynamicSerializeElement + private Double ssha; + + /** Report type */ + @Transient + @DynamicSerializeElement + @DataURI(position = 6) + private String reportType; + + @Embedded + @DynamicSerializeElement + private PointDataView pointDataView; + + /** + * Default constructor. + */ + public SshaRecord() { + Double doubleRmissd = Double.parseDouble(String.valueOf(RMISSD)); + Long longImissd = Long.parseLong(String.valueOf(IMISSD)); + this.reportType = "BUFRSSHA"; + this.said = longImissd; + this.siid = longImissd; + this.staq = " "; + this.softv = " "; + this.sacyln = longImissd; + this.orbn = longImissd; + this.numid = " "; + this.clath = doubleRmissd; + this.clonh = doubleRmissd; + this.rsst = longImissd; + this.aetp = longImissd; + this.dsst = longImissd; + this.intf = longImissd; + this.eeno = longImissd; + this.asfl = longImissd; + this.adqf = longImissd; + this.arqf = longImissd; + this.alrf = longImissd; + this.rsfl = longImissd; + this.rdqf = longImissd; + this.rbif = longImissd; + this.ipin = longImissd; + this.aasf = longImissd; + this.mmap = longImissd; + this.ifdt = longImissd; + this.kbor = doubleRmissd; + this.rkbor = doubleRmissd; + this.nvpk2 = longImissd; + this.kbic = doubleRmissd; + this.sbck = doubleRmissd; + this.kbsw = doubleRmissd; + this.rksw = doubleRmissd; + this.nvksw = longImissd; + this.kncs = doubleRmissd; + this.kobc = doubleRmissd; + this.skobc = doubleRmissd; + this.nvpkb = longImissd; + this.knic = doubleRmissd; + this.acrs1 = doubleRmissd; + this.acrs2 = doubleRmissd; + this.kagc = doubleRmissd; + this.rkagc = doubleRmissd; + this.nvkg = longImissd; + this.cbor = doubleRmissd; + this.rcbor = doubleRmissd; + this.nvpc = longImissd; + this.cbic = doubleRmissd; + this.sbcc = doubleRmissd; + this.cbsw = doubleRmissd; + this.rcsw = doubleRmissd; + this.nvcsw = longImissd; + this.cncs = doubleRmissd; + this.ccob = doubleRmissd; + this.rccob = doubleRmissd; + this.nvpcb = longImissd; + this.cnia = doubleRmissd; + this.cagc = doubleRmissd; + this.rcagc = doubleRmissd; + this.nvpca = longImissd; + this.sccf1 = doubleRmissd; + this.sccf2 = doubleRmissd; + this.sccf3 = doubleRmissd; + this.tmbrst1 = doubleRmissd; + this.tmbrst2 = doubleRmissd; + this.tmbrst3 = doubleRmissd; + this.rwvc = doubleRmissd; + this.rlqc = doubleRmissd; + this.hmsl1 = doubleRmissd; + this.hmsl2 = doubleRmissd; + this.wspa = doubleRmissd; + this.wspr = doubleRmissd; + this.umwv = doubleRmissd; + this.vwmv = doubleRmissd; + this.mdyt = doubleRmissd; + this.alre = doubleRmissd; + this.ialr = doubleRmissd; + this.onap = doubleRmissd; + this.sonaw = doubleRmissd; + this.icmk = doubleRmissd; + this.aick = doubleRmissd; + this.mdtc = doubleRmissd; + this.mwtc = doubleRmissd; + this.rwtc = doubleRmissd; + this.mssh = doubleRmissd; + this.msha = doubleRmissd; + this.geodh = doubleRmissd; + this.odle = doubleRmissd; + this.seth = doubleRmissd; + this.tgoth1 = doubleRmissd; + this.tgoth2 = doubleRmissd; + this.lths1 = doubleRmissd; + this.lths2 = doubleRmissd; + this.lpth = doubleRmissd; + this.nlth = doubleRmissd; + this.gpth = doubleRmissd; + this.ibco = doubleRmissd; + this.hfstc = doubleRmissd; + this.ssha = doubleRmissd; + } + + /** + * Constructor for DataURI construction through base class. This is used by + * the notification service. + * + * @param uri + * A data uri applicable to this class. + */ + public SshaRecord(String uri) { + super(uri); + } + + /** + * Get the observation report type. + * + * @return the reportType + */ + public String getReportType() { + return reportType; + } + + /** + * Set the observation report type. + * + * @param reportType + * the reportType to set + */ + public void setReportType(String reportType) { + this.reportType = reportType; + } + + /** + * Get the Satellite Identifier. + * + * @return the Satellite ID + */ + public Long getSaid() { + return said; + } + + /** + * @param said + * the Satellite Identifier to set + */ + public void setSaid(Long said) { + this.said = said; + } + + /** + * Get the Satellite Instruments. + * + * @return the Satellite Instruments + */ + public Long getSiid() { + return siid; + } + + /** + * @param siid + * the Satellite Instruments to set + */ + public void setSiid(Long siid) { + this.siid = siid; + } + + /** + * Get the Station Acquisition. + * + * @return the Station Acquisition + */ + public String getStaq() { + return staq; + } + + /** + * @param staq + * the Station Acquisition to set + */ + public void setStaq(String staq) { + this.staq = staq; + } + + /** + * Get the Software Identification and Version. + * + * @return the Software Id and Version + */ + public String getSoftv() { + return softv; + } + + /** + * @param softv + * the Software Id and Version to set + */ + public void setSoftv(String softv) { + this.softv = softv; + } + + /** + * Get the Satellite Cycle Number. + * + * @return the Satellite Cycle Number + */ + public Long getSacyln() { + return sacyln; + } + + /** + * @param sacyln + * the Satellite Cycle Number to set + */ + public void setSacyln(Long sacyln) { + this.sacyln = sacyln; + } + + /** + * Get the Orbit Number. + * + * @return the Orbit Number + */ + public Long getOrbn() { + return orbn; + } + + /** + * @param orbn + * the Orbit Number to set + */ + public void setOrbn(Long orbn) { + this.orbn = orbn; + } + + /** + * Get the Numerical Model Identifier. + * + * @return the Numerical Model Identifier + */ + public String getNumid() { + return numid; + } + + /** + * @param numid + * the Numerical Model Identifier to set + */ + public void setNumid(String numid) { + this.numid = numid; + } + + /** + * @return the clath + */ + public Double getClath() { + return clath; + } + + /** + * @param clath + * the latitude to set + */ + public void setClath(Double clath) { + this.clath = clath; + } + + /** + * @return the clonh + */ + public Double getClonh() { + return clonh; + } + + /** + * @param clonh + * the longitude to set + */ + public void setClonh(Double clonh) { + this.clonh = clonh; + } + + /** + * Get the Remote Sensed Surface Type. + * + * @return the Remote Sensed Surface Type + */ + public Long getRsst() { + return rsst; + } + + /** + * @param rsst + * the Remote Sensed Surface Type to set + */ + public void setRsst(Long rsst) { + this.rsst = rsst; + } + + /** + * Get the Altimeter Echo Type. + * + * @return the Altimeter Echo Type + */ + public Long getAetp() { + return aetp; + } + + /** + * @param aetp + * the Altimeter Echo Type to set + */ + public void setAetp(Long aetp) { + this.aetp = aetp; + } + + /** + * Get the Radiometer Sensed Surface Type. + * + * @return the Remote Sensed Surface Type + */ + public Long getDsst() { + return dsst; + } + + /** + * @param dsst + * the Radiometer Sensed Surface Type to set + */ + public void setDsst(Long dsst) { + this.dsst = dsst; + } + + /** + * Get the Interpolation Flag. + * + * @return the Interpolation Flag + */ + public Long getIntf() { + return intf; + } + + /** + * @param intf + * the Interpolation Flag to set + */ + public void setIntf(Long intf) { + this.intf = intf; + } + + /** + * Get the Three-dimensional Error Estimate of the Navigator Orbit. + * + * @return the Three-dimensional Error Estimate of the Navigator Orbit + */ + public Long getEeno() { + return eeno; + } + + /** + * @param eeno + * the Three-dimensional Error Estimate of the Navigator Orbit to + * set + */ + public void setEeno(Long eeno) { + this.eeno = eeno; + } + + /** + * Get the Altimeter State Flag. + * + * @return the Altimeter State Flag + */ + public Long getAsfl() { + return asfl; + } + + /** + * @param asfl + * the Altimeter State Flag to set + */ + public void setAsfl(Long asfl) { + this.asfl = asfl; + } + + /** + * Get the Altimeter Data Quality Flag. + * + * @return the Altimeter Data Quality Flag + */ + public Long getAdqf() { + return adqf; + } + + /** + * @param adqf + * the Altimeter Data Quality Flag to set + */ + public void setAdqf(Long adqf) { + this.adqf = adqf; + } + + /** + * Get the Altimeter Correction Quality Flag. + * + * @return the Altimeter Correction Quality Flag + */ + public Long getArqf() { + return arqf; + } + + /** + * @param arqf + * the Altimeter Correction Quality Flag to set + */ + public void setArqf(Long arqf) { + this.arqf = arqf; + } + + /** + * Get the Altimeter Rain Flag. + * + * @return the Altimeter Rain Flag + */ + public Long getAlrf() { + return alrf; + } + + /** + * @param alrf + * the Altimeter Rain Flag to set + */ + public void setAlrf(Long alrf) { + this.alrf = alrf; + } + + /** + * Get the Radiometer State Flag. + * + * @return the Radiometer State Flag + */ + public Long getRsfl() { + return rsfl; + } + + /** + * @param rsfl + * the Radiometer State Flag to set + */ + public void setRsfl(Long rsfl) { + this.rsfl = rsfl; + } + + /** + * Get the Radiometer Data Quality Flag. + * + * @return the Radiometer Data Quality Flag + */ + public Long getRdqf() { + return rdqf; + } + + /** + * @param rdqf + * the Radiometer Data Quality Flag to set + */ + public void setRdqf(Long rdqf) { + this.rdqf = rdqf; + } + + /** + * Get the Radiometer Brightness Temperature Interpretation. + * + * @return the Radiometer Brightness Temperature Interpretation + */ + public Long getRbif() { + return rbif; + } + + /** + * @param rbif + * the Radiometer Brightness Temperature Interpretation to set + */ + public void setRbif(Long rbif) { + this.rbif = rbif; + } + + /** + * Get the Ice Presence Indicator. + * + * @return the Ice Presence Indicator + */ + public Long getIpin() { + return ipin; + } + + /** + * @param ipin + * the Ice Presence Indicator to set + */ + public void setIpin(Long ipin) { + this.ipin = ipin; + } + + /** + * Get the Auxillliary Altimeter State Flags. + * + * @return the Auxillliary Altimeter State Flags + */ + public Long getAasf() { + return aasf; + } + + /** + * @param aasf + * the Auxillliary Altimeter State Flags to set + */ + public void setAasf(Long aasf) { + this.aasf = aasf; + } + + /** + * Get the Meteorological Map Availablity. + * + * @return the Meteorological Map Availablity + */ + public Long getMmap() { + return mmap; + } + + /** + * @param mmap + * the Meteorological Map Availablity to set + */ + public void setMmap(Long mmap) { + this.mmap = mmap; + } + + /** + * Get the Interpolation Flag For Mean Diurnal Tide. + * + * @return the Interpolation Flag For Mean Diurnal Tide + */ + public Long getIfdt() { + return ifdt; + } + + /** + * @param ifdt + * the Interpolation Flag For Mean Diurnal Tide to set + */ + public void setIfdt(Long ifdt) { + this.ifdt = ifdt; + } + + /** + * Get the Ku Band Ocean Range + * + * @param kbor + * Ku Band Ocean Range to return + */ + public Double getKbor() { + return kbor; + } + + /** + * @param kbor + * Ku Band Ocean Range to set + */ + public void setKbor(Double kbor) { + this.kbor = kbor; + } + + /** + * Get the RMS of 20 Hz Ku Band Ocean Range + * + * @param rkbor + * RMS of 20 Hz Ku Band Ocean Range to return + */ + public Double getRkbor() { + return rkbor; + } + + /** + * @param rkbor + * RMS of 20 Hz Ku Band Ocean Range to set + */ + public void setRkbor(Double rkbor) { + this.rkbor = rkbor; + } + + /** + * Get the Number of 20 Hz valid points for Ku Band. + * + * @return the Number of 20 Hz valid points for Ku Band + */ + public Long getNvpk2() { + return nvpk2; + } + + /** + * @param nvpk2 + * the Number of 20 Hz valid points for Ku Band to set + */ + public void setNvpk2(Long nvpk2) { + this.nvpk2 = nvpk2; + } + + /** + * Get the Ku Band Net Instrumental Correction + * + * @param kbic + * Ku Band Net Instrumental Correction to return + */ + public Double getKbic() { + return kbic; + } + + /** + * @param kbic + * Ku Band Net Instrumental Correction to set + */ + public void setKbic(Double kbic) { + this.kbic = kbic; + } + + /** + * Get the Sea State Bias Correction On Ku Band + * + * @param sbck + * Sea State Bias Correction On Ku Band to return + */ + public Double getSbck() { + return sbck; + } + + /** + * @param sbck + * Sea State Bias Correction On Ku Band to set + */ + public void setSbck(Double sbck) { + this.sbck = sbck; + } + + /** + * Get Ku Band Significant Wave Height + * + * @param kbsw + * Ku Band Significant Wave Height to return + */ + public Double getKbsw() { + return kbsw; + } + + /** + * @param kbsw + * Ku Band Significant Wave Height to set + */ + public void setKbsw(Double kbsw) { + this.kbsw = kbsw; + } + + /** + * RMS 20 Hz Ku Band Significant Wave Height + * + * @param rksw + * RMS 20 Hz Ku Band Significant Wave Height + */ + public Double getRksw() { + return rksw; + } + + /** + * @param rksw + * 20 Hz RMS Ku Band Significant Wave Height to set + */ + public void setRksw(Double rksw) { + this.rksw = rksw; + } + + /** + * Get the Number of 20 Hz valid points for Ku Band Significant Wave Height. + * + * @return the Number of 20 Hz valid points for Ku Band Significant Wave + * Height + */ + public Long getNvksw() { + return nvksw; + } + + /** + * @param nvksw + * the Number of 20 Hz valid points for Ku Band Significant Wave + * Height to set + */ + public void setNvksw(Long nvksw) { + this.nvksw = nvksw; + } + + /** + * RMS 20 Hz Ku Band Net Instrumental Correction For Significant Wave Height + * + * @param kncs + * RMS 20 Hz Ku Band Net Instrumental Correction For Significant + * Wave Height + */ + public Double getKncs() { + return kncs; + } + + /** + * @param kncs + * 20 Hz RMS Ku Band Net Instrumental Correction For Significant + * Wave Height to set + */ + public void setKncs(Double kncs) { + this.kncs = kncs; + } + + /** + * Ku Band Corrected Ocean Backscatter coefficient + * + * @param kobc + * Ku Band Corrected Ocean Backscatter coefficient + */ + public Double getKobc() { + return kobc; + } + + /** + * @param kobc + * Ku Band Corrected Ocean Backscatter coefficient to set + */ + public void setKobc(Double kobc) { + this.kobc = kobc; + } + + /** + * STD Ku Band Corrected Ocean Backscatter coefficient + * + * @param kobc + * STD Ku Band Corrected Ocean Backscatter coefficient + */ + public Double getSkobc() { + return skobc; + } + + /** + * @param skobc + * STD Ku Band Corrected Ocean Backscatter coefficient to set + */ + public void setSkobc(Double skobc) { + this.skobc = skobc; + } + + /** + * Get the Number of valid points for Ku Band Backscatter. + * + * @return the Number of valid points for Ku Band Backscatter + */ + public Long getNvpkb() { + return nvpkb; + } + + /** + * @param nvpkb + * the Number of valid points for Ku Band Backscatter to set + */ + public void setNvpkb(Long nvpkb) { + this.nvpkb = nvpkb; + } + + /** + * Ku band net instrumental correction for AGC + * + * @param knic + * Ku band net instrumental correction for AGC + */ + public Double getKnic() { + return knic; + } + + /** + * @param knic + * Ku band net instrumental correction for AGC to set + */ + public void setKnic(Double knic) { + this.knic = knic; + } + + /** + * Attenuation Correction 1 On Sigma-0 + * + * @param acrs1 + * Attenuation 1 Correction On Sigma-0 + */ + public Double getAcrs1() { + return acrs1; + } + + /** + * @param acrs1 + * Attenuation Correction 1 On Sigma-0 + */ + public void setAcrs1(Double acrs1) { + this.acrs1 = acrs1; + } + + /** + * Attenuation Correction 2 On Sigma-0 + * + * @param acrs2 + * Attenuation Correction 2 On Sigma-0 + */ + public Double getAcrs2() { + return acrs2; + } + + /** + * @param acrs2 + * Attenuation Correction 2 On Sigma-0 + */ + public void setAcrs2(Double acrs2) { + this.acrs2 = acrs2; + } + + /** + * Ku Band Automatic Gain Control + * + * @param kagc + * Ku Band Automatic Gain Control + */ + public Double getKagc() { + return kagc; + } + + /** + * @param kagc + * Ku Band Automatic Gain Control + */ + public void setKagc(Double kagc) { + this.kagc = kagc; + } + + /** + * RMS Ku Band Automatic Gain Control + * + * @param rkagc + * RMS Ku Band Automatic Gain Control + */ + public Double getRkagc() { + return rkagc; + } + + /** + * @param rkagc + * RMS Ku Band Automatic Gain Control + */ + public void setRkagc(Double rkagc) { + this.rkagc = rkagc; + } + + /** + * Get the Number of valid points for Ku Band Automatic Gain Control. + * + * @return nvkg the Number of valid points for Ku Band Automatic Gain + * Control + */ + public Long getNvkg() { + return nvkg; + } + + /** + * @param nvkg + * the Number of valid points for Ku Band Automatic Gain Control + * to set + */ + public void setNvkg(Long nvkg) { + this.nvkg = nvkg; + } + + /** + * C Band Ocean Range + * + * @param cbor + * C Band Ocean Range to return + */ + public Double getCbor() { + return cbor; + } + + /** + * @param cbor + * C Band Ocean Range to set + */ + public void setCbor(Double cbor) { + this.cbor = cbor; + } + + /** + * RMS of C Band Ocean Range + * + * @param rcbor + * RMS of C Band Ocean Range to return + */ + public Double getRcbor() { + return rcbor; + } + + /** + * @param rcbor + * RMS of C Band Ocean Range to set + */ + public void setRcbor(Double rcbor) { + this.rcbor = rcbor; + } + + /** + * Get the Number of Number of 20 Hz valid points for C band + * + * @return nvpc the Number of 20 Hz valid points for C band + */ + public Long getNvpc() { + return nvpc; + } + + /** + * @param nvpc + * the Number of 20 Hz valid points for C band to set + */ + public void setNvpc(Long nvpc) { + this.nvpc = nvpc; + } + + /** + * C Band net instrumental correction + * + * @param cbic + * C band net instrumental correction to return + */ + public Double getCbic() { + return cbic; + } + + /** + * @param cbic + * C band net instrumental correction to set + */ + public void setCbic(Double cbic) { + this.cbic = cbic; + } + + /** + * Sea state bias correction on C band + * + * @param sbcc + * Sea state bias correction on C band to return + */ + public Double getSbcc() { + return sbcc; + } + + /** + * @param sbcc + * Sea state bias correction on C band to set + */ + public void setSbcc(Double sbcc) { + this.sbcc = sbcc; + } + + /** + * C band significant wave height + * + * @param cbsw + * C band significant wave height to return + */ + public Double getCbsw() { + return cbsw; + } + + /** + * @param cbsw + * C band significant wave height to set + */ + public void setCbsw(Double cbsw) { + this.cbsw = cbsw; + } + + /** + * RMS 20 Hz C band significant wave height + * + * @param rcsw + * RMS 20 Hz C band significant wave height to return + */ + public Double getRcsw() { + return rcsw; + } + + /** + * @param rcsw + * RMS 20 Hz C band significant wave height to set + */ + public void setRcsw(Double rcsw) { + this.rcsw = rcsw; + } + + /** + * Get the Number of 20 Hz valid points for C band significance + * + * @return nvcsw the Number of 20 Hz valid points for C band significance + */ + public Long getNvcsw() { + return nvcsw; + } + + /** + * @param nvcsw + * the Number of 20 Hz valid points for C band significance to + * set + */ + public void setNvcsw(Long nvcsw) { + this.nvcsw = nvcsw; + } + + /** + * C band net instrumental correction for significance + * + * @param cncs + * C band net instrumental correction for significance to return + */ + public Double getCncs() { + return cncs; + } + + /** + * @param cncs + * C band net instrumental correction for significance to set + */ + public void setCncs(Double cncs) { + this.cncs = cncs; + } + + /** + * C band corrected ocean backscatter coefficient + * + * @param ccob + * C band corrected ocean backscatter coefficient to return + */ + public Double getCcob() { + return ccob; + } + + /** + * @param ccob + * C band corrected ocean backscatter coefficient to set + */ + public void setCcob(Double ccob) { + this.ccob = ccob; + } + + /** + * RMS C band corrected ocean backscatter coefficient + * + * @param rccob + * RMS C band corrected ocean backscatter coefficient to return + */ + public Double getRccob() { + return rccob; + } + + /** + * @param rccob + * RMS C band corrected ocean backscatter coefficient to set + */ + public void setRccob(Double rccob) { + this.rccob = rccob; + } + + /** + * Get the Number of valid points for C band backscatter + * + * @return nvpcb the Number of valid points for C band backscatter + */ + public Long getNvpcb() { + return nvpcb; + } + + /** + * @param nvpcb + * the Number of valid points for C band backscatter to set + */ + public void setNvpcb(Long nvpcb) { + this.nvpcb = nvpcb; + } + + /** + * RMS C band net instrumental correction for AGC + * + * @param cnia + * C band net instrumental correction for AGC to return + */ + public Double getCnia() { + return cnia; + } + + /** + * @param cnia + * C band net instrumental correction for AGC to set + */ + public void setCnia(Double cnia) { + this.cnia = cnia; + } + + /** + * C band automatic gain control + * + * @param cagc + * C band automatic gain control to return + */ + public Double getCagc() { + return cagc; + } + + /** + * @param cagc + * C band automatic gain control to set + */ + public void setCagc(Double cagc) { + this.cagc = cagc; + } + + /** + * RMS C band automatic gain control + * + * @param rcagc + * RMS C band automatic gain control to return + */ + public Double getRcagc() { + return rcagc; + } + + /** + * @param rcagc + * RMS C band automatic gain control to set + */ + public void setRcagc(Double rcagc) { + this.rcagc = rcagc; + } + + /** + * Get the Number of valid points for C band automatic gain + * + * @return nvpca the Number of valid points for C band automatic gain + */ + public Long getNvpca() { + return nvpca; + } + + /** + * @param nvpca + * the Number of valid points for C band automatic gain to set + */ + public void setNvpca(Long nvpca) { + this.nvpca = nvpca; + } + + /** + * Satellite channel center frequency 1 + * + * @param sccf1 + * Satellite channel center frequency 1 + */ + public Double getSccf1() { + return sccf1; + } + + /** + * @param sccf1 + * Satellite channel center frequency 1 + */ + public void setSccf1(Double sccf1) { + this.sccf1 = sccf1; + } + + /** + * Satellite channel center frequency 1 + * + * @param sccf2 + * Satellite channel center frequency 2 + */ + public Double getSccf2() { + return sccf2; + } + + /** + * @param sccf2 + * Satellite channel center frequency 2 + */ + public void setSccf2(Double sccf2) { + this.sccf2 = sccf2; + } + + /** + * Satellite channel center frequency 3 + * + * @param sccf1 + * Satellite channel center frequency 3 + */ + public Double getSccf3() { + return sccf3; + } + + /** + * @param sccf3 + * Satellite channel center frequency 3 + */ + public void setSccf3(Double sccf3) { + this.sccf3 = sccf3; + } + + /** + * Brightness temperature 1 + * + * @param tmbrst1 + * Brightness temperature 1 + */ + public Double getTmbrst1() { + return tmbrst1; + } + + /** + * @param tmbrst1 + * Brightness temperature 1 + */ + public void setTmbrst1(Double tmbrst1) { + this.tmbrst1 = tmbrst1; + } + + /** + * Brightness temperature 2 + * + * @param tmbrst2 + * Brightness temperature 2 + */ + public Double getTmbrst2() { + return tmbrst2; + } + + /** + * @param tmbrst2 + * Brightness temperature 2 + */ + public void setTmbrst2(Double tmbrst2) { + this.tmbrst2 = tmbrst2; + } + + /** + * Brightness temperature 3 + * + * @param tmbrst3 + * Brightness temperature 3 + */ + public Double getTmbrst3() { + return tmbrst3; + } + + /** + * @param tmbrst3 + * Brightness temperature 3 + */ + public void setTmbrst3(Double tmbrst3) { + this.tmbrst3 = tmbrst3; + } + + /** + * Radiometer water vapor content + * + * @param rwvc + * Radiometer water vapor content to return + */ + public Double getRwvc() { + return rwvc; + } + + /** + * @param rwvc + * Radiometer water vapor content to set + */ + public void setRwvc(Double rwvc) { + this.rwvc = rwvc; + } + + /** + * Radiometer liquid content + * + * @param rlqc + * Radiometer liquid content to return + */ + public Double getRlqc() { + return rlqc; + } + + /** + * @param rlqc + * Radiometer liquid content to set + */ + public void setRlqc(Double rlqc) { + this.rlqc = rlqc; + } + + /** + * Height or altitude 1 + * + * @param hmsl + * Height or altitude 1 to return + */ + public Double getHmsl1() { + return hmsl1; + } + + /** + * @param hmsl + * Height or altitude 1 to set + */ + public void setHmsl1(Double hmsl1) { + this.hmsl1 = hmsl1; + } + + /** + * Height or altitude 2 + * + * @param hmsl + * Height or altitude 2 to return + */ + public Double getHmsl2() { + return hmsl2; + } + + /** + * @param hmsl + * Height or altitude 2 to set + */ + public void setHmsl2(Double hmsl2) { + this.hmsl2 = hmsl2; + } + + /** + * Wind speed from altimeter (m/s) + * + * @param wspa + * Wind speed from altimeter to return + */ + public Double getWspa() { + return wspa; + } + + /** + * @param wspa + * Wind speed from altimeter to set + */ + public void setWspa(Double wspa) { + this.wspa = wspa; + } + + /** + * Wind speed from radiometer (m/s) + * + * @param wspr + * Wind speed from radiometer to return + */ + public Double getWspr() { + return wspr; + } + + /** + * @param wspr + * Wind speed from radiometer to set + */ + public void setWspr(Double wspr) { + this.wspr = wspr; + } + + /** + * u-component of the model wind vector (m/s) + * + * @param umwv + * u-component of the model wind vector to return + */ + public Double getUmwv() { + return umwv; + } + + /** + * @param umwv + * u-component of the model wind vector to set + */ + public void setUmwv(Double umwv) { + this.umwv = umwv; + } + + /** + * u-component of the model wind vector (m/s) + * + * @param vwmv + * u-component of the model wind vector to return + */ + public Double getVwmv() { + return vwmv; + } + + /** + * @param vwmv + * u-component of the model wind vector to set + */ + public void setVwmv(Double vwmv) { + this.vwmv = vwmv; + } + + /** + * Mean dynamic topography (m) + * + * @param 1G Mean dynamic topography to return + */ + public Double getMdyt() { + return mdyt; + } + + /** + * @param mdyt + * Mean dynamic topography to set + */ + public void setMdyt(Double mdyt) { + this.mdyt = mdyt; + } + + /** + * Altitude of COG above reference ellipsoid (m) + * + * @param alre + * Altitude of COG above reference ellipsoid + */ + public Double getAlre() { + return alre; + } + + /** + * @param alre + * Altitude of COG above reference ellipsoid to set + */ + public void setAlre(Double alre) { + this.alre = alre; + } + + /** + * Instantaneous altitude rate (m/s) + * + * @param ialr + * Instantaneous altitude rate to return + */ + public Double getIalr() { + return ialr; + } + + /** + * @param ialr + * Instantaneous altitude rate to set + */ + public void setIalr(Double ialr) { + this.ialr = ialr; + } + + /** + * Squared off nadir angle of the satellite from platform data (degree**2) + * + * @param onap + * Squared off nadir angle of the satellite from platform data to + * set + */ + public Double getOnap() { + return onap; + } + + /** + * @param onap + * Squared off nadir angle of the satellite from platform data to + * set + */ + public void setOnap(Double onap) { + this.onap = onap; + } + + /** + * Squared off nadir angle of the satellite from waveform data (degree**2) + * + * @param sonaw + * Squared off nadir angle of the satellite from waveform data to + * return + */ + public Double getSonaw() { + return sonaw; + } + + /** + * @param sonaw + * Squared off nadir angle of the satellite from waveform data to + * set + */ + public void setSonaw(Double sonaw) { + this.sonaw = sonaw; + } + + /** + * Ionospheric correction from model on Ku band (m) + * + * @param icmk + * Ionospheric correction from model on Ku band to return + */ + public Double getIcmk() { + return icmk; + } + + /** + * @param icmk + * Ionospheric correction from model on Ku band to set + */ + public void setIcmk(Double icmk) { + this.icmk = icmk; + } + + /** + * Ionospheric correction from model on Ku band (m) + * + * @param aick + * Ionospheric correction from model on Ku band to return + */ + public Double getAick() { + return aick; + } + + /** + * @param aick + * Ionospheric correction from model on Ku band to set + */ + public void setAick(Double aick) { + this.aick = aick; + } + + /** + * Model dry tropospheric correction (m) + * + * @param mdtc + * Model dry tropospheric correction to return + */ + public Double getMdtc() { + return mdtc; + } + + /** + * @param mdtc + * Model dry tropospheric correction to set + */ + public void setMdtc(Double mdtc) { + this.mdtc = mdtc; + } + + /** + * Model wet tropospheric correction (m) + * + * @param mwtc + * Model wet tropospheric correction to return + */ + public Double getMwtc() { + return mwtc; + } + + /** + * @param mwtc + * Model wet tropospheric correction to set + */ + public void setMwtc(Double mwtc) { + this.mwtc = mwtc; + } + + /** + * Radiometer wet tropospheric correction (m) + * + * @param rwtc + * Radiometer wet tropospheric correction to return + */ + public Double getRwtc() { + return rwtc; + } + + /** + * @param rwtc + * Radiometer wet tropospheric correction to set + */ + public void setRwtc(Double rwtc) { + this.rwtc = rwtc; + } + + /** + * Mean sea-surface height (m) + * + * @param mssh + * Mean sea-surface height to return + */ + public Double getMssh() { + return mssh; + } + + /** + * @param mssh + * Mean sea-surface height to set + */ + public void setMssh(Double mssh) { + this.mssh = mssh; + } + + /** + * Mean sea-surface height from altimeter only (m) + * + * @param msha + * Mean sea-surface height from altimeter only to return + */ + public Double getMsha() { + return msha; + } + + /** + * @param msha + * Mean sea-surface height from altimeter only to set + */ + public void setMsha(Double msha) { + this.msha = msha; + } + + /** + * Geoid's height (m) + * + * @param geodh + * Geoid's height to return + */ + public Double getGeodh() { + return geodh; + } + + /** + * @param odle + * Ocean depth/land elevation (m) + */ + public void setGeodh(Double geodh) { + this.geodh = geodh; + } + + /** + * Ocean depth/land elevation (m) + * + * @param odle + * Ocean depth/land elevation to return + */ + public Double getOdle() { + return odle; + } + + /** + * @param odle + * Ocean depth/land elevation to set + */ + public void setOdle(Double odle) { + this.odle = odle; + } + + /** + * Solid earth tide height (m) + * + * @param seth + * Solid earth tide height to return + */ + public Double getSeth() { + return seth; + } + + /** + * @param seth + * Solid earth tide height to set + */ + public void setSeth(Double seth) { + this.seth = seth; + } + + /** + * Total geocentric ocean tide height solution 1 (m) + * + * @param tgoth1 + * Total geocentric ocean tide height solution 1 to return + */ + public Double getTgoth1() { + return tgoth1; + } + + /** + * @param tgoth1 + * Total geocentric ocean tide height solution 1 to set + */ + public void setTgoth1(Double tgoth1) { + this.tgoth1 = tgoth1; + } + + /** + * Total geocentric ocean tide height solution 2 (m) + * + * @param tgoth2 + * Total geocentric ocean tide height solution 2 to return + */ + public Double getTgoth2() { + return tgoth2; + } + + /** + * @param tgoth2 + * Total geocentric ocean tide height solution 2 to set + */ + public void setTgoth2(Double tgoth2) { + this.tgoth2 = tgoth2; + } + + /** + * Loading tide height geocentric ocean tide solution 1 (m) + * + * @param lths1 + * Loading tide height geocentric ocean tide solution 1 to return + */ + public Double getLths1() { + return lths1; + } + + /** + * @param lths1 + * Loading tide height geocentric ocean tide solution 1 to set + */ + public void setLths1(Double lths1) { + this.lths1 = lths1; + } + + /** + * Loading tide height geocentric ocean tide solution 2 (m) + * + * @param lths2 + * Loading tide height geocentric ocean tide solution 2 to return + */ + public Double getLths2() { + return lths2; + } + + /** + * @param lths2 + * Loading tide height geocentric ocean tide solution 2 to set + */ + public void setLths2(Double lths2) { + this.lths2 = lths2; + } + + /** + * Long period tide height (m) + * + * @param lpth + * Long period tide height to return + */ + public Double getLpth() { + return lpth; + } + + /** + * @param lpth + * Long period tide height to set + */ + public void setLpth(Double lpth) { + this.lpth = lpth; + } + + /** + * Non-equilibrium long period tide height (m) + * + * @param nlth + * Non-equilibrium long period tide height to return + */ + public Double getNlth() { + return nlth; + } + + /** + * @param nlth + * Non-equilibrium long period tide height to set + */ + public void setNlth(Double nlth) { + this.nlth = nlth; + } + + /** + * Geocentric pole tide height (m) + * + * @param gpth + * Geocentric pole tide height to return + */ + public Double getGpth() { + return gpth; + } + + /** + * @param gpth + * Geocentric pole tide height to set + */ + public void setGpth(Double gpth) { + this.gpth = gpth; + } + + /** + * Inverted barometer correction (m) + * + * @param ibco + * Inverted barometer correction to return + */ + public Double getIbco() { + return ibco; + } + + /** + * @param ibco + * Inverted barometer correction to set + */ + public void setIbco(Double ibco) { + this.ibco = ibco; + } + + /** + * High frequency fluctuations of the sea surface topography correction (m) + * + * @param hfstc + * High frequency fluctuations of the sea surface topography + * correction + * + */ + public Double getHfstc() { + return hfstc; + } + + /** + * @param hfstc + * High frequency fluctuations of the sea surface topography + * correction to set + */ + public void setHfstc(Double hfstc) { + this.hfstc = hfstc; + } + + /** + * Sea Surface Height Anomoly + * + * @param ssha + * Sea Surface Height Anomoly to return + */ + public Double getSsha() { + return ssha; + } + + /** + * @param ssha + * Sea Surface Height Anomoly to set + */ + public void setSsha(Double ssha) { + this.ssha = ssha; + } + + /** + * @return the obsTime + */ + public Calendar getObsTime() { + return obsTime; + } + + /** + * @param obsTime + * the obsTime to set + */ + public void setObsTime(Calendar obsTime) { + this.obsTime = obsTime; + } + + /** + * Get the value and units of a named parameter within this observation. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return An Amount with value and units. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Amount getValue(String paramName) { + return null; + } + + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public String getString(String paramName) { + return null; + } + + /** + * Get the value of a parameter that is represented as a String. + * + * @param paramName + * The name of the parameter value to retrieve. + * @return The String value of the parameter. If the parameter is unknown, a + * null reference is returned. + */ + @Override + public Collection getValues(String paramName) { + return null; + } + + /** + * Get the IDecoderGettable reference for this record. + * + * @return The IDecoderGettable reference for this record. + */ + @Override + public IDecoderGettable getDecoderGettable() { + return this; + } + + @Override + public void setDataURI(String dataURI) { + identifier = dataURI; + } + + @Override + public String[] getStrings(String paramName) { + return null; + } + + @Override + public Date getPersistenceTime() { + return this.dataTime.getRefTime(); + + } + + @Override + public void setPersistenceTime(Date persistTime) { + // TODO Auto-generated method stub + + } + + @Override + public PointDataView getPointDataView() { + return this.pointDataView; + } + + @Override + public void setPointDataView(PointDataView pointDataView) { + this.pointDataView = pointDataView; + + } @Override @Column @@ -2570,4 +2569,9 @@ public class SshaRecord extends PersistablePluginDataObject implements public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "ssha"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.stormtrack/src/gov/noaa/nws/ncep/common/dataplugin/stormtrack/StormTrackRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.stormtrack/src/gov/noaa/nws/ncep/common/dataplugin/stormtrack/StormTrackRecord.java index bfad2c3fe9..4c29426f79 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.stormtrack/src/gov/noaa/nws/ncep/common/dataplugin/stormtrack/StormTrackRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.stormtrack/src/gov/noaa/nws/ncep/common/dataplugin/stormtrack/StormTrackRecord.java @@ -1,23 +1,3 @@ -/* - * - * StormTrackRecord - * - * This class performs the mapping to the database tables for the Automated - * Tropical Cyclone Forecast (ATCF) and ensemble storm tracks Decoder plug-in. - * - * SOFTWARE HISTORY - * Date Ticket# Engineer Description - * ------------ ----------- -------------- ----------------------------------- - * 06/23/10 283 F. J. Yen Initial creation - * * - * This code has been developed by the SIB for use in the AWIPS2 system. - * - * - * @author F. J. Yen, SIB - * @version 1 - - */ - package gov.noaa.nws.ncep.common.dataplugin.stormtrack; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; @@ -55,18 +35,20 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * * SOFTWARE HISTORY * - * Date Ticket# Engineer Description - * ------------ ---------- ----------- -------------------------- - * 07/2011 T. Lee ATCF and Ensemble storm tracks - * 10/19/2011 858 Greg Hull remove forecastHr - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. - * May 07, 2013 1869 bsteffen Remove dataURI column from - * PluginDataObject. - * + * Date Ticket# Engineer Description + * ------------ --------- ----------- -------------------------- + * Jun 23, 2010 283 F. J. Yen Initial creation + * 07/2011 T. Lee ATCF and Ensemble storm tracks + * Oct 19, 2011 858 Greg Hull remove forecastHr + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * May 07, 2013 1869 bsteffen Remove dataURI column from + * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * - * @author tlee + * @author F. J. Yen, SIB * @version 1.0 */ @Entity @@ -76,674 +58,672 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "stormtrack", - indexes = { - @Index(name = "stormtrack_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "stormtrack", indexes = { @Index(name = "stormtrack_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @XmlRootElement @XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class StormTrackRecord extends PluginDataObject { - private static final long serialVersionUID = 1L; - private static final float RMISSD = IDecoderConstantsN.FLOAT_MISSING; - private static final Integer IMISSD = IDecoderConstantsN.INTEGER_MISSING; - - /** Report type */ - @Column(length = 32) - @XmlElement - @DynamicSerializeElement - @DataURI(position = 6) - private String reportType; - - /** - * Basin, e.g. WP, IO, SH, CP, EP, AL, SL, ML - */ - @DataURI(position = 1) - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String basin; - - /** - * Annual cyclone number; 1 through 99 - */ - @DataURI(position = 2) - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String cycloneNum; - - /** - * Warning Date-Time - */ - @Column - @DynamicSerializeElement - @XmlElement - private Calendar warnTime; - - /** - * Objective technique sorting number/Minutes for best track: 00-99 - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private int techniqueNum; - - /** - * Objective Technique or CARQ or WRNG, BEST for best Track - */ - @DataURI(position = 3) - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String model; - -// @DataURI(position = 4) -// @Column -// @DynamicSerializeElement -// @XmlElement -// private int fcstHour; - - /** - * Latitude (degrees) for the DTG: -900 through 900 - */ - @DynamicSerializeElement - @XmlElement - private float clat; - - /** - * Longitude (degrees) for the DTG: -1800 through 1800 - */ - @DynamicSerializeElement - @XmlElement - private float clon; - - /** - * Maximum sustained wind speed in knots: 0 through 300 - */ - @DynamicSerializeElement - @XmlElement - private float windMax; - - /** - * Minimum sea level pressure, 1 through 1100MB - */ - @DynamicSerializeElement - @XmlElement - private float mslp; - - /** - * Level of tropical cyclone development; such as DB, TD, TS, TY, ... - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String stormType; - - /** - * Wind intensity (kts) for the radii defined i this record: 34, 50, 64 - */ - @DataURI(position = 4) - @DynamicSerializeElement - @XmlElement - private float windCategory; - - /** - * Radius Code for wind intensity: AAA = full circle; QQQ = quadrant (NNQ, - * NEQ, EEQ, SEQ, SSQ, SWQ, WWQ, NWQ) - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String windCode; - - /** - * If full circle, radius of specified wind intensity. If semicircle or - * quadrant, radius of specified wind intensity of circle portion specified - * in radius code. 0 - 1200 nm. - */ - @DynamicSerializeElement - @XmlElement - private float quad1WindRad; - - /** - * If full circle, this field not used. If semicircle, radius (nm) of - * specified wind intensity for semicircle not specified in radius code. If - * quadrant, radius (nm) of specified wind intensity for 2nd quadrant - * (counting clockwise from quadrant specified in radius code). 0 - 1200 nm. - */ - @DynamicSerializeElement - @XmlElement - private float quad2WindRad; - - /** - * If full circle or semicircle this field not used. If quadrant, radius - * (nm) of specified wind intensity for 3rd quadrant (counting clockwise - * from quadrant specified in radius code). 0 - 1200 nm. - */ - @DynamicSerializeElement - @XmlElement - private float quad3WindRad; - - /** - * If full circle or semicircle this field not used. If quadrant, radius - * (nm) of specified wind intensity for 4th quadrant (counting clockwise - * from quadrant specified in radius code). 0 - 1200 nm. - */ - @DynamicSerializeElement - @XmlElement - private float quad4WindRad; - - /** - * Pressure in millibars of the last closed isobar. 900 - 1050 mb - */ - @DynamicSerializeElement - @XmlElement - private float closedP; - - /** - * Radius of the last closed isobar in nm. 0 - 9999 nm - */ - @DynamicSerializeElement - @XmlElement - private float radClosedP; - - /** - * Radius of max winds. 0 - 999 nm - */ - @DynamicSerializeElement - @XmlElement - private float maxWindRad; - - /** - * Gusts. 0 - 995 kts. - */ - @DynamicSerializeElement - @XmlElement - private float gust; - - /** - * Eye diameter. 0 - 999nm - */ - @DynamicSerializeElement - @XmlElement - private float eyeSize; - - /** - * Subregion code: A, B, C, E, L, P, Q, S, W - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String subRegion; - - /** - * Max seas: 0 through 999 ft. - */ - @DynamicSerializeElement - @XmlElement - private float maxSeas; - - /** - * Forecaster's initials, used for forecastHour 0 WRNG, up to 3 chars - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String forecaster; - - /** - * Storm direction in compass coordinates, 0 - 359 degrees - */ - @DynamicSerializeElement - @XmlElement - private float stormDrct; - - /** - * Storm speed. 0 - 999 kts - */ - @DynamicSerializeElement - @XmlElement - private float stormSped; - - /** - * Literal storm name, NONAME, or INVEST - */ - @DataURI(position = 5) - @Column(length = 32) - @DynamicSerializeElement - @XmlElement - private String stormName; - - /** - * System depth, D=deep, M=medium, S=shallow, X=unknown - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String stormDepth; - - /** - * Wave height for radii defined in seas1 - seas4. 0 - 99 ft. - */ - @DynamicSerializeElement - @XmlElement - private float waveHght; - - /** - * Radius code for seas wave height - */ - @Column(length = 8) - @DynamicSerializeElement - @XmlElement - private String waveCode; - - /** - * First quadrant seas radius as defined by waveCode, 0 - 999 nm - */ - @DynamicSerializeElement - @XmlElement - private float quad1WaveRad; - - /** - * Second quadrant seas radius as defined by waveCode, 0 - 999 nm - */ - @DynamicSerializeElement - @XmlElement - private float quad2WaveRad; - - /** - * Third quadrant seas radius as defined by waveCode, 0 - 999 nm - */ - @DynamicSerializeElement - @XmlElement - private float quad3WaveRad; - - /** - * Fourth quadrant seas radius as defined by waveCode, 0 - 999 nm - */ - @DynamicSerializeElement - @XmlElement - private float quad4WaveRad; - - /* - * 20 character description of format to follow in userData - */ - @Column(length = 20) - @DynamicSerializeElement - @XmlElement - private String userDefined; - - /* - * User data section as indicated by userDefined parameter - */ - @Column(length = 30) - @DynamicSerializeElement - @XmlElement - private String userData; - - /** - * Default Constructor - */ - public StormTrackRecord() { - this.reportType= " "; - this.basin = "XX"; - this.cycloneNum = "M"; - this.warnTime = null; - this.techniqueNum = IDecoderConstantsN.INTEGER_MISSING; - this.model = " "; -// this.fcstHour = IMISSD; - this.clat = RMISSD; - this.clon = RMISSD; - this.windMax = RMISSD; - this.mslp = RMISSD; - this.stormType = "XX"; - this.windCategory = RMISSD; - this.windCode = "M"; - this.quad1WindRad = RMISSD; - this.quad2WindRad = RMISSD; - this.quad3WindRad = RMISSD; - this.quad4WindRad = RMISSD; - this.closedP = RMISSD; - this.radClosedP = RMISSD; - this.maxWindRad = RMISSD; - this.gust = RMISSD; - this.eyeSize = RMISSD; - this.subRegion = " "; - this.maxSeas = RMISSD; - this.forecaster = ""; - this.stormDrct = RMISSD; - this.stormSped = RMISSD; - this.stormName = " "; - this.stormDepth = " "; - this.waveHght = RMISSD; - this.waveCode = " "; - this.quad1WaveRad = RMISSD; - this.quad2WaveRad = RMISSD; - this.quad3WaveRad = RMISSD; - this.quad4WaveRad = RMISSD; - this.userDefined = " "; - this.userData = " "; - } - - /** - * Constructs a StormTrack record from a dataURI - * - * @param uri - * The dataURI - */ - public StormTrackRecord(String uri) { - super(uri); - } - - @Override - public IDecoderGettable getDecoderGettable() { - // TODO Auto-generated method stub - return null; - } - - public String getReportType() { - return reportType; - } - - public void setReportType(String reportType) { - this.reportType = reportType; - } - - public String getBasin() { - return basin; - } - - public void setBasin(String basin) { - this.basin = basin; - } - - public String getCycloneNum() { - return cycloneNum; - } - - public void setCycloneNum(String cycloneNum) { - this.cycloneNum = cycloneNum; - } - - public Calendar getWarnTime() { - return warnTime; - } - - public void setWarnTime(Calendar warnTime) { - this.warnTime = warnTime; - } - - public int getTechniqueNum() { - return techniqueNum; - } - - public void setTechniqueNum(int techniqueNum) { - this.techniqueNum = techniqueNum; - } - - public String getModel() { - return model; - } - - public void setModel(String model) { - this.model = model; - } - - public int getFcstHour() { - return dataTime.getFcstTime()/3600; //fcstHour; - } - - public float getClat() { - return clat; - } - - public void setClat(float clat) { - this.clat = clat; - } - - public float getClon() { - return clon; - } - - public void setClon(float clon) { - this.clon = clon; - } - - public float getWindMax() { - return windMax; - } - - public void setWindMax(float windMax) { - this.windMax = windMax; - } - - public float getMslp() { - return mslp; - } - - public void setMslp(float mslp) { - this.mslp = mslp; - } - - public String getStormType() { - return stormType; - } - - public void setStormType(String stormType) { - this.stormType = stormType; - } + private static final long serialVersionUID = 1L; + + private static final float RMISSD = IDecoderConstantsN.FLOAT_MISSING; + + private static final Integer IMISSD = IDecoderConstantsN.INTEGER_MISSING; + + /** Report type */ + @Column(length = 32) + @XmlElement + @DynamicSerializeElement + @DataURI(position = 6) + private String reportType; + + /** + * Basin, e.g. WP, IO, SH, CP, EP, AL, SL, ML + */ + @DataURI(position = 1) + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String basin; + + /** + * Annual cyclone number; 1 through 99 + */ + @DataURI(position = 2) + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String cycloneNum; + + /** + * Warning Date-Time + */ + @Column + @DynamicSerializeElement + @XmlElement + private Calendar warnTime; + + /** + * Objective technique sorting number/Minutes for best track: 00-99 + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private int techniqueNum; + + /** + * Objective Technique or CARQ or WRNG, BEST for best Track + */ + @DataURI(position = 3) + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String model; + + // @DataURI(position = 4) + // @Column + // @DynamicSerializeElement + // @XmlElement + // private int fcstHour; + + /** + * Latitude (degrees) for the DTG: -900 through 900 + */ + @DynamicSerializeElement + @XmlElement + private float clat; + + /** + * Longitude (degrees) for the DTG: -1800 through 1800 + */ + @DynamicSerializeElement + @XmlElement + private float clon; + + /** + * Maximum sustained wind speed in knots: 0 through 300 + */ + @DynamicSerializeElement + @XmlElement + private float windMax; + + /** + * Minimum sea level pressure, 1 through 1100MB + */ + @DynamicSerializeElement + @XmlElement + private float mslp; + + /** + * Level of tropical cyclone development; such as DB, TD, TS, TY, ... + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String stormType; + + /** + * Wind intensity (kts) for the radii defined i this record: 34, 50, 64 + */ + @DataURI(position = 4) + @DynamicSerializeElement + @XmlElement + private float windCategory; + + /** + * Radius Code for wind intensity: AAA = full circle; QQQ = quadrant (NNQ, + * NEQ, EEQ, SEQ, SSQ, SWQ, WWQ, NWQ) + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String windCode; + + /** + * If full circle, radius of specified wind intensity. If semicircle or + * quadrant, radius of specified wind intensity of circle portion specified + * in radius code. 0 - 1200 nm. + */ + @DynamicSerializeElement + @XmlElement + private float quad1WindRad; + + /** + * If full circle, this field not used. If semicircle, radius (nm) of + * specified wind intensity for semicircle not specified in radius code. If + * quadrant, radius (nm) of specified wind intensity for 2nd quadrant + * (counting clockwise from quadrant specified in radius code). 0 - 1200 nm. + */ + @DynamicSerializeElement + @XmlElement + private float quad2WindRad; + + /** + * If full circle or semicircle this field not used. If quadrant, radius + * (nm) of specified wind intensity for 3rd quadrant (counting clockwise + * from quadrant specified in radius code). 0 - 1200 nm. + */ + @DynamicSerializeElement + @XmlElement + private float quad3WindRad; + + /** + * If full circle or semicircle this field not used. If quadrant, radius + * (nm) of specified wind intensity for 4th quadrant (counting clockwise + * from quadrant specified in radius code). 0 - 1200 nm. + */ + @DynamicSerializeElement + @XmlElement + private float quad4WindRad; + + /** + * Pressure in millibars of the last closed isobar. 900 - 1050 mb + */ + @DynamicSerializeElement + @XmlElement + private float closedP; + + /** + * Radius of the last closed isobar in nm. 0 - 9999 nm + */ + @DynamicSerializeElement + @XmlElement + private float radClosedP; + + /** + * Radius of max winds. 0 - 999 nm + */ + @DynamicSerializeElement + @XmlElement + private float maxWindRad; + + /** + * Gusts. 0 - 995 kts. + */ + @DynamicSerializeElement + @XmlElement + private float gust; + + /** + * Eye diameter. 0 - 999nm + */ + @DynamicSerializeElement + @XmlElement + private float eyeSize; + + /** + * Subregion code: A, B, C, E, L, P, Q, S, W + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String subRegion; + + /** + * Max seas: 0 through 999 ft. + */ + @DynamicSerializeElement + @XmlElement + private float maxSeas; + + /** + * Forecaster's initials, used for forecastHour 0 WRNG, up to 3 chars + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String forecaster; + + /** + * Storm direction in compass coordinates, 0 - 359 degrees + */ + @DynamicSerializeElement + @XmlElement + private float stormDrct; + + /** + * Storm speed. 0 - 999 kts + */ + @DynamicSerializeElement + @XmlElement + private float stormSped; + + /** + * Literal storm name, NONAME, or INVEST + */ + @DataURI(position = 5) + @Column(length = 32) + @DynamicSerializeElement + @XmlElement + private String stormName; + + /** + * System depth, D=deep, M=medium, S=shallow, X=unknown + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String stormDepth; + + /** + * Wave height for radii defined in seas1 - seas4. 0 - 99 ft. + */ + @DynamicSerializeElement + @XmlElement + private float waveHght; + + /** + * Radius code for seas wave height + */ + @Column(length = 8) + @DynamicSerializeElement + @XmlElement + private String waveCode; + + /** + * First quadrant seas radius as defined by waveCode, 0 - 999 nm + */ + @DynamicSerializeElement + @XmlElement + private float quad1WaveRad; + + /** + * Second quadrant seas radius as defined by waveCode, 0 - 999 nm + */ + @DynamicSerializeElement + @XmlElement + private float quad2WaveRad; + + /** + * Third quadrant seas radius as defined by waveCode, 0 - 999 nm + */ + @DynamicSerializeElement + @XmlElement + private float quad3WaveRad; + + /** + * Fourth quadrant seas radius as defined by waveCode, 0 - 999 nm + */ + @DynamicSerializeElement + @XmlElement + private float quad4WaveRad; + + /* + * 20 character description of format to follow in userData + */ + @Column(length = 20) + @DynamicSerializeElement + @XmlElement + private String userDefined; + + /* + * User data section as indicated by userDefined parameter + */ + @Column(length = 30) + @DynamicSerializeElement + @XmlElement + private String userData; + + /** + * Default Constructor + */ + public StormTrackRecord() { + this.reportType = " "; + this.basin = "XX"; + this.cycloneNum = "M"; + this.warnTime = null; + this.techniqueNum = IDecoderConstantsN.INTEGER_MISSING; + this.model = " "; + // this.fcstHour = IMISSD; + this.clat = RMISSD; + this.clon = RMISSD; + this.windMax = RMISSD; + this.mslp = RMISSD; + this.stormType = "XX"; + this.windCategory = RMISSD; + this.windCode = "M"; + this.quad1WindRad = RMISSD; + this.quad2WindRad = RMISSD; + this.quad3WindRad = RMISSD; + this.quad4WindRad = RMISSD; + this.closedP = RMISSD; + this.radClosedP = RMISSD; + this.maxWindRad = RMISSD; + this.gust = RMISSD; + this.eyeSize = RMISSD; + this.subRegion = " "; + this.maxSeas = RMISSD; + this.forecaster = ""; + this.stormDrct = RMISSD; + this.stormSped = RMISSD; + this.stormName = " "; + this.stormDepth = " "; + this.waveHght = RMISSD; + this.waveCode = " "; + this.quad1WaveRad = RMISSD; + this.quad2WaveRad = RMISSD; + this.quad3WaveRad = RMISSD; + this.quad4WaveRad = RMISSD; + this.userDefined = " "; + this.userData = " "; + } + + /** + * Constructs a StormTrack record from a dataURI + * + * @param uri + * The dataURI + */ + public StormTrackRecord(String uri) { + super(uri); + } + + @Override + public IDecoderGettable getDecoderGettable() { + // TODO Auto-generated method stub + return null; + } + + public String getReportType() { + return reportType; + } + + public void setReportType(String reportType) { + this.reportType = reportType; + } + + public String getBasin() { + return basin; + } + + public void setBasin(String basin) { + this.basin = basin; + } + + public String getCycloneNum() { + return cycloneNum; + } + + public void setCycloneNum(String cycloneNum) { + this.cycloneNum = cycloneNum; + } + + public Calendar getWarnTime() { + return warnTime; + } + + public void setWarnTime(Calendar warnTime) { + this.warnTime = warnTime; + } + + public int getTechniqueNum() { + return techniqueNum; + } + + public void setTechniqueNum(int techniqueNum) { + this.techniqueNum = techniqueNum; + } + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model; + } + + public int getFcstHour() { + return dataTime.getFcstTime() / 3600; // fcstHour; + } + + public float getClat() { + return clat; + } + + public void setClat(float clat) { + this.clat = clat; + } + + public float getClon() { + return clon; + } + + public void setClon(float clon) { + this.clon = clon; + } + + public float getWindMax() { + return windMax; + } + + public void setWindMax(float windMax) { + this.windMax = windMax; + } + + public float getMslp() { + return mslp; + } + + public void setMslp(float mslp) { + this.mslp = mslp; + } + + public String getStormType() { + return stormType; + } + + public void setStormType(String stormType) { + this.stormType = stormType; + } - public float getWindCategory() { - return windCategory; - } + public float getWindCategory() { + return windCategory; + } - public void setWindCategory(float windCategory) { - this.windCategory = windCategory; - } + public void setWindCategory(float windCategory) { + this.windCategory = windCategory; + } - public String getWindCode() { - return windCode; - } + public String getWindCode() { + return windCode; + } - public void setWindCode(String windCode) { - this.windCode = windCode; - } + public void setWindCode(String windCode) { + this.windCode = windCode; + } - public float getQuad1WindRad() { - return quad1WindRad; - } + public float getQuad1WindRad() { + return quad1WindRad; + } - public void setQuad1WindRad(float quad1WindRad) { - this.quad1WindRad = quad1WindRad; - } + public void setQuad1WindRad(float quad1WindRad) { + this.quad1WindRad = quad1WindRad; + } - public float getQuad2WindRad() { - return quad2WindRad; - } + public float getQuad2WindRad() { + return quad2WindRad; + } - public void setQuad2WindRad(float quad2WindRad) { - this.quad2WindRad = quad2WindRad; - } + public void setQuad2WindRad(float quad2WindRad) { + this.quad2WindRad = quad2WindRad; + } - public float getQuad3WindRad() { - return quad3WindRad; - } + public float getQuad3WindRad() { + return quad3WindRad; + } - public void setQuad3WindRad(float quad3WindRad) { - this.quad3WindRad = quad3WindRad; - } + public void setQuad3WindRad(float quad3WindRad) { + this.quad3WindRad = quad3WindRad; + } - public float getQuad4WindRad() { - return quad4WindRad; - } + public float getQuad4WindRad() { + return quad4WindRad; + } - public void setQuad4WindRad(float quad4WindRad) { - this.quad4WindRad = quad4WindRad; - } + public void setQuad4WindRad(float quad4WindRad) { + this.quad4WindRad = quad4WindRad; + } - public float getClosedP() { - return closedP; - } + public float getClosedP() { + return closedP; + } - public void setClosedP(float closedP) { - this.closedP = closedP; - } + public void setClosedP(float closedP) { + this.closedP = closedP; + } - public float getRadClosedP() { - return radClosedP; - } + public float getRadClosedP() { + return radClosedP; + } - public void setRadClosedP(float radClosedP) { - this.radClosedP = radClosedP; - } + public void setRadClosedP(float radClosedP) { + this.radClosedP = radClosedP; + } - public float getMaxWindRad() { - return maxWindRad; - } + public float getMaxWindRad() { + return maxWindRad; + } - public void setMaxWindRad(float maxWindRad) { - this.maxWindRad = maxWindRad; - } + public void setMaxWindRad(float maxWindRad) { + this.maxWindRad = maxWindRad; + } - public float getGust() { - return gust; - } + public float getGust() { + return gust; + } - public void setGust(float gust) { - this.gust = gust; - } + public void setGust(float gust) { + this.gust = gust; + } - public float getEyeSize() { - return eyeSize; - } + public float getEyeSize() { + return eyeSize; + } - public void setEyeSize(float eyeSize) { - this.eyeSize = eyeSize; - } + public void setEyeSize(float eyeSize) { + this.eyeSize = eyeSize; + } - public String getSubRegion() { - return subRegion; - } + public String getSubRegion() { + return subRegion; + } - public void setSubRegion(String subRegion) { - this.subRegion = subRegion; - } + public void setSubRegion(String subRegion) { + this.subRegion = subRegion; + } - public float getMaxSeas() { - return maxSeas; - } + public float getMaxSeas() { + return maxSeas; + } - public void setMaxSeas(float maxSeas) { - this.maxSeas = maxSeas; - } + public void setMaxSeas(float maxSeas) { + this.maxSeas = maxSeas; + } - public String getForecaster() { - return forecaster; - } + public String getForecaster() { + return forecaster; + } - public void setForecaster(String forecaster) { - this.forecaster = forecaster; - } + public void setForecaster(String forecaster) { + this.forecaster = forecaster; + } - public float getStormDrct() { - return stormDrct; - } + public float getStormDrct() { + return stormDrct; + } - public void setStormDrct(float stormDrct) { - this.stormDrct = stormDrct; - } + public void setStormDrct(float stormDrct) { + this.stormDrct = stormDrct; + } - public float getStormSped() { - return stormSped; - } + public float getStormSped() { + return stormSped; + } - public void setStormSped(float stormSped) { - this.stormSped = stormSped; - } + public void setStormSped(float stormSped) { + this.stormSped = stormSped; + } - public String getStormName() { - return stormName; - } + public String getStormName() { + return stormName; + } - public void setStormName(String stormName) { - this.stormName = stormName; - } + public void setStormName(String stormName) { + this.stormName = stormName; + } - public String getStormDepth() { - return stormDepth; - } + public String getStormDepth() { + return stormDepth; + } - public void setStormDepth(String stormDepth) { - this.stormDepth = stormDepth; - } + public void setStormDepth(String stormDepth) { + this.stormDepth = stormDepth; + } - public float getWaveHght() { - return waveHght; - } + public float getWaveHght() { + return waveHght; + } - public void setWaveHght(float waveHght) { - this.waveHght = waveHght; - } + public void setWaveHght(float waveHght) { + this.waveHght = waveHght; + } - public String getWaveCode() { - return waveCode; - } + public String getWaveCode() { + return waveCode; + } - public void setWaveCode(String waveCode) { - this.waveCode = waveCode; - } + public void setWaveCode(String waveCode) { + this.waveCode = waveCode; + } - public float getQuad1WaveRad() { - return quad1WaveRad; - } + public float getQuad1WaveRad() { + return quad1WaveRad; + } - public void setQuad1WaveRad(float quad1WaveRad) { - this.quad1WaveRad = quad1WaveRad; - } + public void setQuad1WaveRad(float quad1WaveRad) { + this.quad1WaveRad = quad1WaveRad; + } - public float getQuad2WaveRad() { - return quad2WaveRad; - } + public float getQuad2WaveRad() { + return quad2WaveRad; + } - public void setQuad2WaveRad(float quad2WaveRad) { - this.quad2WaveRad = quad2WaveRad; - } + public void setQuad2WaveRad(float quad2WaveRad) { + this.quad2WaveRad = quad2WaveRad; + } - public float getQuad3WaveRad() { - return quad3WaveRad; - } + public float getQuad3WaveRad() { + return quad3WaveRad; + } - public void setQuad3WaveRad(float quad3WaveRad) { - this.quad3WaveRad = quad3WaveRad; - } + public void setQuad3WaveRad(float quad3WaveRad) { + this.quad3WaveRad = quad3WaveRad; + } - public float getQuad4WaveRad() { - return quad4WaveRad; - } + public float getQuad4WaveRad() { + return quad4WaveRad; + } - public void setQuad4WaveRad(float quad4WaveRad) { - this.quad4WaveRad = quad4WaveRad; - } + public void setQuad4WaveRad(float quad4WaveRad) { + this.quad4WaveRad = quad4WaveRad; + } - public String getUserDefined() { - return userDefined; - } + public String getUserDefined() { + return userDefined; + } - public void setUserDefined(String userDefined) { - this.userDefined = userDefined; - } + public void setUserDefined(String userDefined) { + this.userDefined = userDefined; + } - public String getUserData() { - return userData; - } + public String getUserData() { + return userData; + } - public void setUserData(String userData) { - this.userData = userData; - } + public void setUserData(String userData) { + this.userData = userData; + } @Override @Column @@ -752,4 +732,8 @@ public class StormTrackRecord extends PluginDataObject { return super.getDataURI(); } + @Override + public String getPluginName() { + return "stormtrack"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.tcm/src/gov/noaa/nws/ncep/common/dataplugin/tcm/TcmRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.tcm/src/gov/noaa/nws/ncep/common/dataplugin/tcm/TcmRecord.java index c4c96cc01b..27f67b511b 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.tcm/src/gov/noaa/nws/ncep/common/dataplugin/tcm/TcmRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.tcm/src/gov/noaa/nws/ncep/common/dataplugin/tcm/TcmRecord.java @@ -1,30 +1,3 @@ -/** - * - * TcmRecord - * - * This java class performs the mapping to the database tables for TCM. - * - *
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    	Engineer    Description
- * -------		------- 	-------- 	-----------
- * 06/2009		128			T. Lee		Initial coding
- * 07/2009		128			T. Lee		Migrated to TO11
- * 11/2009		128			T. Lee		Migrated to TO11D6
- * 09/2011      			Chin Chen   changed to improve purge performance and
- * 										removed xml serialization as well
- * 07/2012      #606        Greg Huoll  added reportType to the dataURI
- * Apr 4, 2013        1846 bkowal      Added an index on refTime and forecastTime
- * Apr 12, 2013 1857        bgonzale    Added SequenceGenerator annotation.
- * May 07, 2013 1869        bsteffen	Remove dataURI column from PluginDataObject.
- * 
- * 
- * - * @author T.Lee - * @version 1.0 - */ - package gov.noaa.nws.ncep.common.dataplugin.tcm; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; @@ -53,6 +26,32 @@ import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; +/** + * + * TcmRecord + * + * This java class performs the mapping to the database tables for TCM. + * + *
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket# Engineer   Description
+ * ------------ ------- ---------- ---------------------------------
+ * 06/2009      128     T. Lee     Initial coding
+ * 07/2009      128     T. Lee     Migrated to TO11
+ * 11/2009      128     T. Lee     Migrated to TO11D6
+ * 09/2011              Chin Chen  changed to improve purge performance and
+ *                                 removed xml serialization as well
+ * 07/2012      606     Greg Hull  added reportType to the dataURI
+ * Apr 04, 2013 1846    bkowal     Added an index on refTime and forecastTime
+ * Apr 12, 2013 1857    bgonzale   Added SequenceGenerator annotation.
+ * May 07, 2013 1869    bsteffen   Remove dataURI column from PluginDataObject.
+ * Aug 30, 2013 2298   rjpeter Make getPluginName abstract
+ * 
+ * + * @author T.Lee + * @version 1.0 + */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "tcmseq") @Table(name = "tcm", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -60,66 +59,61 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "tcm", - indexes = { - @Index(name = "tcm_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) +@org.hibernate.annotations.Table(appliesTo = "tcm", indexes = { @Index(name = "tcm_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize - public class TcmRecord extends PluginDataObject { private static final long serialVersionUID = 1L; - + /** Report type */ - @Column(length=32) - @DataURI(position=6) - @DynamicSerializeElement + @Column(length = 32) + @DataURI(position = 6) + @DynamicSerializeElement private String reportType; /** Storm name */ - @Column(length=32) - @DataURI(position=2) + @Column(length = 32) + @DataURI(position = 2) @DynamicSerializeElement private String stormName; - + /** Tropical storm basin */ - @Column(length=8) - @DataURI(position=1) + @Column(length = 8) + @DataURI(position = 1) @DynamicSerializeElement private String basin; /** Storm number */ - @Column(length=8) - @DataURI(position=3) + @Column(length = 8) + @DataURI(position = 3) @DynamicSerializeElement private String stormNumber; - + /** Advisory number */ - @Column(length=8) - @DataURI(position=4) + @Column(length = 8) + @DataURI(position = 4) @DynamicSerializeElement private String advisoryNumber; - + /** Correction flag */ @Column - @DataURI(position=5) + @DataURI(position = 5) @DynamicSerializeElement private Boolean corr; - + /** Bulletin insurance time */ @Column @DynamicSerializeElement private Calendar issueTime; - - /** Storm observation time **/ - @Column - @DynamicSerializeElement - private Calendar obsTime; + + /** Storm observation time **/ + @Column + @DynamicSerializeElement + private Calendar obsTime; /** Storm type */ - @Column(length=32) + @Column(length = 32) @DynamicSerializeElement private String stormType; @@ -142,359 +136,379 @@ public class TcmRecord extends PluginDataObject { @Column @DynamicSerializeElement private String ne12ft; - + /** Twelve-foot wave height radii at the SE quadrant */ @Column @DynamicSerializeElement private String se12ft; - + /** Twelve-foot wave height radii at the SW quadrant */ @Column @DynamicSerializeElement private String sw12ft; - + /** Twelve-foot wave height radii at the NW quadrant */ @Column @DynamicSerializeElement private String nw12ft; /** Mass news disseminator (MND) */ - @Column(length=72) + @Column(length = 72) @DynamicSerializeElement private String mndTime; /** Bulletin messages */ - @Column(length=8000) + @Column(length = 8000) @DynamicSerializeElement private String bullMessage; - + /** TCM position and winds */ @DynamicSerializeElement @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - @JoinColumn(name = "parentID", nullable = false) + @JoinColumn(name = "parentID", nullable = false) @Index(name = "tcmPosWinds_parentid_idex") - private Set tcmPosWinds = new HashSet(); - + private Set tcmPosWinds = new HashSet(); + /** * Default constructor */ public TcmRecord() { - basin = null; - stormName = null; - stormNumber = null; - issueTime = null; - obsTime = null; - corr = false; - mndTime = null; - advisoryNumber = null; - centralPressure = IDecoderConstantsN.INTEGER_MISSING; - positionAccuracy = IDecoderConstantsN.INTEGER_MISSING; - ne12ft = null; - se12ft = null; - sw12ft = null; - nw12ft = null; - bullMessage = null; + basin = null; + stormName = null; + stormNumber = null; + issueTime = null; + obsTime = null; + corr = false; + mndTime = null; + advisoryNumber = null; + centralPressure = IDecoderConstantsN.INTEGER_MISSING; + positionAccuracy = IDecoderConstantsN.INTEGER_MISSING; + ne12ft = null; + se12ft = null; + sw12ft = null; + nw12ft = null; + bullMessage = null; } /** * Constructs a TCM record from a dataURI * - * @param uri the dataURI + * @param uri + * the dataURI */ public TcmRecord(String uri) { - super(uri); + super(uri); } - - /** - * Return the report type + + /** + * Return the report type */ public String getReportType() { return reportType; } /** - * @param reportType the report type to set + * @param reportType + * the report type to set */ public void setReportType(String reportType) { this.reportType = reportType; } - - /** + + /** * Return the basin, e.g., AL/EP */ - public String getBasin() { - return basin; - } - - /** - * @param basin the basin name to set - */ - public void setBasin(String basin) { - this.basin = basin; - } - - /** - * Return the storm name - */ - public String getStormName() { - return stormName; - } + public String getBasin() { + return basin; + } /** - * @param stormName the storm name to set + * @param basin + * the basin name to set */ - public void setStormName(String stormName) { - this.stormName = stormName; - } - - /** + public void setBasin(String basin) { + this.basin = basin; + } + + /** + * Return the storm name + */ + public String getStormName() { + return stormName; + } + + /** + * @param stormName + * the storm name to set + */ + public void setStormName(String stormName) { + this.stormName = stormName; + } + + /** * Return the storm number */ - public String getStormNumber() { - return stormNumber; - } + public String getStormNumber() { + return stormNumber; + } /** - * @param stormNumber the storm number to set + * @param stormNumber + * the storm number to set */ - public void setStormNumber(String stormNumber) { - this.stormNumber = stormNumber; - } - - /** + public void setStormNumber(String stormNumber) { + this.stormNumber = stormNumber; + } + + /** * Return the advisory number */ - - public String getAdvisoryNumber() { - return advisoryNumber; - } + + public String getAdvisoryNumber() { + return advisoryNumber; + } /** - * @param advisory the advisory number to set + * @param advisory + * the advisory number to set */ - public void setAdvisoryNumber(String advisoryNumber) { - this.advisoryNumber = advisoryNumber; - } - - /** + public void setAdvisoryNumber(String advisoryNumber) { + this.advisoryNumber = advisoryNumber; + } + + /** * Return the correction flag */ - public Boolean getCorr() { - return corr; - } + public Boolean getCorr() { + return corr; + } /** - * @param corr the correction flag to set + * @param corr + * the correction flag to set */ - public void setCorr(Boolean corr) { - this.corr = corr; - } - - /** + public void setCorr(Boolean corr) { + this.corr = corr; + } + + /** * Return the storm type */ - public String getStormType() { - return stormType; - } + public String getStormType() { + return stormType; + } /** - * @param stormType the storm type to set + * @param stormType + * the storm type to set */ - public void setStormType(String stormType) { - this.stormType = stormType; - } - - /** + public void setStormType(String stormType) { + this.stormType = stormType; + } + + /** * Return the eye size */ - public Integer getEyeSize() { - return eyeSize; - } + public Integer getEyeSize() { + return eyeSize; + } /** - * @param eyeSize the eye size to set + * @param eyeSize + * the eye size to set */ - public void setEyeSize(Integer eyeSize) { - this.eyeSize = eyeSize; - } - - /** + public void setEyeSize(Integer eyeSize) { + this.eyeSize = eyeSize; + } + + /** * Return the minimum central pressure */ - public Integer getCentralPressure() { - return centralPressure; - } + public Integer getCentralPressure() { + return centralPressure; + } /** - * @param centralPressure the minimum central pressure to set + * @param centralPressure + * the minimum central pressure to set */ - public void setCentralPressure(Integer centralPressure) { - this.centralPressure = centralPressure; - } - - /** - * Return the position accuracy - */ - public Integer getPositionAccuracy() { - return positionAccuracy; - } + public void setCentralPressure(Integer centralPressure) { + this.centralPressure = centralPressure; + } /** - * @param positionAccuracy the position accuracy to set + * Return the position accuracy */ - public void setPositionAccuracy(Integer positionAccuracy) { - this.positionAccuracy = positionAccuracy; - } - - /** + public Integer getPositionAccuracy() { + return positionAccuracy; + } + + /** + * @param positionAccuracy + * the position accuracy to set + */ + public void setPositionAccuracy(Integer positionAccuracy) { + this.positionAccuracy = positionAccuracy; + } + + /** * Return the twelve-foot wave height radii at the NE quadrant */ - public String getNe12ft() { - return ne12ft; - } + public String getNe12ft() { + return ne12ft; + } /** - * @param ne12ft the twelve-foot wave height radii at the NE quadrant to set + * @param ne12ft + * the twelve-foot wave height radii at the NE quadrant to set */ - public void setNe12ft(String ne12ft) { - this.ne12ft = ne12ft; - } + public void setNe12ft(String ne12ft) { + this.ne12ft = ne12ft; + } - /** + /** * Return the twelve-foot wave height radii at the SE quadrant */ - public String getSe12ft() { - return se12ft; - } + public String getSe12ft() { + return se12ft; + } - /** - * @param se12ft the twelve-foot wave height radii at the SE quadrant to set + /** + * @param se12ft + * the twelve-foot wave height radii at the SE quadrant to set */ - public void setSe12ft(String se12ft) { - this.se12ft = se12ft; - } + public void setSe12ft(String se12ft) { + this.se12ft = se12ft; + } - /** + /** * Return the twelve-foot wave height radii at the SW quadrant */ - public String getSw12ft() { - return sw12ft; - } + public String getSw12ft() { + return sw12ft; + } - /** - * @param sw12ft The twelve-foot wave height radii at the SW quadrant to set + /** + * @param sw12ft + * The twelve-foot wave height radii at the SW quadrant to set */ - public void setSw12ft(String sw12ft) { - this.sw12ft = sw12ft; - } + public void setSw12ft(String sw12ft) { + this.sw12ft = sw12ft; + } - /** + /** * Return the twelve-foot wave height radii at the NW quadrant */ - public String getNw12ft() { - return nw12ft; - } + public String getNw12ft() { + return nw12ft; + } - /** - * @param nw12ft The twelve-foot wave height radii at the NW quadrant to set + /** + * @param nw12ft + * The twelve-foot wave height radii at the NW quadrant to set */ - public void setNw12ft(String nw12ft) { - this.nw12ft = nw12ft; - } + public void setNw12ft(String nw12ft) { + this.nw12ft = nw12ft; + } /** * @return the issueTime */ public Calendar getIssueTime() { - return issueTime; + return issueTime; } /** - * @param obsTime The obsTime to set + * @param obsTime + * The obsTime to set */ public void setObsTime(Calendar obsTime) { - this.obsTime = obsTime; + this.obsTime = obsTime; } - + /** * @return the obsTime */ public Calendar getObsTime() { - return obsTime; + return obsTime; } /** - * @param issueTime the issueTime to set + * @param issueTime + * the issueTime to set */ public void setIssueTime(Calendar issueTime) { - this.issueTime = issueTime; + this.issueTime = issueTime; } - + /** * @return the bullMessage */ public String getBullMessage() { - return bullMessage; - } - + return bullMessage; + } + /** - * @param bullMessage the bullMessage to set + * @param bullMessage + * the bullMessage to set */ public void setBullMessage(String bullMessage) { - this.bullMessage = bullMessage; + this.bullMessage = bullMessage; } - + /** * @return the MndTime */ public String getMndTime() { - return mndTime; + return mndTime; } /** - * @param mndTime the mndTime to set + * @param mndTime + * the mndTime to set */ public void setMndTime(String mndTime) { - this.mndTime = mndTime; + this.mndTime = mndTime; } - + /** * @return the set of position and winds */ public Set getTcmPosWinds() { - return tcmPosWinds; + return tcmPosWinds; } /** - * @param tcmPW the set of position and winds to set + * @param tcmPW + * the set of position and winds to set */ - public void setTcmPosWinds(Set tcmPosWinds ) { - this.tcmPosWinds = tcmPosWinds; + public void setTcmPosWinds(Set tcmPosWinds) { + this.tcmPosWinds = tcmPosWinds; } /** * Add TcmPosWinds to set */ - public void addPosWinds(TcmPositionWinds poswinds){ - tcmPosWinds.add(poswinds); - - } + public void addPosWinds(TcmPositionWinds poswinds) { + tcmPosWinds.add(poswinds); - /** - * Override existing set method to modify any - * classes that use the dataURI as a foreign key - */ - @Override - public void setIdentifier(Object dataURI) { - this.identifier = dataURI; - } - @Override + /** + * Override existing set method to modify any classes that use the dataURI + * as a foreign key + */ + @Override + public void setIdentifier(Object dataURI) { + this.identifier = dataURI; + + } + + @Override public IDecoderGettable getDecoderGettable() { - // TODO Auto-generated method stub - return null; - } + // TODO Auto-generated method stub + return null; + } @Override @Column @@ -502,4 +516,9 @@ public class TcmRecord extends PluginDataObject { public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "tcm"; + } } diff --git a/ncep/gov.noaa.nws.ncep.common.dataplugin.wcp/src/gov/noaa/nws/ncep/common/dataplugin/wcp/WcpRecord.java b/ncep/gov.noaa.nws.ncep.common.dataplugin.wcp/src/gov/noaa/nws/ncep/common/dataplugin/wcp/WcpRecord.java index 757c3288ee..a04b47479f 100644 --- a/ncep/gov.noaa.nws.ncep.common.dataplugin.wcp/src/gov/noaa/nws/ncep/common/dataplugin/wcp/WcpRecord.java +++ b/ncep/gov.noaa.nws.ncep.common.dataplugin.wcp/src/gov/noaa/nws/ncep/common/dataplugin/wcp/WcpRecord.java @@ -1,4 +1,3 @@ - /** * WcpRecord is the Data Access component for WCP Watch Corner Point data. * This contains getters and setters for the main parent table wcp. @@ -10,16 +9,19 @@ * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 12Dec2008 37 F. J. Yen Initial Coding. - * 17Apr2009 37 F. J. Yen Refactored for TO10 - * 24Aug2009 37 F. J. Yen Refactored for TO11 - * 17May2010 37 F. J. Yen Refactored to dataplugin for migration to to11dr11 - * 09/2011 Chin Chen changed to improve purge performance and - * removed xml serialization as well - * * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime - * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. + * 12Dec2008 37 F. J. Yen Initial Coding. + * 17Apr2009 37 F. J. Yen Refactored for TO10 + * 24Aug2009 37 F. J. Yen Refactored for TO11 + * 17May2010 37 F. J. Yen Refactored to dataplugin for migration to + * to11dr11 + * 09/2011 Chin Chen changed to improve purge performance and + * removed xml serialization as well + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime + * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -52,6 +54,7 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.serialization.annotations.DynamicSerialize; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; + @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "wcpseq") @Table(name = "wcp", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) @@ -59,46 +62,40 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. */ -@org.hibernate.annotations.Table( - appliesTo = "wcp", - indexes = { - @Index(name = "wcp_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) - } -) - +@org.hibernate.annotations.Table(appliesTo = "wcp", indexes = { @Index(name = "wcp_refTimeIndex", columnNames = { + "refTime", "forecastTime" }) }) @DynamicSerialize +public class WcpRecord extends PluginDataObject { -public class WcpRecord extends PluginDataObject{ - - private static final long serialVersionUID = 1L; - - /** Report type */ - @Column(length=32) - @DynamicSerializeElement - @DataURI(position = 2) - private String reportType; - - @Column + private static final long serialVersionUID = 1L; + + /** Report type */ + @Column(length = 32) @DynamicSerializeElement - private Calendar issueTime; + @DataURI(position = 2) + private String reportType; - @DataURI(position = 1) - @Column(length = 8) - @DynamicSerializeElement - private String designatorBBB; - - @Column(length = 2500) - @DynamicSerializeElement - private String bullMessage; + @Column + @DynamicSerializeElement + private Calendar issueTime; - /** WcpSevrln */ - @DynamicSerializeElement - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) - @JoinColumn(name = "parentID", nullable = false) + @DataURI(position = 1) + @Column(length = 8) + @DynamicSerializeElement + private String designatorBBB; + + @Column(length = 2500) + @DynamicSerializeElement + private String bullMessage; + + /** WcpSevrln */ + @DynamicSerializeElement + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @JoinColumn(name = "parentID", nullable = false) @Index(name = "wcpSevrLn_parentid_idex") - private Set wcpSevrLn = new HashSet(); + private Set wcpSevrLn = new HashSet(); - /** + /** * Default Constructor */ public WcpRecord() { @@ -113,73 +110,83 @@ public class WcpRecord extends PluginDataObject{ public WcpRecord(String uri) { super(uri); } - + @Override public IDecoderGettable getDecoderGettable() { // TODO Auto-generated method stub return null; } - + public String getReportType() { - return reportType; + return reportType; } + public void setReportType(String reportType) { - this.reportType = reportType; + this.reportType = reportType; } - - public Calendar getIssueTime(){ - return issueTime; - } - public void setIssueTime(Calendar issueTime){ - this.issueTime=issueTime; - } - - public String getDesignatorBBB(){ - return designatorBBB; - } - public void setDesignatorBBB(String designatorBBB){ - this.designatorBBB=designatorBBB; - } - - public String getBullMessage(){ - return bullMessage; - } - public void setBullMessage(String bullMessage){ - this.bullMessage=bullMessage; - } - /** - * return the set of wcpSevrLn - */ - public Set getWcpSevrLn() { - return wcpSevrLn; - } - - /** - * @param wcpSevrln the wcpSevrln to set - */ - public void setWcpSevrLn(Set wcpSevrlin) { - this.wcpSevrLn = wcpSevrlin; - } - - /* - * Add wcpSevrln to set - */ - public void addWcpSevrLn(WcpSevrln psevrln) { - wcpSevrLn.add(psevrln); - - } - - public void setIdentifier(Object dataURI){ - this.identifier = dataURI; - - + public Calendar getIssueTime() { + return issueTime; } - + + public void setIssueTime(Calendar issueTime) { + this.issueTime = issueTime; + } + + public String getDesignatorBBB() { + return designatorBBB; + } + + public void setDesignatorBBB(String designatorBBB) { + this.designatorBBB = designatorBBB; + } + + public String getBullMessage() { + return bullMessage; + } + + public void setBullMessage(String bullMessage) { + this.bullMessage = bullMessage; + } + + /** + * return the set of wcpSevrLn + */ + public Set getWcpSevrLn() { + return wcpSevrLn; + } + + /** + * @param wcpSevrln + * the wcpSevrln to set + */ + public void setWcpSevrLn(Set wcpSevrlin) { + this.wcpSevrLn = wcpSevrlin; + } + + /* + * Add wcpSevrln to set + */ + public void addWcpSevrLn(WcpSevrln psevrln) { + wcpSevrLn.add(psevrln); + + } + + @Override + public void setIdentifier(Object dataURI) { + this.identifier = dataURI; + + } + @Override @Column @Access(AccessType.PROPERTY) public String getDataURI() { return super.getDataURI(); } + + @Override + public String getPluginName() { + return "wcp"; + } } diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.airmet/src/gov/noaa/nws/ncep/edex/plugin/airmet/decoder/AirmetDecoder.java b/ncep/gov.noaa.nws.ncep.edex.plugin.airmet/src/gov/noaa/nws/ncep/edex/plugin/airmet/decoder/AirmetDecoder.java old mode 100755 new mode 100644 index 7aad148a39..bff3c951cc --- a/ncep/gov.noaa.nws.ncep.edex.plugin.airmet/src/gov/noaa/nws/ncep/edex/plugin/airmet/decoder/AirmetDecoder.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.airmet/src/gov/noaa/nws/ncep/edex/plugin/airmet/decoder/AirmetDecoder.java @@ -109,7 +109,6 @@ public class AirmetDecoder extends AbstractDecoder { */ if (record != null) { record.setTraceId(traceId); - record.setPluginName(pluginName); record.setReportType(pluginName); record.setReportName(reportName); // Decode and set the update number diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.atcf/src/gov/noaa/nws/ncep/edex/plugin/atcf/decoder/AtcfDecoder.java b/ncep/gov.noaa.nws.ncep.edex.plugin.atcf/src/gov/noaa/nws/ncep/edex/plugin/atcf/decoder/AtcfDecoder.java index 0d5f84bfa1..6072c95d34 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.atcf/src/gov/noaa/nws/ncep/edex/plugin/atcf/decoder/AtcfDecoder.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.atcf/src/gov/noaa/nws/ncep/edex/plugin/atcf/decoder/AtcfDecoder.java @@ -1,15 +1,3 @@ -/** - * - * AtcfDecoder - * - * Decoder Plug-In for Automated Tropical Cyclone Forecast ATCF. - * - * 12 December 2008 - * - * This code has been developed by the SIB for use in the AWIPS2 system. - * - */ - package gov.noaa.nws.ncep.edex.plugin.atcf.decoder; import gov.noaa.nws.ncep.common.dataplugin.atcf.AtcfRecord; @@ -31,13 +19,15 @@ import com.raytheon.uf.common.dataplugin.PluginException; * * Decoder implementation for ATCF Plug-In * + * This code has been developed by the SIB for use in the AWIPS2 system. + * *
  * SOFTWARE HISTORY
  * 
- * Date       	Ticket#		Engineer	Description
- * ------------	----------	-----------	--------------------------
- * 06/23/10		208			F. J. Yen	Initial creation
- * 
+ * Date         Ticket#    Engineer     Description
+ * ------------ -------- ----------- --------------------------
+ * Jun 23, 2010 208      F. J. Yen   Initial creation
+ * Aug 30, 2013 2298     rjpeter     Make getPluginName abstract
  * 
* * @author Fee Jing Yen, SIB @@ -114,7 +104,6 @@ public class AtcfDecoder extends AbstractDecoder { if (record != null) { try { record.setTraceId(traceId); - record.setPluginName(pluginName); record.constructDataURI(); } catch (PluginException e) { throw new DecoderException( diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.aww/res/spring/aww-ingest.xml b/ncep/gov.noaa.nws.ncep.edex.plugin.aww/res/spring/aww-ingest.xml index 5199c6cc78..ecc5b995e3 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.aww/res/spring/aww-ingest.xml +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.aww/res/spring/aww-ingest.xml @@ -5,9 +5,7 @@ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> - - - + - + diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.stormtrack/src/gov/noaa/nws/ncep/edex/plugin/stormtrack/decoder/StormTrackDecoder.java b/ncep/gov.noaa.nws.ncep.edex.plugin.stormtrack/src/gov/noaa/nws/ncep/edex/plugin/stormtrack/decoder/StormTrackDecoder.java index 46b51338a4..b4cc97e66f 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.stormtrack/src/gov/noaa/nws/ncep/edex/plugin/stormtrack/decoder/StormTrackDecoder.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.stormtrack/src/gov/noaa/nws/ncep/edex/plugin/stormtrack/decoder/StormTrackDecoder.java @@ -1,20 +1,8 @@ -/** - * - * StormTrackDecoder - * - * Decoder Plug-In for StormTrack (Automatic Tropical Cyclone Forecast & Ensemble cyclones). - * - * 12 December 2008 - * - * This code has been developed by the SIB for use in the AWIPS2 system. - * - */ - package gov.noaa.nws.ncep.edex.plugin.stormtrack.decoder; import gov.noaa.nws.ncep.common.dataplugin.stormtrack.StormTrackRecord; -import gov.noaa.nws.ncep.edex.plugin.stormtrack.util.StormTrackParser; import gov.noaa.nws.ncep.common.tools.IDecoderConstantsN; +import gov.noaa.nws.ncep.edex.plugin.stormtrack.util.StormTrackParser; import java.util.ArrayList; import java.util.List; @@ -27,32 +15,36 @@ import com.raytheon.edex.exception.DecoderException; import com.raytheon.edex.plugin.AbstractDecoder; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginException; +import com.raytheon.uf.common.status.IUFStatusHandler; +import com.raytheon.uf.common.status.UFStatus; /** - * * StormTrackDecoder * - * Decoder implementation for StormTrack Plug-In + * Decoder implementation for StormTrack Plug-In (Automatic Tropical Cyclone + * Forecast & Ensemble cyclones). + * + * This code has been developed by the SIB for use in the AWIPS2 system. * *
  * SOFTWARE HISTORY
  * 
- * Date       	Ticket#		Engineer	Description
- * ------------	----------	-----------	--------------------------
- * 08/2011					T. Lee		ATCF and Ensemble storm tracks	
- * 06/2012       #606       G. Hull     constructDataURI() after setReportType so it gets into the URI	
- * 07/2013				    T. Lee		Improved performance via batch processing	
- * 
+ * Date        Ticket#  Engineer   Description
+ * ------------ ------- ---------- --------------------------
+ * 08/2011              T. Lee     ATCF and Ensemble storm tracks
+ * 06/2012      606     G. Hull    constructDataURI() after setReportType so it
+ *                                 gets into the URI
+ * 07/2013              T. Lee     Improved performance via batch processing	
+ * Aug 30, 2013 2298    rjpeter    Make getPluginName abstract
  * 
* * @author tlee * @version 1 * */ - public class StormTrackDecoder extends AbstractDecoder { - // Name of the plugin controlling this decoder. - public final String pluginName; + private static final transient IUFStatusHandler statusHandler = UFStatus + .getHandler(StormTrackDecoder.class); protected Matcher regexMatcher; @@ -65,8 +57,7 @@ public class StormTrackDecoder extends AbstractDecoder { * * @throws DecoderException */ - public StormTrackDecoder(String name) throws DecoderException { - pluginName = name; + public StormTrackDecoder() throws DecoderException { } public PluginDataObject[] decode(byte[] data, Headers headers) @@ -96,15 +87,14 @@ public class StormTrackDecoder extends AbstractDecoder { Matcher stormTrackMatcher = stormTrackPattern.matcher(theMessage); if (stormTrackMatcher.find()) { - + } else { - System.out.println("StormTrack WARNING: Ignored invalid record: " + statusHandler.warn("StormTrack: Ignored invalid record: " + theMessage); } } catch (Exception e) { - System.out.println("StormTrack WARNING exception: Unable to decode: " - + theMessage); - e.printStackTrace(); + statusHandler.error("StormTrack exception: Unable to decode: " + + theMessage, e); } /* @@ -117,32 +107,32 @@ public class StormTrackDecoder extends AbstractDecoder { */ if (record != null) { try { - record.setTraceId(traceId); - record.setPluginName(pluginName); + record.setTraceId(traceId); - /* - * Set report type in record. - */ - if (theMessage.contains("FOF\n") || theMessage.contains("TCV\n")) { - record.setReportType("ENSCYC"); - } else { - record.setReportType("ATCF"); - } + /* + * Set report type in record. + */ + if (theMessage.contains("FOF\n") + || theMessage.contains("TCV\n")) { + record.setReportType("ENSCYC"); + } else { + record.setReportType("ATCF"); + } - record.constructDataURI(); + record.constructDataURI(); if ( record.getClat() != IDecoderConstantsN.FLOAT_MISSING && record.getClon() != IDecoderConstantsN.FLOAT_MISSING ) { records.add(record); } } catch (PluginException e) { - throw new DecoderException( - "StormTrack WARNING: Unable to construct dataURI--exception: ", - e); + throw new DecoderException( + "StormTrack WARNING: Unable to construct dataURI--exception: ", + e); } } } - + /* * Return StormTrack record object if not null */ diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.tcm/src/gov/noaa/nws/ncep/edex/plugin/tcm/decoder/TcmDecoder.java b/ncep/gov.noaa.nws.ncep.edex.plugin.tcm/src/gov/noaa/nws/ncep/edex/plugin/tcm/decoder/TcmDecoder.java index 7d8df076b7..ae6a67ef24 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.tcm/src/gov/noaa/nws/ncep/edex/plugin/tcm/decoder/TcmDecoder.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.tcm/src/gov/noaa/nws/ncep/edex/plugin/tcm/decoder/TcmDecoder.java @@ -1,24 +1,3 @@ -/* - * - * TcmDecoder - * - * This java class decodes TCM (Tropical Cyclone Message) data. - * - *
 
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    	Engineer    Description
- * ----- 		------- 	--------	-----------
- * 06/2009		128			T. Lee		Creation
- * 07/2009		128			T. Lee		Migrated to TO11
- * 11/2009		128			T. Lee		Migrated to TO11D6
- * 06/2010		128			T. Lee		Migrated to TO11DR11
- * 
- * - * @author T.Lee - * @version 1.0 - */ - package gov.noaa.nws.ncep.edex.plugin.tcm.decoder; import gov.noaa.nws.ncep.common.dataplugin.tcm.TcmRecord; @@ -37,6 +16,26 @@ import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; +/** + * TcmDecoder + * + * This java class decodes TCM (Tropical Cyclone Message) data. + * + *
 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket# Engineer   Description
+ * ------------ ------- ---------- -----------
+ * 06/2009      128     T. Lee     Creation
+ * 07/2009      128     T. Lee     Migrated to TO11
+ * 11/2009      128     T. Lee     Migrated to TO11D6
+ * 06/2010      128     T. Lee     Migrated to TO11DR11
+ * Aug 30, 2013 2298    rjpeter    Make getPluginName abstract
+ * 
+ * + * @author T.Lee + * @version 1.0 + */ public class TcmDecoder extends AbstractDecoder { private static String pluginName; @@ -128,7 +127,6 @@ public class TcmDecoder extends AbstractDecoder { traceId = (String) headers.get("traceId"); } record.setTraceId(traceId); - record.setPluginName(pluginName); record.constructDataURI(); } catch (PluginException e) { @@ -144,4 +142,4 @@ public class TcmDecoder extends AbstractDecoder { } return new PluginDataObject[] { record }; } -} \ No newline at end of file +} diff --git a/ncep/gov.noaa.nws.ncep.edex.plugin.wcp/src/gov/noaa/nws/ncep/edex/plugin/wcp/decoder/WcpDecoder.java b/ncep/gov.noaa.nws.ncep.edex.plugin.wcp/src/gov/noaa/nws/ncep/edex/plugin/wcp/decoder/WcpDecoder.java index 0c0102eab6..91fb6cd608 100644 --- a/ncep/gov.noaa.nws.ncep.edex.plugin.wcp/src/gov/noaa/nws/ncep/edex/plugin/wcp/decoder/WcpDecoder.java +++ b/ncep/gov.noaa.nws.ncep.edex.plugin.wcp/src/gov/noaa/nws/ncep/edex/plugin/wcp/decoder/WcpDecoder.java @@ -1,15 +1,3 @@ -/** - * - * WcpDecoder - * - * Decoder Plug-In for Watch Corner Point WCP. - * - * 12 December 2008 - * - * This code has been developed by the SIB for use in the AWIPS2 system. - * - */ - package gov.noaa.nws.ncep.edex.plugin.wcp.decoder; import gov.noaa.nws.ncep.common.dataplugin.wcp.WcpRecord; @@ -28,28 +16,28 @@ import com.raytheon.uf.common.dataplugin.PluginException; import com.raytheon.uf.edex.decodertools.core.IDecoderConstants; /** - * * WcpDecoder * - * Decoder implementation for WCP Plug-In + * Decoder implementation for WCP Plug-In. + * + * This code has been developed by the SIB for use in the AWIPS2 system. * *
  * SOFTWARE HISTORY
  * 
- * Date       	Ticket#		Engineer	Description
- * ------------	----------	-----------	--------------------------
- * 12Dec2008		37		F. J. Yen	Initial creation
- * 17Apr2009		37		F. J. Yen	Refactored for TO10 and to allow for more unit testing
- * 24Aug2009		37		F. J. Yen	Modified for TO11 migration
- * 10Dec2009		37		F. J. Yen	Modified for To11d6
- * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * 12Dec2008    37         F. J. Yen   Initial creation
+ * 17Apr2009    37         F. J. Yen   Refactored for TO10 and to allow for more
+ *                                     unit testing
+ * 24Aug2009    37         F. J. Yen   Modified for TO11 migration
+ * 10Dec2009    37         F. J. Yen   Modified for To11d6
+ * Aug 30, 2013 2298       rjpeter     Make getPluginName abstract
  * 
* * @author Fee Jing Yen, SIB * @version 1 - * */ - public class WcpDecoder extends AbstractDecoder { // Name of the plugin controlling this decoder. public final String pluginName; @@ -140,7 +128,6 @@ public class WcpDecoder extends AbstractDecoder { if (record != null) { try { record.setTraceId(traceId); - record.setPluginName(pluginName); record.constructDataURI(); } catch (PluginException e) { throw new DecoderException("Unable to construct dataURI", e); diff --git a/ncep/gov.noaa.nws.ncep.edex.uengine/src/gov/noaa/nws/ncep/edex/uengine/tasks/profile/ObservedSoundingQuery.java b/ncep/gov.noaa.nws.ncep.edex.uengine/src/gov/noaa/nws/ncep/edex/uengine/tasks/profile/ObservedSoundingQuery.java index 06ae3e9471..d9a63eb9f8 100644 --- a/ncep/gov.noaa.nws.ncep.edex.uengine/src/gov/noaa/nws/ncep/edex/uengine/tasks/profile/ObservedSoundingQuery.java +++ b/ncep/gov.noaa.nws.ncep.edex.uengine/src/gov/noaa/nws/ncep/edex/uengine/tasks/profile/ObservedSoundingQuery.java @@ -1,40 +1,14 @@ package gov.noaa.nws.ncep.edex.uengine.tasks.profile; -/** - * - * gov.noaa.nws.ncep.edex.uengine.tasks.profile.ObservedSoundingQuery - * - * This java class performs the observed sounding data query functions. - * This code has been developed by the SIB for use in the AWIPS2 system. - * - *
- * SOFTWARE HISTORY
- * 
- * Date         Ticket#    	Engineer    Description
- * -------		------- 	-------- 	-----------
- * 09/13/2010	301			Chin Chen	Initial coding
- * 10/2010		301			T. Lee		Checked missing value
- * 11/05/2010   301         Chin Chen   Update to support uairSnd query to all data types, except ALLDATA  
- * 12/16/2010   301         Chin Chen   add support of BUFRUA observed sounding data
- * 09/14/2011   457         S. Gurung   Renamed h5 to nc
- * 10/20/2011               S. Gurung   Added ncuair changes related to replacing slat/slon/selv with location of type SurfaceObsLocation
- * Nov 2011                 Chin Chen   changed Ncuair table query algorithm for performance improvement
- * 01/05/2012               S. Gurung   Removed references to UAIR (performed cleanup)
- * 02/28/2012               Chin Chen   modify several sounding query algorithms for better performance
- * 
- * - * @author Chin Chen - * @version 1.0 - */ import gov.noaa.nws.ncep.common.dataplugin.ncuair.NcUairRecord; import gov.noaa.nws.ncep.common.dataplugin.ncuair.dao.NcUairToRecord; import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingLayer; import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile; +import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile.ObsSndType; +import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile.SndQueryKeyType; import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingStnInfo; import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingStnInfoCollection; import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingTimeLines; -import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile.ObsSndType; -import gov.noaa.nws.ncep.edex.common.sounding.NcSoundingProfile.SndQueryKeyType; import java.io.File; import java.sql.Timestamp; @@ -49,13 +23,13 @@ import javax.measure.unit.NonSI; import javax.measure.unit.SI; import com.raytheon.edex.plugin.bufrua.dao.BufrUADao; +import com.raytheon.uf.common.dataplugin.bufrua.UAObs; +import com.raytheon.uf.common.dataplugin.bufrua.dao.BufrUAPointDataTransform; import com.raytheon.uf.common.datastorage.DataStoreFactory; import com.raytheon.uf.common.datastorage.IDataStore; import com.raytheon.uf.common.datastorage.Request; import com.raytheon.uf.common.datastorage.records.FloatDataRecord; import com.raytheon.uf.common.datastorage.records.IntegerDataRecord; -import com.raytheon.uf.common.dataplugin.bufrua.UAObs; -import com.raytheon.uf.common.dataplugin.bufrua.dao.BufrUAPointDataTransform; import com.raytheon.uf.common.pointdata.PointDataContainer; import com.raytheon.uf.edex.database.DataAccessLayerException; import com.raytheon.uf.edex.database.dao.CoreDao; @@ -63,1677 +37,1974 @@ import com.raytheon.uf.edex.database.dao.DaoConfig; import com.raytheon.uf.edex.pointdata.PointDataQuery; import com.vividsolutions.jts.geom.Coordinate; +/** + * + * gov.noaa.nws.ncep.edex.uengine.tasks.profile.ObservedSoundingQuery + * + * This java class performs the observed sounding data query functions. + * This code has been developed by the SIB for use in the AWIPS2 system. + * + *
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket# Engineer   Description
+ * ------------ ------- ---------- -----------
+ * Sep 13, 2010 301     Chin Chen  Initial coding
+ * 10/2010      301     T. Lee     Checked missing value
+ * Nov 05, 2010 301     Chin Chen  Update to support uairSnd query to all data
+ *                                 types, except ALLDATA
+ * Dec 16, 2010 301     Chin Chen  add support of BUFRUA observed sounding data
+ * Sep 14, 2011 457     S. Gurung  Renamed h5 to nc
+ * Oct 20, 2011         S. Gurung  Added ncuair changes related to replacing
+ *                                 slat/slon/selv with location of type
+ *                                 SurfaceObsLocation
+ * Nov 2011             Chin Chen  changed Ncuair table query algorithm for
+ *                                 performance improvement
+ * Jan 05, 2012         S. Gurung  Removed references to UAIR (performed
+ *                                 cleanup)
+ * Feb 28, 2012         Chin Chen  modify several sounding query algorithms for
+ *                                 better performance
+ * Jul 19, 2013 1992    bsteffen   Remove redundant time columns from bufrua.
+ * Aug 30, 2013 2298    rjpeter    Make getPluginName abstract
+ * 
+ * + * @author Chin Chen + * @version 1.0 + */ public class ObservedSoundingQuery { - private static final UnitConverter metersPerSecondToKnots = SI.METERS_PER_SECOND.getConverterTo(NonSI.KNOT); - private static final UnitConverter kelvinToCelsius = SI.KELVIN.getConverterTo(SI.CELSIUS); - private static final String NCUAIR_TBL_NAME = "ncuair"; - private static final String BURFUA_TBL_NAME = "bufrua"; - private static String currentDBTblName = "nil"; - - /* - * This method is for caller to get sounding station's info lat/lon/stn id/stn num/elevation - * key: stn's lat/lon or stn ( either stn id or stn num) - */ - @SuppressWarnings("unchecked") - public static NcSoundingProfile getObservedSndStnInfo(Double lat, Double lon,String stn, String obType,Calendar refTimeCal,SndQueryKeyType queryType ) { - NcSoundingProfile pf = new NcSoundingProfile(); - CoreDao dao; - List fields = new ArrayList(); - List values = new ArrayList(); - /*if(obType.equals(ObsSndType.NCUAIR.toString())){ - List operands = new ArrayList(); - List lUairRecords = null; - if(queryType==SndQueryKeyType.STNID){ - fields.add("location.stationId");// the location.stationId field name defined in NcUairRecord - values.add(stn); - operands.add("="); - } - else if(queryType==SndQueryKeyType.STNNUM){ - fields.add("stnum");// the stnNum field name defined in NcUairRecord - values.add(stn); - operands.add("="); - } - else if(queryType==SndQueryKeyType.LATLON){ - fields.add("location.latitude"); // the location.latitude field name defined in NcUairRecord - values.add(lat); - operands.add(">="); - fields.add("location.latitude"); - values.add(lat); - operands.add("<="); - fields.add("location.longitude"); // the location.longitude field name defined in NcUairRecord - values.add(lon); - operands.add(">="); - fields.add("location.longitude"); - values.add(lon); - operands.add("<="); - } - else { - //System.out.println("request query type "+ queryType+ " is not supported in this API" ); - return pf; - } - fields.add("synopticTime");// the synoptic time field name defined in UairRecord - values.add(refTimeCal); - operands.add("="); - dao = new CoreDao(DaoConfig.forClass(NcUairRecord.class)); - try { - lUairRecords = (List) dao.queryByCriteria(fields, values,operands); - System.out.println("Nc uair at lat="+ lat+" lon="+lon+ " recorde size="+lUairRecords.size()); - if(lUairRecords.size() > 0){ - pf.setStationElevation((float)lUairRecords.get(0).getElevation()); - pf.setStationId(lUairRecords.get(0).getStationId()); - if(lUairRecords.get(0).getStnum() != null && lUairRecords.get(0).getStnum().length()>0) - pf.setStationNum(Integer.parseInt(lUairRecords.get(0).getStnum())); - pf.setStationLatitude((float)lUairRecords.get(0).getLatitude()); - pf.setStationLongitude((float)lUairRecords.get(0).getLongitude()); - } - }catch (DataAccessLayerException e) { - //System.out.println("obs sounding query exception"); - e.printStackTrace(); - } - } - else*/ if(obType.equals(ObsSndType.BUFRUA.toString())) { - List lUairRecords = null; - if(queryType==SndQueryKeyType.STNID){ - fields.add("stationName");// the stationName String field name defined in UAObs, dont be confused with UAIRRecord definition - values.add(stn); - } - else if(queryType==SndQueryKeyType.STNNUM){ - fields.add("location.stationId");// the location.stationId String field name defined in UAObs. dont be confused with UAIRRecord definition - values.add(stn); - } - else if(queryType==SndQueryKeyType.LATLON){ - fields.add("location.latitude");// the location.latitude field name defined in UAObs - values.add(lat); - fields.add("location.longitude");// the location.longitude field name defined in UAObs - values.add(lon); + private static final UnitConverter metersPerSecondToKnots = SI.METERS_PER_SECOND + .getConverterTo(NonSI.KNOT); - } - else { - return pf; - } + private static final UnitConverter kelvinToCelsius = SI.KELVIN + .getConverterTo(SI.CELSIUS); + + private static final String NCUAIR_TBL_NAME = "ncuair"; + + private static final String BURFUA_TBL_NAME = "bufrua"; + + private static String currentDBTblName = "nil"; + + /* + * This method is for caller to get sounding station's info lat/lon/stn + * id/stn num/elevation key: stn's lat/lon or stn ( either stn id or stn + * num) + */ + @SuppressWarnings("unchecked") + public static NcSoundingProfile getObservedSndStnInfo(Double lat, + Double lon, String stn, String obType, Calendar refTimeCal, + SndQueryKeyType queryType) { + NcSoundingProfile pf = new NcSoundingProfile(); + CoreDao dao; + List fields = new ArrayList(); + List values = new ArrayList(); + /* + * if(obType.equals(ObsSndType.NCUAIR.toString())){ List + * operands = new ArrayList(); List lUairRecords = + * null; if(queryType==SndQueryKeyType.STNID){ + * fields.add("location.stationId");// the location.stationId field name + * defined in NcUairRecord values.add(stn); operands.add("="); } else + * if(queryType==SndQueryKeyType.STNNUM){ fields.add("stnum");// the + * stnNum field name defined in NcUairRecord values.add(stn); + * operands.add("="); } else if(queryType==SndQueryKeyType.LATLON){ + * fields.add("location.latitude"); // the location.latitude field name + * defined in NcUairRecord values.add(lat); operands.add(">="); + * fields.add("location.latitude"); values.add(lat); operands.add("<="); + * fields.add("location.longitude"); // the location.longitude field + * name defined in NcUairRecord values.add(lon); operands.add(">="); + * fields.add("location.longitude"); values.add(lon); + * operands.add("<="); } else { + * //System.out.println("request query type "+ queryType+ + * " is not supported in this API" ); return pf; } + * fields.add("synopticTime");// the synoptic time field name defined in + * UairRecord values.add(refTimeCal); operands.add("="); dao = new + * CoreDao(DaoConfig.forClass(NcUairRecord.class)); try { lUairRecords = + * (List) dao.queryByCriteria(fields, values,operands); + * System.out.println("Nc uair at lat="+ lat+" lon="+lon+ + * " recorde size="+lUairRecords.size()); if(lUairRecords.size() > 0){ + * pf.setStationElevation((float)lUairRecords.get(0).getElevation()); + * pf.setStationId(lUairRecords.get(0).getStationId()); + * if(lUairRecords.get(0).getStnum() != null && + * lUairRecords.get(0).getStnum().length()>0) + * pf.setStationNum(Integer.parseInt(lUairRecords.get(0).getStnum())); + * pf.setStationLatitude((float)lUairRecords.get(0).getLatitude()); + * pf.setStationLongitude((float)lUairRecords.get(0).getLongitude()); } + * }catch (DataAccessLayerException e) { + * //System.out.println("obs sounding query exception"); + * e.printStackTrace(); } } else + */if (obType.equals(ObsSndType.BUFRUA.toString())) { + List lUairRecords = null; + if (queryType == SndQueryKeyType.STNID) { + fields.add("stationName");// the stationName String field name + // defined in UAObs, dont be confused + // with UAIRRecord definition + values.add(stn); + } else if (queryType == SndQueryKeyType.STNNUM) { + fields.add("location.stationId");// the location.stationId + // String field name defined in + // UAObs. dont be confused with + // UAIRRecord definition + values.add(stn); + } else if (queryType == SndQueryKeyType.LATLON) { + fields.add("location.latitude");// the location.latitude field + // name defined in UAObs + values.add(lat); + fields.add("location.longitude");// the location.longitude field + // name defined in UAObs + values.add(lon); + + } else { + return pf; + } fields.add("validTime");// the synoptic time field name defined in UAObs values.add(refTimeCal); - dao = new CoreDao(DaoConfig.forClass(UAObs.class)); - try { - lUairRecords = (List) dao.queryByCriteria(fields, values); - if(lUairRecords.size() > 0){ - pf.setStationLatitude((float)lUairRecords.get(0).getLatitude()); - pf.setStationLongitude((float)lUairRecords.get(0).getLongitude()); - pf.setStationElevation((float)lUairRecords.get(0).getElevation()); - if(lUairRecords.get(0).getStationId()!=null && lUairRecords.get(0).getStationId().length()>0) - pf.setStationNum(Integer.parseInt(lUairRecords.get(0).getStationId())); - pf.setStationId(lUairRecords.get(0).getStationName()); - pf.setFcsTime(lUairRecords.get(0).getDataTime().getRefTime().getTime()); - } - }catch (DataAccessLayerException e) { - //*System.out.println("obs sounding query exception"); - e.printStackTrace(); - } - } - return pf; - } - public static NcSoundingStnInfoCollection getObservedSndStnInfoCol(String obType, String selectedSndTime) { - NcSoundingStnInfoCollection stnInfoCol = new NcSoundingStnInfoCollection(); - List stationInfoList= new ArrayList(); - String queryStr, queryStr1; - Object [] rtnobjArray, rtnobjArray1; - CoreDao dao; - if(obType.equals(ObsSndType.BUFRUA.toString())){ - currentDBTblName = BURFUA_TBL_NAME; - queryStr = new String("Select Distinct latitude, longitude, id, stationname, elevation, reftime FROM "+ currentDBTblName + " where reftime='" + - selectedSndTime+"' AND latitude BETWEEN -89.9 AND 89.9 AND longitude BETWEEN -179.9 AND 179.9"); - queryStr1 = new String("Select Distinct latitude, longitude FROM "+ currentDBTblName + " where reftime='" + - selectedSndTime+"' AND latitude BETWEEN -89.9 AND 89.9 AND longitude BETWEEN -179.9 AND 179.9"); - dao = new CoreDao(DaoConfig.forClass(UAObs.class)); - - } - else if(obType.equals(ObsSndType.NCUAIR.toString())){ - currentDBTblName = NCUAIR_TBL_NAME; - queryStr = new String("Select Distinct latitude, longitude, id, stationId, elevation, synoptictime FROM "+ currentDBTblName + " where nil='FALSE' AND synoptictime='" + - selectedSndTime+"' AND latitude BETWEEN -89.9 AND 89.9 AND longitude BETWEEN -179.9 AND 179.9"); - queryStr1 = new String("Select Distinct latitude, longitude FROM "+ currentDBTblName + " where nil='FALSE' AND synoptictime='" + - selectedSndTime+"' AND latitude BETWEEN -89.9 AND 89.9 AND longitude BETWEEN -179.9 AND 179.9"); - dao = new CoreDao(DaoConfig.forClass(NcUairRecord.class)); - } - else { - return stnInfoCol; - } - rtnobjArray = dao.executeSQLQuery(queryStr); - - //*System.out.println("size of rtnobjArray " + rtnobjArray.length); - /* - Object[] obj; - for (int i =0; i 0) && (rtnobjArray.length > 0)){ - double lat, lon, elv; - String stnInfo; - - //System.out.println("queryAndMarkStn called mapresource = "+ nsharpMapResource.toString()); - //Note: A same station may have many reports and at some reports they dont provide elv and or stnid - // this implementation is "try" to make sure we get those info. - //If, all reports does not have elv or stnid, then we still can not report it. - for (int i =0; i = '"+ startTimeStr+"' AND synoptictime <= '"+endTimeStr+"' ORDER BY synoptictime DESC"); - dao = new CoreDao(DaoConfig.forClass(NcUairRecord.class)); - } - else{ - return null; - } - synopTimeAry = (Object[]) dao.executeSQLQuery(queryStr); - List timeLst = new ArrayList(); - //*System.out.println("size of synoptictime " + synopTimeAry.length); - - for(int i=0; i < synopTimeAry.length; i++){ - if(synopTimeAry[i] != null){ - System.out.println("synoptictime ="+synopTimeAry[i] ); - Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); - cal.setTimeInMillis(((Timestamp)synopTimeAry[i]).getTime()); - //String gmtTimeStr = String.format("%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS", cal); - timeLst.add(cal); - } - } - - return timeLst; - } - //static long totalRqTime=0; - /* - * Chin: Note: get NcUair based on stn is NOT supported yet!!! - * NEW: This function requests ONE station's all dataTypes data at once - * NSHARP is using this metod...dont remove it without consulting Nsharp developer - * - public static NcUairRecord[] getObservedSndNcUairData(Double lat, Double lon, String stn, String refTime){ - - PointDataQuery request = null; - PointDataContainer result = null; - NcUairRecord[] h5Records=null; - - List pickedH5Records = new ArrayList(); - try { - request = new PointDataQuery("ncuair"); - request.setParameters(NcUairToRecord.MAN_PARAMS_LIST); - request.addParameter("location.latitude", String.valueOf(lat), "="); - request.addParameter("location.longitude", String.valueOf(lon), "="); - - request.addParameter("dataTime.refTime",refTime, "="); - request.addParameter("nil", String.valueOf(false), "="); - //Chin newQ request.addParameter("dataType", dataType, "="); - long t001 = System.currentTimeMillis(); - request.requestAllLevels(); - result = request.execute(); - long t002 = System.currentTimeMillis(); - //totalRqTime=totalRqTime+(t002-t001); - //System.out.println("getObservedSndNcUairData request at lat="+ lat+ " lon="+lon+" took "+(t002-t001)+"ms "); - if (result != null) { - //System.out.println("getObservedSndNcUairData: result is not null, getAllocatedSz= "+ result.getAllocatedSz()); - //System.out.println("getObservedSndNcUairData:getting "+dataType); - h5Records = NcUairToRecord.toNcUairRecords(result); - - if(h5Records!= null && h5Records.length > 0){ - // Chin: need to search through record list and keep one record for each record type - // If a record type comes with more than one record, then make decision to keep one based on - // its "issuetime" and "corr" columns in the ncuair table, then keep one record only - NcUairRecord orignalRd; - boolean addToList = true; - for(int i=0; i< h5Records.length; i++){ - orignalRd = h5Records[i]; - addToList = true; - for(NcUairRecord pickedRd: pickedH5Records){ - if(orignalRd.getDataType().equals( pickedRd.getDataType())){ - //the two records have same data type - //this records will either replace the one in list or be dropped - addToList = false; - if ((pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())<0) || - (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && orignalRd.getCorr()!=null && pickedRd.getCorr() != null && pickedRd.getCorr().compareTo(orignalRd.getCorr())<0 )|| - (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && orignalRd.getCorr()!=null && pickedRd.getCorr() == null) - ) - { - // decide to replace picked with original record, based on the following cases, in (priority) order - //case 1: original record has "later" issue time than picked record - //case 2: original record has "larger" correction "corr" than picked record - //case 3: original record has correction "corr", picked record does not have - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " ori= " + orignalRd.getDataURI()+ - // " picked="+ pickedRd.getDataURI()); - int pickedIndex = pickedH5Records.indexOf(pickedRd); - pickedH5Records.set(pickedIndex, orignalRd); - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " afterreplaced picked record ="+pickedH5Records.get(pickedIndex).getDataURI()); - - } - break; - } - } - if(addToList==true){ - // add this original record to picked list - pickedH5Records.add(orignalRd); - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " add ori to picked record ="+orignalRd.getDataURI()); - - } - } - - } - + dao = new CoreDao(DaoConfig.forClass(UAObs.class)); + try { + lUairRecords = (List) dao + .queryByCriteria(fields, values); + if (lUairRecords.size() > 0) { + pf.setStationLatitude((float) lUairRecords.get(0) + .getLatitude()); + pf.setStationLongitude((float) lUairRecords.get(0) + .getLongitude()); + pf.setStationElevation(lUairRecords.get(0).getElevation()); + if ((lUairRecords.get(0).getStationId() != null) + && (lUairRecords.get(0).getStationId().length() > 0)) { + pf.setStationNum(Integer.parseInt(lUairRecords.get(0) + .getStationId())); + } + pf.setStationId(lUairRecords.get(0).getStationName()); + pf.setFcsTime(lUairRecords.get(0).getDataTime() + .getRefTime().getTime()); + } + } catch (DataAccessLayerException e) { + // *System.out.println("obs sounding query exception"); + e.printStackTrace(); } - } catch (Exception e) { - e.printStackTrace(); } - if(pickedH5Records.size()>0){ - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " number of picked records = "+pickedH5Records.size()); - return pickedH5Records.toArray(new NcUairRecord[pickedH5Records.size()]); + return pf; + } + + public static NcSoundingStnInfoCollection getObservedSndStnInfoCol( + String obType, String selectedSndTime) { + NcSoundingStnInfoCollection stnInfoCol = new NcSoundingStnInfoCollection(); + List stationInfoList = new ArrayList(); + String queryStr, queryStr1; + Object[] rtnobjArray, rtnobjArray1; + CoreDao dao; + if (obType.equals(ObsSndType.BUFRUA.toString())) { + currentDBTblName = BURFUA_TBL_NAME; + queryStr = new String( + "Select Distinct latitude, longitude, id, stationname, elevation, reftime FROM " + + currentDBTblName + + " where reftime='" + + selectedSndTime + + "' AND latitude BETWEEN -89.9 AND 89.9 AND longitude BETWEEN -179.9 AND 179.9"); + queryStr1 = new String( + "Select Distinct latitude, longitude FROM " + + currentDBTblName + + " where reftime='" + + selectedSndTime + + "' AND latitude BETWEEN -89.9 AND 89.9 AND longitude BETWEEN -179.9 AND 179.9"); + dao = new CoreDao(DaoConfig.forClass(UAObs.class)); + + } else if (obType.equals(ObsSndType.NCUAIR.toString())) { + currentDBTblName = NCUAIR_TBL_NAME; + queryStr = new String( + "Select Distinct latitude, longitude, id, stationId, elevation, synoptictime FROM " + + currentDBTblName + + " where nil='FALSE' AND synoptictime='" + + selectedSndTime + + "' AND latitude BETWEEN -89.9 AND 89.9 AND longitude BETWEEN -179.9 AND 179.9"); + queryStr1 = new String( + "Select Distinct latitude, longitude FROM " + + currentDBTblName + + " where nil='FALSE' AND synoptictime='" + + selectedSndTime + + "' AND latitude BETWEEN -89.9 AND 89.9 AND longitude BETWEEN -179.9 AND 179.9"); + dao = new CoreDao(DaoConfig.forClass(NcUairRecord.class)); + } else { + return stnInfoCol; } - return null; - }*/ - /* - * Chin: Note: get NcUair based on stn is NOT supported yet!!! - * NEW: This function requests ALL stn with all dataTypes and returns all good ("corrected")records at once to improve performance - * Need performance improving by using Operand "in" for lat/lon pair, see getObservedSndNcUairDataByLatLonArrayNew() 02/15/2012 Chin - * - public static List getObservedSndNcUairDataByLatLonArray(double[][] latLonArray, String refTime){ - //List soundingProfileList= new ArrayList(); - PointDataQuery request = null; + rtnobjArray = dao.executeSQLQuery(queryStr); + + // *System.out.println("size of rtnobjArray " + rtnobjArray.length); + /* + * Object[] obj; for (int i =0; i 0) && (rtnobjArray.length > 0)) { + double lat, lon, elv; + String stnInfo; + + // System.out.println("queryAndMarkStn called mapresource = "+ + // nsharpMapResource.toString()); + // Note: A same station may have many reports and at some reports + // they dont provide elv and or stnid + // this implementation is "try" to make sure we get those info. + // If, all reports does not have elv or stnid, then we still can not + // report it. + for (Object element : rtnobjArray1) { + Object[] objArray1 = (Object[]) element; + Timestamp synoptictime = null; + stnInfo = ""; + elv = -999; + /* + * if(obType.equals(ObsSndType.NCUAIR.toString())){ lat = + * (Float)objArray1[0]; lon = (Float)objArray1[1]; } else{ + */ + lat = (Double) objArray1[0]; + lon = (Double) objArray1[1]; + // } + // System.out.println("lat = "+ lat +" lon= "+lon+"\n\n"); + for (Object element2 : rtnobjArray) { + Object[] objArray = (Object[]) element2; + if ((obType.equals(ObsSndType.NCUAIR.toString()) + && (lat == (Double) objArray[0]) && (lon == (Double) objArray[1])) + || ((obType.equals(ObsSndType.BUFRUA.toString())) + && (lat == (Double) objArray[0]) && (lon == (Double) objArray[1]))) { + // ids.add(((Integer)objArray[2])); + // System.out.println("id=" + (Integer)objArray[2]); + if (stnInfo == "") { + stnInfo = (String) objArray[3]; + } + if (elv == -999) { + if (obType.equals(ObsSndType.NCUAIR.toString())) { + elv = (Integer) objArray[4]; + } else if (obType.equals(ObsSndType.BUFRUA + .toString())) { + elv = (Integer) objArray[4]; + } + } + synoptictime = (Timestamp) objArray[5]; + } + + } + + NcSoundingStnInfo stn = stnInfoCol.getNewStnInfo(); + stn.setStnId(stnInfo); + stn.setStationLongitude(lon); + stn.setStationLatitude(lat); + stn.setStationElevation((float) elv); + stn.setSynopTime(synoptictime); + stationInfoList.add(stn); + // System.out.println("stn "+ stnInfo + " lon "+ lon + " lat "+ + // lat); + } + } + + NcSoundingStnInfo[] stationInfoAry = new NcSoundingStnInfo[stationInfoList + .size()]; + stnInfoCol.setStationInfo(stationInfoList.toArray(stationInfoAry)); + // *System.out.println("stn size = "+ + // stnInfoCol.getStationInfo().length); + return stnInfoCol; + } + + public static NcSoundingTimeLines getObservedSndTimeLine(String obType) { + Object[] synopTimeAry = null; + NcSoundingTimeLines tl = new NcSoundingTimeLines(); + String queryStr; + CoreDao dao; + if (obType.equals(ObsSndType.BUFRUA.toString())) { + currentDBTblName = BURFUA_TBL_NAME; + queryStr = new String("Select Distinct reftime FROM " + + currentDBTblName + " ORDER BY reftime DESC"); + dao = new CoreDao(DaoConfig.forClass(UAObs.class)); + + } else if (obType.equals(ObsSndType.NCUAIR.toString())) { + currentDBTblName = NCUAIR_TBL_NAME; + queryStr = new String("Select Distinct synoptictime FROM " + + currentDBTblName + + " where nil='FALSE' ORDER BY synoptictime DESC"); + dao = new CoreDao(DaoConfig.forClass(NcUairRecord.class)); + } else { + return tl; + } + synopTimeAry = dao.executeSQLQuery(queryStr); + // System.out.println("size of synoptictime " + synopTimeAry.length); + + // for(int i=0; i < synopTimeAry.length; i++){ + // if(synopTimeAry[i] != null) + // System.out.println("synoptictime ="+synopTimeAry[i] ); + // } + tl.setTimeLines(synopTimeAry); + + return tl; + } + + public static List getObservedSndTimeRangeList(String obType, + Calendar startTime, Calendar endTime) { + Object[] synopTimeAry = null; + String startTimeStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") + .format(startTime.getTime()); + String endTimeStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") + .format(endTime.getTime()); + String queryStr; + CoreDao dao; + if (obType.equals(ObsSndType.BUFRUA.toString())) { + currentDBTblName = BURFUA_TBL_NAME; + queryStr = new String("Select Distinct reftime FROM " + + currentDBTblName + " ORDER BY reftime DESC"); + dao = new CoreDao(DaoConfig.forClass(UAObs.class)); + + } else if (obType.equals(ObsSndType.NCUAIR.toString())) { + currentDBTblName = NCUAIR_TBL_NAME; + queryStr = new String("Select Distinct synoptictime FROM " + + currentDBTblName + + " where nil='FALSE' AND synoptictime >= '" + startTimeStr + + "' AND synoptictime <= '" + endTimeStr + + "' ORDER BY synoptictime DESC"); + dao = new CoreDao(DaoConfig.forClass(NcUairRecord.class)); + } else { + return null; + } + synopTimeAry = dao.executeSQLQuery(queryStr); + List timeLst = new ArrayList(); + // *System.out.println("size of synoptictime " + synopTimeAry.length); + + for (Object element : synopTimeAry) { + if (element != null) { + System.out.println("synoptictime =" + element); + Calendar cal = Calendar + .getInstance(TimeZone.getTimeZone("GMT")); + cal.setTimeInMillis(((Timestamp) element).getTime()); + // String gmtTimeStr = + // String.format("%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS", cal); + timeLst.add(cal); + } + } + + return timeLst; + } + + // static long totalRqTime=0; + /* + * Chin: Note: get NcUair based on stn is NOT supported yet!!! NEW: This + * function requests ONE station's all dataTypes data at once NSHARP is + * using this metod...dont remove it without consulting Nsharp developer + * + * public static NcUairRecord[] getObservedSndNcUairData(Double lat, Double + * lon, String stn, String refTime){ + * + * PointDataQuery request = null; PointDataContainer result = null; + * NcUairRecord[] h5Records=null; + * + * List pickedH5Records = new ArrayList(); try { + * request = new PointDataQuery("ncuair"); + * request.setParameters(NcUairToRecord.MAN_PARAMS_LIST); + * request.addParameter("location.latitude", String.valueOf(lat), "="); + * request.addParameter("location.longitude", String.valueOf(lon), "="); + * + * request.addParameter("dataTime.refTime",refTime, "="); + * request.addParameter("nil", String.valueOf(false), "="); //Chin newQ + * request.addParameter("dataType", dataType, "="); long t001 = + * System.currentTimeMillis(); request.requestAllLevels(); result = + * request.execute(); long t002 = System.currentTimeMillis(); + * //totalRqTime=totalRqTime+(t002-t001); + * //System.out.println("getObservedSndNcUairData request at lat="+ lat+ + * " lon="+lon+" took "+(t002-t001)+"ms "); if (result != null) { + * //System.out + * .println("getObservedSndNcUairData: result is not null, getAllocatedSz= " + * + result.getAllocatedSz()); + * //System.out.println("getObservedSndNcUairData:getting "+dataType); + * h5Records = NcUairToRecord.toNcUairRecords(result); + * + * if(h5Records!= null && h5Records.length > 0){ // Chin: need to search + * through record list and keep one record for each record type // If a + * record type comes with more than one record, then make decision to keep + * one based on // its "issuetime" and "corr" columns in the ncuair table, + * then keep one record only NcUairRecord orignalRd; boolean addToList = + * true; for(int i=0; i< h5Records.length; i++){ orignalRd = h5Records[i]; + * addToList = true; for(NcUairRecord pickedRd: pickedH5Records){ + * if(orignalRd.getDataType().equals( pickedRd.getDataType())){ //the two + * records have same data type //this records will either replace the one in + * list or be dropped addToList = false; if + * ((pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())<0) || + * (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && + * orignalRd.getCorr()!=null && pickedRd.getCorr() != null && + * pickedRd.getCorr().compareTo(orignalRd.getCorr())<0 )|| + * (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && + * orignalRd.getCorr()!=null && pickedRd.getCorr() == null) ) { // decide to + * replace picked with original record, based on the following cases, in + * (priority) order //case 1: original record has "later" issue time than + * picked record //case 2: original record has "larger" correction "corr" + * than picked record //case 3: original record has correction "corr", + * picked record does not have + * //System.out.println("getObservedSndNcUairData: at lat="+ lat+ + * " lon="+lon+ " ori= " + orignalRd.getDataURI()+ // " picked="+ + * pickedRd.getDataURI()); int pickedIndex = + * pickedH5Records.indexOf(pickedRd); pickedH5Records.set(pickedIndex, + * orignalRd); //System.out.println("getObservedSndNcUairData: at lat="+ + * lat+ " lon="+lon+ + * " afterreplaced picked record ="+pickedH5Records.get(pickedIndex + * ).getDataURI()); + * + * } break; } } if(addToList==true){ // add this original record to picked + * list pickedH5Records.add(orignalRd); + * //System.out.println("getObservedSndNcUairData: at lat="+ lat+ + * " lon="+lon+ " add ori to picked record ="+orignalRd.getDataURI()); + * + * } } + * + * } + * + * } } catch (Exception e) { e.printStackTrace(); } + * if(pickedH5Records.size()>0){ + * //System.out.println("getObservedSndNcUairData: at lat="+ lat+ + * " lon="+lon+ " number of picked records = "+pickedH5Records.size()); + * return pickedH5Records.toArray(new NcUairRecord[pickedH5Records.size()]); + * } return null; } + */ + /* + * Chin: Note: get NcUair based on stn is NOT supported yet!!! NEW: This + * function requests ALL stn with all dataTypes and returns all good + * ("corrected")records at once to improve performance Need performance + * improving by using Operand "in" for lat/lon pair, see + * getObservedSndNcUairDataByLatLonArrayNew() 02/15/2012 Chin + * + * public static List + * getObservedSndNcUairDataByLatLonArray(double[][] latLonArray, String + * refTime){ //List soundingProfileList= new + * ArrayList(); PointDataQuery request = null; + * PointDataContainer result = null; //NcUairRecord[] h5Records=null; Double + * maxLat, minLat, maxLon, minLon, lat, lon; List + * returnedDbRecords = new ArrayList(); List + * finalRecordArrayList = new ArrayList(); + * maxLat=minLat=0.0; maxLon=minLon=0.0; for ( int i=0; i < + * latLonArray.length ; i++) { + * + * //make sure we have right precision... lat = latLonArray[i][0]; lon = + * latLonArray[i][1]; //latLonStr = latLonStr+ if(i==0){ maxLat=minLat=lat; + * maxLon=minLon=lon; } maxLat = Math.max(lat, maxLat); minLat = + * Math.min(lat, minLat); maxLon = Math.max(lon, maxLon); minLon = + * Math.min(lon, minLon); } try { request = new PointDataQuery("ncuair"); + * request.setParameters(NcUairToRecord.MAN_PARAMS_LIST); + * + * request.addParameter("location.latitude", String.valueOf(minLat-0.1), + * ">="); request.addParameter("location.latitude", + * String.valueOf(maxLat+0.1), "<="); + * request.addParameter("location.longitude", String.valueOf(minLon-0.1), + * ">="); request.addParameter("location.longitude", + * String.valueOf(maxLon+0.1), "<="); + * request.addParameter("dataTime.refTime",refTime, "="); + * request.addParameter("nil", String.valueOf(false), "="); + * request.requestAllLevels(); result = request.execute(); //long t002 = + * System.currentTimeMillis(); //totalRqTime=totalRqTime+(t002-t001); + * //System.out.println("getObservedSndNcUairData request at lat="+ lat+ + * " lon="+lon+" took "+(t002-t001)+"ms total Qtime="+totalRqTime); if + * (result != null) { returnedDbRecords = + * NcUairToRecord.toNcUairRecordsList(result); + * + * if(returnedDbRecords!= null && returnedDbRecords.size() > 0){ + * + * //Chin: keep list of records for same station //search through all + * returned records and keep same staion's records in one list for ( int + * i=0; i < latLonArray.length ; i++) { //for each station lat = + * latLonArray[i][0]; lon = latLonArray[i][1]; NcUairRecord record; + * List stnRecords = new ArrayList(); + * //System.out + * .println("Before loop: Number of records in returnedDbRecords=" + * +returnedDbRecords.size()); for(int j=returnedDbRecords.size()-1; j >=0; + * j--){ record =returnedDbRecords.get(j); if(record.getLatitude() >= lat - + * 0.1 && record.getLatitude() <= lat + 0.1 && record.getLongitude() >= + * lon-0.1&& record.getLongitude() <= lon+0.1){ //remove this record from + * return list and add it to this stn list + * stnRecords.add(returnedDbRecords.remove(j)); } } if(stnRecords.size()>0){ + * //System.out.println("Before checking:stn lat="+lat + * +"stn record size="+stnRecords.size()); List + * pickedUairRecords = new ArrayList(); NcUairRecord + * orignalRd; boolean addToList = true; for(int ii=0; ii< stnRecords.size(); + * ii++){ orignalRd = stnRecords.get(ii); addToList = true; for(NcUairRecord + * pickedRd: pickedUairRecords){ if(orignalRd.getDataType().equals( + * pickedRd.getDataType())){ + * //System.out.println("getObservedSndNcUairData: at lat="+ lat+ + * " lon="+lon+ " find a same datatype="+pickedRd.getDataType()+ + * " orignalRd corr="+orignalRd.getCorr()+ // + * " pickedRd Corr="+pickedRd.getCorr()); + * + * //the two records have same data type //this records will either replace + * the one in list or be dropped addToList = false; if + * ((pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())<0) || + * (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && + * orignalRd.getCorr()!=null && pickedRd.getCorr() != null && + * pickedRd.getCorr().compareTo(orignalRd.getCorr())<0 )|| + * (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && + * orignalRd.getCorr()!=null && pickedRd.getCorr() == null) ) { // decide to + * replace picked with original record, based on the following cases, in + * (priority) order //case 1: original record has "later" issue time than + * picked record //case 2: original record has "larger" correction "corr" + * than picked record //case 3: original record has correction "corr", + * picked record does not have + * //System.out.println("getObservedSndNcUairData: at lat="+ lat+ + * " lon="+lon+ " ori= " + orignalRd.getDataURI()+ // " picked="+ + * pickedRd.getDataURI()); int pickedIndex = + * pickedUairRecords.indexOf(pickedRd); pickedUairRecords.set(pickedIndex, + * orignalRd); //System.out.println("getObservedSndNcUairData: at lat="+ + * lat+ " lon="+lon+ + * " afterreplaced picked record ="+pickedH5Records.get(pickedIndex + * ).getDataURI()); } break; } } if(addToList==true){ // add this original + * record to picked list pickedUairRecords.add(orignalRd); + * //System.out.println("getObservedSndNcUairData: at lat="+ lat+ + * " lon="+lon+ " add ori to picked record ="+orignalRd.getDataURI()); + * + * } } //pickedUairRecords.get(0).setNil(false); // set for special handling + * for its caller finalRecordArrayList.add(pickedUairRecords.toArray(new + * NcUairRecord[pickedUairRecords.size()])); + * //System.out.println("After checking: stn record size=" + * +pickedUairRecords.size()); }//Chin: If caller need all query stns + * returned (no matter there is no data), then we may need to add this + * code... else { //just add a null record array NcUairRecord dummy = new + * NcUairRecord(); dummy.setNil(true);// set for special handling for its + * caller SurfaceObsLocation location = new SurfaceObsLocation(); + * location.setLatitude(lat); location.setLongitude(lon); + * dummy.setLocation(location); + * + * NcUairRecord[] dummys= new NcUairRecord[1]; dummys[0] = dummy; + * finalRecordArrayList.add(dummys); }// } } } } catch (Exception e) { + * e.printStackTrace(); } return finalRecordArrayList; } + */ + /* + * Chin: Note: get NcUair based on stn is NOT supported yet!!! NEW: This + * function requests ALL stn with all dataTypes and returns all good + * ("corrected")records at once to improve performance Performance improved + * by using Operand "in" for lat/lon pair. 02/16/2012 Chin + * + * public static List + * getObservedSndNcUairDataByLatLonArrayNew(double[][] latLonArray, String + * refTime){ //List soundingProfileList= new + * ArrayList(); PointDataQuery request = null; + * PointDataContainer result = null; //NcUairRecord[] h5Records=null; Double + * lat, lon; List returnedDbRecords = new + * ArrayList(); List finalRecordArrayList = + * new ArrayList(); String latStr="", lonStr=""; for ( int + * i=0; i < latLonArray.length ; i++) { latStr = + * latStr+String.valueOf(latLonArray[i][0])+","; lonStr = + * lonStr+String.valueOf(latLonArray[i][1])+","; } + * latStr=latStr.substring(0, latStr.length()-1);//get rid of last "," + * lonStr=lonStr.substring(0, lonStr.length()-1);//get rid of last "," try { + * request = new PointDataQuery("ncuair"); + * request.setParameters(NcUairToRecord.MAN_PARAMS_LIST); + * + * request.addParameter("location.latitude",latStr, "in"); + * request.addParameter("location.longitude", lonStr, "in"); + * request.addParameter("dataTime.refTime",refTime, "="); + * request.addParameter("nil", String.valueOf(false), "="); + * request.requestAllLevels(); result = request.execute(); //long t002 = + * System.currentTimeMillis(); //totalRqTime=totalRqTime+(t002-t001); + * //System.out.println("getObservedSndNcUairData request at lat="+ lat+ + * " lon="+lon+" took "+(t002-t001)+"ms total Qtime="+totalRqTime); if + * (result != null) { returnedDbRecords = + * NcUairToRecord.toNcUairRecordsList(result); + * + * if(returnedDbRecords!= null && returnedDbRecords.size() > 0){ + * System.out.println + * ("Before loop: Number of records in returnedDbRecords="+ + * returnedDbRecords.size()); //Chin: keep list of records for same station + * //search through all returned records and keep same staion's records in + * one list for ( int i=0; i < latLonArray.length ; i++) { //for each + * station lat = latLonArray[i][0]; lon = latLonArray[i][1]; NcUairRecord + * record; List stnRecords = new ArrayList(); + * + * for(int j=returnedDbRecords.size()-1; j >=0; j--){ record + * =returnedDbRecords.get(j); if(record.getLatitude() >= lat - 0.1 && + * record.getLatitude() <= lat + 0.1 && record.getLongitude() >= lon-0.1&& + * record.getLongitude() <= lon+0.1){ //remove this record from return list + * and add it to this stn list stnRecords.add(returnedDbRecords.remove(j)); + * } } if(stnRecords.size()>0){ + * //System.out.println("Before checking:stn lat="+lat + * +"stn record size="+stnRecords.size()); List + * pickedUairRecords = new ArrayList(); NcUairRecord + * orignalRd; boolean addToList = true; for(int ii=0; ii< stnRecords.size(); + * ii++){ orignalRd = stnRecords.get(ii); addToList = true; for(NcUairRecord + * pickedRd: pickedUairRecords){ if(orignalRd.getDataType().equals( + * pickedRd.getDataType())){ + * //System.out.println("getObservedSndNcUairData: at lat="+ lat+ + * " lon="+lon+ " find a same datatype="+pickedRd.getDataType()+ + * " orignalRd corr="+orignalRd.getCorr()+ // + * " pickedRd Corr="+pickedRd.getCorr()); + * + * //the two records have same data type //this records will either replace + * the one in list or be dropped addToList = false; if + * ((pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())<0) || + * (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && + * orignalRd.getCorr()!=null && pickedRd.getCorr() != null && + * pickedRd.getCorr().compareTo(orignalRd.getCorr())<0 )|| + * (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && + * orignalRd.getCorr()!=null && pickedRd.getCorr() == null) ) { // decide to + * replace picked with original record, based on the following cases, in + * (priority) order //case 1: original record has "later" issue time than + * picked record //case 2: original record has "larger" correction "corr" + * than picked record //case 3: original record has correction "corr", + * picked record does not have + * //System.out.println("getObservedSndNcUairData: at lat="+ lat+ + * " lon="+lon+ " ori= " + orignalRd.getDataURI()+ // " picked="+ + * pickedRd.getDataURI()); int pickedIndex = + * pickedUairRecords.indexOf(pickedRd); pickedUairRecords.set(pickedIndex, + * orignalRd); //System.out.println("getObservedSndNcUairData: at lat="+ + * lat+ " lon="+lon+ + * " afterreplaced picked record ="+pickedH5Records.get(pickedIndex + * ).getDataURI()); } break; } } if(addToList==true){ // add this original + * record to picked list pickedUairRecords.add(orignalRd); + * //System.out.println("getObservedSndNcUairData: at lat="+ lat+ + * " lon="+lon+ " add ori to picked record ="+orignalRd.getDataURI()); + * + * } } //pickedUairRecords.get(0).setNil(false); // set for special handling + * for its caller finalRecordArrayList.add(pickedUairRecords.toArray(new + * NcUairRecord[pickedUairRecords.size()])); + * //System.out.println("After checking: stn record size=" + * +pickedUairRecords.size()); } } } } } catch (Exception e) { + * e.printStackTrace(); } + * System.out.println(" Number of records in finalRecordArrayList=" + * +finalRecordArrayList.size()); return finalRecordArrayList; } + */ + /* + * Chin: Note: NEW: This function requests ALL stn with all dataTypes and + * returns all good ("corrected")records at once to improve performance + * Performance improved by using Operand "in" for stnId list. 02/16/2012 + * Chin + * + * public static List + * getObservedSndNcUairDataByStnIdArray(String[] stnIdArray, String + * refTime){ //List soundingProfileList= new + * ArrayList(); PointDataQuery request = null; + * PointDataContainer result = null; //NcUairRecord[] h5Records=null; String + * stnStr; List returnedDbRecords = new + * ArrayList(); List finalRecordArrayList = + * new ArrayList(); String stnIdListStr=""; for ( int i=0; i + * < stnIdArray.length ; i++) { + * + * if(i < stnIdArray.length -1){ stnIdListStr = + * stnIdListStr+stnIdArray[i]+","; } } try { request = new + * PointDataQuery("ncuair"); + * request.setParameters(NcUairToRecord.MAN_PARAMS_LIST); + * + * request.addParameter("location.stationId",stnIdListStr, "in"); + * request.addParameter("dataTime.refTime",refTime, "="); + * request.addParameter("nil", String.valueOf(false), "="); + * request.requestAllLevels(); long t001 = System.currentTimeMillis(); + * result = request.execute(); long t002 = System.currentTimeMillis(); + * //totalRqTime=totalRqTime+(t002-t001); + * System.out.println("getObservedSndNcUairDataByStnIdArray request stn size=" + * + stnIdArray.length+ " took "+(t002-t001)+"ms"); + * + * if (result != null) { long t003 = System.currentTimeMillis(); + * returnedDbRecords = NcUairToRecord.toNcUairRecordsList(result); + * + * if(returnedDbRecords!= null && returnedDbRecords.size() > 0){ + * System.out.println( + * "getObservedSndNcUairDataByStnIdArray Before loop: Number of records in returnedDbRecords=" + * +returnedDbRecords.size()); //Chin: keep list of records for same station + * //search through all returned records and keep same staion's records in + * one list for ( int i=0; i < stnIdArray.length ; i++) { //for each station + * stnStr = stnIdArray[i]; NcUairRecord record; List + * stnRecords = new ArrayList(); + * + * for(int j=returnedDbRecords.size()-1; j >=0; j--){ record + * =returnedDbRecords.get(j); + * //System.out.println("requesting stn="+stnStr+" returned rd stnId=" + * +record.getStationId()+ " stnNum="+record.getStnum()); + * if(stnStr.equals(record.getStationId())){ //remove this record from + * return list and add it to this stn list + * stnRecords.add(returnedDbRecords.remove(j)); } } if(stnRecords.size()>0){ + * //System.out.println("Before checking:stn lat="+lat + * +"stn record size="+stnRecords.size()); List + * pickedUairRecords = new ArrayList(); NcUairRecord + * orignalRd; boolean addToList = true; for(int ii=0; ii< stnRecords.size(); + * ii++){ orignalRd = stnRecords.get(ii); addToList = true; for(NcUairRecord + * pickedRd: pickedUairRecords){ if(orignalRd.getDataType().equals( + * pickedRd.getDataType())){ + * //System.out.println("getObservedSndNcUairData: at lat="+ lat+ + * " lon="+lon+ " find a same datatype="+pickedRd.getDataType()+ + * " orignalRd corr="+orignalRd.getCorr()+ // + * " pickedRd Corr="+pickedRd.getCorr()); + * + * //the two records have same data type //this records will either replace + * the one in list or be dropped addToList = false; if + * ((pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())<0) || + * (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && + * orignalRd.getCorr()!=null && pickedRd.getCorr() != null && + * pickedRd.getCorr().compareTo(orignalRd.getCorr())<0 )|| + * (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && + * orignalRd.getCorr()!=null && pickedRd.getCorr() == null) ) { // decide to + * replace picked with original record, based on the following cases, in + * (priority) order //case 1: original record has "later" issue time than + * picked record //case 2: original record has "larger" correction "corr" + * than picked record //case 3: original record has correction "corr", + * picked record does not have + * //System.out.println("getObservedSndNcUairData: at lat="+ lat+ + * " lon="+lon+ " ori= " + orignalRd.getDataURI()+ // " picked="+ + * pickedRd.getDataURI()); int pickedIndex = + * pickedUairRecords.indexOf(pickedRd); pickedUairRecords.set(pickedIndex, + * orignalRd); //System.out.println("getObservedSndNcUairData: at lat="+ + * lat+ " lon="+lon+ + * " afterreplaced picked record ="+pickedH5Records.get(pickedIndex + * ).getDataURI()); } break; } } if(addToList==true){ // add this original + * record to picked list pickedUairRecords.add(orignalRd); + * //System.out.println("getObservedSndNcUairData: at lat="+ lat+ + * " lon="+lon+ " add ori to picked record ="+orignalRd.getDataURI()); + * + * } } //pickedUairRecords.get(0).setNil(false); // set for special handling + * for its caller finalRecordArrayList.add(pickedUairRecords.toArray(new + * NcUairRecord[pickedUairRecords.size()])); + * //System.out.println("After checking: stn record size=" + * +pickedUairRecords.size()); } } + * + * } long t004 = System.currentTimeMillis(); + * System.out.println(" sorting return records took "+(t004-t003)+"ms"); } } + * catch (Exception e) { e.printStackTrace(); } + * + * System.out.println( + * "getObservedSndNcUairDataByStnIdArray Number of records in finalRecordArrayList=" + * +finalRecordArrayList.size()); return finalRecordArrayList; } + */ + /* + * Chin: 2/21/2012 Using Lat/lon array OR StnId array, AND soundingTimeAry + * (fcst time array) as input. This function is to be generic for all cases. + * One and only one of latLonArray and stnIdArr should be not null and the + * other one should be null soundingTimeAry is a list of refer time (in + * Bufrua, only use refer time for query) should be not null Chin's note: + * NOT completed yet................. + */ + public static List getObservedSndBufruaDataGeneric( + Coordinate[] coordArray, String[] stnIdArray, + List soundingTimeStrList, long[] soundTimeLongArr) { + // List soundingProfileList= new + // ArrayList(); + PointDataQuery request = null; PointDataContainer result = null; - //NcUairRecord[] h5Records=null; - Double maxLat, minLat, maxLon, minLon, lat, lon; - List returnedDbRecords = new ArrayList(); - List finalRecordArrayList = new ArrayList(); - maxLat=minLat=0.0; - maxLon=minLon=0.0; - for ( int i=0; i < latLonArray.length ; i++) - { - - //make sure we have right precision... - lat = latLonArray[i][0]; - lon = latLonArray[i][1]; - //latLonStr = latLonStr+ - if(i==0){ - maxLat=minLat=lat; - maxLon=minLon=lon; - } - maxLat = Math.max(lat, maxLat); - minLat = Math.min(lat, minLat); - maxLon = Math.max(lon, maxLon); - minLon = Math.min(lon, minLon); - } - try { - request = new PointDataQuery("ncuair"); - request.setParameters(NcUairToRecord.MAN_PARAMS_LIST); - - request.addParameter("location.latitude", String.valueOf(minLat-0.1), ">="); - request.addParameter("location.latitude", String.valueOf(maxLat+0.1), "<="); - request.addParameter("location.longitude", String.valueOf(minLon-0.1), ">="); - request.addParameter("location.longitude", String.valueOf(maxLon+0.1), "<="); - request.addParameter("dataTime.refTime",refTime, "="); - request.addParameter("nil", String.valueOf(false), "="); - request.requestAllLevels(); - result = request.execute(); - //long t002 = System.currentTimeMillis(); - //totalRqTime=totalRqTime+(t002-t001); - //System.out.println("getObservedSndNcUairData request at lat="+ lat+ " lon="+lon+" took "+(t002-t001)+"ms total Qtime="+totalRqTime); - if (result != null) { - returnedDbRecords = NcUairToRecord.toNcUairRecordsList(result); - - if(returnedDbRecords!= null && returnedDbRecords.size() > 0){ - - //Chin: keep list of records for same station - //search through all returned records and keep same staion's records in one list - for ( int i=0; i < latLonArray.length ; i++) - { - //for each station - lat = latLonArray[i][0]; - lon = latLonArray[i][1]; - NcUairRecord record; - List stnRecords = new ArrayList(); - //System.out.println("Before loop: Number of records in returnedDbRecords="+returnedDbRecords.size()); - for(int j=returnedDbRecords.size()-1; j >=0; j--){ - record =returnedDbRecords.get(j); - if(record.getLatitude() >= lat - 0.1 && record.getLatitude() <= lat + 0.1 && record.getLongitude() >= lon-0.1&& record.getLongitude() <= lon+0.1){ - //remove this record from return list and add it to this stn list - stnRecords.add(returnedDbRecords.remove(j)); - } - } - if(stnRecords.size()>0){ - //System.out.println("Before checking:stn lat="+lat +"stn record size="+stnRecords.size()); - List pickedUairRecords = new ArrayList(); - NcUairRecord orignalRd; - boolean addToList = true; - for(int ii=0; ii< stnRecords.size(); ii++){ - orignalRd = stnRecords.get(ii); - addToList = true; - for(NcUairRecord pickedRd: pickedUairRecords){ - if(orignalRd.getDataType().equals( pickedRd.getDataType())){ - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " find a same datatype="+pickedRd.getDataType()+ " orignalRd corr="+orignalRd.getCorr()+ - // " pickedRd Corr="+pickedRd.getCorr()); - - //the two records have same data type - //this records will either replace the one in list or be dropped - addToList = false; - if ((pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())<0) || - (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && orignalRd.getCorr()!=null && pickedRd.getCorr() != null && pickedRd.getCorr().compareTo(orignalRd.getCorr())<0 )|| - (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && orignalRd.getCorr()!=null && pickedRd.getCorr() == null) - ) - { - // decide to replace picked with original record, based on the following cases, in (priority) order - //case 1: original record has "later" issue time than picked record - //case 2: original record has "larger" correction "corr" than picked record - //case 3: original record has correction "corr", picked record does not have - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " ori= " + orignalRd.getDataURI()+ - // " picked="+ pickedRd.getDataURI()); - int pickedIndex = pickedUairRecords.indexOf(pickedRd); - pickedUairRecords.set(pickedIndex, orignalRd); - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " afterreplaced picked record ="+pickedH5Records.get(pickedIndex).getDataURI()); - } - break; - } - } - if(addToList==true){ - // add this original record to picked list - pickedUairRecords.add(orignalRd); - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " add ori to picked record ="+orignalRd.getDataURI()); - - } - } - //pickedUairRecords.get(0).setNil(false); // set for special handling for its caller - finalRecordArrayList.add(pickedUairRecords.toArray(new NcUairRecord[pickedUairRecords.size()])); - //System.out.println("After checking: stn record size="+pickedUairRecords.size()); - }//Chin: If caller need all query stns returned (no matter there is no data), then we may need to add this code... - else { - //just add a null record array - NcUairRecord dummy = new NcUairRecord(); - dummy.setNil(true);// set for special handling for its caller - SurfaceObsLocation location = new SurfaceObsLocation(); - location.setLatitude(lat); - location.setLongitude(lon); - dummy.setLocation(location); - - NcUairRecord[] dummys= new NcUairRecord[1]; - dummys[0] = dummy; - finalRecordArrayList.add(dummys); - }// - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return finalRecordArrayList; - }*/ - /* - * Chin: Note: get NcUair based on stn is NOT supported yet!!! - * NEW: This function requests ALL stn with all dataTypes and returns all good ("corrected")records at once to improve performance - * Performance improved by using Operand "in" for lat/lon pair. 02/16/2012 Chin - * - public static List getObservedSndNcUairDataByLatLonArrayNew(double[][] latLonArray, String refTime){ - //List soundingProfileList= new ArrayList(); - PointDataQuery request = null; - PointDataContainer result = null; - //NcUairRecord[] h5Records=null; - Double lat, lon; - List returnedDbRecords = new ArrayList(); - List finalRecordArrayList = new ArrayList(); - String latStr="", lonStr=""; - for ( int i=0; i < latLonArray.length ; i++) - { - latStr = latStr+String.valueOf(latLonArray[i][0])+","; - lonStr = lonStr+String.valueOf(latLonArray[i][1])+","; - } - latStr=latStr.substring(0, latStr.length()-1);//get rid of last "," - lonStr=lonStr.substring(0, lonStr.length()-1);//get rid of last "," - try { - request = new PointDataQuery("ncuair"); - request.setParameters(NcUairToRecord.MAN_PARAMS_LIST); - - request.addParameter("location.latitude",latStr, "in"); - request.addParameter("location.longitude", lonStr, "in"); - request.addParameter("dataTime.refTime",refTime, "="); - request.addParameter("nil", String.valueOf(false), "="); - request.requestAllLevels(); - result = request.execute(); - //long t002 = System.currentTimeMillis(); - //totalRqTime=totalRqTime+(t002-t001); - //System.out.println("getObservedSndNcUairData request at lat="+ lat+ " lon="+lon+" took "+(t002-t001)+"ms total Qtime="+totalRqTime); - if (result != null) { - returnedDbRecords = NcUairToRecord.toNcUairRecordsList(result); - - if(returnedDbRecords!= null && returnedDbRecords.size() > 0){ - System.out.println("Before loop: Number of records in returnedDbRecords="+returnedDbRecords.size()); - //Chin: keep list of records for same station - //search through all returned records and keep same staion's records in one list - for ( int i=0; i < latLonArray.length ; i++) - { - //for each station - lat = latLonArray[i][0]; - lon = latLonArray[i][1]; - NcUairRecord record; - List stnRecords = new ArrayList(); - - for(int j=returnedDbRecords.size()-1; j >=0; j--){ - record =returnedDbRecords.get(j); - if(record.getLatitude() >= lat - 0.1 && record.getLatitude() <= lat + 0.1 && record.getLongitude() >= lon-0.1&& record.getLongitude() <= lon+0.1){ - //remove this record from return list and add it to this stn list - stnRecords.add(returnedDbRecords.remove(j)); - } - } - if(stnRecords.size()>0){ - //System.out.println("Before checking:stn lat="+lat +"stn record size="+stnRecords.size()); - List pickedUairRecords = new ArrayList(); - NcUairRecord orignalRd; - boolean addToList = true; - for(int ii=0; ii< stnRecords.size(); ii++){ - orignalRd = stnRecords.get(ii); - addToList = true; - for(NcUairRecord pickedRd: pickedUairRecords){ - if(orignalRd.getDataType().equals( pickedRd.getDataType())){ - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " find a same datatype="+pickedRd.getDataType()+ " orignalRd corr="+orignalRd.getCorr()+ - // " pickedRd Corr="+pickedRd.getCorr()); - - //the two records have same data type - //this records will either replace the one in list or be dropped - addToList = false; - if ((pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())<0) || - (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && orignalRd.getCorr()!=null && pickedRd.getCorr() != null && pickedRd.getCorr().compareTo(orignalRd.getCorr())<0 )|| - (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && orignalRd.getCorr()!=null && pickedRd.getCorr() == null) - ) - { - // decide to replace picked with original record, based on the following cases, in (priority) order - //case 1: original record has "later" issue time than picked record - //case 2: original record has "larger" correction "corr" than picked record - //case 3: original record has correction "corr", picked record does not have - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " ori= " + orignalRd.getDataURI()+ - // " picked="+ pickedRd.getDataURI()); - int pickedIndex = pickedUairRecords.indexOf(pickedRd); - pickedUairRecords.set(pickedIndex, orignalRd); - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " afterreplaced picked record ="+pickedH5Records.get(pickedIndex).getDataURI()); - } - break; - } - } - if(addToList==true){ - // add this original record to picked list - pickedUairRecords.add(orignalRd); - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " add ori to picked record ="+orignalRd.getDataURI()); - - } - } - //pickedUairRecords.get(0).setNil(false); // set for special handling for its caller - finalRecordArrayList.add(pickedUairRecords.toArray(new NcUairRecord[pickedUairRecords.size()])); - //System.out.println("After checking: stn record size="+pickedUairRecords.size()); - } - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } - System.out.println(" Number of records in finalRecordArrayList="+finalRecordArrayList.size()); - return finalRecordArrayList; - }*/ - /* - * Chin: Note: - * NEW: This function requests ALL stn with all dataTypes and returns all good ("corrected")records at once to improve performance - * Performance improved by using Operand "in" for stnId list. 02/16/2012 Chin - * - public static List getObservedSndNcUairDataByStnIdArray(String[] stnIdArray, String refTime){ - //List soundingProfileList= new ArrayList(); - PointDataQuery request = null; - PointDataContainer result = null; - //NcUairRecord[] h5Records=null; - String stnStr; - List returnedDbRecords = new ArrayList(); - List finalRecordArrayList = new ArrayList(); - String stnIdListStr=""; - for ( int i=0; i < stnIdArray.length ; i++) - { - - if(i < stnIdArray.length -1){ - stnIdListStr = stnIdListStr+stnIdArray[i]+","; - } - } - try { - request = new PointDataQuery("ncuair"); - request.setParameters(NcUairToRecord.MAN_PARAMS_LIST); - - request.addParameter("location.stationId",stnIdListStr, "in"); - request.addParameter("dataTime.refTime",refTime, "="); - request.addParameter("nil", String.valueOf(false), "="); - request.requestAllLevels(); - long t001 = System.currentTimeMillis(); - result = request.execute(); - long t002 = System.currentTimeMillis(); - //totalRqTime=totalRqTime+(t002-t001); - System.out.println("getObservedSndNcUairDataByStnIdArray request stn size="+ stnIdArray.length+ " took "+(t002-t001)+"ms"); - - if (result != null) { - long t003 = System.currentTimeMillis(); - returnedDbRecords = NcUairToRecord.toNcUairRecordsList(result); - - if(returnedDbRecords!= null && returnedDbRecords.size() > 0){ - System.out.println("getObservedSndNcUairDataByStnIdArray Before loop: Number of records in returnedDbRecords="+returnedDbRecords.size()); - //Chin: keep list of records for same station - //search through all returned records and keep same staion's records in one list - for ( int i=0; i < stnIdArray.length ; i++) - { - //for each station - stnStr = stnIdArray[i]; - NcUairRecord record; - List stnRecords = new ArrayList(); - - for(int j=returnedDbRecords.size()-1; j >=0; j--){ - record =returnedDbRecords.get(j); - //System.out.println("requesting stn="+stnStr+" returned rd stnId="+record.getStationId()+ " stnNum="+record.getStnum()); - if(stnStr.equals(record.getStationId())){ - //remove this record from return list and add it to this stn list - stnRecords.add(returnedDbRecords.remove(j)); - } - } - if(stnRecords.size()>0){ - //System.out.println("Before checking:stn lat="+lat +"stn record size="+stnRecords.size()); - List pickedUairRecords = new ArrayList(); - NcUairRecord orignalRd; - boolean addToList = true; - for(int ii=0; ii< stnRecords.size(); ii++){ - orignalRd = stnRecords.get(ii); - addToList = true; - for(NcUairRecord pickedRd: pickedUairRecords){ - if(orignalRd.getDataType().equals( pickedRd.getDataType())){ - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " find a same datatype="+pickedRd.getDataType()+ " orignalRd corr="+orignalRd.getCorr()+ - // " pickedRd Corr="+pickedRd.getCorr()); - - //the two records have same data type - //this records will either replace the one in list or be dropped - addToList = false; - if ((pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())<0) || - (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && orignalRd.getCorr()!=null && pickedRd.getCorr() != null && pickedRd.getCorr().compareTo(orignalRd.getCorr())<0 )|| - (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && orignalRd.getCorr()!=null && pickedRd.getCorr() == null) - ) - { - // decide to replace picked with original record, based on the following cases, in (priority) order - //case 1: original record has "later" issue time than picked record - //case 2: original record has "larger" correction "corr" than picked record - //case 3: original record has correction "corr", picked record does not have - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " ori= " + orignalRd.getDataURI()+ - // " picked="+ pickedRd.getDataURI()); - int pickedIndex = pickedUairRecords.indexOf(pickedRd); - pickedUairRecords.set(pickedIndex, orignalRd); - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " afterreplaced picked record ="+pickedH5Records.get(pickedIndex).getDataURI()); - } - break; - } - } - if(addToList==true){ - // add this original record to picked list - pickedUairRecords.add(orignalRd); - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " add ori to picked record ="+orignalRd.getDataURI()); - - } - } - //pickedUairRecords.get(0).setNil(false); // set for special handling for its caller - finalRecordArrayList.add(pickedUairRecords.toArray(new NcUairRecord[pickedUairRecords.size()])); - //System.out.println("After checking: stn record size="+pickedUairRecords.size()); - } - } - - } - long t004 = System.currentTimeMillis(); - System.out.println(" sorting return records took "+(t004-t003)+"ms"); - } - } catch (Exception e) { - e.printStackTrace(); - } - - System.out.println("getObservedSndNcUairDataByStnIdArray Number of records in finalRecordArrayList="+finalRecordArrayList.size()); - return finalRecordArrayList; - }*/ - /* - * Chin: 2/21/2012 - * Using Lat/lon array OR StnId array, AND soundingTimeAry (fcst time array) as input. - * This function is to be generic for all cases. - * One and only one of latLonArray and stnIdArr should be not null and the other one should be null - * soundingTimeAry is a list of refer time (in Bufrua, only use refer time for query) should be not null - * Chin's note: NOT completed yet................. - */ - public static List getObservedSndBufruaDataGeneric(Coordinate[] coordArray,String[] stnIdArray, List soundingTimeStrList, long[] soundTimeLongArr){ - //List soundingProfileList= new ArrayList(); - PointDataQuery request = null; - PointDataContainer result = null; - //NcUairRecord[] h5Records=null; - String stnStr=""; - Coordinate coord= new Coordinate();; + // NcUairRecord[] h5Records=null; + String stnStr = ""; + Coordinate coord = new Coordinate(); + ; List returnedDbRecords = new ArrayList(); UAObs[] returnedDbRecordArr; List finalRecordArrayList = new ArrayList(); boolean queryByStn; try { - request = new PointDataQuery("bufrua"); - request.setParameters(BufrUAPointDataTransform.MAN_PARAMS_LIST); - request.requestAllLevels(); - String d=""; - for (String timeStr: soundingTimeStrList){ - d = d+timeStr; - d= d+","; - } - d=d.substring(0, d.length()-1);//get rid of last "," - request.addParameter("dataTime.refTime",d, "in"); - if(coordArray != null){ - String latStr="", lonStr=""; - for ( int i=0; i < coordArray.length ; i++) - { - latStr = latStr+String.valueOf(coordArray[i].y)+","; - lonStr = lonStr+String.valueOf(coordArray[i].x)+","; - } - latStr=latStr.substring(0, latStr.length()-1);//get rid of last "," - lonStr=lonStr.substring(0, lonStr.length()-1);//get rid of last "," - request.addParameter("location.latitude",latStr, "in"); - request.addParameter("location.longitude", lonStr, "in"); - queryByStn = false; - } - else if(stnIdArray != null){ - String stnIdListStr=""; - for ( int i=0; i < stnIdArray.length ; i++) - { + request = new PointDataQuery("bufrua"); + request.setParameters(BufrUAPointDataTransform.MAN_PARAMS_LIST); + request.requestAllLevels(); + String d = ""; + for (String timeStr : soundingTimeStrList) { + d = d + timeStr; + d = d + ","; + } + d = d.substring(0, d.length() - 1);// get rid of last "," + request.addParameter("dataTime.refTime", d, "in"); + if (coordArray != null) { + String latStr = "", lonStr = ""; + for (Coordinate element : coordArray) { + latStr = latStr + String.valueOf(element.y) + ","; + lonStr = lonStr + String.valueOf(element.x) + ","; + } + latStr = latStr.substring(0, latStr.length() - 1);// get rid of + // last "," + lonStr = lonStr.substring(0, lonStr.length() - 1);// get rid of + // last "," + request.addParameter("location.latitude", latStr, "in"); + request.addParameter("location.longitude", lonStr, "in"); + queryByStn = false; + } else if (stnIdArray != null) { + String stnIdListStr = ""; + for (int i = 0; i < stnIdArray.length; i++) { - if(i < stnIdArray.length -1){ - stnIdListStr = stnIdListStr+stnIdArray[i]+","; - } - } - request.addParameter("location.stationId",stnIdListStr, "in"); - queryByStn= true; - } - else { - return finalRecordArrayList; - } - long t001 = System.currentTimeMillis(); - result = request.execute(); - long t002 = System.currentTimeMillis(); - //totalRqTime=totalRqTime+(t002-t001); - System.out.println("getObservedSndBufruaDataGeneric data query alone took "+(t002-t001)+"ms"); + if (i < (stnIdArray.length - 1)) { + stnIdListStr = stnIdListStr + stnIdArray[i] + ","; + } + } + request.addParameter("location.stationId", stnIdListStr, "in"); + queryByStn = true; + } else { + return finalRecordArrayList; + } + long t001 = System.currentTimeMillis(); + result = request.execute(); + long t002 = System.currentTimeMillis(); + // totalRqTime=totalRqTime+(t002-t001); + System.out + .println("getObservedSndBufruaDataGeneric data query alone took " + + (t002 - t001) + "ms"); - if (result != null) { - long t003 = System.currentTimeMillis(); - returnedDbRecordArr = BufrUAPointDataTransform.toUAObsRecords(result); - for(int i=0; i < returnedDbRecordArr.length; i++) - returnedDbRecords.add(returnedDbRecordArr[i]); - if(returnedDbRecords!= null && returnedDbRecords.size() > 0){ - System.out.println("getObservedSndBufruaDataGeneric Before loop: Number of records in returnedDbRecords="+returnedDbRecords.size()); - //Chin: keep list of records for same station - //search through all returned records and keep same staion's records in one list - int loopLen; - if(queryByStn== true){ - loopLen = stnIdArray.length; - } - else { - loopLen = coordArray.length; - } - UAObs record; - - for ( int i=0; i < loopLen ; i++) - { - //for each station - if(queryByStn== true){ - stnStr = stnIdArray[i]; - } - else{ - coord = coordArray[i]; - } - - List> stnRecordsList = new ArrayList>(); - for (long refT: soundTimeLongArr){ - List stnRecords = new ArrayList(); - stnRecordsList.add(stnRecords); - } - for(int j=returnedDbRecords.size()-1; j >=0; j--){ - record =returnedDbRecords.get(j); - boolean goodRecord = false; - //System.out.println("requesting stn="+stnStr+" returned rd stnId="+record.getStationId()+ " stnNum="+record.getStnum()); - if(queryByStn== true){ - if(stnStr.equals(record.getStationId()) ){ - //remove this record from return list and add it to this stn list - //stnRecords.add(returnedDbRecords.remove(j)); - goodRecord = true; - } - } - else { - //System.out.println("coor.x="+coord.x + " coor.y="+coord.y + " record lon="+record.getLongitude()+ " record lat="+ record.getLatitude()); - //Chin: for some unknown reason that record returned from DB with lat/lon extended with many digits - //For example, coor.x=-114.4 coor.y=32.85 record lon=-114.4000015258789 record lat=32.849998474121094 - //Therefore, do the following. - if( Math.abs(coord.x-record.getLongitude())< 0.01 && Math.abs(coord.y-record.getLatitude())<0.01){ - //remove this record from return list and add it to this stn list - //stnRecords.add(returnedDbRecords.remove(j)); - goodRecord = true; - } - } - if(goodRecord == true){ - for(int index=0; index< soundTimeLongArr.length; index++){ - long refT= soundTimeLongArr[index]; - if( refT == record.getDataTime().getRefTime().getTime()){ - stnRecordsList.get(index).add(returnedDbRecords.remove(j)); - } - } - } - } - for(List recordList:stnRecordsList){ - if(recordList.size()>0){ - - //pickedUairRecords.get(0).setNil(false); // set for special handling for its caller - finalRecordArrayList.add(recordList.toArray(new UAObs[recordList.size()])); - //System.out.println("getObservedSndNcUairDataGeneric Number of records in PF=" + pickedUairRecords.size()); - } - } - } + if (result != null) { + long t003 = System.currentTimeMillis(); + returnedDbRecordArr = BufrUAPointDataTransform + .toUAObsRecords(result); + for (UAObs element : returnedDbRecordArr) { + returnedDbRecords.add(element); + } + if ((returnedDbRecords != null) + && (returnedDbRecords.size() > 0)) { + System.out + .println("getObservedSndBufruaDataGeneric Before loop: Number of records in returnedDbRecords=" + + returnedDbRecords.size()); + // Chin: keep list of records for same station + // search through all returned records and keep same + // staion's records in one list + int loopLen; + if (queryByStn == true) { + loopLen = stnIdArray.length; + } else { + loopLen = coordArray.length; + } + UAObs record; - } - long t004 = System.currentTimeMillis(); - System.out.println(" sorting return records took "+(t004-t003)+"ms"); - } + for (int i = 0; i < loopLen; i++) { + // for each station + if (queryByStn == true) { + stnStr = stnIdArray[i]; + } else { + coord = coordArray[i]; + } + + List> stnRecordsList = new ArrayList>(); + for (long refT : soundTimeLongArr) { + List stnRecords = new ArrayList(); + stnRecordsList.add(stnRecords); + } + for (int j = returnedDbRecords.size() - 1; j >= 0; j--) { + record = returnedDbRecords.get(j); + boolean goodRecord = false; + // System.out.println("requesting stn="+stnStr+" returned rd stnId="+record.getStationId()+ + // " stnNum="+record.getStnum()); + if (queryByStn == true) { + if (stnStr.equals(record.getStationId())) { + // remove this record from return list and + // add it to this stn list + // stnRecords.add(returnedDbRecords.remove(j)); + goodRecord = true; + } + } else { + // System.out.println("coor.x="+coord.x + + // " coor.y="+coord.y + + // " record lon="+record.getLongitude()+ + // " record lat="+ record.getLatitude()); + // Chin: for some unknown reason that record + // returned from DB with lat/lon extended with + // many digits + // For example, coor.x=-114.4 coor.y=32.85 + // record lon=-114.4000015258789 record + // lat=32.849998474121094 + // Therefore, do the following. + if ((Math.abs(coord.x - record.getLongitude()) < 0.01) + && (Math.abs(coord.y + - record.getLatitude()) < 0.01)) { + // remove this record from return list and + // add it to this stn list + // stnRecords.add(returnedDbRecords.remove(j)); + goodRecord = true; + } + } + if (goodRecord == true) { + for (int index = 0; index < soundTimeLongArr.length; index++) { + long refT = soundTimeLongArr[index]; + if (refT == record.getDataTime() + .getRefTime().getTime()) { + stnRecordsList.get(index).add( + returnedDbRecords.remove(j)); + } + } + } + } + for (List recordList : stnRecordsList) { + if (recordList.size() > 0) { + + // pickedUairRecords.get(0).setNil(false); // + // set for special handling for its caller + finalRecordArrayList.add(recordList + .toArray(new UAObs[recordList.size()])); + // System.out.println("getObservedSndNcUairDataGeneric Number of records in PF=" + // + pickedUairRecords.size()); + } + } + } + + } + long t004 = System.currentTimeMillis(); + System.out.println(" sorting return records took " + + (t004 - t003) + "ms"); + } } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace(); } - System.out.println("getObservedSndBufruaDataGeneric Number profiles (record[]s) in finalRecordArrayList="+finalRecordArrayList.size()); + System.out + .println("getObservedSndBufruaDataGeneric Number profiles (record[]s) in finalRecordArrayList=" + + finalRecordArrayList.size()); return finalRecordArrayList; - } - /* - * Chin: 2/21/2012 - * Using Lat/lon array OR StnId array, AND soundingTimeAry (fcst time array) as input. - * This function is to be generic for all cases. - * One and only one of latLonArray and stnIdArr should be not null and the other one should be null - * soundingTimeAry is a list of refer time (in NCUair, only use refer time for query) should be not null - * - */ - public static List getObservedSndNcUairDataGeneric(Coordinate[] coordArray,String[] stnIdArray, List soundingTimeStrList, long[] soundTimeLongArr){ - //List soundingProfileList= new ArrayList(); - PointDataQuery request = null; + } + + /* + * Chin: 2/21/2012 Using Lat/lon array OR StnId array, AND soundingTimeAry + * (fcst time array) as input. This function is to be generic for all cases. + * One and only one of latLonArray and stnIdArr should be not null and the + * other one should be null soundingTimeAry is a list of refer time (in + * NCUair, only use refer time for query) should be not null + */ + public static List getObservedSndNcUairDataGeneric( + Coordinate[] coordArray, String[] stnIdArray, + List soundingTimeStrList, long[] soundTimeLongArr) { + // List soundingProfileList= new + // ArrayList(); + PointDataQuery request = null; PointDataContainer result = null; - //NcUairRecord[] h5Records=null; - String stnStr=""; - Coordinate coord= new Coordinate();; + // NcUairRecord[] h5Records=null; + String stnStr = ""; + Coordinate coord = new Coordinate(); + ; List returnedDbRecords = new ArrayList(); List finalRecordArrayList = new ArrayList(); boolean queryByStn; try { - request = new PointDataQuery("ncuair"); - request.setParameters(NcUairToRecord.MAN_PARAMS_LIST); - request.addParameter("nil", String.valueOf(false), "="); - request.requestAllLevels(); - String d=""; - for (String timeStr: soundingTimeStrList){ - d = d+timeStr; - d= d+","; - } - d=d.substring(0, d.length()-1);//get rid of last "," - request.addParameter("dataTime.refTime",d, "in"); - if(coordArray != null){ - String latStr="", lonStr=""; - for ( int i=0; i < coordArray.length ; i++) - { - latStr = latStr+String.valueOf(coordArray[i].y)+","; - lonStr = lonStr+String.valueOf(coordArray[i].x)+","; - } - latStr=latStr.substring(0, latStr.length()-1);//get rid of last "," - lonStr=lonStr.substring(0, lonStr.length()-1);//get rid of last "," - request.addParameter("location.latitude",latStr, "in"); - request.addParameter("location.longitude", lonStr, "in"); - queryByStn = false; - } - else if(stnIdArray != null){ - String stnIdListStr=""; - StringBuilder stringOfStnIds = new StringBuilder(); - for ( String thisStnId : stnIdArray ){ - stringOfStnIds.append(thisStnId); - stringOfStnIds.append(","); - } - stnIdListStr = stringOfStnIds.toString(); - //get rid of the last comma - stnIdListStr = stnIdListStr.substring(0, stnIdListStr.length() - 1 ); - - request.addParameter("location.stationId",stnIdListStr, "in"); - queryByStn= true; - } - else { - return finalRecordArrayList; - } - long t001 = System.currentTimeMillis(); - result = request.execute(); - long t002 = System.currentTimeMillis(); - //totalRqTime=totalRqTime+(t002-t001); - //System.out.println("getObservedSndNcUairDataGeneric data query alone took "+(t002-t001)+"ms"); + request = new PointDataQuery("ncuair"); + request.setParameters(NcUairToRecord.MAN_PARAMS_LIST); + request.addParameter("nil", String.valueOf(false), "="); + request.requestAllLevels(); + String d = ""; + for (String timeStr : soundingTimeStrList) { + d = d + timeStr; + d = d + ","; + } + d = d.substring(0, d.length() - 1);// get rid of last "," + request.addParameter("dataTime.refTime", d, "in"); + if (coordArray != null) { + String latStr = "", lonStr = ""; + for (Coordinate element : coordArray) { + latStr = latStr + String.valueOf(element.y) + ","; + lonStr = lonStr + String.valueOf(element.x) + ","; + } + latStr = latStr.substring(0, latStr.length() - 1);// get rid of + // last "," + lonStr = lonStr.substring(0, lonStr.length() - 1);// get rid of + // last "," + request.addParameter("location.latitude", latStr, "in"); + request.addParameter("location.longitude", lonStr, "in"); + queryByStn = false; + } else if (stnIdArray != null) { + String stnIdListStr = ""; + StringBuilder stringOfStnIds = new StringBuilder(); + for (String thisStnId : stnIdArray) { + stringOfStnIds.append(thisStnId); + stringOfStnIds.append(","); + } + stnIdListStr = stringOfStnIds.toString(); + // get rid of the last comma + stnIdListStr = stnIdListStr.substring(0, + stnIdListStr.length() - 1); - if (result != null) { - long t003 = System.currentTimeMillis(); - returnedDbRecords = NcUairToRecord.toNcUairRecordsList(result); + request.addParameter("location.stationId", stnIdListStr, "in"); + queryByStn = true; + } else { + return finalRecordArrayList; + } + long t001 = System.currentTimeMillis(); + result = request.execute(); + long t002 = System.currentTimeMillis(); + // totalRqTime=totalRqTime+(t002-t001); + // System.out.println("getObservedSndNcUairDataGeneric data query alone took "+(t002-t001)+"ms"); - if(returnedDbRecords!= null && returnedDbRecords.size() > 0){ - //System.out.println("getObservedSndNcUairDataGeneric Before loop: Number of records in returnedDbRecords="+returnedDbRecords.size()); - //Chin: keep list of records for same station - //search through all returned records and keep same staion's records in one list - int loopLen; - if(queryByStn== true){ - loopLen = stnIdArray.length; - } - else { - loopLen = coordArray.length; - } - NcUairRecord record; - - for ( int i=0; i < loopLen ; i++) - { - //for each station - if(queryByStn== true){ - stnStr = stnIdArray[i]; - } - else{ - coord = coordArray[i]; - } - - List> stnRecordsList = new ArrayList>(); - for (long refT: soundTimeLongArr){ - //create empty List for each sounding time line - List stnRecords = new ArrayList(); - stnRecordsList.add(stnRecords); - } - for(int j=returnedDbRecords.size()-1; j >=0; j--){ - record =returnedDbRecords.get(j); - boolean goodRecord = false; - //System.out.println("requesting stn="+stnStr+" returned rd stnId="+record.getStationId()+ " stnNum="+record.getStnum()); - if(queryByStn== true){ - if(stnStr.equals(record.getStationId()) ){ - //remove this record from return list and add it to this stn list - //stnRecords.add(returnedDbRecords.remove(j)); - goodRecord = true; - } - } - else { - //System.out.println("coor.x="+coord.x + " coor.y="+coord.y + " record lon="+record.getLongitude()+ " record lat="+ record.getLatitude()); - //Chin: for some unknown reason that record returned from DB with lat/lon extended with many digits - //For example, coor.x=-114.4 coor.y=32.85 record lon=-114.4000015258789 record lat=32.849998474121094 - //Therefore, do the following. - if( Math.abs(coord.x-record.getLongitude())< 0.01 && Math.abs(coord.y-record.getLatitude())<0.01){ - //remove this record from return list and add it to this stn list - //stnRecords.add(returnedDbRecords.remove(j)); - goodRecord = true; - } - } - if(goodRecord == true){ - for(int index=0; index< soundTimeLongArr.length; index++){ - long refT= soundTimeLongArr[index]; - if( refT == record.getDataTime().getRefTime().getTime()){ - stnRecordsList.get(index).add(returnedDbRecords.remove(j)); - } - } - } - } - for(List recordList:stnRecordsList){ - if(recordList.size()>0){ - //System.out.println("Before checking:stn lat="+lat +"stn record size="+stnRecords.size()); - List pickedUairRecords = new ArrayList(); - NcUairRecord orignalRd; - boolean addToList = true; - for(int ii=0; ii< recordList.size(); ii++){ - orignalRd = recordList.get(ii); - addToList = true; - for(NcUairRecord pickedRd: pickedUairRecords){ - if(orignalRd.getDataType().equals( pickedRd.getDataType())){ - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " find a same datatype="+pickedRd.getDataType()+ " orignalRd corr="+orignalRd.getCorr()+ - // " pickedRd Corr="+pickedRd.getCorr()); - - //the two records have same data type - //this records will either replace the one in list or be dropped - addToList = false; - if ((pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())<0) || - (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && orignalRd.getCorr()!=null && pickedRd.getCorr() != null && pickedRd.getCorr().compareTo(orignalRd.getCorr())<0 )|| - (pickedRd.getIssueTime().compareTo(orignalRd.getIssueTime())==0 && orignalRd.getCorr()!=null && pickedRd.getCorr() == null) - ) - { - // decide to replace picked with original record, based on the following cases, in (priority) order - //case 1: original record has "later" issue time than picked record - //case 2: original record has "larger" correction "corr" than picked record - //case 3: original record has correction "corr", picked record does not have - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " ori= " + orignalRd.getDataURI()+ - // " picked="+ pickedRd.getDataURI()); - int pickedIndex = pickedUairRecords.indexOf(pickedRd); - pickedUairRecords.set(pickedIndex, orignalRd); - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " afterreplaced picked record ="+pickedH5Records.get(pickedIndex).getDataURI()); - } - break; - } - } - if(addToList==true){ - // add this original record to picked list - pickedUairRecords.add(orignalRd); - //System.out.println("getObservedSndNcUairData: at lat="+ lat+ " lon="+lon+ " add ori to picked record ="+orignalRd.getDataURI()); - - } - } - //pickedUairRecords.get(0).setNil(false); // set for special handling for its caller - finalRecordArrayList.add(pickedUairRecords.toArray(new NcUairRecord[pickedUairRecords.size()])); - //System.out.println("getObservedSndNcUairDataGeneric Number of records in PF=" + pickedUairRecords.size()); - } - } - } - - } - long t004 = System.currentTimeMillis(); - //System.out.println(" sorting return records took "+(t004-t003)+"ms"); - } - } catch (Exception e) { - e.printStackTrace(); - } - - //System.out.println("getObservedSndNcUairDataGeneric Number profiles (record[]s) in finalRecordArrayList="+finalRecordArrayList.size()); - return finalRecordArrayList; - } - /* - * This method query ONE station's specific one dataType data only - * - public static NcUairRecord getObservedSndNcUairData(Double lat, Double lon, String stn, String refTime, String dataType, SndQueryKeyType queryType){ - NcUairRecord effectRecord=null; - PointDataQuery request = null; - PointDataContainer result = null; - - try { - request = new PointDataQuery("ncuair"); - request.setParameters(NcUairToRecord.MAN_PARAMS_LIST); - request.addParameter("location.latitude", String.valueOf(lat-0.1), ">="); - request.addParameter("location.latitude", String.valueOf(lat+0.1), "<="); - request.addParameter("location.longitude", String.valueOf(lon-0.1), ">="); - request.addParameter("location.longitude", String.valueOf(lon+0.1), "<="); - request.addParameter("dataTime.refTime",refTime, "="); - //System.out.println("getObservedSndNcUairData: lat="+lat+ " lon="+lon + " refTime="+refTime); - request.addParameter("nil", String.valueOf(false), "="); - request.addParameter("dataType", dataType, "="); - - request.requestAllLevels(); - result = request.execute(); if (result != null) { - //System.out.println("getObservedSndNcUairData: result is not null, getAllocatedSz= "+ result.getAllocatedSz()); - //System.out.println("getObservedSndNcUairData:getting "+dataType); - NcUairRecord[] h5Records = NcUairToRecord.toNcUairRecords(result); - //System.out.println("getObservedSndNcUairData: number of "+dataType+" records = "+h5Records.length); - - if(h5Records.length == 1){ - //effectRecord = h5Records[0]; - //System.out.println("getObservedSndNcUairData: real dataType =" + h5Records[0].getDataType()); - return h5Records[0]; - } - else if (h5Records.length > 1){ - // need to find out the latest corrected record - int lastCorrectedRecord=0; - String currentCorInd = ""; - Calendar curIssueTime = Calendar.getInstance(TimeZone.getTimeZone("GMT")); - // set init time - curIssueTime.setTimeInMillis(0); - for(int i=0; i< h5Records.length; i++){ - //System.out.println("getObservedSndNcUairData2: real dataType =" + h5Records[i].getDataType()); - if( ( curIssueTime.compareTo(h5Records[i].getIssueTime())<0 ) || - (curIssueTime.compareTo(h5Records[i].getIssueTime())==0 && h5Records[i].getCorr()!= null && currentCorInd.compareTo(h5Records[i].getCorr()) < 0 ) - ) - { - currentCorInd = h5Records[i].getCorr(); - curIssueTime = h5Records[i].getIssueTime(); - lastCorrectedRecord = i; - //System.out.println("getObservedSndNcUairData: corr=" + h5Records[i].getCorr()); - } - } - //effectRecord = h5Records[lastCorrectedRecord]; - return h5Records[lastCorrectedRecord]; - } - + long t003 = System.currentTimeMillis(); + returnedDbRecords = NcUairToRecord.toNcUairRecordsList(result); + + if ((returnedDbRecords != null) + && (returnedDbRecords.size() > 0)) { + // System.out.println("getObservedSndNcUairDataGeneric Before loop: Number of records in returnedDbRecords="+returnedDbRecords.size()); + // Chin: keep list of records for same station + // search through all returned records and keep same + // staion's records in one list + int loopLen; + if (queryByStn == true) { + loopLen = stnIdArray.length; + } else { + loopLen = coordArray.length; + } + NcUairRecord record; + + for (int i = 0; i < loopLen; i++) { + // for each station + if (queryByStn == true) { + stnStr = stnIdArray[i]; + } else { + coord = coordArray[i]; + } + + List> stnRecordsList = new ArrayList>(); + for (long refT : soundTimeLongArr) { + // create empty List for each sounding + // time line + List stnRecords = new ArrayList(); + stnRecordsList.add(stnRecords); + } + for (int j = returnedDbRecords.size() - 1; j >= 0; j--) { + record = returnedDbRecords.get(j); + boolean goodRecord = false; + // System.out.println("requesting stn="+stnStr+" returned rd stnId="+record.getStationId()+ + // " stnNum="+record.getStnum()); + if (queryByStn == true) { + if (stnStr.equals(record.getStationId())) { + // remove this record from return list and + // add it to this stn list + // stnRecords.add(returnedDbRecords.remove(j)); + goodRecord = true; + } + } else { + // System.out.println("coor.x="+coord.x + + // " coor.y="+coord.y + + // " record lon="+record.getLongitude()+ + // " record lat="+ record.getLatitude()); + // Chin: for some unknown reason that record + // returned from DB with lat/lon extended with + // many digits + // For example, coor.x=-114.4 coor.y=32.85 + // record lon=-114.4000015258789 record + // lat=32.849998474121094 + // Therefore, do the following. + if ((Math.abs(coord.x - record.getLongitude()) < 0.01) + && (Math.abs(coord.y + - record.getLatitude()) < 0.01)) { + // remove this record from return list and + // add it to this stn list + // stnRecords.add(returnedDbRecords.remove(j)); + goodRecord = true; + } + } + if (goodRecord == true) { + for (int index = 0; index < soundTimeLongArr.length; index++) { + long refT = soundTimeLongArr[index]; + if (refT == record.getDataTime() + .getRefTime().getTime()) { + stnRecordsList.get(index).add( + returnedDbRecords.remove(j)); + } + } + } + } + for (List recordList : stnRecordsList) { + if (recordList.size() > 0) { + // System.out.println("Before checking:stn lat="+lat + // +"stn record size="+stnRecords.size()); + List pickedUairRecords = new ArrayList(); + NcUairRecord orignalRd; + boolean addToList = true; + for (int ii = 0; ii < recordList.size(); ii++) { + orignalRd = recordList.get(ii); + addToList = true; + for (NcUairRecord pickedRd : pickedUairRecords) { + if (orignalRd.getDataType().equals( + pickedRd.getDataType())) { + // System.out.println("getObservedSndNcUairData: at lat="+ + // lat+ " lon="+lon+ + // " find a same datatype="+pickedRd.getDataType()+ + // " orignalRd corr="+orignalRd.getCorr()+ + // " pickedRd Corr="+pickedRd.getCorr()); + + // the two records have same data + // type + // this records will either replace + // the one in list or be dropped + addToList = false; + if ((pickedRd + .getIssueTime() + .compareTo( + orignalRd + .getIssueTime()) < 0) + || ((pickedRd + .getIssueTime() + .compareTo( + orignalRd + .getIssueTime()) == 0) + && (orignalRd + .getCorr() != null) + && (pickedRd + .getCorr() != null) && (pickedRd + .getCorr() + .compareTo( + orignalRd + .getCorr()) < 0)) + || ((pickedRd + .getIssueTime() + .compareTo( + orignalRd + .getIssueTime()) == 0) + && (orignalRd + .getCorr() != null) && (pickedRd + .getCorr() == null))) { + // decide to replace picked with + // original record, based on the + // following cases, in + // (priority) order + // case 1: original record has + // "later" issue time than + // picked record + // case 2: original record has + // "larger" correction "corr" + // than picked record + // case 3: original record has + // correction "corr", picked + // record does not have + // System.out.println("getObservedSndNcUairData: at lat="+ + // lat+ " lon="+lon+ " ori= " + + // orignalRd.getDataURI()+ + // " picked="+ + // pickedRd.getDataURI()); + int pickedIndex = pickedUairRecords + .indexOf(pickedRd); + pickedUairRecords.set( + pickedIndex, orignalRd); + // System.out.println("getObservedSndNcUairData: at lat="+ + // lat+ " lon="+lon+ + // " afterreplaced picked record ="+pickedH5Records.get(pickedIndex).getDataURI()); + } + break; + } + } + if (addToList == true) { + // add this original record to picked + // list + pickedUairRecords.add(orignalRd); + // System.out.println("getObservedSndNcUairData: at lat="+ + // lat+ " lon="+lon+ + // " add ori to picked record ="+orignalRd.getDataURI()); + + } + } + // pickedUairRecords.get(0).setNil(false); // + // set for special handling for its caller + finalRecordArrayList + .add(pickedUairRecords + .toArray(new NcUairRecord[pickedUairRecords + .size()])); + // System.out.println("getObservedSndNcUairDataGeneric Number of records in PF=" + // + pickedUairRecords.size()); + } + } + } + + } + long t004 = System.currentTimeMillis(); + // System.out.println(" sorting return records took "+(t004-t003)+"ms"); } } catch (Exception e) { - e.printStackTrace(); + e.printStackTrace(); } - return effectRecord; - } -*/ - /* - * NOT used currently - * - * obsType: UAIR, TAMDAR or DROP, dataType: ALLDATA ONLY - */ - /*@SuppressWarnings("unchecked") - public static NcSoundingProfile getObservedSndData(int[] parentIds, String obType,String dataType) { - NcSoundingProfile pf = new NcSoundingProfile(); - //one StnPt represent one data time line - List soundLyLst = new ArrayList(); - NcSoundingLayer soundingLy; - soundLyLst.clear(); - - obType = ObsSndType.UAIR.toString(); // currently assume all uair sounding type - if(obType.equals(ObsSndType.UAIR.toString())){ - //*System.out.println("parentIds length = " + parentIds.length ); - for(int i=0; i fields = new ArrayList(); - List values = new ArrayList(); - List lObsLevels = null; - fields.add("id");// the record id field name defined in UairRecord - values.add(id); //testing 994872); - if(!dataType.equals(NcSoundingLayer.DataType.ALLDATA.toString()) && - !dataType.equals(NcSoundingLayer.DataType.MAXWIND_A.toString()) && - !dataType.equals(NcSoundingLayer.DataType.TROPOPAUSE_A.toString())){ - fields.add("dataType");// the record dataType field name defined in UairRecord - values.add(dataType); //testing "TTAA" - } - CoreDao dao = new CoreDao(DaoConfig.forClass(UairRecord.class)); - try { - lObsLevels = (List) dao.queryByCriteria(fields, values); - if(lObsLevels.size() > 0){ - //since we are using Records id to query uair table. lObsLevels.size() should always be one. - //*System.out.println("size of uairrecord " + lObsLevels.size()); - //*System.out.println("id ="+lObsLevels.get(0).getId() + " datauri=" +lObsLevels.get(0).getDataURI()); - //*System.out.println("size of ObsLevels ="+lObsLevels.get(0).getObsLevels().size() ); - //*System.out.println("size of maxWind ="+lObsLevels.get(0).getMaxWind().size() ); - //*System.out.println("size of Tropopause ="+lObsLevels.get(0).getTropopause().size() ); - if((lObsLevels.get(0).getObsLevels().size()>0) && - !dataType.equals(NcSoundingLayer.DataType.MAXWIND_A.toString()) && - !dataType.equals(NcSoundingLayer.DataType.TROPOPAUSE_A.toString())){ - java.util.Iterator it=lObsLevels.get(0).getObsLevels().iterator(); - while(it.hasNext()) - { - ObsLevels value=(ObsLevels)it.next(); - soundingLy = new NcSoundingLayer(); - soundingLy.setGeoHeight(value.getGeoHeight()); - soundingLy.setTemperature(value.getTemp()); - soundingLy.setPressure(value.getPressure()); - soundingLy.setWindDirection(value.getWindDirection()); - if ( value.getWindSpeed() != NcSoundingLayer.MISSING ) { - soundingLy.setWindSpeed((float)metersPerSecondToKnots.convert((float)value.getWindSpeed())); - } else { - soundingLy.setWindSpeed((float)value.getWindSpeed()); - } - soundingLy.setDewpoint(value.getDwpt()); - //*System.out.println("pressure :"+value.getPressure() + " temp:" + value.getTemp() + " H:"+value.getGeoHeight() ); - soundLyLst.add(soundingLy); - } - } - } - - if(lObsLevels.get(0).getMaxWind().size() >0 && - !dataType.equals(NcSoundingLayer.DataType.TROPOPAUSE_A.toString())){ - java.util.Iterator itWind=lObsLevels.get(0).getMaxWind().iterator(); - - while(itWind.hasNext()) - { - MaxWind value=(MaxWind)itWind.next(); - soundingLy = new NcSoundingLayer(); - soundingLy.setPressure(value.getPressure()); - soundingLy.setWindDirection(value.getWindDirection()); - if ( value.getWindSpeed() != NcSoundingLayer.MISSING ) { - soundingLy.setWindSpeed((float)metersPerSecondToKnots.convert((float)value.getWindSpeed())); - } else { - soundingLy.setWindSpeed((float)value.getWindSpeed()); - } - - soundLyLst.add(soundingLy); - } - } - - if(lObsLevels.get(0).getTropopause().size() >0 && - !dataType.equals(NcSoundingLayer.DataType.MAXWIND_A.toString())){ - java.util.Iterator it=lObsLevels.get(0).getTropopause().iterator(); - while(it.hasNext()) - { - Tropopause value=(Tropopause)it.next(); - soundingLy = new NcSoundingLayer(); - soundingLy.setTemperature(value.getTemp()); - soundingLy.setPressure(value.getPressure()); - soundingLy.setWindDirection(value.getWindDirection()); - if ( value.getWindSpeed() != NcSoundingLayer.MISSING ) { - soundingLy.setWindSpeed((float)metersPerSecondToKnots.convert((float)value.getWindSpeed())); - //*System.out.println("Tropopause pressure :"+value.getPressure() + " temp:" + value.getTemp()+" WD:" + value.getWindDirection() + " WS:"+(float)metersPerSecondToKnots.convert((float)value.getWindSpeed())); - - } else { - soundingLy.setWindSpeed((float)value.getWindSpeed()); - //*System.out.println("Tropopause pressure :"+value.getPressure() + " temp:" + value.getTemp()+" WD:" + value.getWindDirection() + " WS:"+(float)value.getWindSpeed()); - - } - - soundingLy.setDewpoint(value.getDwpt()); - - soundLyLst.add(soundingLy); - - } - } - } catch (DataAccessLayerException e) { - //*System.out.println("obs sounding query exception"); - //e.printStackTrace(); - } - - } - } - pf.setSoundingLyLst(soundLyLst); - return pf; - - } - */ - /* - * this api is provided for applications and for testing to retrieve observed bufruair data from PostgreSql DB & HDF5 - * dataType should use "enum DataType" defined in NcSoundingLayer.java - * Support "ALLDATA" data type only - */ - public static NcSoundingProfile getObservedSndBufruaAllData(Double lat, Double lon, String stn, long refTimeL, SndQueryKeyType queryType){ - Calendar refTimeCal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); - // for testing ...refTimeCal.setTimeInMillis(1276581600000L); - //refTimeCal.setTimeInMillis(refTime.getTime()); - refTimeCal.setTimeInMillis(refTimeL); - return getObservedSndBufruaAllData(lat, lon, stn, refTimeCal, queryType); - } - - /* - * this api is provided for applications and for testing to retrieve observed bufruair data from PostgreSql DB & HDF5 - * dataType should use "enum DataType" defined in NcSoundingLayer.java - * Support "ALLDATA" data type only - */ - public static NcSoundingProfile getObservedSndBufruaAllData(Double lat, Double lon, String stn, Calendar refTimeCal, SndQueryKeyType queryType){ - NcSoundingProfile pfAll= new NcSoundingProfile(); - List soundingLyLst, finalsoundingLyLst; - NcSoundingProfile pf = getObservedSndBufruaData(lat, lon, stn, refTimeCal, "TTAA", queryType); - pfAll.setStationElevation(pf.getStationElevation()); - finalsoundingLyLst = pf.getSoundingLyLst(); - soundingLyLst = getObservedSndBufruaData(lat, lon, stn,refTimeCal, "TTBB", queryType).getSoundingLyLst(); - if (soundingLyLst.size() >= 0){ - finalsoundingLyLst.addAll(soundingLyLst); - } - soundingLyLst = getObservedSndBufruaData(lat, lon, stn,refTimeCal, "TTCC", queryType).getSoundingLyLst(); - if (soundingLyLst.size() >= 0){ - finalsoundingLyLst.addAll(soundingLyLst); - } - soundingLyLst = getObservedSndBufruaData(lat, lon, stn,refTimeCal, "TTDD", queryType).getSoundingLyLst(); - if (soundingLyLst.size() >= 0){ - finalsoundingLyLst.addAll(soundingLyLst); - } - //soundingLyLst = getObservedSndBufruaData(lat, lon, stn,refTimeCal, "PPAA", queryType).getSoundingLyLst(); - //if (soundingLyLst.size() >= 0){ - // finalsoundingLyLst.addAll(soundingLyLst); - //} - soundingLyLst = getObservedSndBufruaData(lat, lon, stn,refTimeCal, "PPBB", queryType).getSoundingLyLst(); - if (soundingLyLst.size() >= 0){ - finalsoundingLyLst.addAll(soundingLyLst); - } - //soundingLyLst = getObservedSndBufruaData(lat, lon, stn,refTimeCal, "PPCC", queryType).getSoundingLyLst(); - //if (soundingLyLst.size() >= 0){ - // finalsoundingLyLst.addAll(soundingLyLst); - //} - soundingLyLst = getObservedSndBufruaData(lat, lon, stn,refTimeCal, "PPDD", queryType).getSoundingLyLst(); - if (soundingLyLst.size() >= 0){ - finalsoundingLyLst.addAll(soundingLyLst); - } - soundingLyLst = getObservedSndBufruaData(lat, lon,stn, refTimeCal, "MAXWIND_A", queryType).getSoundingLyLst(); - if (soundingLyLst.size() >= 0){ - finalsoundingLyLst.addAll(soundingLyLst); - } - soundingLyLst = getObservedSndBufruaData(lat, lon, stn,refTimeCal, "MAXWIND_C", queryType).getSoundingLyLst(); - if (soundingLyLst.size() >= 0){ - finalsoundingLyLst.addAll(soundingLyLst); - } - soundingLyLst = getObservedSndBufruaData(lat, lon, stn,refTimeCal, "TROPOPAUSE_A", queryType).getSoundingLyLst(); - if (soundingLyLst.size() >= 0){ - finalsoundingLyLst.addAll(soundingLyLst); - } - soundingLyLst = getObservedSndBufruaData(lat, lon, stn,refTimeCal, "TROPOPAUSE_C", queryType).getSoundingLyLst(); - if (soundingLyLst.size() >= 0){ - finalsoundingLyLst.addAll(soundingLyLst); - } - pfAll.setSoundingLyLst(finalsoundingLyLst); - return pfAll; - } + // System.out.println("getObservedSndNcUairDataGeneric Number profiles (record[]s) in finalRecordArrayList="+finalRecordArrayList.size()); + return finalRecordArrayList; + } /* - * this api is provided for applications and for testing to retrieve observed BufrUA data from PostgreSql DB and HDF5 - * dataType should use "enum DataType" defined in NcSoundingLayer.java - * Support all dataType except "ALLDATA" data type - * using either lat/lon, stnId or stnNum and validTime as key - * refTime is with unit of msec as input + * This method query ONE station's specific one dataType data only + * + * public static NcUairRecord getObservedSndNcUairData(Double lat, Double + * lon, String stn, String refTime, String dataType, SndQueryKeyType + * queryType){ NcUairRecord effectRecord=null; PointDataQuery request = + * null; PointDataContainer result = null; + * + * try { request = new PointDataQuery("ncuair"); + * request.setParameters(NcUairToRecord.MAN_PARAMS_LIST); + * request.addParameter("location.latitude", String.valueOf(lat-0.1), ">="); + * request.addParameter("location.latitude", String.valueOf(lat+0.1), "<="); + * request.addParameter("location.longitude", String.valueOf(lon-0.1), + * ">="); request.addParameter("location.longitude", + * String.valueOf(lon+0.1), "<="); + * request.addParameter("dataTime.refTime",refTime, "="); + * //System.out.println("getObservedSndNcUairData: lat="+lat+ " lon="+lon + + * " refTime="+refTime); request.addParameter("nil", String.valueOf(false), + * "="); request.addParameter("dataType", dataType, "="); + * + * request.requestAllLevels(); result = request.execute(); if (result != + * null) { //System.out.println( + * "getObservedSndNcUairData: result is not null, getAllocatedSz= "+ + * result.getAllocatedSz()); + * //System.out.println("getObservedSndNcUairData:getting "+dataType); + * NcUairRecord[] h5Records = NcUairToRecord.toNcUairRecords(result); + * //System + * .out.println("getObservedSndNcUairData: number of "+dataType+" records = " + * +h5Records.length); + * + * if(h5Records.length == 1){ //effectRecord = h5Records[0]; + * //System.out.println("getObservedSndNcUairData: real dataType =" + + * h5Records[0].getDataType()); return h5Records[0]; } else if + * (h5Records.length > 1){ // need to find out the latest corrected record + * int lastCorrectedRecord=0; String currentCorInd = ""; Calendar + * curIssueTime = Calendar.getInstance(TimeZone.getTimeZone("GMT")); // set + * init time curIssueTime.setTimeInMillis(0); for(int i=0; i< + * h5Records.length; i++){ + * //System.out.println("getObservedSndNcUairData2: real dataType =" + + * h5Records[i].getDataType()); if( ( + * curIssueTime.compareTo(h5Records[i].getIssueTime())<0 ) || + * (curIssueTime.compareTo(h5Records[i].getIssueTime())==0 && + * h5Records[i].getCorr()!= null && + * currentCorInd.compareTo(h5Records[i].getCorr()) < 0 ) ) { currentCorInd = + * h5Records[i].getCorr(); curIssueTime = h5Records[i].getIssueTime(); + * lastCorrectedRecord = i; + * //System.out.println("getObservedSndNcUairData: corr=" + + * h5Records[i].getCorr()); } } //effectRecord = + * h5Records[lastCorrectedRecord]; return h5Records[lastCorrectedRecord]; } + * + * } } catch (Exception e) { e.printStackTrace(); } return effectRecord; } */ - public static NcSoundingProfile getObservedSndBufruaData(Double lat, Double lon,String stn, long refTimeL, String dataType, SndQueryKeyType queryType){ - Calendar refTimeCal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); - // for testing ...refTimeCal.setTimeInMillis(1276581600000L); - //refTimeCal.setTimeInMillis(refTime.getTime()); - refTimeCal.setTimeInMillis(refTimeL); - return getObservedSndBufruaData(lat, lon, stn, refTimeCal, dataType, queryType); - } - - /* - * This API is provided for retrieving bufrUA data from PostgresSQL and HDF5 - * dataType should use "enum DataType" defined in NcSoundingLayer.java - * Support all dataType except "ALLDATA" data type - * using either lat/lon, stnId or stnNum and synopticTime as key - * reference time is with Calendar data type as input - * Chin's Note 2/28/2012:This API is used for bufrua query now. Should be replaced by - * getObservedSndBufruaDataGeneric() when point data query is implemented. + /* + * NOT used currently + * + * obsType: UAIR, TAMDAR or DROP, dataType: ALLDATA ONLY */ - @SuppressWarnings("unchecked") - public static NcSoundingProfile getObservedSndBufruaData(Double lat, Double lon, String stn, Calendar refTimeCal, String dataType,SndQueryKeyType queryType){ - //*System.out.println("getObservedSndBufruaData lat= " + lat+" lon="+lon+" refTime="+refTimeCal ); - //Timestamp refTime = new Timestamp(refTimeL); - //System.out.println("GMT ref time = "+ refTime.toGMTString()); - NcSoundingProfile pf = new NcSoundingProfile(); - List soundLyList = new ArrayList(); - if(dataType.equals(NcSoundingLayer.DataType.ALLDATA.toString())){ - //*System.out.println("request all data is not supported in this API"); - return pf; - } - else { - List fields = new ArrayList(); - List values = new ArrayList(); - List lUairRecords = null; - if(queryType==SndQueryKeyType.STNID){ - fields.add("stationName");// the stationName String field name defined in UAObs, dont be confused with UAIRRecord definition - values.add(stn); - } - else if(queryType==SndQueryKeyType.STNNUM){ - fields.add("location.stationId");// the location.stationId String field name defined in UAObs. dont be confused with UAIRRecord definition - values.add(stn); - } - else if(queryType==SndQueryKeyType.LATLON){ - fields.add("location.latitude");// the location.latitude field name defined in UAObs - values.add(lat); - fields.add("location.longitude");// the location.longitude field name defined in UAObs - values.add(lon); + /* + * @SuppressWarnings("unchecked") public static NcSoundingProfile + * getObservedSndData(int[] parentIds, String obType,String dataType) { + * NcSoundingProfile pf = new NcSoundingProfile(); //one StnPt represent one + * data time line List soundLyLst = new + * ArrayList(); NcSoundingLayer soundingLy; + * soundLyLst.clear(); + * + * obType = ObsSndType.UAIR.toString(); // currently assume all uair + * sounding type if(obType.equals(ObsSndType.UAIR.toString())){ + * //*System.out.println("parentIds length = " + parentIds.length ); for(int + * i=0; i + * fields = new ArrayList(); List values = new + * ArrayList(); List lObsLevels = null; + * fields.add("id");// the record id field name defined in UairRecord + * values.add(id); //testing 994872); + * if(!dataType.equals(NcSoundingLayer.DataType.ALLDATA.toString()) && + * !dataType.equals(NcSoundingLayer.DataType.MAXWIND_A.toString()) && + * !dataType.equals(NcSoundingLayer.DataType.TROPOPAUSE_A.toString())){ + * fields.add("dataType");// the record dataType field name defined in + * UairRecord values.add(dataType); //testing "TTAA" + * + * } CoreDao dao = new CoreDao(DaoConfig.forClass(UairRecord.class)); try { + * lObsLevels = (List) dao.queryByCriteria(fields, values); + * if(lObsLevels.size() > 0){ //since we are using Records id to query uair + * table. lObsLevels.size() should always be one. + * //*System.out.println("size of uairrecord " + lObsLevels.size()); + * //*System.out.println("id ="+lObsLevels.get(0).getId() + " datauri=" + * +lObsLevels.get(0).getDataURI()); + * //*System.out.println("size of ObsLevels =" + * +lObsLevels.get(0).getObsLevels().size() ); + * //*System.out.println("size of maxWind =" + * +lObsLevels.get(0).getMaxWind().size() ); + * //*System.out.println("size of Tropopause =" + * +lObsLevels.get(0).getTropopause().size() ); + * if((lObsLevels.get(0).getObsLevels().size()>0) && + * !dataType.equals(NcSoundingLayer.DataType.MAXWIND_A.toString()) && + * !dataType.equals(NcSoundingLayer.DataType.TROPOPAUSE_A.toString())){ + * java.util.Iterator + * it=lObsLevels.get(0).getObsLevels().iterator(); while(it.hasNext()) { + * ObsLevels value=(ObsLevels)it.next(); soundingLy = new NcSoundingLayer(); + * soundingLy.setGeoHeight(value.getGeoHeight()); + * soundingLy.setTemperature(value.getTemp()); + * soundingLy.setPressure(value.getPressure()); + * soundingLy.setWindDirection(value.getWindDirection()); if ( + * value.getWindSpeed() != NcSoundingLayer.MISSING ) { + * soundingLy.setWindSpeed + * ((float)metersPerSecondToKnots.convert((float)value.getWindSpeed())); } + * else { soundingLy.setWindSpeed((float)value.getWindSpeed()); } + * soundingLy.setDewpoint(value.getDwpt()); + * //*System.out.println("pressure :"+value.getPressure() + " temp:" + + * value.getTemp() + " H:"+value.getGeoHeight() ); + * soundLyLst.add(soundingLy); } } } + * + * if(lObsLevels.get(0).getMaxWind().size() >0 && + * !dataType.equals(NcSoundingLayer.DataType.TROPOPAUSE_A.toString())){ + * java.util.Iterator + * itWind=lObsLevels.get(0).getMaxWind().iterator(); + * + * while(itWind.hasNext()) { MaxWind value=(MaxWind)itWind.next(); + * soundingLy = new NcSoundingLayer(); + * soundingLy.setPressure(value.getPressure()); + * soundingLy.setWindDirection(value.getWindDirection()); if ( + * value.getWindSpeed() != NcSoundingLayer.MISSING ) { + * soundingLy.setWindSpeed + * ((float)metersPerSecondToKnots.convert((float)value.getWindSpeed())); } + * else { soundingLy.setWindSpeed((float)value.getWindSpeed()); } + * + * soundLyLst.add(soundingLy); } } + * + * if(lObsLevels.get(0).getTropopause().size() >0 && + * !dataType.equals(NcSoundingLayer.DataType.MAXWIND_A.toString())){ + * java.util.Iterator + * it=lObsLevels.get(0).getTropopause().iterator(); while(it.hasNext()) { + * Tropopause value=(Tropopause)it.next(); soundingLy = new + * NcSoundingLayer(); soundingLy.setTemperature(value.getTemp()); + * soundingLy.setPressure(value.getPressure()); + * soundingLy.setWindDirection(value.getWindDirection()); if ( + * value.getWindSpeed() != NcSoundingLayer.MISSING ) { + * soundingLy.setWindSpeed + * ((float)metersPerSecondToKnots.convert((float)value.getWindSpeed())); + * //*System.out.println("Tropopause pressure :"+value.getPressure() + + * " temp:" + value.getTemp()+" WD:" + value.getWindDirection() + + * " WS:"+(float + * )metersPerSecondToKnots.convert((float)value.getWindSpeed())); + * + * } else { soundingLy.setWindSpeed((float)value.getWindSpeed()); + * //*System.out.println("Tropopause pressure :"+value.getPressure() + + * " temp:" + value.getTemp()+" WD:" + value.getWindDirection() + + * " WS:"+(float)value.getWindSpeed()); + * + * } + * + * soundingLy.setDewpoint(value.getDwpt()); + * + * soundLyLst.add(soundingLy); + * + * } } } catch (DataAccessLayerException e) { + * //*System.out.println("obs sounding query exception"); + * //e.printStackTrace(); } + * + * } } pf.setSoundingLyLst(soundLyLst); return pf; + * + * } + */ + /* + * this api is provided for applications and for testing to retrieve + * observed bufruair data from PostgreSql DB & HDF5 dataType should use + * "enum DataType" defined in NcSoundingLayer.java Support "ALLDATA" data + * type only + */ + public static NcSoundingProfile getObservedSndBufruaAllData(Double lat, + Double lon, String stn, long refTimeL, SndQueryKeyType queryType) { + Calendar refTimeCal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); + // for testing ...refTimeCal.setTimeInMillis(1276581600000L); + // refTimeCal.setTimeInMillis(refTime.getTime()); + refTimeCal.setTimeInMillis(refTimeL); + return getObservedSndBufruaAllData(lat, lon, stn, refTimeCal, queryType); + } - } - else { - System.out.println("request query type "+ queryType+ " is not supported in this API" ); - return pf; - } - fields.add("dataTime.refTime");// the synoptic time field name defined in UAObs - //fields.add("validTime");// the synoptic time field name defined in UAObs - values.add(refTimeCal.getTime()); - fields.add("reportType");// the record dataType field name defined in UAObs - int intDataType = NcSoundingLayer.dataTypeMap.get(dataType); - values.add(intDataType); + /* + * this api is provided for applications and for testing to retrieve + * observed bufruair data from PostgreSql DB & HDF5 dataType should use + * "enum DataType" defined in NcSoundingLayer.java Support "ALLDATA" data + * type only + */ + public static NcSoundingProfile getObservedSndBufruaAllData(Double lat, + Double lon, String stn, Calendar refTimeCal, + SndQueryKeyType queryType) { + NcSoundingProfile pfAll = new NcSoundingProfile(); + List soundingLyLst, finalsoundingLyLst; + NcSoundingProfile pf = getObservedSndBufruaData(lat, lon, stn, + refTimeCal, "TTAA", queryType); + pfAll.setStationElevation(pf.getStationElevation()); + finalsoundingLyLst = pf.getSoundingLyLst(); + soundingLyLst = getObservedSndBufruaData(lat, lon, stn, refTimeCal, + "TTBB", queryType).getSoundingLyLst(); + if (soundingLyLst.size() >= 0) { + finalsoundingLyLst.addAll(soundingLyLst); + } + soundingLyLst = getObservedSndBufruaData(lat, lon, stn, refTimeCal, + "TTCC", queryType).getSoundingLyLst(); + if (soundingLyLst.size() >= 0) { + finalsoundingLyLst.addAll(soundingLyLst); + } + soundingLyLst = getObservedSndBufruaData(lat, lon, stn, refTimeCal, + "TTDD", queryType).getSoundingLyLst(); + if (soundingLyLst.size() >= 0) { + finalsoundingLyLst.addAll(soundingLyLst); + } + // soundingLyLst = getObservedSndBufruaData(lat, lon, stn,refTimeCal, + // "PPAA", queryType).getSoundingLyLst(); + // if (soundingLyLst.size() >= 0){ + // finalsoundingLyLst.addAll(soundingLyLst); + // } + soundingLyLst = getObservedSndBufruaData(lat, lon, stn, refTimeCal, + "PPBB", queryType).getSoundingLyLst(); + if (soundingLyLst.size() >= 0) { + finalsoundingLyLst.addAll(soundingLyLst); + } + // soundingLyLst = getObservedSndBufruaData(lat, lon, stn,refTimeCal, + // "PPCC", queryType).getSoundingLyLst(); + // if (soundingLyLst.size() >= 0){ + // finalsoundingLyLst.addAll(soundingLyLst); + // } + soundingLyLst = getObservedSndBufruaData(lat, lon, stn, refTimeCal, + "PPDD", queryType).getSoundingLyLst(); + if (soundingLyLst.size() >= 0) { + finalsoundingLyLst.addAll(soundingLyLst); + } + soundingLyLst = getObservedSndBufruaData(lat, lon, stn, refTimeCal, + "MAXWIND_A", queryType).getSoundingLyLst(); + if (soundingLyLst.size() >= 0) { + finalsoundingLyLst.addAll(soundingLyLst); + } + soundingLyLst = getObservedSndBufruaData(lat, lon, stn, refTimeCal, + "MAXWIND_C", queryType).getSoundingLyLst(); + if (soundingLyLst.size() >= 0) { + finalsoundingLyLst.addAll(soundingLyLst); + } + soundingLyLst = getObservedSndBufruaData(lat, lon, stn, refTimeCal, + "TROPOPAUSE_A", queryType).getSoundingLyLst(); + if (soundingLyLst.size() >= 0) { + finalsoundingLyLst.addAll(soundingLyLst); + } + soundingLyLst = getObservedSndBufruaData(lat, lon, stn, refTimeCal, + "TROPOPAUSE_C", queryType).getSoundingLyLst(); + if (soundingLyLst.size() >= 0) { + finalsoundingLyLst.addAll(soundingLyLst); + } + pfAll.setSoundingLyLst(finalsoundingLyLst); + return pfAll; + } - //for (int i=0; i < fields.size(); i++) { - // System.out.println("field "+ fields.get(i) + " value "+ values.get(i)); - //} - CoreDao dao = new CoreDao(DaoConfig.forClass(UAObs.class)); - try { - lUairRecords = (List) dao.queryByCriteria(fields, values); - if(lUairRecords.size() > 0){ - //set pf data - //System.out.println("record size = "+ lUairRecords.size() + " reportType="+dataType); - - int lastCorrectedRecord=0; - String currentCorInd = ""; - - if(lUairRecords.size() > 1){ - for(int i=0; i< lUairRecords.size(); i++){ - //Since we are using lat/lon/refTime to query uair table. We may have several records returned for - // one query. It indicates there is a correction report, then we should use the newest one report. - // we compare corIndicator to find the latest record. - - if(lUairRecords.get(i).getCorIndicator()!= null && currentCorInd.compareTo(lUairRecords.get(i).getCorIndicator()) < 0){ - currentCorInd = lUairRecords.get(i).getCorIndicator(); - lastCorrectedRecord = i; - } - } - } - UAObs uairRecord = lUairRecords.get(lastCorrectedRecord); - pf.setStationLatitude((float)uairRecord.getLatitude()); - pf.setStationLongitude((float)uairRecord.getLongitude()); - pf.setStationElevation((float)uairRecord.getElevation()); - if(uairRecord.getStationId()!= null && uairRecord.getStationId().length()>0) - pf.setStationNum(Integer.parseInt(uairRecord.getStationId())); - pf.setStationId(uairRecord.getStationName()); - int hdfIndex = uairRecord.getIdx(); - if(hdfIndex >= 0) { - //System.out.println("selected stn lon= " + lon + - // " lat = "+ lat + " elv = "+ pf.getStationElevation() + " h5 table Y index ="+ hdfIndex); - BufrUADao uadao = new BufrUADao("bufrua"); - uairRecord.setPluginName("bufrua"); - File hdf5loc = uadao.getFullFilePath(uairRecord); - //System.out.println("hdf5 path = " + hdf5loc.getAbsolutePath()); - IDataStore dataStore = DataStoreFactory.getDataStore(hdf5loc); + /* + * this api is provided for applications and for testing to retrieve + * observed BufrUA data from PostgreSql DB and HDF5 dataType should use + * "enum DataType" defined in NcSoundingLayer.java Support all dataType + * except "ALLDATA" data type using either lat/lon, stnId or stnNum and + * validTime as key refTime is with unit of msec as input + */ + public static NcSoundingProfile getObservedSndBufruaData(Double lat, + Double lon, String stn, long refTimeL, String dataType, + SndQueryKeyType queryType) { + Calendar refTimeCal = Calendar.getInstance(TimeZone.getTimeZone("GMT")); + // for testing ...refTimeCal.setTimeInMillis(1276581600000L); + // refTimeCal.setTimeInMillis(refTime.getTime()); + refTimeCal.setTimeInMillis(refTimeL); + return getObservedSndBufruaData(lat, lon, stn, refTimeCal, dataType, + queryType); + } - FloatDataRecord sfcPressurefloatData = (FloatDataRecord) dataStore.retrieve( - "/", "sfcPressure", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] sfcPressuredata = sfcPressurefloatData.getFloatData(); - if(sfcPressuredata.length>0) - pf.setSfcPress(sfcPressuredata[0]/100F); + /* + * This API is provided for retrieving bufrUA data from PostgresSQL and HDF5 + * dataType should use "enum DataType" defined in NcSoundingLayer.java + * Support all dataType except "ALLDATA" data type using either lat/lon, + * stnId or stnNum and synopticTime as key reference time is with Calendar + * data type as input Chin's Note 2/28/2012:This API is used for bufrua + * query now. Should be replaced by getObservedSndBufruaDataGeneric() when + * point data query is implemented. + */ + @SuppressWarnings("unchecked") + public static NcSoundingProfile getObservedSndBufruaData(Double lat, + Double lon, String stn, Calendar refTimeCal, String dataType, + SndQueryKeyType queryType) { + // *System.out.println("getObservedSndBufruaData lat= " + + // lat+" lon="+lon+" refTime="+refTimeCal ); + // Timestamp refTime = new Timestamp(refTimeL); + // System.out.println("GMT ref time = "+ refTime.toGMTString()); + NcSoundingProfile pf = new NcSoundingProfile(); + List soundLyList = new ArrayList(); + if (dataType.equals(NcSoundingLayer.DataType.ALLDATA.toString())) { + // *System.out.println("request all data is not supported in this API"); + return pf; + } else { + List fields = new ArrayList(); + List values = new ArrayList(); + List lUairRecords = null; + if (queryType == SndQueryKeyType.STNID) { + fields.add("stationName");// the stationName String field name + // defined in UAObs, dont be confused + // with UAIRRecord definition + values.add(stn); + } else if (queryType == SndQueryKeyType.STNNUM) { + fields.add("location.stationId");// the location.stationId + // String field name defined in + // UAObs. dont be confused with + // UAIRRecord definition + values.add(stn); + } else if (queryType == SndQueryKeyType.LATLON) { + fields.add("location.latitude");// the location.latitude field + // name defined in UAObs + values.add(lat); + fields.add("location.longitude");// the location.longitude field + // name defined in UAObs + values.add(lon); - NcSoundingLayer soundingLy; - //based on requested data type: - // get temp, dew point, pressure, wind u/v components, and height - //they are 2-D tables - if(dataType.equals(NcSoundingLayer.DataType.TTAA.toString()) || - dataType.equals(NcSoundingLayer.DataType.TTCC.toString())) - { - //get mandatory data size - IntegerDataRecord numManIntData = (IntegerDataRecord) dataStore.retrieve( - "/", "numMand", Request.buildYLineRequest(new int[] {hdfIndex})); - int[] sizes = numManIntData.getIntData(); - // sizes is a 1x1 2d table. Only first (0) element is valid. - if(sizes[0] >0){ - FloatDataRecord pressurefloatData = (FloatDataRecord) dataStore.retrieve( - "/", "prMan", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] pressuredata = pressurefloatData.getFloatData(); - FloatDataRecord temperaturefloatData = (FloatDataRecord) dataStore.retrieve( - "/", "tpMan", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] temperaturedata = temperaturefloatData.getFloatData(); - FloatDataRecord dewptfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "tdMan", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] dewptdata = dewptfloatData.getFloatData(); - FloatDataRecord windDfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "wdMan", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] windDdata = windDfloatData.getFloatData(); - FloatDataRecord windSfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "wsMan", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] windSdata = windSfloatData.getFloatData(); - FloatDataRecord htfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "htMan", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] htdata = htfloatData.getFloatData(); - for (int i=0; i0){ - FloatDataRecord pressurefloatData = (FloatDataRecord) dataStore.retrieve( - "/", "prSigT", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] pressuredata = pressurefloatData.getFloatData(); - FloatDataRecord temperaturefloatData = (FloatDataRecord) dataStore.retrieve( - "/", "tpSigT", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] temperaturedata = temperaturefloatData.getFloatData(); - FloatDataRecord dewptfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "tdSigT", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] dewptdata = dewptfloatData.getFloatData(); - for (int i=0; i0){ - FloatDataRecord htfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "htSigW", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] htdata = htfloatData.getFloatData(); - FloatDataRecord windDfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "wdSigW", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] windDdata = windDfloatData.getFloatData(); - FloatDataRecord windSfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "wsSigW", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] windSdata = windSfloatData.getFloatData(); - for (int i=0; i0){ - FloatDataRecord pressurefloatData = (FloatDataRecord) dataStore.retrieve( - "/", "prMaxW", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] pressuredata = pressurefloatData.getFloatData(); - FloatDataRecord windDfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "wdMaxW", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] windDdata = windDfloatData.getFloatData(); - FloatDataRecord windSfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "wsMaxW", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] windSdata = windSfloatData.getFloatData(); - for (int i=0; i0){ - FloatDataRecord pressurefloatData = (FloatDataRecord) dataStore.retrieve( - "/", "prTrop", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] pressuredata = pressurefloatData.getFloatData(); - FloatDataRecord temperaturefloatData = (FloatDataRecord) dataStore.retrieve( - "/", "tpTrop", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] temperaturedata = temperaturefloatData.getFloatData(); - FloatDataRecord dewptfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "tdTrop", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] dewptdata = dewptfloatData.getFloatData(); - FloatDataRecord windDfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "wdTrop", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] windDdata = windDfloatData.getFloatData(); - FloatDataRecord windSfloatData = (FloatDataRecord) dataStore.retrieve( - "/", "wsTrop", Request.buildYLineRequest(new int[] {hdfIndex})); - float[] windSdata = windSfloatData.getFloatData(); - for (int i=0; i) dao + .queryByCriteria(fields, values); + if (lUairRecords.size() > 0) { + // set pf data + // System.out.println("record size = "+ lUairRecords.size() + // + " reportType="+dataType); - } catch (Exception e) { - //*System.out.println("exception=" + e ); - e.printStackTrace(); - return pf; - } - //*System.out.println("sounding layer size = "+ soundLyList.size()); - - pf.setSoundingLyLst(soundLyList); + int lastCorrectedRecord = 0; + String currentCorInd = ""; - return pf; - - - } - } + if (lUairRecords.size() > 1) { + for (int i = 0; i < lUairRecords.size(); i++) { + // Since we are using lat/lon/refTime to query uair + // table. We may have several records returned for + // one query. It indicates there is a correction + // report, then we should use the newest one report. + // we compare corIndicator to find the latest + // record. + + if ((lUairRecords.get(i).getCorIndicator() != null) + && (currentCorInd.compareTo(lUairRecords + .get(i).getCorIndicator()) < 0)) { + currentCorInd = lUairRecords.get(i) + .getCorIndicator(); + lastCorrectedRecord = i; + } + } + } + UAObs uairRecord = lUairRecords.get(lastCorrectedRecord); + pf.setStationLatitude((float) uairRecord.getLatitude()); + pf.setStationLongitude((float) uairRecord.getLongitude()); + pf.setStationElevation(uairRecord.getElevation()); + if ((uairRecord.getStationId() != null) + && (uairRecord.getStationId().length() > 0)) { + pf.setStationNum(Integer.parseInt(uairRecord + .getStationId())); + } + pf.setStationId(uairRecord.getStationName()); + int hdfIndex = uairRecord.getIdx(); + if (hdfIndex >= 0) { + // System.out.println("selected stn lon= " + lon + + // " lat = "+ lat + " elv = "+ pf.getStationElevation() + // + " h5 table Y index ="+ hdfIndex); + BufrUADao uadao = new BufrUADao("bufrua"); + File hdf5loc = uadao.getFullFilePath(uairRecord); + // System.out.println("hdf5 path = " + + // hdf5loc.getAbsolutePath()); + IDataStore dataStore = DataStoreFactory + .getDataStore(hdf5loc); + + FloatDataRecord sfcPressurefloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "sfcPressure", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] sfcPressuredata = sfcPressurefloatData + .getFloatData(); + if (sfcPressuredata.length > 0) { + pf.setSfcPress(sfcPressuredata[0] / 100F); + } + + NcSoundingLayer soundingLy; + // based on requested data type: + // get temp, dew point, pressure, wind u/v components, + // and height + // they are 2-D tables + if (dataType.equals(NcSoundingLayer.DataType.TTAA + .toString()) + || dataType + .equals(NcSoundingLayer.DataType.TTCC + .toString())) { + // get mandatory data size + IntegerDataRecord numManIntData = (IntegerDataRecord) dataStore + .retrieve( + "/", + "numMand", + Request.buildYLineRequest(new int[] { hdfIndex })); + int[] sizes = numManIntData.getIntData(); + // sizes is a 1x1 2d table. Only first (0) element + // is valid. + if (sizes[0] > 0) { + FloatDataRecord pressurefloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "prMan", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] pressuredata = pressurefloatData + .getFloatData(); + FloatDataRecord temperaturefloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "tpMan", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] temperaturedata = temperaturefloatData + .getFloatData(); + FloatDataRecord dewptfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "tdMan", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] dewptdata = dewptfloatData + .getFloatData(); + FloatDataRecord windDfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "wdMan", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] windDdata = windDfloatData + .getFloatData(); + FloatDataRecord windSfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "wsMan", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] windSdata = windSfloatData + .getFloatData(); + FloatDataRecord htfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "htMan", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] htdata = htfloatData.getFloatData(); + for (int i = 0; i < sizes[0]; i++) { + soundingLy = new NcSoundingLayer(); + // if data is not available, dont convert it + // and just use default setting data + if (temperaturedata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setTemperature((float) kelvinToCelsius + .convert(temperaturedata[i])); + } + if (pressuredata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setPressure(pressuredata[i] / 100F); + } + if (windSdata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setWindSpeed((float) metersPerSecondToKnots + .convert(windSdata[i])); + } + soundingLy.setWindDirection(windDdata[i]); + if (dewptdata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setDewpoint((float) kelvinToCelsius + .convert(dewptdata[i])); + } + soundingLy.setGeoHeight(htdata[i]); + soundLyList.add(soundingLy); + } + // debug + // for(NcSoundingLayer ly: soundLyList){ + // System.out.println("Mandatory "+ dataType + + // ":: Pre= "+ly.getPressure()+ " Dew= "+ + // ly.getDewpoint()+ " T= "+ ly.getTemperature() + // + " WS= " + ly.getWindSpeed() + " WD= " + + // ly.getWindDirection()); + // } + } else { + System.out + .println("Mandatory data is not available! request data tye is " + + dataType); + } + } else if (dataType + .equals(NcSoundingLayer.DataType.TTBB + .toString()) + || dataType + .equals(NcSoundingLayer.DataType.TTDD + .toString())) { + // get significantT data size + IntegerDataRecord numSigtIntData = (IntegerDataRecord) dataStore + .retrieve( + "/", + "numSigT", + Request.buildYLineRequest(new int[] { hdfIndex })); + int[] sizes = numSigtIntData.getIntData(); + // sizes is a 1x1 2d table. Only first (0) element + // is valid. + if (sizes[0] > 0) { + FloatDataRecord pressurefloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "prSigT", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] pressuredata = pressurefloatData + .getFloatData(); + FloatDataRecord temperaturefloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "tpSigT", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] temperaturedata = temperaturefloatData + .getFloatData(); + FloatDataRecord dewptfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "tdSigT", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] dewptdata = dewptfloatData + .getFloatData(); + for (int i = 0; i < sizes[0]; i++) { + soundingLy = new NcSoundingLayer(); + // if data is not available, dont convert it + // and just use default setting data + if (temperaturedata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setTemperature((float) kelvinToCelsius + .convert(temperaturedata[i])); + } + if (pressuredata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setPressure(pressuredata[i] / 100F); + } + if (dewptdata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setDewpoint((float) kelvinToCelsius + .convert(dewptdata[i])); + } + soundLyList.add(soundingLy); + } + // for(NcSoundingLayer ly: soundLyList){ + // System.out.println("SigT "+ dataType + + // ":: Pre= "+ly.getPressure()+ " Dew= "+ + // ly.getDewpoint()+ " T= "+ + // ly.getTemperature()); + // } + } else { + System.out + .println("SigT data is not available! request data tye is " + + dataType); + } + + } else if (dataType + .equals(NcSoundingLayer.DataType.PPBB + .toString()) + || dataType + .equals(NcSoundingLayer.DataType.PPDD + .toString())) { + // get significantW data size + IntegerDataRecord numSigwIntData = (IntegerDataRecord) dataStore + .retrieve( + "/", + "numSigW", + Request.buildYLineRequest(new int[] { hdfIndex })); + int[] sizes = numSigwIntData.getIntData(); + // sizes is a 1x1 2d table. Only first (0) element + // is valid. + if (sizes[0] > 0) { + FloatDataRecord htfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "htSigW", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] htdata = htfloatData.getFloatData(); + FloatDataRecord windDfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "wdSigW", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] windDdata = windDfloatData + .getFloatData(); + FloatDataRecord windSfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "wsSigW", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] windSdata = windSfloatData + .getFloatData(); + for (int i = 0; i < sizes[0]; i++) { + soundingLy = new NcSoundingLayer(); + // if data is not available, dont convert it + // and just use default setting data + soundingLy.setGeoHeight(htdata[i]); + if (windSdata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setWindSpeed((float) metersPerSecondToKnots + .convert(windSdata[i])); + } + soundingLy.setWindDirection(windDdata[i]); + soundLyList.add(soundingLy); + } + // for(NcSoundingLayer ly: soundLyList){ + // System.out.println("SigW "+ dataType + + // ":: Ht= "+ly.getGeoHeight()+" WS= " + + // ly.getWindSpeed() + " WD= " + + // ly.getWindDirection()); + // } + } else { + System.out + .println("SigW data is not available! request data tye is " + + dataType); + } + } else if (dataType + .equals(NcSoundingLayer.DataType.MAXWIND_A + .toString()) + || dataType + .equals(NcSoundingLayer.DataType.MAXWIND_C + .toString())) { + // get max wind data size + IntegerDataRecord numMwndIntData = (IntegerDataRecord) dataStore + .retrieve( + "/", + "numMwnd", + Request.buildYLineRequest(new int[] { hdfIndex })); + int[] sizes = numMwndIntData.getIntData(); + // sizes is a 1x1 2d table. Only first (0) element + // is valid. + if (sizes[0] > 0) { + FloatDataRecord pressurefloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "prMaxW", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] pressuredata = pressurefloatData + .getFloatData(); + FloatDataRecord windDfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "wdMaxW", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] windDdata = windDfloatData + .getFloatData(); + FloatDataRecord windSfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "wsMaxW", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] windSdata = windSfloatData + .getFloatData(); + for (int i = 0; i < sizes[0]; i++) { + soundingLy = new NcSoundingLayer(); + // if data is not available, dont convert it + // and just use default setting data + if (pressuredata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setPressure(pressuredata[i] / 100F); + } + if (windSdata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setWindSpeed((float) metersPerSecondToKnots + .convert(windSdata[i])); + } + soundingLy.setWindDirection(windDdata[i]); + soundLyList.add(soundingLy); + } + // for(NcSoundingLayer ly: soundLyList){ + // System.out.println("MAXwind "+ dataType + + // ":: Pre= "+ly.getPressure()+ " WS= " + + // ly.getWindSpeed() + " WD= " + + // ly.getWindDirection()); + // } + } else { + System.out + .println("max wind data is not available! request data tye is " + + dataType); + } + } else if (dataType + .equals(NcSoundingLayer.DataType.TROPOPAUSE_A + .toString()) + || dataType + .equals(NcSoundingLayer.DataType.TROPOPAUSE_C + .toString())) { + // get troppause data size + IntegerDataRecord numTropIntData = (IntegerDataRecord) dataStore + .retrieve( + "/", + "numTrop", + Request.buildYLineRequest(new int[] { hdfIndex })); + int[] sizes = numTropIntData.getIntData(); + // sizes is a 1x1 2d table. Only first (0) element + // is valid. + if (sizes[0] > 0) { + FloatDataRecord pressurefloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "prTrop", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] pressuredata = pressurefloatData + .getFloatData(); + FloatDataRecord temperaturefloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "tpTrop", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] temperaturedata = temperaturefloatData + .getFloatData(); + FloatDataRecord dewptfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "tdTrop", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] dewptdata = dewptfloatData + .getFloatData(); + FloatDataRecord windDfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "wdTrop", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] windDdata = windDfloatData + .getFloatData(); + FloatDataRecord windSfloatData = (FloatDataRecord) dataStore + .retrieve( + "/", + "wsTrop", + Request.buildYLineRequest(new int[] { hdfIndex })); + float[] windSdata = windSfloatData + .getFloatData(); + for (int i = 0; i < sizes[0]; i++) { + soundingLy = new NcSoundingLayer(); + // if data is not available, dont convert it + // and just use default setting data + if (temperaturedata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setTemperature((float) kelvinToCelsius + .convert(temperaturedata[i])); + } + if (pressuredata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setPressure(pressuredata[i] / 100F); + } + if (windSdata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setWindSpeed((float) metersPerSecondToKnots + .convert(windSdata[i])); + } + soundingLy.setWindDirection(windDdata[i]); + if (dewptdata[i] != NcSoundingLayer.MISSING) { + soundingLy + .setDewpoint((float) kelvinToCelsius + .convert(dewptdata[i])); + } + soundLyList.add(soundingLy); + } + // debug + // for(NcSoundingLayer ly: soundLyList){ + // System.out.println("Troppause "+ dataType + + // ":: Pre= "+ly.getPressure()+ " Dew= "+ + // ly.getDewpoint()+ " T= "+ ly.getTemperature() + // + " WS= " + ly.getWindSpeed() + " WD= " + + // ly.getWindDirection()); + // } + } else { + System.out + .println("Troppause data is not available! request data tye is " + + dataType); + } + } + + } else { + System.out + .println("hdf5 index (idx) is less than 0!!!"); + return pf; + } + } else { + System.out + .println("buffrua (UAOb) record is not available!! request type " + + dataType); + return pf; + } + + } catch (Exception e) { + // *System.out.println("exception=" + e ); + e.printStackTrace(); + return pf; + } + // *System.out.println("sounding layer size = "+ + // soundLyList.size()); + + pf.setSoundingLyLst(soundLyList); + + return pf; + + } + } } diff --git a/ncep/gov.noaa.nws.ncep.ui.pgen/src/gov/noaa/nws/ncep/ui/pgen/store/StorageUtils.java b/ncep/gov.noaa.nws.ncep.ui.pgen/src/gov/noaa/nws/ncep/ui/pgen/store/StorageUtils.java index 2fd871e5d9..07ed6e5835 100644 --- a/ncep/gov.noaa.nws.ncep.ui.pgen/src/gov/noaa/nws/ncep/ui/pgen/store/StorageUtils.java +++ b/ncep/gov.noaa.nws.ncep.ui.pgen/src/gov/noaa/nws/ncep/ui/pgen/store/StorageUtils.java @@ -48,7 +48,8 @@ import com.raytheon.viz.core.mode.CAVEMode; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * Apr 22, 2013 sgilbert Initial creation + * Apr 22, 2013 sgilbert Initial creation + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @@ -134,8 +135,9 @@ public class StorageUtils { if (promptOnOverwrite) { boolean answer = promptIfActivityExists(info); - if (!answer) + if (!answer) { return null; + } } try { @@ -208,7 +210,6 @@ public class StorageUtils { record.setStatus(info.getStatus()); record.setDataTime(new DataTime(info.getRefTime())); - record.setPluginName("pgen"); try { record.constructDataURI(); } catch (PluginException e1) { @@ -226,8 +227,9 @@ public class StorageUtils { DbQueryResponse response; try { response = (DbQueryResponse) ThriftClient.sendRequest(request); - if (response.getResults().size() == 1) + if (response.getResults().size() == 1) { exists = true; + } System.out.println("GOT RESPONSE BACK = " + response.getResults().size()); } catch (Exception e) { @@ -384,8 +386,9 @@ public class StorageUtils { if (promptOnOverwrite) { boolean answer = promptIfProductExists(dataURI, name); - if (!answer) + if (!answer) { return; + } } StoreDerivedProductRequest request = new StoreDerivedProductRequest( @@ -452,8 +455,9 @@ public class StorageUtils { "Cannot retrieve list of derived product names.", e); } for (String prod : products) { - if (prod.equals(name)) + if (prod.equals(name)) { return true; + } } return exists; diff --git a/ost/gov.noaa.nws.ost.edex.plugin.regionalsat/src/gov/noaa/nws/ost/edex/plugin/regionalsat/decoder/RegionalSatDecoder.java b/ost/gov.noaa.nws.ost.edex.plugin.regionalsat/src/gov/noaa/nws/ost/edex/plugin/regionalsat/decoder/RegionalSatDecoder.java index 59d2891382..0781ed88b5 100644 --- a/ost/gov.noaa.nws.ost.edex.plugin.regionalsat/src/gov/noaa/nws/ost/edex/plugin/regionalsat/decoder/RegionalSatDecoder.java +++ b/ost/gov.noaa.nws.ost.edex.plugin.regionalsat/src/gov/noaa/nws/ost/edex/plugin/regionalsat/decoder/RegionalSatDecoder.java @@ -53,13 +53,13 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; * * SOFTWARE HISTORY * - * date Ticket# Engineer Description + * Date Ticket# Engineer Description * ----------- ---------- ----------- -------------------------- - * 7/15/11 tk Initial Creation - * - AWIPS2 Baseline Repository -------- - * 07/12/2012 798 jkorman Changed projection "magic" numbers - * 09/24/2012 1210 jkorman Modified the decode method to create the + * Jul 15, 2011 tk Initial Creation + * Jul 12, 2012 798 jkorman Changed projection "magic" numbers + * Sep 24, 2012 1210 jkorman Modified the decode method to create the * IDataRecord required by the SatelliteDao + * Aug 30, 2013 2298 rjpeter Make getPluginName abstract * * * @author tk @@ -69,9 +69,9 @@ import com.raytheon.uf.edex.decodertools.time.TimeTools; public class RegionalSatDecoder extends AbstractDecoder { private static final IUFStatusHandler handler = UFStatus - .getHandler(AbstractDecoder.class); + .getHandler(AbstractDecoder.class); - private String traceId = ""; + private final String traceId = ""; private String source; @@ -91,7 +91,8 @@ public class RegionalSatDecoder extends AbstractDecoder { * alaskasat-ingest.xml and the dao and source members are set when the * RegionalSatDecoder instance is initialized: * - * @param data The file byte array data to be decoded. + * @param data + * The file byte array data to be decoded. * @return The decoded data record(s). */ public PluginDataObject[] decode(byte[] data) throws Exception { @@ -130,7 +131,7 @@ public class RegionalSatDecoder extends AbstractDecoder { if (entity != null) { String parsed = getCreatingEntity(entity); - if (parsed != null && parsed.length() > 0) { + if ((parsed != null) && (parsed.length() > 0)) { record.setCreatingEntity(parsed); } else { record.setCreatingEntity(entity); @@ -247,7 +248,7 @@ public class RegionalSatDecoder extends AbstractDecoder { ny = numRecords; // read the image as byte data and store as byte array - record.setMessageData((byte[]) netCdfFile.readSection("image") + record.setMessageData(netCdfFile.readSection("image") .get1DJavaArray(Class.forName("java.lang.Byte"))); // get the latitude of the first point, upper left corner @@ -315,15 +316,16 @@ public class RegionalSatDecoder extends AbstractDecoder { record.setCoverage(mapCoverage); record.setPersistenceTime(TimeTools.getSystemCalendar() .getTime()); - record.setPluginName("satellite"); record.constructDataURI(); // Set the data into the IDataRecord IDataRecord dataRec = SatelliteRecord.getDataRecord(record); - if(dataRec != null) { + if (dataRec != null) { record.setMessageData(dataRec); } else { - handler.error(String.format("Could not create datarecord for %s"), traceId); + handler.error( + String.format("Could not create datarecord for %s"), + traceId); record = null; } @@ -391,5 +393,5 @@ public class RegionalSatDecoder extends AbstractDecoder { public void setFilename(String file) { this.filename = file; } - + } diff --git a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.py b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.py index 4187bb40ae..8b8e150e1e 100644 --- a/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.py +++ b/pythonPackages/dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/GFERecord.py @@ -87,10 +87,7 @@ class GFERecord(object): self.dataURI = dataURI def getPluginName(self): - return self.pluginName - - def setPluginName(self, pluginName): - self.pluginName = pluginName + return "gfe" def getDataTime(self): return self.dataTime diff --git a/pythonPackages/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridDataRequest.py b/pythonPackages/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridDataRequest.py index 082dea578a..839d5fbfee 100644 --- a/pythonPackages/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridDataRequest.py +++ b/pythonPackages/dynamicserialize/dstypes/gov/noaa/nws/ncep/common/dataplugin/gempak/request/GetGridDataRequest.py @@ -34,7 +34,7 @@ class GetGridDataRequest(object): def getFcstsec(self): return self.fcstsec - def setFcstSec(self, reftime): + def setFcstSec(self, fcstsec): self.fcstsec = fcstsec def getLevel1(self): diff --git a/rpms/awips2.cave/Installer.alertviz/component.spec b/rpms/awips2.cave/Installer.alertviz/component.spec index 6979838d6a..5a6a47eebe 100644 --- a/rpms/awips2.cave/Installer.alertviz/component.spec +++ b/rpms/awips2.cave/Installer.alertviz/component.spec @@ -70,6 +70,10 @@ fi if [ $? -ne 0 ]; then exit 1 fi +/bin/mkdir -p %{_build_root}/etc/gdm/PostSession +if [ $? -ne 0 ]; then + exit 1 +fi build_arch=%{_build_arch} if [ "${build_arch}" = "i386" ]; then @@ -90,6 +94,10 @@ alertviz_project="${viz_rpm_dir}/Installer.alertviz" script_="${alertviz_project}/scripts/autostart/awips2-alertviz.desktop" /bin/cp ${script_} %{_build_root}/etc/xdg/autostart +# install the gnome session kill script for cave and alertviz +script_="%{_baseline_workspace}/build/static/linux/cave/awips2VisualizeUtility.sh" +/bin/cp ${script_} %{_build_root}/etc/gdm/PostSession + # add the license information. license_dir="%{_baseline_workspace}/rpms/legal" cp "${license_dir}/license.txt" \ @@ -107,6 +115,8 @@ fi %pre %post +echo -e "\nInstalling A2 gdm PostSession Default script" +scp /etc/gdm/PostSession/awips2VisualizeUtility.sh /etc/gdm/PostSession/Default %preun %postun @@ -142,3 +152,4 @@ rm -rf ${RPM_BUILD_ROOT} /awips2/alertviz/*.sh %attr(644,root,root) /etc/xdg/autostart/awips2-alertviz.desktop +%attr(644,root,root) /etc/gdm/PostSession/awips2VisualizeUtility.sh diff --git a/rpms/awips2.core/Installer.ldm/component.spec b/rpms/awips2.core/Installer.ldm/component.spec index 2567ecb354..a2d7e31853 100644 --- a/rpms/awips2.core/Installer.ldm/component.spec +++ b/rpms/awips2.core/Installer.ldm/component.spec @@ -173,6 +173,7 @@ rm -f %{_ldm_src_tar} if [ $? -ne 0 ]; then exit 1 fi +chown -R ldm:fxalpha ${_ldm_dir} # create .bash_profile if [ ! -f /usr/local/ldm/.bash_profile ]; then diff --git a/rpms/awips2.core/Installer.ldm/src/ldm-6.11.5.tar.gz b/rpms/awips2.core/Installer.ldm/src/ldm-6.11.5.tar.gz index 373d4b4089..72cec41394 100644 Binary files a/rpms/awips2.core/Installer.ldm/src/ldm-6.11.5.tar.gz and b/rpms/awips2.core/Installer.ldm/src/ldm-6.11.5.tar.gz differ diff --git a/rpms/awips2.core/Installer.python/nativeLib/x86_64/gridslice.so b/rpms/awips2.core/Installer.python/nativeLib/x86_64/gridslice.so old mode 100644 new mode 100755 index 46b680e017..d38fd49fb8 Binary files a/rpms/awips2.core/Installer.python/nativeLib/x86_64/gridslice.so and b/rpms/awips2.core/Installer.python/nativeLib/x86_64/gridslice.so differ diff --git a/rpms/build/x86_64/build.sh b/rpms/build/x86_64/build.sh index 3311961337..11a71344c4 100644 --- a/rpms/build/x86_64/build.sh +++ b/rpms/build/x86_64/build.sh @@ -399,21 +399,22 @@ fi if [ "${1}" = "-viz" ]; then buildRPM "awips2" buildRPM "awips2-common-base" - buildRPM "awips2-adapt-native" - unpackHttpdPypies - if [ $? -ne 0 ]; then - exit 1 - fi - buildRPM "awips2-httpd-pypies" - buildRPM "awips2-hydroapps-shared" - buildRPM "awips2-rcm" + #buildRPM "awips2-python-dynamicserialize" + #buildRPM "awips2-adapt-native" + #unpackHttpdPypies + #if [ $? -ne 0 ]; then + # exit 1 + #fi + #buildRPM "awips2-httpd-pypies" + #buildRPM "awips2-hydroapps-shared" + #buildRPM "awips2-rcm" #buildRPM "awips2-tools" #buildRPM "awips2-cli" buildCAVE if [ $? -ne 0 ]; then exit 1 fi - buildRPM "awips2-alertviz" + #buildRPM "awips2-alertviz" exit 0 fi @@ -424,6 +425,7 @@ if [ "${1}" = "-edex" ]; then if [ $? -ne 0 ]; then exit 1 fi + buildRPM "awips2-python-dynamicserialize" exit 0 fi @@ -433,7 +435,8 @@ if [ "${1}" = "-custom" ]; then #if [ $? -ne 0 ]; then # exit 1 #fi - buildRPM "awips2-alertviz" + buildRPM "awips2-python" + #buildRPM "awips2-alertviz" #buildRPM "awips2-eclipse" exit 0 diff --git a/tests/unit/com/raytheon/uf/common/archive/ArchiveConfigManagerTest.java b/tests/unit/com/raytheon/uf/common/archive/ArchiveConfigManagerTest.java index ce94df87df..8df168ed93 100644 --- a/tests/unit/com/raytheon/uf/common/archive/ArchiveConfigManagerTest.java +++ b/tests/unit/com/raytheon/uf/common/archive/ArchiveConfigManagerTest.java @@ -64,13 +64,13 @@ import com.raytheon.uf.common.util.TestUtil; * May 7, 2013 1965 bgonzale Initial creation. * Added additional test data for file newer than purge * time but in directory that is older than purge time. + * Aug 28, 2013 2299 rferrel purgeExpiredFromArchive now returns number of files purged. * * * * @author bgonzale * @version 1.0 */ - public class ArchiveConfigManagerTest { private static final String RAW = "Raw"; @@ -92,11 +92,13 @@ public class ArchiveConfigManagerTest { private final DateFormat mmFormat = new SimpleDateFormat("mm"); - private Collection archiveFiles = new ArrayList(); + private final Collection archiveFiles = new ArrayList(); - private Collection purgeFiles = new ArrayList(); + private final Collection purgeFiles = new ArrayList(); - private Collection archiveSelectedDisplays = new HashSet(); + private final Collection allFiles = new ArrayList(); + + private final Collection archiveSelectedDisplays = new HashSet(); private Calendar referenceCalendar; @@ -116,25 +118,9 @@ public class ArchiveConfigManagerTest { if (referenceCalendar == null) { setupTimes(); } - File testLocalization = TestUtil - .setupTestClassDir(PathManagerFactoryTest.class); PathManagerFactoryTest.initLocalization(); - // after setting up test localization get the production config files - // and copy them to the the test localization directory. - // utility/common_static/base/archive - File prodConfigDir = new File( - "../edexOsgi/com.raytheon.uf.edex.archive/utility"); - Collection configs = FileUtils.listFiles(prodConfigDir, - FileFilterUtils.trueFileFilter(), - FileFilterUtils.trueFileFilter()); - File destDir = new File(testLocalization, - "utility/common_static/base/archive"); - for (File srcConfig : configs) { - FileUtils.copyFileToDirectory(srcConfig, destDir); - } - ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); ArchiveConfig archiveProcessed = manager.getArchive(PROCESSED); @@ -154,6 +140,8 @@ public class ArchiveConfigManagerTest { // {6} file-dd // {7} file-kk // {8} file-mm + // {9} file-epochMS + // {10} file-epochSec // **** grib1 **** MessageFormat grib1Format_Raw = new MessageFormat( @@ -188,31 +176,64 @@ public class ArchiveConfigManagerTest { // **** binlightning **** MessageFormat binlightningFormat_Raw = new MessageFormat( "/binlightning/{0}{1}{2}/{3}/SFUS41_KWBC_{6}{7}{8}_22725485.nldn.{4}{5}{6}{7}"); - createTestFiles(binlightningFormat_Raw, archiveRaw, "Misc", + createTestFiles(binlightningFormat_Raw, archiveRaw, "Observation", false, archiveStart, archiveEnd); MessageFormat binlightningFormat_Processed = new MessageFormat( "/binlightning/binlightning-{4}-{5}-{6}-{7}.h5"); - createTestFiles(binlightningFormat_Processed, archiveProcessed, "Misc", - false, archiveStart, archiveEnd); + createTestFiles(binlightningFormat_Processed, archiveProcessed, + "Observation", false, archiveStart, archiveEnd); // **** bufrsigwx **** MessageFormat bufrsigwxFormat_Raw = new MessageFormat( "/bufrsigwx/{0}{1}{2}/{3}/JUWE96_KKCI_{6}{7}{8}_31368878.bufr.{4}{5}{6}{7}"); - createTestFiles(bufrsigwxFormat_Raw, archiveRaw, "Observation", false, + createTestFiles(bufrsigwxFormat_Raw, archiveRaw, "Products", false, archiveStart, archiveEnd); MessageFormat bufrsigwxFormat_Processed = new MessageFormat( "/bufrsigwx/SWH/sigwxCAT-{4}-{5}-{6}-{7}.h5"); createTestFiles(bufrsigwxFormat_Processed, archiveProcessed, - "Observation", false, archiveStart, archiveEnd); + "Products", false, archiveStart, archiveEnd); + + // *** manual **** + MessageFormat manualFormat_Raw1 = new MessageFormat( + "manual/mpe/ZETA98_BDHRMOSAIC{4}{5}{6}{7}{8}z_15180450.grib"); + createTestFiles(manualFormat_Raw1, archiveRaw, "Local", false, + archiveStart, archiveEnd); + MessageFormat manualFormat_Raw2 = new MessageFormat( + "manual/mpe/ZETA98_{0}{1}{2}{3}z_16122536.grib"); + createTestFiles(manualFormat_Raw2, archiveRaw, "Local", false, + archiveStart, archiveEnd); + MessageFormat manualFormat_RawE1 = new MessageFormat( + "manual/000-KOUNVFTOUN-NXUS98-KOUN-13{5}{6}{7}{8}-___-{10}"); + createTestFiles(manualFormat_RawE1, archiveRaw, "Local", false, + archiveStart, archiveEnd); + MessageFormat manualFormat_RawE2 = new MessageFormat( + "manual/AQIOUN.wan{10}"); + createTestFiles(manualFormat_RawE2, archiveRaw, "Local", false, + archiveStart, archiveEnd); + MessageFormat manualFormat_Raw3 = new MessageFormat( + "manual/wrf4nssl_{0}{1}{2}{3}.f00.OUN_subset.16122536"); + createTestFiles(manualFormat_Raw3, archiveRaw, "Local", false, + archiveStart, archiveEnd); + MessageFormat manualFormat_Raw4 = new MessageFormat( + "manual/ZETA98.LAPS.{4}{5}{6}_{7}{8}"); + createTestFiles(manualFormat_Raw4, archiveRaw, "Local", false, + archiveStart, archiveEnd); + + // **** manual using file last modified time. + createModTestFiles("manual/FOUS74KTUA.16130407.100", + "manual/FOUS74KTUA.16130407.200", + "manual/FOUS74KTUA.16130407.300", + "manual/FOUS74KTUA.16130407.400", archiveRaw, "Local", false, + archiveStart, archiveEnd); // create test archive data dir archiveDir = new File(TEST_DIR, TEST_ARCHIVE_DIR); + } private int getRetentionHours(ArchiveConfig archive, CategoryConfig category) { return category == null || category.getRetentionHours() == 0 ? archive - .getRetentionHours() - : category.getRetentionHours(); + .getRetentionHours() : category.getRetentionHours(); } private CategoryConfig getCategory(ArchiveConfig archive, @@ -224,12 +245,20 @@ public class ArchiveConfigManagerTest { break; } } + if (category == null) { + // This is part of setup and asserts will not give stack trace. + System.err.println(String.format("category: %s not in archive: %s", + categoryName, archive.getName())); + throw new IllegalArgumentException("bad category name: " + + categoryName); + } return category; } private void createTestFiles(MessageFormat fileNameFormat, ArchiveConfig archive, String categoryName, boolean isSelected, Calendar start, Calendar end) throws IOException { + CategoryConfig category = getCategory(archive, categoryName); int retentionHours = getRetentionHours(archive, category); String rootDir = archive.getRootDir(); @@ -306,6 +335,88 @@ public class ArchiveConfigManagerTest { .substring(rootDir.length())); } + private void createModTestFiles(String newFilename, String oldFilename, + String purgeFilename, String outsideFilename, + ArchiveConfig archive, String categoryName, boolean isSelected, + Calendar start, Calendar end) throws IOException { + + CategoryConfig category = getCategory(archive, categoryName); + int retentionHours = getRetentionHours(archive, category); + String rootDir = archive.getRootDir(); + + // create data file newer than purge time, within archive time, and + // isSelected + File dataFile = create_ModFile(end, newFilename, rootDir); + + if (isSelected) { + ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); + + archiveFiles.add(dataFile); + archiveSelectedDisplays.addAll(manager.getDisplayData( + archive.getName(), categoryName, true)); + } + System.out + .println("{newer modTime than purge/within archive/}\n\tFor archive:" + + archive.getName() + + " category:" + + categoryName + + "\n\tcreated file: " + + dataFile.getAbsolutePath() + .substring(rootDir.length())); + + // create data file newer than purge time, within archive time, but not + // in selected + Calendar moreThanOneDayOld = (Calendar) referenceCalendar.clone(); + moreThanOneDayOld.add(Calendar.DAY_OF_MONTH, -1); + dataFile = create_ModFile(moreThanOneDayOld, oldFilename, rootDir); + System.out + .println("{newer modTime than purge/within archive/Not Selected}\nFor archive:" + + archive.getName() + + " category:" + + categoryName + + "\n\tcreated file: " + + dataFile.getAbsolutePath() + .substring(rootDir.length())); + + // create data file older than purge time + Calendar lessThanExpiredCalendar = (Calendar) referenceCalendar.clone(); + lessThanExpiredCalendar.add(Calendar.HOUR, (-1 * retentionHours - 1)); + dataFile = create_ModFile(lessThanExpiredCalendar, purgeFilename, + rootDir); + purgeFiles.add(dataFile); + System.out.println("{older than purge}\nFor archive:" + + archive.getName() + " category:" + categoryName + + "\n\tcreated file: " + + dataFile.getAbsolutePath().substring(rootDir.length())); + + // // create data file newer than purge time, but in a directory that is + // // older than purge time, and outside of archive time frame + Calendar newerThanArchiveEnd = (Calendar) end.clone(); + // newerThanArchiveEnd.add(Calendar.HOUR, 3); + // dataFile = create_DataFile(lessThanExpiredCalendar, + // newerThanArchiveEnd, fileNameFormat, rootDir); + // System.out + // .println("{newer than purge/in directory older than purge/outside of archive}\nFor archive:" + // + archive.getName() + // + " category:" + // + categoryName + // + "\n created file: " + dataFile.getAbsolutePath()); + + // create data file newer than purge time and outside of archive time + // frame + newerThanArchiveEnd = (Calendar) end.clone(); + newerThanArchiveEnd.add(Calendar.HOUR, 3); + dataFile = create_ModFile(newerThanArchiveEnd, outsideFilename, rootDir); + System.out + .println("{newer modTime than purge/outside of archive}\nFor archive:" + + archive.getName() + + " category:" + + categoryName + + "\n\tcreated file: " + + dataFile.getAbsolutePath() + .substring(rootDir.length())); + } + private void setupTimes() { referenceCalendar = TimeUtil.newGmtCalendar(); referenceCalendar.set(Calendar.MINUTE, 0); @@ -345,8 +456,13 @@ public class ArchiveConfigManagerTest { String file_dd = ddFormat.format(fileReferenceTime); String file_kk = kkFormat.format(fileReferenceTime); String file_mm = mmFormat.format(fileReferenceTime); + String file_epochMS = String.format("%013d", + fileReferenceTime.getTime()); + String file_epochSec = String.format("%010d", + fileReferenceTime.getTime() / TimeUtil.MILLIS_PER_SECOND); String[] formatArgs = new String[] { dir_yyyy, dir_MM, dir_dd, dir_kk, - file_yyyy, file_MM, file_dd, file_kk, file_mm }; + file_yyyy, file_MM, file_dd, file_kk, file_mm, file_epochMS, + file_epochSec }; String filename = fileFormat.format(formatArgs, new StringBuffer(), new FieldPosition(0)).toString(); @@ -357,6 +473,23 @@ public class ArchiveConfigManagerTest { dir.mkdirs(); resultFile.createNewFile(); + allFiles.add(resultFile); + return resultFile; + } + + private File create_ModFile(Calendar fileReferenceCalendar, + String filename, String rootDir) throws IOException { + Date fileReferenceTime = fileReferenceCalendar.getTime(); + + File resultFile = new File(rootDir, filename); + String dirname = FilenameUtils + .getFullPath(resultFile.getAbsolutePath()); + File dir = new File(dirname); + + dir.mkdirs(); + resultFile.createNewFile(); + allFiles.add(resultFile); + resultFile.setLastModified(fileReferenceTime.getTime()); return resultFile; } @@ -416,9 +549,30 @@ public class ArchiveConfigManagerTest { public void testArchiveManagerPurge() throws IOException { ArchiveConfigManager manager = ArchiveConfigManager.getInstance(); Collection filesFoundInPurge = new ArrayList(); + int purgeCount = 0; for (ArchiveConfig a : manager.getArchives()) { - filesFoundInPurge.addAll(manager.purgeExpiredFromArchive(a)); + purgeCount += manager.purgeExpiredFromArchive(a); + } + + // assertEquals( + // + // "The expected number of purged files and number of purge files not the same", + // purgeCount, purgeFiles.size()); + + for (File file : allFiles) { + if (!file.exists()) { + filesFoundInPurge.add(file); + } + } + System.out.println("purgeCount: " + purgeCount + ", pureFiles.size:" + + purgeFiles.size() + ", filesFoundInPurge.size(): " + + filesFoundInPurge.size()); + + for (File file : purgeFiles) { + if (!filesFoundInPurge.contains(file)) { + System.out.println("not purged: " + file.getAbsolutePath()); + } } assertEquals(