au.edu.archer.services.icat.impl
Class ICATHibernateImpl

java.lang.Object
  extended by au.edu.archer.services.icat.AbstractICATClient
      extended by au.edu.archer.services.icat.impl.ICATHibernateImpl
All Implemented Interfaces:
ICAT, ICATHelpers, ICATLocationListener, ICATTraversal, SearchService, au.edu.jcu.hpc.srb.mcatext.notify.PathNotificationListener, java.util.EventListener, org.springframework.context.ApplicationListener

public class ICATHibernateImpl
extends AbstractICATClient
implements org.springframework.context.ApplicationListener, au.edu.jcu.hpc.srb.mcatext.notify.PathNotificationListener, ICATLocationListener

The implemention of the ICAT storage interface using JPA. Capable of receiving MCATExt notifications.

Author:
nigel

Constructor Summary
ICATHibernateImpl(javax.sql.DataSource dataSource, java.util.Map properties)
           
ICATHibernateImpl(org.hibernate.ejb.Ejb3Configuration ejb3Config)
           
 
Method Summary
 void collectionChanged(java.lang.String oldParentGroupName, java.lang.String oldDataGroupName, java.lang.String newParentGroupName, java.lang.String newDataGroupName)
           
 void collectionCreated(java.lang.String parentGroupName, java.lang.String dataGroupName)
           
 void collectionDeleted(java.lang.String parentGroupName, java.lang.String dataGroupName)
           
 void deleteDataFile(DataFile in)
          
 void deleteDataFileFormat(DataFileFormat in)
          
 void deleteDataFileParameter(DataFileParameter in)
          
 void deleteDataSet(DataSet in)
          
 void deleteDataSetParameter(DataSetParameter in)
          
 void deleteDataSetStatus(DataSetStatus in)
          
 void deleteDataSetType(DataSetType in)
          
 void deleteFacilityCycle(FacilityCycle in)
          
 void deleteFacilityUser(FacilityUser in)
          
 void deleteInstrument(Instrument in)
          
 void deleteInvestigation(Investigation in)
          
 void deleteInvestigationType(InvestigationType in)
          
 void deleteParameter(Parameter in)
          
 void deleteSample(Sample in)
          
 void deleteSampleParameter(SampleParameter in)
          
 void deleteStudy(Study in)
          
 void deleteStudyStatus(StudyStatus in)
          
protected  DataFile flattenDataFile(DataFile df)
           
protected  DataFileParameter flattenDataFileParameter(DataFileParameter dfp)
           
protected  DataSet flattenDataSet(DataSet ds, int levelsToPreserve)
           
protected  DataSetParameter flattenDataSetParameter(DataSetParameter dsp)
           
protected  Investigation flattenInvestigation(Investigation i, int levelsToPreserve)
          Convert study link to study ID, and cascade flattening dataset and samples, else clear.
protected  Sample flattenSample(Sample s)
           
protected  SampleParameter flattenSampleParameter(SampleParameter dfp)
           
