001: /*
002: * SalomeTMF is a Test Management Framework
003: * Copyright (C) 2005 France Telecom R&D
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *
019: * @author Marche Mikael
020: *
021: * Contact: mikael.marche@rd.francetelecom.com
022: */
023: package org.objectweb.salome_tmf.api.sql;
024:
025: import java.rmi.Remote;
026: import java.sql.Date;
027:
028: import org.objectweb.salome_tmf.api.data.AttachementWrapper;
029: import org.objectweb.salome_tmf.api.data.DataSetWrapper;
030: import org.objectweb.salome_tmf.api.data.EnvironmentWrapper;
031: import org.objectweb.salome_tmf.api.data.ExecutionResultWrapper;
032: import org.objectweb.salome_tmf.api.data.ExecutionWrapper;
033: import org.objectweb.salome_tmf.api.data.FileAttachementWrapper;
034: import org.objectweb.salome_tmf.api.data.SalomeFileWrapper;
035: import org.objectweb.salome_tmf.api.data.ScriptWrapper;
036: import org.objectweb.salome_tmf.api.data.UrlAttachementWrapper;
037:
038: public interface ISQLExecution extends Remote {
039: /**
040: * Insert an Exceution in the campaign idCamp (table EXEC_CAMP)
041: * @param idCamp
042: * @param name of the execution
043: * @param idEnv used by the execution
044: * @param idDataSet used by the execution
045: * @param idUser who created the execution
046: * @param description of the execution
047: * @return the id of the execution
048: * @throws Exception
049: * need permission canExecutCamp
050: */
051: public int insert(int idCamp, String name, int idEnv,
052: int idDataSet, int idUser, String description)
053: throws Exception;
054:
055: /**
056: * Attach a file to the Exceution (table EXEC_CAMP_ATTACH)
057: * @param idExec
058: * @param file
059: * @param description of the file
060: * @return the Id of the attachment in the table ATTACHEMENT
061: * @throws Exception
062: * @see ISQLFileAttachment.insert(File, String)
063: * no permission needed
064: */
065: public int addAttachFile(int idExec, SalomeFileWrapper file,
066: String description) throws Exception;
067:
068: /**
069: * Attach an Url to the Exceution (table EXEC_CAMP_ATTACH)
070: * @param idExec
071: * @param url
072: * @param description of the url
073: * @return the Id of the attachment in the table ATTACHEMENT
074: * @throws Exception
075: * @see ISQLUrlAttachment.insert(String, String)
076: * no permission needed
077: */
078: public int addAttachUrl(int idExec, String url, String description)
079: throws Exception;
080:
081: /**
082: * Insert a pre-scrit (type ApiConstants.PRE_SCRIPT) to the execution idExec
083: * @param idExec
084: * @param file of the script
085: * @param description the description of the script
086: * @param name : the name of the script
087: * @param extention : argument 1 of the script (plug-in extention)
088: * @param arg2 : argument 2 of the script (free use for plug-in)
089: * @return the Id of the script
090: * @throws Exception
091: * no permission needed
092: */
093: public int addPreScript(int idExec, SalomeFileWrapper file,
094: String description, String name, String extention,
095: String arg2) throws Exception;
096:
097: /**
098: * Insert a pre-scrit (type ApiConstants.POST_SCRIPT) to the execution idExec
099: * @param idExec
100: * @param file of the script
101: * @param description the description of the script
102: * @param name : the name of the script
103: * @param extention : argument 1 of the script (plug-in extention)
104: * @param arg2 : argument 2 of the script (free use for plug-in)
105: * @return the Id of the script
106: * @throws Exception
107: * no permission needed
108: */
109: public int addPostScript(int idExec, SalomeFileWrapper file,
110: String description, String name, String extention,
111: String arg2) throws Exception;
112:
113: /**
114: * Update the name and the description of the execution idExec
115: * @param idExec
116: * @param name
117: * @throws Exception
118: * need permission canUpdateCamp or canExecutCamp
119: */
120: public void updateName(int idExec, String name) throws Exception;
121:
122: /**
123: * Update the date of the execution idExec
124: * @param idExec
125: * @param date
126: * @throws Exception
127: * no permission needed
128: */
129: public void updateDate(int idExec, Date date) throws Exception;
130:
131: /**
132: * Update the environment mapped to the execution idExec
133: * @param idExec
134: * @param idEnv the new env to use
135: * @throws Exception
136: * need permission canExecutCamp
137: */
138: public void updateEnv(int idExec, int idEnv) throws Exception;
139:
140: /**
141: * Update the dataset mapped to the execution idExec
142: * @param idExec
143: * @param idDataset the new dataset to use
144: * @throws Exception
145: * need permission canExecutCamp
146: */
147: public void updateDataset(int idExec, int idDataset)
148: throws Exception;
149:
150: /**
151: * replace all reference of user oldIdUser by newIdUser in the table (EXEC_CAMP) where campagne = idCamp
152: * @param oldIdUser
153: * @param newIdUser
154: * @throws Exception
155: * no permission needed
156: */
157: public void updateUserRef(int idCamp, int oldIdUser, int newIdUser)
158: throws Exception;
159:
160: /**
161: * Delete all attchements of the execution idExec
162: * @param idExec
163: * @throws Exception
164: * no permission needed
165: */
166: public void deleteAllAttach(int idExec) throws Exception;
167:
168: /**
169: * Delete the execution idExec in the Database
170: * Then delete all attachemnts, the script, and all related execution result
171: * @param idExec
172: * @see ISQLExecutionResult.delete(int)
173: * need permission canExecutCamp
174: */
175: public void delete(int idExec) throws Exception;
176:
177: /**
178: * Delete all execution result for the execution idExec in the Database
179: * @param idExec
180: * @see ISQLExecutionResult.delete(int)
181: * need permission canExecutCamp
182: */
183: public void deleteAllExecResult(int idExec) throws Exception;
184:
185: /**
186: * Delete an attchement idAttach of the execution idExec
187: * @param idExec
188: * @param idAttach
189: * @throws Exception
190: * no permission needed
191: */
192: public void deleteAttach(int idExec, int idAttach) throws Exception;
193:
194: /**
195: * Delete the pre-script of the execution idExec
196: * @param idExec
197: * @throws Exception
198: * no permission needed
199: */
200: public void deletePreScript(int idExec) throws Exception;
201:
202: /**
203: * Delete the post-script of the execution idExec
204: * @param idExec
205: * @throws Exception
206: * no permission needed
207: */
208: public void deletePostScript(int idExec) throws Exception;
209:
210: /**
211: * Delete pre-script and post-script of the execution idEnv
212: * @param idEnv
213: * @throws Exception
214: * no permission needed
215: */
216: public void deleteScripts(int idExec) throws Exception;
217:
218: /**
219: * Get an Array of FileAttachementWrapper representing the files attachment of the execution
220: * @param idExec
221: * @return
222: * @throws Exception
223: */
224: public FileAttachementWrapper[] getAttachFiles(int idExec)
225: throws Exception;
226:
227: /**
228: * Get an Array of UrlAttachementWrapper representing the Urls attachment of the execution
229: * @param idExec
230: * @return
231: * @throws Exception
232: */
233: public UrlAttachementWrapper[] getAttachUrls(int idExec)
234: throws Exception;
235:
236: /**
237: * Get an Array of all attachments (AttachementWrapper, File or Url) of the execution
238: * @param idExec
239: * @return
240: * @throws Exception
241: */
242: public AttachementWrapper[] getAttachs(int idExec) throws Exception;
243:
244: /**
245: * Get an array (lenth 2) of ScriptWrapper representing the pre and post script of the Execution idExec
246: * @param idExec
247: * @return
248: * @throws Exception
249: */
250: public ScriptWrapper[] getExecutionScripts(int idExec)
251: throws Exception;
252:
253: /**
254: * Get the SalomeFileWrapper of the pre-script in the Execution idExec
255: * @param idExec
256: * @return
257: * @throws Exception
258: */
259: public SalomeFileWrapper getPreScript(int idExec) throws Exception;
260:
261: /**
262: * Get the SalomeFileWrapper of the post-script in the Execution idExec
263: * @param idExec
264: * @return
265: * @throws Exception
266: */
267: public SalomeFileWrapper getPostScript(int idExec) throws Exception;
268:
269: /**
270: * Get an Array of ExecutionResultWrapper representing the execution result of the execution idExec
271: * @param idExec
272: * @return
273: * @throws Exception
274: */
275: public ExecutionResultWrapper[] getExecResults(int idExec)
276: throws Exception;
277:
278: /**
279: * Get the id of the execution name in the campaign idCamp
280: * @param idCamp
281: * @param name
282: * @return
283: * @throws Exception
284: */
285: public int getID(int idCamp, String name) throws Exception;
286:
287: /**
288: * Get a wrapper of the execution represented by idExec
289: * @param idExec
290: * @return
291: * @throws Exception
292: */
293: public ExecutionWrapper getWrapper(int idExec) throws Exception;
294:
295: /**
296: * Get an Array of long reprenting all date (sorted) where the execution idExec was executed
297: * @param idExec
298: * @return
299: * @throws Exception
300: */
301: public long[] getAllExecDate(int idExec) throws Exception;
302:
303: /**
304: * Get an EnvironmentWrapper representing the environnment used by the execution idExec
305: * @param idExec
306: * @return
307: * @throws Exception
308: */
309: public EnvironmentWrapper getEnvironmentWrapper(int idExec)
310: throws Exception;
311:
312: /**
313: * Get an DataSetWrapper representing the dataset used by the execution idExec
314: * @param idExec
315: * @return
316: * @throws Exception
317: */
318: public DataSetWrapper getDataSetWrapper(int idExec)
319: throws Exception;
320: }
|