public class SuggestionStorage
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.sql.Connection |
conn
Our database connection
|
protected static java.util.logging.Logger |
logger
Our logging instance
|
Constructor and Description |
---|
SuggestionStorage(java.sql.Connection conn) |
Modifier and Type | Method and Description |
---|---|
Suggestion |
load(int id)
Load a suggestion by ID.
|
static java.lang.String |
roiToPolygonText(java.lang.String roi)
Takes a ROI CSV string and creates a geo-SQL string
|
void |
save(Suggestion suggestion,
User user)
Saves a suggestion, including any related suggestions and their mappings.
|
protected java.sql.Connection conn
protected static final java.util.logging.Logger logger
public SuggestionStorage(java.sql.Connection conn)
conn
- The database connectionpublic Suggestion load(int id) throws java.sql.SQLException
id
- The suggestion IDjava.sql.SQLException
- Data could not be loadedpublic void save(Suggestion suggestion, User user) throws java.sql.SQLException
suggestion
- The suggestion to saveuser
- The user who is doing the savejava.sql.SQLException
- Suggestion could not be savedpublic static java.lang.String roiToPolygonText(java.lang.String roi) throws java.text.ParseException
roi
- Region of Interestjava.text.ParseException
- invalid inputCopyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona