Salome HOME
Refactoring continues: UserService is created instead of UserDirectory. Database...
[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          * 
92          * @param sprop
93          *            the example
94          * @return list of found context types
95          */
96         public List<SimulationContextType> selectTypesWhere(
97                         SimulationContextType.Properties sprop);
98
99         /**
100          * Get a simulation context type by its name.
101          * 
102          * @param name
103          *            name of the context type
104          * @return found context type
105          */
106         public SimulationContextType selectType(String name);
107
108         /**
109          * Get simulation context type by its id.
110          * 
111          * @param index
112          *            simulation context type id.
113          * @return found context type
114          */
115         public SimulationContextType selectType(long index);
116
117         /**
118          * Hold the simulation context.
119          * 
120          * @param simCtx
121          *            the context to hold.
122          */
123         public void hold(SimulationContext simCtx);
124
125         /**
126          * Release the simulation context.
127          * 
128          * @param simCtx
129          *            the context to release
130          */
131         public void release(SimulationContext simCtx);
132
133         /**
134          * Get the simulation context list for displaying drop-down list values populating on the "Create new study" screen.
135          * 
136          * @return List of the simulation contexts.
137          */
138         List<SimulationContext> getSimulationContextList();
139
140         /**
141          * Approve the simulation context type.
142          * 
143          * @param simCtxType
144          *            the type to approve
145          * @return true if approval succeeded
146          */
147         public boolean approve(SimulationContextType simCtxType);
148
149         /**
150          * @param simCtxType
151          * @return
152          */
153         public ProjectSettingsService.Step getAttachedStep(
154                         SimulationContextType simCtxType);
155 }