Class EventGridSubscriber


  • @Beta
    public class EventGridSubscriber
    extends Object
    The type that can be used to de-serialize eventgrid events.
    • Constructor Detail

      • EventGridSubscriber

        @Beta
        public EventGridSubscriber()
        Creates EventGridSubscriber with default de-serializer.
    • Method Detail

      • putCustomEventMapping

        @Beta
        public void putCustomEventMapping​(String eventType,
                                          Type eventDataType)
        Add a custom event mapping. If a mapping with same eventType exists then the old eventDataType is replaced by the specified eventDataType.
        Parameters:
        eventType - the event type name.
        eventDataType - type of the Java model that the event type name mapped to.
      • getCustomEventMapping

        @Beta
        public Type getCustomEventMapping​(String eventType)
        Get type of the Java model that is mapped to the given eventType.
        Parameters:
        eventType - the event type name.
        Returns:
        type of the Java model if mapping exists, null otherwise.
      • getAllCustomEventMappings

        @Beta
        public Set<Map.Entry<String,​Type>> getAllCustomEventMappings()
        Returns:
        get all registered custom event mappings.
      • removeCustomEventMapping

        @Beta
        public boolean removeCustomEventMapping​(String eventType)
        Removes the mapping with the given eventType.
        Parameters:
        eventType - the event type name.
        Returns:
        true if the mapping exists and removed, false if mapping does not exists.
      • containsCustomEventMappingFor

        @Beta
        public boolean containsCustomEventMappingFor​(String eventType)
        Checks if an event mapping with the given eventType exists.
        Parameters:
        eventType - the event type name.
        Returns:
        true if the mapping exists, false otherwise.
      • deserializeEventGridEvents

        @Beta
        public EventGridEvent[] deserializeEventGridEvents​(String requestContent)
                                                    throws IOException
        De-serialize the events in the given requested content using default de-serializer.
        Parameters:
        requestContent - the request content in string format.
        Returns:
        De-serialized events.
        Throws:
        IOException
      • deserializeEventGridEvents

        @Beta
        public EventGridEvent[] deserializeEventGridEvents​(String requestContent,
                                                           com.microsoft.rest.protocol.SerializerAdapter<com.fasterxml.jackson.databind.ObjectMapper> serializerAdapter)
                                                    throws IOException
        De-serialize the events in the given requested content using the provided de-serializer.
        Parameters:
        requestContent - the request content as string.
        serializerAdapter - the de-serializer.
        Returns:
        de-serialized events.
        Throws:
        IOException