]> gerrit.simantics Code Review - simantics/interop.git/commitdiff
Fixed SplittingWriteGraph/WriteGraphProxy to work with WriteGraph/ReadGraph API addit...
authorlehtonen <lehtonen@ac1ea38d-2e2b-0410-8846-a27921b304fc>
Mon, 30 Jul 2012 09:33:01 +0000 (09:33 +0000)
committerMarko Luukkainen <marko.luukkainen@vtt.fi>
Thu, 2 Feb 2017 09:22:21 +0000 (11:22 +0200)
refs #3552

git-svn-id: https://www.simantics.org/svn/simantics/interoperability/trunk@25354 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 f8e5faea31b86deb45b17fd883067377ef52c3dc..a91c8c0b72eff08f3ecf195887967c716a04c870 100644 (file)
@@ -371,14 +371,20 @@ public class SplittingWriteGraph implements WriteGraph {
                });\r
        }\r
 \r
-    @Override\r
-    public RandomAccessBinary newLiteral4RandomAccessBinary\r
-    (final Resource resource, final Resource predicate, final Datatype datatype, final Object initialvalue)\r
-    throws DatabaseException {\r
+       public RandomAccessBinary createRandomAccessBinary(final Resource resource, final Resource predicate, final Datatype datatype, final Object initialValue) throws DatabaseException {\r
+        return session.syncRequest(new WriteResultRequest<RandomAccessBinary>() {\r
+            @Override\r
+            public RandomAccessBinary perform(WriteGraph graph) throws DatabaseException {\r
+                return graph.createRandomAccessBinary(resource, predicate, datatype, initialValue);\r
+            }\r
+        });\r
+    }\r
+\r
+    public RandomAccessBinary createRandomAccessBinary(final Resource resource, final Datatype datatype, final Object initialValue) throws DatabaseException {\r
         return session.syncRequest(new WriteResultRequest<RandomAccessBinary>() {\r
             @Override\r
             public RandomAccessBinary perform(WriteGraph graph) throws DatabaseException {\r
-                return graph.newLiteral4RandomAccessBinary(resource, predicate, datatype, initialvalue);\r
+                return graph.createRandomAccessBinary(resource, datatype, initialValue);\r
             }\r
         });\r
     }\r
@@ -2439,7 +2445,7 @@ public class SplittingWriteGraph implements WriteGraph {
                                \r
                                @Override\r
                                public Set<Resource> perform(ReadGraph graph) throws DatabaseException {\r
-               return graph.getSupertypes(subject);\r
+                                       return graph.getSupertypes(subject);\r
                                }\r
                        });\r
                } catch (DatabaseException e) {\r
@@ -2455,7 +2461,20 @@ public class SplittingWriteGraph implements WriteGraph {
                                \r
                                @Override\r
                                public Set<Resource> perform(ReadGraph graph) throws DatabaseException {\r
-               return graph.getSuperrelations(subject);\r
+                                       return graph.getSuperrelations(subject);\r
+                               }\r
+                       });\r
+               } catch (DatabaseException e) {\r
+                       throw new ServiceException(e);\r
+               }\r
+       }\r
+\r
+       public Resource getPossibleSuperrelation(final Resource subject) throws ServiceException {\r
+               try {\r
+                       return session.syncRequest(new Read<Resource>() {\r
+                               @Override\r
+                               public Resource perform(ReadGraph graph) throws DatabaseException {\r
+                                       return graph.getPossibleSuperrelation(subject);\r
                                }\r
                        });\r
                } catch (DatabaseException e) {\r
index f51407fc02a1ad9152377b72847fcbca2961e045..cefc7613c3b70f7a42ca8ea1d009c235b0db0815 100644 (file)
@@ -245,12 +245,19 @@ public class WriteGraphProxy implements WriteGraph {
                return graph.newLiteral(resource, predicate, datatype, initialValue);\r
        }\r
 \r
-    @Override\r
-    public RandomAccessBinary newLiteral4RandomAccessBinary\r
-    (Resource resource, Resource predicate, Datatype datatype, Object initialValue)\r
-    throws DatabaseException {\r
-        return graph.newLiteral4RandomAccessBinary(resource, predicate, datatype, initialValue);\r
-    }\r
+       @Override\r
+       public RandomAccessBinary createRandomAccessBinary(Resource resource,\r
+                       Resource predicate, Datatype datatype, Object initialValue)\r
+                       throws DatabaseException {\r
+               return graph.createRandomAccessBinary(resource, predicate, datatype, initialValue);\r
+       }\r
+       \r
+       @Override\r
+       public RandomAccessBinary createRandomAccessBinary(Resource resource,\r
+                       Datatype datatype, Object initialValue) throws DatabaseException {\r
+               return graph.createRandomAccessBinary(resource, datatype, initialValue);\r
+       }\r
+       \r
 //     @Override\r
 //     public void claimFile(Resource resource, Object content, Binding binding)\r
 //                     throws DatabaseException {\r
@@ -1199,6 +1206,12 @@ public class WriteGraphProxy implements WriteGraph {
                return graph.getSuperrelations(subject);\r
        }\r
 \r
+       @Override\r
+       public Resource getPossibleSuperrelation(Resource subject)\r
+                       throws ServiceException {\r
+               return graph.getPossibleSuperrelation(subject);\r
+       }\r
+\r
 //     @Override\r
 //     public Collection<Resource> getObjects(Resource subject,\r
 //                     Resource relation)\r