Trispark JDT
2.50.13

com.archimed.dicom.network
Class Association

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

public class Association
extends java.lang.Object

replaced by AssociationIO.

This class contains methods to build up and break down an association between two DICOM application entities and to send DICOM commands and data sets once an association is established.

Note: This class is replaced by the AssociationIO class and is maintained for backwards compatibility. New implementations should make use of the AssocationIO class.

Since:
1.00
See Also:
AssociationIO

Field Summary
static int ABORT
           
static int ASSOCIATE_ACKNOWLEDGE
           
static int ASSOCIATE_REJECT
           
static int ASSOCIATE_REQUEST
           
protected  JdtLogger log
           
static int PDATA_PDU
           
static int RELEASE_REQUEST
           
static int RELEASE_RESPONSE
           
 
Constructor Summary
Association(java.io.InputStream in, java.io.OutputStream out)
          constructs an new Association Object
 
Method Summary
 UIDEntry getCurrentAbstractSyntax()
           
 int getCurrentPresentationContext()
           
 java.lang.String getImplementationClassUID()
          returns the Implementation Class UID
 java.lang.String getImplementationVersionName()
          returns the Implementation Version Name
 boolean isSequenceUndefLen()
          returns true if sequences are sent with undefined length or false otherwise
 int peek()
          peeks to see the type of the structure sent from a peer DICOM application entity once a connection is established.
 Abort receiveAbort()
          reads in an abort
 Request receiveAssociateRequest()
          reads an association request.
 Response receiveAssociateResponse()
          awaits an associate response.
 DicomObject receiveCommand()
          reads from the inputstream until a complete DICOM commandset is received from the peer dicom application entity
 byte[] receiveCommandAsByteArray()
          reads from the inputstream until a complete DICOM commandset is received from the peer dicom application entity.
 DicomObject receiveData()
          reads from the inputstream until a complete DICOM dataset is received from the peer dicom application entity
 byte[] receiveDataAsByteArray()
          reads from the inputstream until a complete DICOM dataset is received from the peer dicom application entity.
 void receiveReleaseRequest()
          reads in a release request.
 void receiveReleaseResponse()
          reads in a release response
 void send(byte pcid, DicomObject commandset, DicomObject dataset)
          Deprecated. To avoid confusion with the other send method that takes an abstract syntax uid as the first argument, this method has been deprecated and replaced by sendInPresentationContext(int pcid,DicomObject commandset,DicomObject dataset)
 void send(int abstractsyntaxuid, DicomObject commandset, DicomObject dataset)
          sends a commandset (and dataset) in a presentation context according to the specified abstract syntax.
 void sendAbort(int source, int reason)
          sends an abort.
 void sendAssociateRequest(Request req)
          sends an Association Request.
 void sendAssociateResponse(Response response)
          sends an Associate Response.
 void sendInPresentationContext(byte pcid, DicomObject commandset, DicomObject dataset)
          Deprecated. This method is deprecated and replaced by sendInPresentationContext(int pcid,DicomObject commandset,DicomObject dataset)
 void sendInPresentationContext(int pcid, DicomObject commandset, DicomObject dataset)
          sends a commandset (and dataset) in a presentation context with the specified presentation context id.
 void sendReleaseRequest()
          sends a release request.
 void sendReleaseResponse()
          sends an release response
 void setImplementationClassUID(java.lang.String s)
          sets the Implementation Class UID
 void setImplementationVersionName(java.lang.String s)
          sets the Implementation Version Name
 void setSequenceUndefLen(boolean sequenceUndefLen)
          sets whether sequences are sent with undefined length or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PDATA_PDU

public static final int PDATA_PDU
See Also:
Constant Field Values

RELEASE_REQUEST

public static final int RELEASE_REQUEST
See Also:
Constant Field Values

ABORT

public static final int ABORT
See Also:
Constant Field Values

RELEASE_RESPONSE

public static final int RELEASE_RESPONSE
See Also:
Constant Field Values

ASSOCIATE_REQUEST

public static final int ASSOCIATE_REQUEST
See Also:
Constant Field Values

ASSOCIATE_ACKNOWLEDGE

public static final int ASSOCIATE_ACKNOWLEDGE
See Also:
Constant Field Values

ASSOCIATE_REJECT

