public SingularityCreateResult update(SingularityRequest request, Optional<String> user) {
return save(request, getRequest(request.getId()).get().getState(), RequestHistoryType.UPDATED, user);
}
private SingularityCreateResult save(SingularityRequest request, RequestState state, RequestHistoryType eventType, Optional<String> user) {
saveHistory(new SingularityRequestHistory(System.currentTimeMillis(), user, eventType, request));
return save(getRequestPath(request.getId()), new SingularityRequestWithState(request, state), requestTranscoder);
}