]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/structure/StructureRegistry.java
Improve versioning driver
[gpl/argeo-slc.git] / runtime / org.argeo.slc.specs / src / main / java / org / argeo / slc / structure / StructureRegistry.java
1 /*
2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.argeo.slc.structure;
18
19 import java.util.List;
20
21 /** Registry where the whole structure is stored. */
22 public interface StructureRegistry<P extends StructurePath> {
23 /** Read mode: the structure is only read. */
24 public static String READ = "READ";
25 /** All mode: everything is executed regardless of the active paths. */
26 public static String ALL = "ALL";
27 /** Active mode: only the active paths are executed. */
28 public static String ACTIVE = "ACTIVE";
29
30 /** Adds an element to the registry. */
31 public void register(P path, StructureElement element);
32
33 /** Lists <b>all</b> registered elements. */
34 public List<StructureElement> listElements();
35
36 /** Lists <b>all</b> registered elements. */
37 public List<P> listPaths();
38
39 /** Gets a element based on its path. */
40 public <T extends StructureElement> T getElement(P path);
41
42 /**
43 * Set the interpreter mode: read, all or active.
44 *
45 * @see #READ
46 * @see #ALL
47 * @see #STATUS_ACTIVE
48 */
49 public void setMode(String mode);
50
51 /**
52 * Gets the current interpreter mode.
53 *
54 * @see #READ
55 * @see #ALL
56 * @see #STATUS_ACTIVE
57 */
58 public String getMode();
59
60 /**
61 * Gets the list of active paths, which will be run if executed in
62 * <code>STATUS_ACTIVE</code> mode.
63 */
64 public List<P> getActivePaths();
65
66 /**
67 * Sets the list of active path, which will be run if executed in
68 * <code>STATUS_ACTIVE</code> mode.
69 */
70 public void setActivePaths(List<P> activePaths);
71 }