Package gda.data.fileregistrar
Class FileRegistrar
java.lang.Object
gda.data.scan.datawriter.DataWriterExtenderBase
gda.data.fileregistrar.FileRegistrar
- All Implemented Interfaces:
IFileRegistrar,IDataWriterExtender,Findable
The FileRegistrar deals with archiving in both the GDA8 and the GDA9 scanning systems.
To be used in 9
the init-method "register" must be called. This ensures that the FileRegistrar is registered as a scanning participant. Now whenever a scan is run its @FileDeclared and @ScanEnd annotations will be run.
<bean id="FileRegistrar" class="gda.data.fileregistrar.FileRegistrar"init-method="register"><property name="name" value="FileRegistrar"/><property name="directory" value="/dls/bl-misc/dropfiles2/icat/dropZone/${gda.instrument}-" /></bean>
To be used in 8
In GDA8 File registration listens to scans (via DataWriterExtender) and can be used directly by detectors. Files will be archived and listed in icat and possibly post-processed. Whatever the pipeline is configured to do.<bean id="FileRegistrar" class="gda.data.fileregistrar.FileRegistrar"<property name="name" value="FileRegistrar"/><property name="directory" value="/dls/bl-misc/dropfiles2/icat/dropZone/${gda.instrument}-" /></bean>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddData(IDataWriterExtender parent, IScanDataPoint dataPoint) called by a DataWriter after it has processed addDatavoidaddScanFile(String filePath) Normally in GDA8 the IFileRegistrar interface is made available to register files.voidcalled by a DataWriter after it has processed completeCollectiongetName()Get the object name.voidregister()Method called by spring to register the registrar with solstice scanning.voidregisterFile(String fileName) Entry point in GDA8 scanning to register a filevoidregisterFiles(String[] fileNames) Entry point in GDA8 scanning to register filesvoidscanEnd()voidvoidsetClientFileAnnouncer(ClientFileAnnouncer clientFileAnnouncer) Clients can listen to this object for String arrays with filenames of recently created files to update their data projects.voidSet or change the name of the object (as defined in XML).Methods inherited from class gda.data.scan.datawriter.DataWriterExtenderBase
addData, addDataWriterExtender, completeCollection, removeDataWriterExtender
-
Constructor Details
-
FileRegistrar
- Throws:
FactoryException
-
-
Method Details
-
registerFile
Entry point in GDA8 scanning to register a file- Specified by:
registerFilein interfaceIFileRegistrar- Parameters:
fileName- absolute Pathname of file to register
-
registerFiles
Entry point in GDA8 scanning to register files- Specified by:
registerFilesin interfaceIFileRegistrar- Parameters:
fileNames- An array of absolute Pathnames of files to register
-
addScanFile
Normally in GDA8 the IFileRegistrar interface is made available to register files. That interface should be used rather than this method. In GDA9 this is redundant because annotations are used for any object participating in a scan. The @FileDeclared injects the filenames to be used in the scan. You may also inject the first position of the scan or any OSGi service or the ScanInformation when using this annotation.- Parameters:
filePath- - the full path to the file
-
addData
Description copied from interface:IDataWriterExtendercalled by a DataWriter after it has processed addData- Specified by:
addDatain interfaceIDataWriterExtender- Overrides:
addDatain classDataWriterExtenderBase- Parameters:
parent-dataPoint-- Throws:
Exception
-
completeCollection
Description copied from interface:IDataWriterExtendercalled by a DataWriter after it has processed completeCollection- Specified by:
completeCollectionin interfaceIDataWriterExtender- Overrides:
completeCollectionin classDataWriterExtenderBase- Parameters:
parent-
-
scanEnd
public void scanEnd() -
scanFinally
public void scanFinally() -
getName
Description copied from interface:FindableGet the object name. Used by Castor to check if the object name has been set before calling theFindable.setName(String)method. -
setName
Description copied from interface:FindableSet or change the name of the object (as defined in XML). -
getIcatXMLCreator
-
getClientFileAnnouncer
-
setClientFileAnnouncer
Clients can listen to this object for String arrays with filenames of recently created files to update their data projects.- Parameters:
clientFileAnnouncer-
-
register
public void register()Method called by spring to register the registrar with solstice scanning.- Throws:
NullPointerException- if there is no IRunnableDeviceService - this is intentional and an errorClassCastException- if IRunnableDeviceService is not a IScanService which is must be.
-