Search in sources :

Example 1 with PackageType

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()));
    }
}
Also used : PackageType(org.apache.pulsar.packages.management.core.common.PackageType) RestException(org.apache.pulsar.broker.web.RestException)

Example 2 with PackageType

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()));
    }
}
Also used : PackageType(org.apache.pulsar.packages.management.core.common.PackageType) RestException(org.apache.pulsar.broker.web.RestException)

Example 3 with PackageType

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()));
    }
}
Also used : PackageType(org.apache.pulsar.packages.management.core.common.PackageType) RestException(org.apache.pulsar.broker.web.RestException)

Aggregations

RestException (org.apache.pulsar.broker.web.RestException)3 PackageType (org.apache.pulsar.packages.management.core.common.PackageType)3