/** * Delete flowConfig locally and trigger all listeners iff @param triggerListener is set to true */ public UpdateResponse deleteFlowConfig(FlowId flowId, Properties header, boolean triggerListener) throws FlowConfigLoggedException { log.info("[GAAS-REST] Delete called with flowGroup {} flowName {}", flowId.getFlowGroup(), flowId.getFlowName()); URI flowUri = null; try { flowUri = createFlowSpecUri(flowId); this.flowCatalog.remove(flowUri, header, triggerListener); return new UpdateResponse(HttpStatus.S_200_OK); } catch (URISyntaxException e) { throw new FlowConfigLoggedException(HttpStatus.S_400_BAD_REQUEST, "bad URI " + flowUri, e); } }
/** * {@inheritDoc} * * @param result The result of a Rest.li UPDATE, PARTIAL_UPDATE, or DELETE method. It is a {@link UpdateResponse} * object. */ @Override @SuppressWarnings("unchecked") public D buildRestLiResponseData(Request request, RoutingResult routingResult, Object result, Map<String, String> headers, List<HttpCookie> cookies) { UpdateResponse updateResponse = (UpdateResponse) result; //Verify that the status in the UpdateResponse is not null. If so, this is a developer error. if (updateResponse.getStatus() == null) { throw new RestLiServiceException(HttpStatus.S_500_INTERNAL_SERVER_ERROR, "Unexpected null encountered. HttpStatus is null inside of a UpdateResponse returned by the resource method: " + routingResult.getResourceMethod()); } return buildResponseData(updateResponse.getStatus(), headers, cookies); }
batchResponseMap.put(finalKey, new BatchResponseEntry(entry.getValue().getStatus(), new UpdateStatus()));
/** * Update flowConfig locally and trigger all listeners iff @param triggerListener is set to true */ public UpdateResponse updateFlowConfig(FlowId flowId, FlowConfig flowConfig, boolean triggerListener) { log.info("[GAAS-REST] Update called with flowGroup {} flowName {}", flowId.getFlowGroup(), flowId.getFlowName()); if (!flowId.getFlowGroup().equals(flowConfig.getId().getFlowGroup()) || !flowId.getFlowName().equals(flowConfig.getId().getFlowName())) { throw new FlowConfigLoggedException(HttpStatus.S_400_BAD_REQUEST, "flowName and flowGroup cannot be changed in update", null); } this.flowCatalog.put(createFlowSpecForConfig(flowConfig), triggerListener); return new UpdateResponse(HttpStatus.S_200_OK); }
return new UpdateResponse(HttpStatus.S_200_OK); } else { return this.localHandler.updateFlowConfig(flowId, flowConfig);
return new UpdateResponse(HttpStatus.S_200_OK); } else { return this.localHandler.deleteFlowConfig(flowId, header);
@Override UpdateResponse buildResponse() { return new UpdateResponse(HttpStatus.S_200_OK); } });
@Override public UpdateResponse update(Integer id, PatchRequest<GroupContact> request) { return new UpdateResponse(S_204_NO_CONTENT); }
@Override UpdateResponse buildResponse() { return new UpdateResponse(HttpStatus.S_200_OK); } });
/** * Deletes the greeting. */ @Override public UpdateResponse delete() { GREETING = null; return new UpdateResponse(HttpStatus.S_204_NO_CONTENT); }
@Override public UpdateResponse delete(Integer id) { return new UpdateResponse(S_204_NO_CONTENT); }
/** * Updates the greeting. */ @Override public UpdateResponse update(Greeting greeting) { GREETING = greeting; return new UpdateResponse(HttpStatus.S_204_NO_CONTENT); }
@Override UpdateResponse buildResponse() { return new UpdateResponse(HttpStatus.S_200_OK); } });
@Override public UpdateResponse update(final Long key, final Greeting entity) { return new UpdateResponse(HttpStatus.S_404_NOT_FOUND); }
@Override public UpdateResponse update(final ComplexResourceKey<TwoPartKey, TwoPartKey> key, final PatchRequest<Message> patch) { try { _dataProvider.partialUpdate(key, patch); } catch(DataProcessingException e) { return new UpdateResponse(HttpStatus.S_400_BAD_REQUEST); } return new UpdateResponse(HttpStatus.S_204_NO_CONTENT); }
@RestMethod.Update public UpdateResponse update(String key, Message entity) { Message g = _db.get(key); if (g == null) { return new UpdateResponse(HttpStatus.S_404_NOT_FOUND); } _db.put(key, entity); return new UpdateResponse(HttpStatus.S_204_NO_CONTENT); }
@RestMethod.Update public UpdateResponse update(Long key, Greeting entity) { Greeting g = _db.get(key); if (g == null) { return new UpdateResponse(HttpStatus.S_404_NOT_FOUND); } _db.put(key, entity); return new UpdateResponse(HttpStatus.S_204_NO_CONTENT); }
private BatchUpdateResult<Object, RecordTemplatePlaceholder> createBatchUpdateResult(Object id1, Object id2) { Map<Object, UpdateResponse> buResponseData = new HashMap<Object, UpdateResponse>(); buResponseData.put(id1, new UpdateResponse(HttpStatus.S_200_OK)); buResponseData.put(id2, new UpdateResponse(HttpStatus.S_200_OK)); return new BatchUpdateResult<Object, RecordTemplatePlaceholder>(buResponseData); }
/** * Updates the greeting. */ @Override public UpdateResponse update(PatchRequest<Greeting> patchRequest) { try { PatchApplier.applyPatch(GREETING, patchRequest); } catch(DataProcessingException e) { return new UpdateResponse(HttpStatus.S_400_BAD_REQUEST); } return new UpdateResponse(HttpStatus.S_204_NO_CONTENT); }