X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=org.simantics.interop.mapping%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fmapping%2FSplittingWriteGraph.java;h=fb2cbb56ff3e7bb1dae6274e0c4b97288e0a49e8;hb=cde15da71bdb1ccba37aa890fd9fbc2ba99bac58;hp=a91c8c0b72eff08f3ecf195887967c716a04c870;hpb=8b00e8b4094618aab8783242b061a9367ae02bc4;p=simantics%2Finterop.git diff --git a/org.simantics.interop.mapping/src/org/simantics/interop/mapping/SplittingWriteGraph.java b/org.simantics.interop.mapping/src/org/simantics/interop/mapping/SplittingWriteGraph.java index a91c8c0..fb2cbb5 100644 --- a/org.simantics.interop.mapping/src/org/simantics/interop/mapping/SplittingWriteGraph.java +++ b/org.simantics.interop.mapping/src/org/simantics/interop/mapping/SplittingWriteGraph.java @@ -453,8 +453,51 @@ public class SplittingWriteGraph implements WriteGraph { throw new ServiceException(e); } } - - @Override + + @Override + public Resource newResource(final Resource clusterSet) throws ServiceException { + try { + return session.syncRequest(new WriteResultRequest() { + + @Override + public Resource perform(WriteGraph graph) throws DatabaseException { + return graph.newResource(clusterSet); + } + }); + } catch (DatabaseException e) { + throw new ServiceException(e); + } + } + + @Override + public void newClusterSet(final Resource clusterSet) throws ServiceException { + try { + session.syncRequest(new WriteRequest() { + @Override + public void perform(WriteGraph graph) throws DatabaseException { + graph.newClusterSet(clusterSet); + } + }); + } catch (DatabaseException e) { + throw new ServiceException(e); + } + } + + @Override + public Resource setClusterSet4NewResource(final Resource clusterSet) throws ServiceException { + try { + return session.syncRequest(new WriteResultRequest() { + + @Override + public Resource perform(WriteGraph graph) throws DatabaseException { + return graph.newResource(clusterSet); + } + }); + } catch (DatabaseException e) { + throw new ServiceException(e); + } + } + @Override public T adapt(final Resource resource, final Class clazz) throws AdaptionException, ValidationException, ServiceException { try { @@ -6183,4 +6226,74 @@ public class SplittingWriteGraph implements WriteGraph { return null; } + @Override + public boolean isImmutable(final Resource resource) throws DatabaseException { + try { + return session.syncRequest(new Read() { + @Override + public Boolean perform(ReadGraph graph) throws DatabaseException { + return graph.isImmutable(resource); + } + }); + } catch (DatabaseException e) { + throw new ServiceException(e); + } + } + + @Override + public T getValue2(final Resource subject, final Object context) throws DatabaseException { + try { + return (T) session.syncRequest(new Read() { + @Override + public T perform(ReadGraph graph) throws DatabaseException { + return graph.getValue2(subject, context); + } + }); + } catch (DatabaseException e) { + throw new ServiceException(e); + } + } + + @Override + public T getPossibleValue2(final Resource subject, final Object context) throws DatabaseException { + try { + return (T) session.syncRequest(new Read() { + @Override + public T perform(ReadGraph graph) throws DatabaseException { + return graph.getPossibleValue2(subject, context); + } + }); + } catch (DatabaseException e) { + throw new ServiceException(e); + } + } + + @Override + public T getValue2(final Resource subject, final Object context, final Binding binding) throws DatabaseException { + try { + return (T) session.syncRequest(new Read() { + @Override + public T perform(ReadGraph graph) throws DatabaseException { + return graph.getValue2(subject, context, binding); + } + }); + } catch (DatabaseException e) { + throw new ServiceException(e); + } + } + + @Override + public T getPossibleValue2(final Resource subject, final Object context, final Binding binding) throws DatabaseException { + try { + return (T) session.syncRequest(new Read() { + @Override + public T perform(ReadGraph graph) throws DatabaseException { + return graph.getPossibleValue2(subject, context, binding); + } + }); + } catch (DatabaseException e) { + throw new ServiceException(e); + } + } + }