/* © SRSoftware 2025 */
package de.srsoftware.umbrella.user.api;

import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
import de.srsoftware.umbrella.core.model.EmailAddress;
import de.srsoftware.umbrella.core.model.Session;
import de.srsoftware.umbrella.core.model.Token;
import de.srsoftware.umbrella.core.model.UmbrellaUser;
import de.srsoftware.umbrella.user.model.DbUser;
import de.srsoftware.umbrella.user.model.Password;
import java.util.Collection;
import java.util.Map;

public interface UserDb {

	Long delete(Long userId) throws UmbrellaException;

	Boolean dropSession(Token token) throws UmbrellaException;

	Session extend(Session session) throws UmbrellaException;

	/**
	 * Get a session for the provided user.
	 * @param user
	 * @return
	 */
	Session getSession(UmbrellaUser user) throws UmbrellaException;

	Map<Long, UmbrellaUser> list(Integer start, Integer limit, Collection<Long> ids) throws UmbrellaException;

	Session load(Token token) throws UmbrellaException;

	UmbrellaUser load(EmailAddress email) throws UmbrellaException;

	UmbrellaUser load(Long id) throws UmbrellaException;

	UmbrellaUser load(Session session) throws UmbrellaException;

	UmbrellaUser load(String key, Password password) throws UmbrellaException;

	UmbrellaUser save(DbUser user) throws UmbrellaException;

	Map<Long,DbUser> search(String key);

	UserDb setSessionDuration(Number minutes);
}
