org.sonatype.aether.util.listener
Class DefaultRepositoryEvent

java.lang.Object
  extended by org.sonatype.aether.util.listener.DefaultRepositoryEvent
All Implemented Interfaces:
RepositoryEvent

public class DefaultRepositoryEvent
extends Object
implements RepositoryEvent

A simple repository event.

Author:
Benjamin Bentmann

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.sonatype.aether.RepositoryEvent
RepositoryEvent.EventType
 
Constructor Summary
DefaultRepositoryEvent(RepositoryEvent.EventType type, RepositorySystemSession session)
          Deprecated. As of version 1.11, use DefaultRepositoryEvent(org.sonatype.aether.RepositoryEvent.EventType, RepositorySystemSession, RequestTrace) instead.
DefaultRepositoryEvent(RepositoryEvent.EventType type, RepositorySystemSession session, RequestTrace trace)
          Creates a new event with the specified properties.
 
Method Summary
 Artifact getArtifact()
          Gets the artifact involved in the event (if any).
 Exception getException()
          Gets the exception that caused the event (if any).
 List<Exception> getExceptions()
          Gets the exceptions that caused the event (if any).
 File getFile()
          Gets the file involved in the event (if any).
 Metadata getMetadata()
          Gets the metadata involved in the event (if any).
 ArtifactRepository getRepository()
          Gets the repository involved in the event (if any).
 RepositorySystemSession getSession()
          Gets the repository system session during which the event occurred.
 RequestTrace getTrace()
          Gets the trace information about the request during which the event occurred.
 RepositoryEvent.EventType getType()
          Gets the type of the event.
 DefaultRepositoryEvent setArtifact(Artifact artifact)
          Sets the artifact involved in the event.
 DefaultRepositoryEvent setException(Exception exception)
          Sets the exception causing the event.
 DefaultRepositoryEvent setExceptions(List<Exception> exceptions)
          Sets the exceptions causing the event.
 DefaultRepositoryEvent setFile(File file)
          Sets the file involved in the event.
 DefaultRepositoryEvent setMetadata(Metadata metadata)
          Sets the metadata involved in the event.
 DefaultRepositoryEvent setRepository(ArtifactRepository repository)
          Sets the repository involved in the event.
 DefaultRepositoryEvent setTrace(RequestTrace trace)
          Sets the trace information about the request during which the event occurred.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultRepositoryEvent

@Deprecated
public DefaultRepositoryEvent(RepositoryEvent.EventType type,
                                         RepositorySystemSession session)
Deprecated. As of version 1.11, use DefaultRepositoryEvent(org.sonatype.aether.RepositoryEvent.EventType, RepositorySystemSession, RequestTrace) instead.

Creates a new event with the specified properties.

Parameters:
type - The type of the event, must not be null.
session - The repository system session, must not be null.

DefaultRepositoryEvent

public DefaultRepositoryEvent(RepositoryEvent.EventType type,
                              RepositorySystemSession session,
                              RequestTrace trace)
Creates a new event with the specified properties.

Parameters:
type - The type of the event, must not be null.
session - The repository system session, must not be null.
trace - The trace information, may be null.
Method Detail

getType

public RepositoryEvent.EventType getType()
Description copied from interface: RepositoryEvent
Gets the type of the event.

Specified by:
getType in interface RepositoryEvent
Returns:
The type of the event, never null.

getSession

public RepositorySystemSession getSession()
Description copied from interface: RepositoryEvent
Gets the repository system session during which the event occurred.

Specified by:
getSession in interface RepositoryEvent
Returns:
The repository system session during which the event occurred, never null.

getArtifact

public Artifact getArtifact()
Description copied from interface: RepositoryEvent
Gets the artifact involved in the event (if any).

Specified by:
getArtifact in interface RepositoryEvent
Returns:
The involved artifact or null if none.

setArtifact

public DefaultRepositoryEvent setArtifact(Artifact artifact)
Sets the artifact involved in the event.

Parameters:
artifact - The involved artifact, may be null.
Returns:
This event for chaining, never null.

getMetadata

public Metadata getMetadata()
Description copied from interface: RepositoryEvent
Gets the metadata involved in the event (if any).

Specified by:
getMetadata in interface RepositoryEvent
Returns:
The involved metadata or null if none.

setMetadata

public DefaultRepositoryEvent setMetadata(Metadata metadata)
Sets the metadata involved in the event.

Parameters:
metadata - The involved metadata, may be null.
Returns:
This event for chaining, never null.

getRepository

public ArtifactRepository getRepository()
Description copied from interface: RepositoryEvent
Gets the repository involved in the event (if any).

Specified by:
getRepository in interface RepositoryEvent
Returns:
The involved repository or null if none.

setRepository

public DefaultRepositoryEvent setRepository(ArtifactRepository repository)
Sets the repository involved in the event.

Parameters:
repository - The involved repository, may be null.
Returns:
This event for chaining, never null.

getFile

public File getFile()
Description copied from interface: RepositoryEvent
Gets the file involved in the event (if any).

Specified by:
getFile in interface RepositoryEvent
Returns:
The involved file or null if none.

setFile

public DefaultRepositoryEvent setFile(File file)
Sets the file involved in the event.

Parameters:
file - The involved file, may be null.
Returns:
This event for chaining, never null.

getException

public Exception getException()
Description copied from interface: RepositoryEvent
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.

Specified by:
getException in interface RepositoryEvent
Returns:
The exception or null if none.

setException

public DefaultRepositoryEvent setException(Exception exception)
Sets the exception causing the event.

Parameters:
exception - The exception causing the event, may be null.
Returns:
This event for chaining, never null.

getExceptions

public List<Exception> getExceptions()
Description copied from interface: RepositoryEvent
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.

Specified by:
getExceptions in interface RepositoryEvent
Returns:
The exceptions, never null.

setExceptions

public DefaultRepositoryEvent setExceptions(List<Exception> exceptions)
Sets the exceptions causing the event.

Parameters:
exceptions - The exceptions causing the event, may be null.
Returns:
This event for chaining, never null.

getTrace

public RequestTrace getTrace()
Description copied from interface: RepositoryEvent
Gets the trace information about the request during which the event occurred.

Specified by:
getTrace in interface RepositoryEvent
Returns:
The trace information or null if none.

setTrace

public DefaultRepositoryEvent setTrace(RequestTrace trace)
Sets the trace information about the request during which the event occurred.

Parameters:
trace - The trace information, may be null.
Returns:
This event for chaining, never null.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2013. All Rights Reserved.