Class XMLResultSetManager

java.lang.Object
ca.phon.query.db.xml.XMLResultSetManager
All Implemented Interfaces:
ResultSetManager

public class XMLResultSetManager extends Object implements ResultSetManager
An implementation of ResultSetManager that implements an XML-based system. XML data is stored on on disk.
  • Field Details

    • DEFAULT_QUERY_FOLDER

      public static final String DEFAULT_QUERY_FOLDER
      Folder inside of <project>/__res where query results are saved.
      See Also:
  • Constructor Details

    • XMLResultSetManager

      public XMLResultSetManager()
      Default constructor.
  • Method Details

    • getQueries

      public List<Query> getQueries(Project project)
      Description copied from interface: ResultSetManager
      Gets a list of queries for a specified project.
      Specified by:
      getQueries in interface ResultSetManager
      Parameters:
      project - the project
      Returns:
      a list of queries for the given project
    • getResultSetsForQuery

      public List<ResultSet> getResultSetsForQuery(Project project, Query query)
      Description copied from interface: ResultSetManager
      Gets a list of result sets for a specified query and project.
      Specified by:
      getResultSetsForQuery in interface ResultSetManager
      Parameters:
      project - the project
      query - the query
      Returns:
      the list of result sets for a given query of the given project
    • saveQuery

      public void saveQuery(Project project, Query query) throws IOException
      Description copied from interface: ResultSetManager
      Saves a query in the specified project.
      Specified by:
      saveQuery in interface ResultSetManager
      Parameters:
      project - the project
      query - the query
      Throws:
      IOException - if the query could not be saved
    • loadQuery

      public Query loadQuery(Project project, String queryName) throws IOException
      Description copied from interface: ResultSetManager
      Loads a given query from the specified project.
      Specified by:
      loadQuery in interface ResultSetManager
      Parameters:
      project - the project
      queryName - the query name
      Returns:
      the query, if successfully loaded
      Throws:
      IOException - if the query could not be loaded
    • saveResultSet

      public void saveResultSet(Project project, Query query, ResultSet resultSet) throws IOException
      Description copied from interface: ResultSetManager
      Saves a query's result set in the specified project.
      Specified by:
      saveResultSet in interface ResultSetManager
      Parameters:
      project - the project
      query - the query
      resultSet - the result set
      Throws:
      IOException - if the result set could not be saved
    • loadResultSet

      public ResultSet loadResultSet(Project project, Query query, String sessionPath) throws IOException
      Description copied from interface: ResultSetManager
      Loads a given result set for a query from the specified project.
      Specified by:
      loadResultSet in interface ResultSetManager
      Parameters:
      project - the project
      query - the query
      sessionPath - the session name
      Returns:
      the result set, if successfully loaded
      Throws:
      IOException - if the result set could not be loaded
    • deleteQuery

      public void deleteQuery(Project project, Query query) throws IOException
      Description copied from interface: ResultSetManager
      Delete the given query from the specified project. This will also delete all associated result sets.
      Specified by:
      deleteQuery in interface ResultSetManager
      Parameters:
      project -
      query -
      Throws:
      IOException - if the query is not found or could not be removed from the storage device.
    • deleteResultSet

      public void deleteResultSet(Project project, Query query, ResultSet resultset) throws IOException
      Description copied from interface: ResultSetManager
      Delete the specified result set from the given project and query.
      Specified by:
      deleteResultSet in interface ResultSetManager
      Parameters:
      project -
      query -
      resultset -
      Throws:
      IOException - if the resultset/query is not found or could not be removed from the storage device.
    • renameQuery

      public void renameQuery(Project project, Query query, String newName) throws IOException
      Description copied from interface: ResultSetManager
      Re-name the specified query. query.setName() should not be called before using the method!
      Specified by:
      renameQuery in interface ResultSetManager
      Parameters:
      project -
      query -
      newName -
      Throws:
      IOException - if the query folder could not be re-named.