com.shephertz.app42.paas.sdk.android.review
Class ReviewService

java.lang.Object
  extended by com.shephertz.app42.paas.sdk.android.review.ReviewService

public class ReviewService
extends java.lang.Object

The service is a Review & Rating manager for any item. The item can be anything which has an id e.g. App on a AppStore/Marketplace, items in a catalogue, articles, blogs etc. It manages the comments and its associated rating. It also provides methods to fetch average, highest etc. Reviews. Reviews can be also be muted or unmuted if it has any objectionable content.

See Also:
Review

Constructor Summary
ReviewService(java.lang.String apiKey, java.lang.String secretKey, java.lang.String baseURL)
          The costructor for the Service
 
Method Summary
 Review createReview(java.lang.String userID, java.lang.String itemID, java.lang.String reviewComment, double reviewRating)
          Creates review for the specified item on the cloud
 java.util.ArrayList<Review> getAllReviews()
          Fetches all reviews for the App
 java.util.ArrayList<Review> getAllReviews(int max, int offset)
          Fetches all reviews for the App by Paging.
 App42Response getAllReviewsCount()
          Fetches count of all reviews for the App
 Review getAverageReviewByItem(java.lang.String itemId)
          Fetches the average review for the specified itemId
 Review getHighestReviewByItem(java.lang.String itemId)
          Fetches the highest review for the specified itemId
 Review getLowestReviewByItem(java.lang.String itemId)
          Fetches the lowest review for the specified itemId
 java.util.ArrayList<Review> getReviewsByItem(java.lang.String itemId)
          Fetches All Reviews based on the itemId
 java.util.ArrayList<Review> getReviewsByItem(java.lang.String itemId, int max, int offset)
          Fetches All Reviews based on the itemId by Paging.
 App42Response getReviewsCountByItem(java.lang.String itemId)
          Fetches count of All Reviews based on the itemId
 App42Response mute(java.lang.String reviewId)
          Mutes the specified review
 App42Response unmute(java.lang.String reviewId)
          UnMutes the specified review
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReviewService

public ReviewService(java.lang.String apiKey,
                     java.lang.String secretKey,
                     java.lang.String baseURL)
The costructor for the Service

Parameters:
apiKey -
secretKey -
baseURL -
Method Detail

createReview

public Review createReview(java.lang.String userID,
                           java.lang.String itemID,
                           java.lang.String reviewComment,
                           double reviewRating)
                    throws App42Exception
Creates review for the specified item on the cloud

Parameters:
userId - The user who has created the review
itemId - The item for which the review has to be created
reviewComment - The review comment
reviewRating - Review rating in double
Returns:
Review object containing the review which has been created
Throws:
App42Exception

getAllReviews

public java.util.ArrayList<Review> getAllReviews()
                                          throws App42Exception
Fetches all reviews for the App

Returns:
ArrayList of Review object containing all the reviews for the App
Throws:
App42Exception

getAllReviews

public java.util.ArrayList<Review> getAllReviews(int max,
                                                 int offset)
                                          throws App42Exception
Fetches all reviews for the App by Paging.

Parameters:
max - Maximum number of records to be fetched
offset - From where the records are to be fetched
Returns:
ArrayList of Review object containing all the reviews for the App
Throws:
App42Exception

getAllReviewsCount

public App42Response getAllReviewsCount()
                                 throws App42Exception
Fetches count of all reviews for the App

Returns:
App42Response containing count of all the reviews for the App
Throws:
App42Exception

getAverageReviewByItem

public Review getAverageReviewByItem(java.lang.String itemId)
                              throws App42Exception
Fetches the average review for the specified itemId

Parameters:
itemId - The item for which the average review has to be fetched
Returns:
Review object containing the average review for a item
Throws:
App42Exception

getHighestReviewByItem

public Review getHighestReviewByItem(java.lang.String itemId)
                              throws App42Exception
Fetches the highest review for the specified itemId

Parameters:
itemId - The item for which the highest review has to be fetched
Returns:
Review object containing the highest review for a item
Throws:
App42Exception

getLowestReviewByItem

public Review getLowestReviewByItem(java.lang.String itemId)
                             throws App42Exception
Fetches the lowest review for the specified itemId

Parameters:
itemId - The item for which the lowest review has to be fetched
Returns:
Review object containing the lowest review for a item
Throws:
App42Exception

getReviewsByItem

public java.util.ArrayList<Review> getReviewsByItem(java.lang.String itemId)
                                             throws App42Exception
Fetches All Reviews based on the itemId

Parameters:
itemId - The item for which reviews have to be fetched
Returns:
ArrayList of Review object containing all the reviews for a item
Throws:
App42Exception

getReviewsByItem

public java.util.ArrayList<Review> getReviewsByItem(java.lang.String itemId,
                                                    int max,
                                                    int offset)
                                             throws App42Exception
Fetches All Reviews based on the itemId by Paging.

Parameters:
itemId - The item for which reviews have to be fetched
userName - The name of the user for which file has to be retrieved
max - Maximum number of records to be fetched
offset - From where the records are to be fetched
Returns:
ArrayList of Review object containing all the reviews for a item
Throws:
App42Exception

getReviewsCountByItem

public App42Response getReviewsCountByItem(java.lang.String itemId)
                                    throws App42Exception
Fetches count of All Reviews based on the itemId

Parameters:
itemId - The item for which count of reviews have to be fetched
Returns:
App42Response containing count of all the reviews for a item
Throws:
App42Exception

mute

public App42Response mute(java.lang.String reviewId)
                   throws App42Exception
Mutes the specified review

Parameters:
reviewId - The Id of the review which has to be muted
Returns:
App42Response if muted successfully
Throws:
App42Exception

unmute

public App42Response unmute(java.lang.String reviewId)
                     throws App42Exception
UnMutes the specified review

Parameters:
reviewId - The Id of the review which has to be unmuted
Returns:
App42Response if unmuted successfully
Throws:
App42Exception