Package com.pixelmed.network
Class CompositeResponseHandler
java.lang.Object
com.pixelmed.network.ReceivedDataHandler
com.pixelmed.network.CompositeResponseHandler
- Direct Known Subclasses:
MoveSOPClassSCU.CMoveResponseHandler,StorageSOPClassSCU.CStoreResponseHandler,VerificationSOPClassSCU.CEchoResponseHandler
This abstract class provides a mechanism to process each PDU of a composite response as it is received, such as for evaluating the status of the response for success.
Typically a private sub-class would be declared and instantiated with overriding methods to evaluate the success or failure of a storage or query or retrieve response.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected byte[]protected byte[]protected intprotected booleanFields inherited from class com.pixelmed.network.ReceivedDataHandler
done, release -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a handler to process each PDU of a composite response as it is received, evaluating the status of the response for success.CompositeResponseHandler(int debugLevel) Construct a handler to process each PDU of a composite response as it is received, evaluating the status of the response for success. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdumpAttributeListFromCommandOrData(byte[] bytes, String transferSyntaxUID) Extract anAttributeListfrom the concatenated bytes that have been assembled from one or more PDUs and which make up an entire Command or Dataset.protected abstract voidExtract the status information from a composite response and set the status flag accordingly.static AttributeListgetAttributeListFromCommandOrData(byte[] bytes, String transferSyntaxUID) Extract anAttributeListfrom the concatenated bytes that have been assembled from one or more PDUs and which make up an entire Command or Dataset.static AttributeListgetAttributeListFromCommandOrData(byte[] bytes, String transferSyntaxUID, int debugLevel) Extract anAttributeListfrom the concatenated bytes that have been assembled from one or more PDUs and which make up an entire Command or Dataset.intGet the response status Valid only after first callingevaluateStatusAndSetSuccess()protected voidIgnore any data set in the composite response (unless this method is overridden).voidsendPDataIndication(PDataPDU pdata, Association association) The code handling the reception of data on anAssociationcalls this method to indicate that a PDU has been received (a P-DATA-INDICATION).booleanDoes the response include an indication of success ?Methods inherited from class com.pixelmed.network.ReceivedDataHandler
dumpPDVList, dumpPDVListToString, isDone, isToBeReleased, setDone, setRelease
-
Field Details
-
commandReceived
protected byte[] commandReceived -
dataReceived
protected byte[] dataReceived -
success
protected boolean success -
allowData
protected boolean allowData -
status
protected int status
-
-
Constructor Details
-
CompositeResponseHandler
public CompositeResponseHandler(int debugLevel) Construct a handler to process each PDU of a composite response as it is received, evaluating the status of the response for success.- Parameters:
debugLevel- ignored
-
CompositeResponseHandler
public CompositeResponseHandler()Construct a handler to process each PDU of a composite response as it is received, evaluating the status of the response for success.
-
-
Method Details
-
getAttributeListFromCommandOrData
public static AttributeList getAttributeListFromCommandOrData(byte[] bytes, String transferSyntaxUID, int debugLevel) throws DicomNetworkException, DicomException, IOException Extract anAttributeListfrom the concatenated bytes that have been assembled from one or more PDUs and which make up an entire Command or Dataset.- Parameters:
bytes- the concatenated PDU bytes up to and including the last fragmenttransferSyntaxUID- the Transfer Syntax to use to interpret the bytesdebugLevel- ignored- Throws:
IOExceptionDicomExceptionDicomNetworkException
-
getAttributeListFromCommandOrData
public static AttributeList getAttributeListFromCommandOrData(byte[] bytes, String transferSyntaxUID) throws DicomNetworkException, DicomException, IOException Extract anAttributeListfrom the concatenated bytes that have been assembled from one or more PDUs and which make up an entire Command or Dataset.- Parameters:
bytes- the concatenated PDU bytes up to and including the last fragmenttransferSyntaxUID- the Transfer Syntax to use to interpret the bytes- Throws:
IOExceptionDicomExceptionDicomNetworkException
-
dumpAttributeListFromCommandOrData
public static String dumpAttributeListFromCommandOrData(byte[] bytes, String transferSyntaxUID) throws DicomNetworkException, DicomException, IOException Extract anAttributeListfrom the concatenated bytes that have been assembled from one or more PDUs and which make up an entire Command or Dataset.- Parameters:
bytes- the concatenated PDU bytes up to and including the last fragmenttransferSyntaxUID- the Transfer Syntax to use to interpret the bytes- Throws:
IOExceptionDicomExceptionDicomNetworkException
-
sendPDataIndication
public void sendPDataIndication(PDataPDU pdata, Association association) throws DicomNetworkException, DicomException, IOException The code handling the reception of data on anAssociationcalls this method to indicate that a PDU has been received (a P-DATA-INDICATION).- Specified by:
sendPDataIndicationin classReceivedDataHandler- Parameters:
pdata- the PDU that was receivedassociation- the association on which the PDU was received- Throws:
IOExceptionDicomExceptionDicomNetworkException
-
evaluateStatusAndSetSuccess
Extract the status information from a composite response and set the status flag accordingly.- Parameters:
list- the list of Attributes extracted from the bytes of the PDU(s)
-
makeUseOfDataSet
Ignore any data set in the composite response (unless this method is overridden).- Parameters:
list- the list of Attributes extracted from the bytes of the PDU(s)
-
wasSuccessful
public boolean wasSuccessful()Does the response include an indication of success ? -
getStatus
public int getStatus()Get the response status Valid only after first callingevaluateStatusAndSetSuccess()
-