Package org.dcm4che3.net

Examples of org.dcm4che3.net.Connection


                file.exists());

        Device device = new Device("storescu");
        Connection conn = new Connection();
        device.addConnection(conn);
        ApplicationEntity ae = new ApplicationEntity("STORESCU");
        device.addApplicationEntity(ae);
        ae.addConnection(conn);

        StoreSCU main = new StoreSCU(ae);

        main.setRspHandlerFactory(new StoreSCU.RSPHandlerFactory() {
View Full Code Here


                 }
             }
    };

    public StgCmtSCU(ApplicationEntity ae) throws IOException {
        this.remote = new Connection();
        this.ae = ae;
        DicomServiceRegistry serviceRegistry = new DicomServiceRegistry();
        serviceRegistry.addDicomService(new BasicCEchoSCP());
        serviceRegistry.addDicomService(stgcmtResultHandler);
        ae.setDimseRQHandler(serviceRegistry);
View Full Code Here

    @SuppressWarnings("unchecked")
    public static void main(String[] args) {
        try {
            CommandLine cl = parseComandLine(args);
            Device device = new Device("stgcmtscu");
            Connection conn = new Connection();
            device.addConnection(conn);
            ApplicationEntity ae = new ApplicationEntity("STGCMTSCU");
            device.addApplicationEntity(ae);
            ae.addConnection(conn);
            final StgCmtSCU stgcmtscu = new StgCmtSCU(ae);
            CLIUtils.configureConnect(stgcmtscu.remote, stgcmtscu.rq, cl);
            CLIUtils.configureBind(conn, stgcmtscu.ae, cl);
            CLIUtils.configure(conn, cl);
            stgcmtscu.remote.setTlsProtocols(conn.getTlsProtocols());
            stgcmtscu.remote.setTlsCipherSuites(conn.getTlsCipherSuites());
            stgcmtscu.setTransferSyntaxes(CLIUtils.transferSyntaxesOf(cl));
            stgcmtscu.setStatus(CLIUtils.getIntOption(cl, "status", 0));
            stgcmtscu.setSplitTag(getSplitTag(cl));
            stgcmtscu.setKeepAlive(cl.hasOption("keep-alive"));
            stgcmtscu.setStorageDirectory(getStorageDirectory(cl));
            stgcmtscu.setAttributes(new Attributes());
            CLIUtils.addAttributes(stgcmtscu.attrs, cl.getOptionValues("s"));
            stgcmtscu.setUIDSuffix(cl.getOptionValue("uid-suffix"));
            List<String> argList = cl.getArgList();
            boolean echo = argList.isEmpty();
            if (!echo) {
                LOG.info(rb.getString("scanning"));
                DicomFiles.scan(argList, new DicomFiles.Callback() {
                   
                    @Override
                    public boolean dicomFile(File f, Attributes fmi, long dsPos,
                            Attributes ds) {
                        return stgcmtscu.addInstance(ds);
                    }
                });
            }
            ExecutorService executorService =
                    Executors.newCachedThreadPool();
            ScheduledExecutorService scheduledExecutorService =
                    Executors.newSingleThreadScheduledExecutor();
            device.setExecutor(executorService);
            device.setScheduledExecutor(scheduledExecutorService);
            device.bindConnections();
            try {
                stgcmtscu.open();
                if (echo)
                    stgcmtscu.echo();
                else
                    stgcmtscu.sendRequests();
             } finally {
                stgcmtscu.close();
                if (conn.isListening()) {
                    device.waitForNoOpenConnections();
                    device.unbindConnections();
                }
                executorService.shutdown();
                scheduledExecutorService.shutdown();
View Full Code Here

        assertTrue(
                "file or directory does not exists: " + file.getAbsolutePath(),
                file.exists());

        Device device = new Device("mppsscu");
        Connection conn = new Connection();
        device.addConnection(conn);
        ApplicationEntity ae = new ApplicationEntity("MPPSSCU");
        device.addApplicationEntity(ae);
        ae.addConnection(conn);
View Full Code Here

        assertTrue(
                "file or directory does not exists: " + file.getAbsolutePath(),
                file.exists());

        Device device = new Device("storescu");
        Connection conn = new Connection();
        device.addConnection(conn);
        ApplicationEntity ae = new ApplicationEntity("STORESCU");
        device.addApplicationEntity(ae);
        ae.addConnection(conn);
View Full Code Here

    private static Device createDevice(String name, String appName) throws Exception {
        Device device = new Device(name);
        HL7DeviceExtension hl7Ext = new HL7DeviceExtension();
        device.addDeviceExtension(hl7Ext);
        Connection conn = createConn("host.dcm4che.org", 2575);
        device.addConnection(conn);
        HL7Application app = createHL7App(appName, conn);
        hl7Ext.addHL7Application(app);
        return device ;
    }
View Full Code Here

        hl7Ext.addHL7Application(app);
        return device ;
    }

    private static Connection createConn(String hostname, int port) {
        Connection conn = new Connection();
        conn.setHostname(hostname);
        conn.setPort(port);
        conn.setProtocol(Protocol.HL7);
        return conn;
    }
View Full Code Here

        assertEquals(1, conns.size());
    }

    private Device createDevice(String name, String aet) {
        Device dev = new Device(name);
        Connection conn = new Connection("dicom", "localhost", 11112);
        dev.addConnection(conn);
        ApplicationEntity ae = new ApplicationEntity(aet);
        dev.addApplicationEntity(ae);
        ae.addConnection(conn);
        return dev;
View Full Code Here

            String value = (String) entry.getValue();
            try {
                String[] hostPortCiphers = StringUtils.split(value, ':');
                String[] ciphers = new String[hostPortCiphers.length-2];
                System.arraycopy(hostPortCiphers, 2, ciphers, 0, ciphers.length);
                Connection remote = new Connection();
                remote.setHostname(hostPortCiphers[0]);
                remote.setPort(Integer.parseInt(hostPortCiphers[1]));
                remote.setTlsCipherSuites(ciphers);
                main.addRemoteConnection(aet, remote);
            } catch (Exception e) {
                throw new IllegalArgumentException(
                        "Invalid entry in " + file + ": " + aet + "=" + value);
            }
View Full Code Here

                            .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);
View Full Code Here

TOP

Related Classes of org.dcm4che3.net.Connection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.