Class S3EventSerializer<T>

  • All Implemented Interfaces:
    OrgJsonSerializer<T>, PojoSerializer<T>

    public class S3EventSerializer<T>
    extends Object
    implements OrgJsonSerializer<T>
    Serializer for S3 event NOTE: Because the s3 event class provided by the SDK does not play well with Jackson through a class laoder, this class uses the low level org json library to serialize and deserialize the event. If new events are added that do not work well with Jackson or GSON, this is the fallback method that will always work but is more verbose.
    • Constructor Detail

      • S3EventSerializer

        public S3EventSerializer()
    • Method Detail

      • withClass

        public S3EventSerializer<T> withClass​(Class<T> eventClass)
        Construct s3Event Serialize from specific s3 event class from user
        Specified by:
        withClass in interface OrgJsonSerializer<T>
        Parameters:
        eventClass - s3 event class
        Returns:
        OrgJsonSerializer with event type
      • withClassLoader

        public S3EventSerializer<T> withClassLoader​(ClassLoader classLoader)
        Sets the ClassLoader that will be used to load S3 event classes
        Specified by:
        withClassLoader in interface OrgJsonSerializer<T>
        Parameters:
        classLoader - - ClassLoader that S3 event classes will be loaded from
        Returns:
        OrgJsonSerializer with the supplied classLoader
      • toJson

        public void toJson​(T value,
                           OutputStream output)
        serialize an S3 event object to the output stream
        Specified by:
        toJson in interface OrgJsonSerializer<T>
        Specified by:
        toJson in interface PojoSerializer<T>
        Parameters:
        value - S3 event object
        output - OutputStream serializing to