1 package org.simantics.db.impl.internal;
\r
3 import java.util.Collection;
\r
5 import org.simantics.db.ExternalValueSupport;
\r
6 import org.simantics.db.Resource;
\r
7 import org.simantics.db.Session;
\r
8 import org.simantics.utils.datastructures.Pair;
\r
11 * A database {@link Session} service for registering and retrieving random
\r
12 * access binary instances related to a session.
\r
15 * This service is internal to the implementation and must not be used
\r
19 * @author Tuukka Lehtonen
\r
21 * @see ExternalValueSupport
\r
23 public interface RandomAccessValueSupport {
\r
26 * Registers the specified value with the specified resource.
\r
30 * @throws IllegalStateException
\r
31 * if a previous registration already exists for the specified
\r
34 void put(Resource resource, ResourceData data);
\r
38 * @return currently registered value attached to the specified resource
\r
40 ResourceData get(Resource resource);
\r
43 * @return currently registered entries
\r
45 Collection<Pair<Resource, ResourceData>> entries();
\r
48 * Removes all value registrations from this registry.
\r
50 * @return the set of previously registered values
\r
52 Collection<Pair<Resource, ResourceData>> removeAll();
\r