protected  Study flattenStudy(Study s, int levelsToPreserve)
          Convert the references out of the study into ID references.
 java.util.List<DataFileFormat> getAllDataFileFormats()
          
 java.util.List<java.lang.String> getAllDataFileLocations()
          Get all the locations referenced in the iCAT.
 java.util.List<DataFileParameter> getAllDataFileParameters(java.lang.Integer dataFileID)
          
 java.util.List<DataFile> getAllDataFilesByDataSetId(java.lang.Integer dataSetID)
          
 java.util.List<java.lang.String> getAllDataSetLocations()
           
 java.util.List<DataSetParameter> getAllDataSetParameters(java.lang.Integer in)
          
 java.util.List<DataSet> getAllDataSetsByInvestigationId(java.lang.Integer investigationID)
          
 java.util.List<DataSetStatus> getAllDataSetStatus()
          
 java.util.List<DataSetType> getAllDataSetTypes()
          
 java.util.List<FacilityCycle> getAllFacilityCycles()
          
 java.util.List<FacilityUser> getAllFacilityUsers()
          
 java.util.List<Instrument> getAllInstruments()
          
 java.util.List<Investigation> getAllInvestigationsByStudyId(java.lang.Integer in)
          
 java.util.List<InvestigationType> getAllInvestigationTypes()
          
 java.util.List<Parameter> getAllParameters()
          
 java.util.List<Parameter> getAllParametersByType(boolean isSampleParameter, boolean isDataSetParameter, boolean isDataFileParameter)
          Returns the parameters for which the boolean parameters are true.
 java.util.List<SampleParameter> getAllSampleParameters(java.lang.Integer in)
          
 java.util.List<Sample> getAllSamplesByInvestigationId(java.lang.Integer in)
          
 java.util.List<Sample> getAllSamplesByInvestigationName(java.lang.String studyName, java.lang.String investigationName)
          
 java.util.List<Study> getAllStudies()
          
 java.util.List<StudyStatus> getAllStudyStatus()
          
 java.util.List<ClientLocationPair> getClients()
           
 DataFile getDataFileById(java.lang.Integer in)
          
 DataFile getDataFileByLocation(java.lang.String location)
          Get the Data file object associated with the given location URI.
 DataFile getDataFileByName(java.lang.String studyName, java.lang.String investigationName, java.lang.String datasetName, java.lang.String datafileName)
          Get the data file based on the names of it's path components in the icat structure.
 DataFileFormat getDataFileFormatById(java.lang.String name, java.lang.String version)
          
 java.util.List<DataFileFormat> getDataFileFormatByName(java.lang.String in)
          
 DataFileParameter getDataFileParameterById(java.lang.String name, java.lang.String units, java.lang.Integer dataFileID)
          
 DataSet getDataSetById(java.lang.Integer in)
          
 DataSet getDataSetByLocation(java.lang.String location)
          
 DataSet getDataSetByName(java.lang.String studyName, java.lang.String investigationName, java.lang.String datasetName)
          Lookup the dataset based on the path name components made up of study, investigation and dataset names.
 java.lang.Integer getDataSetIdByHandle(java.lang.String in)
          
 DataSetParameter getDataSetParameterById(java.lang.String name, java.lang.String units, java.lang.Integer dataSetID)
          
 DataSetStatus getDataSetStatusByName(java.lang.String in)
          
 DataSetType getDataSetTypeByName(java.lang.String in)
          
 javax.persistence.EntityManagerFactory getEntityManagerFactory()
           
 FacilityCycle getFacilityCycleByName(java.lang.String in)
          
 FacilityUser getFacilityUserById(java.lang.String in)
          
 Instrument getInstrumentByName(java.lang.String in)
          
 Investigation getInvestigationById(java.lang.Integer in)
          
 Investigation getInvestigationByLocation(java.lang.String location)
          
 Investigation getInvestigationByName(java.lang.String studyName, java.lang.String investigationName)
          Lookup the Investigation based on the path components of study name and investigation name.
 InvestigationType getInvestigationTypeByName(java.lang.String in)
          
 ICATObjectFactory getObjectFactory()
           
 Parameter getParameterById(java.lang.Integer in)
          
 Parameter getParameterByName(java.lang.String name, java.lang.String units)
          Gets the parameter with this name-unit key
 java.util.List<java.lang.String> getResourceUrlPrefixes()
           
 Sample getSampleById(java.lang.Integer in)
          
 Sample getSampleByName(java.lang.String studyName, java.lang.String investigationName, java.lang.String sampleName)
          
 SampleParameter getSampleParameterById(java.lang.String name, java.lang.String units, java.lang.Integer sampleID)
          
 ICATSecurityManager getSecurityManager()
          Security manager getter.
 Study getStudyById(java.lang.Integer in)
          
 Study getStudyByLocation(java.lang.String location)
          
 Study getStudyByName(java.lang.String in)
          
 StudyStatus getStudyStatusByName(java.lang.String in)
          
 void locationAdded(java.lang.String location)
          Method to be called when a location is added to the ICAT.
 void locationChanged(java.lang.String oldLocation, java.lang.String newLocation)
          Method to be called when a location is changed in the the ICAT.
 void locationRemoved(java.lang.String location)
          Method to be called when a location is removed from the ICAT.
 void objectChanged(java.lang.String oldParentName, java.lang.String oldName, java.lang.String newParentName, java.lang.String newName)
           
 void objectCreated(java.lang.String parentName, java.lang.String name)
           
 void objectDeleted(java.lang.String parentName, java.lang.String name)
           
 void onApplicationEvent(org.springframework.context.ApplicationEvent event)
          When the context finishes loading we need to register our notification requirements.
 java.util.List<DataFile> searchDataFile(SearchRequestType search)
          SEARCH SERVICES
 java.util.List<DataSet> searchDataSet(SearchRequestType search)
          Search datasets.
 java.util.List<Investigation> searchExperiment(SearchRequestType search)
          Search experiments.
 java.util.List<Study> searchProject(SearchRequestType search)
          Search project.
 java.util.List<Sample> searchSample(SearchRequestType search)
          Search samples.
 void setClients(java.util.List<ClientLocationPair> clients)
           
 void setSecurityManager(ICATSecurityManager securityManager)
          Used for setting the security manager used by this ICAT.
 void start()
           
 void stop()
           
 java.lang.String testCall(java.lang.String str1, java.lang.String str2)
          
 void triggerNotifications()
           
protected  DataFile unflattenDataFile(DataFile df, DataSet parentDS, javax.persistence.EntityManager em)
           
protected  DataFileParameter unflattenDataFileParameter(DataFileParameter dfp, DataFile parentDataFile, javax.persistence.EntityManager em)
           
protected  DataSet unflattenDataSet(DataSet ds, Investigation inv, javax.persistence.EntityManager em)
           
protected  DataSetParameter unflattenDataSetParameter(DataSetParameter dsp, DataSet parentDataSet, javax.persistence.EntityManager em)
           
protected  Investigation unflattenInvestigation(Investigation i, Study parentStudy, javax.persistence.EntityManager em)
          Convert parent ID link back into a reference, and unflattern any datasets or samples.
