X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fgenericrelation%2FIndexedRelations.java;fp=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fgenericrelation%2FIndexedRelations.java;h=e136d19ee6d4f24dd9db76e5e66ec8e95958206f;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/IndexedRelations.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/IndexedRelations.java new file mode 100644 index 000000000..e136d19ee --- /dev/null +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/genericrelation/IndexedRelations.java @@ -0,0 +1,99 @@ +/******************************************************************************* + * 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.layer0.genericrelation; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.simantics.db.RequestProcessor; +import org.simantics.db.Resource; +import org.simantics.db.layer0.adapter.GenericRelation; + +/** + * TODO: how to use + * + * TODO: make a statement about synchronization requirements imposed by the interface + * + * TODO: what exceptions are the methods supposed to throw? any checked exceptions? + * + * @author Antti Villberg + */ +public interface IndexedRelations { + + /** + * @param monitor + * @param search + * @param session + * @param relation + * @param input + * @param maxResultCount + * @return + * @throws IndexException + */ + public List> query(IProgressMonitor monitor, String search, RequestProcessor session, + Resource relation, Resource input, int maxResultCount) throws IndexException; + + public List queryResources(IProgressMonitor monitor, String search, RequestProcessor session, + Resource relation, Resource input, int maxResultCount) throws IndexException; + + /** + * @param monitor + * @param processor + * @param relation + * @param resource + * @param input + * @param documents + * @throws IndexException + */ + public void insert(IProgressMonitor monitor, RequestProcessor processor, GenericRelation relation, + Resource resource, Resource input, Collection documents) + throws IndexException; + + /** + * @param monitor + * @param processor + * @param relation + * @param resource + * @param input + * @param key + * @param keyValues + * @throws IndexException + */ + public void remove(IProgressMonitor monitor, RequestProcessor processor, GenericRelation relation, + Resource resource, Resource input, String key, Collection keyValues) + throws IndexException; + + public void removeAll(IProgressMonitor monitor, RequestProcessor processor, GenericRelation relation, + Resource resource, Resource input) + throws IndexException; + + /** + * @param monitor + * @param processor + * @param relation + * @param resource + * @param input + * @param key + * @param keyValues + * @param documents + * @throws IndexException + */ + public boolean replace(IProgressMonitor monitor, RequestProcessor processor, GenericRelation relation, + Resource resource, Resource input, String key, Collection keyValues, Collection documents) + throws IndexException; + + public void reset(IProgressMonitor monitor, RequestProcessor processor, Resource resource, Resource input) + throws IndexException; + +}