public static final int ASSOCIATE_REJECT
See Also:
Constant Field Values

log

protected JdtLogger log
Constructor Detail

Association

public Association(java.io.InputStream in,
                   java.io.OutputStream out)
constructs an new Association Object

Parameters:
in - the inputstream,typically a socket input stream
out - the outputstream, typically a socket outputstream.
Method Detail

setImplementationVersionName

public void setImplementationVersionName(java.lang.String s)
sets the Implementation Version Name

Parameters:
s - the Implementation Version Name

getImplementationVersionName

public java.lang.String getImplementationVersionName()
returns the Implementation Version Name

Returns:
the Implementation Version Name

setImplementationClassUID

public void setImplementationClassUID(java.lang.String s)
sets the Implementation Class UID

Parameters:
s - the Implementation Class UID

getImplementationClassUID

public java.lang.String getImplementationClassUID()
returns the Implementation Class UID

Returns:
the Implementation Class UID

setSequenceUndefLen

public void setSequenceUndefLen(boolean sequenceUndefLen)
sets whether sequences are sent with undefined length or not

Parameters:
sequenceUndefLen - true for undefined length, false for defined length

isSequenceUndefLen

public boolean isSequenceUndefLen()
returns true if sequences are sent with undefined length or false otherwise

Returns:
true if sequence are sent with undefined length (default) or false otherwise

receiveCommand

public DicomObject receiveCommand()
                           throws java.io.IOException,
                                  IllegalValueException,
                                  DicomException,
                                  UnknownUIDException
reads from the inputstream until a complete DICOM commandset is received from the peer dicom application entity

Returns:
the commandset read in as a com.archimed.dicom.DicomObject
Throws:
java.io.IOException
IllegalValueException
DicomException
UnknownUIDException

receiveCommandAsByteArray

public byte[] receiveCommandAsByteArray()
                                 throws java.io.IOException,
                                        IllegalValueException
reads from the inputstream until a complete DICOM commandset is received from the peer dicom application entity. The commandset is returned as a byte array and has not been parsed into a DicomObject.

Returns:
the commandset in a byte array
Throws:
java.io.IOException
IllegalValueException

receiveData

public DicomObject receiveData()
                        throws java.io.IOException,
                               IllegalValueException,
                               DicomException,
                               UnknownUIDException
reads from the inputstream until a complete DICOM dataset is received from the peer dicom application entity

Returns:
the dataset read in as a com.archimed.dicom.DicomObject
Throws:
java.io.IOException
IllegalValueException
DicomException
UnknownUIDException

receiveDataAsByteArray

public byte[] receiveDataAsByteArray()
                              throws java.io.IOException,
                                     IllegalValueException
reads from the inputstream until a complete DICOM dataset is received from the peer dicom application entity. The dataset is returned as a byte array and has not been parsed into a DicomObject.

Returns:
the dataset in a byte array
Throws:
java.io.IOException
IllegalValueException

sendAssociateResponse

public void sendAssociateResponse(Response response)
                           throws java.io.IOException,
                                  IllegalValueException
sends an Associate Response.

Parameters:
response - the response to send. This should be an instance of Reject,Abort or Acknowledge.
Throws:
java.io.IOException
IllegalValueException

sendReleaseResponse

public void sendReleaseResponse()
                         throws java.io.IOException,
                                IllegalValueException
sends an release response

Throws:
java.io.IOException
IllegalValueException

send

public void send(int abstractsyntaxuid,
                 DicomObject commandset,
                 DicomObject dataset)
          throws java.io.IOException,
                 IllegalValueException,
                 DicomException
sends a commandset (and dataset) in a presentation context according to the specified abstract syntax. If multiple presentation contexts with the same abstract syntax are accepted, the accepted presentation context with the lowest presentation context id is used. The abstract syntax should be negotiated during association establishment.

Parameters:
abstractsyntaxuid - a negotiated abstract syntax.
commandset - the commandset to send.
dataset - the dataset to send or null if there is no dataset to send.
Throws:
java.io.IOException
IllegalValueException
DicomException

send

public void send(byte pcid,
                 DicomObject commandset,
                 DicomObject dataset)
          throws java.io.IOException,
                 IllegalValueException,
                 DicomException
