|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pixelmed.network.StorageSOPClassSCPDispatcher
public class StorageSOPClassSCPDispatcher
This class waits for incoming connections and association requests for the SCP role of SOP Classes of the Storage Service Class, the Study Root Query Retrieve Information Model Find, Get and Move SOP Classes, and the Verification SOP Class.
The class has a constructor and a run() method. The
constructor is passed a socket on which to listen for transport
connection open indications. The run() method waits
for transport connection open indications, then instantiates
StorageSOPClassSCP
to accept an association and wait for storage or verification commands, storing
data sets in Part 10 files in the specified folder.
An instance of ReceivedObjectHandler
can be supplied in the constructor to process the received data set stored in the file
when it has been completely received.
For example:
try {
new Thread(new StorageSOPClassSCPDispatcher("104","STORESCP","/tmp",new OurReceivedObjectHandler(),0)).start();
}
catch (IOException e) {
e.printStackTrace(System.err);
}
Debugging messages with a varying degree of verbosity can be activated.
The main method is also useful in its own right as a command-line Storage SCP utility, which will store incoming files in a specified directory.
For example, on Unix:
% java -cp ./pixelmed.jar com.pixelmed.network.StorageSOPClassSCPDispatcher "104" "STORESCP" "/tmp" 0
On Windows, the classpath syntax would use a different separator, e.g. .\pixelmed.jar
Note that the main method can also be used without command line arguments, in which case it looks for a properties file or uses defaults (refer to the main() method documentation for details).
StorageSOPClassSCP,
ReceivedObjectHandler| Field Summary | |
|---|---|
protected StoredFilePathStrategy |
storedFilePathStrategy
|
| Constructor Summary | |
|---|---|
StorageSOPClassSCPDispatcher(int port,
String calledAETitle,
File savedImagesFolder,
ReceivedObjectHandler receivedObjectHandler,
int debugLevel)
Construct an instance of dispatcher that will wait for transport connection open indications, and handle associations and commands. |
|
StorageSOPClassSCPDispatcher(int port,
String calledAETitle,
File savedImagesFolder,
ReceivedObjectHandler receivedObjectHandler,
QueryResponseGeneratorFactory queryResponseGeneratorFactory,
RetrieveResponseGeneratorFactory retrieveResponseGeneratorFactory,
NetworkApplicationInformation networkApplicationInformation,
boolean secureTransport,
int debugLevel)
Construct an instance of dispatcher that will wait for transport connection open indications, and handle associations and commands. |
|
StorageSOPClassSCPDispatcher(int port,
String calledAETitle,
File savedImagesFolder,
StoredFilePathStrategy storedFilePathStrategy,
ReceivedObjectHandler receivedObjectHandler,
int debugLevel)
Construct an instance of dispatcher that will wait for transport connection open indications, and handle associations and commands. |
|
StorageSOPClassSCPDispatcher(int port,
String calledAETitle,
File savedImagesFolder,
StoredFilePathStrategy storedFilePathStrategy,
ReceivedObjectHandler receivedObjectHandler,
QueryResponseGeneratorFactory queryResponseGeneratorFactory,
RetrieveResponseGeneratorFactory retrieveResponseGeneratorFactory,
NetworkApplicationInformation networkApplicationInformation,
boolean secureTransport,
int debugLevel)
Construct an instance of dispatcher that will wait for transport connection open indications, and handle associations and commands. |
|
StorageSOPClassSCPDispatcher(int port,
String calledAETitle,
int ourMaximumLengthReceived,
int socketReceiveBufferSize,
int socketSendBufferSize,
File savedImagesFolder,
ReceivedObjectHandler receivedObjectHandler,
QueryResponseGeneratorFactory queryResponseGeneratorFactory,
RetrieveResponseGeneratorFactory retrieveResponseGeneratorFactory,
NetworkApplicationInformation networkApplicationInformation,
boolean secureTransport,
int debugLevel)
Construct an instance of dispatcher that will wait for transport connection open indications, and handle associations and commands. |
|
StorageSOPClassSCPDispatcher(int port,
String calledAETitle,
int ourMaximumLengthReceived,
int socketReceiveBufferSize,
int socketSendBufferSize,
File savedImagesFolder,
StoredFilePathStrategy storedFilePathStrategy,
ReceivedObjectHandler receivedObjectHandler,
QueryResponseGeneratorFactory queryResponseGeneratorFactory,
RetrieveResponseGeneratorFactory retrieveResponseGeneratorFactory,
NetworkApplicationInformation networkApplicationInformation,
boolean secureTransport,
int debugLevel)
Construct an instance of dispatcher that will wait for transport connection open indications, and handle associations and commands. |
|
| Method Summary | |
|---|---|
static void |
main(String[] arg)
For testing. |
void |
run()
Waits for a transport connection indications, then spawns new threads to act as association acceptors, which then wait for storage or verification commands, storing data sets in Part 10 files in the specified folder, until the associations are released or the transport connections are closed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected StoredFilePathStrategy storedFilePathStrategy
| Constructor Detail |
|---|
public StorageSOPClassSCPDispatcher(int port,
String calledAETitle,
File savedImagesFolder,
ReceivedObjectHandler receivedObjectHandler,
int debugLevel)
throws IOException
Construct an instance of dispatcher that will wait for transport connection open indications, and handle associations and commands.
port - the port on which to listen for connectionscalledAETitle - our AE TitlesavedImagesFolder - the folder in which to store received data sets (may be null, to ignore received data for testing)receivedObjectHandler - the handler to call after each data set has been received and storeddebugLevel - zero for no debugging messages, higher values more verbose messages
IOException
public StorageSOPClassSCPDispatcher(int port,
String calledAETitle,
File savedImagesFolder,
StoredFilePathStrategy storedFilePathStrategy,
ReceivedObjectHandler receivedObjectHandler,
int debugLevel)
throws IOException
Construct an instance of dispatcher that will wait for transport connection open indications, and handle associations and commands.
port - the port on which to listen for connectionscalledAETitle - our AE TitlesavedImagesFolder - the folder in which to store received data sets (may be null, to ignore received data for testing)storedFilePathStrategy - the strategy to use for naming received files and foldersreceivedObjectHandler - the handler to call after each data set has been received and storeddebugLevel - zero for no debugging messages, higher values more verbose messages
IOException
public StorageSOPClassSCPDispatcher(int port,
String calledAETitle,
int ourMaximumLengthReceived,
int socketReceiveBufferSize,
int socketSendBufferSize,
File savedImagesFolder,
ReceivedObjectHandler receivedObjectHandler,
QueryResponseGeneratorFactory queryResponseGeneratorFactory,
RetrieveResponseGeneratorFactory retrieveResponseGeneratorFactory,
NetworkApplicationInformation networkApplicationInformation,
boolean secureTransport,
int debugLevel)
throws IOException
Construct an instance of dispatcher that will wait for transport connection open indications, and handle associations and commands.
port - the port on which to listen for connectionscalledAETitle - our AE TitleourMaximumLengthReceived - the maximum PDU length that we will offer to receivesocketReceiveBufferSize - the TCP socket receive buffer size to set (if possible), 0 means leave at the defaultsocketSendBufferSize - the TCP socket send buffer size to set (if possible), 0 means leave at the defaultsavedImagesFolder - the folder in which to store received data sets (may be null, to ignore received data for testing)receivedObjectHandler - the handler to call after each data set has been received and stored, or null for the default that prints the file namequeryResponseGeneratorFactory - the factory to make handlers to generate query responses from a supplied query messageretrieveResponseGeneratorFactory - the factory to make handlers to generate retrieve responses from a supplied retrieve messagenetworkApplicationInformation - from which to obtain a map of application entity titles to presentation addressessecureTransport - true if to use secure transport protocoldebugLevel - zero for no debugging messages, higher values more verbose messages
IOException
public StorageSOPClassSCPDispatcher(int port,
String calledAETitle,
int ourMaximumLengthReceived,
int socketReceiveBufferSize,
int socketSendBufferSize,
File savedImagesFolder,
StoredFilePathStrategy storedFilePathStrategy,
ReceivedObjectHandler receivedObjectHandler,
QueryResponseGeneratorFactory queryResponseGeneratorFactory,
RetrieveResponseGeneratorFactory retrieveResponseGeneratorFactory,
NetworkApplicationInformation networkApplicationInformation,
boolean secureTransport,
int debugLevel)
throws IOException
Construct an instance of dispatcher that will wait for transport connection open indications, and handle associations and commands.
port - the port on which to listen for connectionscalledAETitle - our AE TitleourMaximumLengthReceived - the maximum PDU length that we will offer to receivesocketReceiveBufferSize - the TCP socket receive buffer size to set (if possible), 0 means leave at the defaultsocketSendBufferSize - the TCP socket send buffer size to set (if possible), 0 means leave at the defaultsavedImagesFolder - the folder in which to store received data sets (may be null, to ignore received data for testing)storedFilePathStrategy - the strategy to use for naming received files and foldersreceivedObjectHandler - the handler to call after each data set has been received and stored, or null for the default that prints the file namequeryResponseGeneratorFactory - the factory to make handlers to generate query responses from a supplied query messageretrieveResponseGeneratorFactory - the factory to make handlers to generate retrieve responses from a supplied retrieve messagenetworkApplicationInformation - from which to obtain a map of application entity titles to presentation addressessecureTransport - true if to use secure transport protocoldebugLevel - zero for no debugging messages, higher values more verbose messages
IOException
public StorageSOPClassSCPDispatcher(int port,
String calledAETitle,
File savedImagesFolder,
ReceivedObjectHandler receivedObjectHandler,
QueryResponseGeneratorFactory queryResponseGeneratorFactory,
RetrieveResponseGeneratorFactory retrieveResponseGeneratorFactory,
NetworkApplicationInformation networkApplicationInformation,
boolean secureTransport,
int debugLevel)
throws IOException
Construct an instance of dispatcher that will wait for transport connection open indications, and handle associations and commands.
port - the port on which to listen for connectionscalledAETitle - our AE TitlesavedImagesFolder - the folder in which to store received data sets (may be null, to ignore received data for testing)receivedObjectHandler - the handler to call after each data set has been received and stored, or null for the default that prints the file namequeryResponseGeneratorFactory - the factory to make handlers to generate query responses from a supplied query messageretrieveResponseGeneratorFactory - the factory to make handlers to generate retrieve responses from a supplied retrieve messagenetworkApplicationInformation - from which to obtain a map of application entity titles to presentation addressessecureTransport - true if to use secure transport protocoldebugLevel - zero for no debugging messages, higher values more verbose messages
IOException
public StorageSOPClassSCPDispatcher(int port,
String calledAETitle,
File savedImagesFolder,
StoredFilePathStrategy storedFilePathStrategy,
ReceivedObjectHandler receivedObjectHandler,
QueryResponseGeneratorFactory queryResponseGeneratorFactory,
RetrieveResponseGeneratorFactory retrieveResponseGeneratorFactory,
NetworkApplicationInformation networkApplicationInformation,
boolean secureTransport,
int debugLevel)
throws IOException
Construct an instance of dispatcher that will wait for transport connection open indications, and handle associations and commands.
port - the port on which to listen for connectionscalledAETitle - our AE TitlesavedImagesFolder - the folder in which to store received data sets (may be null, to ignore received data for testing)storedFilePathStrategy - the strategy to use for naming received files and foldersreceivedObjectHandler - the handler to call after each data set has been received and stored, or null for the default that prints the file namequeryResponseGeneratorFactory - the factory to make handlers to generate query responses from a supplied query messageretrieveResponseGeneratorFactory - the factory to make handlers to generate retrieve responses from a supplied retrieve messagenetworkApplicationInformation - from which to obtain a map of application entity titles to presentation addressessecureTransport - true if to use secure transport protocoldebugLevel - zero for no debugging messages, higher values more verbose messages
IOException| Method Detail |
|---|
public void run()
Waits for a transport connection indications, then spawns new threads to act as association acceptors, which then wait for storage or verification commands, storing data sets in Part 10 files in the specified folder, until the associations are released or the transport connections are closed.
run in interface Runnablepublic static void main(String[] arg)
For testing.
Wait for connections, accept associations and store received files in the specified folder.
arg - array of zero, four, five or eight strings - our port, our AE Title,
optionally the max PDU size, socket receive and send buffer sizes,
the folder in which to stored received files (zero length if want to ignore received data),
optionally a string flag valued SECURE or other,
and the debugging level;
if no arguments are supplied the properties in "~/.com.pixelmed.network.StorageSOPClassSCPDispatcher.properties" will be used if present,
otherwise the defaults (11112,STORESCP,~/tmp,debug level 0) will be used - in this mode the service will also be self-registered with dns-sd if possible
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||