Package org.dcm4che3.net

Examples of org.dcm4che3.net.Device


        assertEquals(7, app.getAcceptedMessageTypes().length);
        config.removeDevice("Test-Device-1");
    }

    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


    @Test
    public void testPersist() throws Exception {
        try {
            config.removeDevice("Test-Device-1");
        catch (ConfigurationNotFoundException e) {}
        Device device = createDevice("Test-Device-1", "TEST-AET1");
        config.persist(device);
        ApplicationEntity ae = config.findApplicationEntity("TEST-AET1");
        assertFalse(ae.isAssociationInitiator());
        assertTrue(ae.isAssociationAcceptor());
        assertTrue(ae.getConnections().get(0).isServer());
View Full Code Here

    @Test
    public void testMerge() throws Exception {
        try {
            config.removeDevice("Test-Device-1");
        catch (ConfigurationNotFoundException e) {}
        Device device = createDevice("Test-Device-1", "TEST-AET1");
        config.persist(device);
        modifyDevice(device);
        config.merge(device);
        ApplicationEntity ae2 = config.findApplicationEntity("TEST-AET2");
        ApplicationEntity ae = ae2.getDevice().getApplicationEntity("TEST-AET1");
View Full Code Here

                findSCP.getQueryOptions());
        config.removeDevice("Test-Device-1");
    }

    private static Device createDevice(String name, String aet) throws Exception {
        Device device = new Device(name);
        Connection conn = createConn("host.dcm4che.org", 11112);
        device.addConnection(conn);
        ApplicationEntity ae = createAE(aet, conn);
        device.addApplicationEntity(ae);
        return device ;
    }
View Full Code Here

    }
   
    @Test
    public void testTimeZoneConversion() throws Exception
    {
        Device modalityInChina = createDevice("modalityInChina", "modalityInChina");
        modalityInChina.setTimeZoneOfDevice(TimeZone.getTimeZone("Asia/Shanghai"));
        Device archiveInAustria = createDevice("archiveInAustria", "archiveInAustria");
        archiveInAustria.setTimeZoneOfDevice(TimeZone.getTimeZone("Europe/Vienna"));
        config.persist(modalityInChina);
        config.persist(archiveInAustria);
       
        TimeZone a = modalityInChina.getTimeZoneOfDevice();
        TimeZone b = archiveInAustria.getTimeZoneOfDevice();
        Attributes attr = new Attributes();
        attr.setDefaultTimeZone(a);
        attr.setDate(Tag.StudyDateAndTime, new Date(0));
        assertEquals("Asia/Shanghai",attr.getTimeZone().getID());
        assertEquals("19700101",attr.getString(Tag.StudyDate));
View Full Code Here

                b.getInstalled());
        mergeAuditSuppressCriteria(a, b, prefs);
    }

    private String arrDeviceRef(AuditLogger a) {
        Device arrDevice = a.getAuditRecordRepositoryDevice();
        return arrDevice != null
                ? config.deviceRef(arrDevice.getDeviceName())
                : null;
    }
View Full Code Here

            config.removeDevice("TestAuditRecordRepository");
        catch (ConfigurationNotFoundException e) {}
        try {
            config.removeDevice("TestAuditLogger");
        catch (ConfigurationNotFoundException e) {}
        Device arrDevice = createARRDevice("TestAuditRecordRepository");
        config.persist(arrDevice);
        config.persist(createLoggerDevice("TestAuditLogger", arrDevice));
        validate(config.findDevice("TestAuditLogger"));
        config.removeDevice("TestAuditRecordRepository");
        config.removeDevice("TestAuditLogger");
View Full Code Here

        config.removeDevice("TestAuditRecordRepository");
        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

        addAuditRecordRepository(device, udp, tls);
        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;
View Full Code Here

        assertFalse(logger.isIncludeBOM());
        assertEquals(300, logger.getRetryInterval());
        assertEquals(SPOOL_DIRECTORY, logger.getSpoolDirectory());
        assertTrue(logger.isIncludeInstanceUID());
        validate(logger.getAuditSuppressCriteriaList());
        Device arrDevice = logger.getAuditRecordRepositoryDevice();
        assertNotNull(arrDevice);
        AuditRecordRepository arr = arrDevice.getDeviceExtension(AuditRecordRepository.class);
        assertNotNull(arr);
        assertEquals(2, arr.getConnections().size());
    }
View Full Code Here

TOP

Related Classes of org.dcm4che3.net.Device

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.