public class ProbeCapability
extends java.lang.Object
implements java.lang.Runnable
This class provides utilities to probe the capabilities of potential DICOM Application Entities, used for example to maintain a cache of potential C-MOVE targets.
The constructors perform the probe and may be used to determine the capabilities of an AE listening on a specified port, or to probe for plausible ports.
The Verification SOP Class must be supported by the AE being tested for it to be detected.
The supported SOP Classes are tested by proposing associations with the default transfer syntax.
The main method may be useful in its own right as a command line utility.
Modifier and Type | Class and Description |
---|---|
protected class |
ProbeCapability.AETGenerator |
protected class |
ProbeCapability.StringPermutationGenerator |
Modifier and Type | Field and Description |
---|---|
protected static char[] |
upperCase |
protected static char[] |
upperCaseNumericUnderscore |
Constructor and Description |
---|
ProbeCapability(java.lang.String hostname,
int port,
java.lang.String calledAETitle,
java.lang.String callingAETitle)
Establish an association to the specified AE and using the specified port, and probe its capabilities.
|
ProbeCapability(java.lang.String hostname,
java.lang.String callingAETitle)
Establish an association to the specified host, find a suitable port and AE Title, and probe its capabilities.
|
ProbeCapability(java.lang.String hostname,
java.lang.String calledAETitle,
java.lang.String callingAETitle)
Establish an association to the specified AE, find a suitable port, and probe its capabilities.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
canConnectToPort(java.lang.String hostAddress,
int port)
Can a connection to the specified address and port be established?
|
static boolean |
canConnectToPort(java.lang.String hostAddress,
int port,
int timeout)
Can a connection to the specified address and port be established?
|
static java.lang.String |
describeIPAddress(java.net.InetAddress address) |
java.lang.String |
getCalledAETitle()
Get the Called AET.
|
java.lang.String |
getHostname()
Get the hostname or IP address.
|
int |
getPort()
Get the port.
|
PresentationAddress |
getPresentationAddress()
Get the Presentation Address.
|
java.lang.String |
getQueryModel()
Get the supported query model.
|
java.util.List |
getSupportedQuerySOPClasses()
Get the supported Query SOP Classes.
|
java.util.List |
getSupportedRetrieveWithGetSOPClasses()
Get the supported Retrieve with Get SOP Classes.
|
java.util.List |
getSupportedRetrieveWithMoveSOPClasses()
Get the supported Retrieve with Move SOP Classes.
|
java.util.List |
getSupportedStorageSOPClasses()
Get the supported Storage SOP Classes.
|
boolean |
isDone()
Has thread finished probing ?
|
boolean |
isQuerySupported()
Are any Query SOP Classes supported ?
|
boolean |
isRetrieveWithGetSupported()
Are any Retrieve with Get SOP Classes supported ?
|
boolean |
isRetrieveWithMoveSupported()
Are any Retrieve with Move SOP Classes supported ?
|
boolean |
isStorageSupported()
Are any Storage SOP Classes supported ?
|
static void |
main(java.lang.String[] arg)
For testing, establish an association to the specified AE, find a suitable port if necessary, and probe its capabilities.
|
static void |
probeRangeAllHostsOnLocalSubnet(java.lang.String callingAETitle) |
static java.util.List |
probeSupportedSOPClasses(java.lang.String[] arrayOfSOPClasses,
java.lang.String hostname,
int port,
java.lang.String calledAETitle,
java.lang.String callingAETitle)
Establish an association to the specified AE, and probe its capabilities with respect to those SOP Classes supported.
|
void |
run()
Actually do the work to probe for the requested information.
|
void |
runUntilDone()
Actually do the work to probe for the requested information, and do not come back until done.
|
java.lang.String |
toString()
Return a String representing this object's value.
|
protected static final char[] upperCase
protected static final char[] upperCaseNumericUnderscore
public ProbeCapability(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle)
Establish an association to the specified AE and using the specified port, and probe its capabilities.
The parameters are established but the work is deferred until run() is called.
hostname
- their hostname or IP addressport
- their portcalledAETitle
- their AE TitlecallingAETitle
- our AE Titlepublic ProbeCapability(java.lang.String hostname, java.lang.String callingAETitle) throws DicomNetworkException
Establish an association to the specified host, find a suitable port and AE Title, and probe its capabilities.
The parameters are established but the work is deferred until run() is called.
hostname
- their hostname or IP addresscallingAETitle
- our AE TitleDicomNetworkException
public ProbeCapability(java.lang.String hostname, java.lang.String calledAETitle, java.lang.String callingAETitle) throws DicomNetworkException
Establish an association to the specified AE, find a suitable port, and probe its capabilities.
The parameters are established but the work is deferred until run() is called.
hostname
- their hostname or IP addresscalledAETitle
- their AE TitlecallingAETitle
- our AE TitleDicomNetworkException
public static boolean canConnectToPort(java.lang.String hostAddress, int port)
Can a connection to the specified address and port be established?
Will block until connected or an error occurs.
hostAddress
- port
- public static boolean canConnectToPort(java.lang.String hostAddress, int port, int timeout)
Can a connection to the specified address and port be established?
hostAddress
- port
- timeout
- in milliseconds, or zero for no timeout (will block until connected or an error occurs)public static java.lang.String describeIPAddress(java.net.InetAddress address)
public java.lang.String getCalledAETitle()
Get the Called AET.
public java.lang.String getHostname()
Get the hostname or IP address.
public int getPort()
Get the port.
public PresentationAddress getPresentationAddress()
Get the Presentation Address.
public java.lang.String getQueryModel()
Get the supported query model.
Note that only a single model is returned, even if more than one is supported; in the later case, study root is preferred over patient root over patient/study only.
Further, the query model of the query (find) is returned, in preference to checking the model of the retrieve (move or get), which is only done of no find SOP classes are supported.
NetworkApplicationProperties.StudyRootQueryModel
or NetworkApplicationProperties.PatientRootQueryModel
or NetworkApplicationProperties.PatientStudyOnlyQueryModel
.public java.util.List getSupportedQuerySOPClasses()
Get the supported Query SOP Classes.
public java.util.List getSupportedRetrieveWithGetSOPClasses()
Get the supported Retrieve with Get SOP Classes.
public java.util.List getSupportedRetrieveWithMoveSOPClasses()
Get the supported Retrieve with Move SOP Classes.
public java.util.List getSupportedStorageSOPClasses()
Get the supported Storage SOP Classes.
public boolean isDone()
Has thread finished probing ?
public boolean isQuerySupported()
Are any Query SOP Classes supported ?
public boolean isRetrieveWithGetSupported()
Are any Retrieve with Get SOP Classes supported ?
public boolean isRetrieveWithMoveSupported()
Are any Retrieve with Move SOP Classes supported ?
public boolean isStorageSupported()
Are any Storage SOP Classes supported ?
public static void main(java.lang.String[] arg)
For testing, establish an association to the specified AE, find a suitable port if necessary, and probe its capabilities.
arg
- array of three or four values - their hostname, optionally their port, optionally their AE Title, our AE Titlepublic static void probeRangeAllHostsOnLocalSubnet(java.lang.String callingAETitle)
public static java.util.List probeSupportedSOPClasses(java.lang.String[] arrayOfSOPClasses, java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle) throws DicomNetworkException, java.io.IOException
Establish an association to the specified AE, and probe its capabilities with respect to those SOP Classes supported.
arrayOfSOPClasses
- the SOP Classes to test forhostname
- their hostname or IP addressport
- their portcalledAETitle
- their AE TitlecallingAETitle
- our AE TitleDicomNetworkException
java.io.IOException
public void run()
Actually do the work to probe for the requested information.
run
in interface java.lang.Runnable
public void runUntilDone() throws java.lang.InterruptedException
Actually do the work to probe for the requested information, and do not come back until done.
java.lang.InterruptedException
public java.lang.String toString()
Return a String representing this object's value.
toString
in class java.lang.Object