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

facebook4j.api.PostMethods Maven / Gradle / Ivy

There is a newer version: 2.4.13
Show newest version
/*
 * Copyright 2012 Ryuji Yamashita
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package facebook4j.api;

import facebook4j.Comment;
import facebook4j.CommentUpdate;
import facebook4j.FacebookException;
import facebook4j.Like;
import facebook4j.Post;
import facebook4j.PostUpdate;
import facebook4j.Reaction;
import facebook4j.Reading;
import facebook4j.ResponseList;

import java.net.URL;

/**
 * @author Ryuji Yamashita - roundrop at gmail.com
 */
public interface PostMethods {
    /**
     * Returns the current user's/page's/event's wall.
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#feed - Facebook Developers
     */
    ResponseList getFeed() throws FacebookException;

    /**
     * Returns the current user's/page's/event's wall.
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#feed - Facebook Developers
     */
    ResponseList getFeed(Reading reading) throws FacebookException;

    /**
     * Returns a user's/page's/event's wall.
     * @param id the ID of a user/page/event
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#feed - Facebook Developers
     */
    ResponseList getFeed(String id) throws FacebookException;

    /**
     * Returns a user's/page's/event's wall.
     * @param id the ID of a user/page/event
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#feed - Facebook Developers
     */
    ResponseList getFeed(String id, Reading reading) throws FacebookException;


    /**
     * Returns the current user's news feed.
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#home - Facebook Developers
     */
    ResponseList getHome() throws FacebookException;

    /**
     * Returns the current user's news feed.
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#home - Facebook Developers
     */
    ResponseList getHome(Reading reading) throws FacebookException;


    /**
     * Returns the current user's/page's own posts.
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#posts - Facebook Developers
     */
    ResponseList getPosts() throws FacebookException;

    /**
     * Returns the current user's/page's own posts.
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#posts - Facebook Developers
     */
    ResponseList getPosts(Reading reading) throws FacebookException;

    /**
     * Returns the user's/page's own posts.
     * @param id the ID of a user/page
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#posts - Facebook Developers
     */
    ResponseList getPosts(String id) throws FacebookException;

    /**
     * Returns the user's/page's own posts.
     * @param id the ID of a user/page
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#posts - Facebook Developers
     */
    ResponseList getPosts(String id, Reading reading) throws FacebookException;


    /**
     * Returns the current user's status updates.
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#statuses - Facebook Developers
     */
    ResponseList getStatuses() throws FacebookException;

    /**
     * Returns the current user's status updates.
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#statuses - Facebook Developers
     */
    ResponseList getStatuses(Reading reading) throws FacebookException;

    /**
     * Returns the user's/page's status updates.
     * @param id the ID of a user/page
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#statuses - Facebook Developers
     */
    ResponseList getStatuses(String id) throws FacebookException;

    /**
     * Returns the user's/page's status updates.
     * @param id the ID of a user/page
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#statuses - Facebook Developers
     */
    ResponseList getStatuses(String id, Reading reading) throws FacebookException;


    /**
     * Returns the posts the current user is tagged in.
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User - Facebook Developers - Connections - tagged
     */
    ResponseList getTagged() throws FacebookException;

    /**
     * Returns the posts the current user is tagged in.
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User - Facebook Developers - Connections - tagged
     */
    ResponseList getTagged(Reading reading) throws FacebookException;

    /**
     * Returns the posts a user is tagged in.
     * @param userId the ID of a user
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User - Facebook Developers - Connections - tagged
     */
    ResponseList getTagged(String userId) throws FacebookException;

    /**
     * Returns the posts the user is tagged in.
     * @param userId the ID of a user
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User - Facebook Developers - Connections - tagged
     */
    ResponseList getTagged(String userId, Reading reading) throws FacebookException;


    /**
     * Returns a single post.
     * @param postId the ID of the post
     * @return post
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Post - Facebook Developers
     */
    Post getPost(String postId) throws FacebookException;

    /**
     * Returns a single post.
     * @param postId the ID of the post
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return post
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Post - Facebook Developers
     */
    Post getPost(String postId, Reading reading) throws FacebookException;


    /**
     * Returns all of the comments on a post.
     * @param postId the ID of a post
     * @return comments
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Post#comments - Facebook Developers
     */
    ResponseList getPostComments(String postId) throws FacebookException;

