/* © SRSoftware 2025 */
package de.srsoftware.umbrella.tags;


import de.srsoftware.tools.Tuple;
import de.srsoftware.umbrella.core.model.UmbrellaUser;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

public interface TagDB {
	String delete(long userId, String module, long entityId, String tag);

	void deleteEntity(String module, long entityId);

	void deleteEntity(String module, long entityId, long userId);

	Map<String, List<Long>> getUses(String tag, long id);

	Collection<Tuple<String, Long>> list(long userId);

	Set<String> list(long userId, String module, long entityId);

	/**
	 * Loads the tags for all the entities denominated by the collection <em>entityIds</em>.
	 * @param module the realm the entities belong to
	 * @param entityIds the set of entities of the respective realm
	 * @param userId the id of the user, for whom the tags shall be loaded
	 * @return a map from entity ids to assigned tags
	 */
	Map<Long, ? extends Collection<String>> list(long userId, String module, Collection<Long> entityIds);

	void save(Collection<Long> userIds, String module, long entityId, Collection<String> tags);

	Collection<String> search(String key, UmbrellaUser user);

	void updateId(String module, Object oldId, Object newId);
}
