1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
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
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.db.service;
14 import org.simantics.db.Resource;
15 import org.simantics.db.exception.DatabaseException;
16 import org.simantics.db.exception.ResourceNotFoundException;
20 * @author Antti Villberg
22 public interface ClusteringSupport {
25 * TODO: specify thread-safety
27 * @return id of new cluster
31 long getCluster(Resource r);
33 int getNumberOfResources(long clusterId) throws DatabaseException;
35 Resource getResourceByKey(int resourceKey) throws ResourceNotFoundException;
37 Resource getResourceByIndexAndCluster(int resourceIndex, long clusterId)
38 throws DatabaseException, ResourceNotFoundException;
43 boolean isClusterSet(Resource r) throws DatabaseException;
44 Resource getClusterSetOfCluster(Resource r) throws DatabaseException;
45 Resource getClusterSetOfCluster(long cluster) throws DatabaseException;
47 //Id getModifiedId(long clusterId) throws DatabaseException;