public String getRemoteAET() { return requestor ? getCalledAET() : getCallingAET(); }
public String getRemoteAET() { return requestor ? getCalledAET() : getCallingAET(); }
public String getLocalAET() { return requestor ? getCallingAET() : getCalledAET(); }
public String getLocalAET() { return requestor ? getCallingAET() : getCalledAET(); }
@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()); } }
@Override protected Attributes adjust(Attributes match) { Attributes adjust = super.adjust(match); adjust.remove(Tag.DirectoryRecordType); if (keys.contains(Tag.SOPClassUID)) adjust.setString(Tag.SOPClassUID, VR.UI, match.getString(Tag.ReferencedSOPClassUIDInFile)); if (keys.contains(Tag.SOPInstanceUID)) adjust.setString(Tag.SOPInstanceUID, VR.UI, match.getString(Tag.ReferencedSOPInstanceUIDInFile)); adjust.setString(Tag.QueryRetrieveLevel, VR.CS, keys.getString(Tag.QueryRetrieveLevel)); adjust.setString(Tag.RetrieveAETitle, VR.AE, as.getCalledAET()); if (availability != null) adjust.setString(Tag.InstanceAvailability, VR.CS, availability); adjust.setString(Tag.StorageMediaFileSetID, VR.SH, ddr.getFileSetID()); adjust.setString(Tag.StorageMediaFileSetUID, VR.UI, ddr.getFileSetUID()); match.setString(Tag.SOPClassUID, VR.UI, match.getString(Tag.ReferencedSOPClassUIDInFile)); match.setString(Tag.SOPInstanceUID, VR.UI, match.getString(Tag.ReferencedSOPInstanceUIDInFile)); if (delayCFind > 0) try { Thread.sleep(delayCFind); } catch (InterruptedException ignore) {} return adjust; }
@Override protected Attributes adjust(Attributes match) { Attributes adjust = super.adjust(match); adjust.remove(Tag.DirectoryRecordType); if (keys.contains(Tag.SOPClassUID)) adjust.setString(Tag.SOPClassUID, VR.UI, match.getString(Tag.ReferencedSOPClassUIDInFile)); if (keys.contains(Tag.SOPInstanceUID)) adjust.setString(Tag.SOPInstanceUID, VR.UI, match.getString(Tag.ReferencedSOPInstanceUIDInFile)); adjust.setString(Tag.QueryRetrieveLevel, VR.CS, keys.getString(Tag.QueryRetrieveLevel)); adjust.setString(Tag.RetrieveAETitle, VR.AE, as.getCalledAET()); if (availability != null) adjust.setString(Tag.InstanceAvailability, VR.CS, availability); adjust.setString(Tag.StorageMediaFileSetID, VR.SH, ddr.getFileSetID()); adjust.setString(Tag.StorageMediaFileSetUID, VR.UI, ddr.getFileSetUID()); match.setString(Tag.SOPClassUID, VR.UI, match.getString(Tag.ReferencedSOPClassUIDInFile)); match.setString(Tag.SOPInstanceUID, VR.UI, match.getString(Tag.ReferencedSOPInstanceUIDInFile)); if (delayCFind > 0) try { Thread.sleep(delayCFind); } catch (InterruptedException ignore) {} return adjust; }