/** * 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); } }
/** * 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); } });
@RestMethod.Update public UpdateResponse update(final Integer key, final ValidationDemo entity) { return new UpdateResponse(HttpStatus.S_204_NO_CONTENT); }
public void run() { result.done(new UpdateResponse(HttpStatus.S_200_OK)); } };
@Override public BatchUpdateResult<CompoundKey, Greeting> batchUpdate(BatchUpdateRequest<CompoundKey, Greeting> entities) { Set<CompoundKey> keys = entities.getData().keySet(); Map<CompoundKey, UpdateResponse> responseMap = new HashMap<CompoundKey, UpdateResponse>(); Map<CompoundKey, RestLiServiceException> errorMap = new HashMap<CompoundKey, RestLiServiceException>(); for(CompoundKey key : keys) { responseMap.put(key, new UpdateResponse(HttpStatus.S_201_CREATED)); } return new BatchUpdateResult<CompoundKey, Greeting>(responseMap); }
@Override public BatchUpdateResult<CustomLong, Greeting> batchUpdate(BatchPatchRequest<CustomLong, Greeting> entityUpdates) { Map<CustomLong, UpdateResponse> results = new HashMap<CustomLong, UpdateResponse>(); for (CustomLong id: entityUpdates.getData().keySet()) { results.put(id, new UpdateResponse(HttpStatus.S_204_NO_CONTENT)); } return new BatchUpdateResult<CustomLong, Greeting>(results); }
@Override public BatchUpdateResult<CompoundKey, Greeting> batchUpdate(BatchUpdateRequest<CompoundKey, Greeting> entities) { Set<CompoundKey> keys = entities.getData().keySet(); Map<CompoundKey, UpdateResponse> responseMap = new HashMap<CompoundKey, UpdateResponse>(); Map<CompoundKey, RestLiServiceException> errorMap = new HashMap<CompoundKey, RestLiServiceException>(); for(CompoundKey key : keys) { responseMap.put(key, new UpdateResponse(HttpStatus.S_201_CREATED)); } return new BatchUpdateResult<CompoundKey, Greeting>(responseMap); }
@Override public BatchUpdateResult<CustomLong, Greeting> batchDelete(BatchDeleteRequest<CustomLong, Greeting> ids) { Map<CustomLong, UpdateResponse> results = new HashMap<CustomLong, UpdateResponse>(); for (CustomLong id: ids.getKeys()) { results.put(id, new UpdateResponse(HttpStatus.S_204_NO_CONTENT)); } return new BatchUpdateResult<CustomLong, Greeting>(results); }
@Override public void delete(String key, @CallbackParam Callback<UpdateResponse> callback) { callback.onSuccess(new UpdateResponse(HttpStatus.S_200_OK)); } }
@Override public void delete(@CallbackParam Callback<UpdateResponse> callback) { callback.onSuccess(new UpdateResponse(HttpStatus.S_200_OK)); } }
@Override public void delete(CompoundKey key, @CallbackParam Callback<UpdateResponse> callback) { callback.onSuccess(new UpdateResponse(HttpStatus.S_200_OK)); } }
public BatchUpdateResult<ComplexResourceKey<TwoPartKey, TwoPartKey>, Message> batchDelete( BatchDeleteRequest<ComplexResourceKey<TwoPartKey, TwoPartKey>, Message> ids) { final Map<ComplexResourceKey<TwoPartKey, TwoPartKey>, UpdateResponse> results = new HashMap<ComplexResourceKey<TwoPartKey, TwoPartKey>, UpdateResponse>(); for (ComplexResourceKey<TwoPartKey, TwoPartKey> id : ids.getKeys()) { _db.remove(keyToString(id.getKey())); results.put(id, new UpdateResponse(HttpStatus.S_204_NO_CONTENT)); } return new BatchUpdateResult<ComplexResourceKey<TwoPartKey, TwoPartKey>, Message>(results); }
/** * Updates the greeting. */ @Override public UpdateResponse update(Greeting greeting) { Long key = this.getContext().getPathKeys().get("subgreetingsId"); TONES.put(key, greeting.getTone()); return new UpdateResponse(HttpStatus.S_204_NO_CONTENT); }
/** * @see AssociationResource#delete */ @Override public UpdateResponse delete(ComplexResourceKey<GroupMembershipKey, GroupMembershipParam> id) { boolean deleted = _app.getMembershipMgr().delete(complexKeyToCompoundKey(id)); return new UpdateResponse(deleted ? S_204_NO_CONTENT : S_404_NOT_FOUND); }
@Override public void update(CompoundKey key, @UnstructuredDataReactiveReaderParam UnstructuredDataReactiveReader reader, @CallbackParam final Callback<UpdateResponse> responseCallback) { reader.getEntityStream().setReader(new GreetingUnstructuredDataReader<UpdateResponse>(responseCallback) { @Override UpdateResponse buildResponse() { return new UpdateResponse(HttpStatus.S_200_OK); } }); }