org.apache.maven.wagon.events
Class TransferEventSupport

java.lang.Object
  extended by org.apache.maven.wagon.events.TransferEventSupport

public final class TransferEventSupport
extends Object

The class allows registration and removal of event listeners of type TransferListener and dispatch of those events to those listeners

Version:
$Id: TransferEventSupport.java 682051 2008-08-02 21:29:38Z hboutemy $
Author:
Michal Maczka

Constructor Summary
TransferEventSupport()
           
 
Method Summary
 void addTransferListener(TransferListener listener)
          Adds the listener to the collection of listeners who will be notified when any transfer event occurs in this Wagon object.
 void fireDebug(String message)
          Dispatches the given debug message to all registered listeners (calls method TransferListener.debug(String) on all of them.
 void fireTransferCompleted(TransferEvent transferEvent)
          Dispatches the given TransferEvent to all registered listeners (calls method TransferListener.transferCompleted(TransferEvent) on all of them}.
 void fireTransferError(TransferEvent transferEvent)
          Dispatches the given TransferEvent to all registered listeners (calls method TransferListener.transferError(TransferEvent) on all of them.
 void fireTransferInitiated(TransferEvent transferEvent)
          Dispatches the given TransferEvent to all registered listeners (calls method TransferListener.transferInitiated(TransferEvent) on all of them.
 void fireTransferProgress(TransferEvent transferEvent, byte[] buffer, int length)
          Dispatches the given TransferEvent to all registered listeners (calls method TransferListener.transferProgress(TransferEvent, byte[], int) on all of them).
 void fireTransferStarted(TransferEvent transferEvent)
          Dispatches the given TransferEvent to all registered listeners (calls method TransferListener.transferStarted(TransferEvent) on all of them}.
 boolean hasTransferListener(TransferListener listener)
          Returns whether the specified instance of transfer listener was added to the collection of listeners who will be notified when an transfer event occurs
 void removeTransferListener(TransferListener listener)
          Removes the transfer listener from the collection of listeners so it no longer receives transfer events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransferEventSupport

public TransferEventSupport()
Method Detail

addTransferListener

public void addTransferListener(TransferListener listener)
Adds the listener to the collection of listeners who will be notified when any transfer event occurs in this Wagon object.
If listener is null, no exception is thrown and no action is performed

Parameters:
listener - the transfer listener
See Also:
removeTransferListener(org.apache.maven.wagon.events.TransferListener), TransferListener

removeTransferListener

public void removeTransferListener(TransferListener listener)
Removes the transfer listener from the collection of listeners so it no longer receives transfer events.
If listener is null or specified listener was not added to this TransferEventSupport object no exception is thrown and no action is performed

Parameters:
listener - the transfer listener
See Also:
addTransferListener(TransferListener)

hasTransferListener

public boolean hasTransferListener(TransferListener listener)
Returns whether the specified instance of transfer listener was added to the collection of listeners who will be notified when an transfer event occurs

Parameters:
listener - the transfer listener
Returns:
true if given listener was added to the collection of listeners false otherwise
See Also:
TransferEvent, addTransferListener(TransferListener)

fireTransferStarted

public void fireTransferStarted(TransferEvent transferEvent)
Dispatches the given TransferEvent to all registered listeners (calls method TransferListener.transferStarted(TransferEvent) on all of them}. The Event should be of type TransferEvent.TRANSFER_COMPLETED

Parameters:
transferEvent - the TransferEvent which will be dispatched to listeners

fireTransferProgress

public void fireTransferProgress(TransferEvent transferEvent,
                                 byte[] buffer,
                                 int length)
Dispatches the given TransferEvent to all registered listeners (calls method TransferListener.transferProgress(TransferEvent, byte[], int) on all of them). The Event should be of type TransferEvent.TRANSFER_PROGRESS.

Parameters:
transferEvent - the TransferEvent which will be dispatched to listeners
buffer - the buffer containing the additional content
length - the length of the content in the buffer

fireTransferCompleted

public void fireTransferCompleted(TransferEvent transferEvent)
Dispatches the given TransferEvent to all registered listeners (calls method TransferListener.transferCompleted(TransferEvent) on all of them}. The Event should be of type TransferEvent.TRANSFER_COMPLETED

Parameters:
transferEvent - the TransferEvent which will be dispatched to listeners

fireTransferError

public void fireTransferError(TransferEvent transferEvent)
Dispatches the given TransferEvent to all registered listeners (calls method TransferListener.transferError(TransferEvent) on all of them. The Event should be of type TransferEvent.TRANSFER_ERROR and it is expected that TransferEvent.getException() } method will return not null value

Parameters:
transferEvent - the TransferEvent which will be dispatched to listeners

fireDebug

public void fireDebug(String message)
Dispatches the given debug message to all registered listeners (calls method TransferListener.debug(String) on all of them.

Parameters:
message - the debug message which will be dispatched to listeners

fireTransferInitiated

public void fireTransferInitiated(TransferEvent transferEvent)
Dispatches the given TransferEvent to all registered listeners (calls method TransferListener.transferInitiated(TransferEvent) on all of them. The Event should be of type TransferEvent.TRANSFER_INITIATED.

Parameters:
transferEvent - the TransferEvent which will be dispatched to listeners


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.