@Override public void onDimseRSP(Association as, Attributes cmd, Attributes data) { super.onDimseRSP(as, cmd, data); } };
@Override public DimseRSPHandler createDimseRSPHandlerForNSet() { return new DimseRSPHandler(as.nextMessageID()); } };
@Override public void cancel(Association a) throws IOException { if (ex != null) throw ex; if (!finished) super.cancel(a); }
void onDimseRSP(Dimse dimse, Attributes cmd, Attributes data) throws AAbort { int msgId = cmd.getInt(Tag.MessageIDBeingRespondedTo, -1); int status = cmd.getInt(Tag.Status, 0); boolean pending = Status.isPending(status); DimseRSPHandler rspHandler = getDimseRSPHandler(msgId); if (rspHandler == null) { Dimse.LOG.info("{}: unexpected message ID in DIMSE RSP:", name); Dimse.LOG.info("\n{}", cmd); throw new AAbort(); } rspHandler.onDimseRSP(this, cmd, data); if (pending) { if (rspHandler.isStopOnPending()) startTimeout(msgId, conn.getRetrieveTimeout(),true); } else { incReceivedCount(dimse); removeDimseRSPHandler(msgId); if (rspHandlerForMsgId.isEmpty() && performing == 0) startIdleOrReleaseTimeout(); } }
@Override public synchronized void onDimseRSP(Association as, Attributes cmd, Attributes data) { super.onDimseRSP(as, cmd, data); Entry last = entry; while (last.next != null) if (autoCancel > 0 && --autoCancel == 0) try { super.cancel(as); } catch (IOException e) { ex = e;
private void addDimseRSPHandler(DimseRSPHandler rspHandler) throws InterruptedException { synchronized (rspHandlerForMsgId) { while (maxOpsInvoked > 0 && rspHandlerForMsgId.size() >= maxOpsInvoked) rspHandlerForMsgId.wait(); rspHandlerForMsgId.put(rspHandler.getMessageID(), rspHandler); } }
public void invoke(PresentationContext pc, Attributes cmd, DataWriter data, DimseRSPHandler rspHandler, int rspTimeout, boolean stopOnPending) throws IOException, InterruptedException { stopTimeout(); checkException(); rspHandler.setPC(pc); addDimseRSPHandler(rspHandler); encoder.writeDIMSE(pc, cmd, data); startTimeout(rspHandler.getMessageID(), rspTimeout, stopOnPending); }
@Override public synchronized void onClose(Association as) { super.onClose(as); if (!finished) { ex = as.getException(); if (ex == null) ex = new IOException("Association to " + as.getRemoteAET() + " released before receive of outstanding DIMSE RSP"); notifyAll(); } }
void onDimseRSP(Dimse dimse, Attributes cmd, Attributes data) throws AAbort { int msgId = cmd.getInt(Tag.MessageIDBeingRespondedTo, -1); int status = cmd.getInt(Tag.Status, 0); boolean pending = Status.isPending(status); DimseRSPHandler rspHandler = getDimseRSPHandler(msgId); if (rspHandler == null) { Dimse.LOG.info("{}: unexpected message ID in DIMSE RSP:", name); Dimse.LOG.info("\n{}", cmd); throw new AAbort(); } rspHandler.onDimseRSP(this, cmd, data); if (pending) { if (rspHandler.isStopOnPending()) startTimeout(msgId, conn.getRetrieveTimeout(),true); } else { incReceivedCount(dimse); removeDimseRSPHandler(msgId); if (rspHandlerForMsgId.isEmpty() && performing == 0) startIdleOrReleaseTimeout(); } }
@Override public synchronized void onDimseRSP(Association as, Attributes cmd, Attributes data) { super.onDimseRSP(as, cmd, data); Entry last = entry; while (last.next != null) if (autoCancel > 0 && --autoCancel == 0) try { super.cancel(as); } catch (IOException e) { ex = e;
private void addDimseRSPHandler(DimseRSPHandler rspHandler) throws InterruptedException { synchronized (rspHandlerForMsgId) { while (maxOpsInvoked > 0 && rspHandlerForMsgId.size() >= maxOpsInvoked) rspHandlerForMsgId.wait(); rspHandlerForMsgId.put(rspHandler.getMessageID(), rspHandler); } }
public void invoke(PresentationContext pc, Attributes cmd, DataWriter data, DimseRSPHandler rspHandler, int rspTimeout, boolean stopOnPending) throws IOException, InterruptedException { stopTimeout(); checkException(); rspHandler.setPC(pc); addDimseRSPHandler(rspHandler); encoder.writeDIMSE(pc, cmd, data); startTimeout(rspHandler.getMessageID(), rspTimeout, stopOnPending); }
@Override public synchronized void onClose(Association as) { super.onClose(as); if (!finished) { ex = as.getException(); if (ex == null) ex = new IOException("Association to " + as.getRemoteAET() + " released before receive of outstanding DIMSE RSP"); notifyAll(); } }
@Override public void onDimseRSP(Association as, Attributes cmd, Attributes data) { super.onDimseRSP(as, cmd, data); } };
@Override public DimseRSPHandler createDimseRSPHandlerForNSet() { return new DimseRSPHandler(as.nextMessageID()); } };
public void cstore(String cuid, String iuid, int priority, String moveOriginatorAET, int moveOriginatorMsgId, DataWriter data, String tsuid, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(cuid, tsuid); Attributes cstorerq = Commands.mkCStoreRQ(rspHandler.getMessageID(), cuid, iuid, priority, moveOriginatorAET, moveOriginatorMsgId); invoke(pc, cstorerq, data, rspHandler, conn.getResponseTimeout()); }
@Override public void cancel(Association a) throws IOException { if (ex != null) throw ex; if (!finished) super.cancel(a); }
@Override public void onDimseRSP(Association as, Attributes cmd, Attributes data) { super.onDimseRSP(as, cmd, data); } };
@Override public DimseRSPHandler createDimseRSPHandlerForNCreate(final MppsWithIUID mppsWithUID) { return new DimseRSPHandler(as.nextMessageID()) { @Override public void onDimseRSP(Association as, Attributes cmd, Attributes data) { switch(cmd.getInt(Tag.Status, -1)) { case Status.Success: case Status.AttributeListError: case Status.AttributeValueOutOfRange: mppsWithUID.iuid = cmd.getString( Tag.AffectedSOPInstanceUID, mppsWithUID.iuid); addCreatedMpps(mppsWithUID); } super.onDimseRSP(as, cmd, data); } }; }
public void cstore(String cuid, String iuid, int priority, String moveOriginatorAET, int moveOriginatorMsgId, DataWriter data, String tsuid, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(cuid, tsuid); Attributes cstorerq = Commands.mkCStoreRQ(rspHandler.getMessageID(), cuid, iuid, priority, moveOriginatorAET, moveOriginatorMsgId); invoke(pc, cstorerq, data, rspHandler, conn.getResponseTimeout()); }