001/*
002 * (C) Copyright 2015 Nuxeo SA (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl-2.1.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *      Nelson Silva
016 */
017
018package org.nuxeo.ecm.media.publishing;
019
020import org.nuxeo.ecm.core.api.DocumentModel;
021import java.util.Map;
022
023/**
024 * @since 7.3
025 */
026public interface MediaPublishingService {
027
028    /**
029     * Return a list of the available media publishing services for the given document
030     */
031    String[] getAvailableProviders(DocumentModel doc);
032
033    /**
034     * Schedules an upload
035     * @param doc the Document to upload
036     * @param provider the id of the media publishing provider
037     * @return the id of the publishing work
038     */
039    String publish(DocumentModel doc, String provider, String account, Map<String, String> options);
040
041    /**
042     * Unpublish the media
043     *
044     * @since 7.4
045     */
046    void unpublish(DocumentModel doc, String provider);
047
048    /**
049     * Return the provider with the given name.
050     */
051    MediaPublishingProvider getProvider(String provider);
052}