Class CodeUpdater
There are 3 main steps to download a code for a Tyler court: 1. calling `getPolicy` (see
FilingReviewMDEPort
) 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 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.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
downloadIndiv
(List<String> args, String jurisdiction, String env) Downloads a single codes zip.static boolean
executeCommand
(CodeDatabase cd, String jurisdiction, String env, List<String> args, String x509Password) static InputStream
getCodesZip
(String toRead, String authHeader) Either downloads the codes file from Tyler, or opens an already downloaded local zip file.static void
Run with:boolean
replaceAll
(String baseUrl, FilingReviewMDEPort filingPort, CodeDatabase cd) Downloads all of the codes from scratch, deleting all of the existing info already in tables.boolean
replaceSome
(String baseUrl, FilingReviewMDEPort filingPort, CodeDatabase cd, List<String> locs) boolean
updateAll
(String baseUrl, FilingReviewMDEPort filingPort, CodeDatabase cd) Returns true if successful, false if not successful
-
Field Details
-
ecf4ElemToTableName
-
-
Constructor Details
-
CodeUpdater
-
-
Method Details
-
getCodesZip
Either downloads the codes file from Tyler, or opens an already downloaded local zip file.Code for HttpConnection: https://stackoverflow.com/a/1485730/11416267
- Returns:
- InputStream
- Throws:
IOException
-
updateAll
public boolean updateAll(String baseUrl, FilingReviewMDEPort filingPort, CodeDatabase cd) throws SQLException, IOException, jakarta.xml.bind.JAXBException Returns true if successful, false if not successful- Throws:
SQLException
IOException
jakarta.xml.bind.JAXBException
-
replaceAll
public boolean replaceAll(String baseUrl, FilingReviewMDEPort filingPort, CodeDatabase cd) throws SQLException, IOException, jakarta.xml.bind.JAXBException Downloads all of the codes from scratch, deleting all of the existing info already in tables.- Throws:
SQLException
IOException
jakarta.xml.bind.JAXBException
-
replaceSome
public boolean replaceSome(String baseUrl, FilingReviewMDEPort filingPort, CodeDatabase cd, List<String> locs) throws SQLException, IOException, jakarta.xml.bind.JAXBException - Throws:
SQLException
IOException
jakarta.xml.bind.JAXBException
-
downloadIndiv
Downloads a single codes zip. For Debugging. -
executeCommand
-
main
Run with:java -cp efspserver-with-deps.jar edu.suffolk.litlab.efspserver.ecfcodes.CodeUpdater refresh
TODO(#111): use with this System property and class to try to fix parallel unmarshalling -Djava.util.concurrent.ForkJoinPool.common.threadFactory=edu.suffolk.litlab.efspserver.JAXBForkJoinWorkerThreadFactory \ https://stackoverflow.com/a/57551188/11416267
- Throws:
Exception
-