au.edu.jcu.hermes.plugin.icat
Class ICATModel

java.lang.Object
  extended by au.edu.jcu.hermes.plugin.icat.ICATModel
All Implemented Interfaces:
IICATModel

public class ICATModel
extends java.lang.Object
implements IICATModel


Field Summary
protected  ICAT icat
          ICAT server connection.
 
Constructor Summary
ICATModel(ICAT icat, IEventShower eventShower)
          Constructor for unit tests so that we can pass in a local hibernate ICAT service instead of a normal connection.
ICATModel(IEventShower eventShower, IFileSystemModel fileSystemModel)
          Default Constructor.
 
Method Summary
 void addConnection(IICATConnector connector)
          Add a connection to an ICAT service.
 void addSuccessListener(java.awt.event.ActionListener actionListener)
          Add a listener to listen for function success.
 void changeConnection(IICATConnector connector)
          change the url connected to.
 java.util.List<DataSetStatus> getAllDataSetStatus()
          Get all the possible Data Set Status'.
 java.util.List<DataSetType> getAllDataSetTypes()
          Get all the possible Data Set Types.
 java.util.List<DataFileFormat> getAllFormats()
          Get all the possible Data File Formats.
 java.util.List<Instrument> getAllInstruments()
          Get all the possible Instruments.
 java.util.List<InvestigationType> getAllInvestigationTypes()
          Get all the possible Investigation Types.
 java.util.List<SampleParameter> getAllSampleParameters(long sampleId)
          Get all the parameters for the sample.
 java.util.List<Study> getAllStudies()
          
 java.util.List<StudyStatus> getAllStudyStatus()
          Get all the options for Study Status.
 java.util.List<IICATConnector> getConnections()
          Get the list of connections.
 DataFile getDataFileById(long id)
          Get the Data File that relates to the id.
 DataFileParameter getDataFileParameterById(long id)
          get the Data File Parameter that relates to the id.
 java.util.List<DataFile> getDataFiles(DataSet dataSet)
          Get a list of the Data Files in a Data Set.
 DataSet getDataSetById(long id)
          Get the Data Set that relates to the id.
 DataSetParameter getDataSetParameterById(long id)
          get the Data Set Parameter that relates to the id.
 java.util.List<DataSet> getDataSets(Investigation inv)
          Get a list of the data sets associated with an investigation.
 ICATObjectFactory getICATFactory()
          
 Investigation getInvestigationById(long id)
          Get the Investigation that relates to the id.
 java.util.List<Investigation> getInvestigations(Study study)
          Get a list of the investigations associated with a study.
 InvestigationType getInvType(java.lang.String invType)
          Get the details of an investigation type from the name.
 Sample getSampleById(long id)
          Get the Sample that relates to the id.
 SampleParameter getSampleParameterById(long id)
          Get the sample parameter that relates to the id.
 java.util.List<Sample> getSamples(Investigation inv)
          Get a list of the samples associated with an investigation.
 Study getStudyById(long id)
          Return the Study that relates the the id.
 DataFile newDataFile(long dataSetId)
          Add a Data File.
 DataFileParameter newDataFileParameter(long dataFileId)
          Add a Data File Parameter.
 DataSet newDataSet(long investigationId)
          Add a Data Set.
 DataSetParameter newDataSetParameter(long dataSetId)
          Add a Data Set Parameter.
 Investigation newInvestigation(long studyId)
          Add an Investigation.
 Sample newSample(long investigationId)
          Add a sample.
 SampleParameter newSampleParameter(long sampleId)
          Add a Sample Parameter.
 Study newStudy()
          Add a new study.
 void removeConnection(IICATConnector connector)
          Remove a connection to an ICAT service.
 void removeDataFile(long dataFileId)
          Delete a Data File.
 void removeDataFileParameter(long parameterId)
          Delete a Data File Parameter.
 void removeDataSet(long dataSetId)
          Delete a sample.
 void removeDataSetParameter(long parameterId)
          delete a data set Parameter.
 void removeInvestigation(long investigationId)
          Delete the Investigation.
 void removeSample(long sampleId)
          Delete a sample.
 void removeSampleParameter(long parameterId)
          delete a sample parameter.
 void removeStudy(long studyId)
          Delete the study.
 void updateDataFile(DataFile dataFile)
          Update a Data File.
 void updateDataFileParameter(DataFileParameter parameter)
          Update a Data File Parameter.
 DataSet updateDataSet(DataSet dataSet)
          Update a data set.
 void updateDataSetParameter(DataSetParameter parameter)
          update a data set Parameter.
 Investigation updateInvestigation(Investigation inv)
          Updates an investigation to the ICAT store.
 Sample updateSample(Sample sample)
          Update a sample.
 void updateSampleParameter(SampleParameter parameter)
          update a new sample parameter.
 Study updateStudy(Study study)
          Updates a study to the ICAT store.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

