com.atlassian.bamboo.build.artifact
Class BambooRemoteArtifactHandler

java.lang.Object
  extended by com.atlassian.bamboo.build.artifact.AbstractArtifactHandler
      extended by com.atlassian.bamboo.build.artifact.BambooRemoteArtifactHandler
All Implemented Interfaces:
ArtifactHandler, InitablePluginModule<ArtifactHandlerModuleDescriptor>, BambooPluginModule

public class BambooRemoteArtifactHandler
extends AbstractArtifactHandler


Field Summary
 
Fields inherited from class com.atlassian.bamboo.build.artifact.AbstractArtifactHandler
ALL_AGENT_TYPES, LOCAL_AGENTS, NON_LOCAL_AGENTS
 
Fields inherited from interface com.atlassian.bamboo.build.artifact.ArtifactHandler
LAN_SPEED, LOCAL_SPEED, WAN_SPEED
 
Constructor Summary
BambooRemoteArtifactHandler()
           
 
Method Summary
 ArtifactLinkDataProvider getArtifactLinkDataProvider(Artifact artifact, ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
           
 ArtifactLinkDataProvider getArtifactLinkDataProvider(ArtifactLink artifactLink, ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
           
 int getSpeed(java.util.Map<java.lang.String,java.lang.String> artifactHandlersConfiguration)
           
 boolean moveArtifactToGlobalStorage(Artifact artifact, ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
          Move artifact to a 'global storage'.
 boolean publish(PlanResultKey planResultKey, ArtifactDefinitionContext artifact, ArtifactPublishingConfig artifactPublishingConfig)
           
 void removeArtifactFromStorage(Artifact artifact, ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
          Removes artifact files for a single artifact.
 void removeArtifactFromStorage(PlanResultKey planResultKey, ImmutableArtifactDefinitionBase artifact, ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
          Removes artifact files for a single artifact.
 void removeArtifactsFromStorage(PlanKey planKey, ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
          Removes artifact files for all results of a single.
 void removeArtifactsFromStorage(PlanResultKey planResultKey, ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
          Removes artifact files for a single plan result.
 ArtifactRetrievalStatus retrieve(PlanResultKey planResultKey, ResultKey resultKey, ArtifactSubscriptionContext artifactSubscription, ArtifactRetrievalConfig artifactRetrievalConfig)
          Retrieve plan artifact.
 ArtifactRetrievalStatus retrieve(ResultKey clientKey, Artifact artifact, ArtifactSubscriptionContext artifactSubscription, ArtifactRetrievalConfig artifactRetrievalConfig)
          Retrieve arbitrary Artifact.
 void setSender(HttpMessageSender sender)
           
 
Methods inherited from class com.atlassian.bamboo.build.artifact.AbstractArtifactHandler
canHandleArtifact, configProvider, getConfigurationKey, getConfigValue, getDefaultConfiguration, getModuleDescriptor, getSupportedAgents, init, populateContextForEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BambooRemoteArtifactHandler

public BambooRemoteArtifactHandler()
Method Detail

publish

public boolean publish(@NotNull
                       PlanResultKey planResultKey,
                       @NotNull
                       ArtifactDefinitionContext artifact,
                       @NotNull
                       ArtifactPublishingConfig artifactPublishingConfig)
                throws java.io.IOException
Throws:
java.io.IOException

retrieve

@NotNull
public ArtifactRetrievalStatus retrieve(@NotNull
                                                PlanResultKey planResultKey,
                                                @NotNull
                                                ResultKey resultKey,
                                                @NotNull
                                                ArtifactSubscriptionContext artifactSubscription,
                                                @NotNull
                                                ArtifactRetrievalConfig artifactRetrievalConfig)
                                 throws java.io.IOException
Description copied from interface: ArtifactHandler
Retrieve plan artifact. Artifact is found by label (taken from artifactSubscription) and planResultKey.

Parameters:
planResultKey - identifier of source plan
resultKey - identifier of plan or deployment doing the download
artifactSubscription - download details (e.g. target path, copy pattern)
artifactRetrievalConfig - handler specific configuration
Throws:
java.io.IOException

retrieve

@NotNull
public ArtifactRetrievalStatus retrieve(@NotNull
                                                ResultKey clientKey,
                                                @NotNull
                                                Artifact artifact,
                                                @NotNull
                                                ArtifactSubscriptionContext artifactSubscription,
                                                @NotNull
                                                ArtifactRetrievalConfig artifactRetrievalConfig)
                                 throws java.io.IOException
Description copied from interface: ArtifactHandler
Retrieve arbitrary Artifact. Artifact is found by the information in artifact parameter.

Parameters:
clientKey - identifier of plan or deployment doing the download
artifact - artifact information
artifactSubscription - download details (e.g. target path, copy pattern)
artifactRetrievalConfig - handler specific configuration
Throws:
java.io.IOException

setSender

public void setSender(HttpMessageSender sender)

getSpeed

public int getSpeed(@NotNull
                    java.util.Map<java.lang.String,java.lang.String> artifactHandlersConfiguration)

removeArtifactFromStorage

public void removeArtifactFromStorage(@NotNull
                                      PlanResultKey planResultKey,
                                      @NotNull
                                      ImmutableArtifactDefinitionBase artifact,
                                      @NotNull
                                      ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Description copied from interface: ArtifactHandler
Removes artifact files for a single artifact. Called when removing ArtifactLink Should not remove artifacts that were moved to global storage.


removeArtifactsFromStorage

public void removeArtifactsFromStorage(@NotNull
                                       PlanResultKey planResultKey,
                                       @NotNull
                                       ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Description copied from interface: ArtifactHandler
Removes artifact files for a single plan result. Called when removing ResultsSummary Should not remove artifacts that were moved to global storage.


removeArtifactsFromStorage

public void removeArtifactsFromStorage(@NotNull
                                       PlanKey planKey,
                                       @NotNull
                                       ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Description copied from interface: ArtifactHandler
Removes artifact files for all results of a single. Called when removing Plan Should not remove artifacts that were moved to global storage.


getArtifactLinkDataProvider

public ArtifactLinkDataProvider getArtifactLinkDataProvider(ArtifactLink artifactLink,
                                                            @NotNull
                                                            ArtifactHandlerConfigProvider artifactHandlerConfigProvider)

removeArtifactFromStorage

public void removeArtifactFromStorage(@NotNull
                                      Artifact artifact,
                                      @NotNull
                                      ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Description copied from interface: ArtifactHandler
Removes artifact files for a single artifact.


moveArtifactToGlobalStorage

public boolean moveArtifactToGlobalStorage(@NotNull
                                           Artifact artifact,
                                           @NotNull
                                           ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Description copied from interface: ArtifactHandler
Move artifact to a 'global storage'. Artifacts in 'global storage' should only be removed when ArtifactHandler.removeArtifactFromStorage(Artifact, ArtifactHandlerConfigProvider) is called. It is not a requirement to physically move the files as long as the above contract is fulfilled.

Returns:
true if move successful

getArtifactLinkDataProvider

@Nullable
public ArtifactLinkDataProvider getArtifactLinkDataProvider(Artifact artifact,
                                                                     @Nullable
                                                                     ArtifactHandlerConfigProvider artifactHandlerConfigProvider)


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