]> gerrit.simantics Code Review - simantics/interop.git/commitdiff
fixes #3420
authorkondelin <kondelin@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 27 Aug 2012 13:53:59 +0000 (13:53 +0000)
committerMarko Luukkainen <marko.luukkainen@vtt.fi>
Thu, 2 Feb 2017 09:22:21 +0000 (11:22 +0200)
git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@25521 ac1ea38d-2e2b-0410-8846-a27921b304fc

org.simantics.interop.mapping/src/org/simantics/interop/mapping/SplittingWriteGraph.java
org.simantics.interop.mapping/src/org/simantics/interop/mapping/WriteGraphProxy.java

index 791ab0a76d4278022481c6e1dac28f993178662f..c3b02988b5809da26fb5c2840d0f0a14371bcf5f 100644 (file)
@@ -453,8 +453,51 @@ public class SplittingWriteGraph implements WriteGraph {
                        throw new ServiceException(e);\r
                }\r
        }\r
-       \r
-       @Override\r
+\r
+    @Override\r
+    public Resource newResource(final Resource clusterSet) throws ServiceException {\r
+        try {\r
+            return session.syncRequest(new WriteResultRequest<Resource>() {\r
+                \r
+                @Override\r
+                public Resource perform(WriteGraph graph) throws DatabaseException {\r
+                    return graph.newResource(clusterSet);\r
+                }\r
+            });\r
+        } catch (DatabaseException e) {\r
+            throw new ServiceException(e);\r
+        }\r
+    }\r
+\r
+    @Override\r
+    public void newClusterSet(final Resource clusterSet) throws ServiceException {\r
+        try {\r
+            session.syncRequest(new WriteRequest() {\r
+                @Override\r
+                public void perform(WriteGraph graph) throws DatabaseException {\r
+                    graph.newClusterSet(clusterSet);\r
+                }\r
+            });\r
+        } catch (DatabaseException e) {\r
+            throw new ServiceException(e);\r
+        }\r
+    }\r
+\r
+    @Override\r
+    public Resource setClusterSet4NewResource(final Resource clusterSet) throws ServiceException {\r
+        try {\r
+            return session.syncRequest(new WriteResultRequest<Resource>() {\r
+                \r
+                @Override\r
+                public Resource perform(WriteGraph graph) throws DatabaseException {\r
+                    return graph.newResource(clusterSet);\r
+                }\r
+            });\r
+        } catch (DatabaseException e) {\r
+            throw new ServiceException(e);\r
+        }\r
+    }\r
+    @Override\r
        public <T> T adapt(final Resource resource, final Class<T> clazz)\r
                        throws AdaptionException, ValidationException, ServiceException {\r
                try {\r
index 204d8012a9f972434db20c7a2e6b6eaff84be4a4..1fff2a287f03a41f83172e99644a4991f7b51b70 100644 (file)
@@ -291,8 +291,23 @@ public class WriteGraphProxy implements WriteGraph {
        public Resource newResource(long clusterId) throws ServiceException {\r
                return graph.newResource(clusterId);\r
        }\r
-       \r
-       @Override\r
+\r
+    @Override\r
+    public Resource newResource(Resource clusterSet) throws ServiceException {\r
+        return graph.newResource(clusterSet);\r
+    }\r
+\r
+    @Override\r
+    public void newClusterSet(Resource clusterSet) throws ServiceException {\r
+        graph.newClusterSet(clusterSet);\r
+    }\r
+    \r
+\r
+    public Resource setClusterSet4NewResource(Resource clusterSet) throws ServiceException {\r
+        return graph.setClusterSet4NewResource(clusterSet);\r
+    }\r
+\r
+    @Override\r
        public <T> T adapt(Resource resource, Class<T> clazz)\r
                        throws AdaptionException, ValidationException, ServiceException {\r
                return graph.adapt(resource, clazz);\r