Class ProbeCapability

  • All Implemented Interfaces:
    java.lang.Runnable

    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.

    • Constructor Summary

      Constructors 
      Constructor Description
      ProbeCapability​(java.lang.String hostname, int port, java.lang.String calledAETitle, java.lang.String callingAETitle, int debugLevel)
      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, int debugLevel)
      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, int debugLevel)
      Establish an association to the specified AE, find a suitable port, and probe its capabilities.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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, int debugLevel)
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • upperCase

        protected static final char[] upperCase
      • upperCaseNumericUnderscore

        protected static final char[] upperCaseNumericUnderscore
    • Constructor Detail

      • ProbeCapability

        public ProbeCapability​(java.lang.String hostname,
                               java.lang.String callingAETitle,
                               int debugLevel)
                        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.

        Parameters:
        hostname - their hostname or IP address
        callingAETitle - our AE Title
        debugLevel - zero for no debugging messages, higher values more verbose messages
        Throws:
        DicomNetworkException
      • ProbeCapability

        public ProbeCapability​(java.lang.String hostname,
                               java.lang.String calledAETitle,
                               java.lang.String callingAETitle,
                               int debugLevel)
                        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.

        Parameters:
        hostname - their hostname or IP address
        calledAETitle - their AE Title
        callingAETitle - our AE Title
        debugLevel - zero for no debugging messages, higher values more verbose messages
        Throws:
        DicomNetworkException
      • ProbeCapability

        public ProbeCapability​(java.lang.String hostname,
                               int port,
                               java.lang.String calledAETitle,
                               java.lang.String callingAETitle,
                               int debugLevel)

        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.

        Parameters:
        hostname - their hostname or IP address
        port - their port
        calledAETitle - their AE Title
        callingAETitle - our AE Title
        debugLevel - zero for no debugging messages, higher values more verbose messages
    • Method Detail

      • getCalledAETitle

        public java.lang.String getCalledAETitle()

        Get the Called AET.

        Returns:
        the Called AET
      • getPresentationAddress

        public PresentationAddress getPresentationAddress()

        Get the Presentation Address.

        Returns:
        the Presentation Address
      • getHostname

        public java.lang.String getHostname()

        Get the hostname or IP address.

        Returns:
        the hostname or IP address
      • getPort

        public int getPort()

        Get the port.

        Returns:
        the port
      • getSupportedStorageSOPClasses

        public java.util.List getSupportedStorageSOPClasses()

        Get the supported Storage SOP Classes.

        Returns:
        a list of the supported Storage SOP Class UID strings
      • isStorageSupported

        public boolean isStorageSupported()

        Are any Storage SOP Classes supported ?

        Returns:
        true if any Storage SOP Classes are supported
      • getSupportedQuerySOPClasses

        public java.util.List getSupportedQuerySOPClasses()

        Get the supported Query SOP Classes.

        Returns:
        a list of the supported Query SOP Class UID strings
      • isQuerySupported

        public boolean isQuerySupported()

        Are any Query SOP Classes supported ?

        Returns:
        true if any Query SOP Classes are supported
      • getSupportedRetrieveWithMoveSOPClasses

        public java.util.List getSupportedRetrieveWithMoveSOPClasses()

        Get the supported Retrieve with Move SOP Classes.

        Returns:
        a list of the supported Retrieve with Move SOP Class UID strings
      • isRetrieveWithMoveSupported

        public boolean isRetrieveWithMoveSupported()

        Are any Retrieve with Move SOP Classes supported ?

        Returns:
        true if any Retrieve with Move SOP Classes are supported
      • getSupportedRetrieveWithGetSOPClasses

        public java.util.List getSupportedRetrieveWithGetSOPClasses()

        Get the supported Retrieve with Get SOP Classes.

        Returns:
        a list of the supported Retrieve with Get SOP Class UID strings
      • isRetrieveWithGetSupported

        public boolean isRetrieveWithGetSupported()

        Are any Retrieve with Get SOP Classes supported ?

        Returns:
        true if any Retrieve with Get SOP Classes are supported
      • isDone

        public boolean isDone()

        Has thread finished probing ?

        Returns:
        true if probe has finished
      • probeSupportedSOPClasses

        public static java.util.List probeSupportedSOPClasses​(java.lang.String[] arrayOfSOPClasses,
                                                              java.lang.String hostname,
                                                              int port,
                                                              java.lang.String calledAETitle,
                                                              java.lang.String callingAETitle,
                                                              int debugLevel)
                                                       throws DicomNetworkException,
                                                              java.io.IOException

        Establish an association to the specified AE, and probe its capabilities with respect to those SOP Classes supported.

        Parameters:
        arrayOfSOPClasses - the SOP Classes to test for
        hostname - their hostname or IP address
        port - their port
        calledAETitle - their AE Title
        callingAETitle - our AE Title
        debugLevel - zero for no debugging messages, higher values more verbose messages
        Returns:
        a list of Strings each being a SOP Class that is supported, or an empty list
        Throws:
        DicomNetworkException
        java.io.IOException
      • run

        public void run()

        Actually do the work to probe for the requested information.

        Specified by:
        run in interface java.lang.Runnable
      • runUntilDone

        public void runUntilDone()
                          throws java.lang.InterruptedException

        Actually do the work to probe for the requested information, and do not come back until done.

        Throws:
        java.lang.InterruptedException
      • toString

        public java.lang.String toString()

        Return a String representing this object's value.

        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of the value of this object
      • canConnectToPort

        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.

        Parameters:
        hostAddress -
        port -
        Returns:
        true if can connect
      • canConnectToPort

        public static boolean canConnectToPort​(java.lang.String hostAddress,
                                               int port,
                                               int timeout)

        Can a connection to the specified address and port be established?

        Parameters:
        hostAddress -
        port -
        timeout - in milliseconds, or zero for no timeout (will block until connected or an error occurs)
        Returns:
        true if can connect within specified timeout period
      • probeRangeAllHostsOnLocalSubnet

        public static void probeRangeAllHostsOnLocalSubnet​(java.lang.String callingAETitle)
      • describeIPAddress

        public static java.lang.String describeIPAddress​(java.net.InetAddress address)
      • main

        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.

        Parameters:
        arg - array of three, four or five values - their hostname, optionally their port, optionally their AE Title, our AE Title, and the debug level