Exemplo n.º 1
0
  private Response insertTenantKey(
      final TenantKey key,
      @Nullable final String keyPostfix,
      final String value,
      final UriInfo uriInfo,
      final String getMethodStr,
      final String createdBy,
      final String reason,
      final String comment,
      final HttpServletRequest request)
      throws TenantApiException {
    final CallContext callContext = context.createContext(createdBy, reason, comment, request);
    final String tenantKey = keyPostfix != null ? key.toString() + keyPostfix : key.toString();
    tenantApi.addTenantKeyValue(tenantKey, value, callContext);

    return uriBuilder.buildResponse(uriInfo, TenantResource.class, getMethodStr, keyPostfix);
  }
Exemplo n.º 2
0
 @TimedResource
 @POST
 @Path("/" + USER_KEY_VALUE + "/{keyName:" + ANYTHING_PATTERN + "}")
 @Consumes(TEXT_PLAIN)
 @Produces(APPLICATION_JSON)
 @ApiOperation(value = "Add a per tenant user key/value")
 @ApiResponses(value = {@ApiResponse(code = 400, message = "Invalid tenantId supplied")})
 public Response insertUserKeyValue(
     @PathParam("keyName") final String key,
     final String value,
     @HeaderParam(HDR_CREATED_BY) final String createdBy,
     @HeaderParam(HDR_REASON) final String reason,
     @HeaderParam(HDR_COMMENT) final String comment,
     @javax.ws.rs.core.Context final HttpServletRequest request,
     @javax.ws.rs.core.Context final UriInfo uriInfo)
     throws TenantApiException {
   final CallContext callContext = context.createContext(createdBy, reason, comment, request);
   tenantApi.addTenantKeyValue(key, value, callContext);
   return uriBuilder.buildResponse(uriInfo, TenantResource.class, "getUserKeyValue", key);
 }