@Override public void run() { try { int msgId = rq.getInt(Tag.MessageID, -1); as.addCancelRQHandler(msgId, this); try { while (!canceled && hasMoreMatches()) { Attributes match = adjust(nextMatch()); if (match != null) { int status = optionalKeysNotSupported ? Status.PendingWarning : Status.Pending; as.writeDimseRSP(pc, Commands.mkCFindRSP(rq, status), match); } } int status = canceled ? Status.Cancel : Status.Success; as.writeDimseRSP(pc, Commands.mkCFindRSP(rq, status)); } catch (DicomServiceException e) { Attributes rsp = e.mkRSP(0x8020, msgId); as.writeDimseRSP(pc, rsp, e.getDataset()); } finally { as.removeCancelRQHandler(msgId); close(); } } catch (IOException e) { // handled by Association } }
@Override public void run() { try { int msgId = rq.getInt(Tag.MessageID, -1); as.addCancelRQHandler(msgId, this); try { while (!canceled && hasMoreMatches()) { Attributes match = adjust(nextMatch()); if (match != null) { int status = optionalKeysNotSupported ? Status.PendingWarning : Status.Pending; as.writeDimseRSP(pc, Commands.mkCFindRSP(rq, status), match); } } int status = canceled ? Status.Cancel : Status.Success; as.writeDimseRSP(pc, Commands.mkCFindRSP(rq, status)); } catch (DicomServiceException e) { Attributes rsp = e.mkRSP(0x8020, msgId); as.writeDimseRSP(pc, rsp, e.getDataset()); } finally { as.removeCancelRQHandler(msgId); close(); } } catch (IOException e) { // handled by Association } }