public class Association
extends java.lang.Object
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.
AssociationIO| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
Association(java.io.InputStream in,
java.io.OutputStream out)
constructs an new Association Object
|
| Modifier and Type | Method and Description |
|---|---|
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
|
public static final int PDATA_PDU
public static final int RELEASE_REQUEST
public static final int ABORT
public static final int RELEASE_RESPONSE
public static final int ASSOCIATE_REQUEST
public static final int ASSOCIATE_ACKNOWLEDGE
public static final int ASSOCIATE_REJECT
protected JdtLogger log
public Association(java.io.InputStream in,
java.io.OutputStream out)
in - the inputstream,typically a socket input streamout - the outputstream, typically a socket outputstream.public void setImplementationVersionName(java.lang.String s)
s - the Implementation Version Namepublic java.lang.String getImplementationVersionName()
public void setImplementationClassUID(java.lang.String s)
s - the Implementation Class UIDpublic java.lang.String getImplementationClassUID()
public void setSequenceUndefLen(boolean sequenceUndefLen)
sequenceUndefLen - true for undefined length, false for defined lengthpublic boolean isSequenceUndefLen()
public DicomObject receiveCommand() throws java.io.IOException, IllegalValueException, DicomException, UnknownUIDException
java.io.IOExceptionIllegalValueExceptionDicomExceptionUnknownUIDExceptionpublic byte[] receiveCommandAsByteArray()
throws java.io.IOException,
IllegalValueException
java.io.IOExceptionIllegalValueExceptionpublic DicomObject receiveData() throws java.io.IOException, IllegalValueException, DicomException, UnknownUIDException
java.io.IOExceptionIllegalValueExceptionDicomExceptionUnknownUIDExceptionpublic byte[] receiveDataAsByteArray()
throws java.io.IOException,
IllegalValueException
java.io.IOExceptionIllegalValueExceptionpublic void sendAssociateResponse(Response response) throws java.io.IOException, IllegalValueException
response - the response to send. This should be an instance of Reject,Abort or
Acknowledge.java.io.IOExceptionIllegalValueExceptionpublic void sendReleaseResponse()
throws java.io.IOException,
IllegalValueException
java.io.IOExceptionIllegalValueExceptionpublic void send(int abstractsyntaxuid,
DicomObject commandset,
DicomObject dataset)
throws java.io.IOException,
IllegalValueException,
DicomException
abstractsyntaxuid - a negotiated abstract syntax.commandset - the commandset to send.dataset - the dataset to send or null if there is no dataset to send.java.io.IOExceptionIllegalValueExceptionDicomExceptionpublic void send(byte pcid,
DicomObject commandset,
DicomObject dataset)
throws java.io.IOException,
IllegalValueException,
DicomException
java.io.IOExceptionIllegalValueExceptionDicomExceptionpublic void sendInPresentationContext(byte pcid,
DicomObject commandset,
DicomObject dataset)
throws java.io.IOException,
IllegalValueException,
DicomException
java.io.IOExceptionIllegalValueExceptionDicomExceptionpublic void sendInPresentationContext(int pcid,
DicomObject commandset,
DicomObject dataset)
throws java.io.IOException,
IllegalValueException,
DicomException
pcid - the presentation context idcommandset - the commandset to send.dataset - the dataset to send or null if there is no dataset to send.java.io.IOExceptionIllegalValueExceptionDicomExceptionpublic int peek()
throws java.io.IOException,
IllegalValueException
java.io.IOExceptionIllegalValueExceptionpublic int getCurrentPresentationContext()
public UIDEntry getCurrentAbstractSyntax() throws IllegalValueException
IllegalValueExceptionpublic Request receiveAssociateRequest() throws java.io.IOException, UnknownUIDException, IllegalValueException
java.io.IOExceptionUnknownUIDExceptionIllegalValueExceptionpublic Response receiveAssociateResponse() throws java.io.IOException, UnknownUIDException, IllegalValueException
java.io.IOExceptionUnknownUIDExceptionIllegalValueExceptionpublic void sendAssociateRequest(Request req) throws java.io.IOException, IllegalValueException
req - contains the association request parameters.java.io.IOExceptionIllegalValueExceptionpublic void sendReleaseRequest()
throws java.io.IOException,
IllegalValueException
java.io.IOExceptionIllegalValueExceptionpublic void receiveReleaseRequest()
throws java.io.IOException,
IllegalValueException
java.io.IOExceptionIllegalValueExceptionpublic void receiveReleaseResponse()
throws java.io.IOException,
IllegalValueException
java.io.IOExceptionIllegalValueExceptionpublic void sendAbort(int source,
int reason)
throws java.io.IOException
source - the source of the abortreason - the reason for the abortjava.io.IOExceptionpublic Abort receiveAbort() throws IllegalValueException, java.io.IOException
IllegalValueExceptionjava.io.IOException