Examples of ExtractorSpec


Examples of org.apache.oodt.cas.filemgr.structs.ExtractorSpec

    public static Vector<Hashtable<String, Object>> getXmlRpcTypeExtractors(List<ExtractorSpec> extractors) {
        Vector<Hashtable<String, Object>> extractorsVector = new Vector<Hashtable<String, Object>>();

        if (extractors != null && extractors.size() > 0) {
            for (Iterator<ExtractorSpec> i = extractors.iterator(); i.hasNext();) {
                ExtractorSpec spec = i.next();
                extractorsVector.add(getXmlRpcExtractorSpec(spec));
            }
        }

        return extractorsVector;
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.ExtractorSpec

        return extractors;
    }

    public static ExtractorSpec getExtractorSpecFromXmlRpc(
            Hashtable<String, Object> extractorSpecHash) {
        ExtractorSpec spec = new ExtractorSpec();
        spec.setClassName((String) extractorSpecHash.get("className"));
        spec
                .setConfiguration(getPropertiesFromXmlRpc((Hashtable<String, String>) extractorSpecHash
                        .get("config")));
        return spec;
    }
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.ExtractorSpec

            if (extractorNodes != null && extractorNodes.getLength() > 0) {
                extractors = new Vector<ExtractorSpec>();
                for (int i = 0; i < extractorNodes.getLength(); i++) {
                    Element extractorElem = (Element) extractorNodes.item(i);
                    ExtractorSpec spec = new ExtractorSpec();
                    String className = extractorElem.getAttribute("class");
                    spec.setClassName(className);

                    // see if there are any configuration properties
                    Element configuration = XMLUtils.getFirstElement(
                            "configuration", extractorElem);

                    if (configuration != null) {
                        Properties config = new Properties();
                        NodeList propertyNodes = configuration
                                .getElementsByTagName("property");

                        if (propertyNodes != null
                                && propertyNodes.getLength() > 0) {
                            for (int j = 0; j < propertyNodes.getLength(); j++) {
                                Element propertyElem = (Element) propertyNodes
                                        .item(j);
                                String propertyName = propertyElem
                                        .getAttribute("name");
                                String propertyValue = propertyElem
                                        .getAttribute("value");
                                if (Boolean
                                        .valueOf(
                                                propertyElem
                                                        .getAttribute("envReplace"))
                                        .booleanValue()) {
                                    propertyValue = PathUtils
                                            .replaceEnvVariables(propertyValue);
                                }

                                config.setProperty(propertyName, propertyValue);
                            }

                            spec.setConfiguration(config);
                        }
                    }

                    extractors.add(spec);
                }
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.ExtractorSpec

        if (product.getProductType().getExtractors() != null
                && product.getProductType().getExtractors().size() > 0) {
            for (Iterator<ExtractorSpec> i = product.getProductType().getExtractors()
                    .iterator(); i.hasNext();) {
                ExtractorSpec spec = i.next();
                FilemgrMetExtractor extractor = GenericFileManagerObjectFactory
                        .getExtractorFromClassName(spec.getClassName());
                extractor.configure(spec.getConfiguration());
                LOG.log(Level.INFO, "Running Met Extractor: ["
                        + extractor.getClass().getName()
                        + "] for product type: ["
                        + product.getProductType().getName() + "]");
                try {
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.ExtractorSpec

        assertTrue(productType.getName().equals(convBackProdType.getName()));
        assertTrue(productType.getDescription().equals(convBackProdType.getDescription()));
        assertTrue(productType.getVersioner().equals(convBackProdType.getVersioner()));
        assertTrue(productType.getProductRepositoryPath().equals(convBackProdType.getProductRepositoryPath()));
        for (int i = 0; i < productType.getExtractors().size(); i++) {
            ExtractorSpec spec1 = productType.getExtractors().get(i);
            ExtractorSpec spec2 = convBackProdType.getExtractors().get(i);
            assertTrue(spec1.getClassName().equals(spec2.getClassName()));
            assertTrue(spec1.getConfiguration().equals(spec2.getConfiguration()));
        }
        for (int i = 0; i < productType.getHandlers().size(); i++) {
            TypeHandler handler1 = productType.getHandlers().get(i);
            TypeHandler handler2 = convBackProdType.getHandlers().get(i);
            assertTrue(handler1.getClass().getCanonicalName().equals(handler2.getClass().getCanonicalName()));
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.ExtractorSpec

    public static Vector<Hashtable<String, Object>> getXmlRpcTypeExtractors(List<ExtractorSpec> extractors) {
        Vector<Hashtable<String, Object>> extractorsVector = new Vector<Hashtable<String, Object>>();

        if (extractors != null && extractors.size() > 0) {
            for (Iterator<ExtractorSpec> i = extractors.iterator(); i.hasNext();) {
                ExtractorSpec spec = i.next();
                extractorsVector.add(getXmlRpcExtractorSpec(spec));
            }
        }

        return extractorsVector;
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.ExtractorSpec

    }

    @SuppressWarnings("unchecked")
    public static ExtractorSpec getExtractorSpecFromXmlRpc(
            Hashtable<String, Object> extractorSpecHash) {
        ExtractorSpec spec = new ExtractorSpec();
        spec.setClassName((String) extractorSpecHash.get("className"));
        spec
                .setConfiguration(getPropertiesFromXmlRpc((Hashtable<String, String>) extractorSpecHash
                        .get("config")));
        return spec;
    }
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.ExtractorSpec

            if (extractorNodes != null && extractorNodes.getLength() > 0) {
                extractors = new Vector<ExtractorSpec>();
                for (int i = 0; i < extractorNodes.getLength(); i++) {
                    Element extractorElem = (Element) extractorNodes.item(i);
                    ExtractorSpec spec = new ExtractorSpec();
                    String className = extractorElem.getAttribute("class");
                    spec.setClassName(className);

                    // see if there are any configuration properties
                    Element configuration = XMLUtils.getFirstElement(
                            "configuration", extractorElem);

                    if (configuration != null) {
                        Properties config = new Properties();
                        NodeList propertyNodes = configuration
                                .getElementsByTagName("property");

                        if (propertyNodes != null
                                && propertyNodes.getLength() > 0) {
                            for (int j = 0; j < propertyNodes.getLength(); j++) {
                                Element propertyElem = (Element) propertyNodes
                                        .item(j);
                                String propertyName = propertyElem
                                        .getAttribute("name");
                                String propertyValue = propertyElem
                                        .getAttribute("value");
                                if (Boolean
                                        .valueOf(
                                                propertyElem
                                                        .getAttribute("envReplace"))
                                        .booleanValue()) {
                                    propertyValue = PathUtils
                                            .replaceEnvVariables(propertyValue);
                                }

                                config.setProperty(propertyName, propertyValue);
                            }

                            spec.setConfiguration(config);
                        }
                    }

                    extractors.add(spec);
                }
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.ExtractorSpec

                typeElem.appendChild(versionerClassPathElem);

                // add extractor info
                Element metExtractorsElem = document.createElement("metExtractors");
                for (Object specObject : type.getExtractors()) {
                    ExtractorSpec spec = (ExtractorSpec) specObject;
                    Element extractorElem = document.createElement("extractor");
                    extractorElem.setAttribute("class", spec.getClassName());
                   
                    if (spec.getConfiguration() != null) {
                        Element extractorConfigElem = document.createElement("configuration");
                        Enumeration e = spec.getConfiguration().propertyNames();
                       
                        while (e.hasMoreElements()) {
                            String key = (String) e.nextElement();
                           
                            Element propertyElem = document.createElement("property");
                            propertyElem.setAttribute("name", key);
                            propertyElem.setAttribute("value", spec.getConfiguration().getProperty(key));
                           
                            extractorConfigElem.appendChild(propertyElem);
                        }
                       
                        extractorElem.appendChild(extractorConfigElem);
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.ExtractorSpec

            if (extractorNodes != null && extractorNodes.getLength() > 0) {
                extractors = new Vector<ExtractorSpec>();
                for (int i = 0; i < extractorNodes.getLength(); i++) {
                    Element extractorElem = (Element) extractorNodes.item(i);
                    ExtractorSpec spec = new ExtractorSpec();
                    String className = extractorElem.getAttribute("class");
                    spec.setClassName(className);

                    // see if there are any configuration properties
                    Element configuration = XMLUtils.getFirstElement(
                            "configuration", extractorElem);

                    if (configuration != null) {
                        Properties config = new Properties();
                        NodeList propertyNodes = configuration
                                .getElementsByTagName("property");

                        if (propertyNodes != null
                                && propertyNodes.getLength() > 0) {
                            for (int j = 0; j < propertyNodes.getLength(); j++) {
                                Element propertyElem = (Element) propertyNodes
                                        .item(j);
                                String propertyName = propertyElem
                                        .getAttribute("name");
                                String propertyValue = propertyElem
                                        .getAttribute("value");
                                if (Boolean
                                        .valueOf(
                                                propertyElem
                                                        .getAttribute("envReplace"))
                                        .booleanValue()) {
                                    propertyValue = PathUtils
                                            .replaceEnvVariables(propertyValue);
                                }

                                config.setProperty(propertyName, propertyValue);
                            }

                            spec.setConfiguration(config);
                        }
                    }

                    extractors.add(spec);
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.