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, BambooIdProvider, 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
BASE_URL, SYSTEM_LINK_TYPE
 
Constructor Summary
protected DefaultArtifactLink()
          Default constructor for use with Hibernate and mappers
  DefaultArtifactLink(ArtifactDefinitionBase artifactDefinitionBase, BuildResultsSummary producerResult)
           
  DefaultArtifactLink(ArtifactDefinitionContext context, BuildResultsSummary producerResult)
          Deprecated. 
  DefaultArtifactLink(ArtifactDefinitionContext context, BuildResultsSummary producerResult, java.lang.String publisherPluginKey)
           
  DefaultArtifactLink(ArtifactDefinitionContext artifactDefinitionContext, ChainResultsSummary planResultsSummary)
           
 
Method Summary
 MutableArtifact getArtifact()
           
 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
 boolean isExists()
          If the artifact link exists
 boolean isSharedArtifact()
          Indicates if the artifact is a shared artifact.
 void setArtifact(MutableArtifact artifact)
           
protected  void setBuildResultsSummary(ResultsSummary resultsSummary)
           
 void setProducerJobResult(BuildResultsSummary producerJobResult)
           
protected  void setSubscriptions(java.util.List<ConsumedSubscription> subscriptions)
           
 
Methods inherited from class com.atlassian.bamboo.core.BambooEntityObject
equals, getId, hashCode, setId
 
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getLastModificationDate, 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
setId
 
Methods inherited from interface com.atlassian.bamboo.core.BambooIdProvider
getId
 

Constructor Detail

DefaultArtifactLink

protected DefaultArtifactLink()
Default constructor for use with Hibernate and mappers


DefaultArtifactLink

public DefaultArtifactLink(@NotNull
                           ArtifactDefinitionContext context,
                           @NotNull
                           BuildResultsSummary producerResult,
                           @NotNull
                           java.lang.String publisherPluginKey)

DefaultArtifactLink

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


DefaultArtifactLink

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

DefaultArtifactLink

public DefaultArtifactLink(@NotNull
                           ArtifactDefinitionContext artifactDefinitionContext,
                           @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

getLabel

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

Specified by:
getLabel in interface ArtifactLink
Returns:
label

getUrl

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

Specified by:
getUrl in interface ArtifactLink
Returns:
url

getSize

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

Specified by:
getSize in interface ArtifactLink
Returns:

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.

getSubscriptions

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

setSubscriptions

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

getArtifact

public MutableArtifact getArtifact()
Specified by:
getArtifact in interface ArtifactLink

setArtifact

public void setArtifact(MutableArtifact artifact)


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.