All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.adobe.cq.socialmedia.SocialPublisher Maven / Gradle / Ivy

/*******************************************************************************
 * ADOBE CONFIDENTIAL
 * __________________
 *
 * Copyright 2016 Adobe Systems Incorporated
 * All Rights Reserved.
 *
 * NOTICE:  All information contained herein is, and remains
 * the property of Adobe Systems Incorporated and its suppliers,
 * if any.  The intellectual and technical concepts contained
 * herein are proprietary to Adobe Systems Incorporated and its
 * suppliers and are protected by trade secret or copyright law.
 * Dissemination of this information or reproduction of this material
 * is strictly forbidden unless prior written permission is obtained
 * from Adobe Systems Incorporated.
 ******************************************************************************/

package com.adobe.cq.socialmedia;

import aQute.bnd.annotation.ProviderType;

import javax.annotation.Nullable;
import java.util.List;

/**
 * Defines a SocialPublisher which offers the possibility to interact with a SM network (ex.: post, delete).
 */
@ProviderType
public interface SocialPublisher {

    /**
     * Posts image and text to a specific location on SM Network.
     *
     * @param params containing:
     *               - pictureUrl - URL pointing to existing picture on the WEB
     *                 OR picture - Picture as InputStream
     *               - description - Picture description
     *               - spaceId - Space where the picture will be posted (ex.:Page ID/ Board name)
     * @return Post ID
     * @throws SocialException Thrown if the post cannot be executed
     */
    String publish(SocialPublisherPublishParams params) throws SocialException;

    /**
     * Deletes a post from the SM network.
     *
     * @param params containing:
     *               - postId - The ID of the post to be deleted
     *               - spaceId - Space where the post exists (ex.:Page ID/ Board name)
     * @throws SocialException Thrown if the post cannot be deleted
     */
    void delete(SocialPublisherDeleteParams params) throws SocialException;


    /**
     * Sets response code from Oauth in order to gain access to SM methods.
     *
     * @param responseCode OAuth response code.
     */
    void setResponseCode(String responseCode);

    /**
     * Returns the OAuth response key.
     *
     * @return OAuth response key
     */
    String getResponseCodeKey();

    /**
     * Retrieves the social spaces list for an user (ex.: pages he manages, boards he owns).
     * @return A list with spaces that the logged in user can modify.
     * @throws SocialException Thrown if the social spaces cannot be retrieved.
     */
    @Nullable List getSocialSpaces() throws SocialException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy