public void writeDimseRSP(PresentationContext pc, Attributes cmd) throws IOException { writeDimseRSP(pc, cmd, null); }
public void writeDimseRSP(PresentationContext pc, Attributes cmd) throws IOException { writeDimseRSP(pc, cmd, null); }
private void writeRSP(Attributes cmd, Attributes data) { try { rqas.writeDimseRSP(pc, cmd, data); } catch (IOException e) { pendingRSP = false; stopWritePendingRSP(); LOG.warn("{}: Unable to send C-GET or C-MOVE RSP on association to {}", rqas, rqas.getRemoteAET(), e); } }
public boolean tryWriteDimseRSP(PresentationContext pc, Attributes cmd, Attributes data) { try { writeDimseRSP(pc, cmd, data); return true; } catch (IOException e) { LOG.warn("{} << {} failed: {}", new Object[] { this, Dimse.valueOf(cmd.getInt(Tag.CommandField, 0)), e.getMessage() }); return false; } }
private void writeRSP(Attributes cmd, Attributes data) { try { rqas.writeDimseRSP(pc, cmd, data); } catch (IOException e) { pendingRSP = false; stopWritePendingRSP(); LOG.warn("{}: Unable to send C-GET or C-MOVE RSP on association to {}", rqas, rqas.getRemoteAET(), e); } }
public boolean tryWriteDimseRSP(PresentationContext pc, Attributes cmd, Attributes data) { try { writeDimseRSP(pc, cmd, data); return true; } catch (IOException e) { LOG.warn("{} << {} failed: {}", new Object[] { this, Dimse.valueOf(cmd.getInt(Tag.CommandField, 0)), e.getMessage() }); return false; } }
@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 } }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes data) throws IOException { if (dimse != Dimse.N_EVENT_REPORT_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); int eventTypeID = cmd.getInt(Tag.EventTypeID, 0); if (eventTypeID != 1 && eventTypeID != 2) throw new DicomServiceException(Status.NoSuchEventType) .setEventTypeID(eventTypeID); String tuid = data.getString(Tag.TransactionUID); try { Attributes rsp = Commands.mkNEventReportRSP(cmd, status); Attributes rspAttrs = StgCmtSCU.this.eventRecord(as, cmd, data); as.writeDimseRSP(pc, rsp, rspAttrs); } catch (AssociationStateException e) { LOG.warn("{} << N-EVENT-RECORD-RSP failed: {}", as, e.getMessage()); } finally { removeOutstandingResult(tuid); } } };
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes data) throws IOException { if (dimse != Dimse.N_EVENT_REPORT_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); int eventTypeID = cmd.getInt(Tag.EventTypeID, 0); if (eventTypeID != 1 && eventTypeID != 2) throw new DicomServiceException(Status.NoSuchEventType) .setEventTypeID(eventTypeID); String tuid = data.getString(Tag.TransactionUID); try { Attributes rsp = Commands.mkNEventReportRSP(cmd, status); Attributes rspAttrs = StgCmtSCU.this.eventRecord(as, cmd, data); as.writeDimseRSP(pc, rsp, rspAttrs); } catch (AssociationStateException e) { LOG.warn("{} << N-EVENT-RECORD-RSP failed: {}", as, e.getMessage()); } finally { removeOutstandingResult(tuid); } } };
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes rq, Attributes actionInfo) throws IOException { if (dimse != Dimse.N_ACTION_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); int actionTypeID = rq.getInt(Tag.ActionTypeID, 0); if (actionTypeID != 1) throw new DicomServiceException(Status.NoSuchActionType) .setActionTypeID(actionTypeID); Attributes rsp = Commands.mkNActionRSP(rq, Status.Success); String callingAET = as.getCallingAET(); String calledAET = as.getCalledAET(); Connection remoteConnection = getRemoteConnection(callingAET); if (remoteConnection == null) throw new DicomServiceException(Status.ProcessingFailure, "Unknown Calling AET: " + callingAET); Attributes eventInfo = calculateStorageCommitmentResult(calledAET, actionInfo); try { as.writeDimseRSP(pc, rsp, null); device.execute(new SendStgCmtResult(as, eventInfo, stgCmtOnSameAssoc, remoteConnection)); } catch (AssociationStateException e) { LOG.warn("{} << N-ACTION-RSP failed: {}", as, e.getMessage()); } }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes rq, Attributes actionInfo) throws IOException { if (dimse != Dimse.N_ACTION_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); int actionTypeID = rq.getInt(Tag.ActionTypeID, 0); if (actionTypeID != 1) throw new DicomServiceException(Status.NoSuchActionType) .setActionTypeID(actionTypeID); Attributes rsp = Commands.mkNActionRSP(rq, Status.Success); String callingAET = as.getCallingAET(); String calledAET = as.getCalledAET(); Connection remoteConnection = getRemoteConnection(callingAET); if (remoteConnection == null) throw new DicomServiceException(Status.ProcessingFailure, "Unknown Calling AET: " + callingAET); Attributes eventInfo = calculateStorageCommitmentResult(calledAET, actionInfo); try { as.writeDimseRSP(pc, rsp, null); device.execute(new SendStgCmtResult(as, eventInfo, stgCmtOnSameAssoc, remoteConnection)); } catch (AssociationStateException e) { LOG.warn("{} << N-ACTION-RSP failed: {}", as, e.getMessage()); } }