org.jfrog.build.extractor.clientConfiguration.client
Class ArtifactoryBuildInfoClient

java.lang.Object
  extended by org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBaseClient
      extended by org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBuildInfoClient

public class ArtifactoryBuildInfoClient
extends ArtifactoryBaseClient

Artifactory client to perform build info related tasks.


Field Summary
static java.lang.String BUILD_BROWSE_URL
           
 
Fields inherited from class org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBaseClient
artifactoryUrl, httpClient, log
 
Constructor Summary
ArtifactoryBuildInfoClient(java.lang.String artifactoryUrl, org.jfrog.build.api.util.Log log)
          Creates a new client for the given Artifactory url.
ArtifactoryBuildInfoClient(java.lang.String artifactoryUrl, java.lang.String username, java.lang.String password, org.jfrog.build.api.util.Log log)
          Creates a new client for the given Artifactory url.
 
Method Summary
 java.lang.String buildInfoToJsonString(org.jfrog.build.api.Build buildInfo)
           
 org.jfrog.build.client.ArtifactoryUploadResponse deployArtifact(org.jfrog.build.client.DeployDetails details)
          Deploys the artifact to the destination repository.
 org.apache.http.HttpResponse executePromotionUserPlugin(java.lang.String promotionName, java.lang.String buildName, java.lang.String buildNumber, java.util.Map<java.lang.String,java.lang.String> requestParams)
           
 org.apache.http.HttpResponse executeUpdateFileProperty(java.lang.String itemPath, java.lang.String properties)
           
 org.apache.http.HttpResponse executeUserPlugin(java.lang.String executionName, java.util.Map<java.lang.String,java.lang.String> requestParams)
           
 org.jfrog.build.client.ArtifactoryVersion getArtifactoryVersion()
           
 java.lang.String getItemLastModified(java.lang.String path)
           
 java.util.List<java.lang.String> getLocalAndCacheRepositoriesKeys()
           
 java.util.List<java.lang.String> getLocalRepositoriesKeys()
           
 java.util.List<java.lang.String> getRemoteRepositoriesKeys()
           
 java.util.Map getStagingStrategy(java.lang.String strategyName, java.lang.String buildName, java.util.Map<java.lang.String,java.lang.String> requestParams)
           
 java.util.Map<java.lang.String,java.util.List<java.util.Map>> getUserPluginInfo()
           
 java.util.List<java.lang.String> getVirtualRepositoryKeys()
           
 org.jfrog.build.client.bintrayResponse.BintrayResponse pushToBintray(java.lang.String buildName, java.lang.String buildNumber, java.lang.String signMethod, java.lang.String passphrase, org.jfrog.build.api.release.BintrayUploadInfoOverride bintrayUploadInfo)
          Push build to bintray
 void sendBuildInfo(org.jfrog.build.api.Build buildInfo)
          Sends build info to Artifactory.
 void sendBuildInfo(java.lang.String buildInfoJson)
           
 void sendModuleInfo(org.jfrog.build.api.Build build)
           
 void shutdown()
          Release all connection and cleanup resources.
 org.apache.http.HttpResponse stageBuild(java.lang.String buildName, java.lang.String buildNumber, org.jfrog.build.api.release.Promotion promotion)
           
 void uploadChecksums(org.jfrog.build.client.DeployDetails details, java.lang.String uploadUrl)
           
 org.jfrog.build.client.ArtifactoryVersion verifyCompatibleArtifactoryVersion()
           
 
Methods inherited from class org.jfrog.build.extractor.clientConfiguration.client.ArtifactoryBaseClient
setConnectionTimeout, setProxyConfiguration, setProxyConfiguration, setProxyConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUILD_BROWSE_URL

public static final java.lang.String BUILD_BROWSE_URL
See Also:
Constant Field Values
Constructor Detail

ArtifactoryBuildInfoClient

public ArtifactoryBuildInfoClient(java.lang.String artifactoryUrl,
                                  org.jfrog.build.api.util.Log log)
Creates a new client for the given Artifactory url.

Parameters:
artifactoryUrl - Artifactory url in the form of: protocol://host[:port]/contextPath

ArtifactoryBuildInfoClient

public ArtifactoryBuildInfoClient(java.lang.String artifactoryUrl,
                                  java.lang.String username,
                                  java.lang.String password,
                                  org.jfrog.build.api.util.Log log)
Creates a new client for the given Artifactory url.

Parameters:
artifactoryUrl - Artifactory url in the form of: protocol://host[:port]/contextPath
username - Authentication username
password - Authentication password
Method Detail

getLocalRepositoriesKeys

public java.util.List<java.lang.String> getLocalRepositoriesKeys()
                                                          throws java.io.IOException
Returns:
A list of local repositories available for deployment.
Throws:
java.io.IOException - On any connection error

getLocalAndCacheRepositoriesKeys

public java.util.List<java.lang.String> getLocalAndCacheRepositoriesKeys()
                                                                  throws java.io.IOException
Returns:
A list of local and cache repositories.
Throws:
java.io.IOException - On any connection error

getRemoteRepositoriesKeys

