|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.portal.databook.server.DBCassandraAstyanaxImpl
public final class DBCassandraAstyanaxImpl
Field Summary | |
---|---|
static String |
APP_TIMELINE_FEEDS
|
static String |
COMMENTS
|
static String |
CONNECTIONS
Column Family names |
static String |
FEEDS
|
static String |
LIKES
|
static String |
NOTIFICATIONS
|
static String |
PENDING_CONNECTIONS_CF_NAME
|
static String |
USER_LIKED_FEEDS
|
static String |
USER_MESSAGES_NOTIFICATIONS
|
static String |
USER_NOTIFICATIONS
|
static String |
USER_TIMELINE_FEEDS
|
static String |
VRE_TIMELINE_FEEDS
|
Constructor Summary | |
---|---|
|
DBCassandraAstyanaxImpl()
public constructor, no dropping schema is allowed |
protected |
DBCassandraAstyanaxImpl(boolean dropSchema)
use this constructor carefully from test classes |
Method Summary | |
---|---|
boolean |
addComment(Comment comment)
add a comment to a feed |
boolean |
approveFriendship(String from,
String to)
userid from approves a friendship to userid to |
boolean |
checkUnreadMessagesNotifications(String userid)
|
boolean |
checkUnreadNotifications(String userid)
|
void |
closeConnection()
close the connection to the underlying database |
boolean |
deleteComment(String commentid,
String feedid)
delete a comment |
boolean |
deleteFeed(String feedId)
delete a Feed from the store |
boolean |
denyFriendship(String from,
String to)
userid from denies a friendship to userid to |
boolean |
editComment(Comment comment2Edit)
edit a comment |
List<Comment> |
getAllCommentByFeed(String feedid)
|
List<Feed> |
getAllFeedsByApp(String appid)
|
List<Feed> |
getAllFeedsByUser(String userid)
|
List<Feed> |
getAllFeedsByVRE(String vreid)
|
List<String> |
getAllLikedFeedIdsByUser(String userid)
|
List<Like> |
getAllLikesByFeed(String feedid)
|
List<Notification> |
getAllNotificationByUser(String userid,
int limit)
|
List<Feed> |
getAllPortalPrivacyLevelFeeds()
return all the feeds whose Level is PORTAL |
List<String> |
getFriends(String userid)
|
List<String> |
getPendingFriendRequests(String userid)
|
List<Feed> |
getRecentFeedsByUser(String userid,
int quantity)
return the most recent feeds for this user up to quantity param |
List<Feed> |
getRecentFeedsByVRE(String vreid,
int quantity)
return the most recent feeds for this vre up to quantity param |
List<Notification> |
getUnreadNotificationMessagesByUser(String userid)
return the not yet read notification messages |
List<Notification> |
getUnreadNotificationsByUser(String userid)
return the not yet read notifications (not including messages) |
boolean |
like(Like like)
add a like to a feed |
Feed |
readFeed(String feedid)
read a feed from a given id |
Notification |
readNotification(String notificationid)
read a notification from a given id |
boolean |
requestFriendship(String from,
String to)
userid from requests a friendship to userid to |
boolean |
saveAppFeed(Feed feed)
save a Feed instance in the store |
boolean |
saveFeedToVRETimeline(String feedKey,
String vreid)
save a Feed in the VRES TimeLine in the store |
boolean |
saveNotification(Notification n)
save a Notification instance in the store |
boolean |
saveUserFeed(Feed feed)
save a Feed instance in the store |
boolean |
setNotificationRead(String notificationidToSet)
set an existing Notification instance in the to read |
boolean |
unlike(String likeid,
String feedid)
unlike a feed |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CONNECTIONS
public static final String PENDING_CONNECTIONS_CF_NAME
public static final String NOTIFICATIONS
public static final String FEEDS
public static final String COMMENTS
public static final String LIKES
public static final String VRE_TIMELINE_FEEDS
public static final String USER_TIMELINE_FEEDS
public static final String APP_TIMELINE_FEEDS
public static final String USER_LIKED_FEEDS
public static final String USER_NOTIFICATIONS
public static final String USER_MESSAGES_NOTIFICATIONS
Constructor Detail |
---|
protected DBCassandraAstyanaxImpl(boolean dropSchema)
dropSchema
- set true if you want do drop the current and set up new onepublic DBCassandraAstyanaxImpl()
Method Detail |
---|
public boolean requestFriendship(String from, String to)
requestFriendship
in interface DatabookStore
public boolean approveFriendship(String from, String to)
approveFriendship
in interface DatabookStore
public boolean denyFriendship(String from, String to)
denyFriendship
in interface DatabookStore
public List<String> getFriends(String userid)
getFriends
in interface DatabookStore
userid
- the user id you want to know friends
public List<String> getPendingFriendRequests(String userid)
getPendingFriendRequests
in interface DatabookStore
userid
- the user id you want to know the pending friend requests
public boolean saveUserFeed(Feed feed)
saveUserFeed
in interface DatabookStore
public boolean saveAppFeed(Feed feed)
saveAppFeed
in interface DatabookStore
public boolean saveFeedToVRETimeline(String feedKey, String vreid) throws FeedIDNotFoundException
saveFeedToVRETimeline
in interface DatabookStore
feedKey
- feedKeyvreid
- vre identifier
FeedIDNotFoundException
public Feed readFeed(String feedid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, FeedIDNotFoundException, ColumnNameNotFoundException
readFeed
in interface DatabookStore
PrivacyLevelTypeNotFoundException
FeedTypeNotFoundException
ColumnNameNotFoundException
FeedIDNotFoundException
public boolean deleteFeed(String feedId) throws FeedIDNotFoundException, PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException
deleteFeed
in interface DatabookStore
FeedIDNotFoundException
PrivacyLevelTypeNotFoundException
FeedTypeNotFoundException
ColumnNameNotFoundException
public List<Feed> getAllFeedsByUser(String userid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, FeedIDNotFoundException
getAllFeedsByUser
in interface DatabookStore
userid
- user identifier
return all the feeds belonging to the userid
PrivacyLevelTypeNotFoundException
FeedTypeNotFoundException
ColumnNameNotFoundException
FeedIDNotFoundException
public List<Feed> getAllFeedsByApp(String appid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, FeedIDNotFoundException
getAllFeedsByApp
in interface DatabookStore
appid
- application identifier
return all the feeds belonging to the appid
PrivacyLevelTypeNotFoundException
FeedTypeNotFoundException
ColumnNameNotFoundException
FeedIDNotFoundException
public List<Feed> getAllPortalPrivacyLevelFeeds() throws FeedTypeNotFoundException, ColumnNameNotFoundException, PrivacyLevelTypeNotFoundException
getAllPortalPrivacyLevelFeeds
in interface DatabookStore
ColumnNameNotFoundException
PrivacyLevelTypeNotFoundException
FeedTypeNotFoundException
public List<Feed> getRecentFeedsByUser(String userid, int quantity) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, FeedIDNotFoundException
getRecentFeedsByUser
in interface DatabookStore
userid
- user identifierquantity
- the number of most recent feeds for this user
PrivacyLevelTypeNotFoundException
FeedTypeNotFoundException
ColumnNameNotFoundException
FeedIDNotFoundException
public List<Feed> getAllFeedsByVRE(String vreid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, FeedIDNotFoundException
getAllFeedsByVRE
in interface DatabookStore
vreid
- vre identifier
return all the feeds belonging to the userid
PrivacyLevelTypeNotFoundException
FeedTypeNotFoundException
ColumnNameNotFoundException
FeedIDNotFoundException
public List<Feed> getRecentFeedsByVRE(String vreid, int quantity) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, FeedIDNotFoundException
getRecentFeedsByVRE
in interface DatabookStore
vreid
- VRES identifierquantity
- the number of most recent feeds for this vre
PrivacyLevelTypeNotFoundException
FeedTypeNotFoundException
ColumnNameNotFoundException
FeedIDNotFoundException
public boolean saveNotification(Notification n)
saveNotification
in interface DatabookStore
public Notification readNotification(String notificationid) throws NotificationIDNotFoundException, NotificationTypeNotFoundException, ColumnNameNotFoundException
readNotification
in interface DatabookStore
NotificationIDNotFoundException
NotificationTypeNotFoundException
ColumnNameNotFoundException
public boolean setNotificationRead(String notificationidToSet) throws NotificationIDNotFoundException, NotificationTypeNotFoundException, ColumnNameNotFoundException
setNotificationRead
in interface DatabookStore
NotificationIDNotFoundException
NotificationTypeNotFoundException
ColumnNameNotFoundException
public List<Notification> getAllNotificationByUser(String userid, int limit) throws NotificationTypeNotFoundException, ColumnNameNotFoundException, NotificationIDNotFoundException
getAllNotificationByUser
in interface DatabookStore
userid
- user identifierlimit
- set 0 to get everything, an int to get the most -limit- notifications
return all the notifications belonging to the userid up to limit, set 0 to get everything
NotificationTypeNotFoundException
ColumnNameNotFoundException
NotificationIDNotFoundException
public List<Notification> getUnreadNotificationsByUser(String userid) throws NotificationTypeNotFoundException, ColumnNameNotFoundException, NotificationIDNotFoundException
getUnreadNotificationsByUser
in interface DatabookStore
userid
- user identifier
NotificationTypeNotFoundException
ColumnNameNotFoundException
NotificationIDNotFoundException
public List<Notification> getUnreadNotificationMessagesByUser(String userid) throws NotificationTypeNotFoundException, ColumnNameNotFoundException, NotificationIDNotFoundException
getUnreadNotificationMessagesByUser
in interface DatabookStore
userid
- user identifier
NotificationTypeNotFoundException
ColumnNameNotFoundException
NotificationIDNotFoundException
public boolean checkUnreadNotifications(String userid) throws NotificationIDNotFoundException, NotificationTypeNotFoundException, ColumnNameNotFoundException
checkUnreadNotifications
in interface DatabookStore
userid
- user identifier
NotificationIDNotFoundException
NotificationTypeNotFoundException
ColumnNameNotFoundException
public boolean checkUnreadMessagesNotifications(String userid) throws NotificationIDNotFoundException, NotificationTypeNotFoundException, ColumnNameNotFoundException
checkUnreadMessagesNotifications
in interface DatabookStore
userid
- user identifier
NotificationIDNotFoundException
NotificationTypeNotFoundException
ColumnNameNotFoundException
public boolean addComment(Comment comment) throws FeedIDNotFoundException
addComment
in interface DatabookStore
comment
- the Comment instance to add
FeedIDNotFoundException
public List<Comment> getAllCommentByFeed(String feedid)
getAllCommentByFeed
in interface DatabookStore
feedid
- feed identifier
return all the comments belonging to the feedidpublic boolean editComment(Comment comment2Edit) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, CommentIDNotFoundException, FeedIDNotFoundException
editComment
in interface DatabookStore
PrivacyLevelTypeNotFoundException
FeedTypeNotFoundException
ColumnNameNotFoundException
CommentIDNotFoundException
FeedIDNotFoundException
public boolean deleteComment(String commentid, String feedid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, CommentIDNotFoundException, FeedIDNotFoundException
deleteComment
in interface DatabookStore
commentid
- the comment identifier to delete
PrivacyLevelTypeNotFoundException
FeedTypeNotFoundException
ColumnNameNotFoundException
CommentIDNotFoundException
FeedIDNotFoundException
public boolean like(Like like) throws FeedIDNotFoundException
like
in interface DatabookStore
FeedIDNotFoundException
public boolean unlike(String likeid, String feedid) throws PrivacyLevelTypeNotFoundException, FeedTypeNotFoundException, ColumnNameNotFoundException, LikeIDNotFoundException, FeedIDNotFoundException
unlike
in interface DatabookStore
likeid
- the like identifier to delete
PrivacyLevelTypeNotFoundException
FeedTypeNotFoundException
ColumnNameNotFoundException
LikeIDNotFoundException
FeedIDNotFoundException
public List<String> getAllLikedFeedIdsByUser(String userid)
getAllLikedFeedIdsByUser
in interface DatabookStore
userid
- user identifier
return all the feedids a user has likedpublic List<Like> getAllLikesByFeed(String feedid)
getAllLikesByFeed
in interface DatabookStore
feedid
- feed identifier
return all the likes belonging to the feedidpublic void closeConnection()
closeConnection
in interface DatabookStore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |