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.layer0.genericrelation;
14 import java.util.Collection;
15 import java.util.List;
18 import org.eclipse.core.runtime.IProgressMonitor;
19 import org.simantics.db.RequestProcessor;
20 import org.simantics.db.Resource;
21 import org.simantics.db.layer0.adapter.GenericRelation;
26 * TODO: make a statement about synchronization requirements imposed by the interface
28 * TODO: what exceptions are the methods supposed to throw? any checked exceptions?
30 * @author Antti Villberg
32 public interface IndexedRelations {
40 * @param maxResultCount
42 * @throws IndexException
44 public List<Map<String, Object>> query(IProgressMonitor monitor, String search, RequestProcessor session,
45 Resource relation, Resource input, int maxResultCount) throws IndexException;
47 public List<Resource> queryResources(IProgressMonitor monitor, String search, RequestProcessor session,
48 Resource relation, Resource input, int maxResultCount) throws IndexException;
57 * @throws IndexException
59 public void insert(IProgressMonitor monitor, RequestProcessor processor, GenericRelation relation,
60 Resource resource, Resource input, Collection<Object[]> documents)
61 throws IndexException;
71 * @throws IndexException
73 public void remove(IProgressMonitor monitor, RequestProcessor processor, GenericRelation relation,
74 Resource resource, Resource input, String key, Collection<Object> keyValues)
75 throws IndexException;
77 public void removeAll(IProgressMonitor monitor, RequestProcessor processor, GenericRelation relation,
78 Resource resource, Resource input)
79 throws IndexException;
90 * @throws IndexException
92 public boolean replace(IProgressMonitor monitor, RequestProcessor processor, GenericRelation relation,
93 Resource resource, Resource input, String key, Collection<Object> keyValues, Collection<Object[]> documents)
94 throws IndexException;
96 public void reset(IProgressMonitor monitor, RequestProcessor processor, Resource resource, Resource input)
97 throws IndexException;
99 public void fullRebuild(IProgressMonitor monitor, RequestProcessor processor) throws IndexException;