@Override public void create(RequestParams requestParams, Tenant tenant) { try { managerIdentityService.createTenant(requestParams.getBearerAuth(), tenant); } catch (ClientErrorException ex) { throw new WebApplicationException(ex.getCause(), ex.getResponse().getStatus()); } catch (Exception ex) { throw new WebApplicationException(ex); } }
@Override public Tenant get(RequestParams requestParams, String realm) { try { return managerIdentityService.getTenant(requestParams.getBearerAuth(), realm); } catch (ClientErrorException ex) { throw new WebApplicationException(ex.getCause(), ex.getResponse().getStatus()); } catch (Exception ex) { throw new WebApplicationException(ex); } }
@Override public void update(RequestParams requestParams, String realm, Tenant tenant) { ConstraintViolationReport violationReport; if ((violationReport = isIllegalMasterRealmMutation(realm, tenant)) != null) { throw new WebApplicationException( Response.status(BAD_REQUEST) .header(VIOLATION_EXCEPTION_HEADER, "true") .entity(violationReport) .build()); } try { managerIdentityService.updateTenant(requestParams.getBearerAuth(), realm, tenant); } catch (ClientErrorException ex) { throw new WebApplicationException(ex.getCause(), ex.getResponse().getStatus()); } catch (Exception ex) { throw new WebApplicationException(ex); } }