DirectoryTransferProgressAggregator
extends AbstractTransferListener
in package
FinalYes
Aggregates per-object progress snapshots into a directory-level snapshot.
Acts as an object-level listener and emits directory-level events through an internal notifier to the provided directory listeners.
Table of Contents
Constants
- PROGRESS_SNAPSHOT_KEY = 'progress_snapshot'
- REASON_KEY = 'reason'
- REQUEST_ARGS_KEY = 'request_args'
Methods
- __construct() : mixed
- bytesTransferred() : bool
- getSnapshot() : DirectoryTransferProgressSnapshot
- incrementTotals() : void
- Update totals, useful when object list is streamed.
- notifyDirectoryComplete() : void
- Notify directory listeners that the directory transfer completed.
- notifyDirectoryFail() : void
- Notify directory listeners that the directory transfer failed.
- notifyDirectoryInitiated() : void
- Notify directory listeners that the directory transfer has been initiated.
- priority() : int
- To provide an order on which listener is notified first.
- transferComplete() : void
- transferFail() : void
- transferInitiated() : void
Constants
PROGRESS_SNAPSHOT_KEY
public
mixed
PROGRESS_SNAPSHOT_KEY
= 'progress_snapshot'
REASON_KEY
public
mixed
REASON_KEY
= 'reason'
REQUEST_ARGS_KEY
public
mixed
REQUEST_ARGS_KEY
= 'request_args'
Methods
__construct()
public
__construct(string $identifier, int $totalBytes, int $totalFiles[, array<string|int, mixed> $directoryListeners = [] ][, AbstractTransferListener|null $directoryProgressTracker = null ]) : mixed
Parameters
- $identifier : string
- $totalBytes : int
- $totalFiles : int
- $directoryListeners : array<string|int, mixed> = []
- $directoryProgressTracker : AbstractTransferListener|null = null
bytesTransferred()
public
bytesTransferred(array<string|int, mixed> $context) : bool
Parameters
- $context : array<string|int, mixed>
-
- request_args: (array) The request arguments that will be provided as part of the operation that originated the bytes transferred event.
- progress_snapshot: (TransferProgressSnapshot) The transfer snapshot holder.
Tags
Return values
bool —true to notify successful handling otherwise false.
getSnapshot()
public
getSnapshot() : DirectoryTransferProgressSnapshot
Return values
DirectoryTransferProgressSnapshotincrementTotals()
Update totals, useful when object list is streamed.
public
incrementTotals(int $bytes[, int $files = 1 ]) : void
Parameters
- $bytes : int
- $files : int = 1
notifyDirectoryComplete()
Notify directory listeners that the directory transfer completed.
public
notifyDirectoryComplete([array<string|int, mixed>|null $response = null ]) : void
Parameters
- $response : array<string|int, mixed>|null = null
notifyDirectoryFail()
Notify directory listeners that the directory transfer failed.
public
notifyDirectoryFail(Throwable|string $reason) : void
Parameters
- $reason : Throwable|string
notifyDirectoryInitiated()
Notify directory listeners that the directory transfer has been initiated.
public
notifyDirectoryInitiated(array<string|int, mixed> $requestArgs) : void
Parameters
- $requestArgs : array<string|int, mixed>
priority()
To provide an order on which listener is notified first.
public
priority() : int
By default, it will provide a neutral value.
Return values
inttransferComplete()
public
transferComplete(array<string|int, mixed> $context) : void
Parameters
- $context : array<string|int, mixed>
-
- request_args: (array) The request arguments that will be provided as part of the operation that originated the bytes transferred event.
- progress_snapshot: (TransferProgressSnapshot) The transfer snapshot holder.
Tags
transferFail()
public
transferFail(array<string|int, mixed> $context) : void
Parameters
- $context : array<string|int, mixed>
-
- request_args: (array) The request arguments that will be provided as part of the operation that originated the bytes transferred event.
- progress_snapshot: (TransferProgressSnapshot) The transfer snapshot holder.
- reason: (Throwable) The exception originated by the transfer failure.
Tags
transferInitiated()
public
transferInitiated(array<string|int, mixed> $context) : void
Parameters
- $context : array<string|int, mixed>
-
- request_args: (array) The request arguments that will be provided as part of the request initialization.
- progress_snapshot: (TransferProgressSnapshot) The transfer snapshot holder.