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: import java.sql.Date;
028:
029: import org.objectweb.salome_tmf.api.data.SalomeFileWrapper;
030:
031: public interface ISQLScript extends Remote {
032:
033: /**
034: * Insert a new script in the table SCRIPT (No attachment are mapped)
035: * @param name : the name of the script
036: * @param arg1 : argument 1 of the script (free use for plug-in)
037: * @param extension : argument 2 of the script (plugin extension)
038: * @param type : type of the script
039: * (ApiConstants.TEST_SCRIPT, ApiConstants.INIT_SCRIPT, ApiConstants.PRE_SCRIPT, ApiConstants.POST_SCRIPT)
040: * @return the id of the new Script
041: * @throws Exception
042: */
043: public int insert(String name, String arg1, String extension,
044: String type) throws Exception;
045:
046: /**
047: * Insert a new script in the table SCRIPT (No attachment are mapped) for an Environnement
048: * @param name : the name of the script
049: * @param arg1 : argument 1 of the script (free use for plug-in)
050: * @param extension : argument 2 of the script (plugin extension)
051: * @param type : type of the script
052: * @param idEnv : id of the Environnement mapped with the script
053: * (ApiConstants.TEST_SCRIPT, ApiConstants.INIT_SCRIPT, ApiConstants.PRE_SCRIPT, ApiConstants.POST_SCRIPT)
054: * @return the id of the new Script
055: * @throws Exception
056: */
057: public int insert(String name, String arg1, String extension,
058: String type, int idEnv) throws Exception;
059:
060: /**
061: * Insert a new script in the table SCRIPT (No attachment are mapped) for an EXECUTION
062: * @param name : the name of the script
063: * @param arg1 : argument 1 of the script (free use for plug-in)
064: * @param extension : argument 2 of the script (plugin extension)
065: * @param type : type of the script
066: * @param idEnv : id of the Environnement mapped with the script
067: * (ApiConstants.TEST_SCRIPT, ApiConstants.INIT_SCRIPT, ApiConstants.PRE_SCRIPT, ApiConstants.POST_SCRIPT)
068: * @return the id of the new Script
069: * @throws Exception
070: */
071: public int insert(int idExec, String name, String arg1,
072: String extension, String type) throws Exception;
073:
074: /**
075: * Map the attachment attachId to the script scriptId in the table SCRIPT_ATTACHEMENT
076: * @param scriptId
077: * @param attachId
078: * @throws Exception
079: */
080: public void addAttach(int scriptId, int attachId) throws Exception;
081:
082: /**
083: * Update the length of the script idScript in the database
084: * @param idScript
085: * @param length
086: * @throws Exception
087: * no permission needed
088: */
089: public void updateLength(int idScript, long length)
090: throws Exception;
091:
092: /**
093: * Update the date of the script idScript in the database
094: * @param idScript
095: * @param date
096: * @throws Exception
097: * no permission needed
098: */
099: public void updateDate(int idScript, Date date) throws Exception;
100:
101: /**
102: * Update the argument reserved for plugin in the script idScript in the database
103: * @param idScript
104: * @param arg
105: * @throws Exception
106: * no permission needed
107: */
108: public void updatePlugArg(int idScript, String arg)
109: throws Exception;
110:
111: /**
112: * Update the conetent of the script id with the content of the file with path filePath
113: * @param idScript
114: * @param filePath
115: * @throws Exception
116: * @see ISQLFileAttachment.updateFileContent(int,BufferedInputStream);
117: * no permission needed
118: */
119: public void updateContent(int idScript, String filePath)
120: throws Exception;
121:
122: /**
123: * Update the script attachement (content, date size, and name) In Database
124: * @param idScript
125: * @param filePath
126: * @throws Exception
127: * @see ISQLFileAttachment.updateFile(int, File);
128: * no permission needed
129: */
130: public void update(int idScript, String filePath) throws Exception;
131:
132: /**
133: * Update the script attachement (content, date size, and name) In Database
134: * @param idScript
135: * @param File
136: * @throws Exception
137: * @see ISQLFileAttachment.updateFile(int, File);
138: * no permission needed
139: */
140: public void update(int idScript, SalomeFileWrapper file)
141: throws Exception;
142:
143: /**
144: * Update the Script name the table SCRIPT and ATTACHEMENT
145: * @param idScript
146: * @param name
147: * @throws Exception
148: * @see ISQLFileAttachment.updateFileName(int, String);
149: * no permission needed
150: */
151: public void updateName(int idScript, String name) throws Exception;
152:
153: /**
154: * Delete the script and mapped file in the tables ( SCRIPT, SCRIPT_ATTACHEMENT, ATTACHEMENT)
155: * @param idScript
156: * @param idAttach
157: * @throws Exception
158: * @see ISQLAttachment().delete(int)
159: */
160: public void delete(int idScript) throws Exception;
161:
162: /**
163: * @return the last id of an attachment in the table SCRIPT_ATTACHEMENT
164: * @throws Exception
165: */
166: public int getLastIdAttach() throws Exception;
167:
168: /**
169: * @param idScript : id of the script in the database
170: * @return the id of the attachment mapped to the script in the database
171: * @throws Exception
172: */
173: public int getScriptIdAttach(int idScript) throws Exception;
174:
175: /**
176: * @param idScript : id of the script in the database
177: * @return a SalomeFileWrapper attached to the script
178: * @throws Exception
179: * @see ISQLFileAttachment.getFile(int)
180: */
181: public SalomeFileWrapper getFile(int idScript) throws Exception;
182:
183: /**
184: * @param idScript : id of the script in the database
185: * @return a SalomeFileWrapper attached to the script
186: * @throws Exception
187: * @see ISQLFileAttachment.getFile(int)
188: */
189: //public SalomeFileWrapper getFile(int idScript, String path) throws Exception ;
190: }
|