HiRISE

HiRISE.HiWish
Class SuggestionStorage

java.lang.Object
  extended by HiRISE.HiWish.SuggestionStorage
Direct Known Subclasses:
Cloning

public class SuggestionStorage
extends Object

Makes Suggestion Sausage


Field Summary
protected  Connection conn
          Our database connection
protected static Logger logger
          Our logging instance
 
Constructor Summary
SuggestionStorage(Connection conn)
           
 
Method Summary
 Suggestion load(int id)
          Load a suggestion by ID.
static String roiToPolygonText(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conn

protected Connection conn
Our database connection


logger

protected static final Logger logger
Our logging instance

Constructor Detail

SuggestionStorage

public SuggestionStorage(Connection conn)
Parameters:
conn - The database connection
Method Detail

load

public Suggestion load(int id)
                throws SQLException
Load a suggestion by ID. If not found, null will be returned.

Parameters:
id - The suggestion ID
Returns:
suggestion instance or null
Throws:
SQLException - Data could not be loaded

save

public void save(Suggestion suggestion,
                 User user)
          throws SQLException
Saves a suggestion, including any related suggestions and their mappings. Also saves the relation to the People table.

Parameters:
suggestion - The suggestion to save
user - The user who is doing the save
Throws:
SQLException - Suggestion could not be saved

roiToPolygonText

public static String roiToPolygonText(String roi)
                               throws ParseException
Takes a ROI CSV string and creates a geo-SQL string

Parameters:
roi - Region of Interest
Returns:
value for SQL
Throws:
ParseException - invalid input

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona