com.atlassian.bamboo.build.artifact
Class DefaultArtifactLink

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.bamboo.core.BambooEntityObject
          extended by com.atlassian.bamboo.build.artifact.DefaultArtifactLink
All Implemented Interfaces:
ArtifactLink, BambooObject, java.lang.Cloneable

public class DefaultArtifactLink
extends BambooEntityObject
implements ArtifactLink

This class is a simple POJO representing artifact links.


Field Summary
 
Fields inherited from class com.atlassian.bamboo.core.BambooEntityObject
id
 
Fields inherited from interface com.atlassian.bamboo.build.artifact.ArtifactLink
SYSTEM_LINK_TYPE
 
Constructor Summary
protected DefaultArtifactLink()
          Default constructor for use with Hibernate
  DefaultArtifactLink(ArtifactDefinitionBase artifactDefinitionBase, BuildResultsSummary producerResult)
           
  DefaultArtifactLink(ArtifactDefinitionContext context, BuildResultsSummary producerResult)
           
protected DefaultArtifactLink(ArtifactDefinitionContext artifactDefinitionContext, BuildResultsSummary producerResult, ChainResultsSummary planResultsSummary)
           
  DefaultArtifactLink(ArtifactDefinitionContext artifactDefinitionContext, ChainResultsSummary planResultsSummary)
           
 
Method Summary
 void calculateSize()
           
 ResultsSummary getBuildResultsSummary()
           
 java.io.File getFile()
          Accessor for the actual file handle of the artifact.
 java.lang.String getLabel()
          Label of the Artifact
 java.lang.String getLinkType()
          Type of artifact link
 BuildResultsSummary getProducerJobResult()
           
 long getSize()
          Returns a file size in bytes
 java.lang.String getSizeDescription()
          Returns a human-readable version of the file size, where the input represents a specific number of bytes.
 java.util.List<ConsumedSubscription> getSubscriptions()
           
 java.lang.String getUrl()
          URL of the artifact relative to AdministrationConfiguration.getBaseUrl()
 java.lang.String getUrlSuffix()
           
 boolean isExists()
          If the artifact link exists
 boolean isSharedArtifact()
          Indicates if the artifact is a shared artifact.
protected  void setBuildResultsSummary(ResultsSummary resultsSummary)
           
protected  void setLabel(java.lang.String label)
           
 void setLinkType(java.lang.String linkType)
           
 void setProducerJobResult(BuildResultsSummary producerJobResult)
           
protected  void setSharedArtifact(boolean sharedArtifact)
           
protected  void setSize(long size)
           
 void setSubscriptions(java.util.List<ConsumedSubscription> subscriptions)
           
 
Methods inherited from class com.atlassian.bamboo.core.BambooEntityObject
getId, setId
 
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, equals, getCreationDate, getCurrentDate, getLastModificationDate, hashCode, setClock, setCreationDate, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.core.BambooObject
getId, setId
 

Constructor Detail

DefaultArtifactLink

protected DefaultArtifactLink()
Default constructor for use with Hibernate


DefaultArtifactLink

public DefaultArtifactLink(@NotNull
                           ArtifactDefinitionContext context,
                           @NotNull
                           BuildResultsSummary producerResult)

DefaultArtifactLink

public DefaultArtifactLink(@NotNull
                           ArtifactDefinitionBase artifactDefinitionBase,
                           @NotNull
                           BuildResultsSummary producerResult)

DefaultArtifactLink

public DefaultArtifactLink(@NotNull
                           ArtifactDefinitionContext artifactDefinitionContext,
                           @NotNull
                           ChainResultsSummary planResultsSummary)

DefaultArtifactLink

protected DefaultArtifactLink(@NotNull
                              ArtifactDefinitionContext artifactDefinitionContext,
                              @NotNull
                              BuildResultsSummary producerResult,
                              @NotNull
                              ChainResultsSummary planResultsSummary)
Method Detail

getLinkType

@NotNull
public java.lang.String getLinkType()
Description copied from interface: ArtifactLink
Type of artifact link

Specified by:
getLinkType in interface ArtifactLink
Returns:
linkType

setLinkType

public void setLinkType(@NotNull
                        java.lang.String linkType)

getLabel

@NotNull
public java.lang.String getLabel()
Description copied from interface: ArtifactLink
Label of the Artifact

Specified by:
getLabel in interface ArtifactLink
Returns:
label

setLabel

protected void setLabel(@NotNull
                        java.lang.String label)

getUrl

@Nullable
public java.lang.String getUrl()
Description copied from interface: ArtifactLink
URL of the artifact relative to AdministrationConfiguration.getBaseUrl()

Specified by:
getUrl in interface ArtifactLink
Returns:
url

getUrlSuffix

public java.lang.String getUrlSuffix()

calculateSize

public void calculateSize()

getSize

public long getSize()
Description copied from interface: ArtifactLink
Returns a file size in bytes

Specified by:
getSize in interface ArtifactLink
Returns:

setSize

protected void setSize(long size)

isExists

public boolean isExists()
Description copied from interface: ArtifactLink
If the artifact link exists

Specified by:
isExists in interface ArtifactLink
Returns:
true if the artifact exists, false otherwise

getFile

@NotNull
public java.io.File getFile()
Description copied from interface: ArtifactLink
Accessor for the actual file handle of the artifact.

Specified by:
getFile in interface ArtifactLink
Returns:
a File object pointing to either the file or directory of this artifact

getSizeDescription

@NotNull
public java.lang.String getSizeDescription()
Description copied from interface: ArtifactLink
Returns a human-readable version of the file size, where the input represents a specific number of bytes.

Specified by:
getSizeDescription in interface ArtifactLink
Returns:
size description

getBuildResultsSummary

public ResultsSummary getBuildResultsSummary()
Specified by:
getBuildResultsSummary in interface ArtifactLink
Returns:
ResultsSummary which this artifact link belongs to. May be null if still not associated with ResultsSummary

setBuildResultsSummary

protected void setBuildResultsSummary(ResultsSummary resultsSummary)

getProducerJobResult

@Nullable
public BuildResultsSummary getProducerJobResult()
Specified by:
getProducerJobResult in interface ArtifactLink
Returns:
ResultsSummary of the Job that produced this artifact. May be null if still not associated with ResultsSummary or if it has been removed but artifact still exists.

setProducerJobResult

public void setProducerJobResult(@Nullable
                                 BuildResultsSummary producerJobResult)

isSharedArtifact

public boolean isSharedArtifact()
Description copied from interface: ArtifactLink
Indicates if the artifact is a shared artifact.

Specified by:
isSharedArtifact in interface ArtifactLink
Returns:
true if artifact is a shared artifact.

setSharedArtifact

protected void setSharedArtifact(boolean sharedArtifact)

getSubscriptions

public java.util.List<ConsumedSubscription> getSubscriptions()
Specified by:
getSubscriptions in interface ArtifactLink

setSubscriptions

public void setSubscriptions(java.util.List<ConsumedSubscription> subscriptions)


Copyright © 2011 Atlassian. All Rights Reserved.