protected  Sample unflattenSample(Sample s, Investigation parentInv, javax.persistence.EntityManager em)
           
protected  SampleParameter unflattenSampleParameter(SampleParameter sp, Sample parent, javax.persistence.EntityManager em)
           
protected  Study unflattenStudy(Study s, javax.persistence.EntityManager em)
          Convert the references out of the Study from IDs to references.
 DataFile updateDataFile(DataFile in)
          Save the datafile object.
 DataFileFormat updateDataFileFormat(DataFileFormat in)
          Save the datafile format object.
 DataFileParameter updateDataFileParameter(DataFileParameter in)
          Save the datafile parameter object.
 DataSet updateDataSet(DataSet in)
          Save the dataset object.
 DataSetParameter updateDataSetParameter(DataSetParameter in)
          Save the dataset parameter object.
 DataSetStatus updateDataSetStatus(DataSetStatus in)
          Save the dataset status object.
 DataSetType updateDataSetType(DataSetType in)
          Save the dataset type object.
 FacilityCycle updateFacilityCycle(FacilityCycle in)
          Save the facility cycle object.
 FacilityUser updateFacilityUser(FacilityUser in)
          Save the facility user object.
 Instrument updateInstrument(Instrument in)
          Save the instrument object.
 Investigation updateInvestigation(Investigation in)
          Save the investigation object.
 InvestigationType updateInvestigationType(InvestigationType in)
          Save the investigation type object.
 Parameter updateParameter(Parameter in)
          Save the parameter, updating or creating if id is null or 0.
 Sample updateSample(Sample in)
          Save the study object.
 SampleParameter updateSampleParameter(SampleParameter in)
          Save the sample parameter object.
 Study updateStudy(Study in)
          Save the study object.
 StudyStatus updateStudyStatus(StudyStatus in)
          Save the study status object.
 
Methods inherited from class au.edu.archer.services.icat.AbstractICATClient
getDataFileFormatById, getDataFileParameterById, getDataFilesFor, getDataSetFor, getDataSetParameterById, getDataSetsFor, getDataSetsFor, getInvestigationFor, getInvestigationFor, getInvestigationsFor, getSamplesFor, getStudyFor, normaliseLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ICATHibernateImpl

public ICATHibernateImpl(javax.sql.DataSource dataSource,
                         java.util.Map properties)

ICATHibernateImpl

public ICATHibernateImpl(org.hibernate.ejb.Ejb3Configuration ejb3Config)
Method Detail

getEntityManagerFactory

public javax.persistence.EntityManagerFactory getEntityManagerFactory()

flattenStudy

protected Study flattenStudy(Study s,
                             int levelsToPreserve)
Convert the references out of the study into ID references. Investigation -> InvestigationID

Parameters:
s -
levelsToPreserve - TODO
Returns:
dereferenced Study object

unflattenStudy

protected Study unflattenStudy(Study s,
                               javax.persistence.EntityManager em)
                        throws java.net.MalformedURLException
Convert the references out of the Study from IDs to references. InvestigationID -> Investigation

Parameters:
s -
em -
Returns:
Throws:
java.net.MalformedURLException

flattenInvestigation

protected Investigation flattenInvestigation(Investigation i,
                                             int levelsToPreserve)
Convert study link to study ID, and cascade flattening dataset and samples, else clear.

Parameters:
i -
levelsToPreserve -
Returns:

unflattenInvestigation

protected Investigation unflattenInvestigation(Investigation i,
                                               Study parentStudy,
                                               javax.persistence.EntityManager em)
                                        throws java.net.MalformedURLException
Convert parent ID link back into a reference, and unflattern any datasets or samples.

Parameters:
i -
parentStudy -
em -
Returns:
Throws:
java.net.MalformedURLException

flattenSample

protected Sample flattenSample(Sample s)

unflattenSample

protected Sample unflattenSample(Sample s,
                                 Investigation parentInv,
                                 javax.persistence.EntityManager em)

flattenDataSet

protected DataSet flattenDataSet(DataSet ds,
                                 int levelsToPreserve)

unflattenDataSet

protected DataSet unflattenDataSet(DataSet ds,
                                   Investigation inv,
                                   javax.persistence.EntityManager em)
                            throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

flattenDataFile

protected DataFile flattenDataFile(DataFile df)

unflattenDataFile

protected DataFile unflattenDataFile(DataFile df,
                                     DataSet parentDS,
                                     javax.persistence.EntityManager em)
                              throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException

flattenDataFileParameter

protected DataFileParameter flattenDataFileParameter(DataFileParameter dfp)

unflattenDataFileParameter

protected DataFileParameter unflattenDataFileParameter(DataFileParameter dfp,
                                                       DataFile parentDataFile,
                                                       javax.persistence.EntityManager em)

flattenDataSetParameter

protected DataSetParameter flattenDataSetParameter(DataSetParameter dsp)

unflattenDataSetParameter

protected DataSetParameter unflattenDataSetParameter(DataSetParameter dsp,
                                                     DataSet parentDataSet,
                                                     javax.persistence.EntityManager em)

