Package org.dcm4che3.conf.api.generic.ReflectiveConfig

Examples of org.dcm4che3.conf.api.generic.ReflectiveConfig.ConfigWriter


            String userID,
            String alternativeUserID,
            String userName,
            String hostName,
            RoleIDCode... roleIDs) {
        ActiveParticipant ap = new ActiveParticipant();
        ap.setUserID(userID);
        ap.setAlternativeUserID(alternativeUserID);
        ap.setUserName(userName);
        ap.setUserIsRequestor(requestor);
        ap.setNetworkAccessPointID(hostName);
        ap.setNetworkAccessPointTypeCode(AuditMessages.isIP(hostName)
                ? AuditMessages.NetworkAccessPointTypeCode.IPAddress
                : AuditMessages.NetworkAccessPointTypeCode.MachineName);
        for (RoleIDCode roleID : roleIDs)
            ap.getRoleIDCode().add(roleID);
        return ap;
    }
View Full Code Here


            ap.getRoleIDCode().add(roleID);
        return ap;
    }

    public AuditSourceIdentification createAuditSourceIdentification() {
        AuditSourceIdentification asi = new AuditSourceIdentification();
        asi.setAuditSourceID(auditSourceID());
        if (auditEnterpriseSiteID != null) {
            if (auditEnterpriseSiteID.equals("dicomInstitutionName")) {
                String[] institutionNames = getDevice().getInstitutionNames();
                if (institutionNames.length > 0)
                    asi.setAuditEnterpriseSiteID(institutionNames[0]);
            } else
                asi.setAuditEnterpriseSiteID(auditEnterpriseSiteID);
        }
        for (String code : auditSourceTypeCodes) {
            if (code.equals("dicomPrimaryDeviceType")) {
                for (String type : device.getPrimaryDeviceTypes()) {
                    AuditSourceTypeCode astc = new AuditSourceTypeCode();
                    astc.setCode(type);
                    astc.setCodeSystemName("DCM");
                    asi.getAuditSourceTypeCode().add(astc);
                }
            } else {
                AuditSourceTypeCode astc = new AuditSourceTypeCode();
                astc.setCode(code);
                asi.getAuditSourceTypeCode().add(astc );
            }
        }
        return asi ;
    }
View Full Code Here

                asi.setAuditEnterpriseSiteID(auditEnterpriseSiteID);
        }
        for (String code : auditSourceTypeCodes) {
            if (code.equals("dicomPrimaryDeviceType")) {
                for (String type : device.getPrimaryDeviceTypes()) {
                    AuditSourceTypeCode astc = new AuditSourceTypeCode();
                    astc.setCode(type);
                    astc.setCodeSystemName("DCM");
                    asi.getAuditSourceTypeCode().add(astc);
                }
            } else {
                AuditSourceTypeCode astc = new AuditSourceTypeCode();
                astc.setCode(code);
                asi.getAuditSourceTypeCode().add(astc );
            }
        }
        return asi ;
    }
View Full Code Here

    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

        ConfigField fieldAnno = field.getAnnotation(ConfigField.class);

        // getValueAdapter
        ConfigTypeAdapter<V, Object> valueAdapter = (ConfigTypeAdapter<V, Object>) getValueAdapter(field, config);

        ConfigWriter collectionWriter = writer.createCollectionChild(getCollectionName(fieldAnno), field);

        if (serialized == null) return;
       
        for (Entry<String, Object> e : serialized.entrySet()) {

            ConfigWriter elementWriter = collectionWriter.getCollectionElementWriter(fieldAnno.mapKey(), e.getKey(), field);
            valueAdapter.write(e.getValue(), config, elementWriter, field);
            elementWriter.flushWriter();
        }
    }
View Full Code Here

        ConfigField fieldAnno = field.getAnnotation(ConfigField.class);

        ConfigTypeAdapter<V, Object> valueAdapter = (ConfigTypeAdapter<V, Object>) getValueAdapter(field, config);
        ConfigTypeAdapter<K, String> keyAdapter = (ConfigTypeAdapter<K, String>) getKeyAdapter(field, config);

        ConfigWriter collectionWriter = diffwriter.getChildWriter(getCollectionName(fieldAnno), field);

        // remove nodes that were deleted since prev
        for (Entry<K, V> e : prev.entrySet())
            if (curr.get(e.getKey()) == null)
                collectionWriter.removeCollectionElement(fieldAnno.mapKey(), keyAdapter.serialize(e.getKey(), config, null));

        // add new nodes and merge existing
        for (Entry<K, V> e : curr.entrySet()) {

            // serialize key
            String serializedKey = keyAdapter.serialize(e.getKey(), config, null);
            // if new node
            if (prev.get(e.getKey()) == null) {
                ConfigWriter elementWriter = collectionWriter.getCollectionElementWriter(fieldAnno.mapKey(), serializedKey, field);
                // serialize
                Object serialized = valueAdapter.serialize(e.getValue(), config, field);
                valueAdapter.write(serialized, config, elementWriter, field);
                elementWriter.flushWriter();
            }
            // existing node
            else {
                ConfigWriter elementWriter = collectionWriter.getCollectionElementDiffWriter(fieldAnno.mapKey(), serializedKey);
                valueAdapter.merge(prev.get(e.getKey()), e.getValue(), config, elementWriter, field);
                elementWriter.flushDiffs();
            }
        }
    }
View Full Code Here

    @Override
    protected void storeChilds(Device device, Preferences deviceNode) throws ConfigurationException {
        T confObj = device.getDeviceExtension(confClass);
        if (confObj != null) {
            ConfigWriter prefsWriter = new PrefsConfigWriter(deviceNode.node(nodename));
           
            try {
           
                reflectiveConfig.storeConfig(confObj, prefsWriter);
           
View Full Code Here

        Preferences xdsNode = deviceNode.node(nodename);
        if (confObj == null)
            xdsNode.removeNode();
        else if (prevConfObj == null) {
            ConfigWriter prefsWriter = new PrefsConfigWriter(xdsNode);
           
            try {
           
                reflectiveConfig.storeConfig(confObj, prefsWriter);
           
            } catch (Exception e) {
                throw new ConfigurationException("Unable to store configuration for class "+confClass.getSimpleName()+
                        (confObj.getDevice() != null ? " for device: " + confObj.getDevice().getDeviceName(): "") , e);
            }
        } else {
            ConfigWriter prefsDiffWriter = new PrefsConfigWriter(xdsNode);
           
            try {
           
                reflectiveConfig.storeConfigDiffs(prevConfObj, confObj, prefsDiffWriter);
           
View Full Code Here

        if (objectClassAttr != null)
            objectClassAttr.add(objectClassName);
        else
            attrs.put(new BasicAttribute("objectclass", objectClassName));

        ConfigWriter ldapWriter = new LdapConfigIO(attrs, getCnStr() + deviceDN, config);

        try {

            reflectiveConfig.storeConfig(confObj, ldapWriter);
View Full Code Here

TOP

Related Classes of org.dcm4che3.conf.api.generic.ReflectiveConfig.ConfigWriter

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.