001/*
002 * (C) Copyright 2017 Nuxeo (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 *     Funsho David
018 *
019 */
020
021package org.nuxeo.directory.mongodb;
022
023import org.nuxeo.common.xmap.annotation.XNode;
024import org.nuxeo.common.xmap.annotation.XObject;
025import org.nuxeo.ecm.directory.ReferenceDescriptor;
026
027/**
028 * Descriptor for mongoDB directory reference. Present for backward compatibility, use
029 * {@link ReferenceDescriptor} instead.
030 *
031 * @since 9.2
032 */
033@XObject("reference")
034public class MongoDBReferenceDescriptor implements Cloneable {
035
036    @XNode("@collection")
037    protected String collection;
038
039    @XNode("@sourceField")
040    protected String sourceField;
041
042    @XNode("@targetField")
043    protected String targetField;
044
045    @XNode("@dataFileName")
046    protected String dataFileName;
047
048    @XNode("@field")
049    protected String fieldName;
050
051    @XNode("@directory")
052    protected String targetDirectoryName;
053
054    public String getCollection() {
055        return collection;
056    }
057
058    public void setCollection(String collection) {
059        this.collection = collection;
060    }
061
062    public String getSourceField() {
063        return sourceField;
064    }
065
066    public void setSourceField(String sourceField) {
067        this.sourceField = sourceField;
068    }
069
070    public String getTargetField() {
071        return targetField;
072    }
073
074    public void setTargetField(String targetField) {
075        this.targetField = targetField;
076    }
077
078    public String getDataFileName() {
079        return dataFileName;
080    }
081
082    public void setDataFileName(String dataFileName) {
083        this.dataFileName = dataFileName;
084    }
085
086    public String getFieldName() {
087        return fieldName;
088    }
089
090    public void setFieldName(String fieldName) {
091        this.fieldName = fieldName;
092    }
093
094    public String getTargetDirectoryName() {
095        return targetDirectoryName;
096    }
097
098    public void setTargetDirectoryName(String targetDirectoryName) {
099        this.targetDirectoryName = targetDirectoryName;
100    }
101
102    @Override
103    public MongoDBReferenceDescriptor clone() {
104        try {
105            return (MongoDBReferenceDescriptor) super.clone();
106        } catch (CloneNotSupportedException e) {
107            throw new AssertionError(e);
108        }
109    }
110
111}