flattenSampleParameter

protected SampleParameter flattenSampleParameter(SampleParameter dfp)

unflattenSampleParameter

protected SampleParameter unflattenSampleParameter(SampleParameter sp,
                                                   Sample parent,
                                                   javax.persistence.EntityManager em)

testCall

public java.lang.String testCall(java.lang.String str1,
                                 java.lang.String str2)

Specified by:
testCall in interface ICAT

updateStudy

public Study updateStudy(Study in)
                  throws ICATServiceException
Save the study object. First unflatten, then persist, then flatten and return.

Specified by:
updateStudy in interface ICAT
Returns:
Throws:
ICATServiceException

updateStudyStatus

public StudyStatus updateStudyStatus(StudyStatus in)
                              throws ICATServiceException
Save the study status object. First unflatten, then persist, then flatten and return.

Specified by:
updateStudyStatus in interface ICAT
Returns:
Throws:
ICATServiceException

updateInvestigation

public Investigation updateInvestigation(Investigation in)
                                  throws ICATServiceException
Save the investigation object. First unflatten, then persist, then flatten and return.

Specified by:
updateInvestigation in interface ICAT
Returns:
Throws:
ICATServiceException

updateInvestigationType

public InvestigationType updateInvestigationType(InvestigationType in)
                                          throws ICATServiceException
Save the investigation type object. First unflatten, then persist, then flatten and return.

Specified by:
updateInvestigationType in interface ICAT
Returns:
Throws:
ICATServiceException

updateSample

public Sample updateSample(Sample in)
                    throws ICATServiceException
Save the study object. First unflatten, then persist, then flatten and return.

Specified by:
updateSample in interface ICAT
Returns:
Throws:
ICATServiceException

updateDataSet

public DataSet updateDataSet(DataSet in)
                      throws ICATServiceException
Save the dataset object. First unflatten, then persist, then flatten and return.

Specified by:
updateDataSet in interface ICAT
Returns:
Throws:
ICATServiceException

updateDataSetType

public DataSetType updateDataSetType(DataSetType in)
                              throws ICATServiceException
Save the dataset type object. First unflatten, then persist, then flatten and return.

Specified by:
updateDataSetType in interface ICAT
Returns:
Throws:
ICATServiceException

updateDataSetStatus

public DataSetStatus updateDataSetStatus(DataSetStatus in)
                                  throws ICATServiceException
Save the dataset status object. First unflatten, then persist, then flatten and return.

Specified by:
updateDataSetStatus in interface ICAT
Returns:
Throws:
ICATServiceException

updateDataFile

public DataFile updateDataFile(DataFile in)
                        throws ICATServiceException
Save the datafile object. First unflatten, then persist, then flatten and return.

Specified by:
updateDataFile in interface ICAT
Returns:
Throws:
ICATServiceException

updateDataFileFormat

public DataFileFormat updateDataFileFormat(DataFileFormat in)
                                    throws ICATServiceException
Save the datafile format object. First unflatten, then persist, then flatten and return.

Specified by:
updateDataFileFormat in interface ICAT
Returns:
Throws:
ICATServiceException

updateDataFileParameter

public DataFileParameter updateDataFileParameter(DataFileParameter in)
                                          throws ICATServiceException
Save the datafile parameter object. First unflatten, then persist, then flatten and return.

Specified by:
updateDataFileParameter in interface ICAT
Returns:
Throws:
ICATServiceException

updateInstrument

public Instrument updateInstrument(Instrument in)
                            throws ICATServiceException
Save the instrument object. First unflatten, then persist, then flatten and return.

Specified by:
updateInstrument in interface ICAT
Returns:
Throws:
ICATServiceException

updateFacilityCycle

public FacilityCycle updateFacilityCycle(FacilityCycle in)
                                  throws ICATServiceException
Save the facility cycle object. First unflatten, then persist, then flatten and return.

Specified by:
updateFacilityCycle in interface ICAT
Returns:
Throws:
ICATServiceException

updateFacilityUser

public FacilityUser updateFacilityUser(FacilityUser in)
                                throws ICATServiceException
Save the facility user object. First unflatten, then persist, then flatten and return.

Specified by:
updateFacilityUser in interface ICAT
Returns:
Throws:
ICATServiceException

deleteStudy

public void deleteStudy(Study in)
                 throws ICATServiceException

Specified by:
deleteStudy in interface ICAT
Throws:
ICATServiceException

deleteStudyStatus

public void deleteStudyStatus(StudyStatus in)
                       throws ICATServiceException

Specified by:
deleteStudyStatus in interface ICAT
Throws:
ICATServiceException

deleteInvestigation

public void deleteInvestigation(Investigation in)
                         throws ICATServiceException

Specified by:
deleteInvestigation in interface ICAT
Throws:
ICATServiceException

deleteInvestigationType

public void deleteInvestigationType(InvestigationType in)
                             throws ICATServiceException

Specified by:
deleteInvestigationType in interface ICAT
Throws:
ICATServiceException

