private void activate() { device.execute(new Runnable() { @Override public void run() { decoder = new PDUDecoder(Association.this, in); device.addAssociation(Association.this); try { while (!(state == State.Sta1 || state == State.Sta13)) decoder.nextPDU(); } catch (AAbort aa) { abort(aa); } catch (IOException e) { onIOException(e); } finally { device.removeAssociation(Association.this); onClose(); } } }); }
private void activate() { device.execute(new Runnable() { @Override public void run() { decoder = new PDUDecoder(Association.this, in); device.addAssociation(Association.this); try { while (!(state == State.Sta1 || state == State.Sta13)) decoder.nextPDU(); } catch (AAbort aa) { abort(aa); } catch (IOException e) { onIOException(e); } finally { device.removeAssociation(Association.this); onClose(); } } }); }
@Override public void onAccept(Connection conn, Socket s) throws IOException { conn.getDevice().execute(new SyslogReceiverTLS(conn, s)); }
@Override public void onReceive(Connection conn, DatagramPacket packet) { conn.getDevice().execute(new SyslogReceiverUDP(conn, packet)); }
@Override public void onReceive(Connection conn, DatagramPacket packet) { conn.getDevice().execute(new SyslogReceiverUDP(conn, packet)); }
@Override public void onAccept(Connection conn, Socket s) throws IOException { conn.getDevice().execute(new HL7Receiver(conn, s)); }
@Override public void onAccept(Connection conn, Socket s) throws IOException { conn.getDevice().execute(new SyslogReceiverTLS(conn, s)); }
public UDPListener(Connection conn, UDPProtocolHandler handler) throws IOException, GeneralSecurityException { this.conn = conn; this.handler = handler; try { ds = new DatagramSocket(conn.getBindPoint()); } catch (BindException e) { throw new IOException("Cannot start UDP listener on "+conn.getBindPoint().getHostName()+":"+conn.getBindPoint().getPort(),e); } conn.setReceiveBufferSize(ds); conn.getDevice().execute(new Runnable(){ @Override public void run() { listen(); } }); }
public UDPListener(Connection conn, UDPProtocolHandler handler) throws IOException, GeneralSecurityException { this.conn = conn; this.handler = handler; try { ds = new DatagramSocket(conn.getBindPoint()); } catch (BindException e) { throw new IOException("Cannot start UDP listener on "+conn.getBindPoint().getHostName()+":"+conn.getBindPoint().getPort(),e); } conn.setReceiveBufferSize(ds); conn.getDevice().execute(new Runnable(){ @Override public void run() { listen(); } }); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes rq, Attributes keys) throws IOException { if (dimse != Dimse.C_FIND_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); QueryTask queryTask = calculateMatches(as, pc, rq, keys); as.getApplicationEntity().getDevice().execute(queryTask); }
@Override public void onDimseRQ(Association as, PresentationContext pc, Dimse dimse, Attributes rq, Attributes keys) throws IOException { if (dimse != Dimse.C_FIND_RQ) throw new DicomServiceException(Status.UnrecognizedOperation); QueryTask queryTask = calculateMatches(as, pc, rq, keys); as.getApplicationEntity().getDevice().execute(queryTask); }
public TCPListener(Connection conn, TCPProtocolHandler handler) throws IOException, GeneralSecurityException { try { this.conn = conn; this.handler = handler; ss = conn.isTls() ? createTLSServerSocket(conn) : new ServerSocket(); conn.setReceiveBufferSize(ss); ss.bind(conn.getBindPoint(), conn.getBacklog()); conn.getDevice().execute(new Runnable(){ @Override public void run() { listen(); } }); } catch (IOException e) { throw new IOException("Unable to start TCPListener on "+conn.getHostname()+":"+conn.getPort(), e); } }
public TCPListener(Connection conn, TCPProtocolHandler handler) throws IOException, GeneralSecurityException { try { this.conn = conn; this.handler = handler; ss = conn.isTls() ? createTLSServerSocket(conn) : new ServerSocket(); conn.setReceiveBufferSize(ss); ss.bind(conn.getBindPoint(), conn.getBacklog()); conn.getDevice().execute(new Runnable(){ @Override public void run() { listen(); } }); } catch (IOException e) { throw new IOException("Unable to start TCPListener on "+conn.getHostname()+":"+conn.getPort(), e); } }
@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 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()); } }