net.sf.taverna.raven.repository
Enum ArtifactStatus

java.lang.Object
  extended by java.lang.Enum<ArtifactStatus>
      extended by net.sf.taverna.raven.repository.ArtifactStatus
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ArtifactStatus>

public enum ArtifactStatus
extends java.lang.Enum<ArtifactStatus>
implements java.lang.Comparable<ArtifactStatus>

Enumeration of the possible states a dependency may occupy during the resolution, fetch and verify process. The valid transitions between these states are shown below:

When an artifact is added to the Repository it is initially in the Queued state. The first action is to attempt to download the POM file from each of the remote URLs, if this fails the state shifts to PomFailed, otherwise to Pom. The Pom is then analyzed and the <packaging> element inspected, if present and its contents are not 'jar' then the Pom is assumed to refer to something else and the artifact moves to the PomNonJar state. If the artifact is a jar type then the dependency section within the Pom is analyzed - this causes any new dependencies not already present in the repository to be added in the Queued state and this artifact moves to JarFetching status. If download of the Jar fails the state is marked as JarFailed otherwise it transitions to Jar. Any artifacts with Jar state are checked to see whether they have no dependencies - if so they move to Ready, they also move to this state if all their child dependencies have Ready status. If any child dependency has an error state as denoted by the red boxes then the artifact moves to the DependencyFailure error state.

The PomFetching and JarFetching states denote download activities - while an artifact is in these states the detailed progress of the download can be monitored through the getDownloadStatus(Artifact a) method in the Repository interface.

Author:
Tom Oinn

Enum Constant Summary
Analyzed
          Pom has been parsed, immediate dependencies added
DependencyFailure
          One or more dependencies of this artifact failed to resolve, this may include transitive dependency failure.
Jar
          Both pom and jar have been downloaded but dependencies may exist which are not resolved fully
JarFailed
          An error occured during download of the Jar
JarFetching
          Downloading the jar file
Pom
          Pom has been fetched, no jar file as yet
PomFailed
          An error occured during download of the Pom
PomFetching
          Downloading Pom file
PomNonJar
          Non jar package method for the POM, means we can't do anything further with it
Queued
          Artifact has been added to the download queue but no fetch has occured
Ready
          Fully resolved, a ClassLoader can be created at this point
Unknown
          No information is known about this Artifact, it is not present in the Repository
 
Method Summary
 java.util.Date getCreated()
           
 java.lang.String getDescription()
           
 java.lang.Exception getException()
           
 int getOrder()
           
 boolean isError()
           
 void setException(java.lang.Exception exception)
           
static ArtifactStatus valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ArtifactStatus[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Enum Constant Detail

Unknown

public static final ArtifactStatus Unknown
No information is known about this Artifact, it is not present in the Repository


Queued

public static final ArtifactStatus Queued
Artifact has been added to the download queue but no fetch has occured


PomFetching

public static final ArtifactStatus PomFetching
Downloading Pom file


Pom

public static final ArtifactStatus Pom
Pom has been fetched, no jar file as yet


PomFailed

public static final ArtifactStatus PomFailed
An error occured during download of the Pom


PomNonJar

public static final ArtifactStatus PomNonJar
Non jar package method for the POM, means we can't do anything further with it


Analyzed

public static final ArtifactStatus Analyzed
Pom has been parsed, immediate dependencies added


JarFetching

public static final ArtifactStatus JarFetching
Downloading the jar file


Jar

public static final ArtifactStatus Jar
Both pom and jar have been downloaded but dependencies may exist which are not resolved fully


JarFailed

public static final ArtifactStatus JarFailed
An error occured during download of the Jar


Ready

public static final ArtifactStatus Ready
Fully resolved, a ClassLoader can be created at this point


DependencyFailure

public static final ArtifactStatus DependencyFailure
One or more dependencies of this artifact failed to resolve, this may include transitive dependency failure.

Method Detail

values

public static final ArtifactStatus[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(ArtifactStatus c : ArtifactStatus.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static ArtifactStatus valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getCreated

public java.util.Date getCreated()
Returns:
Returns the Date this status object was created.

getDescription

public java.lang.String getDescription()
Returns:
Returns a free text description of the status.

getException

public java.lang.Exception getException()
Returns:
Returns the exception.

getOrder

public int getOrder()
Returns:
the index in the partial order of ArtifactStatus enumeration

isError

public boolean isError()
Returns:
Returns true if this status indicates a failure.

setException

public void setException(java.lang.Exception exception)
Parameters:
exception - The exception to set.