001/*
002 * (C) Copyright 2016 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 *     Kevin Leturc
018 */
019package org.nuxeo.ecm.storage.marklogic;
020
021import org.nuxeo.common.xmap.annotation.XNode;
022import org.nuxeo.common.xmap.annotation.XObject;
023import org.nuxeo.ecm.core.storage.dbs.DBSRepositoryDescriptor;
024
025/**
026 * MarkLogic Repository Descriptor.
027 *
028 * @since 8.3
029 */
030@XObject(value = "repository")
031public class MarkLogicRepositoryDescriptor extends DBSRepositoryDescriptor {
032
033    public MarkLogicRepositoryDescriptor() {
034    }
035
036    @XNode("host")
037    public String host;
038
039    @XNode("port")
040    public Integer port;
041
042    @XNode("user")
043    public String user;
044
045    @XNode("password")
046    public String password;
047
048    @XNode("dbname")
049    public String dbname;
050
051    @Override
052    public MarkLogicRepositoryDescriptor clone() {
053        return (MarkLogicRepositoryDescriptor) super.clone();
054    }
055
056    public void merge(MarkLogicRepositoryDescriptor other) {
057        super.merge(other);
058        if (other.host != null) {
059            host = other.host;
060        }
061        if (other.port != null) {
062            port = other.port;
063        }
064        if (other.password != null) {
065            password = other.password;
066        }
067        if (other.dbname != null) {
068            dbname = other.dbname;
069        }
070    }
071
072}