forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the packages management administration opeartions. (apache#…
…8816) --- Master Issue: apache#8676 *Motivation* Introduce the pulsar admin operations with packages management service. *Modifications* - Add the admin API for packages management service. This only has client-side code. Will add integration tests when server-side code is merged.
- Loading branch information
Showing
4 changed files
with
451 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
166 changes: 166 additions & 0 deletions
166
pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Packages.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.apache.pulsar.client.admin; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.CompletableFuture; | ||
import org.apache.pulsar.packages.management.core.common.PackageMetadata; | ||
|
||
/** | ||
* Administration operations of the packages management service. | ||
*/ | ||
public interface Packages { | ||
/** | ||
* Get a package metadata information. | ||
* | ||
* @param packageName | ||
* the package name of the package metadata you want to find | ||
* @return the package metadata information | ||
*/ | ||
PackageMetadata getMetadata(String packageName) throws PulsarAdminException; | ||
|
||
/** | ||
* Get a package metadata information asynchronously. | ||
* | ||
* @param packageName | ||
* the package name of the package metadata you want to find | ||
* @return the package metadata information | ||
*/ | ||
CompletableFuture<PackageMetadata> getMetadataAsync(String packageName); | ||
|
||
/** | ||
* Update a package metadata information. | ||
* | ||
* @param packageName | ||
* the package name of the package metadata you want to update | ||
* @param metadata | ||
* the updated metadata information | ||
*/ | ||
void updateMetadata(String packageName, PackageMetadata metadata) throws PulsarAdminException; | ||
|
||
/** | ||
* Update a package metadata information asynchronously. | ||
* | ||
* @param packageName | ||
* the package name of the package metadata you want to update | ||
* @param metadata | ||
* the updated metadata information | ||
* @return nothing | ||
*/ | ||
CompletableFuture<Void> updateMetadataAsync(String packageName, PackageMetadata metadata); | ||
|
||
/** | ||
* Upload a package to the package management service. | ||
* | ||
* @param packageName | ||
* the package name of the upload file | ||
* @param path | ||
* the upload file path | ||
*/ | ||
void upload(PackageMetadata metadata, String packageName, String path) throws PulsarAdminException; | ||
|
||
/** | ||
* Upload a package to the package management service asynchronously. | ||
* | ||
* @param packageName | ||
* the package name you want to upload | ||
* @param path | ||
* the path you want to upload from | ||
* @return nothing | ||
*/ | ||
CompletableFuture<Void> uploadAsync(PackageMetadata metadata, String packageName, String path); | ||
|
||
/** | ||
* Download a package from the package management service. | ||
* | ||
* @param packageName | ||
* the package name you want to download | ||
* @param path | ||
* the path you want to download to | ||
*/ | ||
void download(String packageName, String path) throws PulsarAdminException; | ||
|
||
/** | ||
* Download a package from the package management service asynchronously. | ||
* | ||
* @param packageName | ||
* the package name you want to download | ||
* @param path | ||
* the path you want to download to | ||
* @return nothing | ||
*/ | ||
CompletableFuture<Void> downloadAsync(String packageName, String path); | ||
|
||
/** | ||
* Delete the specified package. | ||
* | ||
* @param packageName | ||
* the package name which you want to delete | ||
*/ | ||
void delete(String packageName) throws PulsarAdminException; | ||
|
||
/** | ||
* Delete the specified package asynchronously. | ||
* | ||
* @param packageName | ||
* the package name which you want to delete | ||
* @return nothing | ||
*/ | ||
CompletableFuture<Void> deleteAsync(String packageName); | ||
|
||
/** | ||
* List all the versions of a package. | ||
* | ||
* @param packageName | ||
* the package name which you want to get all the versions | ||
* @return all the versions of the package | ||
*/ | ||
List<String> listPackageVersions(String packageName) throws PulsarAdminException; | ||
|
||
/** | ||
* List all the versions of a package asynchronously. | ||
* | ||
* @param packageName | ||
* the package name which you want to get all the versions | ||
* @return all the versions of the package | ||
*/ | ||
CompletableFuture<List<String>> listPackageVersionsAsync(String packageName); | ||
|
||
/** | ||
* List all the packages with the given type in a namespace. | ||
* | ||
* @param type | ||
* the type you want to get the packages | ||
* @param namespace | ||
* the namespace you want to get the packages | ||
* @return all the packages of the given type which in the given namespace | ||
*/ | ||
|
||
List<String> listPackages(String type, String namespace) throws PulsarAdminException; | ||
/** | ||
* List all the packages with the given type in a namespace asynchronously. | ||
* | ||
* @param type | ||
* the type you want to get the packages | ||
* @param namespace | ||
* the namespace you want to get the packages | ||
* @return all the packages of the given type which in the given namespace | ||
*/ | ||
CompletableFuture<List<String>> listPackagesAsync(String type, String namespace); | ||
} |
Oops, something went wrong.