소스 검색

Extracted interface to enable proxy-style CXF REST

peter_backlund 16 년 전
부모
커밋
7abb258358

+ 9
- 0
dddsample/external/reporting-api/src/main/java/se/citerus/dddsample/reporting/api/ReportSubmission.java 파일 보기

@@ -0,0 +1,9 @@
1
+package se.citerus.dddsample.reporting.api;
2
+
3
+public interface ReportSubmission {
4
+
5
+  void reportCargo(CargoDetails cargoDetails);
6
+
7
+  void reportHandling(String trackingId, Handling handling);
8
+
9
+}

+ 4
- 1
dddsample/external/reporting/src/main/java/com/reporting/ReportingService.java 파일 보기

@@ -8,6 +8,7 @@ import org.apache.commons.logging.LogFactory;
8 8
 import org.springframework.transaction.annotation.Transactional;
9 9
 import se.citerus.dddsample.reporting.api.CargoDetails;
10 10
 import se.citerus.dddsample.reporting.api.Handling;
11
+import se.citerus.dddsample.reporting.api.ReportSubmission;
11 12
 
12 13
 import javax.ws.rs.*;
13 14
 import javax.ws.rs.core.Response;
@@ -20,7 +21,7 @@ import static javax.ws.rs.core.Response.status;
20 21
 @Produces({"application/json", "application/pdf"})
21 22
 @Consumes({"application/json", "application/xml"})
22 23
 @Path("/")
23
-public class ReportingService {
24
+public class ReportingService implements ReportSubmission {
24 25
 
25 26
   private ReportDAO reportDAO;
26 27
   private static final Log LOG = LogFactory.getLog(ReportingService.class);
@@ -53,6 +54,7 @@ public class ReportingService {
53 54
       build();
54 55
   }
55 56
 
57
+  @Override
56 58
   @PUT
57 59
   @Path("/cargo")
58 60
   @Transactional
@@ -61,6 +63,7 @@ public class ReportingService {
61 63
     LOG.info("Stored cargo: " + cargoDetails);
62 64
   }
63 65
 
66
+  @Override
64 67
   @POST
65 68
   @Path("/cargo/{trackingId}/handled")
66 69
   @Transactional