Trispark JDT
2.50.13

com.archimed.dicom.network
Class AssociationIO

java.lang.Object
  extended by com.archimed.dicom.network.AssociationIO

public class AssociationIO
extends java.lang.Object

The AssociationIO class is used to read and write ULServiceMessage messages on an association, during the association setup and once an association is established. Use this class to send/receive all the different types of messages:

Maximum PDU length: Normally the maximum pdu length of PDATA_TF pdu's in which DIMSE messages are fragmented and encapsulated as they are sent to the peer device, is taken from the length specified by the peer device in the received Request or Acknowledge message. This length can be changed with the setMaxPduLength(int length) method. It is the caller's responsability to ensure that the maximum length specified is not greater than the maximum length specified by the peer device.

Note: This class replaces the Association class and is the preferred way for exchanging messages on an assocation.

Since:
1.50

Constructor Summary
AssociationIO(java.io.InputStream in, java.io.OutputStream out)
          Constructs a new AssocationIO object from the combination of an inputstream and an outputstream.
 
Method Summary
 void addProgressListener(AssociationIOProgressListener progressListener)
           
 int getMaxPduLength()
          returns the maximum pdu length used in writing dimse messages as specified by setMaxPduLength or -1 if this property is not set explicitly.
 boolean isSeparateDataPDU()
          See setSeparateDataPDU
 boolean isWriteGroupLengths()
          see setWriteGroupLengths
 boolean isWriteSeqUndefLength()
          see setWriteSeqUndefLength
 ULServiceMessage read()
          reads an ULServiceMessage from an association.
 void removeProgressListener(AssociationIOProgressListener progressListener)
           
 void setMaxPduLength(int length)
          sets the maximum pdu length to use for writing PDATA_TF pdu's.
 void setSeparateDataPDU(boolean separateDataPDU)
          sets whether or not datasets of dimse messages are (partly) sent in the PDATA_TF pdu that contained the command part of the dimse message.
 void setWriteGroupLengths(boolean groupLengths)
          specifies if group lengths should be generated when writing the dataset to the network.
 void setWriteSeqUndefLength(boolean sequndeflen)
          Sets wether or not sequences of datasets are written with undefined or defined length.
 void write(ULServiceMessage ulServiceMessage)
          writes an ULServiceMessage on to the outputstream of an assocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssociationIO

public AssociationIO(java.io.InputStream in,
                     java.io.OutputStream out)
Constructs a new AssocationIO object from the combination of an inputstream and an outputstream. The streams can be any type of stream, most often a socket stream or buffered stream wrapped around a socket stream.

Parameters:
in - the inputstream to read messages from
out - the outputstream to write messages to
Method Detail

read

public ULServiceMessage read()
                      throws java.io.IOException,
                             PduException,
                             AbortException,
                             DicomException
reads an ULServiceMessage from an association. This method blocks until a complete ULServiceMesssage is read or an exception is thrown. When an abort message is read, the method will throw an AbortException.

Returns:
the message read from the association
Throws:
java.io.IOException
PduException
AbortException
UnexpectedPduException
DicomException

write

public void write(ULServiceMessage ulServiceMessage)
           throws java.io.IOException,
                  PduException,
                  DicomException
writes an ULServiceMessage on to the outputstream of an assocation. The method will block until the complete message is written or an exception is thrown.

Parameters:
ulServiceMessage -
Throws:
java.io.IOException
PduException
DicomException

isSeparateDataPDU

public boolean isSeparateDataPDU()
See setSeparateDataPDU

Returns:

setSeparateDataPDU

public void setSeparateDataPDU(boolean separateDataPDU)
sets whether or not datasets of dimse messages are (partly) sent in the PDATA_TF pdu that contained the command part of the dimse message. When set to true , a dataset or part of a dataset will never be sent in the same PDATA_TF pdu that contains the command. Defaults to true.

Parameters:
separateDataPDU -

isWriteSeqUndefLength

public boolean isWriteSeqUndefLength()
see setWriteSeqUndefLength

Returns:

setWriteSeqUndefLength

public void setWriteSeqUndefLength(boolean sequndeflen)
Sets wether or not sequences of datasets are written with undefined or defined length. Defaults to true (= undefined length)

Parameters:
sequndeflen -

getMaxPduLength

public int getMaxPduLength()
returns the maximum pdu length used in writing dimse messages as specified by setMaxPduLength or -1 if this property is not set explicitly.

Returns:

setMaxPduLength

public void setMaxPduLength(int length)
sets the maximum pdu length to use for writing PDATA_TF pdu's. If this property is not set explicitly, the maximum pdu length specified in the received request message or acknowledge message will be used. It is the caller's responsability to ensure that the supplied value is not larger than the maximum pdu length specification received in a request or acknowledge from the peer dicom entity on the association.

Parameters:
length -

addProgressListener

public void addProgressListener(AssociationIOProgressListener progressListener)

removeProgressListener

public void removeProgressListener(AssociationIOProgressListener progressListener)

isWriteGroupLengths

public boolean isWriteGroupLengths()
see setWriteGroupLengths

Returns:

setWriteGroupLengths

public void setWriteGroupLengths(boolean groupLengths)
specifies if group lengths should be generated when writing the dataset to the network. (default true)

Parameters:
groupLengths -

Trispark JDT
2.50.13

Copyright © 1999-2008 Trispark. All Rights Reserved.