Package org.dcm4che3.net

Examples of org.dcm4che3.net.Connection


        config.removeDevice("TestAuditLogger");
    }

    private Device createARRDevice(String name) {
        Device device = new Device(name);
        Connection udp = new Connection("audit-udp", "host.dcm4che.org", 514);
        udp.setProtocol(Connection.Protocol.SYSLOG_UDP);
        Connection tls = new Connection("audit-tls", "host.dcm4che.org", 6514);
        tls.setProtocol(Connection.Protocol.SYSLOG_TLS);
        tls.setTlsCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA");
        device.addConnection(udp);
        device.addConnection(tls);
        addAuditRecordRepository(device, udp, tls);
        return device ;
    }
View Full Code Here


        return device ;
    }

    private Device createLoggerDevice(String name, Device arrDevice) {
        Device device = new Device(name);
        Connection udp = new Connection("audit-udp", "host.dcm4che.org");
        udp.setProtocol(Connection.Protocol.SYSLOG_UDP);
        Connection tls = new Connection("audit-tls", "host.dcm4che.org");
        tls.setProtocol(Connection.Protocol.SYSLOG_TLS);
        tls.setTlsCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA");
        device.addConnection(udp);
        device.addConnection(tls);
        if (arrDevice == null) {
            udp.setPort(514);
            tls.setPort(6514);
            addAuditRecordRepository(device, udp, tls);
            arrDevice = device;
        }
        addAuditLogger(device, udp, tls, arrDevice);
        return device ;
View Full Code Here

    private HashMap<String,MppsWithIUID> map = new HashMap<String,MppsWithIUID>();
    private ArrayList<MppsWithIUID> created = new ArrayList<MppsWithIUID>();
    private Association as;

    public MppsSCU( ApplicationEntity ae) throws IOException {
        this.remote = new Connection();
        this.ae = ae;
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public static void main(String[] args) {
        try {
            CommandLine cl = parseComandLine(args);
            Device device = new Device("mppsscu");
            Connection conn = new Connection();
            device.addConnection(conn);
            ApplicationEntity ae = new ApplicationEntity("MPPSSCU");
            device.addApplicationEntity(ae);
            ae.addConnection(conn);
            final MppsSCU main = new MppsSCU(ae);
            configureMPPS(main, cl);
            CLIUtils.configureConnect(main.remote, main.rq, cl);
            CLIUtils.configureBind(conn, main.ae, cl);
            CLIUtils.configure(conn, cl);
            main.remote.setTlsProtocols(conn.getTlsProtocols());
            main.remote.setTlsCipherSuites(conn.getTlsCipherSuites());
            main.setTransferSyntaxes(CLIUtils.transferSyntaxesOf(cl));
            main.setAttributes(new Attributes());
            CLIUtils.addAttributes(main.attrs, cl.getOptionValues("s"));
            main.setUIDSuffix(cl.getOptionValue("uid-suffix"));
            List<String> argList = cl.getArgList();
View Full Code Here

        if (tmpOption.split("@")[1] == null)
            throw new ParseException(rb.getString("invalid-probed-ae"));
        String host = tmpOption.split("@")[1].split(":")[0];
        int port = Integer.parseInt(tmpOption.split("@")[1].split(":")[1]);
        probedAET = aeTitle;
        Connection conn = new Connection();
        conn.setHostname(host);
        conn.setPort(port);
        conn.setInstalled(true);
        setDestination(conn);

        this.setProbedAE(new ApplicationEntity(aeTitle));
        this.getProbedAE().addConnection(conn);
        this.setCallingAET(callingaet);
View Full Code Here

    }

    public void probeAndSet() {
        ProbeTC instance = this;
        Device device = new Device(instance.getCallingAET());
        Connection conn = new Connection();
        device.addConnection(conn);
        ApplicationEntity ae = new ApplicationEntity(instance.getCallingAET());
        device.addApplicationEntity(ae);
        ae.addConnection(conn);

        conn.setReceivePDULength(Connection.DEF_MAX_PDU_LENGTH);
        conn.setSendPDULength(Connection.DEF_MAX_PDU_LENGTH);

        conn.setMaxOpsInvoked(0);
        conn.setMaxOpsPerformed(0);

        conn.setPackPDV(true);
        conn.setConnectTimeout(0);
        conn.setRequestTimeout(0);
        conn.setAcceptTimeout(0);
        conn.setReleaseTimeout(0);
        conn.setResponseTimeout(0);
        conn.setRetrieveTimeout(0);
        conn.setIdleTimeout(0);
        conn.setSocketCloseDelay(Connection.DEF_SOCKETDELAY);
        conn.setSendBufferSize(0);
        conn.setReceiveBufferSize(0);
        conn.setTcpNoDelay(true);

        // no tls in this implementation (for tls use command line tool)
        if (instance.getConfigType().compareToIgnoreCase("ldap") == 0) {
            InputStream is = null;
            try {
View Full Code Here

            device = new Device(cl.getOptionValue("b").toLowerCase());
        } else {
            LOG.error("Missing broadcast AETitle");
            throw new IllegalAccessException("missing broadcast AETitle");
        }
        Connection conn = new Connection();
        device.addConnection(conn);
        ApplicationEntity ae = new ApplicationEntity(cl.getOptionValue("b")
                .toUpperCase());
        if (cl.hasOption("d")) {
            instance.setDestinationAET(cl.getOptionValue("d"));
        }
        if (cl.hasOption("s")) {
            instance.setSourceAET(cl.getOptionValue("s"));
           
        }
        device.addApplicationEntity(ae);
        ae.addConnection(conn);

        instance.destination = new Connection();

        configureConnect(instance.destination, instance.rq, cl, ae);
        CLIUtils.configure(conn, cl);
        // instance.sourceAE = new
        // ApplicationEntity(cl.getOptionValue("s").split(":")[0]);
View Full Code Here

        config.removeDevice("TestAuditLogger");
    }

    private Device createARRDevice(String name) {
        Device device = new Device(name);
        Connection udp = new Connection("audit-udp", "host.dcm4che.org", 514);
        udp.setProtocol(Connection.Protocol.SYSLOG_UDP);
        Connection tls = new Connection("audit-tls", "host.dcm4che.org", 6514);
        tls.setProtocol(Connection.Protocol.SYSLOG_TLS);
        tls.setTlsCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA");
        device.addConnection(udp);
        device.addConnection(tls);
        addAuditRecordRepository(device, udp, tls);
        return device ;
    }
View Full Code Here

        return device ;
    }

    private Device createLoggerDevice(String name, Device arrDevice) {
        Device device = new Device(name);
        Connection udp = new Connection("audit-udp", "host.dcm4che.org");
        udp.setProtocol(Connection.Protocol.SYSLOG_UDP);
        Connection tls = new Connection("audit-tls", "host.dcm4che.org");
        tls.setProtocol(Connection.Protocol.SYSLOG_TLS);
        tls.setTlsCipherSuites("TLS_RSA_WITH_AES_128_CBC_SHA");
        device.addConnection(udp);
        device.addConnection(tls);
        if (arrDevice == null) {
            udp.setPort(514);
            tls.setPort(6514);
            addAuditRecordRepository(device, udp, tls);
            arrDevice = device;
        }
        addAuditLogger(device, udp, tls, arrDevice);
        return device ;
View Full Code Here

            CommandLine cl = parseComandLine(args);
            if(cl.getArgList().isEmpty())
                throw new MissingOptionException(
                        rb.getString("missing-i-file"));
            final Device device = new Device("modality");
            final Connection conn = new Connection();
            final ApplicationEntity ae = new ApplicationEntity("MODALITY");
            checkOptions(cl);
            CLIUtils.configureBind(conn, ae, cl);
            CLIUtils.configure(conn, cl);
            device.addConnection(conn);
            device.addApplicationEntity(ae);
            ae.addConnection(conn);
            final MppsSCU mppsscu = new MppsSCU(ae);
            final StoreSCU storescu = new StoreSCU(ae);
            final StgCmtSCU stgcmtscu = new StgCmtSCU(ae);
            CLIUtils.configureConnect(mppsscu.getRemoteConnection(), mppsscu.getAAssociateRQ(), cl);
            CLIUtils.configureConnect(stgcmtscu.getRemoteConnection(), stgcmtscu.getAAssociateRQ(), cl);
            CLIUtils.configureConnect(storescu.getRemoteConnection(), storescu.getAAssociateRQ(), cl);
            calledAET = storescu.getAAssociateRQ().getCalledAET();
            mppsscu.setTransferSyntaxes(CLIUtils.transferSyntaxesOf(cl));
            mppsscu.setCodes(CLIUtils.loadProperties(
                    cl.getOptionValue("code-config", "resource:code.properties"), null));
            if (cl.hasOption("dc"))
                mppsscu.setFinalStatus("DISCONTINUED");
            if (cl.hasOption("dc-reason"))
                mppsscu.setDiscontinuationReason(cl.getOptionValue("dc-reason"));
            stgcmtscu.setTransferSyntaxes(CLIUtils.transferSyntaxesOf(cl));
            stgcmtscu.setStorageDirectory(StgCmtSCU.getStorageDirectory(cl));
            StoreSCU.configureRelatedSOPClass(storescu, cl);
            storescu.setUIDSuffix(StoreSCU.uidSuffixOf(cl));
            Attributes attrs = new Attributes();
            CLIUtils.addAttributes(attrs, cl.getOptionValues("s"));
            mppsscu.setAttributes(attrs);
            storescu.setAttributes(attrs);
            stgcmtscu.setAttributes(attrs);
            setTlsParams(mppsscu.getRemoteConnection(), conn);
            setTlsParams(storescu.getRemoteConnection(), conn);
            setTlsParams(stgcmtscu.getRemoteConnection(), conn);
            String tmpPrefix = "iocmtest-";
            String tmpSuffix = null;
            File tmpDir = null;
            configureTmpFile(storescu, tmpPrefix, tmpSuffix, tmpDir, cl);
            String mppsiuid = UIDUtils.createUID();
            mppsscu.setPPSUID(mppsiuid);
            if(cl.hasOption("kos-title")) {
                List<String> fname = Arrays.asList(mkkos(cl));
                scanFiles(fname, tmpPrefix, tmpSuffix, tmpDir, mppsscu, storescu, stgcmtscu);
            } else {
                stgcmtscu.setUIDSuffix(cl.getOptionValue("uid-suffix"));
                storescu.setUIDSuffix(cl.getOptionValue("uid-suffix"));
                mppsscu.setUIDSuffix(cl.getOptionValue("uid-suffix"));
                scanFiles(cl.getArgList(), tmpPrefix, tmpSuffix, tmpDir, mppsscu, storescu, stgcmtscu);
            }
            ExecutorService executorService =
                    Executors.newCachedThreadPool();
            ScheduledExecutorService scheduledExecutorService =
                    Executors.newSingleThreadScheduledExecutor();
            device.setExecutor(executorService);
            device.setScheduledExecutor(scheduledExecutorService);
            device.bindConnections();
            try {
                boolean sendMpps = cl.hasOption("mpps");
                boolean sendLateMpps = cl.hasOption("mpps-late");
                if (sendMpps || sendLateMpps) {
                    sendMpps(mppsscu, sendMpps);
                    addReferencedPerformedProcedureStepSequence(mppsiuid, storescu);
                } else {
                    nullifyReferencedPerformedProcedureStepSequence(storescu);
                }
                sendObjects(storescu);
                if (sendLateMpps)
                    sendMppsNSet(mppsscu);
                if (cl.hasOption("stgcmt"))
                    sendStgCmt(stgcmtscu);
            } finally {
                if (conn.isListening()) {
                    device.waitForNoOpenConnections();
                    device.unbindConnections();
                }
                executorService.shutdown();
                scheduledExecutorService.shutdown();
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.