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

facebook4j.api.AlbumMethods 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 java.net.URL;

import facebook4j.Album;
import facebook4j.AlbumCreate;
import facebook4j.Comment;
import facebook4j.FacebookException;
import facebook4j.Like;
import facebook4j.Media;
import facebook4j.Photo;
import facebook4j.Reading;
import facebook4j.ResponseList;

/**
 * @author Ryuji Yamashita - roundrop at gmail.com
 */
public interface AlbumMethods {
    /**
     * Returns the photo albums the current user has created.
     * @return albums
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User - Facebook Developers - Connections - albums
     */
    ResponseList getAlbums() throws FacebookException;

    /**
     * Returns the photo albums the current user has created.
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return albums
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#albums - Facebook Developers
     */
    ResponseList getAlbums(Reading reading) throws FacebookException;

    /**
     * Returns the photo albums a user has created.
     * @param userId the ID of a user
     * @return albums
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#albums - Facebook Developers
     */
    ResponseList getAlbums(String userId) throws FacebookException;

    /**
     * Returns the photo albums a user has created.
     * @param userId the ID of a user
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return albums
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#albums - Facebook Developers
     */
    ResponseList getAlbums(String userId, Reading reading) throws FacebookException;


    /**
     * Creates the current user's photo album.
     * @param albumCreate the album to be created
     * @return The new album ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#albums - Facebook Developers
     */
    String createAlbum(AlbumCreate albumCreate) throws FacebookException;

    /**
     * Creates the user's photo album.
     * @param userId the ID of a user
     * @param albumCreate the album to be created
     * @return The new album ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see User#albums - Facebook Developers
     */
    String createAlbum(String userId, AlbumCreate albumCreate) throws FacebookException;


    /**
     * Returns a single photo album.
     * @param albumId the ID of a album
     * @return album
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Album - Facebook Developers
     */
    Album getAlbum(String albumId) throws FacebookException;

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


    /**
     * Returns the photos contained in the album.
     * @param albumId the ID of a album
     * @return photos
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Album#photos - Facebook Developers
     */
    ResponseList getAlbumPhotos(String albumId) throws FacebookException;

    /**
     * Returns the photos contained in the album.
     * @param albumId the ID of a album
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return photos
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Album#photos - Facebook Developers
     */
    ResponseList getAlbumPhotos(String albumId, Reading reading) throws FacebookException;

    /**
     * Adds a photo to the album.
     * @param albumId the ID of a album
     * @param source photo content
     * @return The new photo ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Album#photos - Facebook Developers
     */
    String addAlbumPhoto(String albumId, Media source) throws FacebookException;

    /**
     * Adds a photo to the album.
     * @param albumId the ID of a album
     * @param source photo content
     * @param message photo description
     * @return The new photo ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Album#photos - Facebook Developers
     */
    String addAlbumPhoto(String albumId, Media source, String message) throws FacebookException;


    /**
     * Returns the comments made on the album.
     * @param albumId the ID of a album
     * @return comments
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Album#comments - Facebook Developers
     */
    ResponseList getAlbumComments(String albumId) throws FacebookException;

    /**
     * Returns the comments made on the album.
     * @param albumId the ID of a album
     * @param reading optional reading parameters. see Graph API#reading - Facebook Developers
     * @return comments
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Album#comments - Facebook Developers
     */
    ResponseList getAlbumComments(String albumId, Reading reading) throws FacebookException;

    /**
     * Comments on the album.
     * @param albumId the ID of a album
     * @param message comment text
     * @return The new comment ID
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Album#comments - Facebook Developers
     */
    String commentAlbum(String albumId, String message) throws FacebookException;


    /**
     * Returns likes made on the album.
     * @param albumId the ID of a album
     * @return likes
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Album#likes - Facebook Developers
     */
    ResponseList getAlbumLikes(String albumId) throws FacebookException;

    /**
     * Returns likes made on the album.
     * @param albumId the ID of a album
     * @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 Album#likes - Facebook Developers
     */
    ResponseList getAlbumLikes(String albumId, Reading reading) throws FacebookException;

    /**
     * Likes the album.
     * @param albumId the ID of a album
     * @return true if like is successful
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Album#likes - Facebook Developers
     */
    boolean likeAlbum(String albumId) throws FacebookException;

    /**
     * Unlikes the album.
     * @param albumId the ID of a album
     * @return true if unlike is successful
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Album#likes - Facebook Developers
     */
    boolean unlikeAlbum(String albumId) throws FacebookException;
    
    /**
     * Returns url of the album's cover photo.
     * @param albumId the ID of a album
     * @return url
     * @throws FacebookException when Facebook service or network is unavailable
     * @see Album - Facebook Developers - Connections - picture
     */
    URL getAlbumCoverPhoto(String albumId) throws FacebookException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy