Class B2EventNotification


  • public class B2EventNotification
    extends java.lang.Object
    The notification that Backblaze sends when object events occur.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • parse

        public static B2EventNotification parse​(byte[] json)
                                         throws java.io.IOException,
                                                B2JsonException
        Create a new EventNotification from JSON content with signature check.
        Parameters:
        json - - The JSON content to create an B2EventNotification object from. The byte array should be UTF-8 encoded
        Returns:
        The B2EventNotification object
        Throws:
        B2JsonException - - If the content is not valid JSON
        java.io.IOException
      • parse

        public static B2EventNotification parse​(java.lang.String json)
                                         throws B2JsonException
        Create a new EventNotification from JSON content with signature check.
        Parameters:
        json - - The JSON content to create an B2EventNotification object from.
        Returns:
        The B2EventNotification object
        Throws:
        B2JsonException - - If the content is not valid JSON
      • parse

        public static B2EventNotification parse​(byte[] json,
                                                java.lang.String signatureFromHeader,
                                                java.lang.String signingSecret)
                                         throws B2JsonException,
                                                java.io.IOException,
                                                B2SignatureVerificationException
        Create a new EventNotification from JSON content with signature check.
        Parameters:
        json - - The JSON content to create an B2EventNotification object from. The byte array should be UTF-8 encoded
        signatureFromHeader - - The value of the X-Bz-Event-Notification-Signature header
        signingSecret - - The secret for computing the signature.
        Returns:
        The B2EventNotification object
        Throws:
        B2JsonException - - If the content is not valid JSON
        B2SignatureVerificationException - - if the content does not match the signature from header.
        java.io.IOException
      • parse

        public static B2EventNotification parse​(java.lang.String json,
                                                java.lang.String signatureFromHeader,
                                                java.lang.String signingSecret)
                                         throws B2JsonException,
                                                B2SignatureVerificationException
        Create a new EventNotification from JSON content with signature check.
        Parameters:
        json - - The JSON content to create an B2EventNotification object from.
        signatureFromHeader - - The value of the X-Bz-Event-Notification-Signature header
        signingSecret - - The secret for computing the signature.
        Returns:
        The B2EventNotification object
        Throws:
        B2JsonException - - If the content is not valid JSON
        B2SignatureVerificationException - - if the content does not match the signature from header.