Class CloudEventsProtocolAdaptor<T extends org.apache.eventmesh.common.protocol.ProtocolTransportObject>

  • All Implemented Interfaces:
    org.apache.eventmesh.protocol.api.ProtocolAdaptor<org.apache.eventmesh.common.protocol.ProtocolTransportObject>

    public class CloudEventsProtocolAdaptor<T extends org.apache.eventmesh.common.protocol.ProtocolTransportObject>
    extends java.lang.Object
    implements org.apache.eventmesh.protocol.api.ProtocolAdaptor<org.apache.eventmesh.common.protocol.ProtocolTransportObject>
    CloudEvents protocol adaptor, used to transform CloudEvents message to CloudEvents message.
    Since:
    1.3.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.eventmesh.common.protocol.ProtocolTransportObject fromCloudEvent​(io.cloudevents.CloudEvent cloudEvent)  
      java.lang.String getProtocolType()  
      java.util.List<io.cloudevents.CloudEvent> toBatchCloudEvent​(org.apache.eventmesh.common.protocol.ProtocolTransportObject protocol)  
      io.cloudevents.CloudEvent toCloudEvent​(org.apache.eventmesh.common.protocol.ProtocolTransportObject cloudEvent)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CloudEventsProtocolAdaptor

        public CloudEventsProtocolAdaptor()
    • Method Detail

      • toCloudEvent

        public io.cloudevents.CloudEvent toCloudEvent​(org.apache.eventmesh.common.protocol.ProtocolTransportObject cloudEvent)
                                               throws org.apache.eventmesh.protocol.api.exception.ProtocolHandleException
        Specified by:
        toCloudEvent in interface org.apache.eventmesh.protocol.api.ProtocolAdaptor<T extends org.apache.eventmesh.common.protocol.ProtocolTransportObject>
        Throws:
        org.apache.eventmesh.protocol.api.exception.ProtocolHandleException
      • toBatchCloudEvent

        public java.util.List<io.cloudevents.CloudEvent> toBatchCloudEvent​(org.apache.eventmesh.common.protocol.ProtocolTransportObject protocol)
                                                                    throws org.apache.eventmesh.protocol.api.exception.ProtocolHandleException
        Specified by:
        toBatchCloudEvent in interface org.apache.eventmesh.protocol.api.ProtocolAdaptor<T extends org.apache.eventmesh.common.protocol.ProtocolTransportObject>
        Throws:
        org.apache.eventmesh.protocol.api.exception.ProtocolHandleException
      • fromCloudEvent

        public org.apache.eventmesh.common.protocol.ProtocolTransportObject fromCloudEvent​(io.cloudevents.CloudEvent cloudEvent)
                                                                                    throws org.apache.eventmesh.protocol.api.exception.ProtocolHandleException
        Specified by:
        fromCloudEvent in interface org.apache.eventmesh.protocol.api.ProtocolAdaptor<T extends org.apache.eventmesh.common.protocol.ProtocolTransportObject>
        Throws:
        org.apache.eventmesh.protocol.api.exception.ProtocolHandleException
      • getProtocolType

        public java.lang.String getProtocolType()
        Specified by:
        getProtocolType in interface org.apache.eventmesh.protocol.api.ProtocolAdaptor<T extends org.apache.eventmesh.common.protocol.ProtocolTransportObject>