public class InstanceReceiver
extends java.lang.Object
A class to wait for incoming composite instance storage operations and process each instance as it is received.
The doSomethingWithReceivedDicomFile()
method may be implemented in a sub-class to actually do something more useful than just storing the files.
It is configured by use of a properties file that resides in the user's
home directory in .com.pixelmed.apps.ProcessReceivedWholeSlideImagesMakeTiledPyramidAndSend.properties
.
The properties allow control over the user interface elements that are displayed
and record the settings changed by the user when the application closes.
For a description of the network configuration properties, see NetworkApplicationProperties
.
The properties that are specific to the application, and their default values, are as follows
Application.SavedImagesFolderName=.com.pixelmed.apps.InstanceReceiver.receivedinstances
- where to store DICOM instances received
Modifier and Type | Class and Description |
---|---|
protected static class |
InstanceReceiver.OurReadTerminationStrategy |
protected class |
InstanceReceiver.OurReceivedObjectHandler |
protected class |
InstanceReceiver.ReceivedFileProcessor |
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
defaultPropertiesFileName |
protected java.lang.String |
defaultSavedImagesFolderName |
protected NetworkApplicationInformationFederated |
networkApplicationInformation |
protected NetworkApplicationProperties |
networkApplicationProperties |
protected java.lang.String |
ourCalledAETitle |
protected java.util.Properties |
properties |
protected static java.lang.String |
propertyName_SavedImagesFolderName |
protected java.io.File |
savedImagesFolder |
protected StoredFilePathStrategy |
storedFilePathStrategy |
protected static AttributeList.ReadTerminationStrategy |
terminateAfterRelationshipGroup |
Constructor and Description |
---|
InstanceReceiver(java.lang.String propertiesFileName)
Wait for incoming composite instance storage operations and process each instance as it is received.
|
Modifier and Type | Method and Description |
---|---|
void |
activateStorageSCP()
Start or restart DICOM storage listener.
|
protected void |
doSomethingWithReceivedDicomFile(java.lang.String receivedFileName,
java.lang.String sourceApplicationEntityTitle,
java.lang.String transferSyntaxUID,
java.lang.String sopClassUID)
Do something with the received DICOM file.
|
protected static java.io.File |
getFolderNameCreatingItIfNecessary(java.lang.String folderName)
Return the folder, creating it if necessary.
|
protected void |
loadProperties(java.lang.String propertiesFileName)
Load properties.
|
static void |
main(java.lang.String[] arg)
Wait for incoming composite instance storage operations and process each instance as it is received.
|
void |
shutdownStorageSCP()
Shutdown DICOM storage listener.
|
protected static java.lang.String defaultPropertiesFileName
protected java.lang.String defaultSavedImagesFolderName
protected NetworkApplicationInformationFederated networkApplicationInformation
protected NetworkApplicationProperties networkApplicationProperties
protected java.lang.String ourCalledAETitle
protected java.util.Properties properties
protected static java.lang.String propertyName_SavedImagesFolderName
protected java.io.File savedImagesFolder
protected StoredFilePathStrategy storedFilePathStrategy
protected static final AttributeList.ReadTerminationStrategy terminateAfterRelationshipGroup
public InstanceReceiver(java.lang.String propertiesFileName) throws DicomException, DicomNetworkException, java.io.IOException, java.lang.InterruptedException
Wait for incoming composite instance storage operations and process each instance as it is received.
propertiesFileName
- DicomException
DicomNetworkException
java.io.IOException
java.lang.InterruptedException
public void activateStorageSCP() throws DicomException, java.io.IOException
Start or restart DICOM storage listener.
Shuts down existing listener, if any, so may be used to restart after configuration change.
DicomException
java.io.IOException
protected void doSomethingWithReceivedDicomFile(java.lang.String receivedFileName, java.lang.String sourceApplicationEntityTitle, java.lang.String transferSyntaxUID, java.lang.String sopClassUID)
Do something with the received DICOM file.
This method may be implemented in a sub-class to do something useful even if it is only logging to the user interface.
The default method does nothing.
This method is called on the ReceivedFileProcessor thread.
This method does not define any exceptions and hence must handle any errors locally.
receivedFileName
- the path name to a DICOM filesourceApplicationEntityTitle
- the Application Entity from which the file was receivedtransferSyntaxUID
- the Transfer Syntax of the Data Set in the DICOM filesopClassUID
- the SOP Class of the Data Set in the DICOM fileprotected static java.io.File getFolderNameCreatingItIfNecessary(java.lang.String folderName) throws java.io.IOException
Return the folder, creating it if necessary.
If not an absolute path, will be sought or created relative to the current user's home directory.
java.io.IOException
protected void loadProperties(java.lang.String propertiesFileName) throws java.io.IOException
Load properties.
java.io.IOException
- thrown if properties file is missingpublic static void main(java.lang.String[] arg)
Wait for incoming composite instance storage operations and process each instance as it is received.
arg
- nonepublic void shutdownStorageSCP()
Shutdown DICOM storage listener.