public interface RatingsDAO
| Modifier and Type | Method and Description |
|---|---|
void |
addRating(ResourceImpl resourceImpl,
String userID,
int rating)
Method to persist a rating.
|
void |
addRatings(ResourceImpl resource,
RatingDO[] ratingDOs)
Method to persist ratings.
|
void |
copyRatings(ResourceImpl fromResource,
ResourceImpl toResource)
Method to copy ratings.
|
float |
getAverageRating(ResourceImpl resourceImpl)
Method to get the average rating added to a given resource.
|
String[] |
getRatedUserNames(ResourceImpl resourceImpl)
Method to get users who rated the given resource.
|
int |
getRateID(ResourceImpl resourceImpl,
String userID)
Method to get a id of a rating added to a given resource.
|
int |
getRating(ResourceImpl resourceImpl,
String userID)
Method to get a rating added to a given resource.
|
RatingDO |
getRatingDO(ResourceImpl resourceImpl,
String userID)
Method to get a rating added by the given user to the given resource.
|
RatingDO[] |
getResourceRatingDO(ResourceImpl resourceImpl)
Method to get ratings added by all users to the given resource.
|
ResourceImpl |
getResourceWithMinimumData(String path)
Gets the resource with sufficient data to differentiate it from another resource.
|
void |
moveRatingPaths(ResourceIDImpl source,
ResourceIDImpl target)
Method to move rating paths.
|
void |
moveRatings(ResourceIDImpl source,
ResourceIDImpl target)
Method to move ratings.
|
void |
removeRating(ResourceImpl resourceImpl,
int rateID)
Method to remove rating added to a resource.
|
void |
removeRatings(ResourceImpl resourceImpl)
Method to remove all ratings added to a resource.
|
void |
removeVersionRatings(long version)
Removes all ratings added to the given resource of a given version.
|
void |
updateRating(ResourceImpl resourceImpl,
int rateID,
int rating)
Method to update a rating added to a resource.
|
void addRating(ResourceImpl resourceImpl, String userID, int rating) throws RegistryException
resourceImpl - the resourceuserID - the id of the user who added the rating.rating - the rating to be persisted.RegistryException - if some error occurs while adding a ratingvoid copyRatings(ResourceImpl fromResource, ResourceImpl toResource) throws RegistryException
fromResource - the source resource.toResource - the target resource.RegistryException - if some error occurs while copying ratingsvoid addRatings(ResourceImpl resource, RatingDO[] ratingDOs) throws RegistryException
resource - the resourceratingDOs - the ratings to be persisted.RegistryException - if some error occurs while adding ratingsvoid updateRating(ResourceImpl resourceImpl, int rateID, int rating) throws RegistryException
resourceImpl - the resource.rateID - the rate id.rating - the rating.RegistryException - if some error occurs while updating the rating.int getRateID(ResourceImpl resourceImpl, String userID) throws RegistryException
resourceImpl - the resource.userID - the id of the user who added the rating.RegistryException - if an error occurs while getting the rate id.float getAverageRating(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - the resource.RegistryException - if an error occurs while getting the average rating.RatingDO getRatingDO(ResourceImpl resourceImpl, String userID) throws RegistryException
resourceImpl - the resource.userID - the id of the user who added the rating.RegistryException - if an error occurs while getting the rating.int getRating(ResourceImpl resourceImpl, String userID) throws RegistryException
resourceImpl - the resource.userID - the id of the user who added the rating.RegistryException - if an error occurs while getting the rating.void removeRatings(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - the resource.RegistryException - if some error occurs while removing ratings.void removeRating(ResourceImpl resourceImpl, int rateID) throws RegistryException
resourceImpl - the resource.RegistryException - if some error occurs while removing ratings.RatingDO[] getResourceRatingDO(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - the resource.RegistryException - if an error occurs while getting the rating.String[] getRatedUserNames(ResourceImpl resourceImpl) throws RegistryException
resourceImpl - the resource.RegistryException - if an error occurs while getting the rating.ResourceImpl getResourceWithMinimumData(String path) throws RegistryException
ResourceImpl with the path, name and path identifier
of a resource.path - the path of the resource.RegistryException - if an error occurs while retrieving resource data.void moveRatings(ResourceIDImpl source, ResourceIDImpl target) throws RegistryException
source - the source resource.target - the target resource.RegistryException - if some error occurs while moving ratingsvoid moveRatingPaths(ResourceIDImpl source, ResourceIDImpl target) throws RegistryException
source - the source resource.target - the target resource.RegistryException - if some error occurs while moving rating pathsvoid removeVersionRatings(long version)
throws RegistryException
version - the versionRegistryException - if an error occurred while removing tags.Copyright © 2016 WSO2 Inc. All Rights Reserved.