/** * @param error */ private void error(StorageException error) { logger.error(error); throw new RuntimeException(error); }
log.error(e);
log.error(e);
log.error(e);
log.error(e);
logger.error(t); dispatcher.cancel(); } finally {
rval.setErrors(response.getAggregations().getFilterAggregation("total_errors").getCount()); } catch (IOException e) { log.error(e);
/** * @see io.apiman.manager.api.rest.contract.IOrganizationResource#createClientPolicy(java.lang.String, java.lang.String, java.lang.String, io.apiman.manager.api.beans.policies.NewPolicyBean) */ @Override public PolicyBean createClientPolicy(String organizationId, String clientId, String version, NewPolicyBean bean) throws OrganizationNotFoundException, ClientVersionNotFoundException, NotAuthorizedException { if (!securityContext.hasPermission(PermissionType.clientEdit, organizationId)) throw ExceptionFactory.notAuthorizedException(); // Make sure the Client exists ClientVersionBean cvb = getClientVersion(organizationId, clientId, version); PolicyBean policy = doCreatePolicy(organizationId, clientId, version, bean, PolicyType.Client); try { storage.beginTx(); cvb.setModifiedBy(securityContext.getCurrentUser()); cvb.setModifiedOn(new Date()); storage.commitTx(); } catch (Exception e) { storage.rollbackTx(); log.error(e); } return policy; }
rval.setErrors(response.getAggregations().getFilterAggregation("total_errors").getCount()); } catch (IOException e) { log.error(e);
log.error(e);
/** * @see io.apiman.manager.api.rest.contract.IOrganizationResource#createPlanPolicy(java.lang.String, * java.lang.String, java.lang.String, io.apiman.manager.api.beans.policies.NewPolicyBean) */ @Override public PolicyBean createPlanPolicy(String organizationId, String planId, String version, NewPolicyBean bean) throws OrganizationNotFoundException, PlanVersionNotFoundException, NotAuthorizedException { if (!securityContext.hasPermission(PermissionType.planEdit, organizationId)) throw ExceptionFactory.notAuthorizedException(); // Make sure the plan version exists and is in the right state PlanVersionBean pvb = getPlanVersion(organizationId, planId, version); if (pvb.getStatus() == PlanStatus.Locked) { throw ExceptionFactory.invalidPlanStatusException(); } log.debug(String.format("Creating plan %s policy %s", planId, pvb)); //$NON-NLS-1$ PolicyBean policy = doCreatePolicy(organizationId, planId, version, bean, PolicyType.Plan); try { storage.beginTx(); pvb.setModifiedOn(new Date()); pvb.setModifiedBy(securityContext.getCurrentUser()); storage.commitTx(); } catch (Exception e) { storage.rollbackTx(); log.error(e); } return policy; }
/** * @see io.apiman.manager.api.rest.contract.IOrganizationResource#createClientPolicy(java.lang.String, java.lang.String, java.lang.String, io.apiman.manager.api.beans.policies.NewPolicyBean) */ @Override public PolicyBean createClientPolicy(String organizationId, String clientId, String version, NewPolicyBean bean) throws OrganizationNotFoundException, ClientVersionNotFoundException, NotAuthorizedException { if (!securityContext.hasPermission(PermissionType.clientEdit, organizationId)) throw ExceptionFactory.notAuthorizedException(); // Make sure the Client exists ClientVersionBean cvb = getClientVersion(organizationId, clientId, version); PolicyBean policy = doCreatePolicy(organizationId, clientId, version, bean, PolicyType.Client); try { storage.beginTx(); cvb.setModifiedBy(securityContext.getCurrentUser()); cvb.setModifiedOn(new Date()); storage.commitTx(); } catch (Exception e) { storage.rollbackTx(); log.error(e); } return policy; }
/** * @see io.apiman.manager.api.rest.contract.IOrganizationResource#createPlanPolicy(java.lang.String, * java.lang.String, java.lang.String, io.apiman.manager.api.beans.policies.NewPolicyBean) */ @Override public PolicyBean createPlanPolicy(String organizationId, String planId, String version, NewPolicyBean bean) throws OrganizationNotFoundException, PlanVersionNotFoundException, NotAuthorizedException { if (!securityContext.hasPermission(PermissionType.planEdit, organizationId)) throw ExceptionFactory.notAuthorizedException(); // Make sure the plan version exists and is in the right state PlanVersionBean pvb = getPlanVersion(organizationId, planId, version); if (pvb.getStatus() == PlanStatus.Locked) { throw ExceptionFactory.invalidPlanStatusException(); } log.debug(String.format("Creating plan %s policy %s", planId, pvb)); //$NON-NLS-1$ PolicyBean policy = doCreatePolicy(organizationId, planId, version, bean, PolicyType.Plan); try { storage.beginTx(); pvb.setModifiedOn(new Date()); pvb.setModifiedBy(securityContext.getCurrentUser()); storage.commitTx(); } catch (Exception e) { storage.rollbackTx(); log.error(e); } return policy; }
} catch (Exception e) { storage.rollbackTx(); log.error(e);
} catch (Exception e) { storage.rollbackTx(); log.error(e);
storage.updateApiDefinition(newVersion, definition); } catch (Exception e) { log.error("Unable to store API definition from: " + bean.getDefinitionUrl(), e); //$NON-NLS-1$ } finally { IOUtils.closeQuietly(definition);
log.error("Unable to create response", sdnfe); //$NON-NLS-1$ } finally { IOUtils.closeQuietly(definition);