Class CodeUpdater
There are 3 main steps to download a code for a Tyler court: 1. calling `FilingReview::getPolicy` for a court to get the URLs that the codes are available at. - this URL can change, but tbh doesn't change often. It takes approximately 1 for a call to getPolicy to complete. 2. downloading the codes, which are zip files available at the above URL. - You need the court itself, the table that you are downloading. Currently, we take the input stream and divert it directly to the XMLStream reader, so we don't need to write out to a file. 3. updating the Postgres codes database - this takes the XMLStreamReader, unmarshalls it into a java object, and uses that to populate the code database. Most code for that is in tyler.CodeDatabase.
We parallelize this as much as possible, which means steps 1 and 2 are done in batch, and each court / court-table item is done in parallel. Step 3, however, can't seem to be parallelized, due to java issues. See https://github.com/SuffolkLITLab/EfileProxyServer/issues/111
For TX, IL, and MA, it takes ~45 minutes to refresh all of the codes.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandownloadIndiv(List<String> args, BiFunction<String, String, String> makeUrl, CodeUrlGetter urlGetter) Downloads a single codes zip.static CodeDatabaseAPImakeCodeDatabase(Function<DataSource, CodeDatabaseAPI> dbMaker) Should just be called from main.booleanreplaceAll(Map<String, String> systemUrls, Function<String, List<CodeUpdater.CourtCodelistInfo>> codeInfoGetter, CodeUrlGetter urlGetter, CodeDatabaseAPI cd) Downloads all of the codes from scratch, deleting all of the existing info already in tables.booleanreplaceSome(Map<String, String> systemUrls, Function<String, List<CodeUpdater.CourtCodelistInfo>> codeInfoGetter, CodeUrlGetter urlGetter, CodeDatabaseAPI cd, List<String> locs) booleanupdateAll(Map<String, String> systemUrls, Function<String, List<CodeUpdater.CourtCodelistInfo>> codeInfoGetter, CodeUrlGetter urlGetter, CodeDatabaseAPI cd) Returns true if successful, false if not successful
-
Constructor Details
-
CodeUpdater
public CodeUpdater()
-
-
Method Details
-
updateAll
public boolean updateAll(Map<String, String> systemUrls, Function<String, throws SQLException, IOException, jakarta.xml.bind.JAXBException, URISyntaxExceptionList<CodeUpdater.CourtCodelistInfo>> codeInfoGetter, CodeUrlGetter urlGetter, CodeDatabaseAPI cd) Returns true if successful, false if not successful- Throws:
URISyntaxExceptionSQLExceptionIOExceptionjakarta.xml.bind.JAXBException
-
replaceAll
public boolean replaceAll(Map<String, String> systemUrls, Function<String, throws SQLException, IOException, jakarta.xml.bind.JAXBException, URISyntaxExceptionList<CodeUpdater.CourtCodelistInfo>> codeInfoGetter, CodeUrlGetter urlGetter, CodeDatabaseAPI cd) Downloads all of the codes from scratch, deleting all of the existing info already in tables.- Throws:
URISyntaxExceptionSQLExceptionIOExceptionjakarta.xml.bind.JAXBException
-
replaceSome
public boolean replaceSome(Map<String, String> systemUrls, Function<String, throws SQLException, IOException, jakarta.xml.bind.JAXBException, URISyntaxExceptionList<CodeUpdater.CourtCodelistInfo>> codeInfoGetter, CodeUrlGetter urlGetter, CodeDatabaseAPI cd, List<String> locs) - Throws:
SQLExceptionIOExceptionjakarta.xml.bind.JAXBExceptionURISyntaxException
-
downloadIndiv
public boolean downloadIndiv(List<String> args, BiFunction<String, String, throws URISyntaxExceptionString> makeUrl, CodeUrlGetter urlGetter) Downloads a single codes zip. For Debugging.- Throws:
URISyntaxException
-
makeCodeDatabase
Should just be called from main.
-