Package org.azd.maven

Class MavenApi

All Implemented Interfaces:
MavenDetails

public class MavenApi extends AzDAsyncApi<MavenApi> implements MavenDetails
MavenApi class to manage maven artifact package api
  • Constructor Details

    • MavenApi

      public MavenApi(Connection connection)
      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 interface MavenDetails
      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 interface MavenDetails
      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 interface MavenDetails
      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 interface MavenDetails
      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 interface MavenDetails
      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 interface MavenDetails
      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 interface MavenDetails
      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 interface MavenDetails
      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 interface MavenDetails
      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 AzDException
      Update several packages from a single feed in a single request. The updates to the packages do not happen atomically.
      Specified by:
      updatePackageVersions in interface MavenDetails
      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 interface MavenDetails
      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 interface MavenDetails
      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 interface MavenDetails
      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 interface MavenDetails
      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 AzDException
      Delete or restore several package versions from the recycle bin.
      Specified by:
      updateRecycleBinPackages in interface MavenDetails
      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 interface MavenDetails
      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.