PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 1ms app.codeStats 0ms

/pride-inspector/tags/0.2.0/src/main/java/uk/ac/ebi/pride/data/controller/DataAccessController.java

http://pride-toolsuite.googlecode.com/
Java | 362 lines | 67 code | 56 blank | 239 comment | 0 complexity | a1197ed3a3975967739bcc14ddeceefc MD5 | raw file
  1. package uk.ac.ebi.pride.data.controller;
  2. import uk.ac.ebi.pride.data.core.*;
  3. import uk.ac.ebi.pride.gui.utils.PropertyChangeHandler;
  4. import java.util.Collection;
  5. import java.util.List;
  6. /**
  7. * Created by IntelliJ IDEA.
  8. * User: rwang
  9. * Date: 09-Apr-2010
  10. * Time: 14:25:49
  11. */
  12. public interface DataAccessController extends PropertyChangeHandler {
  13. public static final String EXPERIMENT_TYPE = "Experiment";
  14. public static final String MZGRAPH_TYPE = "MzGraph";
  15. public static final String SPECTRUM_TYPE = "Spectrum";
  16. public static final String CHROMATOGRAM_TYPE = "Chromatogram";
  17. public static final String IDENTIFICATION_TYPE ="Identification";
  18. public static final String TWO_DIM_IDENTIFICATION_TYPE = "2D";
  19. public static final String GEL_FREE_IDENTIFICATION_TYPE = "Gel Free";
  20. public static final String FOREGROUND_EXPERIMENT_CHANGED = "foregroundExperiment";
  21. public static final String FOREGROUND_SPECTRUM_CHANGED = "foregroundSpectrum";
  22. public static final String FOREGROUND_CHROMATOGRAM_CHANGED = "foregroundChromatogram";
  23. public static final String FOREGROUND_TWODIM_IDENTIFICATION_CHANGED = "foregroundTwoDimIdent";
  24. public static final String FOREGROUND_GELFREE_IDENTIFICATION_CHANGED = "foregroundGelFreeIdent";
  25. public static final String DATA_SOURCE_RELOADED = "dataSourceReloaded";
  26. /** ========================================= Data accession section =========================================*/
  27. /**
  28. * Get an collection of cv lookups
  29. * @return Collection<CVLookup> a collection of cv lookups
  30. * @throws DataAccessException throw a exception when there is an error accessing the data source
  31. */
  32. public Collection<CVLookup> getCvLookups() throws DataAccessException;
  33. /**
  34. * Get file description object.
  35. * @return FileDescription FileDescription object
  36. * @throws DataAccessException throw a exception when there is an error accessing the data source
  37. */
  38. public FileDescription getFileDescription() throws DataAccessException;
  39. /**
  40. * Get the referenceable param group
  41. * @return ReferenceableParamGroup the referenceable param group
  42. * @throws DataAccessException throw a exception when there is an error accessing the data source
  43. */
  44. public ReferenceableParamGroup getReferenceableParamGroup() throws DataAccessException;
  45. /**
  46. * Get an collection of samples.
  47. * @return Collection<Sample> an colleciton of samples.
  48. * @throws DataAccessException throw a exception when there is an error accessing the data source
  49. */
  50. public Collection<Sample> getSamples() throws DataAccessException;
  51. /**
  52. * Get an collection of softwares.
  53. * @return Collection<Software> an collection of softwares.
  54. * @throws DataAccessException throw a exception when there is an error accessing the data source
  55. */
  56. public Collection<Software> getSoftware() throws DataAccessException;
  57. /**
  58. * Get an collection of scan settings.
  59. * @return Collection<ScanSetting> an collection of scan settings.
  60. * @throws DataAccessException throw a exception when there is an error accessing the data source
  61. */
  62. public Collection<ScanSetting> getScanSettings() throws DataAccessException;
  63. /**
  64. * Get an collection of instruments.
  65. * @return Collection<Instrument> an collection of instruments.
  66. * @throws DataAccessException throw a exception when there is an error accessing the data source
  67. */
  68. public Collection<InstrumentConfiguration> getInstrumentConfigurations() throws DataAccessException;
  69. /**
  70. * Get an collection of data processings.
  71. * @return Collection<DataProcessing> an collection of data processings.
  72. * @throws DataAccessException throw a exception when there is an error accessing the data source
  73. */
  74. public Collection<DataProcessing> getDataProcessings() throws DataAccessException;
  75. /**
  76. * Get an collection of experiment ids from data source
  77. * @return Collection<Comparable> a string collection of experiment ids
  78. * @throws DataAccessException throw a exception when there is an error accessing the data source
  79. */
  80. public Collection<Comparable> getExperimentAccs() throws DataAccessException;
  81. /**
  82. * Get an Experiment object via an experiment id
  83. * @param expAcc
  84. * @return Experiment an Experiment object which consists only the meta data
  85. * @throws DataAccessException throw a exception when there is an error accessing the data source
  86. */
  87. public Experiment getExperimentByAcc(Comparable expAcc) throws DataAccessException;
  88. /**
  89. * Get a meta object
  90. * @return MetaData meta data object
  91. * @throws DataAccessException throw a exception when there is an error accessing the data source
  92. */
  93. public MetaData getMetaData() throws DataAccessException;
  94. /**
  95. * Get a collection of spectrum ids
  96. * @return Collection a string collection of spectrum ids
  97. * @throws DataAccessException throw a exception when there is an error accessing the data source
  98. */
  99. public Collection<Comparable> getSpectrumIds() throws DataAccessException;
  100. /**
  101. * Get a Spectrum object via an spectrum id
  102. * @param id Spectrum id
  103. * @return Spectrum an Spectrum object
  104. * @throws DataAccessException throw a exception when there is an error accessing the data source
  105. */
  106. public Spectrum getSpectrumById(Comparable id) throws DataAccessException;
  107. /**
  108. * Get a collection of chromatogram ids.
  109. * @return Collection<Comparable> a string collection of chromatogram ids
  110. * @throws DataAccessException throw a exception when there is an error accessing the data source
  111. */
  112. public Collection<Comparable> getChromatogramIds() throws DataAccessException;
  113. /**
  114. * Get a Chromatogram object
  115. * @param id chromatogram string id
  116. * @return Chromatogram an chromatogram object
  117. * @throws DataAccessException throw a exception when there is an error accessing the data source
  118. */
  119. public Chromatogram getChromatogramById(Comparable id) throws DataAccessException;
  120. /**
  121. * Get a collection of two dimensional identification ids
  122. * @return Collection a string collection of two dimentional identification ids
  123. * @throws DataAccessException throw a exception when there is an error accessing the data source
  124. */
  125. public Collection<Comparable> getTwoDimIdentIds() throws DataAccessException;
  126. /**
  127. * Get a TwoDimIdentification object
  128. * @param id a string id of TwoDimIdentification
  129. * @return TwoDimIdentification an TwoDimIdentification object
  130. * @throws DataAccessException throw a exception when there is an error accessing the data source
  131. */
  132. public TwoDimIdentification getTwoDimIdentById(Comparable id) throws DataAccessException;
  133. /**
  134. * Get a collection of gel free identification ids.
  135. * @return Collection a string collection of gel free identification ids
  136. * @throws DataAccessException throw a exception when there is an error accessing the data source
  137. */
  138. public Collection<Comparable> getGelFreeIdentIds() throws DataAccessException;
  139. /**
  140. * Get an GelFreeIdentification object
  141. * @param id an string id of GelFreeIdentification
  142. * @return GelFreeIdentification an GelFreeIdentification object
  143. * @throws DataAccessException throw a exception when there is an error accessing the data source
  144. */
  145. public GelFreeIdentification getGelFreeIdentById(Comparable id) throws DataAccessException;
  146. //Todo: getDefaultInstrument() from mzML's run element
  147. //Todo: getDefaultSample() from mzML's run element
  148. //Todo: getDefaultSpectrumDataProcessing() from mzML's spectrumList element
  149. //Todo: getDefaultChromatogramDataProcessing() from mzML's chromatogramList element
  150. /** ========================================= Description section =========================================*/
  151. /**
  152. * Get the display name for this controller, for GUI
  153. * @return String the name of this DataAccessController
  154. */
  155. public String getName();
  156. /**
  157. * Set the name of this DataAccessionController
  158. * @param name the new name for this DataAccessController
  159. */
  160. public void setName(String name);
  161. /**
  162. * Get the type of database access controller.
  163. * @return DataAccessControllerType controller type.
  164. */
  165. public DataAccessControllerType getType();
  166. /**
  167. * Set the type of database access controller.
  168. * @param type controller type.
  169. */
  170. public void setType(DataAccessControllerType type);
  171. /**
  172. * Get the description for this controller, for GUI
  173. * @return String the description of this controller
  174. */
  175. public String getDescription();
  176. /**
  177. * Set the description for this controller, for GUI
  178. * @param desc the new description for the controller
  179. */
  180. public void setDescription(String desc);
  181. /**
  182. * Get the original data source object
  183. * @return Object data source object
  184. */
  185. public Object getSource();
  186. /**
  187. * Set the orginal data source object
  188. * @param src data source object
  189. */
  190. public void setSource(Object src);
  191. /**
  192. * Whether this controller contains identifications
  193. * @return boolean return true if identifications exist
  194. */
  195. public boolean hasIdentification();
  196. /**
  197. * Whether this controller contains spectra
  198. * @return boolean return true if spectra exist
  199. */
  200. public boolean hasSpectrum();
  201. /**
  202. * Whether this controller contains chromatogram.
  203. * @return boolean return true if chromatogram exist.
  204. */
  205. public boolean hasChromatogram();
  206. /**
  207. * Get the current foreground experiment id
  208. * @return Experiment foreground experiment id.
  209. */
  210. public Comparable getForegroundExperimentAcc();
  211. /**
  212. * Set a new foreground experiment id
  213. * @param expId experiment id
  214. * @throws DataAccessException throw a exception when there is an error accessing the data source
  215. */
  216. public void setForegroundExperimentAcc(Comparable expId) throws DataAccessException;
  217. /**
  218. * Get the current foreground chromatogram
  219. * @return Chromatogram foreground chromatogram object
  220. */
  221. public Chromatogram getForegroundChromatogram();
  222. /**
  223. * Set a new foreground chromatogram using id.
  224. * @param chromaId chromatogram id
  225. * @throws DataAccessException throw a exception when there is an error accessing the data source
  226. */
  227. public void setForegroundChromatogramById(Comparable chromaId) throws DataAccessException;
  228. /**
  229. * Get the current foreground spectrum.
  230. * @return Spectrum foreground spectrum
  231. */
  232. public Spectrum getForegroundSpectrum();
  233. /**
  234. * Set a foreground spectrum using id
  235. * @param specId spectrum id
  236. * @throws DataAccessException throw a exception when there is an error accessing the data source
  237. */
  238. public void setForegroundSpectrumById(Comparable specId) throws DataAccessException;
  239. /**
  240. * Get the foreground mz graph, can be either spectrum or chromatogram
  241. *
  242. * @param classType classes that extends MzGraph
  243. * @return MzGraph foreground MzGraph object.
  244. */
  245. public MzGraph getForegroundMzGraph(Class<? extends MzGraph> classType);
  246. /**
  247. * Get the foreground two dimensional identification
  248. * @return TwoDimIdentification two dimensional identification object
  249. */
  250. public TwoDimIdentification getForegroundTwoDimIdent();
  251. /**
  252. * Set a new foreground two dimensional identification using accession.
  253. * @param identId identification id
  254. * @throws DataAccessException throw a exception when there is an error accessing the data source
  255. */
  256. public void setForegroundTwoDimIdentById(Comparable identId) throws DataAccessException;
  257. /**
  258. * Get a foreground gel free identification using accession.
  259. * @return GelFreeIdentificaiton Gel free identification object
  260. */
  261. public GelFreeIdentification getForegroundGelFreeIdent();
  262. /**
  263. * Set a new foregound gel free identification using accessioin.
  264. * @param identId gel free identification accession.
  265. * @throws DataAccessException throw a exception when there is an error accessing the data source
  266. */
  267. public void setForegroundGelFreeIdentById(Comparable identId) throws DataAccessException;
  268. /**
  269. * Get the total number of identifications.
  270. *
  271. * @return int the number of identifications.
  272. * @throws DataAccessException data access exception.
  273. */
  274. public int getNumberOfIdentifications() throws DataAccessException;
  275. /**
  276. * Get identifications by index, this combines both two dimensional and gel free identifications.
  277. *
  278. * @param start start index.
  279. * @param offset number of identification to get.
  280. * @return List<Identification> list of identifications.
  281. * @throws DataAccessException data access exception.
  282. */
  283. public List<Identification> getIdentificationsByIndex(int start, int offset) throws DataAccessException;
  284. /**
  285. * Get the number of gel free identifications.
  286. *
  287. * @return int the number of gel free identifications.
  288. * @throws DataAccessException data access exception.
  289. */
  290. public int getNumberOfGelFreeIdentifications() throws DataAccessException;
  291. /**
  292. * Get the number of two dimensional identifications.
  293. *
  294. * @return int the number of two dimensional identifications.
  295. * @throws DataAccessException data access exception.
  296. */
  297. public int getNumberOfTwoDimIdentifications() throws DataAccessException;
  298. /**
  299. * Reload this data access controller from the source.
  300. */
  301. public void reload() throws DataAccessException;
  302. /**
  303. * shutdown this controller, release all the resources.
  304. */
  305. public void close();
  306. }