Merge "Issue #2361 remove ISerializableObject for some pointdata and user roles classes" into development
Former-commit-id:2934222c09
[formerlyb3fdf129db
[formerly 7a2dd6ccb98c9b7b28b989835b6ed6535f7a6ce1]] Former-commit-id:b3fdf129db
Former-commit-id:55d1d12c38
This commit is contained in:
commit
038f48e28f
39 changed files with 1711 additions and 1827 deletions
|
@ -22,13 +22,12 @@ package com.raytheon.edex.plugin.bufrmos;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
|
@ -68,7 +67,7 @@ public class MOSPointDataState {
|
|||
if (container != null) {
|
||||
pointData.put(type, container);
|
||||
}
|
||||
} catch (JAXBException e) {
|
||||
} catch (SerializationException e) {
|
||||
logger.error("Could not create PointDataContainer for " + type
|
||||
+ " model soundings", e);
|
||||
}
|
||||
|
@ -78,7 +77,7 @@ public class MOSPointDataState {
|
|||
}
|
||||
|
||||
public static synchronized PointDataDescription getDescription(String type)
|
||||
throws JAXBException {
|
||||
throws SerializationException {
|
||||
PointDataDescription pdd = descriptions.get(type);
|
||||
if (pdd == null) {
|
||||
String strmPath = "/res/pointdata/bufrmos" + type + ".xml";
|
||||
|
|
|
@ -22,11 +22,10 @@ package com.raytheon.edex.plugin.goessounding.dao;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.goessounding.GOESSounding;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
||||
import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
||||
|
@ -142,7 +141,7 @@ public class GOESSoundingDAO extends PointDataPluginDao<GOESSounding> {
|
|||
hdf5DataDescription = PointDataDescription.fromStream(this
|
||||
.getClass().getResourceAsStream(
|
||||
"/res/pointdata/goes.xml"));
|
||||
} catch (JAXBException e) {
|
||||
} catch (SerializationException e) {
|
||||
logger.error("Unable to load " + pluginName
|
||||
+ " Point Data Description", e);
|
||||
}
|
||||
|
|
|
@ -24,20 +24,20 @@ import java.io.InputStream;
|
|||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import com.raytheon.edex.plugin.ldadprofiler.dao.LdadProfilerDao;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.pointdata.ParameterDescription;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.pointdata.PointDataView;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
|
||||
/**
|
||||
* Provides a transform from Ldadprofiler Records to PointDataContainer and vice versa.
|
||||
* Provides a transform from Ldadprofiler Records to PointDataContainer and vice
|
||||
* versa.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -54,11 +54,11 @@ import com.raytheon.uf.common.pointdata.PointDataView;
|
|||
|
||||
public class LdadprofilerPointDataTransform {
|
||||
|
||||
// private static final String BASE_TIME = "base_time";
|
||||
//
|
||||
// private static final String START_TIME_OFFSET = "start_time_offset";
|
||||
//
|
||||
// private static final String END_TIME_OFFSET = "end_time_offset";
|
||||
// private static final String BASE_TIME = "base_time";
|
||||
//
|
||||
// private static final String START_TIME_OFFSET = "start_time_offset";
|
||||
//
|
||||
// private static final String END_TIME_OFFSET = "end_time_offset";
|
||||
|
||||
private static final String HEIGHTS_NUM = "nhts";
|
||||
|
||||
|
@ -78,22 +78,21 @@ public class LdadprofilerPointDataTransform {
|
|||
|
||||
private static final String V_CONF = "vconf";
|
||||
|
||||
private static final String W_CONF ="wconf";
|
||||
|
||||
// private static final String REPORT_TYPE = "reportType";
|
||||
//
|
||||
// private static final String TIME_OBS = "timeObs";
|
||||
//
|
||||
// private static final String LONGITUDE = "longitude";
|
||||
//
|
||||
// private static final String LATITUDE = "latitude";
|
||||
//
|
||||
// private static final String STATION_NAME = "stationName";
|
||||
//
|
||||
// private static final String DATAURI = "dataURI";
|
||||
//
|
||||
// private static final String ELEVATION = "elevation";
|
||||
private static final String W_CONF = "wconf";
|
||||
|
||||
// private static final String REPORT_TYPE = "reportType";
|
||||
//
|
||||
// private static final String TIME_OBS = "timeObs";
|
||||
//
|
||||
// private static final String LONGITUDE = "longitude";
|
||||
//
|
||||
// private static final String LATITUDE = "latitude";
|
||||
//
|
||||
// private static final String STATION_NAME = "stationName";
|
||||
//
|
||||
// private static final String DATAURI = "dataURI";
|
||||
//
|
||||
// private static final String ELEVATION = "elevation";
|
||||
|
||||
private LdadProfilerDao dao;
|
||||
|
||||
|
@ -149,7 +148,7 @@ public class LdadprofilerPointDataTransform {
|
|||
if (lvl.getLevelHeight() != null) {
|
||||
pdv.setInt(LEVEL_HEIGHT, lvl.getLevelHeight(), i);
|
||||
}
|
||||
if (lvl.getWindSpeed()!= null) {
|
||||
if (lvl.getWindSpeed() != null) {
|
||||
pdv.setFloat(WIND_SPEED, lvl.getWindSpeed().floatValue(), i);
|
||||
}
|
||||
if (lvl.getWindDir() != null) {
|
||||
|
@ -180,8 +179,8 @@ public class LdadprofilerPointDataTransform {
|
|||
return pdv;
|
||||
}
|
||||
|
||||
|
||||
private PointDataDescription getDescription(String type) throws JAXBException{
|
||||
private PointDataDescription getDescription(String type)
|
||||
throws SerializationException {
|
||||
InputStream is = this.getClass().getResourceAsStream(
|
||||
"/res/pointdata/" + type + ".xml");
|
||||
if (is == null) {
|
||||
|
|
|
@ -33,6 +33,7 @@ import com.raytheon.uf.common.dataquery.db.QueryParam;
|
|||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.pointdata.spatial.ObStation;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataDbDescription;
|
||||
|
@ -159,7 +160,7 @@ public class ObsDao extends PointDataPluginDao<MetarRecord> {
|
|||
hdf5DataDescription = PointDataDescription.fromStream(this
|
||||
.getClass().getResourceAsStream(
|
||||
"/res/pointdata/metar.xml"));
|
||||
} catch (JAXBException e) {
|
||||
} catch (SerializationException e) {
|
||||
logger.error("Unable to load metar Point Data Description", e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,11 +22,10 @@ package com.raytheon.edex.plugin.poessounding.dao;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.poessounding.POESSounding;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
||||
import com.raytheon.uf.edex.wmo.message.WMOHeader;
|
||||
|
@ -149,7 +148,7 @@ public class POESSoundingDAO extends PointDataPluginDao<POESSounding> {
|
|||
hdf5DataDescription = PointDataDescription.fromStream(this
|
||||
.getClass().getResourceAsStream(
|
||||
"/res/pointdata/poes.xml"));
|
||||
} catch (JAXBException e) {
|
||||
} catch (SerializationException e) {
|
||||
logger.error("Unable to load " + pluginName
|
||||
+ " Point Data Description", e);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ import com.raytheon.uf.common.pointdata.PointDataContainer;
|
|||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.pointdata.PointDataView;
|
||||
import com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.decodertools.time.TimeTools;
|
||||
|
||||
/**
|
||||
|
@ -494,7 +495,7 @@ public class SfcObsPointDataTransform {
|
|||
* @throws JAXBException
|
||||
*/
|
||||
private PointDataDescription getDescription(String type)
|
||||
throws JAXBException {
|
||||
throws SerializationException {
|
||||
InputStream is = this.getClass().getResourceAsStream(
|
||||
"/res/pointdata/" + type + ".xml");
|
||||
if (is == null) {
|
||||
|
|
|
@ -33,14 +33,13 @@ import java.util.Map;
|
|||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import com.raytheon.uf.common.localization.IPathManager;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.python.PyUtil;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
|
@ -140,7 +139,7 @@ public class QCPaths {
|
|||
}
|
||||
}
|
||||
return pdds;
|
||||
} catch (JAXBException e) {
|
||||
} catch (SerializationException e) {
|
||||
throw new RuntimeException(
|
||||
"Failed to initialize QcNetCDF PointDataDescriptions. QC Python netCDF calls will Fail!");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
com.raytheon.uf.common.plugin.nwsauth.user.UserId
|
||||
com.raytheon.uf.common.plugin.nwsauth.xml.NwsRoleData
|
||||
com.raytheon.uf.common.plugin.nwsauth.xml.PermissionXML
|
||||
com.raytheon.uf.common.plugin.nwsauth.xml.RoleXML
|
||||
com.raytheon.uf.common.plugin.nwsauth.xml.UserXML
|
|
@ -14,14 +14,13 @@ import javax.xml.bind.annotation.XmlElement;
|
|||
import javax.xml.bind.annotation.XmlElements;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
@XmlRootElement(name = "nwsRoleData")
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class NwsRoleData implements ISerializableObject {
|
||||
public class NwsRoleData {
|
||||
@DynamicSerializeElement
|
||||
@XmlElement(name = "application")
|
||||
private String application;
|
||||
|
@ -140,7 +139,8 @@ public class NwsRoleData implements ISerializableObject {
|
|||
}
|
||||
|
||||
public void addRole(String role, String description) {
|
||||
if (role != null && description != null && role.length() > 0 && description.length() > 0) {
|
||||
if (role != null && description != null && role.length() > 0
|
||||
&& description.length() > 0) {
|
||||
RoleXML roleXml = new RoleXML();
|
||||
roleXml.setRoleDescription(description);
|
||||
roleXml.setRoleId(role);
|
||||
|
@ -149,9 +149,8 @@ public class NwsRoleData implements ISerializableObject {
|
|||
}
|
||||
|
||||
/**
|
||||
* Add a permission. This should only be used for
|
||||
* Localization permissions, which are directory access
|
||||
* permissions.
|
||||
* Add a permission. This should only be used for Localization permissions,
|
||||
* which are directory access permissions.
|
||||
*
|
||||
* @param permission
|
||||
*/
|
||||
|
@ -166,7 +165,8 @@ public class NwsRoleData implements ISerializableObject {
|
|||
/**
|
||||
* Get the user's permissions
|
||||
*
|
||||
* @param userId id of the user
|
||||
* @param userId
|
||||
* id of the user
|
||||
* @return String[] of permissions
|
||||
*/
|
||||
public String[] getUserPermissions(String userId) {
|
||||
|
@ -192,7 +192,7 @@ public class NwsRoleData implements ISerializableObject {
|
|||
*/
|
||||
public String[] getAllDefinedPermissions() {
|
||||
ArrayList<String> permissions = new ArrayList<String>();
|
||||
for (PermissionXML p: this.permissionList) {
|
||||
for (PermissionXML p : this.permissionList) {
|
||||
permissions.add(p.getId());
|
||||
}
|
||||
|
||||
|
@ -262,7 +262,7 @@ public class NwsRoleData implements ISerializableObject {
|
|||
for (RoleXML roleXml : roleList) {
|
||||
for (String role : roles) {
|
||||
if (roleXml.getRoleId().equals(role)) {
|
||||
for (String p: roleXml.getPermissionList()) {
|
||||
for (String p : roleXml.getPermissionList()) {
|
||||
permSet.add(p);
|
||||
}
|
||||
}
|
||||
|
@ -286,15 +286,16 @@ public class NwsRoleData implements ISerializableObject {
|
|||
*/
|
||||
public boolean isAuthorized(String permission, String user) {
|
||||
Set<String> authorizedPermissions = this.getAuthorizedPermissions(user);
|
||||
Set<String> allAuthorizedPermissions = this.getAuthorizedPermissions("ALL");
|
||||
Set<String> allAuthorizedPermissions = this
|
||||
.getAuthorizedPermissions("ALL");
|
||||
|
||||
for (String perm: authorizedPermissions) {
|
||||
for (String perm : authorizedPermissions) {
|
||||
if (perm.equalsIgnoreCase(permission)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (String perm: allAuthorizedPermissions) {
|
||||
for (String perm : allAuthorizedPermissions) {
|
||||
if (perm.equalsIgnoreCase(permission)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
|||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -47,7 +46,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class PermissionXML implements ISerializableObject {
|
||||
public class PermissionXML {
|
||||
|
||||
@DynamicSerializeElement
|
||||
@XmlAttribute(name = "id")
|
||||
|
|
|
@ -28,7 +28,6 @@ import javax.xml.bind.annotation.XmlAttribute;
|
|||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlElements;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -50,7 +49,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class RoleXML implements ISerializableObject {
|
||||
public class RoleXML {
|
||||
@DynamicSerializeElement
|
||||
@XmlAttribute(name = "roleId")
|
||||
private String roleId;
|
||||
|
|
|
@ -34,7 +34,6 @@ import org.apache.commons.lang.builder.HashCodeBuilder;
|
|||
import com.raytheon.uf.common.auth.user.IAuthenticationData;
|
||||
import com.raytheon.uf.common.auth.user.IUser;
|
||||
import com.raytheon.uf.common.auth.user.IUserId;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -56,7 +55,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class UserXML implements IUser, ISerializableObject {
|
||||
public class UserXML implements IUser {
|
||||
@DynamicSerializeElement
|
||||
@XmlAttribute(name = "userId")
|
||||
private String userId;
|
||||
|
|
|
@ -1,11 +1,3 @@
|
|||
com.raytheon.uf.common.pointdata.PointDataContainer
|
||||
com.raytheon.uf.common.pointdata.PointDataSerializable
|
||||
com.raytheon.uf.common.pointdata.ParameterDescription
|
||||
com.raytheon.uf.common.pointdata.Dimension
|
||||
com.raytheon.uf.common.pointdata.elements.FloatPointDataObject
|
||||
com.raytheon.uf.common.pointdata.elements.IntPointDataObject
|
||||
com.raytheon.uf.common.pointdata.elements.LongPointDataObject
|
||||
com.raytheon.uf.common.pointdata.elements.StringPointDataObject
|
||||
com.raytheon.uf.common.pointdata.spatial.ObStation
|
||||
com.raytheon.uf.common.pointdata.spatial.AircraftObsLocation
|
||||
com.raytheon.uf.common.pointdata.spatial.SurfaceObsLocation
|
|
@ -23,8 +23,6 @@ import javax.xml.bind.annotation.XmlAccessType;
|
|||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
|
||||
/**
|
||||
* Provides metadata (primarily the size) of a named dimension
|
||||
*
|
||||
|
@ -41,7 +39,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
* @version 1.0
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class Dimension implements ISerializableObject {
|
||||
public class Dimension {
|
||||
|
||||
@XmlAttribute(name = "name")
|
||||
private String dimensionName;
|
||||
|
|
|
@ -28,7 +28,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
|
|||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription.Type;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -51,7 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@DynamicSerialize
|
||||
public class ParameterDescription implements ISerializableObject {
|
||||
public class ParameterDescription {
|
||||
|
||||
@XmlAttribute(name = "name", required = true)
|
||||
@DynamicSerializeElement
|
||||
|
|
|
@ -23,17 +23,8 @@ import java.util.ArrayList;
|
|||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
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 javax.xml.bind.annotation.adapters.XmlAdapter;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IntegerDataRecord;
|
||||
|
@ -46,7 +37,6 @@ import com.raytheon.uf.common.pointdata.elements.FloatPointDataObject;
|
|||
import com.raytheon.uf.common.pointdata.elements.IntPointDataObject;
|
||||
import com.raytheon.uf.common.pointdata.elements.LongPointDataObject;
|
||||
import com.raytheon.uf.common.pointdata.elements.StringPointDataObject;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -60,6 +50,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 8, 2009 chammack Initial creation
|
||||
* Oct 9, 2013 2361 njensen Removed XML annotations
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -67,23 +58,17 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* @version 1.0
|
||||
*/
|
||||
@DynamicSerialize
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class PointDataContainer implements ISerializableObject {
|
||||
public class PointDataContainer {
|
||||
|
||||
protected static final int DEFAULT_SZ = 2048;
|
||||
|
||||
@DynamicSerializeElement
|
||||
@XmlAttribute
|
||||
protected int currentSz;
|
||||
|
||||
@DynamicSerializeElement
|
||||
@XmlAttribute
|
||||
protected int allocatedSz;
|
||||
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
@XmlJavaTypeAdapter(value = PointDataMarshaller.class)
|
||||
protected HashMap<String, AbstractPointDataObject<?>> pointDataTypes;
|
||||
|
||||
public PointDataContainer() {
|
||||
|
@ -426,55 +411,6 @@ public class PointDataContainer implements ISerializableObject {
|
|||
this.currentSz = currentSz;
|
||||
}
|
||||
|
||||
public static class PointDataMarshaller
|
||||
extends
|
||||
XmlAdapter<PointDataSerializable, HashMap<String, AbstractPointDataObject<?>>> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* javax.xml.bind.annotation.adapters.XmlAdapter#marshal(java.lang.Object
|
||||
* )
|
||||
*/
|
||||
@Override
|
||||
public PointDataSerializable marshal(
|
||||
HashMap<String, AbstractPointDataObject<?>> v) throws Exception {
|
||||
PointDataSerializable serializable = new PointDataSerializable();
|
||||
PointDataSerializable.PointDataItemSerializable[] items = new PointDataSerializable.PointDataItemSerializable[v
|
||||
.size()];
|
||||
int i = 0;
|
||||
for (Entry<String, AbstractPointDataObject<?>> entry : v.entrySet()) {
|
||||
items[i] = new PointDataSerializable.PointDataItemSerializable();
|
||||
items[i].key = entry.getKey();
|
||||
items[i].value = entry.getValue();
|
||||
i++;
|
||||
}
|
||||
serializable.items = items;
|
||||
return serializable;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang
|
||||
* .Object)
|
||||
*/
|
||||
@Override
|
||||
public HashMap<String, AbstractPointDataObject<?>> unmarshal(
|
||||
PointDataSerializable v) throws Exception {
|
||||
HashMap<String, AbstractPointDataObject<?>> map = new HashMap<String, AbstractPointDataObject<?>>(
|
||||
v.items.length);
|
||||
for (PointDataSerializable.PointDataItemSerializable item : v.items) {
|
||||
map.put(item.key, item.value);
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected AbstractPointDataObject<?> getParamSafe(String parameter) {
|
||||
AbstractPointDataObject<?> p = pointDataTypes.get(parameter);
|
||||
if (p == null) {
|
||||
|
|
|
@ -24,16 +24,15 @@ import java.io.InputStream;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
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 javax.xml.bind.annotation.XmlType;
|
||||
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
|
||||
|
||||
/**
|
||||
* A generic description for a type of point data
|
||||
|
@ -47,6 +46,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 8, 2009 chammack Initial creation
|
||||
* Oct 9, 2013 2361 njensen Use JAXBManager for XML
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -56,7 +56,7 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
|
|||
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
@XmlRootElement(name = "pointDataDescription")
|
||||
public class PointDataDescription implements ISerializableObject {
|
||||
public class PointDataDescription {
|
||||
|
||||
private static final int DEFAULT_LEVELSIZE = 64;
|
||||
|
||||
|
@ -67,6 +67,9 @@ public class PointDataDescription implements ISerializableObject {
|
|||
|
||||
public static final int FILL_VALUE_INT = -9999;
|
||||
|
||||
private static final SingleTypeJAXBManager<PointDataDescription> jaxb = SingleTypeJAXBManager
|
||||
.createWithoutException(PointDataDescription.class);
|
||||
|
||||
@XmlElement(name = "dimension")
|
||||
public Dimension[] dimensions;
|
||||
|
||||
|
@ -84,19 +87,10 @@ public class PointDataDescription implements ISerializableObject {
|
|||
* @return
|
||||
* @throws JAXBException
|
||||
*/
|
||||
public static PointDataDescription fromFile(File file) throws JAXBException {
|
||||
PointDataDescription pdd = null;
|
||||
|
||||
JAXBContext ctx = JAXBContext.newInstance(PointDataDescription.class);
|
||||
if (ctx != null) {
|
||||
Unmarshaller um = ctx.createUnmarshaller();
|
||||
if (um != null) {
|
||||
pdd = (PointDataDescription) um.unmarshal(file);
|
||||
}
|
||||
}
|
||||
|
||||
public static PointDataDescription fromFile(File file)
|
||||
throws SerializationException {
|
||||
PointDataDescription pdd = jaxb.unmarshalFromXmlFile(file);
|
||||
pdd.resolveDimensions();
|
||||
|
||||
return pdd;
|
||||
}
|
||||
|
||||
|
@ -107,17 +101,9 @@ public class PointDataDescription implements ISerializableObject {
|
|||
* @throws JAXBException
|
||||
*/
|
||||
public static PointDataDescription fromStream(InputStream is)
|
||||
throws JAXBException {
|
||||
PointDataDescription pdd = null;
|
||||
|
||||
JAXBContext ctx = JAXBContext.newInstance(PointDataDescription.class);
|
||||
if (ctx != null) {
|
||||
Unmarshaller um = ctx.createUnmarshaller();
|
||||
if (um != null) {
|
||||
pdd = (PointDataDescription) um.unmarshal(is);
|
||||
}
|
||||
}
|
||||
|
||||
throws SerializationException {
|
||||
PointDataDescription pdd = (PointDataDescription) jaxb
|
||||
.unmarshalFromInputStream(is);
|
||||
pdd.resolveDimensions();
|
||||
|
||||
return pdd;
|
||||
|
|
|
@ -1,60 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.common.pointdata;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlAttribute;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import com.raytheon.uf.common.pointdata.elements.AbstractPointDataObject;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
|
||||
/**
|
||||
* A serialization helper class for serializing pointdata maps
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 16, 2009 chammack Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
* @version 1.0
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class PointDataSerializable implements ISerializableObject {
|
||||
|
||||
@XmlElement(name = "item")
|
||||
public PointDataItemSerializable[] items;
|
||||
|
||||
public static class PointDataItemSerializable implements
|
||||
ISerializableObject {
|
||||
|
||||
@XmlAttribute
|
||||
public String key;
|
||||
|
||||
@XmlElement
|
||||
public AbstractPointDataObject<?> value;
|
||||
}
|
||||
}
|
|
@ -22,13 +22,9 @@ package com.raytheon.uf.common.pointdata.elements;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.pointdata.ParameterDescription;
|
||||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.serialization.ISerializableObject;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
|
||||
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
||||
|
||||
|
@ -41,15 +37,16 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 8, 2009 chammack Initial creation
|
||||
* Oct 9, 2013 2361 njensen Removed XML annotations
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
* @version 1.0
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
|
||||
@DynamicSerialize
|
||||
public abstract class AbstractPointDataObject<A> implements ISerializableObject {
|
||||
public abstract class AbstractPointDataObject<A> {
|
||||
|
||||
static final int STORAGE_CHUNK_SIZE = 1024;
|
||||
|
||||
|
|
|
@ -19,10 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.uf.common.pointdata.elements;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.pointdata.ParameterDescription;
|
||||
|
@ -39,6 +35,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 8, 2009 chammack Initial creation
|
||||
* Oct 9, 2013 2361 njensen Removed XML annotations
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,11 +43,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* @version 1.0
|
||||
*/
|
||||
@DynamicSerialize
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class FloatPointDataObject extends AbstractPointDataObject<float[]> {
|
||||
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
protected float[] floatData;
|
||||
|
||||
public FloatPointDataObject() {
|
||||
|
|
|
@ -19,10 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.uf.common.pointdata.elements;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IntegerDataRecord;
|
||||
import com.raytheon.uf.common.pointdata.ParameterDescription;
|
||||
|
@ -39,6 +35,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 8, 2009 chammack Initial creation
|
||||
* Oct 9, 2013 2361 njensen Removed XML annotations
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,10 +43,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* @version 1.0
|
||||
*/
|
||||
@DynamicSerialize
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class IntPointDataObject extends AbstractPointDataObject<int[]> {
|
||||
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
protected int[] intData;
|
||||
|
||||
public IntPointDataObject() {
|
||||
|
|
|
@ -19,10 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.uf.common.pointdata.elements;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.LongDataRecord;
|
||||
import com.raytheon.uf.common.pointdata.ParameterDescription;
|
||||
|
@ -39,6 +35,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 8, 2009 chammack Initial creation
|
||||
* Oct 9, 2013 2361 njensen Removed XML annotations
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,10 +43,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* @version 1.0
|
||||
*/
|
||||
@DynamicSerialize
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class LongPointDataObject extends AbstractPointDataObject<long[]> {
|
||||
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
protected long[] longData;
|
||||
|
||||
public LongPointDataObject() {
|
||||
|
|
|
@ -19,10 +19,6 @@
|
|||
**/
|
||||
package com.raytheon.uf.common.pointdata.elements;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.StringDataRecord;
|
||||
import com.raytheon.uf.common.pointdata.ParameterDescription;
|
||||
|
@ -39,6 +35,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 8, 2009 chammack Initial creation
|
||||
* Oct 9, 2013 2361 njensen Removed XML annotations
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -46,10 +43,9 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
|
|||
* @version 1.0
|
||||
*/
|
||||
@DynamicSerialize
|
||||
@XmlAccessorType(XmlAccessType.NONE)
|
||||
public class StringPointDataObject extends AbstractPointDataObject<String[]> {
|
||||
|
||||
@DynamicSerializeElement
|
||||
@XmlElement
|
||||
protected String[] stringData;
|
||||
|
||||
public StringPointDataObject() {
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
com.raytheon.uf.common.site.xml.AdjacentWfoXML
|
||||
com.raytheon.uf.common.site.xml.CwaXML
|
|
@ -22,13 +22,12 @@ package com.raytheon.uf.edex.plugin.bufrsigwx;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.bufrsigwx.SigWxData;
|
||||
import com.raytheon.uf.common.dataplugin.bufrsigwx.common.SigWxLayer;
|
||||
import com.raytheon.uf.common.dataplugin.bufrsigwx.common.SigWxType;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
||||
|
||||
|
@ -167,7 +166,7 @@ public class SigWxDataDao extends PointDataPluginDao<SigWxData> {
|
|||
try {
|
||||
return PointDataDescription.fromStream(this.getClass()
|
||||
.getResourceAsStream(pddFile));
|
||||
} catch (JAXBException e) {
|
||||
} catch (SerializationException e) {
|
||||
logger.error("Unable to load " + pluginName
|
||||
+ " Point Data Description for " + type + "," + layer,
|
||||
e);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.raytheon.uf.edex.plugin.fssobs;
|
||||
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -16,15 +15,13 @@ import com.raytheon.uf.common.dataplugin.persist.IPersistable;
|
|||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataDbDescription;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
||||
|
||||
|
||||
public class FSSObsDAO extends PointDataPluginDao<FSSObsRecord> {
|
||||
|
||||
|
||||
public FSSObsDAO(String pluginName) throws PluginException {
|
||||
super(pluginName);
|
||||
}
|
||||
|
@ -77,8 +74,8 @@ public class FSSObsDAO extends PointDataPluginDao<FSSObsRecord> {
|
|||
record = getDataStore((IPersistable) obj).retrieve(
|
||||
obj.getDataURI());
|
||||
} catch (Exception e) {
|
||||
throw new PluginException("Error retrieving FSSObs HDF5 data",
|
||||
e);
|
||||
throw new PluginException(
|
||||
"Error retrieving FSSObs HDF5 data", e);
|
||||
}
|
||||
retVal.add(record);
|
||||
}
|
||||
|
@ -96,7 +93,6 @@ public class FSSObsDAO extends PointDataPluginDao<FSSObsRecord> {
|
|||
return new FSSObsRecord();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getPointDataFileName(FSSObsRecord p) {
|
||||
return "fssobs.h5";
|
||||
|
@ -109,15 +105,19 @@ public class FSSObsDAO extends PointDataPluginDao<FSSObsRecord> {
|
|||
hdf5DataDescription = PointDataDescription.fromStream(this
|
||||
.getClass().getResourceAsStream(
|
||||
"/res/pointdata/fssobs.xml"));
|
||||
} catch (JAXBException e) {
|
||||
} catch (SerializationException e) {
|
||||
logger.error("Unable to load fssobs Point Data Description", e);
|
||||
}
|
||||
}
|
||||
return hdf5DataDescription;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.raytheon.uf.edex.pointdata.PointDataPluginDao#getPointDataDbDescription()
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.edex.pointdata.PointDataPluginDao#getPointDataDbDescription
|
||||
* ()
|
||||
*/
|
||||
@Override
|
||||
public PointDataDbDescription getPointDataDbDescription() {
|
||||
|
|
|
@ -35,11 +35,13 @@ import com.raytheon.uf.common.dataplugin.madis.MadisRecord;
|
|||
import com.raytheon.uf.common.dataquery.db.QueryParam;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.pointdata.spatial.ObStation;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.util.CollectionUtil;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.database.plugin.PluginDao;
|
||||
import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataDbDescription;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
||||
|
@ -78,7 +80,7 @@ public class MadisDao extends PointDataPluginDao<MadisRecord> {
|
|||
upperLeftLon, lowerRightLat, lowerRightLon);
|
||||
|
||||
List<String> stationNames = new ArrayList<String>();
|
||||
for (ObStation ob: stationList) {
|
||||
for (ObStation ob : stationList) {
|
||||
stationNames.add(ob.getIcao());
|
||||
}
|
||||
|
||||
|
@ -108,8 +110,8 @@ public class MadisDao extends PointDataPluginDao<MadisRecord> {
|
|||
*/
|
||||
public Object[] queryDataUriColumn(final String dataUri) {
|
||||
|
||||
String sql = "select datauri from awips.madis where datauri='" + dataUri
|
||||
+ "';";
|
||||
String sql = "select datauri from awips.madis where datauri='"
|
||||
+ dataUri + "';";
|
||||
|
||||
Object[] results = executeSQLQuery(sql);
|
||||
|
||||
|
@ -129,10 +131,11 @@ public class MadisDao extends PointDataPluginDao<MadisRecord> {
|
|||
hdf5DataDescription = PointDataDescription.fromStream(this
|
||||
.getClass().getResourceAsStream(
|
||||
"/res/pointdata/" + pluginName + ".xml"));
|
||||
} catch (JAXBException e) {
|
||||
} catch (SerializationException e) {
|
||||
statusHandler.error("Unable to load madis Point Data Description",
|
||||
e);
|
||||
throw new PluginException("Unable to load madis Point Data Description!", e);
|
||||
throw new PluginException(
|
||||
"Unable to load madis Point Data Description!", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -142,7 +145,6 @@ public class MadisDao extends PointDataPluginDao<MadisRecord> {
|
|||
return hdf5DataDescription;
|
||||
}
|
||||
|
||||
|
||||
public ObStationDao getObDao() {
|
||||
return obDao;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ import com.raytheon.uf.common.localization.LocalizationFile;
|
|||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.plugin.nwsauth.exception.RoleApplicationNotFoundException;
|
||||
import com.raytheon.uf.common.plugin.nwsauth.xml.NwsRoleData;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.edex.auth.roles.IRoleStorage;
|
||||
|
@ -27,6 +27,7 @@ import com.raytheon.uf.edex.auth.roles.IRoleStorage;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* May 25, 2010 rgeorge Initial creation
|
||||
* Oct 09, 2013 2361 njensen Use JAXBManager for XML
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -34,6 +35,10 @@ import com.raytheon.uf.edex.auth.roles.IRoleStorage;
|
|||
* @version 1.0
|
||||
*/
|
||||
public class NwsRoleStorage implements IRoleStorage {
|
||||
|
||||
private static final SingleTypeJAXBManager<NwsRoleData> jaxb = SingleTypeJAXBManager
|
||||
.createWithoutException(NwsRoleData.class);
|
||||
|
||||
private static NwsRoleStorage instance = null;
|
||||
|
||||
private final Map<String, File> lastUsedFileMap = new HashMap<String, File>();
|
||||
|
@ -65,12 +70,15 @@ public class NwsRoleStorage implements IRoleStorage {
|
|||
|
||||
// Check COMMON_STATIC base and site levels
|
||||
LocalizationContext[] contexts = new LocalizationContext[2];
|
||||
contexts[0] = pm.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.BASE);
|
||||
contexts[1] = pm.getContext(LocalizationType.COMMON_STATIC, LocalizationLevel.SITE);
|
||||
contexts[0] = pm.getContext(LocalizationType.COMMON_STATIC,
|
||||
LocalizationLevel.BASE);
|
||||
contexts[1] = pm.getContext(LocalizationType.COMMON_STATIC,
|
||||
LocalizationLevel.SITE);
|
||||
|
||||
String[] extensions = new String[] { ".xml" };
|
||||
LocalizationFile[] localizationFiles =
|
||||
PathManagerFactory.getPathManager().listFiles(contexts, "roles", extensions, true, true);
|
||||
LocalizationFile[] localizationFiles = PathManagerFactory
|
||||
.getPathManager().listFiles(contexts, "roles", extensions,
|
||||
true, true);
|
||||
|
||||
File file = null;
|
||||
for (LocalizationFile locFile : localizationFiles) {
|
||||
|
@ -79,20 +87,26 @@ public class NwsRoleStorage implements IRoleStorage {
|
|||
file = locFile.getFile();
|
||||
|
||||
if (lastUsedFileMap.get(locFile.getName()) == null
|
||||
|| (file != null && (file.equals(lastUsedFileMap.get(locFile.getName())) == false || file
|
||||
.lastModified() > lastModificationTimeMap.get(locFile.getName())))) {
|
||||
|| (file != null && (file.equals(lastUsedFileMap
|
||||
.get(locFile.getName())) == false || file
|
||||
.lastModified() > lastModificationTimeMap
|
||||
.get(locFile.getName())))) {
|
||||
// First time we found a role file, or we have a different
|
||||
// file to
|
||||
// use or we were modified since our last check
|
||||
lastUsedFileMap.put(locFile.getName(), file);
|
||||
try {
|
||||
roleData = (NwsRoleData) SerializationUtil.jaxbUnmarshalFromXmlFile(file.getAbsolutePath());
|
||||
applicationRoleMap.put(roleData.getApplication(), roleData);
|
||||
roleData = jaxb.unmarshalFromXmlFile(file
|
||||
.getAbsolutePath());
|
||||
applicationRoleMap.put(roleData.getApplication(),
|
||||
roleData);
|
||||
} catch (Exception e) {
|
||||
UFStatus.getHandler().handle(Priority.PROBLEM, "Error loading file: " + file.getName(), e);
|
||||
UFStatus.getHandler().handle(Priority.PROBLEM,
|
||||
"Error loading file: " + file.getName(), e);
|
||||
}
|
||||
|
||||
lastModificationTimeMap.put(locFile.getName(), file.lastModified());
|
||||
lastModificationTimeMap.put(locFile.getName(),
|
||||
file.lastModified());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,6 +53,7 @@ import com.raytheon.uf.common.pointdata.IPointData;
|
|||
import com.raytheon.uf.common.pointdata.PointDataContainer;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.pointdata.PointDataView;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
|
@ -269,7 +270,7 @@ public abstract class PointDataPluginDao<T extends PluginDataObject> extends
|
|||
hdf5DataDescription = PointDataDescription.fromStream(this
|
||||
.getClass().getResourceAsStream(
|
||||
"/res/pointdata/" + pluginName + ".xml"));
|
||||
} catch (JAXBException e) {
|
||||
} catch (SerializationException e) {
|
||||
statusHandler.error("Unable to load " + pluginName
|
||||
+ " Point Data Description", e);
|
||||
}
|
||||
|
@ -505,8 +506,8 @@ public abstract class PointDataPluginDao<T extends PluginDataObject> extends
|
|||
+ File.separator
|
||||
+ getPointDataFileName(bean).replace(".h5", "")
|
||||
+ DefaultPathProvider.fileNameFormat.get().format(
|
||||
((PluginDataObject) bean).getDataTime()
|
||||
.getRefTime()) + ".h5";
|
||||
((PluginDataObject) bean).getDataTime().getRefTime())
|
||||
+ ".h5";
|
||||
}
|
||||
|
||||
public abstract T newObject();
|
||||
|
|
|
@ -10,12 +10,11 @@ import gov.noaa.nws.ncep.common.dataplugin.airep.AirepRecord;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.persist.IPersistable;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
||||
|
||||
|
@ -111,21 +110,16 @@ public class AirepDao extends PointDataPluginDao<AirepRecord> {
|
|||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public String[] getParameters(File file) throws StorageException,
|
||||
FileNotFoundException {
|
||||
|
||||
try {
|
||||
// This should be faster than hitting the datastore.
|
||||
return getPointDataDescription().getParameterNames();
|
||||
} catch (Exception e) {
|
||||
// let super handle it
|
||||
return super.getParameters(file);
|
||||
}
|
||||
}
|
||||
* @Override public String[] getParameters(File file) throws
|
||||
* StorageException, FileNotFoundException {
|
||||
*
|
||||
* try { // This should be faster than hitting the datastore. return
|
||||
* getPointDataDescription().getParameterNames(); } catch (Exception e) { //
|
||||
* let super handle it return super.getParameters(file); } }
|
||||
*/
|
||||
|
||||
public PointDataDescription getPointDataDescription() throws JAXBException {
|
||||
public PointDataDescription getPointDataDescription()
|
||||
throws SerializationException {
|
||||
if (pdd == null) {
|
||||
|
||||
pdd = PointDataDescription.fromStream(this.getClass()
|
||||
|
@ -134,4 +128,3 @@ public class AirepDao extends PointDataPluginDao<AirepRecord> {
|
|||
return pdd;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -15,15 +15,13 @@
|
|||
**/
|
||||
package gov.noaa.nws.ncep.common.dataplugin.ncpafm.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import gov.noaa.nws.ncep.common.dataplugin.ncpafm.NcPafmRecord;
|
||||
import gov.noaa.nws.ncep.edex.common.dao.NcepDefaultPluginDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
||||
|
||||
|
@ -31,9 +29,9 @@ public class NcPafmDao extends PointDataPluginDao<NcPafmRecord> {
|
|||
|
||||
private PointDataDescription pdd;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new ReccoDao
|
||||
*
|
||||
* @throws PluginException
|
||||
*/
|
||||
public NcPafmDao(String pluginName) throws PluginException {
|
||||
|
@ -55,7 +53,7 @@ public class NcPafmDao extends PointDataPluginDao<NcPafmRecord> {
|
|||
} catch (DataAccessLayerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if((obs != null)&&(obs.size() > 0)) {
|
||||
if ((obs != null) && (obs.size() > 0)) {
|
||||
report = (NcPafmRecord) obs.get(0);
|
||||
}
|
||||
return report;
|
||||
|
@ -80,13 +78,14 @@ public class NcPafmDao extends PointDataPluginDao<NcPafmRecord> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String[] getKeysRequiredForFileName() { //TODO: See if this is correct/complete
|
||||
public String[] getKeysRequiredForFileName() { // TODO: See if this is
|
||||
// correct/complete
|
||||
return new String[] { "dataTime.refTime" };
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPointDataFileName(NcPafmRecord p) {
|
||||
return "ncpafm.h5"; //TODO: "s"? or no "s"?
|
||||
return "ncpafm.h5"; // TODO: "s"? or no "s"?
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -95,20 +94,15 @@ public class NcPafmDao extends PointDataPluginDao<NcPafmRecord> {
|
|||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public String[] getParameters(File file) throws StorageException,
|
||||
FileNotFoundException {
|
||||
try {
|
||||
// This should be faster than hitting the datastore.
|
||||
return getPointDataDescription().getParameterNames();
|
||||
} catch (Exception e) {
|
||||
// let super handle it
|
||||
return super.getParameters(file);
|
||||
}
|
||||
}
|
||||
* @Override public String[] getParameters(File file) throws
|
||||
* StorageException, FileNotFoundException { try { // This should be faster
|
||||
* than hitting the datastore. return
|
||||
* getPointDataDescription().getParameterNames(); } catch (Exception e) { //
|
||||
* let super handle it return super.getParameters(file); } }
|
||||
*/
|
||||
|
||||
public PointDataDescription getPointDataDescription() throws JAXBException {
|
||||
public PointDataDescription getPointDataDescription()
|
||||
throws SerializationException {
|
||||
if (pdd == null) {
|
||||
pdd = PointDataDescription.fromStream(this.getClass()
|
||||
.getResourceAsStream("/res/pointdata/ncpafm.xml"));
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
package gov.noaa.nws.ncep.common.dataplugin.ncscd.dao;
|
||||
|
||||
import gov.noaa.nws.ncep.common.dataplugin.ncscd.NcScdRecord;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -33,14 +35,13 @@ import com.raytheon.uf.common.dataquery.db.QueryParam;
|
|||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.pointdata.spatial.ObStation;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataDbDescription;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
||||
import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
|
||||
|
||||
import gov.noaa.nws.ncep.common.dataplugin.ncscd.NcScdRecord;
|
||||
|
||||
public class NcScdDao extends PointDataPluginDao<NcScdRecord> {
|
||||
|
||||
/** The station dao */
|
||||
|
@ -61,6 +62,7 @@ public class NcScdDao extends PointDataPluginDao<NcScdRecord> {
|
|||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<?> queryBySpatialBox(double upperLeftLat, double upperLeftLon,
|
||||
double lowerRightLat, double lowerRightLon)
|
||||
throws DataAccessLayerException {
|
||||
|
@ -95,6 +97,7 @@ public class NcScdDao extends PointDataPluginDao<NcScdRecord> {
|
|||
QueryParam.QueryOperand.IN);
|
||||
return queryByCriteria(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves an ncscd report using the datauri .
|
||||
*
|
||||
|
@ -164,7 +167,7 @@ public class NcScdDao extends PointDataPluginDao<NcScdRecord> {
|
|||
hdf5DataDescription = PointDataDescription.fromStream(this
|
||||
.getClass().getResourceAsStream(
|
||||
"/res/pointdata/ncscd.xml"));
|
||||
} catch (JAXBException e) {
|
||||
} catch (SerializationException e) {
|
||||
logger.error("Unable to load ncscd Point Data Description", e);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,25 +4,26 @@
|
|||
**/
|
||||
package gov.noaa.nws.ncep.common.dataplugin.nctaf.dao;
|
||||
|
||||
import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafRecord;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import gov.noaa.nws.ncep.common.dataplugin.nctaf.NcTafRecord;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.persist.IPersistable;
|
||||
import com.raytheon.uf.common.dataquery.db.QueryParam;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.pointdata.spatial.ObStation;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.database.query.DatabaseQuery;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataDbDescription;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
||||
import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.pointdata.spatial.ObStation;
|
||||
|
||||
/**
|
||||
* Set of DAO methods for TAF data.
|
||||
|
@ -49,6 +50,7 @@ public class NcTafDao extends PointDataPluginDao<NcTafRecord> {
|
|||
|
||||
/**
|
||||
* Creates a new NcTafDao
|
||||
*
|
||||
* @throws PluginException
|
||||
*/
|
||||
public NcTafDao(String pluginName) throws PluginException {
|
||||
|
@ -112,7 +114,7 @@ public class NcTafDao extends PointDataPluginDao<NcTafRecord> {
|
|||
} catch (DataAccessLayerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if((obs != null)&&(obs.size() > 0)) {
|
||||
if ((obs != null) && (obs.size() > 0)) {
|
||||
report = (NcTafRecord) obs.get(0);
|
||||
}
|
||||
return report;
|
||||
|
@ -159,10 +161,12 @@ public class NcTafDao extends PointDataPluginDao<NcTafRecord> {
|
|||
return new NcTafRecord();
|
||||
}
|
||||
|
||||
public PointDataDescription getPointDataDescription() throws JAXBException {
|
||||
public PointDataDescription getPointDataDescription()
|
||||
throws SerializationException {
|
||||
if (hdf5DataDescription == null) {
|
||||
hdf5DataDescription = PointDataDescription.fromStream(this.getClass()
|
||||
.getResourceAsStream("/res/pointdata/nctaf.xml"));
|
||||
hdf5DataDescription = PointDataDescription
|
||||
.fromStream(this.getClass().getResourceAsStream(
|
||||
"/res/pointdata/nctaf.xml"));
|
||||
|
||||
}
|
||||
return hdf5DataDescription;
|
||||
|
@ -186,5 +190,4 @@ public class NcTafDao extends PointDataPluginDao<NcTafRecord> {
|
|||
return dbDataDescription;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -24,17 +24,20 @@
|
|||
|
||||
package gov.noaa.nws.ncep.common.dataplugin.ncuair.dao;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataDbDescription;
|
||||
|
||||
import gov.noaa.nws.ncep.common.dataplugin.ncuair.NcUairRecord;
|
||||
import gov.noaa.nws.ncep.edex.common.dao.NcepPointDataPluginDao;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataDbDescription;
|
||||
|
||||
public class NcUairDao extends NcepPointDataPluginDao<NcUairRecord> {
|
||||
|
||||
private PointDataDescription pdd;
|
||||
|
@ -103,20 +106,15 @@ public class NcUairDao extends NcepPointDataPluginDao<NcUairRecord> {
|
|||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public String[] getParameters(File file) throws StorageException,
|
||||
FileNotFoundException {
|
||||
try {
|
||||
// This should be faster than hitting the datastore.
|
||||
return getPointDataDescription().getParameterNames();
|
||||
} catch (Exception e) {
|
||||
// let super handle it
|
||||
return super.getParameters(file);
|
||||
}
|
||||
}
|
||||
* @Override public String[] getParameters(File file) throws
|
||||
* StorageException, FileNotFoundException { try { // This should be faster
|
||||
* than hitting the datastore. return
|
||||
* getPointDataDescription().getParameterNames(); } catch (Exception e) { //
|
||||
* let super handle it return super.getParameters(file); } }
|
||||
*/
|
||||
|
||||
public PointDataDescription getPointDataDescription() throws JAXBException {
|
||||
public PointDataDescription getPointDataDescription()
|
||||
throws SerializationException {
|
||||
if (pdd == null) {
|
||||
pdd = PointDataDescription.fromStream(this.getClass()
|
||||
.getResourceAsStream("/res/pointdata/ncuair.xml"));
|
||||
|
@ -142,5 +140,4 @@ public class NcUairDao extends NcepPointDataPluginDao<NcUairRecord> {
|
|||
return dbDataDescription;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,12 +10,11 @@ import gov.noaa.nws.ncep.common.dataplugin.pirep.PirepRecord;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.dataplugin.persist.IPersistable;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
||||
|
||||
|
@ -40,6 +39,7 @@ import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
|
|||
public class PirepDao extends PointDataPluginDao<PirepRecord> {
|
||||
|
||||
private PointDataDescription pdd;
|
||||
|
||||
/**
|
||||
* Creates a new PirepDao
|
||||
*
|
||||
|
@ -48,6 +48,7 @@ public class PirepDao extends PointDataPluginDao<PirepRecord> {
|
|||
public PirepDao(String pluginName) throws PluginException {
|
||||
super(pluginName);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IDataStore populateDataStore(IDataStore dataStore,
|
||||
IPersistable obj) throws Exception {
|
||||
|
@ -92,6 +93,7 @@ public class PirepDao extends PointDataPluginDao<PirepRecord> {
|
|||
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getKeysRequiredForFileName() {
|
||||
return new String[] { "dataTime.refTime" };
|
||||
|
@ -108,21 +110,16 @@ public class PirepDao extends PointDataPluginDao<PirepRecord> {
|
|||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public String[] getParameters(File file) throws StorageException,
|
||||
FileNotFoundException {
|
||||
|
||||
try {
|
||||
// This should be faster than hitting the datastore.
|
||||
return getPointDataDescription().getParameterNames();
|
||||
} catch (Exception e) {
|
||||
// let super handle it
|
||||
return super.getParameters(file);
|
||||
}
|
||||
}
|
||||
* @Override public String[] getParameters(File file) throws
|
||||
* StorageException, FileNotFoundException {
|
||||
*
|
||||
* try { // This should be faster than hitting the datastore. return
|
||||
* getPointDataDescription().getParameterNames(); } catch (Exception e) { //
|
||||
* let super handle it return super.getParameters(file); } }
|
||||
*/
|
||||
|
||||
public PointDataDescription getPointDataDescription() throws JAXBException {
|
||||
public PointDataDescription getPointDataDescription()
|
||||
throws SerializationException {
|
||||
if (pdd == null) {
|
||||
|
||||
pdd = PointDataDescription.fromStream(this.getClass()
|
||||
|
@ -132,4 +129,3 @@ public class PirepDao extends PointDataPluginDao<PirepRecord> {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -16,21 +16,23 @@
|
|||
**/
|
||||
package gov.noaa.nws.ncep.common.dataplugin.sgwh.dao;
|
||||
|
||||
import java.util.List;
|
||||
import gov.noaa.nws.ncep.common.dataplugin.sgwh.SgwhRecord;
|
||||
import gov.noaa.nws.ncep.edex.common.dao.NcepPointDataPluginDao;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
import gov.noaa.nws.ncep.common.dataplugin.sgwh.SgwhRecord;
|
||||
import gov.noaa.nws.ncep.edex.common.dao.NcepPointDataPluginDao;
|
||||
|
||||
public class SgwhDao extends NcepPointDataPluginDao<SgwhRecord> {
|
||||
|
||||
private PointDataDescription pdd;
|
||||
|
||||
/**
|
||||
* Creates a new ReccoDao
|
||||
*
|
||||
* @throws PluginException
|
||||
*/
|
||||
public SgwhDao(String pluginName) throws PluginException {
|
||||
|
@ -52,7 +54,7 @@ public class SgwhDao extends NcepPointDataPluginDao<SgwhRecord> {
|
|||
} catch (DataAccessLayerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if((obs != null)&&(obs.size() > 0)) {
|
||||
if ((obs != null) && (obs.size() > 0)) {
|
||||
report = (SgwhRecord) obs.get(0);
|
||||
}
|
||||
return report;
|
||||
|
@ -68,14 +70,16 @@ public class SgwhDao extends NcepPointDataPluginDao<SgwhRecord> {
|
|||
*/
|
||||
public Object[] queryDataUriColumn(final String dataUri) {
|
||||
|
||||
String sql = "select datauri from awips.sgwh where datauri='"
|
||||
+ dataUri + "';";
|
||||
String sql = "select datauri from awips.sgwh where datauri='" + dataUri
|
||||
+ "';";
|
||||
|
||||
Object[] results = executeSQLQuery(sql);
|
||||
|
||||
return results;
|
||||
}
|
||||
public PointDataDescription getPointDataDescription() throws JAXBException {
|
||||
|
||||
public PointDataDescription getPointDataDescription()
|
||||
throws SerializationException {
|
||||
if (pdd == null) {
|
||||
pdd = PointDataDescription.fromStream(this.getClass()
|
||||
.getResourceAsStream("/res/pointdata/sgwh.xml"));
|
||||
|
|
|
@ -16,15 +16,14 @@
|
|||
**/
|
||||
package gov.noaa.nws.ncep.common.dataplugin.sgwhv.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import gov.noaa.nws.ncep.common.dataplugin.sgwhv.SgwhvRecord;
|
||||
import gov.noaa.nws.ncep.edex.common.dao.NcepPointDataPluginDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
|
||||
public class SgwhvDao extends NcepPointDataPluginDao<SgwhvRecord> {
|
||||
|
@ -32,6 +31,7 @@ public class SgwhvDao extends NcepPointDataPluginDao<SgwhvRecord> {
|
|||
|
||||
/**
|
||||
* Creates a new ReccoDao
|
||||
*
|
||||
* @throws PluginException
|
||||
*/
|
||||
public SgwhvDao(String pluginName) throws PluginException {
|
||||
|
@ -53,14 +53,15 @@ public class SgwhvDao extends NcepPointDataPluginDao<SgwhvRecord> {
|
|||
} catch (DataAccessLayerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if((obs != null)&&(obs.size() > 0)) {
|
||||
if ((obs != null) && (obs.size() > 0)) {
|
||||
report = (SgwhvRecord) obs.get(0);
|
||||
}
|
||||
return report;
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries for to determine if a given data uri exists on the Bufrsgwhv table.
|
||||
* Queries for to determine if a given data uri exists on the Bufrsgwhv
|
||||
* table.
|
||||
*
|
||||
* @param dataUri
|
||||
* The DataURI to find.
|
||||
|
@ -76,13 +77,16 @@ public class SgwhvDao extends NcepPointDataPluginDao<SgwhvRecord> {
|
|||
|
||||
return results;
|
||||
}
|
||||
public PointDataDescription getPointDataDescription() throws JAXBException {
|
||||
|
||||
public PointDataDescription getPointDataDescription()
|
||||
throws SerializationException {
|
||||
if (pdd == null) {
|
||||
pdd = PointDataDescription.fromStream(this.getClass()
|
||||
.getResourceAsStream("/res/pointdata/sgwhv.xml"));
|
||||
}
|
||||
return pdd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getKeysRequiredForFileName() {
|
||||
return new String[] { "dataTime.refTime" };
|
||||
|
|
|
@ -16,15 +16,14 @@
|
|||
**/
|
||||
package gov.noaa.nws.ncep.common.dataplugin.ssha.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
||||
import gov.noaa.nws.ncep.common.dataplugin.ssha.SshaRecord;
|
||||
import gov.noaa.nws.ncep.edex.common.dao.NcepPointDataPluginDao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.PluginException;
|
||||
import com.raytheon.uf.common.pointdata.PointDataDescription;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.edex.database.DataAccessLayerException;
|
||||
|
||||
public class SshaDao extends NcepPointDataPluginDao<SshaRecord> {
|
||||
|
@ -32,6 +31,7 @@ public class SshaDao extends NcepPointDataPluginDao<SshaRecord> {
|
|||
|
||||
/**
|
||||
* Creates a new BufrsshaDao
|
||||
*
|
||||
* @throws PluginException
|
||||
*/
|
||||
public SshaDao(String pluginName) throws PluginException {
|
||||
|
@ -53,15 +53,16 @@ public class SshaDao extends NcepPointDataPluginDao<SshaRecord> {
|
|||
} catch (DataAccessLayerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if((obs != null)&&(obs.size() > 0)) {
|
||||
if ((obs != null) && (obs.size() > 0)) {
|
||||
report = (SshaRecord) obs.get(0);
|
||||
}
|
||||
return report;
|
||||
}
|
||||
|
||||
/**
|
||||
* Queries for to determine if a given data uri exists on the Bufrssha table.import gov.noaa.nws.ncep.common.dataplugin.sgwh.SgwhRecord;
|
||||
|
||||
* Queries for to determine if a given data uri exists on the Bufrssha
|
||||
* table.import gov.noaa.nws.ncep.common.dataplugin.sgwh.SgwhRecord;
|
||||
*
|
||||
*
|
||||
* @param dataUri
|
||||
* The DataURI to find.
|
||||
|
@ -70,20 +71,23 @@ public class SshaDao extends NcepPointDataPluginDao<SshaRecord> {
|
|||
*/
|
||||
public Object[] queryDataUriColumn(final String dataUri) {
|
||||
|
||||
String sql = "select datauri from awips.ssha where datauri='"
|
||||
+ dataUri + "';";
|
||||
String sql = "select datauri from awips.ssha where datauri='" + dataUri
|
||||
+ "';";
|
||||
|
||||
Object[] results = executeSQLQuery(sql);
|
||||
|
||||
return results;
|
||||
}
|
||||
public PointDataDescription getPointDataDescription() throws JAXBException {
|
||||
|
||||
public PointDataDescription getPointDataDescription()
|
||||
throws SerializationException {
|
||||
if (pdd == null) {
|
||||
pdd = PointDataDescription.fromStream(this.getClass()
|
||||
.getResourceAsStream("/res/pointdata/ssha.xml"));
|
||||
}
|
||||
return pdd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getKeysRequiredForFileName() {
|
||||
return new String[] { "dataTime.refTime" };
|
||||
|
|
Loading…
Add table
Reference in a new issue