Merge "Issue #2361 remove ISerializableObject for some pointdata and user roles classes" into development

Former-commit-id: 2934222c09 [formerly b3fdf129db [formerly 7a2dd6ccb98c9b7b28b989835b6ed6535f7a6ce1]]
Former-commit-id: b3fdf129db
Former-commit-id: 55d1d12c38
This commit is contained in:
Nate Jensen 2013-10-10 10:09:46 -05:00 committed by Gerrit Code Review
commit 038f48e28f
39 changed files with 1711 additions and 1827 deletions

View file

@ -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";

View file

@ -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;
@ -134,7 +133,7 @@ public class GOESSoundingDAO extends PointDataPluginDao<GOESSounding> {
public GOESSounding newObject() {
return new GOESSounding();
}
@Override
public PointDataDescription getPointDataDescription(Map<String, Object> obj) {
if (hdf5DataDescription == null) {
@ -142,12 +141,12 @@ 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);
}
}
return hdf5DataDescription;
}
}

View file

@ -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>
*
@ -53,56 +53,55 @@ 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 HEIGHTS_NUM = "nhts";
// 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";
private static final String LEVEL_HEIGHT = "levelHeight";
private static final String WIND_SPEED = "windSpeed";
private static final String WIND_DIR = "windDir";
private static final String UC_WIND = "ucWind";
private static final String VC_WIND = "vcWind";
private static final String WC_WIND = "wcWind";
private static final String U_CONF = "uconf";
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;
private PointDataDescription pdd;
private Log logger = LogFactory.getLog(getClass());
public LdadprofilerPointDataTransform() {
try {
this.pdd = getDescription("ldadprofiler");
this.dao = new LdadProfilerDao("ldadprofiler");
@ -112,8 +111,8 @@ public class LdadprofilerPointDataTransform {
e.printStackTrace();
}
}
public PluginDataObject[] toPointData(PluginDataObject[] pdo) {
public PluginDataObject[] toPointData(PluginDataObject[] pdo) {
if (pdo.length > 0) {
Map<File, PointDataContainer> pointMap = new HashMap<File, PointDataContainer>();
@ -126,7 +125,7 @@ public class LdadprofilerPointDataTransform {
pdc = PointDataContainer.build(this.pdd);
pointMap.put(f, pdc);
}
ProfilerLdadObs ldadr = (ProfilerLdadObs) p;
PointDataView pdv = buildView(pdc, ldadr);
ldadr.setPointDataView(pdv);
@ -134,60 +133,60 @@ public class LdadprofilerPointDataTransform {
}
return pdo;
}
@SuppressWarnings("unchecked")
private PointDataView buildView(PointDataContainer container,
ProfilerLdadObs record) {
private PointDataView buildView(PointDataContainer container,
ProfilerLdadObs record) {
PointDataView pdv = container.append();
pdv.setInt(HEIGHTS_NUM, record.getNhts());
if (record.getLevels() != null) {
Iterator lvlIterator = record.getLevels().iterator();
int i = 0;
while (lvlIterator.hasNext()) {
ProfilerLdadLevel lvl = (ProfilerLdadLevel) lvlIterator.next();
if (lvl.getLevelHeight() != null) {
pdv.setInt(LEVEL_HEIGHT, lvl.getLevelHeight(), i);
}
if (lvl.getWindSpeed()!= null) {
pdv.setFloat(WIND_SPEED, lvl.getWindSpeed().floatValue(), i);
}
if (lvl.getWindDir() != null) {
pdv.setFloat(WIND_DIR, lvl.getWindDir().floatValue(), i);
}
if (lvl.getUcWind() != null) {
pdv.setFloat(UC_WIND, lvl.getUcWind().floatValue(), i);
}
if (lvl.getVcWind() != null) {
pdv.setFloat(VC_WIND, lvl.getVcWind().floatValue(), i);
}
if (lvl.getWcWind() != null) {
pdv.setFloat(WC_WIND, lvl.getWcWind().floatValue(), i);
}
if (lvl.getUconf() != null) {
pdv.setFloat(U_CONF, lvl.getUconf().floatValue(), i);
}
if (lvl.getVconf() != null) {
pdv.setFloat(V_CONF, lvl.getVconf().floatValue(), i);
}
if (lvl.getWconf() != null) {
pdv.setFloat(W_CONF, lvl.getWconf().floatValue(), i);
}
i++;
ProfilerLdadLevel lvl = (ProfilerLdadLevel) lvlIterator.next();
if (lvl.getLevelHeight() != null) {
pdv.setInt(LEVEL_HEIGHT, lvl.getLevelHeight(), i);
}
if (lvl.getWindSpeed() != null) {
pdv.setFloat(WIND_SPEED, lvl.getWindSpeed().floatValue(), i);
}
if (lvl.getWindDir() != null) {
pdv.setFloat(WIND_DIR, lvl.getWindDir().floatValue(), i);
}
if (lvl.getUcWind() != null) {
pdv.setFloat(UC_WIND, lvl.getUcWind().floatValue(), i);
}
if (lvl.getVcWind() != null) {
pdv.setFloat(VC_WIND, lvl.getVcWind().floatValue(), i);
}
if (lvl.getWcWind() != null) {
pdv.setFloat(WC_WIND, lvl.getWcWind().floatValue(), i);
}
if (lvl.getUconf() != null) {
pdv.setFloat(U_CONF, lvl.getUconf().floatValue(), i);
}
if (lvl.getVconf() != null) {
pdv.setFloat(V_CONF, lvl.getVconf().floatValue(), i);
}
if (lvl.getWconf() != null) {
pdv.setFloat(W_CONF, lvl.getWconf().floatValue(), i);
}
i++;
}
}
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) {
throw new RuntimeException("Cannot find descriptor for: " + type);
}
return PointDataDescription.fromStream(is);
}
}
}

View file

@ -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);
}
}