icat

protected ICAT icat
ICAT server connection.

Constructor Detail

ICATModel

public ICATModel(IEventShower eventShower,
                 IFileSystemModel fileSystemModel)
Default Constructor.

Parameters:
eventShower - - IEventShower allowing the model to throw messages to the view
fileSystemModel - - IFileSystemModel allowing the model to interact with a file system like SRB

ICATModel

public ICATModel(ICAT icat,
                 IEventShower eventShower)
Constructor for unit tests so that we can pass in a local hibernate ICAT service instead of a normal connection.

Parameters:
icat - - hibernate icat connection
Method Detail

changeConnection

public void changeConnection(IICATConnector connector)
change the url connected to.

Specified by:
changeConnection in interface IICATModel
Parameters:
connector - - IICATConnector

getICATFactory

public ICATObjectFactory getICATFactory()

Specified by:
getICATFactory in interface IICATModel
Returns:
the object factory for the ICAT schema.

getInvType

public InvestigationType getInvType(java.lang.String invType)
Get the details of an investigation type from the name.

Specified by:
getInvType in interface IICATModel
Parameters:
invType - - the name of the investigation type
Returns:
InvestigationType

getAllStudies

public java.util.List<Study> getAllStudies()

Specified by:
getAllStudies in interface IICATModel
Returns:
the list of studies in the ICAT store.

getStudyById

public Study getStudyById(long id)
Return the Study that relates the the id.

Specified by:
getStudyById in interface IICATModel
Parameters:
id - - long
Returns:
Study

removeStudy

public void removeStudy(long studyId)
Delete the study.

Specified by:
removeStudy in interface IICATModel
Parameters:
studyId - - long

newStudy

public Study newStudy()
Add a new study.

Specified by:
newStudy in interface IICATModel
Returns:
the new study object

updateStudy

public Study updateStudy(Study study)
Updates a study to the ICAT store.

Specified by:
updateStudy in interface IICATModel
Parameters:
study - - the new study object
Returns:
Study

getInvestigations

public java.util.List<Investigation> getInvestigations(Study study)
Get a list of the investigations associated with a study.

Specified by:
getInvestigations in interface IICATModel
Parameters:
study - - Study
Returns:
List of Investigation

getInvestigationById

public Investigation getInvestigationById(long id)
Get the Investigation that relates to the id.

Specified by:
getInvestigationById in interface IICATModel
Parameters:
id - - long
Returns:
Investigation

removeInvestigation

public void removeInvestigation(long investigationId)
Delete the Investigation.

Specified by:
removeInvestigation in interface IICATModel
Parameters:
investigationId - - long

newInvestigation

public Investigation newInvestigation(long studyId)
Add an Investigation.

Specified by:
newInvestigation in interface IICATModel
Parameters:
studyId - - long
Returns:
Investigation

updateInvestigation

public Investigation updateInvestigation(Investigation inv)
Updates an investigation to the ICAT store.

Specified by:
updateInvestigation in interface IICATModel
Parameters:
inv - - Investigation
Returns:
Investigation

getDataSets