deleteSample

public void deleteSample(Sample in)
                  throws ICATServiceException

Specified by:
deleteSample in interface ICAT
Throws:
ICATServiceException

deleteDataSet

public void deleteDataSet(DataSet in)
                   throws ICATServiceException

Specified by:
deleteDataSet in interface ICAT
Throws:
ICATServiceException

deleteDataSetType

public void deleteDataSetType(DataSetType in)
                       throws ICATServiceException

Specified by:
deleteDataSetType in interface ICAT
Throws:
ICATServiceException

deleteDataSetStatus

public void deleteDataSetStatus(DataSetStatus in)
                         throws ICATServiceException

Specified by:
deleteDataSetStatus in interface ICAT
Throws:
ICATServiceException

deleteDataFile

public void deleteDataFile(DataFile in)
                    throws ICATServiceException

Specified by:
deleteDataFile in interface ICAT
Throws:
ICATServiceException

deleteDataFileFormat

public void deleteDataFileFormat(DataFileFormat in)
                          throws ICATServiceException

Specified by:
deleteDataFileFormat in interface ICAT
Throws:
ICATServiceException

deleteDataFileParameter

public void deleteDataFileParameter(DataFileParameter in)
                             throws ICATServiceException

Specified by:
deleteDataFileParameter in interface ICAT
Throws:
ICATServiceException

deleteInstrument

public void deleteInstrument(Instrument in)
                      throws ICATServiceException

Specified by:
deleteInstrument in interface ICAT
Throws:
ICATServiceException

deleteFacilityCycle

public void deleteFacilityCycle(FacilityCycle in)
                         throws ICATServiceException

Specified by:
deleteFacilityCycle in interface ICAT
Throws:
ICATServiceException

deleteFacilityUser

public void deleteFacilityUser(FacilityUser in)
                        throws ICATServiceException

Specified by:
deleteFacilityUser in interface ICAT
Throws:
ICATServiceException

getAllStudies

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

Specified by:
getAllStudies in interface ICAT
Throws:
ICATServiceException

getAllStudyStatus

public java.util.List<StudyStatus> getAllStudyStatus()
                                              throws ICATServiceException

Specified by:
getAllStudyStatus in interface ICAT
Throws:
ICATServiceException

getAllInvestigationsByStudyId

public java.util.List<Investigation> getAllInvestigationsByStudyId(java.lang.Integer in)
                                                            throws ICATServiceException

Specified by:
getAllInvestigationsByStudyId in interface ICAT
Throws:
ICATServiceException

getAllInvestigationTypes

public java.util.List<InvestigationType> getAllInvestigationTypes()
                                                           throws ICATServiceException

Specified by:
getAllInvestigationTypes in interface ICAT
Throws:
ICATServiceException

getAllSamplesByInvestigationId

public java.util.List<Sample> getAllSamplesByInvestigationId(java.lang.Integer in)
                                                      throws ICATServiceException

Specified by:
getAllSamplesByInvestigationId in interface ICAT
Throws:
ICATServiceException

getAllSamplesByInvestigationName

public java.util.List<Sample> getAllSamplesByInvestigationName(java.lang.String studyName,
                                                               java.lang.String investigationName)
                                                        throws ICATServiceException

Specified by:
getAllSamplesByInvestigationName in interface ICAT
Throws:
ICATServiceException

getAllDataSetsByInvestigationId

public java.util.List<DataSet> getAllDataSetsByInvestigationId(java.lang.Integer investigationID)
                                                        throws ICATServiceException

Specified by:
getAllDataSetsByInvestigationId in interface ICAT
Throws:
ICATServiceException

getAllDataSetTypes

public java.util.List<DataSetType> getAllDataSetTypes()
                                               throws ICATServiceException

Specified by:
getAllDataSetTypes in interface ICAT
Throws:
ICATServiceException

getAllDataSetStatus

public java.util.List<DataSetStatus> getAllDataSetStatus()
                                                  throws ICATServiceException

Specified by:
getAllDataSetStatus in interface ICAT
Throws:
ICATServiceException

getAllDataFilesByDataSetId

public java.util.List<DataFile> getAllDataFilesByDataSetId(java.lang.Integer dataSetID)
                                                    throws ICATServiceException

Specified by:
getAllDataFilesByDataSetId in interface ICAT
Throws:
ICATServiceException

getAllDataFileFormats

public java.util.List<DataFileFormat> getAllDataFileFormats()
                                                     throws ICATServiceException

Specified by:
getAllDataFileFormats in interface ICAT
Throws:
ICATServiceException

getAllDataFileParameters

public java.util.List<DataFileParameter> getAllDataFileParameters(java.lang.Integer dataFileID)
                                                           throws ICATServiceException

Specified by:
getAllDataFileParameters in interface ICAT
Throws:
ICATServiceException

getAllInstruments

public java.util.List<Instrument> getAllInstruments()
                                             throws ICATServiceException

Specified by:
getAllInstruments in interface ICAT
Throws:
ICATServiceException

getAllFacilityCycles

