Class B2EventNotification
- java.lang.Object
-
- com.backblaze.b2.client.structures.B2EventNotification
-
public class B2EventNotification extends java.lang.Object
The notification that Backblaze sends when object events occur.
-
-
Constructor Summary
Constructors Constructor Description B2EventNotification(java.util.List<B2EventNotificationEvent> events)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.util.List<B2EventNotificationEvent>
getEvents()
A list of object events.int
hashCode()
static B2EventNotification
parse(byte[] json)
Create a new EventNotification from JSON content with signature check.static B2EventNotification
parse(byte[] json, java.lang.String signatureFromHeader, java.lang.String signingSecret)
Create a new EventNotification from JSON content with signature check.static B2EventNotification
parse(java.lang.String json)
Create a new EventNotification from JSON content with signature check.static B2EventNotification
parse(java.lang.String json, java.lang.String signatureFromHeader, java.lang.String signingSecret)
Create a new EventNotification from JSON content with signature check.java.lang.String
toString()
-
-
-
Constructor Detail
-
B2EventNotification
public B2EventNotification(java.util.List<B2EventNotificationEvent> events)
-
-
Method Detail
-
getEvents
public java.util.List<B2EventNotificationEvent> getEvents()
A list of object events.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.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 JSONjava.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 encodedsignatureFromHeader
- - The value of the X-Bz-Event-Notification-Signature headersigningSecret
- - The secret for computing the signature.- Returns:
- The B2EventNotification object
- Throws:
B2JsonException
- - If the content is not valid JSONB2SignatureVerificationException
- - 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 headersigningSecret
- - The secret for computing the signature.- Returns:
- The B2EventNotification object
- Throws:
B2JsonException
- - If the content is not valid JSONB2SignatureVerificationException
- - if the content does not match the signature from header.
-
-