Package com.pixelmed.network
Class AssociationFactory
java.lang.Object
com.pixelmed.network.AssociationFactory
A factory object of static methods that can accept and initiate associations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.pixelmed.network.AssociationInitiator
createNewAssociation
(String hostname, int port, String calledAETitle, String callingAETitle, int ourMaximumLengthReceived, int socketReceiveBufferSize, int socketSendBufferSize, LinkedList presentationContexts, LinkedList scuSCPRoleSelections, boolean secureTransport, String username, String password) Opens a transport connection and initiates an association.static com.pixelmed.network.AssociationInitiator
createNewAssociation
(String hostname, int port, String calledAETitle, String callingAETitle, LinkedList presentationContexts, LinkedList scuSCPRoleSelections, boolean secureTransport) Opens a transport connection and initiates an association.static com.pixelmed.network.AssociationInitiator
createNewAssociation
(String hostname, int port, String calledAETitle, String callingAETitle, LinkedList presentationContexts, LinkedList scuSCPRoleSelections, boolean secureTransport, String username, String password) Opens a transport connection and initiates an association.static com.pixelmed.network.AssociationAcceptor
createNewAssociation
(Socket socket, String calledAETitle, int ourMaximumLengthReceived, int socketReceiveBufferSize, int socketSendBufferSize, PresentationContextSelectionPolicy presentationContextSelectionPolicy) Accepts an association on the supplied open transport connection.static com.pixelmed.network.AssociationAcceptor
createNewAssociation
(Socket socket, String calledAETitle, PresentationContextSelectionPolicy presentationContextSelectionPolicy) Accepts an association on the supplied open transport connection.static int
Get the default Maximum PDU Size that we would like to receive.static int
Get the default TCP socket receive buffer size to use to set the socket options.static int
Get the default TCP socket send buffer size to use to set the socket options.
-
Constructor Details
-
AssociationFactory
public AssociationFactory()
-
-
Method Details
-
getDefaultMaximumLengthReceived
public static int getDefaultMaximumLengthReceived()Get the default Maximum PDU Size that we would like to receive.
- Returns:
- the default Maximum PDU Size
-
getDefaultReceiveBufferSize
public static int getDefaultReceiveBufferSize()Get the default TCP socket receive buffer size to use to set the socket options.
- Returns:
- the receive buffer size, 0 means leave the default operating system value alone
-
getDefaultSendBufferSize
public static int getDefaultSendBufferSize()Get the default TCP socket send buffer size to use to set the socket options.
- Returns:
- the send buffer size, 0 means leave the default operating system value alone
-
createNewAssociation
public static com.pixelmed.network.AssociationInitiator createNewAssociation(String hostname, int port, String calledAETitle, String callingAETitle, int ourMaximumLengthReceived, int socketReceiveBufferSize, int socketSendBufferSize, LinkedList presentationContexts, LinkedList scuSCPRoleSelections, boolean secureTransport, String username, String password) throws DicomNetworkException, IOException Opens a transport connection and initiates an association. The default Implementation Class UID and Implementation Version of the toolkit are used.- Parameters:
hostname
- hostname or IP address (dotted quad) component of presentation address of the remote AE (them)port
- TCP port component of presentation address of the remote AE (them)calledAETitle
- the AE Title of the remote (their) end of the associationcallingAETitle
- the AE Title of the local (our) end of the associationourMaximumLengthReceived
- 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 defaultpresentationContexts
- a java.util.LinkedList ofPresentationContext
objects, each of which contains an Abstract Syntax (SOP Class UID) and one or more Transfer SyntaxesscuSCPRoleSelections
- a java.util.LinkedList ofSCUSCPRoleSelection
objects, each of which contains an Abstract Syntax (SOP Class UID) and specifies whether SCU and/or SCP roles are supportedsecureTransport
- true if to use secure transport protocolusername
- may be null if no user identitypassword
- may be null if no user identity or no password required- Returns:
- an open association in state 6 - Data Transfer
- Throws:
IOException
DicomNetworkException
- thrown for A-ASSOCIATE-RJ, A-ABORT and A-P-ABORT indications
-
createNewAssociation
public static com.pixelmed.network.AssociationInitiator createNewAssociation(String hostname, int port, String calledAETitle, String callingAETitle, LinkedList presentationContexts, LinkedList scuSCPRoleSelections, boolean secureTransport) throws DicomNetworkException, IOException Opens a transport connection and initiates an association. The default Implementation Class UID, Implementation Version and Maximum PDU Size of the toolkit are used.- Parameters:
hostname
- hostname or IP address (dotted quad) component of presentation address of the remote AE (them)port
- TCP port component of presentation address of the remote AE (them)calledAETitle
- the AE Title of the remote (their) end of the associationcallingAETitle
- the AE Title of the local (our) end of the associationpresentationContexts
- a java.util.LinkedList ofPresentationContext
objects, each of which contains an Abstract Syntax (SOP Class UID) and one or more Transfer SyntaxesscuSCPRoleSelections
- a java.util.LinkedList ofSCUSCPRoleSelection
objects, each of which contains an Abstract Syntax (SOP Class UID) and specifies whether SCU and/or SCP roles are supportedsecureTransport
- true if to use secure transport protocol- Returns:
- an open association in state 6 - Data Transfer
- Throws:
IOException
DicomNetworkException
- thrown for A-ASSOCIATE-RJ, A-ABORT and A-P-ABORT indications
-
createNewAssociation
public static com.pixelmed.network.AssociationInitiator createNewAssociation(String hostname, int port, String calledAETitle, String callingAETitle, LinkedList presentationContexts, LinkedList scuSCPRoleSelections, boolean secureTransport, String username, String password) throws DicomNetworkException, IOException Opens a transport connection and initiates an association. The default Implementation Class UID, Implementation Version and Maximum PDU Size of the toolkit are used.- Parameters:
hostname
- hostname or IP address (dotted quad) component of presentation address of the remote AE (them)port
- TCP port component of presentation address of the remote AE (them)calledAETitle
- the AE Title of the remote (their) end of the associationcallingAETitle
- the AE Title of the local (our) end of the associationpresentationContexts
- a java.util.LinkedList ofPresentationContext
objects, each of which contains an Abstract Syntax (SOP Class UID) and one or more Transfer SyntaxesscuSCPRoleSelections
- a java.util.LinkedList ofSCUSCPRoleSelection
objects, each of which contains an Abstract Syntax (SOP Class UID) and specifies whether SCU and/or SCP roles are supportedsecureTransport
- true if to use secure transport protocolusername
- may be null if no user identitypassword
- may be null if no user identity or no password required- Returns:
- an open association in state 6 - Data Transfer
- Throws:
IOException
DicomNetworkException
- thrown for A-ASSOCIATE-RJ, A-ABORT and A-P-ABORT indications
-
createNewAssociation
public static com.pixelmed.network.AssociationAcceptor createNewAssociation(Socket socket, String calledAETitle, int ourMaximumLengthReceived, int socketReceiveBufferSize, int socketSendBufferSize, PresentationContextSelectionPolicy presentationContextSelectionPolicy) throws DicomNetworkException, IOException Accepts an association on the supplied open transport connection. The default Implementation Class UID and Implementation Version of the toolkit are used.- Parameters:
socket
- already open transport connection on which the association is to be acceptedcalledAETitle
- the AE Title of the local (our) end of the associationourMaximumLengthReceived
- 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 defaultpresentationContextSelectionPolicy
- which SOP Classes and Transfer Syntaxes to accept and reject- Returns:
- an open association in state 6 - Data Transfer
- Throws:
IOException
DicomNetworkException
- thrown for A-ABORT and A-P-ABORT indications
-
createNewAssociation
public static com.pixelmed.network.AssociationAcceptor createNewAssociation(Socket socket, String calledAETitle, PresentationContextSelectionPolicy presentationContextSelectionPolicy) throws DicomNetworkException, IOException Accepts an association on the supplied open transport connection. The default Implementation Class UID, Implementation Version and Maximum PDU Size of the toolkit are used. The default maximum length received, receive buffer size and send buffer size are used.- Parameters:
socket
- already open transport connection on which the association is to be acceptedcalledAETitle
- the AE Title of the local (our) end of the associationpresentationContextSelectionPolicy
- which SOP Classes and Transfer Syntaxes to accept and reject- Returns:
- an open association in state 6 - Data Transfer
- Throws:
IOException
DicomNetworkException
- thrown for A-ABORT and A-P-ABORT indications
-