Package org.azd.connection
Class Connection
java.lang.Object
org.azd.connection.Connection
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.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptiondefault with no parametersConnection
(String organization, String personalAccessToken) Instantiates the class with organization name and personal access token.Connection
(String organization, String project, String personalAccessToken) Instantiates the class with organization name, project name and personal access token.Connection
(String organization, String project, AuthorizedToken oauthToken, String appSecret, String appCallBackURL) Instantiates the class with organization name, project name and oauth access token.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.Connection
(String organization, AuthorizedToken oauthToken, String appSecret, String appCallBackURL) Instantiates the class with organization name and oauth access token.Connection
(String organization, AuthorizedToken oauthToken, String appSecret, String appCallBackURL, Connection.TokenRefreshedHandler tokenRefreshedHandler) Instantiates the class with organization name and oauth access token. -
Method Summary
Modifier and TypeMethodDescriptionGet the default organization nameGet the personal access tokenGet the default Project namevoid
setOauthToken
(AuthorizedToken oauthToken) Set the oauth access tokenvoid
setOrganization
(String organization) Set the organization name to defaultvoid
setPersonalAccessToken
(String personalAccessToken) Set the personal access tokenvoid
setProject
(String project) Set the project name to default
-
Constructor Details
-
Connection
public Connection()default with no parameters -
Connection
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 namepersonalAccessToken
- pass the personal access token
-
Connection
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 nameproject
- provide the project namepersonalAccessToken
- 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 nameoauthToken
- pass the oauth access tokenappSecret
- pass the app/client secret. It is used to refresh the oauth access tokenappCallBackURL
- 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 nameproject
- provide the project nameoauthToken
- pass the oauth access tokenappSecret
- pass the app/client secret. It is used to refresh the oauth access tokenappCallBackURL
- pass the app/client callBackURL (declared in the app). It is used to refresh the oauth access tokentokenRefreshedHandler
- 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 nameoauthToken
- pass the oauth access tokenappSecret
- pass the app/client secret. It is used to refresh the oauth access tokenappCallBackURL
- pass the app/client callBackURL (declared in the app). It is used to refresh the oauth access tokentokenRefreshedHandler
- 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 nameproject
- provide the project nameoauthToken
- pass the oauth access tokenappSecret
- pass the app/client secret. It is used to refresh the oauth access tokenappCallBackURL
- pass the app/client callBackURL (declared in the app). It is used to refresh the oauth access token
-
-
Method Details
-
getOrganization
Get the default organization name- Returns:
- organization name
-
setOrganization
Set the organization name to default- Parameters:
organization
- pass the organization name
-
getProject
Get the default Project name- Returns:
- project name
-
setProject
Set the project name to default- Parameters:
project
- pass the project name
-
getPersonalAccessToken
Get the personal access token- Returns:
- the personal access token
- Throws:
AzDException
- Default Api Exception handler.
-
setPersonalAccessToken
Set the personal access token- Parameters:
personalAccessToken
- pass the personal access token
-
setOauthToken
Set the oauth access token- Parameters:
oauthToken
- pass the oauth access token
-