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

import com.sun.net.httpserver.HttpExchange;
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 java.util.Collection;
import java.util.Map;
import java.util.Optional;

public interface UserService {
	void dropSession(Token token) throws UmbrellaException;
	Session extend(Session session) throws UmbrellaException;
	Map<Long, UmbrellaUser> list(Integer start, Integer limit, Collection<Long> ids) throws UmbrellaException;
	Session load(Token token) throws UmbrellaException;
	UmbrellaUser load(Session session) throws UmbrellaException;
	Optional<UmbrellaUser> load(EmailAddress email) throws UmbrellaException;
	UmbrellaUser loadUser(long userId) throws UmbrellaException;
	Optional<UmbrellaUser> loadUser(Optional<Token> sessionToken) throws UmbrellaException;
	Optional<UmbrellaUser> loadUser(HttpExchange ex) throws UmbrellaException;
	Optional<UmbrellaUser> refreshSession(HttpExchange ex);
	Map<Long, ? extends UmbrellaUser> search(String key);
}
