Skip to content

Commit 77d330b

Browse files
committed
Add mock wsdls to more files, watchify docker-compose
1 parent 4f3841b commit 77d330b

File tree

7 files changed

+644141
-9
lines changed

7 files changed

+644141
-9
lines changed

docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@ services:
22
efspjava:
33
build:
44
context: .
5+
# Automatically rebuild server on file changes. Use
6+
# `docker compose up --watch`. With some files, you still need to stop and
7+
# `build` again (e.g. client_sign.properties)
8+
develop:
9+
watch:
10+
- action: sync
11+
path: ./src
12+
target: /usr/src/app/src
13+
- action: rebuild
14+
path: ./src
515
# Necessary b/c docassemble is external to the docker network
616
ports:
717
- target: 9009

src/main/java/edu/suffolk/litlab/efspserver/ecf4/SoapClientChooser.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ public class SoapClientChooser {
2727
"massachusetts-prod", "wsdl/prod/massachusetts-ECF-4.0-ServiceMDEService.wsdl",
2828
"california-stage", "wsdl/stage/california-ECF-4.0-ServiceMDEService.wsdl",
2929
"texas-stage", "wsdl/stage/texas-ECF-4.0-ServiceMDEService.wsdl",
30-
"indiana-stage", "wsdl/stage/indiana-ECF-4.0-ServiceMDEService.wsdl");
30+
"indiana-stage", "wsdl/stage/indiana-ECF-4.0-ServiceMDEService.wsdl",
31+
"mock-test", "wsdl/test/mock-ECF-4.0-ServiceMDEService.wsdl");
3132

3233
static final Map<String, String> filingReviewMDEWsdls =
3334
Map.of(
@@ -38,7 +39,8 @@ public class SoapClientChooser {
3839
"massachusetts-prod", "wsdl/prod/massachusetts-ECF-4.0-FilingReviewMDEService.wsdl",
3940
"california-stage", "wsdl/stage/california-ECF-4.0-FilingReviewMDEService.wsdl",
4041
"texas-stage", "wsdl/stage/texas-ECF-4.0-FilingReviewMDEService.wsdl",
41-
"indiana-stage", "wsdl/stage/indiana-ECF-4.0-FilingReviewMDEService.wsdl");
42+
"indiana-stage", "wsdl/stage/indiana-ECF-4.0-FilingReviewMDEService.wsdl",
43+
"mock-test", "wsdl/test/mock-ECF-4.0-FilingReviewMDEService.wsdl");
4244

4345
static final Map<String, String> courtRecordMDEWsdls =
4446
Map.of(
@@ -49,13 +51,15 @@ public class SoapClientChooser {
4951
"massachusetts-prod", "wsdl/prod/massachusetts-ECF-4.0-CourtRecordMDEService.wsdl",
5052
"california-stage", "wsdl/stage/california-ECF-4.0-CourtRecordMDEService.wsdl",
5153
"texas-stage", "wsdl/stage/texas-ECF-4.0-CourtRecordMDEService.wsdl",
52-
"indiana-stage", "wsdl/stage/indiana-ECF-4.0-CourtRecordMDEService.wsdl");
54+
"indiana-stage", "wsdl/stage/indiana-ECF-4.0-CourtRecordMDEService.wsdl",
55+
"mock-test", "wsdl/test/mock-ECF-4.0-CourtRecordMDEService.wsdl");
5356

5457
static final Map<String, String> courtSchedulingMDEWsdls =
5558
Map.of(
5659
"illinois-stage", "wsdl/stage/illinois-v5-CourtSchedulingMDE.wsdl",
5760
"illinois-test", "wsdl/test/illinois-v5-CourtSchedulingMDE.wsdl",
58-
"illinois-prod", "wsdl/prod/illinois-v5-CourtSchedulingMDE.wsdl");
61+
"illinois-prod", "wsdl/prod/illinois-v5-CourtSchedulingMDE.wsdl",
62+
"mock-test", "wsdl/test/mock-v5-CourtSchedulingMDE.wsdl");
5963

