Package org.apache.maven.repository
Class ArtifactTransferEvent
java.lang.Object
java.util.EventObject
org.apache.maven.repository.ArtifactTransferEvent
- All Implemented Interfaces:
Serializable
TransferEvent is used to notify TransferListeners about progress
in transfer of resources form/to the repository
- Author:
- Michal Maczka
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Indicates GET transfer (from the repository)static final int
Indicates PUT transfer (to the repository)static final int
A transfer is completed.static final int
An error occurred during transferstatic final int
A transfer was attempted, but has not yet commenced.static final int
A transfer is in progress.static final int
A transfer was started.Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionArtifactTransferEvent
(String wagon, int eventType, int requestType, ArtifactTransferResource artifact) ArtifactTransferEvent
(String wagon, Exception exception, int requestType, ArtifactTransferResource artifact) -
Method Summary
Modifier and TypeMethodDescriptionboolean
byte[]
int
int
int
int
Returns the request type.long
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 typevoid
setTransferredBytes
(long transferredBytes) toString()
Methods inherited from class java.util.EventObject
getSource
-
Field Details
-
TRANSFER_INITIATED
public static final int TRANSFER_INITIATEDA transfer was attempted, but has not yet commenced.- See Also:
-
TRANSFER_STARTED
public static final int TRANSFER_STARTEDA transfer was started.- See Also:
-
TRANSFER_COMPLETED
public static final int TRANSFER_COMPLETEDA transfer is completed.- See Also:
-
TRANSFER_PROGRESS
public static final int TRANSFER_PROGRESSA transfer is in progress.- See Also:
-
TRANSFER_ERROR
public static final int TRANSFER_ERRORAn error occurred during transfer- See Also:
-
REQUEST_GET
public static final int REQUEST_GETIndicates GET transfer (from the repository)- See Also:
-
REQUEST_PUT
public static final int REQUEST_PUTIndicates PUT transfer (to the repository)- See Also:
-
-
Constructor Details
-
ArtifactTransferEvent
public ArtifactTransferEvent(String wagon, int eventType, int requestType, ArtifactTransferResource artifact) -
ArtifactTransferEvent
public ArtifactTransferEvent(String wagon, Exception exception, int requestType, ArtifactTransferResource artifact)
-
-
Method Details
-
getResource
-
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
orTransferEvent.REQUEST_PUT
-
setRequestType
public void setRequestType(int requestType) Sets the request type- Parameters:
requestType
- The requestType to set. The Request type value should be eitherTransferEvent.REQUEST_GET
orTransferEvent.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
- Returns:
- Returns the local file.
-
setLocalFile
- 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
- Overrides:
toString
in classEventObject
-
hashCode
public int hashCode() -
equals
-