|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dcm4che2.net.NetworkConnection
public class NetworkConnection
A DICOM Part 15, Annex H compliant class, NetworkConnection
encapsulates the properties associated with a connection to a TCP/IP network.
The network connection describes one TCP port on one network device. This can be used for a TCP connection over which a DICOM association can be negotiated with one or more Network AEs. It specifies 8 the hostname and TCP port number. A network connection may support multiple Network AEs. The Network AE selection takes place during association negotiation based on the called and calling AE-titles.
Field Summary | |
---|---|
static int |
DEFAULT
|
static int |
ONLY_ACTIVE
|
protected java.net.ServerSocket |
server
|
Constructor Summary | |
---|---|
NetworkConnection()
|
Method Summary | |
---|---|
void |
bind(java.util.concurrent.Executor executor)
Bind this network connection to a TCP port and start a server socket accept loop. |
protected boolean |
checkConnection(java.net.Socket s)
Check the incoming socket connection against the limitations set up for this Network Connection. |
boolean |
checkConnectionCountWithinLimit()
Check to see if the specified number of associations has been exceeded. |
java.net.Socket |
connect(NetworkConnection peerConfig)
Create a socket as an SCU and connect to a peer network connection (the SCP). |
protected java.net.ServerSocket |
createTLSServerSocket()
|
protected java.net.Socket |
createTLSSocket()
|
protected void |
decListenerConnectionCount()
Decrement the number of active associations. |
void |
disableSSLv2Hello()
|
void |
enableSSLv2Hello()
|
int |
getAcceptTimeout()
|
int |
getBacklog()
|
java.lang.String |
getCommonName()
An arbitrary name for the Network Connections object. |
int |
getConnectTimeout()
|
Device |
getDevice()
Get the Device object that this Network Connection belongs
to. |
java.util.List<java.lang.String> |
getExcludeConnectionsFrom()
Get a list of IP addresses from which we should ignore connections. |
java.lang.String |
getHostname()
This is the DNS name for this particular connection. |
int |
getMaxScpAssociations()
Get the maximum number of incoming associations that this Network Connection will allow. |
int |
getPort()
The TCP port that the AE is listening on. |
int |
getReceiveBufferSize()
Get the SO_RCVBUF socket value in KB. |
int |
getReleaseTimeout()
Timeout in ms for receiving A-RELEASE-RP, 5000 by default. |
int |
getRequestTimeout()
Timeout in ms for receiving A-ASSOCIATE-RQ, 5000 by default |
int |
getSendBufferSize()
Get the SO_SNDBUF socket option value in KB, |
java.net.ServerSocket |
getServer()
Returns server socket associated with this Network Connection, bound to the TCP port, listening for connect requests. |
int |
getSocketCloseDelay()
Delay in ms for Socket close after sending A-ABORT, 50ms by default. |
java.lang.String[] |
getTlsCipherSuite()
The TLS CipherSuites that are supported on this particular connection. |
java.lang.String[] |
getTlsProtocol()
|
protected void |
incListenerConnectionCount()
Increment the number of active associations. |
boolean |
isInstalled()
True if the Network Connection is installed on the network. |
boolean |
isListening()
|
boolean |
isTcpNoDelay()
Determine if this network connection is using Nagle's algorithm as part of its network communication. |
boolean |
isTLS()
|
boolean |
isTlsNeedClientAuth()
|
void |
setAcceptTimeout(int timeout)
|
void |
setBacklog(int backlog)
|
void |
setCommonName(java.lang.String name)
An arbitrary name for the Network Connections object. |
void |
setConnectTimeout(int timeout)
|
void |
setExcludeConnectionsFrom(java.util.List<java.lang.String> excludeConnectionsFrom)
Set a list of IP addresses from which we should ignore connections. |
void |
setHostname(java.lang.String hostname)
This is the DNS name for this particular connection. |
void |
setInstalled(boolean installed)
True if the Network Connection is installed on the network. |
void |
setMaxScpAssociations(int maxListenerAssociations)
Set the maximum number of incoming associations that this Network Connection will allow. |
void |
setPort(int port)
The TCP port that the AE is listening on. |
void |
setReceiveBufferSize(int size)
Set the SO_RCVBUF socket option to specified value in KB. |
void |
setReleaseTimeout(int timeout)
Timeout in ms for receiving A-RELEASE-RP, 5000 by default. |
void |
setRequestTimeout(int timeout)
Timeout in ms for receiving A-ASSOCIATE-RQ, 5000 by default |
void |
setSendBufferSize(int size)
Set the SO_SNDBUF socket option to specified value in KB, |
void |
setSocketCloseDelay(int delay)
Delay in ms for Socket close after sending A-ABORT, 50ms by default. |
protected void |
setSocketOptions(java.net.Socket s)
Set options on a socket that was either just accepted (if this network connection is an SCP), or just created (if this network connection is an SCU). |
void |
setTcpNoDelay(boolean tcpNoDelay)
Set whether or not this network connection should use Nagle's algorithm as part of its network communication. |
void |
setTls3DES_EDE_CBC()
|
void |
setTlsAES_128_CBC()
|
void |
setTlsCipherSuite(java.lang.String[] tlsCipherSuite)
The TLS CipherSuites that are supported on this particular connection. |
void |
setTlsNeedClientAuth(boolean tlsNeedClientAuth)
|
void |
setTlsProtocol(java.lang.String[] tlsProtocol)
|
void |
setTlsWithoutEncyrption()
|
java.lang.String |
toString()
|
void |
unbind()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT
public static final int ONLY_ACTIVE
protected java.net.ServerSocket server
Constructor Detail |
---|
public NetworkConnection()
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public Device getDevice()
Device
object that this Network Connection belongs
to.
public java.lang.String getHostname()
public void setHostname(java.lang.String hostname)
hostname
- A String containing the host name.public java.lang.String getCommonName()
public void setCommonName(java.lang.String name)
name
- A String containing the name.public int getPort()
public void setPort(int port)
ONLY_ACTIVE
for
network connection that only initiates associations.
A port number of zero
will let the system pick up an
ephemeral port.
port
- The port numberpublic java.lang.String[] getTlsCipherSuite()
public void setTlsCipherSuite(java.lang.String[] tlsCipherSuite)
tlsCipherSuite
- A String array containing the supported cipher suitespublic void setTlsWithoutEncyrption()
public void setTls3DES_EDE_CBC()
public void setTlsAES_128_CBC()
public boolean isInstalled()
public void setInstalled(boolean installed)
installed
- True if the NetworkConnection is installed on the network.public boolean isListening()
public boolean isTLS()
public int getBacklog()
public void setBacklog(int backlog)
public int getAcceptTimeout()
public void setAcceptTimeout(int timeout)
public int getConnectTimeout()
public void setConnectTimeout(int timeout)
public int getRequestTimeout()
An
- int value containing the milliseconds.public void setRequestTimeout(int timeout)
timeout
- An int value containing the milliseconds.public int getReleaseTimeout()
public void setReleaseTimeout(int timeout)
timeout
- An int value containing the milliseconds.public int getSocketCloseDelay()
public void setSocketCloseDelay(int delay)
delay
- An int value containing the milliseconds.public int getReceiveBufferSize()
public void setReceiveBufferSize(int size)
bufferSize
- An int value containing the buffer size in KB.public int getSendBufferSize()
public void setSendBufferSize(int size)
bufferSize
- An int value containing the buffer size in KB.public boolean isTcpNoDelay()
public void setTcpNoDelay(boolean tcpNoDelay)
tcpNoDelay
- boolean True if TCP no delay (disable Nagle's algorithm) should be
used.public boolean isTlsNeedClientAuth()
public void setTlsNeedClientAuth(boolean tlsNeedClientAuth)
public java.lang.String[] getTlsProtocol()
public void setTlsProtocol(java.lang.String[] tlsProtocol)
public void enableSSLv2Hello()
public void disableSSLv2Hello()
public java.net.ServerSocket getServer()
null
if this network connection only initiates associations or was not yet
bound by bind(java.util.concurrent.Executor)
.
null
public java.net.Socket connect(NetworkConnection peerConfig) throws java.io.IOException
peerConfig
- The peer NetworkConnection
object that this
network connection is connecting to.
java.io.IOException
- If the connection cannot be made due to network IO
reasons.protected void setSocketOptions(java.net.Socket s) throws java.net.SocketException
s
- The Socket
object.
java.net.SocketException
- If the options cannot be set on the socket.public void bind(java.util.concurrent.Executor executor) throws java.io.IOException
executor
- The Executor
implementation that
association threads should run within. The executor
determines the threading model.
java.io.IOException
- If there is a problem with the network interaction.protected boolean checkConnection(java.net.Socket s)
s
- The socket connection.
protected void incListenerConnectionCount()
protected void decListenerConnectionCount()
public boolean checkConnectionCountWithinLimit()
maxAssociations
- An int containing the maximum number of associations
allowed.
public void unbind()
protected java.net.Socket createTLSSocket() throws java.io.IOException
java.io.IOException
protected java.net.ServerSocket createTLSServerSocket() throws java.io.IOException
java.io.IOException
public java.util.List<java.lang.String> getExcludeConnectionsFrom()
public void setExcludeConnectionsFrom(java.util.List<java.lang.String> excludeConnectionsFrom)
excludeConnectionsFrom
- the list of IP addresses which should be ignored.public int getMaxScpAssociations()
public void setMaxScpAssociations(int maxListenerAssociations)
maxScpAssociations
- An int which defines the max associations.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |