001/*
002 * (C) Copyright 2012 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 *     Anahide Tchertchian
018 */
019package org.nuxeo.ecm.directory.registry;
020
021import java.util.ArrayList;
022import java.util.List;
023
024/**
025 * Pseudo contribution, to make the mapping between a directory and its factory.
026 *
027 * @since 5.6
028 */
029public class DirectoryFactoryMapper {
030
031    protected String directoryName;
032
033    protected List<String> factories;
034
035    public DirectoryFactoryMapper() {
036        super();
037    }
038
039    public DirectoryFactoryMapper(String directoryName, String factory) {
040        super();
041        this.directoryName = directoryName;
042        this.factories = new ArrayList<String>();
043        this.factories.add(factory);
044    }
045
046    public DirectoryFactoryMapper(String directoryName, List<String> factories) {
047        super();
048        this.directoryName = directoryName;
049        this.factories = factories;
050    }
051
052    public String getDirectoryName() {
053        return directoryName;
054    }
055
056    public void setDirectoryName(String directoryName) {
057        this.directoryName = directoryName;
058    }
059
060    public List<String> getFactories() {
061        return factories;
062    }
063
064    public void setFactories(List<String> factories) {
065        this.factories = factories;
066    }
067
068    public DirectoryFactoryMapper clone() {
069        DirectoryFactoryMapper clone = new DirectoryFactoryMapper();
070        clone.setDirectoryName(directoryName);
071        clone.setFactories(factories);
072        return clone;
073    }
074
075}