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 method for {@link org.dcm4che3.net.Device#reconfigure(org.dcm4che3.net.Device)}.
     */
    @Test
    public void testReconfigure() throws Exception {
        Device d1 = createDevice("test", "AET1");
        Device d2 = createDevice("test", "AET2");
        d1.reconfigure(d2);
        ApplicationEntity ae = d1.getApplicationEntity("AET2");
        assertNotNull(ae);
        List<Connection> conns = ae.getConnections();
        assertEquals(1, conns.size());
View Full Code Here

        List<Connection> conns = ae.getConnections();
        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 pathName = deviceRef(device.getDeviceName());
        if (!PreferencesUtils.nodeExists(rootPrefs, pathName))
            throw new ConfigurationNotFoundException();
       
        Preferences devicePrefs = rootPrefs.node(pathName);
        Device prev = loadDevice(devicePrefs);
        try {
            storeDiffs(devicePrefs, prev, device);
            mergeChilds(prev, device, devicePrefs);
            updateCertificates(prev, device);
            devicePrefs.flush();
View Full Code Here

        // if a requested device is already being (was) loaded, do not load it again, just return existing Device object
        if (deviceCache.containsKey(deviceNode.name()))
            return deviceCache.get(deviceNode.name());
       
        try {
            Device device = newDevice(deviceNode);

            // remember this device so it won't be loaded again in this run
            deviceCache.put(deviceNode.name(), device);
           
            loadFrom(device, deviceNode);
View Full Code Here

        Arrays.sort(a);
        return a;
    }

    private Device newDevice(Preferences deviceNode) {
        return new Device(deviceNode.name());
    }
View Full Code Here

    }

    @Override
    public HL7Application findHL7Application(String name)
            throws ConfigurationException {
        Device device = config.findDevice(
            "(&(objectclass=hl7Application)(hl7ApplicationName=" + name + "))",
            name);
        HL7DeviceExtension hl7Ext = device.getDeviceExtension(HL7DeviceExtension.class);
        return hl7Ext.getHL7Application(name);
    }
View Full Code Here

    public synchronized void merge(Device device) throws ConfigurationException {
        if (!configurationExists())
            throw new ConfigurationNotFoundException();

        String deviceDN = deviceRef(device.getDeviceName());
        Device prev = loadDevice(deviceDN);
        try {
            modifyAttributes(deviceDN, storeDiffs(prev, device, new ArrayList<ModificationItem>()));
            mergeChilds(prev, device, deviceDN);
            updateCertificates(prev, device);
        } catch (NameNotFoundException e) {
View Full Code Here

            return deviceCache.get(deviceDN);
               
       
        try {
            Attributes attrs = getAttributes(deviceDN);
            Device device = new Device(LdapUtils.stringValue(attrs.get("dicomDeviceName"), null));

            // remember this device so it won't be loaded again in this run
            deviceCache.put(deviceDN, device);
                       
            loadFrom(device, attrs);
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", "TEST1^DCM4CHE");
        config.persist(device);
        HL7Application app = hl7Ext.findHL7Application("TEST1^DCM4CHE");
        assertEquals(2575, app.getConnections().get(0).getPort());
        assertEquals("TEST2^DCM4CHE", app.getAcceptedSendingApplications()[0]);
        assertEquals(7, app.getAcceptedMessageTypes().length);
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.