use of io.apiman.manager.api.rest.exceptions.InvalidApiStatusException in project apiman by apiman.
the class OrganizationResourceImpl method getApiVersionEndpointInfo.
/**
* @see IOrganizationResource#getApiVersionEndpointInfo(java.lang.String, java.lang.String, java.lang.String)
*/
@Override
public ApiVersionEndpointSummaryBean getApiVersionEndpointInfo(String organizationId, String apiId, String version) throws ApiVersionNotFoundException, InvalidApiStatusException {
// No permission check is needed, because this would break All APIs UI
try {
storage.beginTx();
ApiVersionBean apiVersion = getApiVersionFromStorage(organizationId, apiId, version);
if (apiVersion.getStatus() != ApiStatus.Published) {
// $NON-NLS-1$
throw new InvalidApiStatusException(Messages.i18n.format("ApiNotPublished"));
}
ApiVersionEndpointSummaryBean rval = getApiVersionEndpointInfoFromStorage(apiVersion, organizationId, apiId, version);
storage.commitTx();
return rval;
} catch (AbstractRestException e) {
storage.rollbackTx();
throw e;
} catch (Exception e) {
storage.rollbackTx();
throw new SystemErrorException(e);
}
}
Aggregations