com.tibco.be.custom.channel

## Class BaseEventSerializer

- java.lang.Object
- - com.tibco.be.custom.channel.BaseEventSerializer

-     public abstract class BaseEventSerializer
      extends java.lang.Object

  Handles serialization/de-serialization of BE events to/from a transport.

  Each BE channel type has its own implementation of `BaseEventSerializer`, which is used by the channel's destinations to transform outgoing events into messages and incoming messages into events.

  Since:
    5.4
  See Also:
    `BaseChannel`, `BaseDestination`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract Event` | `deserializeUserEvent(java.lang.Object message, java.util.Map properties)` Transforms a message received by the Destination of the given context into an `Event`
    `abstract void` | `initUserEventSerializer(java.lang.String destinationName, java.util.Properties destinationProperties, Logger logger)` Initializes the serializer.It is called at the time of engine startup
    `abstract java.lang.Object` | `serializeUserEvent(EventWithId event, java.util.Map properties)` Transforms an `Event` into a message that can be sent by the Destination of that context.

- - ### Method Detail

    - #### initUserEventSerializer

          public abstract void initUserEventSerializer(java.lang.String destinationName,
                                                       java.util.Properties destinationProperties,
                                                       Logger logger)

      Initializes the serializer.It is called at the time of engine startup
      Parameters:
        `destinationName` - name of the destination
        `destinationProperties` - the properties of the destination
        `logger` - the logger instance
      Since:
        5.4

    - #### deserializeUserEvent

          public abstract Event deserializeUserEvent(java.lang.Object message,
                                                     java.util.Map properties)

      Transforms a message received by the Destination of the given context into an `Event`
      Parameters:
        `message` - an Object representing an incoming message in the Destination's transport.
        `properties` - de-serialization properties
      Returns:
        the `Event` that represents the incoming message
      Throws:
        `java.lang.Exception` - if an `Event` could not be created.
      Since:
        5.4

    - #### serializeUserEvent

          public abstract java.lang.Object serializeUserEvent(EventWithId event,
                                                              java.util.Map properties)

      Transforms an `Event` into a message that can be sent by the Destination of that context.
      Parameters:
        `event` - an `Event`
        `properties` - serialization properties
      Returns:
        the message Object to be sent on the underlying transport of the Destination.
      Throws:
        `java.lang.Exception` - if the message Object could not be created.
      Since:
        5.4