public final class TransferEvent
extends java.lang.Object
TransferListener
,
TransferEvent.Builder
Modifier and Type | Class and Description |
---|---|
static class |
TransferEvent.Builder
A builder to create transfer events.
|
static class |
TransferEvent.EventType
The type of the event.
|
static class |
TransferEvent.RequestType
The type of the request/transfer being performed.
|
Modifier and Type | Field and Description |
---|---|
private java.nio.ByteBuffer |
dataBuffer |
private java.lang.Exception |
exception |
private TransferEvent.RequestType |
requestType |
private TransferResource |
resource |
private RepositorySystemSession |
session |
private long |
transferredBytes |
private TransferEvent.EventType |
type |
Constructor and Description |
---|
TransferEvent(TransferEvent.Builder builder) |
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
getDataBuffer()
Gets the byte buffer holding the transferred bytes since the last event.
|
int |
getDataLength()
Gets the number of bytes that have been transferred since the last event.
|
java.lang.Exception |
getException()
Gets the error that occurred during the transfer.
|
TransferEvent.RequestType |
getRequestType()
Gets the type of the request/transfer.
|
TransferResource |
getResource()
Gets the resource that is being transferred.
|
RepositorySystemSession |
getSession()
Gets the repository system session during which the event occurred.
|
long |
getTransferredBytes()
Gets the total number of bytes that have been transferred since the download/upload of the resource was started.
|
TransferEvent.EventType |
getType()
Gets the type of the event.
|
java.lang.String |
toString() |
private final TransferEvent.EventType type
private final TransferEvent.RequestType requestType
private final RepositorySystemSession session
private final TransferResource resource
private final java.nio.ByteBuffer dataBuffer
private final long transferredBytes
private final java.lang.Exception exception
TransferEvent(TransferEvent.Builder builder)
public TransferEvent.EventType getType()
null
.public TransferEvent.RequestType getRequestType()
null
.public RepositorySystemSession getSession()
null
.public TransferResource getResource()
null
.public long getTransferredBytes()
getDataLength()
,
TransferResource.getResumeOffset()
public java.nio.ByteBuffer getDataBuffer()
null
if not applicable to the event, i.e. if the event type is not
TransferEvent.EventType.PROGRESSED
.public int getDataLength()
getTransferredBytes()
public java.lang.Exception getException()
null
if none.public java.lang.String toString()
toString
in class java.lang.Object