Package org.sakaiproject.profile2.logic
Interface ProfileConnectionsLogic
-
public interface ProfileConnectionsLogicAn interface for dealing with connections in Profile2- Author:
- Steve Swinsburg (steve.swinsburg@gmail.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanconfirmFriendRequest(String fromUser, String toUser)Confirm friend request from fromUser to toUserBasicConnectiongetBasicConnection(String userUuid)Get a BasicConnectionBasicConnectiongetBasicConnection(org.sakaiproject.user.api.User user)Get a BasicConnectionList<BasicConnection>getBasicConnections(List<org.sakaiproject.user.api.User> users)Get a List of BasicConnections for the given Users.List<BasicConnection>getBasicConnectionsForUser(String userUuid)Gets a list of BasicOnlinePersons that are connected to this userList<org.sakaiproject.user.api.User>getConnectedUsersForUserInsecurely(String userUuid)Gets a list of Persons that are connected to this user.List<Person>getConnectionRequestsForUser(String userId)Gets a list of Persons's that have unconfirmed connection requests to this personintgetConnectionRequestsForUserCount(String userId)Gets a count of the number of unconfirmed incoming connection requestsList<Person>getConnectionsForUser(String userUuid)Gets a list of Persons that are connected to this user. incl prefs and privacyintgetConnectionsForUserCount(String userId)Gets a count of the number of connections a user has.List<Person>getConnectionsSubsetForSearch(List<Person> connections, String search)Gets a subset of the connection list, based on the search string matching the beginning of the displayNameList<Person>getConnectionsSubsetForSearch(List<Person> connections, String search, boolean forMessaging)Gets a subset of the connection list, based on the search string matching the beginning of the displayName, and based on whether that user is allowed to be messaged.intgetConnectionStatus(String userA, String userB)Get the connection status between two users.intgetOnlineStatus(String userUuid)Get the online status for a userMap<String,Integer>getOnlineStatus(List<String> userUuids)Get the online status for a list of usersList<Person>getOutgoingConnectionRequestsForUser(String userId)Gets a list of Persons's that have unconfirmed connection requests from this personbooleanignoreFriendRequest(String fromUser, String toUser)Ignore a friend request from fromUser to toUserbooleanisFriendRequestPending(String fromUser, String toUser)Check if there is a pending request from fromUser to toUserbooleanisUserXFriendOfUserY(String userX, String userY)Is userY a friend of the userX?booleanremoveFriend(String userId, String friendId)Remove a friend connectionbooleanrequestFriend(String userId, String friendId)Make a request for friendId to be a friend of userId
-
-
-
Method Detail
-
getBasicConnectionsForUser
List<BasicConnection> getBasicConnectionsForUser(String userUuid)
Gets a list of BasicOnlinePersons that are connected to this user- Parameters:
userUuid- uuid of the user to retrieve the list of connections for- Returns:
-
getConnectionsForUser
List<Person> getConnectionsForUser(String userUuid)
Gets a list of Persons that are connected to this user. incl prefs and privacy- Parameters:
userUuid- uuid of the user to retrieve the list of connections for- Returns:
-
getConnectedUsersForUserInsecurely
List<org.sakaiproject.user.api.User> getConnectedUsersForUserInsecurely(String userUuid)
Gets a list of Persons that are connected to this user. Current user, prefs and privacy are skipped.- Parameters:
userUuid- uuid of the user to retrieve the list of connections for- Returns:
-
getConnectionsForUserCount
int getConnectionsForUserCount(String userId)
Gets a count of the number of connections a user has.- Parameters:
userId- uuid of the user to retrieve the count for- Returns:
-
getConnectionRequestsForUser
List<Person> getConnectionRequestsForUser(String userId)
Gets a list of Persons's that have unconfirmed connection requests to this person- Parameters:
userId- uuid of the user to retrieve the list of connections for- Returns:
-
getOutgoingConnectionRequestsForUser
List<Person> getOutgoingConnectionRequestsForUser(String userId)
Gets a list of Persons's that have unconfirmed connection requests from this person- Parameters:
userId- the user whose outgoing outgoing connections will be retrieved- Returns:
- A list of Persons who have had a request from the supplied user
-
getConnectionRequestsForUserCount
int getConnectionRequestsForUserCount(String userId)
Gets a count of the number of unconfirmed incoming connection requests- Parameters:
userId- uuid of the user to retrieve the list of connections for- Returns:
-
getConnectionsSubsetForSearch
List<Person> getConnectionsSubsetForSearch(List<Person> connections, String search)
Gets a subset of the connection list, based on the search string matching the beginning of the displayName- Parameters:
connections- list of connectionssearch- search string to match on- Returns:
-
getConnectionsSubsetForSearch
List<Person> getConnectionsSubsetForSearch(List<Person> connections, String search, boolean forMessaging)
Gets a subset of the connection list, based on the search string matching the beginning of the displayName, and based on whether that user is allowed to be messaged.- Parameters:
connections- list of connectionssearch- search string to match onforMessaging- if this request is for messaging, we also check if the user has indicated they can receive messages- Returns:
-
getConnectionStatus
int getConnectionStatus(String userA, String userB)
Get the connection status between two users. The user making the query must be userA.- Parameters:
userA- user making the queryuserB- any other user- Returns:
- int signaling the connection status. See ProfileConstants.
-
requestFriend
boolean requestFriend(String userId, String friendId)
Make a request for friendId to be a friend of userId- Parameters:
userId- uuid of the user making the requestfriendId- uuid of the user that userId wants to be a friend of
-
isFriendRequestPending
boolean isFriendRequestPending(String fromUser, String toUser)
Check if there is a pending request from fromUser to toUser- Parameters:
fromUser- uuid of the user that made the friend requesttoUser- uuid of the user that userId made the request to
-
confirmFriendRequest
boolean confirmFriendRequest(String fromUser, String toUser)
Confirm friend request from fromUser to toUser- Parameters:
fromUser- uuid of the user that made the original friend requesttoUser- uuid of the user that received the friend request Note that fromUser will ALWAYS be the one making the friend request, and toUser will ALWAYS be the one who receives the request.
-
ignoreFriendRequest
boolean ignoreFriendRequest(String fromUser, String toUser)
Ignore a friend request from fromUser to toUser- Parameters:
fromUser- uuid of the user that made the original friend requesttoUser- uuid of the user that received the friend request and wants to ignore it Note that fromUser will ALWAYS be the one that made the friend request, and toUser will ALWAYS be the one who receives the request.
-
removeFriend
boolean removeFriend(String userId, String friendId)
Remove a friend connection- Parameters:
userId- uuid of one useruserId- uuid of the other user Note that they could be in either column
-
isUserXFriendOfUserY
boolean isUserXFriendOfUserY(String userX, String userY)
Is userY a friend of the userX?- Parameters:
userX- the uuid of the user we are queryinguserY- current user uuid- Returns:
- boolean
-
getBasicConnection
BasicConnection getBasicConnection(String userUuid)
Get a BasicConnection- Parameters:
userUuid-- Returns:
-
getBasicConnection
BasicConnection getBasicConnection(org.sakaiproject.user.api.User user)
Get a BasicConnection- Parameters:
user-- Returns:
-
getBasicConnections
List<BasicConnection> getBasicConnections(List<org.sakaiproject.user.api.User> users)
Get a List of BasicConnections for the given Users.- Parameters:
users-- Returns:
-
getOnlineStatus
int getOnlineStatus(String userUuid)
Get the online status for a user- Parameters:
userUuid- user to check- Returns:
- int of status, according to ProfileConstants.ONLINE_STATUS_x
-
-