001/*
002 * (C) Copyright 2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *    Mariana Cedica
018 */
019package org.nuxeo.ecm.platform.importer.service;
020
021import org.nuxeo.common.xmap.annotation.XNode;
022import org.nuxeo.common.xmap.annotation.XObject;
023import org.nuxeo.ecm.platform.importer.factories.DefaultDocumentModelFactory;
024import org.nuxeo.ecm.platform.importer.log.ImporterLogger;
025import org.nuxeo.ecm.platform.importer.source.FileSourceNode;
026
027@XObject("importerConfig")
028public class ImporterConfigurationDescriptor {
029
030    @XNode("@sourceNodeClass")
031    protected Class<? extends FileSourceNode> sourceNodeClass;
032
033    @XNode("@importerLogClass")
034    protected Class<? extends ImporterLogger> importerLogClass;
035
036    @XNode("bulkMode")
037    protected Boolean bulkMode;
038
039    @XNode("documentModelFactory")
040    protected DocumentModelFactory documentModelFactory;
041
042    @XNode("repository")
043    protected String repository;
044
045    /**
046     * @since 9.3
047     */
048    @XNode("enablePerfLogging")
049    protected Boolean enablePerfLogging;
050
051    @XObject("documentModelFactory")
052    public static class DocumentModelFactory {
053
054        @XNode("@documentModelFactoryClass")
055        protected Class<? extends DefaultDocumentModelFactory> documentModelFactoryClass;
056
057        @XNode("@leafType")
058        protected String leafType;
059
060        @XNode("@folderishType")
061        protected String folderishType;
062
063        public String getFolderishType() {
064            return folderishType;
065        }
066
067        public String getLeafType() {
068            return leafType;
069        }
070
071        public Class<? extends DefaultDocumentModelFactory> getDocumentModelFactoryClass() {
072            return documentModelFactoryClass;
073        }
074    }
075
076    public Class<?> getSourceNodeClass() {
077        return sourceNodeClass;
078    }
079
080    public DocumentModelFactory getDocumentModelFactory() {
081        return documentModelFactory;
082    }
083
084    public Class<? extends ImporterLogger> getImporterLog() {
085        return importerLogClass;
086    }
087
088    public String getRepository() {
089        return repository;
090    }
091
092    public Boolean getBulkMode() {
093        return bulkMode;
094    }
095
096    /**
097     * @since 9.3
098     * @return true if the GenericMultiThreadImporter should log performance metrics, false otherwise
099     */
100    public Boolean getEnablePerfLogging() {
101        return enablePerfLogging;
102    }
103}