public java.util.List<DataSet> getDataSets(Investigation inv)
Get a list of the data sets associated with an investigation.

Specified by:
getDataSets in interface IICATModel
Parameters:
inv - - Investigation
Returns:
List of DataSet

getDataSetById

public DataSet getDataSetById(long id)
Get the Data Set that relates to the id.

Specified by:
getDataSetById in interface IICATModel
Parameters:
id - - long
Returns:
DataSet

removeDataSet

public void removeDataSet(long dataSetId)
Delete a sample.

Specified by:
removeDataSet in interface IICATModel
Parameters:
dataSetId - - long

newDataSet

public DataSet newDataSet(long investigationId)
Add a Data Set.

Specified by:
newDataSet in interface IICATModel
Parameters:
investigationId - - long
Returns:
DataSet

updateDataSet

public DataSet updateDataSet(DataSet dataSet)
Update a data set.

Specified by:
updateDataSet in interface IICATModel
Parameters:
dataSet - - DataSet
Returns:
DataSet

getSamples

public java.util.List<Sample> getSamples(Investigation inv)
Get a list of the samples associated with an investigation.

Specified by:
getSamples in interface IICATModel
Parameters:
inv - - Investigation
Returns:
List of Sample

getSampleById

public Sample getSampleById(long id)
Get the Sample that relates to the id.

Specified by:
getSampleById in interface IICATModel
Parameters:
id - - long
Returns:
Sample

removeSample

public void removeSample(long sampleId)
Delete a sample.

Specified by:
removeSample in interface IICATModel
Parameters:
sampleId - - long

newSample

public Sample newSample(long investigationId)
Add a sample.

Specified by:
newSample in interface IICATModel
Parameters:
investigationId - - long
Returns:
Sample

updateSample

public Sample updateSample(Sample sample)
Update a sample.

Specified by:
updateSample in interface IICATModel
Parameters:
sample - - Sample
Returns:
Sample

getDataFiles

public java.util.List<DataFile> getDataFiles(DataSet dataSet)
Get a list of the Data Files in a Data Set.

Specified by:
getDataFiles in interface IICATModel
Parameters:
dataSet - - DataSet
Returns:
List of DataFile

newDataFile

public DataFile newDataFile(long dataSetId)
Add a Data File.

Specified by:
newDataFile in interface IICATModel
Parameters:
dataSetId - - long
Returns:
- DataFile

updateDataFile

public void updateDataFile(DataFile dataFile)
Update a Data File.

Specified by:
updateDataFile in interface IICATModel
Parameters:
dataFile - - DataFile

getDataFileById

public DataFile getDataFileById(long id)
Get the Data File that relates to the id.

Specified by:
getDataFileById in interface IICATModel
Parameters:
id - - long
Returns:
DataFile

removeDataFile

public void removeDataFile(long dataFileId)
Delete a Data File.

Specified by:
removeDataFile in interface IICATModel
Parameters:
dataFileId - - long

getDataFileParameterById

public DataFileParameter getDataFileParameterById(long id)
get the Data File Parameter that relates to the id.

Specified by:
getDataFileParameterById in interface IICATModel
Parameters:
id - - long
Returns:
DataFileParameter

newDataFileParameter

public DataFileParameter newDataFileParameter(long dataFileId)
Add a Data File Parameter.

Specified by:
newDataFileParameter in interface IICATModel
Parameters:
dataFileId - - long
Returns:
DataFileParameter

updateDataFileParameter

public void updateDataFileParameter(DataFileParameter parameter)
Update a Data File Parameter.

Specified by:
updateDataFileParameter in interface IICATModel
Parameters:
parameter - - DataFileParameter

removeDataFileParameter

public void removeDataFileParameter(long parameterId)
Delete a Data File Parameter.

Specified by:
removeDataFileParameter in interface IICATModel
Parameters:
parameterId - - long

getDataSetParameterById

public DataSetParameter getDataSetParameterById(long id)
get the Data Set Parameter that relates to the id.