Deprecated. To avoid confusion with the other send method that takes an abstract syntax uid as the first argument, this method has been deprecated and replaced by sendInPresentationContext(int pcid,DicomObject commandset,DicomObject dataset)

Throws:
java.io.IOException
IllegalValueException
DicomException

sendInPresentationContext

public void sendInPresentationContext(byte pcid,
                                      DicomObject commandset,
                                      DicomObject dataset)
                               throws java.io.IOException,
                                      IllegalValueException,
                                      DicomException
Deprecated. This method is deprecated and replaced by sendInPresentationContext(int pcid,DicomObject commandset,DicomObject dataset)

Throws:
java.io.IOException
IllegalValueException
DicomException

sendInPresentationContext

public void sendInPresentationContext(int pcid,
                                      DicomObject commandset,
                                      DicomObject dataset)
                               throws java.io.IOException,
                                      IllegalValueException,
                                      DicomException
sends a commandset (and dataset) in a presentation context with the specified presentation context id.

Parameters:
pcid - the presentation context id
commandset - the commandset to send.
dataset - the dataset to send or null if there is no dataset to send.
Throws:
java.io.IOException
IllegalValueException
DicomException

peek

public int peek()
         throws java.io.IOException,
                IllegalValueException
peeks to see the type of the structure sent from a peer DICOM application entity once a connection is established.

Returns:
The method will return one of:
  • ASSOCIATE_REQUEST: the connected dicom application entity is sending an associate request
  • ASSOCIATE_ACKNOWLEDGE: the connected dicom application entity is sending an associate acknowledge
  • ASSOCIATE_REJECT: the connected dicom application entity is sending an associate reject
  • RELEASE_REQUEST: the connected dicom application entity is sending a release request.
  • RELEASE_RESPONSE: the connected dicom application entity is sending a release response.
  • ABORT: the connected dicom application entity is sending an abort.
  • PDATA_PDU: the connected dicom application entity is sending a command or data set.
Throws:
java.io.IOException
IllegalValueException

getCurrentPresentationContext

public int getCurrentPresentationContext()

getCurrentAbstractSyntax

public UIDEntry getCurrentAbstractSyntax()
                                  throws IllegalValueException
Throws:
IllegalValueException

receiveAssociateRequest

public Request receiveAssociateRequest()
                                throws java.io.IOException,
                                       UnknownUIDException,
                                       IllegalValueException
reads an association request.

Returns:
The parameters of the association in the form of a Request object.
Throws:
java.io.IOException
UnknownUIDException
IllegalValueException

receiveAssociateResponse

public Response receiveAssociateResponse()
                                  throws java.io.IOException,
                                         UnknownUIDException,
                                         IllegalValueException
awaits an associate response.

Returns:
The response parameters with which the peer dicom entity responded, contained in a Response object. The returned instance will be an Acknowledge, a Reject or an Abort object.
Throws:
java.io.IOException
UnknownUIDException
IllegalValueException

sendAssociateRequest

public void sendAssociateRequest(Request req)
                          throws java.io.IOException,
                                 IllegalValueException
sends an Association Request. The relevant parameters for the request are in the Request argument

Parameters:
req - contains the association request parameters.
Throws:
java.io.IOException
IllegalValueException

sendReleaseRequest

public void sendReleaseRequest()
                        throws java.io.IOException,
                               IllegalValueException
sends a release request.

Throws:
java.io.IOException
IllegalValueException

receiveReleaseRequest

public void receiveReleaseRequest()
                           throws java.io.IOException,
                                  IllegalValueException
reads in a release request.

Throws:
java.io.IOException
IllegalValueException

receiveReleaseResponse

public void receiveReleaseResponse()
                            throws java.io.IOException,
                                   IllegalValueException
reads in a release response

Throws:
java.io.IOException
IllegalValueException

sendAbort

public void sendAbort(int source,
                      int reason)
               throws java.io.IOException
sends an abort.

Parameters:
source - the source of the abort
reason - the reason for the abort
Throws:
java.io.IOException

receiveAbort

public Abort receiveAbort()
                   throws IllegalValueException,
                          java.io.IOException
reads in an abort

Returns:
the abort received
Throws:
IllegalValueException
java.io.IOException

Trispark JDT
2.50.13

Copyright © 1999-2008 Trispark. All Rights Reserved.