Class Connection

java.lang.Object
org.azd.connection.Connection

public class Connection extends Object
The factory class which sets the default parameters to use this library.

To call the Azure DevOps services REST API organization name and personal access token are mandatory. Setting these parameters as default helps to work with this library on ease.

  • Constructor Details

    • Connection

      public Connection()
      default with no parameters
    • Connection

      public Connection(String organization, String personalAccessToken)
      Instantiates the class with organization name and personal access token. Use this method if you don't want to specify the devops project
      Parameters:
      organization - pass the organization name
      personalAccessToken - pass the personal access token
    • Connection

      public Connection(String organization, String project, String personalAccessToken)
      Instantiates the class with organization name, project name and personal access token. Use this method if you want to specify the devops project
      Parameters:
      organization - pass the organization name
      project - provide the project name
      personalAccessToken - pass the personal access token
    • Connection

      public Connection(String organization, AuthorizedToken oauthToken, String appSecret, String appCallBackURL)
      Instantiates the class with organization name and oauth access token. Use this method if you don't want to specify the devops project and you don't want to be notified on oauth token refreshing
      Parameters:
      organization - pass the organization name
      oauthToken - pass the oauth access token
      appSecret - pass the app/client secret. It is used to refresh the oauth access token
      appCallBackURL - pass the app/client callBackURL (declared in the app). It is used to refresh the oauth access token
    • Connection

      public Connection(String organization, String project, AuthorizedToken oauthToken, String appSecret, String appCallBackURL, Connection.TokenRefreshedHandler tokenRefreshedHandler)
      Instantiates the class with organization name, project name and oauth access token. Use this method if you want to specify the devops project and you want to be notified on oauth token refreshing
      Parameters:
      organization - pass the organization name
      project - provide the project name
      oauthToken - pass the oauth access token
      appSecret - pass the app/client secret. It is used to refresh the oauth access token
      appCallBackURL - pass the app/client callBackURL (declared in the app). It is used to refresh the oauth access token
      tokenRefreshedHandler - pass the handler to be called on oauth token refresh
    • Connection

      public Connection(String organization, AuthorizedToken oauthToken, String appSecret, String appCallBackURL, Connection.TokenRefreshedHandler tokenRefreshedHandler)
      Instantiates the class with organization name and oauth access token. Use this method if you don't want to specify the devops project but you want to be notified on oauth token refreshing
      Parameters:
      organization - pass the organization name
      oauthToken - pass the oauth access token
      appSecret - pass the app/client secret. It is used to refresh the oauth access token
      appCallBackURL - pass the app/client callBackURL (declared in the app). It is used to refresh the oauth access token
      tokenRefreshedHandler - pass the handler to be called on oauth token refresh
    • Connection

      public Connection(String organization, String project, AuthorizedToken oauthToken, String appSecret, String appCallBackURL)
      Instantiates the class with organization name, project name and oauth access token. Use this method if you want to specify the devops project and you don't want to be notified on oauth token refreshing
      Parameters:
      organization - pass the organization name
      project - provide the project name
      oauthToken - pass the oauth access token
      appSecret - pass the app/client secret. It is used to refresh the oauth access token
      appCallBackURL - pass the app/client callBackURL (declared in the app). It is used to refresh the oauth access token
  • Method Details

    • getOrganization

      public String getOrganization()
      Get the default organization name
      Returns:
      organization name
    • setOrganization

      public void setOrganization(String organization)
      Set the organization name to default
      Parameters:
      organization - pass the organization name
    • getProject

      public String getProject()
      Get the default Project name
      Returns:
      project name
    • setProject

      public void setProject(String project)
      Set the project name to default
      Parameters:
      project - pass the project name
    • getPersonalAccessToken

      public String getPersonalAccessToken() throws AzDException
      Get the personal access token
      Returns:
      the personal access token
      Throws:
      AzDException - Default Api Exception handler.
    • setPersonalAccessToken

      public void setPersonalAccessToken(String personalAccessToken)
      Set the personal access token
      Parameters:
      personalAccessToken - pass the personal access token
    • setOauthToken

      public void setOauthToken(AuthorizedToken oauthToken)
      Set the oauth access token
      Parameters:
      oauthToken - pass the oauth access token