Specified by:
getDataSetParameterById in interface IICATModel
Parameters:
id - - long
Returns:
DataSetParameter

newDataSetParameter

public DataSetParameter newDataSetParameter(long dataSetId)
Add a Data Set Parameter.

Specified by:
newDataSetParameter in interface IICATModel
Parameters:
dataSetId - - long
Returns:
DataSetParameter

updateDataSetParameter

public void updateDataSetParameter(DataSetParameter parameter)
update a data set Parameter.

Specified by:
updateDataSetParameter in interface IICATModel
Parameters:
parameter - - DataSetParameter

removeDataSetParameter

public void removeDataSetParameter(long parameterId)
delete a data set Parameter.

Specified by:
removeDataSetParameter in interface IICATModel
Parameters:
parameterId - - long

getSampleParameterById

public SampleParameter getSampleParameterById(long id)
Get the sample parameter that relates to the id.

Specified by:
getSampleParameterById in interface IICATModel
Parameters:
id - - long
Returns:
SampleParameter

getAllSampleParameters

public java.util.List<SampleParameter> getAllSampleParameters(long sampleId)
Get all the parameters for the sample.

Specified by:
getAllSampleParameters in interface IICATModel
Parameters:
sampleId - - long
Returns:
List of SampleParameter

newSampleParameter

public SampleParameter newSampleParameter(long sampleId)
Add a Sample Parameter.

Specified by:
newSampleParameter in interface IICATModel
Parameters:
sampleId - - long
Returns:
SampleParameter

updateSampleParameter

public void updateSampleParameter(SampleParameter parameter)
update a new sample parameter.

Specified by:
updateSampleParameter in interface IICATModel
Parameters:
parameter - - SampleParameter

removeSampleParameter

public void removeSampleParameter(long parameterId)
delete a sample parameter.

Specified by:
removeSampleParameter in interface IICATModel
Parameters:
parameterId - - long

getAllStudyStatus

public java.util.List<StudyStatus> getAllStudyStatus()
Get all the options for Study Status.

Specified by:
getAllStudyStatus in interface IICATModel
Returns:
List of StudyStatus

getAllInstruments

public java.util.List<Instrument> getAllInstruments()
Get all the possible Instruments.

Specified by:
getAllInstruments in interface IICATModel
Returns:
List of Instrument

getAllDataSetTypes

public java.util.List<DataSetType> getAllDataSetTypes()
Get all the possible Data Set Types.

Specified by:
getAllDataSetTypes in interface IICATModel
Returns:
List of DataSetType

getAllDataSetStatus

public java.util.List<DataSetStatus> getAllDataSetStatus()
Get all the possible Data Set Status'.

Specified by:
getAllDataSetStatus in interface IICATModel
Returns:
List of DataSetStatus

getAllInvestigationTypes

public java.util.List<InvestigationType> getAllInvestigationTypes()
Get all the possible Investigation Types.

Specified by:
getAllInvestigationTypes in interface IICATModel
Returns:
List of InvestigationType

getAllFormats

public java.util.List<DataFileFormat> getAllFormats()
Get all the possible Data File Formats.

Specified by:
getAllFormats in interface IICATModel
Returns:
List of DataFileFormat

addSuccessListener

public void addSuccessListener(java.awt.event.ActionListener actionListener)
Add a listener to listen for function success.

Specified by:
addSuccessListener in interface IICATModel
Parameters:
actionListener - - ActionListener

addConnection

public void addConnection(IICATConnector connector)
Add a connection to an ICAT service.

Specified by:
addConnection in interface IICATModel
Parameters:
connector - - IICATConnector

removeConnection

public void removeConnection(IICATConnector connector)
Remove a connection to an ICAT service.

Specified by:
removeConnection in interface IICATModel
Parameters:
connector - - IICATConnector

getConnections

public java.util.List<IICATConnector> getConnections()
Get the list of connections.

Specified by:
getConnections in interface IICATModel
Returns:
List of IICATConnector