AccountService.java 1000 Bytes
package org.legrog.web.account;

import org.legrog.entities.Account;
import org.legrog.entities.IndexedAccount;
import org.legrog.entities.IndexingException;
import org.legrog.entities.SearchingException;

import javax.validation.constraints.NotNull;
import java.util.List;

public interface AccountService {
    void addUser(Account account);

    List<Account> getAllUsers();

    Account findUserById(int id);

    void updateUser(Account account);

    /**
     *
     * @param string String searched in indexed Accounts
     * @return indexed IndexedAccounts that match the String
     */
    List<Account> search(@NotNull String string) throws SearchingException;

    /**
     *
     * @param indexedAccounts IndexedAccount to convert
     * @return Account List
     */
    List<Account> convertIndexedAccountsIntoAccounts(List<IndexedAccount> indexedAccounts);

    /**
     *
     * @return number of indexed accounts
     */
    public int reindexAllAccounts() throws IndexingException;
}