View file

@ -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);
}

View file

@ -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) {

View file

@ -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) {

View file

@ -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

View file

@ -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;
@ -107,7 +106,7 @@ public class NwsRoleData implements ISerializableObject {
perms.add(p.getId());
}
Collections.sort(perms);
return perms.toArray(new String[perms.size()]);
}
@ -117,7 +116,7 @@ public class NwsRoleData implements ISerializableObject {
roles.add(r.getRoleId());
}
Collections.sort(roles);
return roles.toArray(new String[roles.size()]);
}
@ -127,7 +126,7 @@ public class NwsRoleData implements ISerializableObject {
users.add(r.getUserId());
}
Collections.sort(users);
return users.toArray(new String[users.size()]);
}
@ -140,18 +139,18 @@ 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);
this.roleList.add(roleXml);
}
}
/**
* 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
*/
@ -159,14 +158,15 @@ public class NwsRoleData implements ISerializableObject {
if (permission != null && permission.length() > 0) {
PermissionXML pXml = new PermissionXML();
pXml.setId(permission);
this.permissionList.add(pXml);
this.permissionList.add(pXml);
}
}
/**
* 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) {
@ -181,10 +181,10 @@ public class NwsRoleData implements ISerializableObject {
}
}
Collections.sort(userPermissions);
return userPermissions.toArray(new String[userPermissions.size()]);
}
/**
* Get an array of all defined permissions
*
@ -192,13 +192,13 @@ 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());
}
return permissions.toArray(new String[permissions.size()]);
}
public String[] getRolePermissions(String roleId) {
ArrayList<String> rolePermissions = new ArrayList<String>();
@ -211,7 +211,7 @@ public class NwsRoleData implements ISerializableObject {
}
}
Collections.sort(rolePermissions);
return rolePermissions.toArray(new String[rolePermissions.size()]);
}
@ -227,7 +227,7 @@ public class NwsRoleData implements ISerializableObject {
}
}
Collections.sort(userRoles);
return userRoles.toArray(new String[userRoles.size()]);
}
@ -237,7 +237,7 @@ public class NwsRoleData implements ISerializableObject {
roleIdList.add(rx.getRoleId());
}
Collections.sort(roleIdList);
return roleIdList.toArray(new String[roleIdList.size()]);
}
@ -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,20 +286,21 @@ public class NwsRoleData implements ISerializableObject {
*/
public boolean isAuthorized(String permission, String user) {
Set<String> authorizedPermissions = this.getAuthorizedPermissions(user);
Set<String> allAuthorizedPermissions = this.getAuthorizedPermissions("ALL");
for (String perm: authorizedPermissions) {
Set<String> allAuthorizedPermissions = this
.getAuthorizedPermissions("ALL");
for (String perm : authorizedPermissions) {
if (perm.equalsIgnoreCase(permission)) {
return true;
}
}
for (String perm: allAuthorizedPermissions) {
for (String perm : allAuthorizedPermissions) {
if (perm.equalsIgnoreCase(permission)) {
return true;
}
}
return false;
}

View file

@ -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")

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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;
@ -59,7 +49,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 8, 2009 chammack Initial creation
* 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) {

View file

@ -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
@ -46,7 +45,8 @@ import com.raytheon.uf.common.serialization.ISerializableObject;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 8, 2009 chammack Initial creation
* 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;

View file

@ -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;
}
}

