Package org.azd.maven
Class MavenApi
- All Implemented Interfaces:
MavenDetails
MavenApi class to manage maven artifact package api
-
Constructor Summary
ConstructorDescriptionMavenApi
(Connection connection) Pass the connection object to work with Maven Package Api -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearUpstreamingBehavior
(String feedId, String groupId, String artifactId) To clear the upstream behavior of a (scoped) package.void
deletePackageVersion
(String feedId, String groupId, String artifactId, String version) Delete a package version from the feed and move it to the feed's recycle bin.void
deletePackageVersionFromRecycleBin
(String feedId, String groupId, String artifactId, String version) Permanently delete a package from a feed's recycle bin.Fulfills Maven package file download requests by either returning the URL of the requested package file or, in the case of Azure DevOps Server (OnPrem),getPackageVersion
(String feedId, String groupId, String artifactId, String version) Get information about a package version.getPackageVersion
(String feedId, String groupId, String artifactId, String version, boolean showDeleted) Get information about a package version.getPackageVersionFromRecycleBin
(String feedId, String groupId, String artifactId, String version) Get information about a package version in the recycle bin.getUpstreamingBehavior
(String feedId, String groupId, String artifactId) Get the upstreaming behavior of a package within the context of a feedvoid
restorePackageVersionFromRecycleBin
(String feedId, String groupId, String artifactId, String version) Restore a package version from the recycle bin to its associated feed.void
setUpstreamingBehavior
(String feedId, String groupId, String artifactId) Set the upstreaming behavior of a (scoped) package.void
setUpstreamingBehavior
(String feedId, String groupId, String artifactId, String upstreamingBehavior) Set the upstreaming behavior of a (scoped) package.void
updatePackageVersion
(String feedId, String groupId, String artifactId, String version, String promote) Set mutable state on a package version.(eg.void
updatePackageVersion
(String feedId, String groupId, String artifactId, String version, PackagePromote promote) Set mutable state on a package version.(eg.void
updatePackageVersions
(String feedId, String viewId, PackagesBatchOperation operation, List<Map<String, Object>> packages) Update several packages from a single feed in a single request.void
updateRecycleBinPackages
(String feedId, PackagesBatchOperation operation, List<Map<String, Object>> packages) Delete or restore several package versions from the recycle bin.void
uploadPackage
(String feedId, String groupId, String artifactId, String version, String fileName, InputStream content) Fulfills Maven package file upload requests by either returning the URL of the requested package file or, in the case of Azure DevOps Server (OnPrem),Methods inherited from class org.azd.utils.AzDAsyncApi
createAsync
-
Constructor Details
-
MavenApi
Pass the connection object to work with Maven Package Api- Parameters:
connection
- Connection object
-
-
Method Details
-
getPackageVersion
public Package getPackageVersion(String feedId, String groupId, String artifactId, String version) throws AzDException Get information about a package version.- Specified by:
getPackageVersion
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".version
- Version of the package. Example: "1.0.0".- Returns:
- Package
Package
- Throws:
AzDException
- Default Api Exception handler.
-
getPackageVersion
public Package getPackageVersion(String feedId, String groupId, String artifactId, String version, boolean showDeleted) throws AzDException Get information about a package version.- Specified by:
getPackageVersion
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".version
- Version of the package. Example: "1.0.0".showDeleted
- True to show information for deleted versions- Returns:
- Package
Package
- Throws:
AzDException
- Default Api Exception handler.
-
getPackageVersionFromRecycleBin
public MavenPackageVersionDeletionState getPackageVersionFromRecycleBin(String feedId, String groupId, String artifactId, String version) throws AzDException Get information about a package version in the recycle bin.- Specified by:
getPackageVersionFromRecycleBin
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".version
- Version of the package. Example: "1.0.0".- Returns:
- MavenPackageVersionDeletionState
MavenPackageVersionDeletionState
- Throws:
AzDException
- Default Api Exception handler.
-
getUpstreamingBehavior
public UpstreamingBehavior getUpstreamingBehavior(String feedId, String groupId, String artifactId) throws AzDException Get the upstreaming behavior of a package within the context of a feed- Specified by:
getUpstreamingBehavior
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".- Returns:
- UpstreamingBehavior
UpstreamingBehavior
- Throws:
AzDException
- Default Api Exception handler.
-
downloadPackage
public InputStream downloadPackage(String feedId, String groupId, String artifactId, String version, String fileName) throws AzDException Fulfills Maven package file download requests by either returning the URL of the requested package file or, in the case of Azure DevOps Server (OnPrem),- Specified by:
downloadPackage
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".version
- Version of the package. Example: "1.0.0".fileName
- File name to download. Example: "app-1.0.0.jar".- Returns:
- Package content.
- Throws:
AzDException
- Default Api Exception handler.
-
deletePackageVersion
public void deletePackageVersion(String feedId, String groupId, String artifactId, String version) throws AzDException Delete a package version from the feed and move it to the feed's recycle bin.- Specified by:
deletePackageVersion
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".version
- Version of the package. Example: "1.0.0".- Throws:
AzDException
- Default Api Exception handler.
-
deletePackageVersionFromRecycleBin
public void deletePackageVersionFromRecycleBin(String feedId, String groupId, String artifactId, String version) throws AzDException Permanently delete a package from a feed's recycle bin.- Specified by:
deletePackageVersionFromRecycleBin
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".version
- Version of the package. Example: "1.0.0".- Throws:
AzDException
- Default Api Exception handler.
-
updatePackageVersion
public void updatePackageVersion(String feedId, String groupId, String artifactId, String version, PackagePromote promote) throws AzDException Set mutable state on a package version.(eg. prelease, release)- Specified by:
updatePackageVersion
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".version
- Version of the package. Example: "1.0.0".promote
- State of the package. Example: "prelease".PackagePromote
- Throws:
AzDException
- Default Api Exception handler.
-
updatePackageVersion
public void updatePackageVersion(String feedId, String groupId, String artifactId, String version, String promote) throws AzDException Set mutable state on a package version.(eg. prelease, release)- Specified by:
updatePackageVersion
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".version
- Version of the package. Example: "1.0.0".promote
- State of the package. Example: "prelease".- Throws:
AzDException
- Default Api Exception handler.
-
updatePackageVersions
public void updatePackageVersions(String feedId, String viewId, PackagesBatchOperation operation, List<Map<String, Object>> packages) throws AzDExceptionUpdate several packages from a single feed in a single request. The updates to the packages do not happen atomically.- Specified by:
updatePackageVersions
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".viewId
- Name of ID the view, packages need to be promoted to.operation
- Type of operation that needs to be performed on packages. supports only PROMOTE or DELETE.PackagesBatchOperation
.packages
- Identifies a particular Maven package versions- Throws:
AzDException
- Default Api Exception handler.
-
restorePackageVersionFromRecycleBin
public void restorePackageVersionFromRecycleBin(String feedId, String groupId, String artifactId, String version) throws AzDException Restore a package version from the recycle bin to its associated feed.- Specified by:
restorePackageVersionFromRecycleBin
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".version
- Version of the package. Example: "1.0.0".- Throws:
AzDException
- Default Api Exception handler.
-
setUpstreamingBehavior
public void setUpstreamingBehavior(String feedId, String groupId, String artifactId) throws AzDException Set the upstreaming behavior of a (scoped) package.- Specified by:
setUpstreamingBehavior
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".- Throws:
AzDException
- Default Api Exception handler.
-
setUpstreamingBehavior
public void setUpstreamingBehavior(String feedId, String groupId, String artifactId, String upstreamingBehavior) throws AzDException Set the upstreaming behavior of a (scoped) package.- Specified by:
setUpstreamingBehavior
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".- Throws:
AzDException
- Default Api Exception handler.
-
clearUpstreamingBehavior
public void clearUpstreamingBehavior(String feedId, String groupId, String artifactId) throws AzDException To clear the upstream behavior of a (scoped) package.- Specified by:
clearUpstreamingBehavior
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".- Throws:
AzDException
- Default Api Exception handler.
-
updateRecycleBinPackages
public void updateRecycleBinPackages(String feedId, PackagesBatchOperation operation, List<Map<String, Object>> packages) throws AzDExceptionDelete or restore several package versions from the recycle bin.- Specified by:
updateRecycleBinPackages
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".operation
- Type of operation that needs to be performed on packages. Recycle Bin supports only PERMANENTDELETE or RESTORETOFEED.PackagesBatchOperation
packages
- Identifies a particular Maven package versions- Throws:
AzDException
- Default Api Exception handler.
-
uploadPackage
public void uploadPackage(String feedId, String groupId, String artifactId, String version, String fileName, InputStream content) throws AzDException Fulfills Maven package file upload requests by either returning the URL of the requested package file or, in the case of Azure DevOps Server (OnPrem),- Specified by:
uploadPackage
in interfaceMavenDetails
- Parameters:
feedId
- Name or ID of the feed. Example: "mavenfeed".groupId
- Group ID of the package. Example: "com.example".artifactId
- Artifact ID of the package. Example: "app".version
- Version of the package. Example: "1.0.0".fileName
- File name to upoad. Must include artifactId Example: "app-1.0.0.jar".content
- Inputstream for the package file.- Throws:
AzDException
- Default Api Exception handler.
-