Package com.amazonaws.event
Class ProgressEvent
- java.lang.Object
-
- com.amazonaws.event.ProgressEvent
-
- Direct Known Subclasses:
ProgressEvent
public class ProgressEvent extends Object
A progress event. Typically this is used to notify a chunk of bytes has been transferred. Also used to notify other types of progress events such as a transfer starting, or failing.The legacy Amazon S3 progress event com.amazonaws.services.s3.model.ProgressEvent has been deprecated in favor of this new class.
-
-
Field Summary
Fields Modifier and Type Field Description static int
CANCELED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_CANCELED_EVENT
static int
COMPLETED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_COMPLETED_EVENT
static int
FAILED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_FAILED_EVENT
static int
PART_COMPLETED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_PART_COMPLETED_EVENT
static int
PART_FAILED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_PART_FAILED_EVENT
static int
PART_STARTED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_PART_STARTED_EVENT
static int
PREPARING_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_PREPARING_EVENT
static int
RESET_EVENT_CODE
Deprecated.static int
STARTED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_STARTED_EVENT
-
Constructor Summary
Constructors Constructor Description ProgressEvent(long bytes)
Deprecated.ProgressEvent(ProgressEventType eventType)
Creates a ProgressEvent object with the specified event type.ProgressEvent(ProgressEventType eventType, long bytes)
Creates a ProgressEvent object.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description long
getBytes()
Returns the number of bytes associated with the event.long
getBytesTransferred()
Convenient method to returns the number of bytes transferred in this event, or the number of bytes reset (or discarded) if negative.int
getEventCode()
Deprecated.UsegetEventType()
instead.ProgressEventType
getEventType()
Returns the type of event this object represents.String
toString()
-
-
-
Field Detail
-
PREPARING_EVENT_CODE
@Deprecated public static final int PREPARING_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_PREPARING_EVENT
- See Also:
- Constant Field Values
-
STARTED_EVENT_CODE
@Deprecated public static final int STARTED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_STARTED_EVENT
- See Also:
- Constant Field Values
-
COMPLETED_EVENT_CODE
@Deprecated public static final int COMPLETED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_COMPLETED_EVENT
- See Also:
- Constant Field Values
-
FAILED_EVENT_CODE
@Deprecated public static final int FAILED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_FAILED_EVENT
- See Also:
- Constant Field Values
-
CANCELED_EVENT_CODE
@Deprecated public static final int CANCELED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_CANCELED_EVENT
- See Also:
- Constant Field Values
-
RESET_EVENT_CODE
@Deprecated public static final int RESET_EVENT_CODE
Deprecated.- See Also:
- Constant Field Values
-
PART_STARTED_EVENT_CODE
@Deprecated public static final int PART_STARTED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_PART_STARTED_EVENT
- See Also:
- Constant Field Values
-
PART_COMPLETED_EVENT_CODE
@Deprecated public static final int PART_COMPLETED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_PART_COMPLETED_EVENT
- See Also:
- Constant Field Values
-
PART_FAILED_EVENT_CODE
@Deprecated public static final int PART_FAILED_EVENT_CODE
Deprecated.Replaced byProgressEventType.TRANSFER_PART_FAILED_EVENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProgressEvent
@Deprecated public ProgressEvent(long bytes)
Deprecated.Creates a BYTE_TRANSFER_EVENT with the specified bytesTransferred data.
-
ProgressEvent
public ProgressEvent(ProgressEventType eventType)
Creates a ProgressEvent object with the specified event type.- Parameters:
eventType
- Type of the progress event. This parameter must not be null.
-
ProgressEvent
public ProgressEvent(ProgressEventType eventType, long bytes)
Creates a ProgressEvent object.- Parameters:
eventType
- Type of the progress event. This parameter must not be null.bytes
- Number of bytes involved.
-
-
Method Detail
-
getBytes
public long getBytes()
Returns the number of bytes associated with the event. The number of bytes are not necessarily the same as the number of bytes transferred, and it's meaning depends on the specific event type. For example, the bytes of aProgressEventType.REQUEST_CONTENT_LENGTH_EVENT
refers to the expected number of bytes to be sent to AWS, not the actual number of bytes that have been transferred.
-
getBytesTransferred
public long getBytesTransferred()
Convenient method to returns the number of bytes transferred in this event, or the number of bytes reset (or discarded) if negative. In particular, bytes of a content-length event is excluded.
-
getEventCode
@Deprecated public int getEventCode()
Deprecated.UsegetEventType()
instead.Returns the unique event code identifying the type of event this object represents.- Returns:
- The unique event code that identifies what type of specific type of event this object represents.
-
getEventType
public ProgressEventType getEventType()
Returns the type of event this object represents. This method never returns null.- Returns:
- The type of event this object represents.
-
-