View file

@ -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;
@ -40,16 +36,17 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 8, 2009 chammack Initial creation
* 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;

View file

@ -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;
@ -38,7 +34,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 8, 2009 chammack Initial creation
* 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() {

View file

@ -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;
@ -38,7 +34,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 8, 2009 chammack Initial creation
* 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() {

View file

@ -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;
@ -38,7 +34,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 8, 2009 chammack Initial creation
* 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() {

View file

@ -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;
@ -38,7 +34,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 8, 2009 chammack Initial creation
* 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() {

View file

@ -1,2 +0,0 @@
com.raytheon.uf.common.site.xml.AdjacentWfoXML
com.raytheon.uf.common.site.xml.CwaXML

View file

@ -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);

View file

@ -1,6 +1,5 @@
package com.raytheon.uf.edex.plugin.fssobs;
import java.io.InputStream;
import java.sql.SQLException;
import java.util.ArrayList;
@ -16,19 +15,17 @@ 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);
}
public FSSObsDAO(String pluginName) throws PluginException {
super(pluginName);
}
public FSSObsDAO() throws PluginException, SQLException {
this("fssobs");
}
@ -46,7 +43,7 @@ public class FSSObsDAO extends PointDataPluginDao<FSSObsRecord> {
}
return report;
}
public Object[] queryDataUriColumn(final String dataUri) {
String sql = "select datauri from awips.fssobs where datauri='"
@ -56,7 +53,7 @@ public class FSSObsDAO extends PointDataPluginDao<FSSObsRecord> {
return results;
}
@Override
protected IDataStore populateDataStore(IDataStore dataStore,
IPersistable obj) throws Exception {
@ -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,12 +93,11 @@ public class FSSObsDAO extends PointDataPluginDao<FSSObsRecord> {
return new FSSObsRecord();
}
@Override
public String getPointDataFileName(FSSObsRecord p) {
return "fssobs.h5";
}
@Override
public PointDataDescription getPointDataDescription(Map<String, Object> obj) {
if (hdf5DataDescription == null) {
@ -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() {
@ -136,5 +136,5 @@ public class FSSObsDAO extends PointDataPluginDao<FSSObsRecord> {
}
return dbDataDescription;
}
}

View file

@ -35,18 +35,20 @@ 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;
import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
/**
* MadisDao MADIS data DAO
* MadisDao MADIS data DAO
*
* <pre>
*
@ -63,22 +65,22 @@ import com.raytheon.uf.edex.pointdata.spatial.ObStationDao;
*/
public class MadisDao extends PointDataPluginDao<MadisRecord> {
/** The station dao */
private ObStationDao obDao = new ObStationDao();
private static final IUFStatusHandler statusHandler = UFStatus
.getHandler(MadisDao.class);
.getHandler(MadisDao.class);
public List<?> queryBySpatialBox(double upperLeftLat, double upperLeftLon,
double lowerRightLat, double lowerRightLon)
throws DataAccessLayerException {
List<ObStation> stationList = obDao.queryBySpatialBox(upperLeftLat,
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;
}
@ -165,7 +167,7 @@ public class MadisDao extends PointDataPluginDao<MadisRecord> {
public MadisRecord newObject() {
return new MadisRecord();
}
/*
* (non-Javadoc)
*

View file

@ -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());
}
}
}
@ -131,7 +145,7 @@ public class NwsRoleStorage implements IRoleStorage {
NwsRoleData roleData = getRoleData(application);
return roleData.isAuthorized(permission, user);
}
@Override
public String[] getAllDefinedPermissions(String application)
throws AuthorizationException {

View file

@ -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);
}
@ -496,17 +497,17 @@ public abstract class PointDataPluginDao<T extends PluginDataObject> extends
this.beanMapCache.offer(bm);
}
}
protected String generatePointDataFileName(T bean) {
return this.pluginName
+ File.separator
+ this.pathProvider.getHDFPath(this.pluginName,
(IPersistable) bean)
+ File.separator
+ getPointDataFileName(bean).replace(".h5", "")
+ DefaultPathProvider.fileNameFormat.get().format(
((PluginDataObject) bean).getDataTime()
.getRefTime()) + ".h5";
+ File.separator
+ this.pathProvider.getHDFPath(this.pluginName,
(IPersistable) bean)
+ File.separator
+ getPointDataFileName(bean).replace(".h5", "")
+ DefaultPathProvider.fileNameFormat.get().format(
((PluginDataObject) bean).getDataTime().getRefTime())
+ ".h5";
}
public abstract T newObject();

View file

@ -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;
@ -95,43 +94,37 @@ public class AirepDao extends PointDataPluginDao<AirepRecord> {
return results;
}
@Override
public String[] getKeysRequiredForFileName() {
return new String[] { "dataTime.refTime" };
}
@Override
public AirepRecord newObject() {
return new AirepRecord();
}
@Override
public String getPointDataFileName(AirepRecord p) {
return "airep.h5";
}
/*
@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 String[] getKeysRequiredForFileName() {
return new String[] { "dataTime.refTime" };
}
*/
public PointDataDescription getPointDataDescription() throws JAXBException {
@Override
public AirepRecord newObject() {
return new AirepRecord();
}
@Override
public String getPointDataFileName(AirepRecord p) {
return "airep.h5";
}
/*
* @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 SerializationException {
if (pdd == null) {
pdd = PointDataDescription.fromStream(this.getClass()
.getResourceAsStream("/res/pointdata/airep.xml"));
}
return pdd;
}
}

View file

@ -15,26 +15,24 @@
**/
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;
public class NcPafmDao extends PointDataPluginDao<NcPafmRecord> {
private PointDataDescription pdd;
private PointDataDescription pdd;
/**
* Creates a new ReccoDao
* @throws PluginException
*
* @throws PluginException
*/
public NcPafmDao(String pluginName) throws PluginException {
super(pluginName);
@ -55,19 +53,19 @@ 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;
}
/**
* Queries for to determine if a given data uri exists on the PAFM table.
*
* @param dataUri
* The DataURI to find.
* @return An array of objects. If not null, there should only be a single
* element.
* element.
*/
public Object[] queryDataUriColumn(final String dataUri) {
@ -78,15 +76,16 @@ public class NcPafmDao extends PointDataPluginDao<NcPafmRecord> {
return results;
}
@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"));

View file

@ -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,19 +35,18 @@ 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 */
private ObStationDao obDao = new ObStationDao();
/**
* Creates a new NcScdDao
*
@ -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 {
@ -94,7 +96,8 @@ public class NcScdDao extends PointDataPluginDao<NcScdRecord> {
query.addQueryParam("location.stationId", icaos,
QueryParam.QueryOperand.IN);
return queryByCriteria(query);
}
}
/**
* Retrieves an ncscd report using the datauri .
*
@ -141,7 +144,7 @@ public class NcScdDao extends PointDataPluginDao<NcScdRecord> {
public void setObDao(ObStationDao obDao) {
this.obDao = obDao;
}
@Override
public String[] getKeysRequiredForFileName() {
return new String[] { "dataTime.refTime" };
@ -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);
}
}
@ -195,5 +198,5 @@ public class NcScdDao extends PointDataPluginDao<NcScdRecord> {
}
return dbDataDescription;
}
}

View file

@ -4,33 +4,34 @@
**/
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.
*
* <pre>
*
*
* SOFTWARE HISTORY
*
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 09/09/2011 458 sgurung Initial Creation from Raytheon's taf plugin
@ -44,12 +45,13 @@ import com.raytheon.uf.common.pointdata.spatial.ObStation;
public class NcTafDao extends PointDataPluginDao<NcTafRecord> {
/** The station dao */
/** The station dao */
private ObStationDao obDao = new ObStationDao();
/**
* Creates a new NcTafDao
* @throws PluginException
*
* @throws PluginException
*/
public NcTafDao(String pluginName) throws PluginException {
super(pluginName);
@ -61,7 +63,7 @@ public class NcTafDao extends PointDataPluginDao<NcTafRecord> {
// TODO Auto-generated method stub
return null;
}
public List<?> queryBySpatialBox(double upperLeftLat, double upperLeftLon,
double lowerRightLat, double lowerRightLon)
throws DataAccessLayerException {
@ -95,8 +97,8 @@ public class NcTafDao extends PointDataPluginDao<NcTafRecord> {
query.addQueryParam("location.stationId", icaos,
QueryParam.QueryOperand.IN);
return queryByCriteria(query);
}
}
/**
* Retrieves an nctaf report using the datauri .
*
@ -105,26 +107,26 @@ public class NcTafDao extends PointDataPluginDao<NcTafRecord> {
* @return The report record if it exists.
*/
public NcTafRecord queryByDataURI(String dataURI) {
NcTafRecord report = null;
NcTafRecord report = null;
List<?> obs = null;
try {
obs = queryBySingleCriteria("dataURI", dataURI);
} catch (DataAccessLayerException e) {
e.printStackTrace();
}
if((obs != null)&&(obs.size() > 0)) {
if ((obs != null) && (obs.size() > 0)) {
report = (NcTafRecord) obs.get(0);
}
return report;
}
/**
* Queries for to determine if a given data uri exists on the nctaf table.
*
* @param dataUri
* The DataURI to find.
* @return An array of objects. If not null, there should only be a single
* element.
* element.
*/
public Object[] queryDataUriColumn(final String dataUri) {
@ -135,7 +137,7 @@ public class NcTafDao extends PointDataPluginDao<NcTafRecord> {
return results;
}
public ObStationDao getObDao() {
return obDao;
}
@ -143,7 +145,7 @@ public class NcTafDao extends PointDataPluginDao<NcTafRecord> {
public void setObDao(ObStationDao obDao) {
this.obDao = obDao;
}
@Override
public String[] getKeysRequiredForFileName() {
return new String[] { "dataTime.refTime" };
@ -159,15 +161,17 @@ 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;
}
@Override
public PointDataDbDescription getPointDataDbDescription() {
if (dbDataDescription == null) {
@ -185,6 +189,5 @@ public class NcTafDao extends PointDataPluginDao<NcTafRecord> {
}
return dbDataDescription;
}
}

View file

@ -24,123 +24,120 @@
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;
/**
* Creates a new ReccoDao
*
* @throws PluginException
*/
public NcUairDao(String pluginName) throws PluginException {
super(pluginName);
}
private PointDataDescription pdd;
/**
* Retrieves an sfcobs report using the datauri .
*
* @param dataURI
* The dataURI to match against.
* @return The report record if it exists.
*/
public NcUairRecord queryByDataURI(String dataURI) {
NcUairRecord report = null;
List<?> obs = null;
try {
obs = queryBySingleCriteria("dataURI", dataURI);
} catch (DataAccessLayerException e) {
e.printStackTrace();
}
if ((obs != null) && (obs.size() > 0)) {
report = (NcUairRecord) obs.get(0);
}
return report;
}
/**
* Creates a new ReccoDao
*
* @throws PluginException
*/
public NcUairDao(String pluginName) throws PluginException {
super(pluginName);
}
/**
* Queries for to determine if a given data uri exists on the sfcobs table.
*
* @param dataUri
* The DataURI to find.
* @return An array of objects. If not null, there should only be a single
* element.
*/
public Object[] queryDataUriColumn(final String dataUri) {
/**
* Retrieves an sfcobs report using the datauri .
*
* @param dataURI
* The dataURI to match against.
* @return The report record if it exists.
*/
public NcUairRecord queryByDataURI(String dataURI) {
NcUairRecord report = null;
List<?> obs = null;
try {
obs = queryBySingleCriteria("dataURI", dataURI);
} catch (DataAccessLayerException e) {
e.printStackTrace();
}
if ((obs != null) && (obs.size() > 0)) {
report = (NcUairRecord) obs.get(0);
}
return report;
}
String sql = "select datauri from awips.ncuair where datauri='"
+ dataUri + "';";
/**
* Queries for to determine if a given data uri exists on the sfcobs table.
*
* @param dataUri
* The DataURI to find.
* @return An array of objects. If not null, there should only be a single
* element.
*/
public Object[] queryDataUriColumn(final String dataUri) {
Object[] results = executeSQLQuery(sql);
String sql = "select datauri from awips.ncuair where datauri='"
+ dataUri + "';";
return results;
}
@Override
public String[] getKeysRequiredForFileName() {
return new String[] { "dataTime.refTime" };
}
Object[] results = executeSQLQuery(sql);
@Override
public String getPointDataFileName(NcUairRecord p) {
return "ncuairs.h5";
}
return results;
}
@Override
public NcUairRecord newObject() {
return new NcUairRecord();
}
@Override
public String[] getKeysRequiredForFileName() {
return new String[] { "dataTime.refTime" };
}
/*
@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 getPointDataFileName(NcUairRecord p) {
return "ncuairs.h5";
}
public PointDataDescription getPointDataDescription() throws JAXBException {
if (pdd == null) {
pdd = PointDataDescription.fromStream(this.getClass()
.getResourceAsStream("/res/pointdata/ncuair.xml"));
}
return pdd;
}
@Override
public PointDataDbDescription getPointDataDbDescription() {
if (dbDataDescription == null) {
InputStream stream = this.getClass().getResourceAsStream(
"/res/pointdata/ncuairdb.xml");
if (stream != null) {
try {
dbDataDescription = PointDataDbDescription
.fromStream(stream);
} catch (JAXBException e) {
logger.error("Unable to load " + pluginName
+ " Point Data Database Description", e);
}
}
}
return dbDataDescription;
}
}
@Override
public NcUairRecord newObject() {
return new 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); } }
*/
public PointDataDescription getPointDataDescription()
throws SerializationException {
if (pdd == null) {
pdd = PointDataDescription.fromStream(this.getClass()
.getResourceAsStream("/res/pointdata/ncuair.xml"));
}
return pdd;
}
@Override
public PointDataDbDescription getPointDataDbDescription() {
if (dbDataDescription == null) {
InputStream stream = this.getClass().getResourceAsStream(
"/res/pointdata/ncuairdb.xml");
if (stream != null) {
try {
dbDataDescription = PointDataDbDescription
.fromStream(stream);
} catch (JAXBException e) {
logger.error("Unable to load " + pluginName
+ " Point Data Database Description", e);
}
}
}
return dbDataDescription;
}
}

View file

@ -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,20 +39,22 @@ import com.raytheon.uf.edex.pointdata.PointDataPluginDao;
public class PirepDao extends PointDataPluginDao<PirepRecord> {
private PointDataDescription pdd;
/**
* Creates a new PirepDao
*
*
* @throws PluginException
*/
public PirepDao(String pluginName) throws PluginException {
super(pluginName);
}
@Override
protected IDataStore populateDataStore(IDataStore dataStore,
IPersistable obj) throws Exception {
return null;
}
/**
* Retrieves an Pirep report using the datauri .
*
@ -92,44 +93,39 @@ public class PirepDao extends PointDataPluginDao<PirepRecord> {
return results;
}
@Override
public String[] getKeysRequiredForFileName() {
return new String[] { "dataTime.refTime" };
}
@Override
public PirepRecord newObject() {
return new PirepRecord();
}
@Override
public String getPointDataFileName(PirepRecord p) {
return "pirep.h5";
}
/*
@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 String[] getKeysRequiredForFileName() {
return new String[] { "dataTime.refTime" };
}
*/
public PointDataDescription getPointDataDescription() throws JAXBException {
if (pdd == null) {
@Override
public PirepRecord newObject() {
return new PirepRecord();
}
pdd = PointDataDescription.fromStream(this.getClass()
@Override
public String getPointDataFileName(PirepRecord p) {
return "pirep.h5";
}
/*
* @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 SerializationException {
if (pdd == null) {
pdd = PointDataDescription.fromStream(this.getClass()
.getResourceAsStream("/res/pointdata/pirep.xml"));
}
return pdd;
}
return pdd;
}
}

View file

@ -16,22 +16,24 @@
**/
package gov.noaa.nws.ncep.common.dataplugin.sgwh.dao;
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 gov.noaa.nws.ncep.common.dataplugin.sgwh.SgwhRecord;
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 SgwhDao extends NcepPointDataPluginDao<SgwhRecord> {
private PointDataDescription pdd;
private PointDataDescription pdd;
/**
* Creates a new ReccoDao
* @throws PluginException
*
* @throws PluginException
*/
public SgwhDao(String pluginName) throws PluginException {
super(pluginName);
@ -52,30 +54,32 @@ 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;
}
/**
* Queries for to determine if a given data uri exists on the sgwh table.
*
* @param dataUri
* The DataURI to find.
* @return An array of objects. If not null, there should only be a single
* element.
* element.
*/
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"));

View file

@ -16,23 +16,23 @@
**/
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> {
private PointDataDescription pdd;
public class SgwhvDao extends NcepPointDataPluginDao<SgwhvRecord> {
private PointDataDescription pdd;
/**
* Creates a new ReccoDao
* @throws PluginException
*
* @throws PluginException
*/
public SgwhvDao(String pluginName) throws PluginException {
super(pluginName);
@ -53,19 +53,20 @@ 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.
* @return An array of objects. If not null, there should only be a single
* element.
* element.
*/
public Object[] queryDataUriColumn(final String dataUri) {
@ -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" };

View file

@ -16,23 +16,23 @@
**/
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> {
private PointDataDescription pdd;
public class SshaDao extends NcepPointDataPluginDao<SshaRecord> {
private PointDataDescription pdd;
/**
* Creates a new BufrsshaDao
* @throws PluginException
*
* @throws PluginException
*/
public SshaDao(String pluginName) throws PluginException {
super(pluginName);
@ -53,37 +53,41 @@ 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.
* @return An array of objects. If not null, there should only be a single
* element.
* element.
*/
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" };