001: package salomeTMF_plug.mantis.sqlWrapper;
002:
003: import java.util.Hashtable;
004: import java.util.Vector;
005:
006: import org.objectweb.salome_tmf.data.Environment;
007: import org.objectweb.salome_tmf.data.Project;
008: import org.objectweb.salome_tmf.data.User;
009:
010: public interface MantisConnector {
011:
012: public void initConnector(String driver, String url_db,
013: String user, String pwd) throws Exception;
014:
015: /**
016: *
017: * @param user_login
018: * @return ID of user_login in Mantis or -1 if not exist
019: * @throws Exception
020: */
021: public int getUserID(String user_login) throws Exception;
022:
023: /**
024: *
025: * @param user_login
026: * @param bugProjectID
027: * @return
028: * @throws Exception
029: */
030: public int getUserIDInProject(String user_login, int bugProjectID)
031: throws Exception;
032:
033: /**
034: *
035: * @param project_name
036: * @return ID of project_name in Mantis or -1 if not exist
037: * @throws Exception
038: */
039: public int getProjectID(String project_name) throws Exception;
040:
041: /**
042: *
043: * @param bugUsrID
044: * @param bugProjectID
045: * @return the acces level of the user bugUsrID in the project bugProjectID or -1 if not exist
046: * @throws Exception
047: */
048: public int getUserAccesLevel(int bugUsrID, int bugProjectID)
049: throws Exception;
050:
051: /**
052: * Add user in the mantis with access_level = viewer
053: * @param pUser
054: * @param bugProjectID
055: * @return the new user id in Mantis
056: * @throws Exception
057: */
058: public int addUser(User pUser) throws Exception;
059:
060: /**
061: * Add project in mantis
062: * @param project
063: * @return the new id of the project
064: * @throws Exception
065: */
066: public int addProject(Project project) throws Exception;
067:
068: /**
069: * Add user in the mantis project with specified access_level
070: * @param bugUsrID
071: * @param bugProjectID
072: * @param access_level
073: * @throws Exception
074: */
075: public void addUserInProject(int bugUsrID, int bugProjectID,
076: int access_level) throws Exception;
077:
078: /**
079: * Add default environnement name ___NO_ENV___ in the specified Mantis project
080: * @param bugProjectID
081: * @throws Exception
082: */
083: public void addDefaultEnvToProject(int bugProjectID)
084: throws Exception;
085:
086: /**
087: * Add Component in Mantis
088: * @param name
089: * @param description
090: * @param bugProjectID
091: * @throws Exception
092: */
093: public void addEnvironment(String name, String description,
094: int bugProjectID) throws Exception;
095:
096: /**
097: * Add Component in Mantis
098: * @param environment
099: * @param bugProjectID
100: * @throws Exception
101: */
102: public void addEnvironment(Environment environment, int bugProjectID)
103: throws Exception;
104:
105: /**
106: * Add relation between defect bugSource <--> bugDest
107: * @param bugSource
108: * @param bugDest
109: * @throws Exception
110: */
111: public void addDefectLink(int bugUsrID, int bugSource, int bugDest)
112: throws Exception;
113:
114: /**
115: * delete relation between defect bugSource <--> bugDest
116: * @param bugSource
117: * @param bugDest
118: * @throws Exception
119: */
120: public void deleteDefectLink(int userID, int bugSource, int bugDest)
121: throws Exception;
122:
123: /**
124: * Update component name old_component with new_component and description (and reference)
125: * @param old_component
126: * @param new_component
127: * @param description
128: * @param bugProjectID
129: * @throws Exception
130: */
131: public void updateEnvironment(String old_component,
132: String new_component, String description, int bugProjectID)
133: throws Exception;
134:
135: public boolean isExistEnv(int bugProjectID, String envName)
136: throws Exception;
137:
138: /**
139: * Delete Component name environment and reference in Mantis DB
140: * @param environment
141: * @param bugProjectID
142: * @throws Exception
143: */
144: public void deleteEnvironment(String environment, int bugProjectID)
145: throws Exception;
146:
147: public int addDefect(int bugUsrID, int bugProjectID,
148: int assigned_to_ID, String long_desc, String url_attach,
149: String short_desc, String bug_OS, int bug_priority,
150: String bug_platform, int bug_reproductibility,
151: int bug_severity, String component) throws Exception;
152:
153: public void updateDefect(int bugUsrID, int bugProjectID, int bugID,
154: int id_assigned_to, String long_desc, int id_bug_severity,
155: int id_bug_satus, String short_desc, String bug_OS,
156: int id_bug_priority, String bug_platform, String bug_env,
157: int id_bug_reproducibility, int id_bug_resolution)
158: throws Exception;
159:
160: public DefectWrapper getDefectInfo(int bugID) throws Exception;
161:
162: public Hashtable getProjectDefects(int bugProjectID)
163: throws Exception;
164:
165: /**
166: * Get a hashtable of defectwrapper representing all defects linked with bugID in the project bugProjectID
167: * @param bugProjectID
168: * @param bugID
169: * @return
170: * @throws Exception
171: */
172: public Hashtable getDefectLink(int bugProjectID, int bugID)
173: throws Exception;
174:
175: public Vector getBugTrackerAllUsers(int bugProjectID);
176:
177: public void suspend() throws Exception;
178:
179: /**
180: * Delete a bug (and all reference) from Mantis DB
181: * @param bugProjectID
182: * @param bugID
183: * @throws Exception
184: */
185: public void deleteDefect(int bugProjectID, int bugID)
186: throws Exception;
187:
188: /**
189: * Get a vector of HistoryWrapper represented bug History
190: * @param bugProjectID
191: * @param bugID
192: * @return
193: * @throws Exception
194: */
195: public Vector getBugHistory(int bugProjectID, int bugID)
196: throws Exception;
197:
198: }
|