Package gda.data.metadata.icat
Class IcatBase
java.lang.Object
gda.data.metadata.icat.IcatBase
- All Implemented Interfaces:
Icat
- Direct Known Subclasses:
DlsIcatBase,NullIcat,XMLIcat
Provides base functionality for classes implementing the Icat interface.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Metadataprotected Dateprotected Stringprotected StringFields inherited from interface gda.data.metadata.icat.Icat
ICAT_TYPE_PROP, SHIFT_TOL_PROP, URL_PROP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCurrentInformation(String accessName) Queries the database filtering using the current username and visit held in metadata.protected abstract StringReturns the access name which is used to find the experiment titleprotected Stringprotected MetadatagetMyInformation(String accessName) Queries the database filtering using the stored username, beamline and visit.getMyInformation(String accessName, String username, String visitID) Queries the database filtering using the given username, beamline and visit.getMyValidVisits(String username) Returns all the visit IDs for this user on this beamline at this point in time (tolerance in the IcatConnectionDetails).protected abstract StringReturns the SQL result for the given accessName string filtered by beamline, username and (optionally) visitID.getVisitDataByPrefix(String visitPrefix) GetVisitDatafor visits beginning with the specified prefixprotected abstract StringReturns the access name which is used to find the visit IDbooleanHas an ICAT been defined for use? Based solely on the java property @seeIcat.ICAT_TYPE_PROPvoidsetInstrumentName(String instrumentName) Inject the beamline (instrument) name for testing.voidsetMetadata(Metadata metadata) Inject the metadata object for testing.voidsetMyVisit(String choiceOfVisit) Sets the visit under which this user shall collect data.voidsetOperatingDate(Date date) Inject the current time for testing.
-
Field Details
-
visitID
-
operatingDate
-
metadata
-
instrumentName
-
username
-
-
Constructor Details
-
IcatBase
public IcatBase()
-
-
Method Details
-
icatInUse
public boolean icatInUse()Has an ICAT been defined for use? Based solely on the java property @seeIcat.ICAT_TYPE_PROP -
setMyVisit
Description copied from interface:IcatSets the visit under which this user shall collect data.- Specified by:
setMyVisitin interfaceIcat- Parameters:
choiceOfVisit-
-
getMyValidVisits
Description copied from interface:IcatReturns all the visit IDs for this user on this beamline at this point in time (tolerance in the IcatConnectionDetails).- Specified by:
getMyValidVisitsin interfaceIcat- Parameters:
username-- Returns:
- array of valid visit IDs
- Throws:
Exception
-
getCurrentInformation
Description copied from interface:IcatQueries the database filtering using the current username and visit held in metadata.- Specified by:
getCurrentInformationin interfaceIcat- Parameters:
accessName-- Returns:
- String or null if no information found
- Throws:
Exception
-
getMyInformation
Description copied from interface:IcatQueries the database filtering using the stored username, beamline and visit.- Specified by:
getMyInformationin interfaceIcat- Parameters:
accessName-- Returns:
- String or null if no information found
- Throws:
Exception
-
getMyInformation
Description copied from interface:IcatQueries the database filtering using the given username, beamline and visit.- Specified by:
getMyInformationin interfaceIcat- Parameters:
accessName-username-visitID-- Returns:
- String or null if no information found
- Throws:
Exception
-
setOperatingDate
Description copied from interface:IcatInject the current time for testing. This will be used when filtering for valid visits on the given beamline.Set to null for the current date to be used.
- Specified by:
setOperatingDatein interfaceIcat- Parameters:
date-
-
getVisitDataByPrefix
Description copied from interface:IcatGetVisitDatafor visits beginning with the specified prefix- Specified by:
getVisitDataByPrefixin interfaceIcat- Parameters:
visitPrefix- the prefix to search for. This can be a complete visit name- Throws:
Exception
-
setMetadata
Inject the metadata object for testing. If not defined this gets the Metadata object from GDAMetadataProvider.- Parameters:
metadata-
-
getVisitIDAccessName
Returns the access name which is used to find the visit ID -
getExperimentTitleAccessName
Returns the access name which is used to find the experiment title -
getValue
protected abstract String getValue(String visitIDFilter, String userNameFilter, String accessName) throws Exception Returns the SQL result for the given accessName string filtered by beamline, username and (optionally) visitID.- Parameters:
visitIDFilter-userNameFilter-accessName-- Returns:
- String
- Throws:
Exception
-
getMetadata
-
setInstrumentName
Inject the beamline (instrument) name for testing. If not defined this looks for the name in first metadata and then in java properties.- Parameters:
instrumentName-
-
getInstrumentName
-