public class Event extends AbstractResource
Modifier and Type | Field and Description |
---|---|
static String |
EVENT_HASH |
static String |
EVENT_KEY |
static String |
EVENT_MESSAGE |
static String |
EVENT_METADATA |
static String |
EVENT_TIME |
static String |
EVENT_TYPE |
static String |
HASH_ALGORITHM |
protected static char[] |
hexArray |
static String |
RELATED_SIGNATURE_ID |
static String |
REPORTED_FOR_ACCOUNT_ID |
static String |
REPORTED_FOR_APP_ID |
dataObj, warnings
Constructor and Description |
---|
Event(org.json.JSONObject json)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getAccountId()
Returns the account ID that this event is reporting for.
|
String |
getAppId()
Returns the API app ID for which this event is reported.
|
Date |
getEventDate()
Returns the event time as a Java Date object.
|
String |
getEventMessage()
Returns the message if any from the event
|
String |
getHash()
Returns the unique hash string identifying this event.
|
Signature |
getRelatedSignature()
Returns the associated Signature object with this event, if the event is
associated with a Signature Request.
|
String |
getRelatedSignatureId()
Returns the signature ID to which this event is associated.
|
SignatureRequest |
getSignatureRequest()
Returns a reference to the SignatureRequest that is attached to the
Event.
|
Template |
getTemplate()
Returns a reference to the Template that is attached to the Event.
|
EventType |
getType()
Returns the EventType for this event.
|
String |
getTypeString()
Returns the event type String.
|
boolean |
hasAccountId()
Returns true if this event has a "reported_for_account_id" field.
|
boolean |
hasAppId()
Returns true if this event has a "reported_for_app_id" field.
|
boolean |
hasRelatedSignatureId()
Utility method to determine if this event has a related signature ID.
|
boolean |
hasSignatureRequest()
Returns true if this Event is associated with a Signature Request.
|
boolean |
hasTemplate()
Returns true if this event is associated with a Template.
|
boolean |
isValid(String apiKey)
Returns true if the event hash matches the computed hash using the
provided API key.
|
String |
toString()
Displays the Signature Request in addition to the Event data.
|
add, addToList, clearList, get, getBoolean, getConstructor, getDate, getInteger, getJSONObject, getList, getList, getLong, getString, getWarnings, has, hasString, set, toString
public static final String EVENT_KEY
public static final String EVENT_METADATA
public static final String REPORTED_FOR_ACCOUNT_ID
public static final String REPORTED_FOR_APP_ID
public static final String RELATED_SIGNATURE_ID
public static final String EVENT_TYPE
public static final String EVENT_TIME
public static final String EVENT_HASH
public static final String EVENT_MESSAGE
public static final String HASH_ALGORITHM
protected static final char[] hexArray
public Event(org.json.JSONObject json) throws HelloSignException
json
- JSONObjectHelloSignException
- thrown if there is a problem parsing the
JSONObject.public String getAccountId() throws HelloSignException
HelloSignException
- thrown if there is a problem parsing the
backing JSON object.public boolean hasAccountId() throws HelloSignException
HelloSignException
- thrown if there is a problem parsing the
backing JSONObject.public String getAppId() throws HelloSignException
HelloSignException
- thrown if there is a problem parsing the
backing JSONObject.public boolean hasAppId() throws HelloSignException
HelloSignException
- thrown if there is a problem parsing the
backing JSONObject.public Date getEventDate()
public String getEventMessage() throws HelloSignException
HelloSignException
- thrown if there is a problem parsing the
backing JSONObject.public String getRelatedSignatureId() throws HelloSignException
HelloSignException
- thrown if there is a problem parsing the
backing JSONObject.public boolean hasRelatedSignatureId()
public Signature getRelatedSignature() throws HelloSignException
HelloSignException
- thrown if there is a problem parsing the
backing JSONObject.public SignatureRequest getSignatureRequest()
public boolean hasSignatureRequest()
public Template getTemplate()
public boolean hasTemplate()
public EventType getType()
public String getTypeString()
public String getHash()
public boolean isValid(String apiKey) throws HelloSignException
apiKey
- String api key.HelloSignException
- thrown if there is a problem parsing the API
key.public String toString()
toString
in class AbstractResource
Copyright © 2017 HelloSign. All rights reserved.