org.apache.maven.repository
Class ArtifactTransferEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.apache.maven.repository.ArtifactTransferEvent
All Implemented Interfaces:
Serializable

public class ArtifactTransferEvent
extends EventObject

TransferEvent is used to notify TransferListeners about progress in transfer of resources form/to the repository

Author:
Michal Maczka
See Also:
Serialized Form

Field Summary
static int REQUEST_GET
          Indicates GET transfer (from the repository)
static int REQUEST_PUT
          Indicates PUT transfer (to the repository)
static int TRANSFER_COMPLETED
          A transfer is completed.
static int TRANSFER_ERROR
          An error occurred during transfer
static int TRANSFER_INITIATED
          A transfer was attempted, but has not yet commenced.
static int TRANSFER_PROGRESS
          A transfer is in progress.
static int TRANSFER_STARTED
          A transfer was started.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ArtifactTransferEvent(String wagon, Exception exception, int requestType, ArtifactTransferResource artifact)
           
ArtifactTransferEvent(String wagon, int eventType, int requestType, ArtifactTransferResource artifact)
           
 
Method Summary
 boolean equals(Object obj)
           
 byte[] getDataBuffer()
           
 int getDataLength()
           
 int getDataOffset()
           
 int getEventType()
           
 Exception getException()
           
 File getLocalFile()
           
 int getRequestType()
          Returns the request type.
 ArtifactTransferResource getResource()
           
 long getTransferredBytes()
           
 int hashCode()
           
 void setDataBuffer(byte[] dataBuffer)
           
 void setDataLength(int dataLength)
           
 void setDataOffset(int dataOffset)
           
 void setEventType(int eventType)
           
 void setLocalFile(File localFile)
           
 void setRequestType(int requestType)
          Sets the request type
 void setTransferredBytes(long transferredBytes)
           
 String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TRANSFER_INITIATED

public static final int TRANSFER_INITIATED
A transfer was attempted, but has not yet commenced.

See Also:
Constant Field Values

TRANSFER_STARTED

public static final int TRANSFER_STARTED
A transfer was started.

See Also:
Constant Field Values

TRANSFER_COMPLETED

public static final int TRANSFER_COMPLETED
A transfer is completed.

See Also:
Constant Field Values

TRANSFER_PROGRESS

public static final int TRANSFER_PROGRESS
A transfer is in progress.

See Also:
Constant Field Values

TRANSFER_ERROR

public static final int TRANSFER_ERROR
An error occurred during transfer

See Also:
Constant Field Values

REQUEST_GET

public static final int REQUEST_GET
Indicates GET transfer (from the repository)

See Also:
Constant Field Values

REQUEST_PUT

public static final int REQUEST_PUT
Indicates PUT transfer (to the repository)

See Also:
Constant Field Values
Constructor Detail

ArtifactTransferEvent

public ArtifactTransferEvent(String wagon,
                             int eventType,
                             int requestType,
                             ArtifactTransferResource artifact)

ArtifactTransferEvent

public ArtifactTransferEvent(String wagon,
                             Exception exception,
                             int requestType,
                             ArtifactTransferResource artifact)
Method Detail

getResource

public ArtifactTransferResource getResource()

getException

public Exception getException()
Returns:
Returns the exception.

getRequestType

public int getRequestType()
Returns the request type.

Returns:
Returns the request type. The Request type is one of TransferEvent.REQUEST_GET or TransferEvent.REQUEST_PUT

setRequestType

public void setRequestType(int requestType)
Sets the request type

Parameters:
requestType - The requestType to set. The Request type value should be either TransferEvent.REQUEST_GET or TransferEvent.REQUEST_PUT.
Throws:
IllegalArgumentException - when

getEventType

public int getEventType()
Returns:
Returns the eventType.

setEventType

public void setEventType(int eventType)
Parameters:
eventType - The eventType to set.

getLocalFile

public File getLocalFile()
Returns:
Returns the local file.

setLocalFile

public void setLocalFile(File localFile)
Parameters:
localFile - The local file to set.

getTransferredBytes

public long getTransferredBytes()

setTransferredBytes

public void setTransferredBytes(long transferredBytes)

getDataBuffer

public byte[] getDataBuffer()

setDataBuffer

public void setDataBuffer(byte[] dataBuffer)

getDataOffset

public int getDataOffset()

setDataOffset

public void setDataOffset(int dataOffset)

getDataLength

public int getDataLength()

setDataLength

public void setDataLength(int dataLength)

toString

public String toString()
Overrides:
toString in class EventObject

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.