Package org.dcm4che3.conf.api

Examples of org.dcm4che3.conf.api.ConfigurationNotFoundException


    public static void main(String[] args) throws Exception {
        LdapDicomConfiguration dicomConf = new LdapDicomConfiguration();
        Device device = dicomConf.findDevice(args[0]);
        Main main = new Main();
        main.bind("dicomDevice", new DicomDeviceComponent(device));
        main.addRouteBuilder(new RouteBuilder(){

            @Override
            public void configure() throws Exception {
                from("dicomDevice:dicom?sopClasses=1.2.840.10008.1.1").bean(EchoSCP.class);
View Full Code Here


        main.run();
    }

    @Override
    public void process(Exchange exchange) throws Exception {
        DicomMessage in = exchange.getIn(DicomMessage.class);
        Dimse dimse = in.getHeader("dimse", Dimse.class);
        if (dimse != Dimse.C_ECHO_RQ)
            throw new DicomServiceException(Status.UnrecognizedOperation);
        DicomMessage out = new DicomMessage(
                Dimse.C_ECHO_RSP,
                Commands.mkEchoRSP(in.getCommand(), Status.Success));
        exchange.setOut(out);
    }
View Full Code Here

        return PreferencesUtils.nodeExists(rootPrefs, DICOM_CONFIGURATION_ROOT);
    }

    public Preferences getDicomConfigurationRoot() throws ConfigurationException {
        if (!PreferencesUtils.nodeExists(rootPrefs, DICOM_CONFIGURATION_ROOT))
            throw new ConfigurationNotFoundException();

        return rootPrefs.node(DICOM_CONFIGURATION_ROOT);
    }
View Full Code Here

    }

    public synchronized Device findDevice(String nodeName, String aet)
            throws ConfigurationException {
         if (!PreferencesUtils.nodeExists(rootPrefs, DICOM_DEVICES_ROOT))
            throw new ConfigurationNotFoundException();
       
        try {
            Preferences devicePrefs = rootPrefs.node(DICOM_DEVICES_ROOT);
            for (String deviceName : devicePrefs.childrenNames()) {
                Preferences deviceNode = devicePrefs.node(deviceName);
                for (String aet2 : deviceNode.node(nodeName).childrenNames())
                    if (aet.equals(aet2))
                        return loadDevice(deviceNode);
            }
        } catch (BackingStoreException e) {
            throw new ConfigurationException(e);
        }
        throw new ConfigurationNotFoundException(aet);
    }
View Full Code Here

    }

    public synchronized Device loadDevice(String pathName) throws ConfigurationException,
            ConfigurationNotFoundException {
        if (!PreferencesUtils.nodeExists(rootPrefs, pathName))
            throw new ConfigurationNotFoundException("Device "+pathName+" not found in configuration");

        return loadDevice(rootPrefs.node(pathName));
    }
View Full Code Here

    @Override
    public synchronized void merge(Device device) throws ConfigurationException {
        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);
View Full Code Here

    @Override
    public synchronized void removeDevice(String name) throws ConfigurationException {
        String pathName = deviceRef(name);
        if (!PreferencesUtils.nodeExists(rootPrefs, pathName))
            throw new ConfigurationNotFoundException();

        try {
            Preferences node = rootPrefs.node(pathName);
            node.removeNode();
            node.flush();
View Full Code Here

    }

    public synchronized Device findDevice(String filter, String childName)
            throws ConfigurationException {
        if (!configurationExists())
            throw new ConfigurationNotFoundException();

        SearchControls ctls = new SearchControls();
        ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
        ctls.setCountLimit(1);
        ctls.setReturningAttributes(StringUtils.EMPTY_STRING);
        ctls.setReturningObjFlag(false);
        NamingEnumeration<SearchResult> ne = null;
        String childDN;
        try {
            ne = ctx.search(devicesDN, filter, ctls);
            if (!ne.hasMore())
                throw new ConfigurationNotFoundException(childName);

            childDN = ne.next().getNameInNamespace();
        } catch (NamingException e) {
            throw new ConfigurationException(e);
        } finally {
View Full Code Here

    }

    @Override
    public synchronized Device findDevice(String name) throws ConfigurationException {
        if (!configurationExists())
            throw new ConfigurationNotFoundException();

        return loadDevice(deviceRef(name));
    }
View Full Code Here

    }

    @Override
    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) {
            throw new ConfigurationNotFoundException(e);
        } catch (NamingException e) {
            throw new ConfigurationException(e);
        } catch (CertificateException e) {
            throw new ConfigurationException(e);
        }
View Full Code Here

TOP

Related Classes of org.dcm4che3.conf.api.ConfigurationNotFoundException

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.