001    /** =====================================================================       
002    *
003    *  File Name : $Id: FaultService.java,v 1.10 2008/01/15 11:08:16 cb Exp $
004    *
005    *  Description
006    *  -----------
007    *
008    *  See javadoc comment 
009    * 
010    *  =====================================================================
011    *
012    *   @Author : Craige Bevil 
013    *             Control Software Group
014    *             Isaac Newton Group of Telescopes
015    *
016    *  =====================================================================
017    *
018    *     Modification Log
019    *
020    *     Vers         Date        Author       Reason
021    *     ----         ----        ------       ------
022    *      1                       C.Bevil      First Release
023    *
024    *     Commissioning Notes
025    *     -------------------
026    *
027    *     None
028    *     
029    *  =====================================================================
030    *
031    *     @Version   : $Id: FaultService.java,v 1.10 2008/01/15 11:08:16 cb Exp $
032    *
033    *     @Author    : $Author: cb $
034    *
035    *     Header     : $Header: /opt/INGsrc/src/CVS/softproj/FaultDatabase/src/FaultDatabase/FaultDatabase/src/GWTApplication/client/FaultService.java,v 1.10 2008/01/15 11:08:16 cb Exp $
036    *
037    *     Log        : $Log: FaultService.java,v $
038    *     Log        : Revision 1.10  2008/01/15 11:08:16  cb
039    *     Log        : Ran through PMD and sorted out the javadoc so that we could export the
040    *     Log        : javadoc to the javadoc repository.
041    *     Log        :
042    *     Log        : Revision 1.9  2007/12/12 15:23:37  cb
043    *     Log        : Added the new printer option
044    *     Log        :
045    *     Log        : Revision 1.8  2007/10/18 08:43:50  cb
046    *     Log        : Support for decommissioned instruments has been added to the system
047    *     Log        :
048    *     Log        : Revision 1.7  2007/10/08 15:39:10  cb
049    *     Log        : Added the method which can be used to send an email to the user to
050    *     Log        : inform him that a fault has been changed to the servlet interface
051    *     Log        :
052    *     Log        : Revision 1.6  2007/10/08 09:32:50  cb
053    *     Log        : Modified to allow and review the user to change the faults which he is
054    *     Log        : subscribed to.
055    *     Log        :
056    *     Log        : Revision 1.5  2007/08/23 15:28:23  cb
057    *     Log        : Modified the createFault method to raise an exception if the fault
058    *     Log        : could not be raised.
059    *     Log        :
060    *     Log        : Revision 1.4  2007/08/17 14:26:44  cb
061    *     Log        : Updated for lastest prototype incorporating a lot of Nikos comments
062    *     Log        :
063    *     Log        : Revision 1.3  2007/08/01 13:00:07  cb
064    *     Log        : First prototype after import
065    *     Log        :
066    *     Log        : Revision 1.2  2007/07/13 10:54:08  cb
067    *     Log        : Complete interface prototype
068    *     Log        :
069    *     Log        : Revision 1.1.1.1  2007/06/01 08:33:26  cb
070    *     Log        : Imported using TkCVS
071    *     Log        :
072    *
073    * =====================================================================*/
074    
075    package GWTApplication.client;
076    
077    import com.google.gwt.user.client.rpc.RemoteService;
078    import java.util.*;
079    
080    public interface FaultService extends RemoteService {
081    
082        /**
083         * @gwt.typeArgs <GWTApplication.client.Person> 
084         */
085    
086        public ArrayList getTelescopeOperators(boolean getOldStaff) throws UnableToGetListException;
087    
088        /**
089         * @gwt.typeArgs <GWTApplication.client.Person> 
090         */
091    
092        public ArrayList getDutyTechnicians(boolean getOldStaff) throws UnableToGetListException;
093    
094        /**
095         * @gwt.typeArgs <GWTApplication.client.Person> 
096         */
097    
098        public ArrayList getSupportAstronomers(boolean getOldStaff) throws UnableToGetListException;
099    
100        /**
101         * @gwt.typeArgs <GWTApplication.client.Site>
102         */
103    
104        public ArrayList getSites() throws UnableToGetListException;
105    
106        /**
107         * @gwt.typeArgs <GWTApplication.client.State>
108         */
109    
110        public ArrayList getStates() throws UnableToGetListException;
111        
112        /**
113         * Return the names of all of the instrument  to the
114         * caller which are recalled from the fault database table. 
115         * <b>INSTRUMENT</b>. 
116         * <P>
117         * @return ArrayList A array which contains objects of type
118         * <b>Instrument</b>.
119         * @gwt.typeArgs <GWTApplication.client.Instrument>
120         */
121        
122        public ArrayList getInstruments(boolean allInstruments) throws UnableToGetListException;
123    
124        /**
125         * Return the names of all of the severity  to the
126         * caller which are recalled from the fault database table. 
127         * <b>SEVERITY</b>. 
128         * <P>
129         * @return ArrayList A array which contains objects of type
130         * <b>Severity</b>.
131         * @gwt.typeArgs <GWTApplication.client.Severity>
132         */
133        
134        public ArrayList getSeverity() throws UnableToGetListException;
135    
136        /**
137         * Return the names of all of the FaultType  to the
138         * caller which are recalled from the fault database table. 
139         * <b>FAULTTYPE</b>. 
140         * <P>
141         * @return ArrayList A array which contains objects of type
142         * <b>FaultType</b>.
143         * @gwt.typeArgs <GWTApplication.client.FaultType>
144         */
145        
146        public ArrayList getFaultType() throws UnableToGetListException;
147    
148            /**
149         * Return the names of all of the system to the
150         * caller which are recalled from the fault database table. 
151         * <b>SITES</b>. 
152         * <P>
153         * @return ArrayList A array which contains objects of type
154         * <b>System</b>.
155         * @gwt.typeArgs <GWTApplication.client.FDBSystem>
156         */
157        
158        public ArrayList getSystems() throws UnableToGetListException;
159    
160        /**
161         * Return the names of all of the staff members to the
162         * caller which are recalled from the fault database table. 
163         * <b>STAFFMEMBER</b>. 
164         * <P>
165         * 
166         * @return ArrayList A array which contains objects of type
167         * <b>Person</b>.
168         * @gwt.typeArgs <GWTApplication.client.Person> 
169         */
170    
171        public ArrayList getStaffMembers(boolean getOldStaff) throws UnableToGetListException;
172        
173        public Integer createFault (Fault newFault) throws UnableToCreateFaultException;
174    
175        /**
176         * Get all faults which go back to a specific date which has been
177         * specified by the caller.
178         * <P>
179         * @param TimeWindow The date which we are to search back to. If this is set
180         * to null then we search for all outstanding faults.
181         * @param locale The locale in which we are to search in. 
182         * @return ArrayList This is an array of type fault which will
183         * contain the details of all of the faults which were found as
184         * part of the search. 
185         * @gwt.typeArgs  <GWTApplication.client.Fault>
186         */
187        
188        public ArrayList getQuickViewFaultData (final int TimeWindow,final String locale);
189        
190        public boolean updateFault(final Fault updatedFault,final String locale) throws UnableToUpdateFaultException;
191        
192        public Fault getFaultDetails(final Integer defectNumber,final String locale);
193    
194        public Solution getSolutionDetails (final Integer DefectNumber);
195    
196        public String calculateTotalAmountOfTimeSpentOnFault (final int FaultNumber);
197    
198        public void updateSolutionDetails(final Solution NewSolutionDetails);
199    
200        public Workaround getWorkaroundDetails (final Integer DefectNumber);
201        
202        public void updateWorkaroundDetails(final Workaround NewWorkaroundDetails);
203    
204        public void updateCommentDetails(final Comment NewCommentDetails);
205    
206        /**
207         * Get all of the comments which are associated with the specified fault 
208         * <P>
209         * @param DefectNumber The defect number of the fault 
210         * @return ArrayList This is an array of type comment which will
211         * contain the details of all of the comments which were found as
212         * part of the database query. 
213         * @gwt.typeArgs <GWTApplication.client.Comment>
214         */
215        
216        public ArrayList getCommentDetails (final Integer DefectNumber);
217    
218        public AuthenticationDetails authenticateUser (final String UserIdentifier, final String Password) throws UserAuthenticationFailedException;
219    
220        /**
221         * Get the list of people who are not in the group specified. 
222         * <P>
223         * @param GroupToExclude The name of the group which contains the people that are to be excluded
224         * @return ArrayList An ArrayList of type Person.
225         * @gwt.typeArgs <GWTApplication.client.Person> 
226         */
227    
228        public ArrayList getMembersOfStaffNotInGroup(final Integer GroupToExclude) throws UnableToGetListException;
229    
230        public void addNewInstrumentToSystem (String newInstrument) throws UnableToAddInstrumentException;
231        
232        public void addNewSystemToSystem (String newSystem) throws UnableToAddSystemException;
233    
234        public void addNewRole (String emailAddress,Integer Role) throws UnableToAddNewRoleException;
235    
236        public void addNewUser(final String Name, final String Surname, final String EmailAddress) throws UnableToAddNewUserException;
237    
238        public void resetPassword(final String emailAddress, final String confirmedPassword) throws UnableToChangePasswordException;    
239    
240        public void linkFault(final int parentFaultId, final int childFaultId) throws UnknownFaultSpecifiedException,Exception;
241        
242        /**
243         * Will be used to execute a basic search across the database
244         * using the input data which has been provided
245         * @param DefectNumber This is the defect number for which we
246         * should return the  fault information. 
247         * @param SearchTerms A list of search terms which will be used to
248         * index the fault information. 
249         * @param StartDate This is the start date from when to look
250         * from. This could be left blank. 
251         * @param EndDate This is the end date from when to stop looking
252         * for faults. 
253         * @param locale This is the locale which the user has selected 
254         * @gwt.typeArgs <GWTApplication.client.Fault>
255         */
256        
257        public ArrayList performBasicSearch (final int DefectNumber, 
258                                             final String SearchTerms, 
259                                             final String DefectToSearchFor,
260                                             final String StartDate, 
261                                             final String EndDate,
262                                             final String locale) throws UnableToPerformSearchException;
263    
264        public void registerForFaultUpdates (final String emailAddress,final int faultId);
265        
266        public boolean printFault (int faultId,String printer,boolean landscape) throws UnknownPrinterSpecifiedException;
267    
268        /**
269         * Perform an advanced search across the database using the
270         * search parameters which have been specified in the input array 
271         * @return ArrayList<Fault>  A list of the parameters which match
272         * the search criteria. 
273         * @gwt.typeArgs <GWTApplication.client.Fault>
274         * @gwt.typeArgs SearchParameters <java.lang.String>
275         */
276    
277        public ArrayList performAdvancedSearch (final HashMap SearchParameters,
278                                                final String StartDate, 
279                                                final String EndDate,
280                                                final String locale) throws UnableToPerformSearchException;
281    
282        /**
283         * Return a list of all of the printers which are currently
284         * accesible by this machine
285         * @return ArrayList<String> A list of the printers which can print
286         * postscript from this machine
287         * @gwt.typeArgs <java.lang.String>
288         */
289        
290        public ArrayList getPostscriptPrinters ();
291        
292        public void closeFault (int faultId) throws UnableToCloseFaultException;
293    
294        /**
295         * Gets a list of all of the faults which have been updated since
296         * the last time that the client checked to see if the faults
297         * which it is displaying has been updated. The epoch to check
298         * from is conveyed in the timeOfLastUpdateCheck parameter. 
299         * @return ArrayList<Fault> A list of the faults which have been
300         * updated. 
301         * @gwt.typeArgs <GWTApplication.client.FaultUpdateSnapshot>
302         */
303        
304        public FaultUpdateSnapshot getFaultsUpdated (final Date timeOfLastUpdateCheck, final String locale);     
305        
306        public Boolean faultExists(final int faultId, final boolean isEditable);
307        
308    
309        /**
310         * Deliver the full details of a fault back to the caller 
311         */
312        
313        public FaultEntryDetails getFullFaultHistory (final int defectNumber,final String locale);
314    
315        /**
316         * This is used to get a list of the faults which the user specified is subscribed to 
317         * @param authenticationDetails The details of the person that has logged into the system. 
318         * @return ArrayList<Fault> This is a list of faults which the user is subscribed to 
319         * @gwt.typeArgs <GWTApplication.client.Fault>          
320         */
321        
322        public ArrayList getSubscribedFaults(final AuthenticationDetails authenticationDetails,final String locale);
323        
324        public void updateFaultSubscriptionList (final AuthenticationDetails authenticationDetails, final HashMap newSubscriptionStatuses);
325        
326        public void informEmailListenersFaultHasChanged(String ContextMessage, final int FaultNumber);
327        
328    }