6064
public static Optional<FilingReviewMDEService> getFilingReviewFactory(String wsdlDomain) {
6165
Optional<URL> url = urlFromString(wsdlDomain, filingReviewMDEWsdls);
@@ -104,7 +108,7 @@ private static Optional<URL> urlFromString(String wsdlDomain, Map<String, String
104108
String wsdlPath = domainToWsdl.get(wsdlDomain);
105109
URL url = SoapClientChooser.class.getClassLoader().getResource(wsdlPath);
106110
if (url == null) {
107-
log.info("Can not initialize the default wsdl from {}", "classpath:" + wsdlPath);
111+
log.info("Can not initialize the default wsdl from {}", "classpath: " + wsdlPath);
108112
return Optional.empty();
109113
}
110114

src/main/java/edu/suffolk/litlab/efspserver/services/EndpointReflection.java

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,39 +24,63 @@
2424
import java.util.stream.Collectors;
2525
import java.util.stream.Stream;
2626

27+
import org.slf4j.Logger;
28+
import org.slf4j.LoggerFactory;
29+
2730
/** Most of this class taken from the below blog post: https://dalelane.co.uk/blog/?p=1871 */
2831
public class EndpointReflection {
32+
private static Logger log = LoggerFactory.getLogger(EndpointReflection.class);
2933

3034
private final String baseUrl;
3135

3236
public EndpointReflection(String startUrl) {
3337
baseUrl = ServiceHelpers.EXTERNAL_URL + startUrl;
38+
log.info("baseUrl: " + baseUrl);
3439
}
3540

3641
/** Returns REST endpoints defined in Java classes in the specified package. */
3742
@SuppressWarnings("rawtypes")
3843
public List<Endpoint> findRESTEndpoints(List<Class> classes) {
3944
var endpoints = new HashSet<Endpoint>();
40-
45+
// log.info("1");
4146
Deque<Class> classQueue = new ArrayDeque<>();
4247
classQueue.addAll(classes);
48+
// log.info("2");
4349
while (!classQueue.isEmpty()) {
50+
// log.info("3");
4451
Class<?> clazz = classQueue.pop();
4552
if (clazz == null) {
53+
// log.info("4");
4654
continue;
4755
}
56+
// log.info("5");
4857
classQueue.addAll(List.of(clazz.getInterfaces()));
58+
// log.info("6");
4959
if (clazz.getSuperclass() != null) {
60+
// log.info("7");
5061
classQueue.add(clazz.getSuperclass());
5162
}
63+
// log.info("8");
5264
Path annotation = clazz.getAnnotation(Path.class);
65+
// log.info("9");
5366
String basePath = "/";
5467
if (annotation != null) {
68+
// log.info("10");
5569
basePath = getRESTEndpointPath(clazz);
70+
// log.info("findRESTEndpoints, basePath: " + basePath);
5671
}
72+
// log.info("11");
5773
Method[] methods = clazz.getMethods();
74+
// log.info("12");
5875
endpoints.addAll(makeRestEndpoints(methods, clazz, basePath));
76+
log.info(endpoints.toString());
5977
}
78+
// StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
79+
// System.out.println("Stack trace:");
80+
// for (StackTraceElement element : stackTrace) {
81+
// log.info(element.toString());
82+
// }
83+
// log.info("13");
6084
return endpoints.stream().toList();
6185
}
6286

@@ -92,7 +116,11 @@ public Map<String, String> getClassPaths(List<Class> classes) {
92116
Map<String, String> toDisplay = new HashMap<>();
93117
for (Class<?> clazz : classes) {
94118
Path annotation = clazz.getAnnotation(Path.class);
95-
toDisplay.put(clazz.getSimpleName(), baseUrl + annotation.value());
119+
if (annotation != null) {
120+
toDisplay.put(clazz.getSimpleName(), baseUrl + annotation.value());
121+
} else {
122+
log.warn("No @Path annotation found on {}, was expected", clazz.getSimpleName());
123+
}
96124
}
97125
return toDisplay;
98126
}
@@ -246,6 +274,11 @@ public static class Endpoint {
246274

247275
@Override
248276
public String toString() {
277+
// StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
278+
// System.out.println("Stack trace:");
279+
// for (StackTraceElement element : stackTrace) {
280+
// log.info(element.toString());
281+
// }
249282
return method + " " + uri + ", triggering " + javaMethodName;
250283
}
251284
}

src/main/java/edu/suffolk/litlab/efspserver/tyler/TylerUrls.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class TylerUrls {
3333
"california-stage", "wsdl/stage/california-EFMFirmServiceSingle.svc.wsdl",
3434
"texas-stage", "wsdl/stage/texas-EFMFirmServiceSingle.svc.wsdl",
3535
"indiana-stage", "wsdl/stage/indiana-EFMFirmServiceSingle.svc.wsdl",
36-
"mock-test", "wsdl/test/mock-EFMUserServiceSingle.svc.wsdl");
36+
"mock-test", "wsdl/test/mock-EFMFirmServiceSingle.svc.wsdl");
3737

3838
/**
3939
* Gets the EfmUserService if the provided domain is present and correct.

src/main/resources/taxonomy.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"IM-07-00-00-00","Sponsoring an immigrant","This category is about options for an individual, a company, or other groups to sponsor an immigrant to the United States, so that they are able to get legal status. This includes both the categories and the process of being a sponsor. It also includes obligations and rules that sponsors must follow.","IM-00-00-00-00",,
133133
"RI-02-00-00-00","Right to a free lawyer","This category covers a person's possible right to counsel (or a lawyer) that they might have for a specific type of legal matter -- like for a criminal charge, an eviction, or other issue.","RI-00-00-00-00, CO-09-01-00-00, CR-04-00-00-00",,"NSMI v1 Taxonomy [1850800], NSMI v1 Taxonomy [2041300]"
134134
"IM-05-00-00-00","Political asylum","This category covers options for an immigrant to apply for political asylum in the United States, including the procedure they must follow, what types of situations are covered, what kind of status are possible as an outcome, and consequences for one's family or a future ability to travel.","IM-00-00-00-00, IM-04-02-00-00, IM-09-00-00-00",,"NSMI v1 Taxonomy [1810900]"
135-
"RI-05-00-00-00","First Amendment Rights","This category covers what rights a person has under the First Amendment of the US Constitution, like to freedom of speech, freedom of religion, freedom of the press, right to assemble, and right to pettion. These rights may arise when a person think that the government is trying to interfere with their religious practices, their speaking or publishing infomration, their assembly or protests, or petitioning the government.","RI-00-00-00-00",,"NSMI v1 Taxonomy [1850400], NSMI v1 Taxonomy [1850499]"
135+
"RI-05-00-00-00","First Amendment Rights","This category covers what rights a person has under the First Amendment of the US Constitution, like to freedom of speech, freedom of religion, freedom of the press, right to assemble, and right to petition. These rights may arise when a person think that the government is trying to interfere with their religious practices, their speaking or publishing infomration, their assembly or protests, or petitioning the government.","RI-00-00-00-00",,"NSMI v1 Taxonomy [1850400], NSMI v1 Taxonomy [1850499]"
136136
"RI-16-00-00-00","Human Trafficking rights and protections","This category covers the rights of people who have been through human trafficking. This includes protection from prosecution and options for visas or immigration statuses.","IM-00-00-00-00, RI-00-00-00-00, CR-01-00-00-00",,"NSMI v1 Taxonomy [1860000], NSMI v1 Taxonomy [1860099], Legal Server Index Taxonomy [LS002-00086], Legal Services Corporation Taxonomy [86]"
137137
"RI-06-00-00-00","LGBTQ Rights","This category covers what protections and rights that members of the LGBTQ (lesbian, gay, bisexual, and transgender) community may have, based on their sexual orientation and gender identity. This includes protections for same-sex marriage, discrimination, and hate crimes.","RI-00-00-00-00",,"NSMI v1 Taxonomy [1851300]"
138138
"DI-01-00-00-00","Help for Farms after a Disaster","This category concerns issues and options that farmers have around a natural disaster or other emergency. This category covers assistance that might be available to them.","DI-00-00-00-00, BU-03-00-00-00",,"NSMI v1 Taxonomy [2110500]"

0 commit comments

Comments
 (0)