com.github.awsjavakit.eventbridge.handlers.DestinationsEventBridgeEventHandler Maven / Gradle / Ivy
package com.github.awsjavakit.eventbridge.handlers;
import com.amazonaws.services.lambda.runtime.Context;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.awsjavakit.eventbridge.models.AwsEventBridgeDetail;
import com.github.awsjavakit.eventbridge.models.AwsEventBridgeEvent;
public abstract class DestinationsEventBridgeEventHandler
extends EventHandler, O> {
private final Class iclass;
protected DestinationsEventBridgeEventHandler(Class iclass, ObjectMapper objectMapper) {
super(AwsEventBridgeDetail.class, objectMapper);
this.iclass = iclass;
}
@Override
protected final O processInput(AwsEventBridgeDetail input,
AwsEventBridgeEvent> event,
Context context) {
return processInputPayload(input.getResponsePayload(), event, context);
}
@SuppressWarnings("unchecked")
@Override
protected AwsEventBridgeEvent> parseEvent(String input) {
return new EventParser>(input, objectMapper)
.parse(AwsEventBridgeDetail.class, iclass);
}
protected abstract O processInputPayload(I input,
AwsEventBridgeEvent> event,
Context context);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy