public boolean tryWriteDimseRSP(PresentationContext pc, Attributes cmd) { return tryWriteDimseRSP(pc, cmd, null); }
public boolean tryWriteDimseRSP(PresentationContext pc, Attributes cmd) { return tryWriteDimseRSP(pc, cmd, null); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes data) throws IOException { if (dimse != Dimse.C_ECHO_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); as.tryWriteDimseRSP(pc, Commands.mkEchoRSP(cmd, Status.Success)); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes data) throws IOException { if (dimse != Dimse.N_CREATE_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); Attributes rsp = Commands.mkNCreateRSP(cmd, status); Attributes rspAttrs = IanSCP.this.create(as, cmd, data); as.tryWriteDimseRSP(pc, rsp, rspAttrs); } };
protected void onNSetRQ(Association as, PresentationContext pc, Attributes rq, Attributes rqAttrs) throws IOException { Attributes rsp = Commands.mkNSetRSP(rq, Status.Success); Attributes rspAttrs = set(as, rq, rqAttrs, rsp); as.tryWriteDimseRSP(pc, rsp, rspAttrs); }
protected void onNCreateRQ(Association as, PresentationContext pc, Attributes rq, Attributes rqAttrs) throws IOException { Attributes rsp = Commands.mkNCreateRSP(rq, Status.Success); Attributes rspAttrs = create(as, rq, rqAttrs, rsp); as.tryWriteDimseRSP(pc, rsp, rspAttrs); }
protected void onNCreateRQ(Association as, PresentationContext pc, Attributes rq, Attributes rqAttrs) throws IOException { Attributes rsp = Commands.mkNCreateRSP(rq, Status.Success); Attributes rspAttrs = create(as, rq, rqAttrs, rsp); as.tryWriteDimseRSP(pc, rsp, rspAttrs); }
protected void onNSetRQ(Association as, PresentationContext pc, Attributes rq, Attributes rqAttrs) throws IOException { Attributes rsp = Commands.mkNSetRSP(rq, Status.Success); Attributes rspAttrs = set(as, rq, rqAttrs, rsp); as.tryWriteDimseRSP(pc, rsp, rspAttrs); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes data) throws IOException { if (dimse != Dimse.C_ECHO_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); as.tryWriteDimseRSP(pc, Commands.mkEchoRSP(cmd, Status.Success)); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes data) throws IOException { if (dimse != Dimse.N_CREATE_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); Attributes rsp = Commands.mkNCreateRSP(cmd, status); Attributes rspAttrs = IanSCP.this.create(as, cmd, data); as.tryWriteDimseRSP(pc, rsp, rspAttrs); } };
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes rq, PDVInputStream data) throws IOException { if (dimse != Dimse.C_STORE_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); Attributes rsp = Commands.mkCStoreRSP(rq, Status.Success); store(as, pc, rq, data, rsp); as.tryWriteDimseRSP(pc, rsp); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes rq, PDVInputStream data) throws IOException { if (dimse != Dimse.C_STORE_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); Attributes rsp = Commands.mkCStoreRSP(rq, Status.Success); store(as, pc, rq, data, rsp); as.tryWriteDimseRSP(pc, rsp); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes keys) throws IOException { if (dimse != Dimse.C_MOVE_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); RetrieveTask retrieveTask = calculateMatches(as, pc, cmd, keys); if (retrieveTask != null) as.getApplicationEntity().getDevice().execute(retrieveTask); else as.tryWriteDimseRSP(pc, Commands.mkCMoveRSP(cmd, Status.Success)); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes keys) throws IOException { if (dimse != Dimse.C_GET_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); RetrieveTask retrieveTask = calculateMatches(as, pc, cmd, keys); if (retrieveTask != null) as.getApplicationEntity().getDevice().execute(retrieveTask); else as.tryWriteDimseRSP(pc, Commands.mkCGetRSP(cmd, Status.Success)); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes keys) throws IOException { if (dimse != Dimse.C_GET_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); RetrieveTask retrieveTask = calculateMatches(as, pc, cmd, keys); if (retrieveTask != null) as.getApplicationEntity().getDevice().execute(retrieveTask); else as.tryWriteDimseRSP(pc, Commands.mkCGetRSP(cmd, Status.Success)); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, Attributes keys) throws IOException { if (dimse != Dimse.C_MOVE_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); RetrieveTask retrieveTask = calculateMatches(as, pc, cmd, keys); if (retrieveTask != null) as.getApplicationEntity().getDevice().execute(retrieveTask); else as.tryWriteDimseRSP(pc, Commands.mkCMoveRSP(cmd, Status.Success)); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, PDVInputStream data) throws IOException { try { lookupService(as, dimse, cmd).onDimseRQ(as, pc, dimse, cmd, data); } catch (DicomServiceException e) { Association.LOG.info("{}: processing {} failed. Caused by:\t", as, dimse.toString(cmd, pc.getPCID(), pc.getTransferSyntax()), e); Attributes rsp = e.mkRSP(dimse.commandFieldOfRSP(), cmd.getInt(Tag.MessageID, 0)); as.tryWriteDimseRSP(pc, rsp, e.getDataset()); } }
@Override public void done(boolean doneSync) { Attributes cmd; Attributes data; if (exchange.getException() != null) { DicomServiceException dse; Exception ex = exchange.getException(); if (ex instanceof DicomServiceException) { dse = (DicomServiceException) ex; } else { dse = new DicomServiceException(Status.ProcessingFailure, ex); } cmd = dse.mkRSP(dimse.commandFieldOfRSP(), msgId); data = dse.getDataset(); } else { DicomMessage out = exchange.getOut(DicomMessage.class); cmd = out.getCommand(); data = out.getBody(Attributes.class); } as.tryWriteDimseRSP(pc, cmd, data); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes cmd, PDVInputStream data) throws IOException { try { lookupService(as, dimse, cmd).onDimseRQ(as, pc, dimse, cmd, data); } catch (DicomServiceException e) { Association.LOG.info("{}: processing {} failed. Caused by:\t", as, dimse.toString(cmd, pc.getPCID(), pc.getTransferSyntax()), e); Attributes rsp = e.mkRSP(dimse.commandFieldOfRSP(), cmd.getInt(Tag.MessageID, 0)); as.tryWriteDimseRSP(pc, rsp, e.getDataset()); } }