Exemplo n.º 1
0
 @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);
   }
 }
Exemplo n.º 2
0
 @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);
   }
 }
Exemplo n.º 3
0
 @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);
   }
 }