cmu.jspsurveymanager.data
Class SurveyStorage

java.lang.Object
  extended by cmu.jspsurveymanager.data.SurveyStorage

public class SurveyStorage
extends java.lang.Object


Constructor Summary
SurveyStorage(DatabaseObjectStorage objectStorage)
           
 
Method Summary
 void deleteSurvey(Survey survey)
           
 Survey getNewSurvey()
           
 Survey getSurvey(int id)
          Provides the survey with the given unique ID.
 Survey getSurvey(java.lang.String title)
          Provides the survey with the given name, or null if none exists.
 java.util.Vector<Survey> getSurveys()
          Gets an array of all Admins.
 java.util.Vector<Survey> getSurveys(Admin admin)
          Returns Surveys for which the given admin has a permissions entry.
 boolean grantSurveyDatabasePermission(Survey s, Admin a)
           
 boolean revokeSurveyDatabasePermission(Survey s, Admin a)
           
 boolean saveSurvey(Survey survey)
          Saves the survey.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SurveyStorage

public SurveyStorage(DatabaseObjectStorage objectStorage)
Method Detail

getSurveys

public java.util.Vector<Survey> getSurveys()
Gets an array of all Admins.


saveSurvey

public boolean saveSurvey(Survey survey)
Saves the survey.

Parameters:
survey -
Returns:
Whether the save was successful.

getSurvey

public Survey getSurvey(java.lang.String title)
Provides the survey with the given name, or null if none exists.

Parameters:
title - The name of the survey.
Returns:
The survey requested, or null.

getSurvey

public Survey getSurvey(int id)
Provides the survey with the given unique ID.

Parameters:
id - The ID of the survey.
Returns:
The survey requested, or null.

deleteSurvey

public void deleteSurvey(Survey survey)

getSurveys

public java.util.Vector<Survey> getSurveys(Admin admin)
Returns Surveys for which the given admin has a permissions entry.

Parameters:
admin - The Admin to find Surveys for.
Returns:
an array of Survey

getNewSurvey

public Survey getNewSurvey()
Returns:
a new, empty survey

grantSurveyDatabasePermission

public boolean grantSurveyDatabasePermission(Survey s,
                                             Admin a)

revokeSurveyDatabasePermission

public boolean revokeSurveyDatabasePermission(Survey s,
                                              Admin a)