]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/structure/StructureRegistry.java
Adapt for agents
[gpl/argeo-slc.git] / runtime / org.argeo.slc.specs / src / main / java / org / argeo / slc / structure / StructureRegistry.java
1 package org.argeo.slc.structure;
2
3 import java.util.List;
4
5 /** Registry where the whole structure is stored. */
6 public interface StructureRegistry<P extends StructurePath> {
7 /** Read mode: the structure is only read. */
8 public static String READ = "READ";
9 /** All mode: everything is executed regardless of the active paths. */
10 public static String ALL = "ALL";
11 /** Active mode: only the active paths are executed. */
12 public static String ACTIVE = "ACTIVE";
13
14 /** Adds an element to the registry. */
15 public void register(P path, StructureElement element);
16
17 /** Lists <b>all</b> registered elements. */
18 public List<StructureElement> listElements();
19
20 /** Lists <b>all</b> registered elements. */
21 public List<P> listPaths();
22
23 /** Gets a element based on its path. */
24 public <T extends StructureElement> T getElement(P path);
25
26 /**
27 * Set the interpreter mode: read, all or active.
28 *
29 * @see #READ
30 * @see #ALL
31 * @see #STATUS_ACTIVE
32 */
33 public void setMode(String mode);
34
35 /**
36 * Gets the current interpreter mode.
37 *
38 * @see #READ
39 * @see #ALL
40 * @see #STATUS_ACTIVE
41 */
42 public String getMode();
43
44 /**
45 * Gets the list of active paths, which will be run if executed in
46 * <code>STATUS_ACTIVE</code> mode.
47 */
48 public List<P> getActivePaths();
49
50 /**
51 * Sets the list of active path, which will be run if executed in
52 * <code>STATUS_ACTIVE</code> mode.
53 */
54 public void setActivePaths(List<P> activePaths);
55 }