public java.util.List<FacilityCycle> getAllFacilityCycles()
                                                   throws ICATServiceException

Specified by:
getAllFacilityCycles in interface ICAT
Throws:
ICATServiceException

getAllFacilityUsers

public java.util.List<FacilityUser> getAllFacilityUsers()
                                                 throws ICATServiceException

Specified by:
getAllFacilityUsers in interface ICAT
Throws:
ICATServiceException

getStudyById

public Study getStudyById(java.lang.Integer in)
                   throws ICATServiceException

Specified by:
getStudyById in interface ICAT
Throws:
ICATServiceException

getStudyByName

public Study getStudyByName(java.lang.String in)
                     throws ICATServiceException

Specified by:
getStudyByName in interface ICAT
Throws:
ICATServiceException

getStudyStatusByName

public StudyStatus getStudyStatusByName(java.lang.String in)
                                 throws ICATServiceException

Specified by:
getStudyStatusByName in interface ICAT
Throws:
ICATServiceException

getInvestigationById

public Investigation getInvestigationById(java.lang.Integer in)
                                   throws ICATServiceException

Specified by:
getInvestigationById in interface ICAT
Throws:
ICATServiceException

getInvestigationByName

public Investigation getInvestigationByName(java.lang.String studyName,
                                            java.lang.String investigationName)
                                     throws ICATServiceException
Lookup the Investigation based on the path components of study name and investigation name.

Specified by:
getInvestigationByName in interface ICAT
Returns:
Throws:
ICATServiceException

getInvestigationTypeByName

public InvestigationType getInvestigationTypeByName(java.lang.String in)
                                             throws ICATServiceException

Specified by:
getInvestigationTypeByName in interface ICAT
Throws:
ICATServiceException

getSampleById

public Sample getSampleById(java.lang.Integer in)
                     throws ICATServiceException

Specified by:
getSampleById in interface ICAT
Throws:
ICATServiceException

getSampleByName

public Sample getSampleByName(java.lang.String studyName,
                              java.lang.String investigationName,
                              java.lang.String sampleName)
                       throws ICATServiceException

Specified by:
getSampleByName in interface ICAT
Throws:
ICATServiceException

getDataSetById

public DataSet getDataSetById(java.lang.Integer in)
                       throws ICATServiceException

Specified by:
getDataSetById in interface ICAT
Throws:
ICATServiceException

getDataSetByName

public DataSet getDataSetByName(java.lang.String studyName,
                                java.lang.String investigationName,
                                java.lang.String datasetName)
                         throws ICATServiceException
Lookup the dataset based on the path name components made up of study, investigation and dataset names.

Specified by:
getDataSetByName in interface ICAT
Returns:
Throws:
ICATServiceException

getDataSetTypeByName

public DataSetType getDataSetTypeByName(java.lang.String in)
                                 throws ICATServiceException

Specified by:
getDataSetTypeByName in interface ICAT
Throws:
ICATServiceException

getDataSetStatusByName

public DataSetStatus getDataSetStatusByName(java.lang.String in)
                                     throws ICATServiceException

Specified by:
getDataSetStatusByName in interface ICAT
Throws:
ICATServiceException

getDataSetIdByHandle

public java.lang.Integer getDataSetIdByHandle(java.lang.String in)
                                       throws ICATServiceException

Specified by:
getDataSetIdByHandle in interface ICAT
Throws:
ICATServiceException

getDataFileById

public DataFile getDataFileById(java.lang.Integer in)
                         throws ICATServiceException

Specified by:
getDataFileById in interface ICAT
Throws:
ICATServiceException

getDataFileFormatById

public DataFileFormat getDataFileFormatById(java.lang.String name,
                                            java.lang.String version)
                                     throws ICATServiceException

Specified by:
getDataFileFormatById in interface ICAT
Throws:
ICATServiceException

getDataFileFormatByName

public java.util.List<DataFileFormat> getDataFileFormatByName(java.lang.String in)
                                                       throws ICATServiceException

Specified by:
getDataFileFormatByName in interface ICAT
Throws:
ICATServiceException

getDataFileParameterById

public DataFileParameter getDataFileParameterById(java.lang.String name,
                                                  java.lang.String units,
                                                  java.lang.Integer dataFileID)
                                           throws ICATServiceException

Specified by:
getDataFileParameterById in interface ICAT
Throws:
ICATServiceException

getInstrumentByName

public Instrument getInstrumentByName(java.lang.String in)
                               throws ICATServiceException

Specified by:
getInstrumentByName in interface ICAT
Throws:
ICATServiceException

getFacilityCycleByName

public FacilityCycle getFacilityCycleByName(java.lang.String in)
                                     throws ICATServiceException

Specified by:
getFacilityCycleByName in interface ICAT
Throws:
ICATServiceException

getFacilityUserById

public FacilityUser getFacilityUserById(java.lang.String in)
                                 throws ICATServiceException

Specified by:
getFacilityUserById in interface ICAT
Throws:
ICATServiceException

getDataFileByName

