|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.carbon.registry.core.jdbc.dao.JDBCRatingsDAO
org.wso2.carbon.registry.core.jdbc.dao.JDBCRatingsVersionDAO
public class JDBCRatingsVersionDAO
An extension of JDBCRatingsDAO
implements RatingsDAO
to store ratings on a
JDBC-based database, when versioning for ratings has been enabled.
Field Summary |
---|
Fields inherited from class org.wso2.carbon.registry.core.jdbc.dao.JDBCRatingsDAO |
---|
ADD_RATING_LOCK |
Constructor Summary | |
---|---|
JDBCRatingsVersionDAO(DAOManager daoManager)
Default constructor |
Method Summary | |
---|---|
void |
addRating(ResourceImpl resourceImpl,
java.lang.String userID,
int rating)
Method to persist a rating. |
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. |
java.lang.String[] |
getRatedUserNames(ResourceImpl resourceImpl)
Method to get users who rated the given resource. |
int |
getRateID(ResourceImpl resourceImpl,
java.lang.String userID)
Method to get a id of a rating added to a given resource. |
RatingDO |
getRating(long ratingID)
Method to get a rating corresponding to the given id. |
RatingDO |
getRatingDO(ResourceImpl resourceImpl,
java.lang.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(java.lang.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. |
Methods inherited from class org.wso2.carbon.registry.core.jdbc.dao.JDBCRatingsDAO |
---|
addRatings, getRating, removeRatings, updateRating |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.wso2.carbon.registry.core.dao.RatingsDAO |
---|
addRatings, getRating, removeRatings, updateRating |
Constructor Detail |
---|
public JDBCRatingsVersionDAO(DAOManager daoManager)
daoManager
- instance of the data access object manager.Method Detail |
---|
public void addRating(ResourceImpl resourceImpl, java.lang.String userID, int rating) throws RegistryException
addRating
in interface RatingsDAO
addRating
in class JDBCRatingsDAO
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 ratingpublic void copyRatings(ResourceImpl fromResource, ResourceImpl toResource) throws RegistryException
copyRatings
in interface RatingsDAO
copyRatings
in class JDBCRatingsDAO
fromResource
- the source resource.toResource
- the target resource.
RegistryException
- if some error occurs while copying ratingspublic int getRateID(ResourceImpl resourceImpl, java.lang.String userID) throws RegistryException
getRateID
in interface RatingsDAO
getRateID
in class JDBCRatingsDAO
resourceImpl
- the resource.userID
- the id of the user who added the rating.
RegistryException
- if an error occurs while getting the rate id.public float getAverageRating(ResourceImpl resourceImpl) throws RegistryException
getAverageRating
in interface RatingsDAO
getAverageRating
in class JDBCRatingsDAO
resourceImpl
- the resource.
RegistryException
- if an error occurs while getting the average rating.public RatingDO getRatingDO(ResourceImpl resourceImpl, java.lang.String userID) throws RegistryException
getRatingDO
in interface RatingsDAO
getRatingDO
in class JDBCRatingsDAO
resourceImpl
- the resource.userID
- the id of the user who added the rating.
RegistryException
- if an error occurs while getting the rating.public RatingDO[] getResourceRatingDO(ResourceImpl resourceImpl) throws RegistryException
getResourceRatingDO
in interface RatingsDAO
getResourceRatingDO
in class JDBCRatingsDAO
resourceImpl
- the resource.
RegistryException
- if an error occurs while getting the rating.public java.lang.String[] getRatedUserNames(ResourceImpl resourceImpl) throws RegistryException
getRatedUserNames
in interface RatingsDAO
getRatedUserNames
in class JDBCRatingsDAO
resourceImpl
- the resource.
RegistryException
- if an error occurs while getting the rating.public RatingDO getRating(long ratingID) throws java.sql.SQLException, RegistryException
getRating
in class JDBCRatingsDAO
ratingID
- the id of the rating.
RegistryException
- if an error occurs while getting the resource path.
java.sql.SQLException
- if an error occurs while getting the rating.public ResourceImpl getResourceWithMinimumData(java.lang.String path) throws RegistryException
ResourceImpl
with the path, name and path identifier
of a resource.
getResourceWithMinimumData
in interface RatingsDAO
getResourceWithMinimumData
in class JDBCRatingsDAO
path
- the path of the resource.
RegistryException
- if an error occurs while retrieving resource data.public void moveRatings(ResourceIDImpl source, ResourceIDImpl target) throws RegistryException
moveRatings
in interface RatingsDAO
moveRatings
in class JDBCRatingsDAO
source
- the source resource.target
- the target resource.
RegistryException
- if some error occurs while moving ratingspublic void moveRatingPaths(ResourceIDImpl source, ResourceIDImpl target) throws RegistryException
moveRatingPaths
in interface RatingsDAO
moveRatingPaths
in class JDBCRatingsDAO
source
- the source resource.target
- the target resource.
RegistryException
- if some error occurs while moving rating paths
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |