public class MCreadStatus
extends java.lang.Object
Instances of this class are returned by the MCassociation.readMessage(int)
method
to convey the result of receiving a message.
Instances of this class can be used by multiple threads concurrently.
Modifier and Type | Field and Description |
---|---|
MCassociation |
association
This field specifies the association instance on which the read operation was performed.
|
MCcommand |
command
This field contains the the DICOM command of the received message or
null
if no message was received. |
MCdimseMessage |
message
This field contains the received message or
null if the association was released,
no message was received during the specified timeout period or an error occurred. |
java.lang.String |
serviceName
This field contains the name of the DICOM service of the received message or
null
if no message was received. |
Modifier and Type | Method and Description |
---|---|
boolean |
associationReleased()
Tells whether the association was gracefully released by the requester during the read call.
|
java.lang.String |
getErrorMessage()
Gets a textual description of the failure when the read operation failed.
|
int |
getStatusCode()
Gets the exception code for a failed read operation.
|
boolean |
succeeded()
Tells whether the read operation succeeded and a message was received.
|
boolean |
timedOut()
Returns
true if no message was received for the timeout duration specified in the
MCassociation.readMessage(int) call and the association is still active. |
public final MCdimseMessage message
null
if the association was released,
no message was received during the specified timeout period or an error occurred.public final java.lang.String serviceName
null
if no message was received.public final MCcommand command
null
if no message was received.public final MCassociation association
public boolean succeeded()
If this method returns true
the message
field contains the received message.
In all other cases (association released, association aborted, network error, timeout) this
method returns false
.
true
if a message was successfully received.public boolean associationReleased()
true
if the association was released.public boolean timedOut()
true
if no message was received for the timeout duration specified in the
MCassociation.readMessage(int)
call and the association is still active.true
if no message was received.public int getStatusCode()
This method returns a code number specific to the condition that caused the read operation to fail.
Values for the exception code are defined by the static fields of the MCexception
class.
This method can be used to discern between various failure conditions when the succeeded()
method returns false
.
public java.lang.String getErrorMessage()