Package org.codice.ddf.activities
Class ActivityEvent
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,Object>
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumStatus enumerations for an activity.Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the ID of the currentActivityEvent.Return the type ofActivityEventthat is going on.Returns the bytes read associated with theActivityEvent.Returns the category associated with theActivityEventReturns the message associated with theActivityEventintReturns the progress of the activity.Retrieves the session ID of the currentActivityEvent.Returns aDatedepicting the time at which the event that triggered thisActivityEventoccurred.Returns alongdepicting the time at which the event that triggered thisActivityEventoccurred.Returns aStringdepicting the time at which the event that triggered thisActivityEventoccurred.getTitle()Returns the title associated with theActivityEventReturns the id of the user to whom thisActivityEventis addressed.voidsetActivityId(String id) Set the id of the activity being performed.voidsetBytesRead(Long bytesRead) Overwrites the bytes read associated with theActivityEvent.voidsetCategory(String category) Overwrites the category associated with theActivityEventvoidsetMessage(String message) Overwrites the message associated with theActivityEventvoidsetOperations(Map<String, String> operations) Sets the operations that this activity can perform.voidsetProgress(int progress) Sets the progress of the activity.voidsetSessionId(String sessionId) Set the session id of the activity being performed.voidsetTimestamp(Long timestamp) Overwrites the timestamp that depicts the time at which the event that triggered theActivityEventoccurred.voidsetTimestamp(Date timestamp) Overwrites the timestamp that depicts the time at which the event that triggered theActivityEventoccurred.voidOverwrites the title associated with theActivityEventvoidOverwrites the id of the user to whom theActivityEventis addressed.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Field Details
-
ID_KEY
- See Also:
-
SESSION_ID_KEY
- See Also:
-
STATUS_KEY
- See Also:
-
TITLE_KEY
- See Also:
-
MESSAGE_KEY
- See Also:
-
TIMESTAMP_KEY
- See Also:
-
OPERATIONS_KEY
- See Also:
-
PROGRESS_KEY
- See Also:
-
USER_ID_KEY
- See Also:
-
CATEGORY_KEY
- See Also:
-
BYTES_READ_KEY
- See Also:
-
DOWNLOAD_ID_KEY
- See Also:
-
EVENT_TOPIC
- See Also:
-
EVENT_TOPIC_DOWNLOAD_CANCEL
- See Also:
-
-
Constructor Details
-
ActivityEvent
-
-
Method Details
-
setOperations
Sets the operations that this activity can perform.- Parameters:
operations- Map of operations where the key is the operation name and the value is a url to the operation
-
getProgress
public int getProgress()Returns the progress of the activity.- Returns:
- progress Integer value representation of the progress, ranging from 0 to 100, or -1 when progress is unknown or not applicable
-
setProgress
public void setProgress(int progress) Sets the progress of the activity.- Parameters:
progress- Integer value representation of the progress, ranging from 0 to 100, or -1 when progress is unknown or not applicable
-
getActivityType
Return the type ofActivityEventthat is going on.- Returns:
- Type of the
ActivityEvent, must follow the enumerated ActivityType values.
-
getActivityId
Retrieves the ID of the currentActivityEvent.- Returns:
- ID of the
ActivityEvent.
-
setActivityId
Set the id of the activity being performed.- Parameters:
id- This id should be unique and used across the entire lifecycle of theActivityEvent.
-
getSessionId
Retrieves the session ID of the currentActivityEvent.- Returns:
- session ID of the
ActivityEvent.
-
setSessionId
Set the session id of the activity being performed.- Parameters:
sessionId- This session id should be unique and used across the entire lifecycle of theActivityEvent.
-
getMessage
Returns the message associated with theActivityEvent- Returns:
- The message associated with the
ActivityEvent
-
setMessage
Overwrites the message associated with theActivityEvent- Parameters:
message- The new message associated with theActivityEvent
-
getTitle
Returns the title associated with theActivityEvent- Returns:
- The title associated with the
ActivityEvent
-
setTitle
Overwrites the title associated with theActivityEvent- Parameters:
title- The new title associated with theActivityEvent
-
getCategory
Returns the category associated with theActivityEvent- Returns:
- The category associated with the
ActivityEvent
-
setCategory
Overwrites the category associated with theActivityEvent- Parameters:
category- A human-readable category that describes the event that is occuring. Example: 'Product Retrieval'.
-
getTimestampString
Returns aStringdepicting the time at which the event that triggered thisActivityEventoccurred.- Returns:
- A
Stringrepresenting the number of milliseconds between January 1, 1970, 00:00:00 GMT and the point at which the event that triggered thisActivityEventoccurred.
-
getTimestampLong
Returns alongdepicting the time at which the event that triggered thisActivityEventoccurred.- Returns:
- A
longrepresenting the number of milliseconds between January 1, 1970, 00:00:00 GMT and the point at which the event that triggered thisActivityEventoccurred.
-
getTimestamp
Returns aDatedepicting the time at which the event that triggered thisActivityEventoccurred.- Returns:
- A
Datethe point at which the event that triggered thisActivityEventoccurred.
-
setTimestamp
Overwrites the timestamp that depicts the time at which the event that triggered theActivityEventoccurred.- Parameters:
timestamp- Alongrepresenting the number of milliseconds between January 1, 1970, 00:00:00 GMT and the point at which the event that triggered thisActivityEventoccurred.
-
setTimestamp
Overwrites the timestamp that depicts the time at which the event that triggered theActivityEventoccurred.- Parameters:
timestamp- ADaterepresenting the point at which the event that triggered thisActivityEventoccurred.
-
getUserId
Returns the id of the user to whom thisActivityEventis addressed.- Returns:
- The id of the user to whom this
ActivityEventis addressed.
-
setUserId
Overwrites the id of the user to whom theActivityEventis addressed.- Parameters:
userId- The new userId to whom theActivityEventshould be addressed.
-
getBytesRead
Returns the bytes read associated with theActivityEvent.- Returns:
- The bytes read associated with the
ActivityEvent.
-
setBytesRead
Overwrites the bytes read associated with theActivityEvent.- Parameters:
bytesRead- The new bytes read associated with theActivityEvent.
-