/** * 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)); }