1 /*
2 * (C) 2002 David Carr david@carr.name
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 package net.sourceforge.mflow.api;
20
21 import java.util.List;
22 import java.util.Map;
23
24 /***
25 * A manager for {@link Account}s.
26 *
27 * @author carrd
28 */
29 public interface AccountManager {
30 /***
31 * Creates a new instance of {@link Account}.
32 *
33 * @param name the name of the new {@link Account}
34 * @param typeClass the type class to instantiate
35 * @return the new {@link Account} instance
36 */
37 Account createNewAccount(String name, Class typeClass);
38
39 /***
40 * Returns a list of all {@link Account}s.
41 *
42 * @return a list of all {@link Account}s
43 */
44 List getAccounts();
45
46 /***
47 * Returns an unmodifiable copy of the type {@link Map}. The keys are the
48 * names of the account types, while the keys are the type classes.
49 *
50 * @return an unmodifiable {@link Map} of {@link String}s to {@link Class}es
51 */
52 Map getTypes();
53
54 /***
55 * Registers a new type of account.
56 *
57 * @param name the name of the account type
58 * @param clazz the {@link Class} of the account type; should implement
59 * {@link Account}
60 */
61 void registerType(String name, Class clazz);
62
63 /***
64 * Removes an {@link Account}.
65 *
66 * @param account the {@link Account} to remove
67 */
68 void remove(Account account);
69 }
This page was automatically generated by Maven