001/*
002 *  Copyright 2020 Anyware Services
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 */
016package org.ametys.plugins.repository.data.external;
017
018import java.util.Set;
019
020import org.ametys.plugins.repository.data.holder.ModelAwareDataHolder;
021import org.ametys.runtime.model.ModelItem;
022
023/**
024 * This interface represents a provider of externalizables data.
025 * 
026 */
027public interface ExternalizableDataProvider
028{
029    /**
030     * Enumeration for externalizable data status
031     *
032     */
033    public enum ExternalizableDataStatus
034    {
035        /** Status for a data for which the value to used is the local value */
036        LOCAL,
037        /** Status for a data for which the value to used is the external value */
038        EXTERNAL
039    }
040    
041    /**
042     * Get the paths of data that can be valued externally or locally.
043     * @param dataHolder The externalizable data holder 
044     * @return The paths of data that can be valued externally or locally
045     */
046    public Set<String> getExternalizableDataPaths(ModelAwareDataHolder dataHolder);
047    
048    /**
049     * Checks if the data of given model item is externalizable
050     * @param modelItem the model item
051     * @return <code>true</code> if the data of given model item is externalizable, <code>false</code> otherwise
052     */
053    public boolean isDataExternalizable(ModelItem modelItem);
054}