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
return null;\r
}\r
\r
+ @Override\r
+ public boolean isImmutable(final Resource resource) throws DatabaseException {\r
+ try {\r
+ return session.syncRequest(new Read<Boolean>() {\r
+ @Override\r
+ public Boolean perform(ReadGraph graph) throws DatabaseException {\r
+ return graph.isImmutable(resource);\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ throw new ServiceException(e);\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public <T> T getValue2(final Resource subject, final Object context) throws DatabaseException {\r
+ try {\r
+ return (T) session.syncRequest(new Read<T>() {\r
+ @Override\r
+ public T perform(ReadGraph graph) throws DatabaseException {\r
+ return graph.getValue2(subject, context);\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ throw new ServiceException(e);\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public <T> T getPossibleValue2(final Resource subject, final Object context) throws DatabaseException {\r
+ try {\r
+ return (T) session.syncRequest(new Read<T>() {\r
+ @Override\r
+ public T perform(ReadGraph graph) throws DatabaseException {\r
+ return graph.getPossibleValue2(subject, context);\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ throw new ServiceException(e);\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public <T> T getValue2(final Resource subject, final Object context, final Binding binding) throws DatabaseException {\r
+ try {\r
+ return (T) session.syncRequest(new Read<T>() {\r
+ @Override\r
+ public T perform(ReadGraph graph) throws DatabaseException {\r
+ return graph.getValue2(subject, context, binding);\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ throw new ServiceException(e);\r
+ }\r
+ }\r
+\r
+ @Override\r
+ public <T> T getPossibleValue2(final Resource subject, final Object context, final Binding binding) throws DatabaseException {\r
+ try {\r
+ return (T) session.syncRequest(new Read<T>() {\r
+ @Override\r
+ public T perform(ReadGraph graph) throws DatabaseException {\r
+ return graph.getPossibleValue2(subject, context, binding);\r
+ }\r
+ });\r
+ } catch (DatabaseException e) {\r
+ throw new ServiceException(e);\r
+ }\r
+ }\r
+\r
}\r