-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- * VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.db.impl.graph;\r
-\r
-import org.simantics.db.MetadataI;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.VirtualGraph;\r
-import org.simantics.db.WriteGraph;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.exception.ServiceException;\r
-import org.simantics.db.request.Write;\r
-import org.simantics.db.request.WriteOnly;\r
-import org.simantics.db.request.WriteResult;\r
-import org.simantics.db.request.WriteTraits;\r
-import org.simantics.db.service.ByteReader;\r
-\r
-public interface WriteSupport extends MetadataI {\r
- \r
- void claim(VirtualGraph provider, int subject, int predicate, int object)\r
- throws ServiceException;\r
-\r
- void claim(VirtualGraph provider, Resource subject, Resource predicate, Resource object)\r
- throws ServiceException;\r
-\r
- boolean removeStatement(VirtualGraph provider, Resource subject, Resource predicate, Resource object)\r
- throws ServiceException;\r
- \r
- void claimValue(VirtualGraph provider, int resource, byte[] value, int length) throws DatabaseException;\r
- void claimValue(VirtualGraph provider, Resource resource, byte[] value) throws DatabaseException;\r
- void claimValue(VirtualGraph provider, Resource resource, ByteReader reader, int amount) throws DatabaseException;\r
- \r
- void denyValue(VirtualGraph provider, Resource resource) throws ServiceException;\r
-\r
- void setValue(VirtualGraph provider, Resource resource, byte[] value) throws ServiceException;\r
- \r
- Resource createResource(VirtualGraph provider)\r
- throws DatabaseException;\r
- \r
- Resource createResource(VirtualGraph provider, long clusterId)\r
- throws DatabaseException;\r
-\r
- Resource createResource(VirtualGraph provider, Resource clusterSet)\r
- throws DatabaseException;\r
-\r
- void createClusterSet(VirtualGraph provider, Resource clusterSet)\r
- throws DatabaseException;\r
-\r
- boolean hasClusterSet(VirtualGraph provider, Resource clusterSet)\r
- throws ServiceException;\r
-\r
- Resource setDefaultClusterSet(Resource clusterSet)\r
- throws ServiceException;\r
-\r
- void performWriteRequest(WriteGraph graph, Write request) throws DatabaseException; \r
- <T> T performWriteRequest(WriteGraph graph, WriteResult<T> request) throws DatabaseException; \r
- void performWriteRequest(WriteGraph graph, WriteOnly request) throws DatabaseException; \r
- \r
- boolean writeOnly();\r
-\r
- void flush(boolean intermediate);\r
- void flushCluster();\r
- void flushCluster(Resource r);\r
-\r
- void gc();\r
- \r
- void commitDone(WriteTraits writeTraits, long csid);\r
- void clearUndoList(WriteTraits writeTraits);\r
- void startUndo();\r
- /**\r
- * @return size of meta data before clearing.\r
- */\r
- int clearMetadata();\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.db.impl.graph;
+
+import org.simantics.db.MetadataI;
+import org.simantics.db.Resource;
+import org.simantics.db.VirtualGraph;
+import org.simantics.db.WriteGraph;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.exception.ServiceException;
+import org.simantics.db.request.Write;
+import org.simantics.db.request.WriteOnly;
+import org.simantics.db.request.WriteResult;
+import org.simantics.db.request.WriteTraits;
+import org.simantics.db.service.ByteReader;
+
+public interface WriteSupport extends MetadataI {
+
+ void claim(VirtualGraph provider, int subject, int predicate, int object)
+ throws ServiceException;
+
+ void claim(VirtualGraph provider, Resource subject, Resource predicate, Resource object)
+ throws ServiceException;
+
+ boolean removeStatement(VirtualGraph provider, Resource subject, Resource predicate, Resource object)
+ throws ServiceException;
+
+ void claimValue(VirtualGraph provider, int resource, byte[] value, int length) throws DatabaseException;
+ void claimValue(VirtualGraph provider, Resource resource, byte[] value) throws DatabaseException;
+ void claimValue(VirtualGraph provider, Resource resource, ByteReader reader, int amount) throws DatabaseException;
+
+ void denyValue(VirtualGraph provider, Resource resource) throws ServiceException;
+
+ void setValue(VirtualGraph provider, Resource resource, byte[] value) throws ServiceException;
+
+ Resource createResource(VirtualGraph provider)
+ throws DatabaseException;
+
+ Resource createResource(VirtualGraph provider, long clusterId)
+ throws DatabaseException;
+
+ Resource createResource(VirtualGraph provider, Resource clusterSet)
+ throws DatabaseException;
+
+ void createClusterSet(VirtualGraph provider, Resource clusterSet)
+ throws DatabaseException;
+
+ boolean hasClusterSet(VirtualGraph provider, Resource clusterSet)
+ throws ServiceException;
+
+ Resource setDefaultClusterSet(Resource clusterSet)
+ throws ServiceException;
+
+ void performWriteRequest(WriteGraph graph, Write request) throws DatabaseException;
+ <T> T performWriteRequest(WriteGraph graph, WriteResult<T> request) throws DatabaseException;
+ void performWriteRequest(WriteGraph graph, WriteOnly request) throws DatabaseException;
+
+ boolean writeOnly();
+
+ void flush(boolean intermediate);
+ void flushCluster();
+ void flushCluster(Resource r);
+
+ void gc();
+
+ void commitDone(WriteTraits writeTraits, long csid);
+ void clearUndoList(WriteTraits writeTraits);
+ void startUndo();
+ /**
+ * @return size of meta data before clearing.
+ */
+ int clearMetadata();
+}