Package org.eclipse.aether.internal.impl
Class SafeTransferListener
- java.lang.Object
-
- org.eclipse.aether.transfer.AbstractTransferListener
-
- org.eclipse.aether.internal.impl.SafeTransferListener
-
- All Implemented Interfaces:
TransferListener
- Direct Known Subclasses:
DefaultDeployer.ArtifactUploadListener
,DefaultDeployer.MetadataUploadListener
class SafeTransferListener extends AbstractTransferListener
-
-
Field Summary
Fields Modifier and Type Field Description private TransferListener
listener
private static org.slf4j.Logger
LOGGER
-
Constructor Summary
Constructors Modifier Constructor Description protected
SafeTransferListener(RepositorySystemSession session)
private
SafeTransferListener(TransferListener listener)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
logError(TransferEvent event, java.lang.Throwable e)
void
transferCorrupted(TransferEvent event)
Notifies the listener that a checksum validation failed.void
transferFailed(TransferEvent event)
Notifies the listener about the unsuccessful termination of a transfer.void
transferInitiated(TransferEvent event)
Notifies the listener about the initiation of a transfer.void
transferProgressed(TransferEvent event)
Notifies the listener about some progress in the data transfer.void
transferStarted(TransferEvent event)
Notifies the listener about the start of a data transfer.void
transferSucceeded(TransferEvent event)
Notifies the listener about the successful completion of a transfer.static TransferListener
wrap(RepositorySystemSession session)
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
listener
private final TransferListener listener
-
-
Constructor Detail
-
SafeTransferListener
protected SafeTransferListener(RepositorySystemSession session)
-
SafeTransferListener
private SafeTransferListener(TransferListener listener)
-
-
Method Detail
-
wrap
public static TransferListener wrap(RepositorySystemSession session)
-
logError
private void logError(TransferEvent event, java.lang.Throwable e)
-
transferInitiated
public void transferInitiated(TransferEvent event) throws TransferCancelledException
Description copied from interface:TransferListener
Notifies the listener about the initiation of a transfer. This event gets fired before any actual network access to the remote repository and usually indicates some thread is now about to perform the transfer. For a given transfer request, this event is the first one being fired and it must be emitted exactly once.- Specified by:
transferInitiated
in interfaceTransferListener
- Overrides:
transferInitiated
in classAbstractTransferListener
- Parameters:
event
- The event details, must not benull
.- Throws:
TransferCancelledException
- If the transfer should be aborted.
-
transferStarted
public void transferStarted(TransferEvent event) throws TransferCancelledException
Description copied from interface:TransferListener
Notifies the listener about the start of a data transfer. This event indicates a successful connection to the remote repository. In case of a download, the requested remote resource exists and its size is given byTransferResource.getContentLength()
if possible. This event may be fired multiple times for given transfer request if said transfer needs to be repeated (e.g. in response to an authentication challenge).- Specified by:
transferStarted
in interfaceTransferListener
- Overrides:
transferStarted
in classAbstractTransferListener
- Parameters:
event
- The event details, must not benull
.- Throws:
TransferCancelledException
- If the transfer should be aborted.
-
transferProgressed
public void transferProgressed(TransferEvent event) throws TransferCancelledException
Description copied from interface:TransferListener
Notifies the listener about some progress in the data transfer. This event may even be fired if actually zero bytes have been transferred since the last event, for instance to enable cancellation.- Specified by:
transferProgressed
in interfaceTransferListener
- Overrides:
transferProgressed
in classAbstractTransferListener
- Parameters:
event
- The event details, must not benull
.- Throws:
TransferCancelledException
- If the transfer should be aborted.
-
transferCorrupted
public void transferCorrupted(TransferEvent event) throws TransferCancelledException
Description copied from interface:TransferListener
Notifies the listener that a checksum validation failed.TransferEvent.getException()
will be of typeChecksumFailureException
and can be used to query further details about the expected/actual checksums.- Specified by:
transferCorrupted
in interfaceTransferListener
- Overrides:
transferCorrupted
in classAbstractTransferListener
- Parameters:
event
- The event details, must not benull
.- Throws:
TransferCancelledException
- If the transfer should be aborted.
-
transferSucceeded
public void transferSucceeded(TransferEvent event)
Description copied from interface:TransferListener
Notifies the listener about the successful completion of a transfer. This event must be fired exactly once for a given transfer request unless said request failed.- Specified by:
transferSucceeded
in interfaceTransferListener
- Overrides:
transferSucceeded
in classAbstractTransferListener
- Parameters:
event
- The event details, must not benull
.
-
transferFailed
public void transferFailed(TransferEvent event)
Description copied from interface:TransferListener
Notifies the listener about the unsuccessful termination of a transfer.TransferEvent.getException()
will provide further information about the failure.- Specified by:
transferFailed
in interfaceTransferListener
- Overrides:
transferFailed
in classAbstractTransferListener
- Parameters:
event
- The event details, must not benull
.
-
-