Class ClientFactory
- java.lang.Object
-
- com.google.jenkins.plugins.storage.client.ClientFactory
-
public class ClientFactory extends Object
Creates clients for communicating with Google APIs.
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_NAME
-
Constructor Summary
Constructors Constructor Description ClientFactory(ItemGroup itemGroup, com.google.common.collect.ImmutableList<com.cloudbees.plugins.credentials.domains.DomainRequirement> domainRequirements, String credentialsId, Optional<com.google.api.client.http.HttpTransport> httpTransport)
Creates aClientFactory
instance.ClientFactory(ItemGroup itemGroup, String credentialsId)
Creates aClientFactory
instance without specifying domainRequirements or httpTransport.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCredentialsId()
String
getDefaultProjectId()
StorageClient
storageClient()
Creates a newStorageClient
.
-
-
-
Field Detail
-
APPLICATION_NAME
public static final String APPLICATION_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClientFactory
public ClientFactory(ItemGroup itemGroup, com.google.common.collect.ImmutableList<com.cloudbees.plugins.credentials.domains.DomainRequirement> domainRequirements, String credentialsId, Optional<com.google.api.client.http.HttpTransport> httpTransport) throws AbortException
Creates aClientFactory
instance.- Parameters:
itemGroup
- A handle to the Jenkins instance.domainRequirements
- A list of domain requirements.credentialsId
- The ID of the GoogleRobotCredentials to be retrieved from Jenkins and utilized for authorization.httpTransport
- If specified, the HTTP transport this factory will utilize for clients it creates.- Throws:
AbortException
- If failed to create a new client factory.
-
ClientFactory
public ClientFactory(ItemGroup itemGroup, String credentialsId) throws AbortException
Creates aClientFactory
instance without specifying domainRequirements or httpTransport.- Parameters:
itemGroup
- A handle to the Jenkins instance.credentialsId
- The ID of the GoogleRobotCredentials to be retrieved from Jenkins and utilized for authorization.- Throws:
AbortException
- If failed to create a new client factory.
-
-
Method Detail
-
storageClient
public StorageClient storageClient()
Creates a newStorageClient
.- Returns:
- A new
StorageClient
instance.
-
getDefaultProjectId
public String getDefaultProjectId()
- Returns:
- The default Project ID associated with this ClientFactory's credentials.
-
getCredentialsId
public String getCredentialsId()
- Returns:
- The Credentials ID for this ClientFactory.
-
-