Package edu.suffolk.litlab.efsp.ecfcodes
Class CodeDatabaseAPI
java.lang.Object
edu.suffolk.litlab.efsp.db.Database
edu.suffolk.litlab.efsp.ecfcodes.CodeDatabaseAPI
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
CodeDatabase
ECF says that certain parts of the information model of the data that we exchange with the EFM is
contained in Genericode code lists. The EfileProxyServer saves those Genericode code lists in a
SQL database, for immediate use.
This class is the exposed interface between the SQL databases that store genericode info and the rest of the proxy server, particularly { CodeUpdater }. It should be instanianted once per jurisiction.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncourtCoverageCaseCategory(String searchTerm) courtCoverageCaseType(String searchTerm) abstract voidcreateTableIfAbsent(String tableName) abstract booleandeleteFromTable(String tableName) abstract booleandeleteFromTable(String tableName, String courtLocation) Deletes all entries in a domain from a table in the given table fromcourtLocation.genericSearch(String searchTerm, SQLFunction<String, PreparedStatement> queryMaker) Runs all of the logic for search queries (both name searches and court coverage searches).Gets all court location identifiers (CLI) stored in the database.abstract List<NameAndCode> getCaseCategoryNames(String courtLocationId) abstract List<NameAndCode> getCaseTypeNamesFor(String courtLocationId, String caseCategoryCode, Optional<Boolean> initial) abstract TylerDomainThe domain (the juristiction + environment, e.g. illinois-stage) that this database is working over.Returns a map from court names to tables that needed to be updated for it.abstract List<CodeAndLocation> retrieveCaseCategoryByName(String categoryName) Get the code and court locations of the case categories that match the given name exactly.abstract List<CodeAndLocation> retrieveCaseTypeByName(String caseTypeName) Get the code and court locations of the case types that match the given name exactly.protected <T> List<T> safetyWrap(SQLGetter<List<T>> sup) protected <T> Optional<T> safetyWrapOpt(SQLGetter<Optional<T>> sup) searchCaseCategory(String searchTerm) Gets all distinct case category names that have the search term in them.searchCaseType(String searchTerm) Gets all distinct case type names that have the search term in them.abstract voidupdateTable(String tableName, String courtName, InputStream is) abstract voidupdateTable(String tableName, String courtName, String newVersion, Iterator<Map<String, String>> rows) The iterator (rows) will be consumed by this function.abstract voidMethods inherited from class edu.suffolk.litlab.efsp.db.Database
close, commit, createTablesIfAbsent, rollback, setAutoCommit, setSavepoint
-
Constructor Details
-
CodeDatabaseAPI
-
-
Method Details
-
getDomain
The domain (the juristiction + environment, e.g. illinois-stage) that this database is working over. -
getAllLocations
Gets all court location identifiers (CLI) stored in the database.- Returns:
- a list of all valid CLIs for this jurisdiction
-
updateTable
public abstract void updateTable(String tableName, String courtName, InputStream is) throws SQLException, CodeDocException - Throws:
SQLExceptionCodeDocException
-
updateTable
public abstract void updateTable(String tableName, String courtName, String newVersion, Iterator<Map<String, String>> rows) throws SQLExceptionThe iterator (rows) will be consumed by this function.- Throws:
SQLException
-
deleteFromTable
- Throws:
SQLException
-
deleteFromTable
Deletes all entries in a domain from a table in the given table fromcourtLocation.- Throws:
SQLException
-
createTableIfAbsent
- Throws:
SQLException
-
getVersionsToUpdate
Returns a map from court names to tables that needed to be updated for it.- Throws:
SQLException
-
vacuumAll
public abstract void vacuumAll() -
searchCaseCategory
Gets all distinct case category names that have the search term in them.- Parameters:
searchTerm-- Returns:
-
courtCoverageCaseCategory
-
retrieveCaseCategoryByName
Get the code and court locations of the case categories that match the given name exactly.- Parameters:
categoryName-- Returns:
-
getCaseCategoryNames
-
searchCaseType
Gets all distinct case type names that have the search term in them.- Parameters:
searchTerm-- Returns:
-
courtCoverageCaseType
-
retrieveCaseTypeByName
Get the code and court locations of the case types that match the given name exactly.- Parameters:
caseTypeName-- Returns:
-
getCaseTypeNamesFor
-
genericSearch
protected List<String> genericSearch(String searchTerm, SQLFunction<String, PreparedStatement> queryMaker) Runs all of the logic for search queries (both name searches and court coverage searches). -
safetyWrap
-
safetyWrapOpt
-