diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-07-09 10:32:54 +0200 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-07-09 10:32:54 +0200 |
commit | d8c668bbca31a835c387a3d52293c9938c424f58 (patch) | |
tree | 819c44930a05071e8f8645a1427f9485a79da664 /src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java | |
parent | c1a1a5130a4ecf755da72941ad3525beb919447f (diff) | |
download | moa-zs-d8c668bbca31a835c387a3d52293c9938c424f58.tar.gz moa-zs-d8c668bbca31a835c387a3d52293c9938c424f58.tar.bz2 moa-zs-d8c668bbca31a835c387a3d52293c9938c424f58.zip |
Refactor MsgResponse and its IDs
StoreSOAPBodyBinaryInRepositoryInterceptor:
- Replace "generate body's id via concatenation" with "give the right
generator function the app delivery id and let the generator
function do the work". Reason: Prevent the logistics of deriving IDs
to spill into unrelated components.
MsgResponse refactor:
- Make MsgResponse an abstract class.
- Derive ResponseID's ONLY in MsgResponse::createResponseID.
Others:
- Ensure that all invocations to DeliveryRepository.getResponse and
BinaryRepository.get use "responseID" instead of ambiguous "id" or
incorrect "appDeliveryID".
- Move SingleThreadedDeliveryPipeline into process package.
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java')
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java b/src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java index f465a28..7670ab7 100644 --- a/src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java +++ b/src/main/java/at/gv/egiz/moazs/scheme/NotificationResponse.java @@ -6,24 +6,18 @@ import at.gv.zustellung.msg.xsd.DeliveryNotificationType; import static at.gv.zustellung.msg.xsd.DeliveryNotificationType.deliveryNotificationTypeBuilder; -public class NotificationResponse implements MsgResponse<DeliveryNotificationType> { +public class NotificationResponse extends MsgResponse<DeliveryNotificationType> { private final DeliveryNotificationType notification; - private final String id; - private static final String ID_SUFFIX = ".NO"; + private final static String ID_SUFFIX = ".NO"; public NotificationResponse(DeliveryNotificationType notification) { + super.id = createResponseId(notification.getAppDeliveryID(), ID_SUFFIX); this.notification = notification; - this.id = getId(notification.getAppDeliveryID()); } - @Override - public String getResponseID() { - return this.id; - } - - public static String getId(String appDeliveryID) { - return appDeliveryID + ID_SUFFIX; + public static String getResponseID(String appDeliveryID) { + return createResponseId(appDeliveryID, ID_SUFFIX); } @Override @@ -60,8 +54,4 @@ public class NotificationResponse implements MsgResponse<DeliveryNotificationTyp return new NotificationResponse(notification); } - - public static String getIdSuffix() { - return ID_SUFFIX; - } } |