-/*******************************************************************************\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;\r
-\r
-import java.io.InputStream;\r
-\r
-import org.simantics.db.Session;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.service.ClusterUID;\r
-\r
-public interface ClusterSupport {\r
-\r
- /**\r
- * For cluster's constructor to get short cluster id for the lifetime of cluster in question.\r
- *\r
- * @param clusterUID\r
- * @param clusterId\r
- * @return\r
- */\r
- int createClusterKeyByClusterUID(ClusterUID clusterUID, long clusterId);\r
-\r
- ClusterBase getClusterByClusterUIDOrMake(ClusterUID clusterUID);\r
- ClusterBase getClusterByClusterId(long clusterId);\r
- ClusterBase getClusterByClusterKey(int clusterKey);\r
- int getClusterKeyByClusterUIDOrMake(ClusterUID clusterUID);\r
- int getClusterKeyByClusterUIDOrMake(long id1, long id2);\r
- /**\r
- * @param resourceKey\r
- * @return cluster owning the given resource.\r
- */\r
- ClusterBase getClusterByResourceKey(int resourceKey);\r
-\r
- long getClusterIdOrCreate(ClusterUID clusterUID);\r
-\r
- void addStatement(Object cluster);\r
- void cancelStatement(Object cluster);\r
- void removeStatement(Object cluster);\r
- void cancelValue(Object cluster);\r
- void removeValue(Object cluster);\r
- void setValue(Object cluster, long clusterId, byte[] bytes, int length);\r
- void modiValue(Object cluster, long clusterId, long voffset, int length, byte[] bytes, int offset);\r
- void setImmutable(Object cluster, boolean immutable);\r
- void setDeleted(Object cluster, boolean deleted);\r
- void createResource(Object cluster, short resourceIndex, long clusterId);\r
- void addStatementIndex(Object cluster, int resourceKey, ClusterUID clusterUID, byte op);\r
- void setStreamOff(boolean setOff);\r
- boolean getStreamOff();\r
-\r
- InputStream getValueStreamEx(int resourceIndex, long clusterId)\r
- throws DatabaseException;\r
- byte[] getValueEx(int resourceIndex, long clusterId)\r
- throws DatabaseException;\r
- byte[] getValueEx(int resourceIndex, long clusterId, long voffset, int length)\r
- throws DatabaseException;\r
- long getValueSizeEx(int resourceIndex, long clusterId)\r
- throws DatabaseException;\r
- int wait4RequestsLess(int limit)\r
- throws DatabaseException;\r
-\r
- Session getSession();\r
- IClusterTable getClusterTable();\r
-\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;
+
+import java.io.InputStream;
+
+import org.simantics.db.Session;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.service.ClusterUID;
+
+public interface ClusterSupport {
+
+ /**
+ * For cluster's constructor to get short cluster id for the lifetime of cluster in question.
+ *
+ * @param clusterUID
+ * @param clusterId
+ * @return
+ */
+ int createClusterKeyByClusterUID(ClusterUID clusterUID, long clusterId);
+
+ ClusterBase getClusterByClusterUIDOrMake(ClusterUID clusterUID);
+ ClusterBase getClusterByClusterId(long clusterId);
+ ClusterBase getClusterByClusterKey(int clusterKey);
+ int getClusterKeyByClusterUIDOrMake(ClusterUID clusterUID);
+ int getClusterKeyByClusterUIDOrMake(long id1, long id2);
+ /**
+ * @param resourceKey
+ * @return cluster owning the given resource.
+ */
+ ClusterBase getClusterByResourceKey(int resourceKey);
+
+ long getClusterIdOrCreate(ClusterUID clusterUID);
+
+ void addStatement(Object cluster);
+ void cancelStatement(Object cluster);
+ void removeStatement(Object cluster);
+ void cancelValue(Object cluster);
+ void removeValue(Object cluster);
+ void setValue(Object cluster, long clusterId, byte[] bytes, int length);
+ void modiValue(Object cluster, long clusterId, long voffset, int length, byte[] bytes, int offset);
+ void setImmutable(Object cluster, boolean immutable);
+ void setDeleted(Object cluster, boolean deleted);
+ void createResource(Object cluster, short resourceIndex, long clusterId);
+ void addStatementIndex(Object cluster, int resourceKey, ClusterUID clusterUID, byte op);
+ void setStreamOff(boolean setOff);
+ boolean getStreamOff();
+
+ InputStream getValueStreamEx(int resourceIndex, long clusterId)
+ throws DatabaseException;
+ byte[] getValueEx(int resourceIndex, long clusterId)
+ throws DatabaseException;
+ byte[] getValueEx(int resourceIndex, long clusterId, long voffset, int length)
+ throws DatabaseException;
+ long getValueSizeEx(int resourceIndex, long clusterId)
+ throws DatabaseException;
+ int wait4RequestsLess(int limit)
+ throws DatabaseException;
+
+ Session getSession();
+ IClusterTable getClusterTable();
+
+}