Package org.eclipse.aether
Class RepositoryEvent
- java.lang.Object
-
- org.eclipse.aether.RepositoryEvent
-
public final class RepositoryEvent extends java.lang.ObjectAn event describing an action performed by the repository system. Note that events which indicate the end of an action likeRepositoryEvent.EventType.ARTIFACT_RESOLVEDare generally fired in both the success and the failure case. UsegetException()to check whether an event denotes success or failure.- See Also:
RepositoryListener,RepositoryEvent.Builder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRepositoryEvent.BuilderA builder to create events.static classRepositoryEvent.EventTypeThe type of the repository event.
-
Field Summary
Fields Modifier and Type Field Description private Artifactartifactprivate java.util.List<java.lang.Exception>exceptionsprivate java.io.Filefileprivate Metadatametadataprivate ArtifactRepositoryrepositoryprivate RepositorySystemSessionsessionprivate RequestTracetraceprivate RepositoryEvent.EventTypetype
-
Constructor Summary
Constructors Constructor Description RepositoryEvent(RepositoryEvent.Builder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArtifactgetArtifact()Gets the artifact involved in the event (if any).java.lang.ExceptiongetException()Gets the exception that caused the event (if any).java.util.List<java.lang.Exception>getExceptions()Gets the exceptions that caused the event (if any).java.io.FilegetFile()Gets the file involved in the event (if any).MetadatagetMetadata()Gets the metadata involved in the event (if any).ArtifactRepositorygetRepository()Gets the repository involved in the event (if any).RepositorySystemSessiongetSession()Gets the repository system session during which the event occurred.RequestTracegetTrace()Gets the trace information about the request during which the event occurred.RepositoryEvent.EventTypegetType()Gets the type of the event.java.lang.StringtoString()
-
-
-
Field Detail
-
type
private final RepositoryEvent.EventType type
-
session
private final RepositorySystemSession session
-
artifact
private final Artifact artifact
-
metadata
private final Metadata metadata
-
repository
private final ArtifactRepository repository
-
file
private final java.io.File file
-
exceptions
private final java.util.List<java.lang.Exception> exceptions
-
trace
private final RequestTrace trace
-
-
Constructor Detail
-
RepositoryEvent
RepositoryEvent(RepositoryEvent.Builder builder)
-
-
Method Detail
-
getType
public RepositoryEvent.EventType getType()
Gets the type of the event.- Returns:
- The type of the event, never
null.
-
getSession
public RepositorySystemSession getSession()
Gets the repository system session during which the event occurred.- Returns:
- The repository system session during which the event occurred, never
null.
-
getArtifact
public Artifact getArtifact()
Gets the artifact involved in the event (if any).- Returns:
- The involved artifact or
nullif none.
-
getMetadata
public Metadata getMetadata()
Gets the metadata involved in the event (if any).- Returns:
- The involved metadata or
nullif none.
-
getFile
public java.io.File getFile()
Gets the file involved in the event (if any).- Returns:
- The involved file or
nullif none.
-
getRepository
public ArtifactRepository getRepository()
Gets the repository involved in the event (if any).- Returns:
- The involved repository or
nullif none.
-
getException
public java.lang.Exception getException()
Gets the exception that caused the event (if any). As a rule of thumb, an event accompanied by an exception indicates a failure of the corresponding action. If multiple exceptions occurred, this method returns the first exception.- Returns:
- The exception or
nullif none.
-
getExceptions
public java.util.List<java.lang.Exception> getExceptions()
Gets the exceptions that caused the event (if any). As a rule of thumb, an event accompanied by exceptions indicates a failure of the corresponding action.- Returns:
- The exceptions, never
null.
-
getTrace
public RequestTrace getTrace()
Gets the trace information about the request during which the event occurred.- Returns:
- The trace information or
nullif none.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-