public java.util.List<java.lang.String> getRemoteRepositoriesKeys()
                                                           throws java.io.IOException
Returns:
A list of remote repositories.
Throws:
java.io.IOException - On any connection error

getVirtualRepositoryKeys

public java.util.List<java.lang.String> getVirtualRepositoryKeys()
                                                          throws java.io.IOException
Returns:
A list of virtual repositories available for resolution.
Throws:
java.io.IOException - On any connection error

sendBuildInfo

public void sendBuildInfo(java.lang.String buildInfoJson)
                   throws java.io.IOException
Throws:
java.io.IOException

sendBuildInfo

public void sendBuildInfo(org.jfrog.build.api.Build buildInfo)
                   throws java.io.IOException
Sends build info to Artifactory.

Parameters:
buildInfo - The build info to send
Throws:
java.io.IOException - On any connection error

sendModuleInfo

public void sendModuleInfo(org.jfrog.build.api.Build build)
                    throws java.io.IOException
Throws:
java.io.IOException

getItemLastModified

public java.lang.String getItemLastModified(java.lang.String path)
                                     throws java.io.IOException,
                                            java.text.ParseException
Throws:
java.io.IOException
java.text.ParseException

deployArtifact

public org.jfrog.build.client.ArtifactoryUploadResponse deployArtifact(org.jfrog.build.client.DeployDetails details)
                                                                throws java.io.IOException
Deploys the artifact to the destination repository.

Parameters:
details - Details about the deployed artifact
Returns:
ArtifactoryResponse The response content received from Artifactory
Throws:
java.io.IOException - On any connection error

verifyCompatibleArtifactoryVersion

public org.jfrog.build.client.ArtifactoryVersion verifyCompatibleArtifactoryVersion()
                                                                             throws org.jfrog.build.util.VersionException
Returns:
Artifactory version if working against a compatible version of Artifactory
Throws:
java.io.IOException - If server not found or it doesn't answer to the version query or it is too old
org.jfrog.build.util.VersionException

pushToBintray

public org.jfrog.build.client.bintrayResponse.BintrayResponse pushToBintray(java.lang.String buildName,
                                                                            java.lang.String buildNumber,
                                                                            java.lang.String signMethod,
                                                                            java.lang.String passphrase,
                                                                            org.jfrog.build.api.release.BintrayUploadInfoOverride bintrayUploadInfo)
                                                                     throws java.io.IOException,
                                                                            java.net.URISyntaxException
Push build to bintray

Parameters:
buildName - name of the build to push
buildNumber - number of the build to push
signMethod - flags if this artifacts should be signed or not
passphrase - passphrase in case that the artifacts should be signed
bintrayUploadInfo - request body which contains the upload info
Returns:
http Response with the response outcome
Throws:
java.io.IOException - On any connection error
java.net.URISyntaxException
See Also:
org.jfrog.build.api.release.BintrayUploadInfoOverride;

stageBuild

public org.apache.http.HttpResponse stageBuild(java.lang.String buildName,
                                               java.lang.String buildNumber,
                                               org.jfrog.build.api.release.Promotion promotion)
                                        throws java.io.IOException
Throws:
java.io.IOException

getUserPluginInfo

public java.util.Map<java.lang.String,java.util.List<java.util.Map>> getUserPluginInfo()
                                                                                throws java.io.IOException
Throws:
java.io.IOException

executeUserPlugin

public org.apache.http.HttpResponse executeUserPlugin(java.lang.String executionName,
                                                      java.util.Map<java.lang.String,java.lang.String> requestParams)
                                               throws java.io.IOException
Throws:
java.io.IOException

getStagingStrategy

public java.util.Map getStagingStrategy(java.lang.String strategyName,
                                        java.lang.String buildName,
                                        java.util.Map<java.lang.String,java.lang.String> requestParams)
                                 throws java.io.IOException
Throws:
java.io.IOException

executePromotionUserPlugin

public org.apache.http.HttpResponse executePromotionUserPlugin(java.lang.String promotionName,
                                                               java.lang.String buildName,
                                                               java.lang.String buildNumber,
                                                               java.util.Map<java.lang.String,java.lang.String> requestParams)
                                                        throws java.io.IOException
Throws:
java.io.IOException

executeUpdateFileProperty

public org.apache.http.HttpResponse executeUpdateFileProperty(java.lang.String itemPath,
                                                              java.lang.String properties)
                                                       throws java.io.IOException
Throws:
java.io.IOException

shutdown

public void shutdown()
Release all connection and cleanup resources.

Overrides:
shutdown in class ArtifactoryBaseClient

buildInfoToJsonString

public java.lang.String buildInfoToJsonString(org.jfrog.build.api.Build buildInfo)
                                       throws java.lang.Exception
Throws:
java.lang.Exception

uploadChecksums

public void uploadChecksums(org.jfrog.build.client.DeployDetails details,
                            java.lang.String uploadUrl)
                     throws java.io.IOException
Throws:
java.io.IOException

getArtifactoryVersion

public org.jfrog.build.client.ArtifactoryVersion getArtifactoryVersion()