    /**
     * Returns all of the comments on a post.
     * @param postId the ID of a post
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return comments
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Post#comments - Facebook Developers
     */
    ResponseList getPostComments(String postId, Reading reading) throws FacebookException;

    /**
     * Comments on the post.
     * @param postId the ID of the post
     * @param message comment text
     * @return The new comment ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Post#comments - Facebook Developers
     */
    String commentPost(String postId, String message) throws FacebookException;

    /**
     * Comments on the post.
     * @param postId the ID of the post
     * @param commentUpdate comment content
     * @return The new comment ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Post#comments - Facebook Developers
     */
    String commentPost(String postId, CommentUpdate commentUpdate) throws FacebookException;


    /**
     * Returns the likes on a post.
     * @param postId the ID of a post
     * @return likes
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Post#likes - Facebook Developers
     */
    ResponseList getPostLikes(String postId) throws FacebookException;

    /**
     * Returns the likes on a post.
     * @param postId the ID of a post
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers see Graph API#reading - Facebook Developers
     * @return likes
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Post#likes - Facebook Developers
     */
    ResponseList getPostLikes(String postId, Reading reading) throws FacebookException;
    
    /**
     * Returns the posts in which this post is shared.
     * @param postId the ID of a post
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see sharedposts - Facebook Developers
     */
    ResponseList getSharedPosts(String postId) throws FacebookException;

    /**
     * Returns the posts in which this post is shared.
     * @param postId the ID of a post
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers see Graph API#reading - Facebook Developers
     * @return posts
     * @throws FacebookException when Facebook service or network is unavailable
     * @see sharedposts - Facebook Developers
     */
    ResponseList getSharedPosts(String postId, Reading reading) throws FacebookException;

    /**
     * Likes the post.
     * @param postId the ID of the post
     * @return true if like is successful
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Post#likes - Facebook Developers
     */
    boolean likePost(String postId) throws FacebookException;

    /**
     * Unlikes the post.
     * @param postId the ID of the post
     * @return true if unlike is successful
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Post#likes - Facebook Developers
     */
    boolean unlikePost(String postId) throws FacebookException;

    /**
     * Creates the post.
     * @param postUpdate the post to be created
     * @return The new post ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#posts - Facebook Developers
     */
    String postFeed(PostUpdate postUpdate) throws FacebookException;

    /**
     * Creates the post.
     * @param id the ID of a user/page/event
     * @param postUpdate the post to be created
     * @return The new post ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#posts - Facebook Developers
     */
    String postFeed(String id, PostUpdate postUpdate) throws FacebookException;


    /**
     * Creates the link.
     * @param link link URL
     * @return The new link ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#links - Facebook Developers
     */
    String postLink(URL link) throws FacebookException;

    /**
     * Creates the link.
     * @param link link URL
     * @param message link message
     * @return The new link ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#links - Facebook Developers
     */
    String postLink(URL link, String message) throws FacebookException;

    /**
     * Creates the link.
     * @param userId the ID of a user
     * @param link link URL
     * @return The new link ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#links - Facebook Developers
     */
    String postLink(String userId, URL link) throws FacebookException;

    /**
     * Creates the link.
     * @param userId the ID of a user
     * @param link link URL
     * @param message link message
     * @return The new link ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#links - Facebook Developers
     */
    String postLink(String userId, URL link, String message) throws FacebookException;


    /**
     * Creates the status message.
     * @param message link message
     * @return The new status message ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#statuses - Facebook Developers
     * @see Page#statuses - Facebook Developers
     */
    String postStatusMessage(String message) throws FacebookException;

    /**
     * Creates the status message.
     * @param id the ID of a user/page
     * @param message link message
     * @return The new status message ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#statuses - Facebook Developers
     * @see Page#statuses - Facebook Developers
     */
    String postStatusMessage(String id, String message) throws FacebookException;


    /**
     * Deletes the post.
     * @param postId the ID of the post
     * @return true if delete is successful
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Post - Facebook Developers
     */
    boolean deletePost(String postId) throws FacebookException;
    
    /**
     * Returns the reactions on a post.
     * @param postId the ID of the post
     * @return reactions
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Reactions - Facebook Developers
     */
    ResponseList getPostReactions(String postId) throws FacebookException;
    
    /**
     * Returns the reactions on a post.
     * @param postId the ID of a post
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers see Graph API#reading - Facebook Developers
     * @return reactions
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Reactions - Facebook Developers
     */
    ResponseList getPostReactions(String postId, Reading reading) throws FacebookException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy