Salome HOME
More business logic has been moved from BO to services. ServiceLocator is created...
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / SimulationContextService.java
1 /*****************************************************************************
2  * Company         OPEN CASCADE
3  * Application     SIMAN
4  * File            $Id$ 
5  * Creation date   16.10.2012
6  * @author         $Author$
7  * @version        $Revision$
8  *****************************************************************************/
9
10 package org.splat.service;
11
12 import java.util.List;
13
14 import org.splat.dal.bo.som.SimulationContext;
15 import org.splat.dal.bo.som.SimulationContextType;
16 import org.splat.kernel.InvalidPropertyException;
17 import org.splat.service.technical.ProjectSettingsService;
18
19 /**
20  * Simulation context service interface.
21  * 
22  * @author <a href="mailto:roman.kozlov@opencascade.com">Roman Kozlov (RKV)</a>
23  * 
24  */
25 public interface SimulationContextService {
26
27         /**
28          * Get simulation context by its id.
29          * 
30          * @param index
31          *            simulation context id.
32          * @return found context
33          */
34         public SimulationContext selectSimulationContext(long index);
35
36         /**
37          * Find simulation context by its type and value.
38          * 
39          * @param celt
40          *            context type
41          * @param value
42          *            context value
43          * @return found context
44          */
45         public SimulationContext selectSimulationContext(
46                         SimulationContextType celt, String value);
47
48         /**
49          * Find simulation contexts by example.
50          * 
51          * @param cprop
52          *            example properties
53          * @return list of contexts
54          */
55         public List<SimulationContext> selectSimulationContextsWhere(
56                         SimulationContext.Properties cprop);
57
58         /**
59          * Create a simulation context type.
60          * 
61          * @param name
62          *            context type name
63          * @param step
64          *            activity related to this context type
65          * @return the created context type
66          * @throws InvalidPropertyException
67          *             if some property of the type to be created is invalid
68          */
69         public SimulationContextType createType(String name,
70                         ProjectSettingsService.Step step) throws InvalidPropertyException;
71
72         /**
73          * Get all simulation context types.
74          * 
75          * @return list of context types
76          */
77         public List<SimulationContextType> selectAllTypes();
78
79         /**
80          * Get simulation context types related to given activities.
81          * 
82          * @param step
83          *            the activity
84          * @return list of found context types
85          */
86         public List<SimulationContextType> selectTypesOf(
87                         ProjectSettingsService.Step... step);
88
89         /**
90          * Get simulation context types by example.
91          * @param sprop the example
92          * @return list of found context types
93          */
94         public List<SimulationContextType> selectTypesWhere(
95                         SimulationContextType.Properties sprop);
96
97         /**
98          * Get a simulation context type by its name.
99          * @param name name of the context type
100          * @return found context type
101          */
102         public SimulationContextType selectType(String name);
103
104         /**
105          * Get simulation context type by its id.
106          * 
107          * @param index
108          *            simulation context type id.
109          * @return found context type
110          */
111         public SimulationContextType selectType(long index);
112
113         /**
114          * Hold the simulation context.
115          * 
116          * @param simCtx
117          *            the context to hold.
118          */
119         public void hold(SimulationContext simCtx);
120
121         /**
122          * Release the simulation context.
123          * 
124          * @param simCtx
125          *            the context to release
126          */
127         public void release(SimulationContext simCtx);
128
129         /**
130          * Get the simulation context list for displaying drop-down list values populating on the "Create new study" screen.
131          * 
132          * @return List of the simulation contexts.
133          */
134         List<SimulationContext> getSimulationContextList();
135
136 }