public DataFile getDataFileByName(java.lang.String studyName,
                                  java.lang.String investigationName,
                                  java.lang.String datasetName,
                                  java.lang.String datafileName)
                           throws ICATServiceException
Get the data file based on the names of it's path components in the icat structure.

Specified by:
getDataFileByName in interface ICAT
Returns:
Throws:
ICATServiceException

deleteParameter

public void deleteParameter(Parameter in)
                     throws ICATServiceException

Specified by:
deleteParameter in interface ICAT
Throws:
ICATServiceException

deleteDataSetParameter

public void deleteDataSetParameter(DataSetParameter in)
                            throws ICATServiceException

Specified by:
deleteDataSetParameter in interface ICAT
Throws:
ICATServiceException

deleteSampleParameter

public void deleteSampleParameter(SampleParameter in)
                           throws ICATServiceException

Specified by:
deleteSampleParameter in interface ICAT
Throws:
ICATServiceException

getAllDataSetParameters

public java.util.List<DataSetParameter> getAllDataSetParameters(java.lang.Integer in)
                                                         throws ICATServiceException

Specified by:
getAllDataSetParameters in interface ICAT
Throws:
ICATServiceException

getAllSampleParameters

public java.util.List<SampleParameter> getAllSampleParameters(java.lang.Integer in)
                                                       throws ICATServiceException

Specified by:
getAllSampleParameters in interface ICAT
Throws:
ICATServiceException

getDataSetParameterById

public DataSetParameter getDataSetParameterById(java.lang.String name,
                                                java.lang.String units,
                                                java.lang.Integer dataSetID)
                                         throws ICATServiceException

Specified by:
getDataSetParameterById in interface ICAT
Throws:
ICATServiceException

getSampleParameterById

public SampleParameter getSampleParameterById(java.lang.String name,
                                              java.lang.String units,
                                              java.lang.Integer sampleID)
                                       throws ICATServiceException

Specified by:
getSampleParameterById in interface ICAT
Throws:
ICATServiceException

updateDataSetParameter

public DataSetParameter updateDataSetParameter(DataSetParameter in)
                                        throws ICATServiceException
Save the dataset parameter object. First unflatten, then persist, then flatten and return.

Specified by:
updateDataSetParameter in interface ICAT
Returns:
Throws:
ICATServiceException

updateSampleParameter

public SampleParameter updateSampleParameter(SampleParameter in)
                                      throws ICATServiceException
Save the sample parameter object. First unflatten, then persist, then flatten and return.

Specified by:
updateSampleParameter in interface ICAT
Returns:
Throws:
ICATServiceException

getAllParameters

public java.util.List<Parameter> getAllParameters()
                                           throws ICATServiceException

Specified by:
getAllParameters in interface ICAT
Throws:
ICATServiceException

getAllParametersByType

public java.util.List<Parameter> getAllParametersByType(boolean isSampleParameter,
                                                        boolean isDataSetParameter,
                                                        boolean isDataFileParameter)
                                                 throws ICATServiceException
Returns the parameters for which the boolean parameters are true. The parameters are ored together so getAllParametersByType(true, true, true) will return all the parameters

Specified by:
getAllParametersByType in interface ICAT
Returns:
Throws:
ICATServiceException

getParameterById

public Parameter getParameterById(java.lang.Integer in)
                           throws ICATServiceException

Specified by:
getParameterById in interface ICAT
Throws:
ICATServiceException

getParameterByName

public Parameter getParameterByName(java.lang.String name,
                                    java.lang.String units)
                             throws ICATServiceException
Gets the parameter with this name-unit key

Specified by:
getParameterByName in interface ICAT
Returns:
Throws:
ICATServiceException

updateParameter

public Parameter updateParameter(Parameter in)
                          throws ICATServiceException
Save the parameter, updating or creating if id is null or 0.

Specified by:
updateParameter in interface ICAT
Returns:
Throws:
ICATServiceException

getAllDataFileLocations

public java.util.List<java.lang.String> getAllDataFileLocations()
Get all the locations referenced in the iCAT. TODO We need to find a more efficient way to do this.

Returns:

getAllDataSetLocations

public java.util.List<java.lang.String> getAllDataSetLocations()

getDataFileByLocation

public DataFile getDataFileByLocation(java.lang.String location)
                               throws ICATServiceException
Get the Data file object associated with the given location URI.

Specified by:
getDataFileByLocation in interface ICAT
Returns:
Throws:
ICATServiceException

getDataSetByLocation

public DataSet getDataSetByLocation(java.lang.String location)
                             throws ICATServiceException

Specified by:
getDataSetByLocation in interface ICAT
Throws:
ICATServiceException

getInvestigationByLocation

public Investigation getInvestigationByLocation(java.lang.String location)
                                         throws ICATServiceException

Specified by:
getInvestigationByLocation in interface ICAT
Throws:
ICATServiceException

getStudyByLocation

public Study getStudyByLocation(java.lang.String location)
                         throws ICATServiceException

Specified by:
getStudyByLocation in interface ICAT
Throws:
ICATServiceException

onApplicationEvent

public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
When the context finishes loading we need to register our notification requirements.

