use of org.apache.pulsar.packages.management.core.common.PackageType in project pulsar by apache.
the class PackagesBase method internalListPackages.
protected void internalListPackages(String type, String tenant, String namespace, AsyncResponse asyncResponse) {
try {
PackageType packageType = PackageType.getEnum(type);
checkPermissions(tenant, namespace).thenCompose(ignore -> getPackagesManagement().list(packageType, tenant, namespace)).thenAccept(asyncResponse::resume).exceptionally(e -> handleError(e.getCause(), asyncResponse));
} catch (IllegalArgumentException iae) {
asyncResponse.resume(new RestException(Response.Status.PRECONDITION_FAILED, iae.getMessage()));
}
}
use of org.apache.pulsar.packages.management.core.common.PackageType in project pulsar by yahoo.
the class PackagesBase method internalListPackages.
protected void internalListPackages(String type, String tenant, String namespace, AsyncResponse asyncResponse) {
try {
PackageType packageType = PackageType.getEnum(type);
checkPermissions(tenant, namespace).thenCompose(ignore -> getPackagesManagement().list(packageType, tenant, namespace)).thenAccept(asyncResponse::resume).exceptionally(e -> handleError(e.getCause(), asyncResponse));
} catch (IllegalArgumentException iae) {
asyncResponse.resume(new RestException(Response.Status.PRECONDITION_FAILED, iae.getMessage()));
}
}
use of org.apache.pulsar.packages.management.core.common.PackageType in project incubator-pulsar by apache.
the class PackagesBase method internalListPackages.
protected void internalListPackages(String type, String tenant, String namespace, AsyncResponse asyncResponse) {
try {
PackageType packageType = PackageType.getEnum(type);
checkPermissions(tenant, namespace).thenCompose(ignore -> getPackagesManagement().list(packageType, tenant, namespace)).thenAccept(asyncResponse::resume).exceptionally(e -> handleError(e.getCause(), asyncResponse));
} catch (IllegalArgumentException iae) {
asyncResponse.resume(new RestException(Response.Status.PRECONDITION_FAILED, iae.getMessage()));
}
}
Aggregations