Package ca.phon.query.db.xml
Class XMLResultSetManager
java.lang.Object
ca.phon.query.db.xml.XMLResultSetManager
- All Implemented Interfaces:
ResultSetManager
An implementation of
ResultSetManager
that implements an XML-based
system. XML data is stored on on disk.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Folder inside of<project>/__res
where query results are saved. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteQuery
(Project project, Query query) Delete the given query from the specified project.void
deleteResultSet
(Project project, Query query, ResultSet resultset) Delete the specified result set from the given project and query.getQueries
(Project project) Gets a list of queries for a specified project.getResultSetsForQuery
(Project project, Query query) Gets a list of result sets for a specified query and project.Loads a given query from the specified project.loadResultSet
(Project project, Query query, String sessionName) Loads a given result set for a query from the specified project.void
renameQuery
(Project project, Query query, String newName) Re-name the specified query.void
Saves a query in the specified project.void
saveResultSet
(Project project, Query query, ResultSet resultSet) Saves a query's result set in the specified project.
-
Field Details
-
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
Description copied from interface:ResultSetManager
Gets a list of queries for a specified project.- Specified by:
getQueries
in interfaceResultSetManager
- Parameters:
project
- the project- Returns:
- a list of queries for the given project
-
getResultSetsForQuery
Description copied from interface:ResultSetManager
Gets a list of result sets for a specified query and project.- Specified by:
getResultSetsForQuery
in interfaceResultSetManager
- Parameters:
project
- the projectquery
- the query- Returns:
- the list of result sets for a given query of the given project
-
saveQuery
Description copied from interface:ResultSetManager
Saves a query in the specified project.- Specified by:
saveQuery
in interfaceResultSetManager
- Parameters:
project
- the projectquery
- the query- Throws:
IOException
- if the query could not be saved
-
loadQuery
Description copied from interface:ResultSetManager
Loads a given query from the specified project.- Specified by:
loadQuery
in interfaceResultSetManager
- Parameters:
project
- the projectqueryName
- the query name- Returns:
- the query, if successfully loaded
- Throws:
IOException
- if the query could not be loaded
-
saveResultSet
Description copied from interface:ResultSetManager
Saves a query's result set in the specified project.- Specified by:
saveResultSet
in interfaceResultSetManager
- Parameters:
project
- the projectquery
- the queryresultSet
- the result set- Throws:
IOException
- if the result set could not be saved
-
loadResultSet
Description copied from interface:ResultSetManager
Loads a given result set for a query from the specified project.- Specified by:
loadResultSet
in interfaceResultSetManager
- Parameters:
project
- the projectquery
- the querysessionName
- the session name- Returns:
- the result set, if successfully loaded
- Throws:
IOException
- if the result set could not be loaded
-
deleteQuery
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 interfaceResultSetManager
- Throws:
IOException
- if the query is not found or could not be removed from the storage device.
-
deleteResultSet
Description copied from interface:ResultSetManager
Delete the specified result set from the given project and query.- Specified by:
deleteResultSet
in interfaceResultSetManager
- Throws:
IOException
- if the resultset/query is not found or could not be removed from the storage device.
-
renameQuery
Description copied from interface:ResultSetManager
Re-name the specified query. query.setName() should not be called before using the method!- Specified by:
renameQuery
in interfaceResultSetManager
- Throws:
IOException
- if the query folder could not be re-named.
-