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