@Override
    public ApiVersionBean getApiVersion(String organizationId, String apiId, String version)
            throws ApiVersionNotFoundException, NotAuthorizedException {
        boolean hasPermission = securityContext.hasPermission(PermissionType.apiView, organizationId);
        try {
            storage.beginTx();
            ApiVersionBean apiVersion = storage.getApiVersion(organizationId, apiId, version);
            if (apiVersion == null) {
                throw ExceptionFactory.apiVersionNotFoundException(apiId, version);
            }
            storage.commitTx();
            if (!hasPermission) {
                apiVersion.setGateways(null);
            }
            decryptEndpointProperties(apiVersion);
            return apiVersion;
        } catch (AbstractRestException e) {
            storage.rollbackTx();
            throw e;
        } catch (Exception e) {
            storage.rollbackTx();
            throw new SystemErrorException(e);
        }
    }
@ Override public ApiVersionBean getApiVersion ( String organizationId , String apiId , String version ) throws ApiVersionNotFoundException , NotAuthorizedException { boolean hasPermission = securityContext . hasPermission ( PermissionType . apiView , organizationId ) ; try { storage . beginTx ( ) ; ApiVersionBean apiVersion = storage . getApiVersion ( organizationId , apiId , version ) ; if ( apiVersion == null ) { throw ExceptionFactory . apiVersionNotFoundException ( apiId , version ) ; } storage . commitTx ( ) ; if ( ! hasPermission ) { apiVersion . setGateways ( null ) ; } decryptEndpointProperties ( apiVersion ) ; return apiVersion ; } catch ( AbstractRestException e ) { storage . rollbackTx ( ) ; throw e ; } catch ( Exception e ) { storage . rollbackTx ( ) ; throw new SystemErrorException ( e ) ; } }
@see io.apiman.manager.api.rest.contract.IOrganizationResource#getApiVersion(java.lang.String, java.lang.String, java.lang.String)