Class CodeDatabase
java.lang.Object
edu.suffolk.litlab.efspserver.db.Database
edu.suffolk.litlab.efspserver.ecfcodes.CodeDatabaseAPI
edu.suffolk.litlab.efspserver.tyler.codes.CodeDatabase
- All Implemented Interfaces:
AutoCloseable
The class that interfaces with the database tables that contain the Tyler case codes.
Codes in this case doesn't mean programming code", it's more like code numbers code names for all of the different case details and information.
- Author:
- brycew
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
createIndicesIfAbsent
(String tableName) void
createTableIfAbsent
(String tableName) void
boolean
deleteFromTable
(String tableName) boolean
deleteFromTable
(String tableName, String courtLocation) static CodeDatabase
fromDS
(String jurisdiction, String env, DataSource ds) Gets all court location identifiers (CLI) stored in the database. updateTable should have been called on the `location` table before this works.getAllowedFileTypes
(String courtId) getCaseCategoriesFor
(String courtLocationId) getCaseCategoryWithCode
(String courtLocationId, String caseCatCode) getCaseSubtypesFor
(String courtLocationId, String caseType) getCaseTypesFor
(String courtLocationId, String caseCategoryCode, Optional<Boolean> initial) getCaseTypeWith
(String courtLocationId, String caseTypeCode) getCrossReference
(String courtLocationId, String caseTypeId) getDamageAmount
(String courtLocationId, String caseCategory) getDataField
(String courtLocationId, String dataName) getDataFieldNames
(String courtLocationId) getDataFields
(String courtLocationId) gets all data fields if dataNames is empty, otherwise just those that match the code.getDisclaimerRequirements
(String courtLocation) getDocumentTypes
(String courtLocationId, String filingCodeId) The domain (the juristiction + environment, e.g. illinois-stage) that this database is working over.getFilableCaseCategories
(String courtLocationId, Optional<Boolean> initial) getFilerTypes
(String courtId) getFilingComponents
(String courtLocationId, String filingCodeId) getFilingStatuses
(String courtId) getFilingType
(String courtLocationId, String categoryCode, String typeCode, boolean initial) getFilingTypeWith
(String courtLocationId, String filingCode) getFullLocationInfo
(String courtId) getLanguageNames
(String courtLocationId) getLanguages
(String courtLocationId) getMotionTypes
(String courtLocationId, String filingCodeId) getNameSuffixes
(String courtLocationId) getOptionalServices
(String courtId, String filingCode) getOptionalServicesByCode
(String courtId, String optServCode) getParentList
(String courtId) Gets the full line of succession for a given court, so given "cook:dv6", this would return ["cook:dv6", "cook:dv", "cook", "1", "0"]getPartyTypeByCode
(String courtLocationId, String partyTypeCode) getPartyTypeFor
(String courtLocationId, String caseTypeCode) Gets the party types that are allowed for a given court and case type.getProcedureOrRemedy
(String courtLocationId, String caseCategory) getServiceTypes
(String courtLocationId) getStateCodes
(String courtId, String country) Returns map of court locations to the list of tables they need to update.static String
likeWildcard
(String searchTerm) In most cases, we want to find all instances of the search term, not the exact term.retrieveCaseCategoryByName
(String categoryName) Get the code and court locations of the case categories that match the given name exactly.retrieveCaseTypeByName
(String caseTypeName) Get the code and court locations of the case types that match the given name exactly.retrieveFilingTypeByName
(String caseTypeName) Get the code and court locations of the filing types that match the given name exactly.retrieveOptionalServices
(String optServName) retrievePartyType
(String partyTypeName) 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.searchFilingType
(String searchTerm) Gets all distinct filing type names that have the search term in them.searchOptionalServices
(String searchTerm) searchPartyType
(String searchTerm) Gets all distinct filing type names that have the search term in them.singleInsert
(PreparedStatement stmt, String tableName, String courtName, Map<String, String> rowsVals) void
updateTable
(String tableName, String courtName, InputStream inStream) void
updateTable
(String tableName, String courtName, CodeListDocument doc) void
updateTableInner
(String tableName, String courtName, CodeListDocument doc) void
Methods inherited from class edu.suffolk.litlab.efspserver.ecfcodes.CodeDatabaseAPI
updateTable
Methods inherited from class edu.suffolk.litlab.efspserver.db.Database
close, commit, rollback, setAutoCommit, setSavepoint
-
Constructor Details
-
CodeDatabase
-
-
Method Details
-
fromDS
-
createTablesIfAbsent
- Specified by:
createTablesIfAbsent
in classDatabase
- Throws:
SQLException
-
getDomain
Description copied from class:CodeDatabaseAPI
The domain (the juristiction + environment, e.g. illinois-stage) that this database is working over.- Specified by:
getDomain
in classCodeDatabaseAPI
-
createTableIfAbsent
- Specified by:
createTableIfAbsent
in classCodeDatabaseAPI
- Throws:
SQLException
-
createIndicesIfAbsent
- Throws:
SQLException
-
updateTable
public void updateTable(String tableName, String courtName, InputStream inStream) throws jakarta.xml.bind.JAXBException, SQLException, XMLStreamException - Specified by:
updateTable
in classCodeDatabaseAPI
- Throws:
jakarta.xml.bind.JAXBException
SQLException
XMLStreamException
-
updateTable
public void updateTable(String tableName, String courtName, CodeListDocument doc) throws SQLException - Specified by:
updateTable
in classCodeDatabaseAPI
- Throws:
SQLException
-
updateTableInner
public void updateTableInner(String tableName, String courtName, CodeListDocument doc) throws SQLException - Throws:
SQLException
-
singleInsert
public PreparedStatement singleInsert(PreparedStatement stmt, String tableName, String courtName, Map<String, String> rowsVals) throws SQLException- Throws:
SQLException
-
likeWildcard
In most cases, we want to find all instances of the search term, not the exact term. It's a LIKE compare, so add the 0 or more characters on either side.- Parameters:
searchTerm
-- Returns:
-
searchCaseCategory
Gets all distinct case category names that have the search term in them.- Parameters:
searchTerm
-- Returns:
-
retrieveCaseCategoryByName
Get the code and court locations of the case categories that match the given name exactly.- Parameters:
categoryName
-- Returns:
-
getCaseCategoriesFor
-
getFilableCaseCategories
public List<CaseCategory> getFilableCaseCategories(String courtLocationId, Optional<Boolean> initial) -
getCaseCategoryWithCode
-
searchCaseType
Gets all distinct case type names that have the search term in them.- Parameters:
searchTerm
-- Returns:
-
retrieveCaseTypeByName
Get the code and court locations of the case types that match the given name exactly.- Parameters:
caseTypeName
-- Returns:
-
getCaseTypesFor
-
getCaseTypeWith
-
getCaseSubtypesFor
-
getDataField
-
getDataFieldNames
-
getDataFields
gets all data fields if dataNames is empty, otherwise just those that match the code. -
getProcedureOrRemedy
-
searchFilingType
Gets all distinct filing type names that have the search term in them.- Parameters:
searchTerm
-- Returns:
-
retrieveFilingTypeByName
Get the code and court locations of the filing types that match the given name exactly.- Parameters:
caseTypeName
-- Returns:
-
getFilingType
public List<FilingCode> getFilingType(String courtLocationId, String categoryCode, String typeCode, boolean initial) -
getFilingTypeWith
-
vacuumAll
public void vacuumAll()- Specified by:
vacuumAll
in classCodeDatabaseAPI
-
getDamageAmount
-
searchPartyType
Gets all distinct filing type names that have the search term in them.- Parameters:
searchTerm
-- Returns:
-
retrievePartyType
-
getPartyTypeFor
Gets the party types that are allowed for a given court and case type.- Parameters:
courtLocationId
-caseTypeCode
- Nullable, if null, gets all party types for court, otherwise, just for that case type.- Returns:
- a list of party types
-
getPartyTypeByCode
-
getCrossReference
-
getServiceTypes
-
getDocumentTypes
-
getMotionTypes
-
getNameSuffixes
-
getFilingComponents
-
getStateCodes
-
getAllowedFileTypes
-
getFilerTypes
-
getFilingStatuses
-
searchOptionalServices
-
retrieveOptionalServices
-
getOptionalServicesByCode
-
getOptionalServices
-
getLanguageNames
-
getLanguages
-
getVersionsToUpdate
Returns map of court locations to the list of tables they need to update.- Specified by:
getVersionsToUpdate
in classCodeDatabaseAPI
- Throws:
SQLException
-
deleteFromTable
- Specified by:
deleteFromTable
in classCodeDatabaseAPI
- Throws:
SQLException
-
deleteFromTable
- Specified by:
deleteFromTable
in classCodeDatabaseAPI
- Throws:
SQLException
-
getAllLocations
Gets all court location identifiers (CLI) stored in the database. updateTable should have been called on the `location` table before this works.- Specified by:
getAllLocations
in classCodeDatabaseAPI
- Returns:
- a list of all valid CLIs for this jurisdiction
-
getLocationNames
-
getFileableLocations
-
getFileableLocationNames
-
getFullLocationInfo
-
getParentList
Gets the full line of succession for a given court, so given "cook:dv6", this would return ["cook:dv6", "cook:dv", "cook", "1", "0"] -
getDisclaimerRequirements
-