public class ActivityEvent extends HashMap<String,Object>
Modifier and Type | Class and Description |
---|---|
static class |
ActivityEvent.ActivityStatus
Status enumerations for an activity.
|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
static String |
BYTES_READ_KEY |
static String |
CATEGORY_KEY |
static String |
DOWNLOAD_ID_KEY |
static String |
EVENT_TOPIC |
static String |
EVENT_TOPIC_DOWNLOAD_CANCEL |
static String |
ID_KEY |
static String |
MESSAGE_KEY |
static String |
OPERATIONS_KEY |
static String |
PROGRESS_KEY |
static String |
SESSION_ID_KEY |
static String |
STATUS_KEY |
static String |
TIMESTAMP_KEY |
static String |
TITLE_KEY |
static String |
USER_ID_KEY |
Constructor and Description |
---|
ActivityEvent(String id,
String sessionId,
Date timestamp,
String category,
String title,
String message,
int progress,
Map<String,String> operations,
String user,
ActivityEvent.ActivityStatus type,
Long bytes) |
Modifier and Type | Method and Description |
---|---|
String |
getActivityId()
Retrieves the ID of the current
ActivityEvent . |
String |
getActivityType()
Return the type of
ActivityEvent that is going on. |
Long |
getBytesRead()
Returns the bytes read associated with the
ActivityEvent . |
String |
getCategory()
Returns the category associated with the
ActivityEvent |
String |
getMessage()
Returns the message associated with the
ActivityEvent |
int |
getProgress()
Returns the progress of the activity.
|
String |
getSessionId()
Retrieves the session ID of the current
ActivityEvent . |
Date |
getTimestamp()
Returns a
Date depicting the time at which the event that triggered this ActivityEvent occurred. |
Long |
getTimestampLong()
Returns a
long depicting the time at which the event that triggered this ActivityEvent occurred. |
String |
getTimestampString()
Returns a
String depicting the time at which the event that triggered this ActivityEvent occurred. |
String |
getTitle()
Returns the title associated with the
ActivityEvent |
String |
getUserId()
Returns the id of the user to whom this
ActivityEvent is addressed. |
void |
setActivityId(String id)
Set the id of the activity being performed.
|
void |
setBytesRead(Long bytesRead)
Overwrites the bytes read associated with the
ActivityEvent . |
void |
setCategory(String category)
Overwrites the category associated with the
ActivityEvent |
void |
setMessage(String message)
Overwrites the message associated with the
ActivityEvent |
void |
setOperations(Map<String,String> operations)
Sets the operations that this activity can perform.
|
void |
setProgress(int progress)
Sets the progress of the activity.
|
void |
setSessionId(String sessionId)
Set the session id of the activity being performed.
|
void |
setTimestamp(Date timestamp)
Overwrites the timestamp that depicts the time at which the event that triggered the
ActivityEvent occurred. |
void |
setTimestamp(Long timestamp)
Overwrites the timestamp that depicts the time at which the event that triggered the
ActivityEvent occurred. |
void |
setTitle(String title)
Overwrites the title associated with the
ActivityEvent |
void |
setUserId(String userId)
Overwrites the id of the user to whom the
ActivityEvent is addressed. |
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
public static final String ID_KEY
public static final String SESSION_ID_KEY
public static final String STATUS_KEY
public static final String TITLE_KEY
public static final String MESSAGE_KEY
public static final String TIMESTAMP_KEY
public static final String OPERATIONS_KEY
public static final String PROGRESS_KEY
public static final String USER_ID_KEY
public static final String CATEGORY_KEY
public static final String BYTES_READ_KEY
public static final String DOWNLOAD_ID_KEY
public static final String EVENT_TOPIC
public static final String EVENT_TOPIC_DOWNLOAD_CANCEL
public void setOperations(Map<String,String> operations)
operations
- Map of operations where the key is the operation name and the value is a url
to the operationpublic int getProgress()
public void setProgress(int progress)
progress
- Integer value representation of the progress, ranging from 0 to 100, or -1 when
progress is unknown or not applicablepublic String getActivityType()
ActivityEvent
that is going on.ActivityEvent
, must follow the enumerated ActivityType values.public String getActivityId()
ActivityEvent
.ActivityEvent
.public void setActivityId(String id)
id
- This id should be unique and used across the entire lifecycle of the ActivityEvent
.public String getSessionId()
ActivityEvent
.ActivityEvent
.public void setSessionId(String sessionId)
sessionId
- This session id should be unique and used across the entire lifecycle of the
ActivityEvent
.public String getMessage()
ActivityEvent
ActivityEvent
public void setMessage(String message)
ActivityEvent
message
- The new message associated with the ActivityEvent
public String getTitle()
ActivityEvent
ActivityEvent
public void setTitle(String title)
ActivityEvent
title
- The new title associated with the ActivityEvent
public String getCategory()
ActivityEvent
ActivityEvent
public void setCategory(String category)
ActivityEvent
category
- A human-readable category that describes the event that is occuring. Example:
'Product Retrieval'.public String getTimestampString()
String
depicting the time at which the event that triggered this ActivityEvent
occurred.String
representing the number of milliseconds between January 1, 1970,
00:00:00 GMT and the point at which the event that triggered this ActivityEvent
occurred.public Long getTimestampLong()
long
depicting the time at which the event that triggered this ActivityEvent
occurred.long
representing the number of milliseconds between January 1, 1970,
00:00:00 GMT and the point at which the event that triggered this ActivityEvent
occurred.public Date getTimestamp()
Date
depicting the time at which the event that triggered this ActivityEvent
occurred.Date
the point at which the event that triggered this ActivityEvent
occurred.public void setTimestamp(Long timestamp)
ActivityEvent
occurred.timestamp
- A long
representing the number of milliseconds between January 1,
1970, 00:00:00 GMT and the point at which the event that triggered this ActivityEvent
occurred.public void setTimestamp(Date timestamp)
ActivityEvent
occurred.timestamp
- A Date
representing the point at which the event that triggered
this ActivityEvent
occurred.public String getUserId()
ActivityEvent
is addressed.ActivityEvent
is addressed.public void setUserId(String userId)
ActivityEvent
is addressed.userId
- The new userId to whom the ActivityEvent
should be addressed.public Long getBytesRead()
ActivityEvent
.ActivityEvent
.public void setBytesRead(Long bytesRead)
ActivityEvent
.bytesRead
- The new bytes read associated with the ActivityEvent
.This work is licensed under a Creative Commons Attribution 4.0 International License.