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.ActionWrapper;
029: import org.objectweb.salome_tmf.api.data.FileAttachementWrapper;
030: import org.objectweb.salome_tmf.api.data.ParameterWrapper;
031: import org.objectweb.salome_tmf.api.data.SalomeFileWrapper;
032: import org.objectweb.salome_tmf.api.data.UrlAttachementWrapper;
033:
034: public interface ISQLAction extends Remote {
035:
036: /**
037: * Insert an Action in the table ACTION_TEST for the test identified by idBddTest
038: * @param idBddTest
039: * @param name : name of the action
040: * @param description : description of the action
041: * @param awaitedResult : awaited result of the action
042: * @return the id of the new action
043: * @throws Exception
044: * need canCreateTest permission
045: */
046: public int insert(int idBddTest, String name, String description,
047: String awaitedResult) throws Exception;
048:
049: /**
050: * insert in table ACTION_PARAM_TEST the use of the parameter identifed by idBddParam for the action idBddAction
051: * WARNING This methode don't insert the reference of idBddParam int the table CAS_PARAM_TEST
052: * @param idBddAction
053: * @param idBddParam
054: * @throws Exception
055: * @see
056: */
057: public void addUseParam(int idBddAction, int idBddParam)
058: throws Exception;
059:
060: /**
061: * Insert a file to the action identifeid by idBddAction
062: * @param idBddAction
063: * @param file
064: * @param description
065: * @return the id of the attachment in the table ATTACHEMENT
066: * @throws Exception
067: * no permission needed
068: * @see SQLFileAttachment.insert(File, String)
069: */
070: public int addFileAttach(int idBddAction, SalomeFileWrapper file,
071: String description) throws Exception;
072:
073: /**
074: * Insert a UrlAttachment to the action identifeid by idBddAction
075: * Table used are ATTACHEMENT and ACTION_ATTACHEMENT
076: * @param idBddAction
077: * @param strUrl
078: * @param description
079: * @return the id of the attachment in the table ATTACHEMENT
080: * @throws Exception
081: * no permission needed
082: * @see SQLUrlAttachment.insert(String, String)
083: */
084: public int addUrlAttach(int idBddAction, String strUrl,
085: String description) throws Exception;
086:
087: //////////////////////////////////////UPDATE///////////////////////////////////////////
088:
089: /**
090: * Update the information of an action identified by idBddAction in database (ACTION_TEST)
091: * @param idBddAction
092: * @param newActionName
093: * @param newActionDesc
094: * @param newActionResAttendu
095: * @throws Exception
096: * need permission canUpdateTest
097: */
098: public void update(int idBddAction, String newActionName,
099: String newActionDesc, String newActionResAttendu)
100: throws Exception;
101:
102: /**
103: * Increment or decrement the order of the action identified by idBddAction in the test
104: * Then, reorder other action to preserve a correct order
105: * @param idBddAction
106: * @param inc true for doind a decrementation (+1) or false (-1)
107: * @return the new order of the action
108: * @throws Exception
109: * need permission canUpdateTest
110: */
111: public int updateOrder(int idBddAction, boolean inc)
112: throws Exception;
113:
114: /////////////////////////////////DELETE/////////////////////////////////////////////////////
115:
116: /**
117: * Delete in database the action identified by idBddAction
118: * this delete all Attachemnts, reference of using parameters,
119: * and update the order of the actions which are referenced in the same test
120: * @param idBddAction
121: * @throws Exception
122: * @see deleteAllAttachment(int)
123: * need permission canDeleteTest
124: */
125: public void delete(int idBddAction) throws Exception;
126:
127: /**
128: * Delete in database the action identified by idBddAction
129: * this delete all Attachemnts, reference of using parameters,
130: * and update the order of the actions which are referenced in the same test if reorder = true
131: * @param idBddAction
132: * @param reorder re-order the actions in the test
133: * @throws Exception
134: * @see deleteAllAttachment(int)
135: * need permission canDeleteTest
136: * @TODO SOAP
137: */
138: public void delete(int idBddAction, boolean reorder)
139: throws Exception;
140:
141: /**
142: * Delete the reference of the use parameter idBddParam in action, but not delete the
143: * parameter to the database
144: * @param idBddAction : unique identifier of the action in database
145: * @param idBddParam : unique identifier of the parameter in database
146: * @throws Exception
147: * need permission canDeleteTest
148: */
149: public void deleteParamUse(int idBddAction, int idBddParam)
150: throws Exception;
151:
152: /**
153: * Delete all Attachement of an action identied by idBddAction in database
154: * Delete reference in table : ATTACHEMENT and ACTION_ATTACHEMENT
155: * @param idBddAction
156: * @throws Exception
157: */
158: public void deleteAllAttachment(int idBddAction) throws Exception;
159:
160: /**
161: * Delete Attchement identidied by idBddAttach int ATTACHEMNT table and reference in ACTION_ATTACHEMENT
162: * @param idBddAction : unique identifier of the action in database
163: * @param idBddAttach : unique identifier of the attachment in database
164: * @throws Exception
165: * need permission canDeleteTest
166: */
167: public void deleteAttachment(int idBddAction, int idBddAttach)
168: throws Exception;
169:
170: ////////////////////////////////////GET/////////////////////////////////////////
171:
172: /**
173: * Return a wrapped action represented by idBddAction in database
174: * @param idBddAction : unique identifier of the action in database
175: * @return Return a wrapped action represented by idBddAction in database
176: * @throws Exception
177: * no permission needed
178: */
179: public ActionWrapper getActionWrapper(int idBddAction)
180: throws Exception;
181:
182: /**
183: * Return an Array of ParameterWrapper used by an action identified by idBddAction
184: * @param idBddAction : unique identifier of the action in database
185: * @return a Vector of java.lang.String contening all parameters names used by this action
186: * @throws Exception
187: * no permission needed
188: */
189: public ParameterWrapper[] getParamsUses(int idBddAction)
190: throws Exception;
191:
192: /**
193: * Get all FileAttachment of an Action idntifed by idBddAction
194: * @param idBddAction : unique identifier of the action in database
195: * @return a Vector contening all FileAttachment (wrapped by FileAttachementWrapper) of action idBddActio
196: * @throws Exception
197: * @see org.objectweb.salome_tmf.api.data.FileAttachementWrapper
198: * no permission needed
199: */
200: public FileAttachementWrapper[] getAllAttachFile(int idBddAction)
201: throws Exception;
202:
203: /**
204: * Get all UrlAttachment of an Action idntifed by idBddAction
205: * @param idBddAction : unique identifier of the action in database
206: * @return a Vector contening all UrlAttachment (wrapped by UrlAttachementWrapper) of action idBddAction
207: * @throws Exception
208: * @see org.objectweb.salome_tmf.api.data.UrlAttachementWrapper
209: * no permission needed
210: */
211: public UrlAttachementWrapper[] getAllAttachUrl(int idBddAction)
212: throws Exception;
213:
214: /**
215: * Return the Id of an action called name in the test identified by testId
216: * @param testId
217: * @param actionName
218: * @return the Id of an action called name in the test identified by testId
219: * @throws Exception
220: * no permission needed
221: */
222: public int getID(int testId, String actionName) throws Exception;
223: }
|