Specified by:
onApplicationEvent in interface org.springframework.context.ApplicationListener

start

public void start()

stop

public void stop()

locationAdded

public void locationAdded(java.lang.String location)
Description copied from interface: ICATLocationListener
Method to be called when a location is added to the ICAT.

Specified by:
locationAdded in interface ICATLocationListener
Parameters:
location - the location that was added.

locationRemoved

public void locationRemoved(java.lang.String location)
Description copied from interface: ICATLocationListener
Method to be called when a location is removed from the ICAT.

Specified by:
locationRemoved in interface ICATLocationListener
Parameters:
location - the location that was removed.

locationChanged

public void locationChanged(java.lang.String oldLocation,
                            java.lang.String newLocation)
Description copied from interface: ICATLocationListener
Method to be called when a location is changed in the the ICAT.

Specified by:
locationChanged in interface ICATLocationListener
Parameters:
oldLocation - the old location.
newLocation - the new location.

collectionDeleted

public void collectionDeleted(java.lang.String parentGroupName,
                              java.lang.String dataGroupName)
Specified by:
collectionDeleted in interface au.edu.jcu.hpc.srb.mcatext.notify.PathNotificationListener

collectionCreated

public void collectionCreated(java.lang.String parentGroupName,
                              java.lang.String dataGroupName)
Specified by:
collectionCreated in interface au.edu.jcu.hpc.srb.mcatext.notify.PathNotificationListener

collectionChanged

public void collectionChanged(java.lang.String oldParentGroupName,
                              java.lang.String oldDataGroupName,
                              java.lang.String newParentGroupName,
                              java.lang.String newDataGroupName)
Specified by:
collectionChanged in interface au.edu.jcu.hpc.srb.mcatext.notify.PathNotificationListener

objectDeleted

public void objectDeleted(java.lang.String parentName,
                          java.lang.String name)
Specified by:
objectDeleted in interface au.edu.jcu.hpc.srb.mcatext.notify.PathNotificationListener

objectCreated

public void objectCreated(java.lang.String parentName,
                          java.lang.String name)
Specified by:
objectCreated in interface au.edu.jcu.hpc.srb.mcatext.notify.PathNotificationListener

objectChanged

public void objectChanged(java.lang.String oldParentName,
                          java.lang.String oldName,
                          java.lang.String newParentName,
                          java.lang.String newName)
Specified by:
objectChanged in interface au.edu.jcu.hpc.srb.mcatext.notify.PathNotificationListener

getObjectFactory

public ICATObjectFactory getObjectFactory()
Specified by:
getObjectFactory in interface ICAT

setClients

public void setClients(java.util.List<ClientLocationPair> clients)

getClients

public java.util.List<ClientLocationPair> getClients()

getResourceUrlPrefixes

public java.util.List<java.lang.String> getResourceUrlPrefixes()
Specified by:
getResourceUrlPrefixes in interface ICAT

triggerNotifications

public void triggerNotifications()
Specified by:
triggerNotifications in interface ICAT

setSecurityManager

public void setSecurityManager(ICATSecurityManager securityManager)
Used for setting the security manager used by this ICAT. This overrides the default security manager.

Parameters:
securityManager -

getSecurityManager

public ICATSecurityManager getSecurityManager()
Security manager getter. Returns a null security manager if none specified.

Returns:

searchDataFile

public java.util.List<DataFile> searchDataFile(SearchRequestType search)
                                        throws ICATServiceException
SEARCH SERVICES

Specified by:
searchDataFile in interface SearchService
Parameters:
search - SearchRequest search request.
Returns:
List<DataFile> list of data files.
Throws:
ICATServiceException

searchDataSet

public java.util.List<DataSet> searchDataSet(SearchRequestType search)
                                      throws ICATServiceException
Description copied from interface: SearchService
Search datasets.

Specified by:
searchDataSet in interface SearchService
Parameters:
search - SearchRequest search request.
Returns:
List<DataSet> list of data sets.
Throws:
ICATServiceException

searchExperiment

public java.util.List<Investigation> searchExperiment(SearchRequestType search)
                                               throws ICATServiceException
Description copied from interface: SearchService
Search experiments.

Specified by:
searchExperiment in interface SearchService
Parameters:
search - SearchRequest search request.
Returns:
List<Investigation> list of investigations.
Throws:
ICATServiceException

searchProject

public java.util.List<Study> searchProject(SearchRequestType search)
                                    throws ICATServiceException
Description copied from interface: SearchService
Search project.

Specified by:
searchProject in interface SearchService
Parameters:
search - SearchRequest search request.
Returns:
List<Study> list of studies.
Throws:
ICATServiceException

searchSample

public java.util.List<Sample> searchSample(SearchRequestType search)
                                    throws ICATServiceException
Description copied from interface: SearchService
Search samples.

Specified by:
searchSample in interface SearchService
Parameters:
search - SearchRequest search request.
Returns:
List<Sample> list of samples.
Throws:
ICATServiceException


Copyright © 2008 ARCHER - James Cook University. All Rights Reserved.