]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.db/src/org/simantics/db/service/ClusteringSupport.java
Fail safe import fixes made by Antti
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / service / ClusteringSupport.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.db.service;
13
14 import org.simantics.db.Resource;
15 import org.simantics.db.exception.DatabaseException;
16 import org.simantics.db.exception.ResourceNotFoundException;
17
18
19 /**
20  * @author Antti Villberg
21  */
22 public interface ClusteringSupport {
23
24     /**
25      * TODO: specify thread-safety
26      * 
27      * @return id of new cluster
28      */
29     long createCluster();
30
31     long getCluster(Resource r);
32     
33     int getNumberOfResources(long clusterId) throws DatabaseException;
34     
35     Resource getResourceByKey(int resourceKey) throws ResourceNotFoundException;
36     
37     Resource getResourceByIndexAndCluster(int resourceIndex, long clusterId)
38     throws DatabaseException, ResourceNotFoundException;
39     interface Id {
40         long[] toLong();
41     }
42     
43     boolean isClusterSet(Resource r) throws DatabaseException;
44     Resource getClusterSetOfCluster(Resource r) throws DatabaseException;
45     Resource getClusterSetOfCluster(long cluster) throws DatabaseException;
46     
47     //Id getModifiedId(long clusterId) throws DatabaseException;
48 }