return db.tx(() -> Single.just(element.v1().transformToRestSync(ac, 0, element.v2()))); }).collect(() -> listResponse.getData(), (x, y) -> { x.add(y);
/** * Read the element with the given element by loading it from the specified root vertex. * * @param ac * @param uuid * Uuid of the element which should be loaded * @param handler * Handler which provides the root vertex which should be used when loading the element * @param perm * Permission to check against when loading the element */ public <T extends MeshCoreVertex<RM, T>, RM extends RestModel> void readElement(InternalActionContext ac, String uuid, TxAction1<RootVertex<T>> handler, GraphPermission perm) { asyncTx(ac, (tx) -> { RootVertex<T> root = handler.handle(); T element = root.loadObjectByUuid(ac, uuid, perm); // Handle etag if (ac.getGenericParameters().getETag()) { String etag = element.getETag(ac); ac.setEtag(etag, true); if (ac.matches(etag, true)) { throw new NotModifiedException(); } } return element.transformToRestSync(ac, 0); }, (model) -> ac.send(model, OK)); }
RM model = updateElement.transformToRestSync(ac, 0); info = new ResultInfo(model, b); if (isUpdated) { RM model = createdElement.transformToRestSync(ac, 0); String path = createdElement.getAPIPath(ac); info = new ResultInfo(model, b);