01: /*
02:
03: This software is OSI Certified Open Source Software.
04: OSI Certified is a certification mark of the Open Source Initiative.
05:
06: The license (Mozilla version 1.0) can be read at the MMBase site.
07: See http://www.MMBase.org/license
08:
09: */
10: package org.mmbase.security;
11:
12: import java.util.*;
13:
14: /**
15: * The defined 'actions' are maintained by the 'action' repository. The security implementation can
16: * decide how to persistify actions and how to connect rights to it.
17: *
18: * @see {@link Action}.
19: * @author Michiel Meeuwissen
20: * @version $Id: ActionRepository.java,v 1.7 2008/01/21 17:28:15 michiel Exp $
21: * @since MMBase-1.9
22: */
23: public abstract class ActionRepository extends Configurable {
24:
25: protected static ActionRepository bootstrap = new MemoryActionRepository();
26:
27: public static final ActionRepository getInstance() {
28: if (bootstrap != null) {
29: return bootstrap;
30: } else {
31: return org.mmbase.module.core.MMBase.getMMBase()
32: .getMMBaseCop().getActionRepository();
33: }
34: }
35:
36: public abstract void add(Action a);
37:
38: public abstract Map<String, Action> get(String nameSpace);
39:
40: public Action get(String nameSpace, String name) {
41: return get(nameSpace).get(name);
42: }
43:
44: public abstract Collection<Map<String, Action>> getActions();
45: }
|