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:
024: package org.objectweb.salome_tmf.api.sql;
025:
026: import java.rmi.Remote;
027:
028: import org.objectweb.salome_tmf.api.data.AttachementWrapper;
029: import org.objectweb.salome_tmf.api.data.EnvironmentWrapper;
030: import org.objectweb.salome_tmf.api.data.FileAttachementWrapper;
031: import org.objectweb.salome_tmf.api.data.SalomeFileWrapper;
032: import org.objectweb.salome_tmf.api.data.ScriptWrapper;
033: import org.objectweb.salome_tmf.api.data.UrlAttachementWrapper;
034: import org.objectweb.salome_tmf.api.data.ValuedParameterWrapper;
035:
036: public interface ISQLEnvironment extends Remote {
037: /**
038: * Insert a Environment in the database (table ENVIRONNEMENT)
039: * @param idProject : id of the project wich contain the environment
040: * @param name of the environment
041: * @param description of the environment
042: * @return id of the environment in the table ENVIRONNEMENT
043: * @throws Exception
044: * need permission canCreateCamp or canExecutCamp
045: */
046: public int insert(int idProject, String name, String description)
047: throws Exception;
048:
049: /**
050: * Attach a file to the environment (table ENV_ATTACHEMENT)
051: * @param idEnv
052: * @param f the file
053: * @param description of the file
054: * @return the Id of the attachment in the table ATTACHEMENT
055: * @throws Exception
056: * @see ISQLFileAttachment.insert(File, String)
057: * no permission needed
058: */
059: public int addAttachFile(int idEnv, SalomeFileWrapper f,
060: String description) throws Exception;
061:
062: /**
063: * Attach an Url to the environment (table ENV_ATTACHEMENT)
064: * @param idEnv
065: * @param url
066: * @param description of the url
067: * @return the Id of the attachment in the table ATTACHEMENT
068: * @throws Exception
069: * @see ISQLUrlAttachment.insert(String, String)
070: * no permission needed
071: */
072: public int addAttachUrl(int idEnv, String url, String description)
073: throws Exception;
074:
075: /**
076: * Insert a script (type ApiConstants.INIT_SCRIPT) to the environment idEnv
077: * If a script already exist, this previous script is deleted
078: * @param idExec
079: * @param file of the script
080: * @param description : the description of the script
081: * @param name : the name of the script
082: * @param extention : argument 1 of the script (plug-in extention)
083: * @param arg2 : argument 2 of the script (free use for plug-in)
084: * @return the Id of the script
085: * @throws Exception
086: * no permission needed
087: */
088: public int addScript(int idEnv, SalomeFileWrapper file,
089: String description, String name, String extention,
090: String arg2) throws Exception;
091:
092: /**
093: * Map a value for the parameter idParam in the environment idEnv (table VALEUR_PARAM)
094: * @param idEnv
095: * @param idParam
096: * @param value
097: * @param description
098: * @throws Exception
099: * need permission canCreateCamp or canExecutCamp
100: */
101: public void addParamValue(int idEnv, int idParam, String value,
102: String description) throws Exception;
103:
104: /**
105: * Update the name and the description of the environment idEnv
106: * @param idEnv
107: * @param name
108: * @param description
109: * @throws Exception
110: * need permission canUpdateCamp or canExecutCamp
111: */
112: public void update(int idEnv, String name, String description)
113: throws Exception;
114:
115: /**
116: * Update a mapped value for the parameter idParam in the environment idEnv
117: * @param idEnv
118: * @param idParam
119: * @param value : the new value
120: * @param description : the new description
121: * @throws Exception
122: * need permission canUpdateCamp or canExecutCamp
123: */
124: public void updateParamValue(int idEnv, int idParam, String value,
125: String description) throws Exception;
126:
127: /**
128: * Delete the environment idEnv in the Database
129: * then delete mapped parameters, mapped attachments and related execution
130: * @param idEnv
131: * @throws Exception
132: * @see ISQLExecution.delete(int)
133: * need permission canExecutCamp
134: */
135: public void delete(int idEnv) throws Exception;
136:
137: /**
138: * Deleted mapped reference to the parameter paramId in the environment idEnv
139: * @param idEnv
140: * @param paramId
141: * @throws Exception
142: * need permission canExecutCamp
143: */
144: public void deleteDefParam(int idEnv, int paramId) throws Exception;
145:
146: /**
147: * Delete all attchements of the environments idEnv
148: * @param idEnv
149: * @throws Exception
150: * no permission needed
151: */
152: public void deleteAllAttach(int idEnv) throws Exception;
153:
154: /**
155: * Delete an attchement idAttach of the environments idEnv
156: * @param idEnv
157: * @param attachId
158: * @throws Exception
159: * @see ISQLAttachment.delete(int)
160: * no permission needed
161: */
162: public void deleteAttach(int idEnv, int idAttach) throws Exception;
163:
164: /**
165: * Delete the script of the environnement idEnv
166: * then delete reference in SCRIPT, SCRIPT_ATTACHEMENT, ATTACHEMENT
167: * @param idExec
168: * @throws Exception
169: * no permission needed
170: */
171: public void deleteScript(int idEnv) throws Exception;
172:
173: /**
174: * Get an Array of FileAttachementWrapper representing the files attachment of the environment
175: * @param idEnv
176: * @return
177: * @throws Exception
178: */
179: public FileAttachementWrapper[] getAttachFiles(int idEnv)
180: throws Exception;
181:
182: /**
183: * Get an Array of UrlAttachementWrapper representing the Urls attachment of the environment
184: * @param idEnv
185: * @return
186: * @throws Exception
187: */
188: public UrlAttachementWrapper[] getAttachUrls(int idEnv)
189: throws Exception;
190:
191: /**
192: * Get an Array of all attachments (AttachementWrapper, File or Url) of the environment
193: * @param idEnv
194: * @return
195: * @throws Exception
196: */
197: public AttachementWrapper[] getAttachs(int idEnv) throws Exception;
198:
199: /**
200: * Get the SalomeFileWrapper of the script in the Environnement idEnv
201: * @param idExec
202: * @return
203: * @throws Exception
204: */
205: public SalomeFileWrapper getScript(int idEnv) throws Exception;
206:
207: /**
208: * Get a ScriptWrapper representing the script of the Environnement
209: * @param idEnv
210: * @return
211: * @throws Exception
212: */
213: public ScriptWrapper getScriptWrapper(int idEnv) throws Exception;
214:
215: /**
216: * Get the id of the environment name in the project idProject
217: * @param idProject
218: * @param name
219: * @return
220: * @throws Exception
221: */
222: public int getID(int idProject, String name) throws Exception;
223:
224: /**
225: * Get an EnvironmentWrapper reprensting the environnement idEnv
226: * @param idEnv
227: * @return
228: * @throws Exception
229: */
230: public EnvironmentWrapper getWrapper(int idEnv) throws Exception;
231:
232: /**
233: * Get the value of the parameter idParameter in the environnement idEnv
234: * @param idEnv
235: * @param idParameter
236: * @return the value or null if the parameter is not use by the environement
237: * @throws Exception
238: */
239: public String getParameterValue(int idEnv, int idParameter)
240: throws Exception;
241:
242: /**
243: * Get an Array of ValuedParameterWrapper for the environnement idEnv
244: * @param idEnv
245: * @return
246: * @throws Exception
247: */
248: public ValuedParameterWrapper[] getDefinedParameters(int idEnv)
249: throws Exception;
250: }
|