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
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