Class B2EventNotification
- java.lang.Object
-
- com.backblaze.b2.client.structures.B2EventNotification
-
public class B2EventNotification extends java.lang.ObjectThe 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 booleanequals(java.lang.Object o)java.util.List<B2EventNotificationEvent>getEvents()A list of object events.inthashCode()static B2EventNotificationparse(byte[] json)Create a new EventNotification from JSON content with signature check.static B2EventNotificationparse(byte[] json, java.lang.String signatureFromHeader, java.lang.String signingSecret)Create a new EventNotification from JSON content with signature check.static B2EventNotificationparse(java.lang.String json)Create a new EventNotification from JSON content with signature check.static B2EventNotificationparse(java.lang.String json, java.lang.String signatureFromHeader, java.lang.String signingSecret)Create a new EventNotification from JSON content with signature check.java.lang.StringtoString()
-
-
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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.
-
-