org.sakaiproject.profile2.dao.impl
Class ProfileDaoImpl

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.sakaiproject.profile2.dao.impl.ProfileDaoImpl
All Implemented Interfaces:
ProfileDao, org.springframework.beans.factory.InitializingBean

public class ProfileDaoImpl
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements ProfileDao

Internal DAO Interface for Profile2

Author:
Steve Swinsburg (steve.swinsburg@gmail.com)

Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Fields inherited from interface org.sakaiproject.profile2.dao.ProfileDao
CONFIRMED, FRIEND_UUID, ID, MESSAGE_ID, OLDEST_STATUS_DATE, QUERY_FIND_SAKAI_PERSONS_BY_INTEREST, QUERY_FIND_SAKAI_PERSONS_BY_INTEREST_AND_BUSINESS_BIO, QUERY_FIND_SAKAI_PERSONS_BY_NAME_OR_EMAIL, QUERY_GET_ALL_SAKAI_PERSON_IDS, QUERY_GET_ALL_SAKAI_PERSON_IDS_COUNT, QUERY_GET_ALL_UNREAD_MESSAGES_COUNT, QUERY_GET_COMPANY_PROFILE, QUERY_GET_COMPANY_PROFILES, QUERY_GET_CONFIRMED_FRIEND_USERIDS_FOR_USER, QUERY_GET_CURRENT_PROFILE_IMAGE_RECORD, QUERY_GET_EXTERNAL_IMAGE_RECORD, QUERY_GET_EXTERNAL_INTEGRATION_INFO, QUERY_GET_FRIEND_RECORD, QUERY_GET_FRIEND_REQUEST, QUERY_GET_FRIEND_REQUESTS_FOR_USER, QUERY_GET_GALLERY_IMAGE_RECORDS, QUERY_GET_GALLERY_IMAGE_RECORDS_COUNT, QUERY_GET_GALLERY_RECORD, QUERY_GET_KUDOS_RECORD, QUERY_GET_LATEST_MESSAGE_IN_THREAD, QUERY_GET_MESSAGE, QUERY_GET_MESSAGE_PARTICIPANT_FOR_MESSAGE_AND_UUID, QUERY_GET_MESSAGE_THREAD, QUERY_GET_MESSAGE_THREADS, QUERY_GET_MESSAGE_THREADS_COUNT, QUERY_GET_MESSAGES_IN_THREAD, QUERY_GET_MESSAGES_IN_THREAD_COUNT, QUERY_GET_OFFICIAL_IMAGE_RECORD, QUERY_GET_PREFERENCES_RECORD, QUERY_GET_PRIVACY_RECORD, QUERY_GET_SAKAI_PERSON, QUERY_GET_SENT_MESSAGES_COUNT, QUERY_GET_SOCIAL_NETWORKING_INFO, QUERY_GET_STATUS_UPDATES_COUNT, QUERY_GET_THREAD_PARTICIPANTS, QUERY_GET_THREADS_WITH_UNREAD_MESSAGES_COUNT, QUERY_GET_USER_STATUS, QUERY_GET_WALL_ITEMS, QUERY_OTHER_PROFILE_IMAGE_RECORDS, SEARCH, THREAD, USER_UUID, UUID
 
Constructor Summary
ProfileDaoImpl()
           
 
Method Summary
 boolean addNewCommentToWallItem(WallItemComment wallItemComment)
          Adds a new wall item comment.
 boolean addNewCompanyProfile(CompanyProfile companyProfile)
          Save a new CompanyProfile record
 boolean addNewConnection(ProfileFriend profileFriend)
          Save a new connection record
 boolean addNewGalleryImage(GalleryImage galleryImage)
          Add a new GalleryImage record
 ProfilePreferences addNewPreferencesRecord(ProfilePreferences prefs)
          Persist a new ProfilePreferences record and return it.
 ProfilePrivacy addNewPrivacyRecord(ProfilePrivacy privacy)
          Add a new ProfilePrivacy record
 boolean addNewProfileImage(ProfileImageUploaded profileImage)
          Add a new profile image record to the database.
 boolean addNewWallItemForUser(String userUuid, WallItem item)
          Adds a wall item for the specified user.
 boolean clearUserStatus(ProfileStatus profileStatus)
          Remove the ProfileStatus record for a user
 List<String> findSakaiPersonsByInterest(String search, boolean includeBusinessBio)
          Get a list of all userIds that match the search criteria in the interest fields.
 List<String> findSakaiPersonsByNameOrEmail(String search)
          Get a list of all userIds that match the search criteria in name or email
 List<String> getAllSakaiPersonIds()
          Get a list of uuids for all users that have a SakaiPerson record
 int getAllSakaiPersonIdsCount()
          Get a total count of all users with SakaiPerson records
 int getAllUnreadMessagesCount(String userId)
          Get a count of all unread messages for a user
 CompanyProfile getCompanyProfile(String userId, long companyProfileId)
          Get the CompanyProfile record for a user and company ID
 List<CompanyProfile> getCompanyProfiles(String userId)
          Get all CompanyProfile records for a user
 List<String> getConfirmedConnectionUserIdsForUser(String userId)
          Get a list of confirmed connections for a given user.
 ProfileFriend getConnectionRecord(String userId, String friendId)
          Get a connection record for a user/friend pair
 ProfileImageUploaded getCurrentProfileImageRecord(String userId)
          Get the current ProfileImage record from the database.
 List<ProfileImageUploaded> getCurrentProfileImageRecords(String userId)
          Get the current ProfileImage records from the database.
 ProfileImageExternal getExternalImageRecordForUser(String userId)
          Get a ProfileImageExternal record for a user
 ExternalIntegrationInfo getExternalIntegrationInfo(String userUuid)
          Get the ExternalIntegrationInfo record for a user
 GalleryImage getGalleryImageRecord(String userId, long imageId)
          Get the GalleryImage record for a user and image ID
 List<GalleryImage> getGalleryImages(String userId)
          Get all GalleryImage records for a user
 int getGalleryImagesCount(String userId)
          Get a count of all gallery images that a user has
 ProfileKudos getKudos(String userUuid)
          Get the kudos record for a user
 Message getLatestMessageInThread(String threadId)
          Get the latest Message in a MessageThread
 Message getMessage(String id)
          Get a Message record
 MessageParticipant getMessageParticipant(String messageId, String userUuid)
          Get a MessageParticipant record for the given message and user id
 List<Message> getMessagesInThread(String threadId)
          Get a list of all Messages in a given thread
 int getMessagesInThreadCount(String threadId)
          Get a count of all Messages in a given thread
 MessageThread getMessageThread(String threadId)
          Get a MessageThread record
 List<MessageThread> getMessageThreads(String userId)
          Get a list of MessageThreads for a user
 int getMessageThreadsCount(String userId)
          Get a count of all message threads for a user
 ProfileImageOfficial getOfficialImageRecordForUser(String userUuid)
          Get the ProfileImageOfficial record from the database for the given user
 List<ProfileImageUploaded> getOtherProfileImageRecords(String userId)
          Get old ProfileImage records from the database.
 ProfileFriend getPendingConnection(String userId, String friendId)
          Get a connection record that is pending
 ProfilePreferences getPreferencesRecordForUser(String userId)
          Get a ProfilePreferences record for the user
 ProfilePrivacy getPrivacyRecord(String userId)
          Get the ProfilePrivacy record for the user
 List<String> getRequestedConnectionUserIdsForUser(String userId)
          Get a list of unconfirmed Friend requests for a given user.
 int getSentMessagesCount(String userId)
          Get a count of all sent messages for a user
 SocialNetworkingInfo getSocialNetworkingInfo(String userId)
          Get a SocialNetworkingInfo record for a user
 int getStatusUpdatesCount(String userId)
          Get a count of all status updates for a user
 List<String> getThreadParticipants(String threadId)
          Get a list of uuids of all perticipants in a thread
 int getThreadsWithUnreadMessagesCount(String userId)
          Get a count of all threads with unread messages for a user
 List<UserProfile> getUserProfiles(int start, int count)
          Get a list of UserProfiles withing the given pageing parameters
 ProfileStatus getUserStatus(String userId, Date oldestDate)
          Get a ProfileStatus record for a user, but only if the date of the record is within the given time
 List<WallItem> getWallItemsForUser(String userUuid)
          Retrieves all wall items for the specified user.
 void init()
           
 boolean removeCompanyProfile(CompanyProfile companyProfile)
          Remove a CompanyProfile record
 boolean removeConnection(ProfileFriend profileFriend)
          Remove a connection record
 boolean removeGalleryImage(GalleryImage galleryImage)
          Remove a GalleryImage record
 boolean removeWallItemFromWall(WallItem item)
          Removes a wall item.
 boolean saveExternalImage(ProfileImageExternal externalImage)
          Save a ProfileImageExternal record
 void saveNewMessage(Message message)
          Save a Message record
 void saveNewMessageParticipant(MessageParticipant participant)
          Save a MessageParticipant record
 void saveNewMessageParticipants(List<MessageParticipant> participants)
          Save a list of MessageParticipants
 void saveNewThread(MessageThread thread)
          Save a MessageThread record
 boolean saveOfficialImageUrl(ProfileImageOfficial officialImage)
          Save the ProfileImageOfficial record the database
 boolean savePreferencesRecord(ProfilePreferences prefs)
          Save a ProfilePreferences record
 boolean saveSocialNetworkingInfo(SocialNetworkingInfo socialNetworkingInfo)
          Save a SocialNetworkingInfo record
 boolean setUserStatus(ProfileStatus profileStatus)
          Set the status for a user
 boolean toggleMessageRead(MessageParticipant participant, boolean read)
          Toggle a Message as being read by the given participant
 boolean updateCompanyProfile(CompanyProfile companyProfile)
          Update a CompanyProfile record
 boolean updateConnection(ProfileFriend profileFriend)
          Update a connection record
 boolean updateExternalIntegrationInfo(ExternalIntegrationInfo info)
          Update a user's ExternalIntegrationInfo record
 boolean updateKudos(ProfileKudos kudos)
          Update a user's kudos record
 boolean updatePrivacyRecord(ProfilePrivacy privacy)
          Update the ProfilePrivacy record
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProfileDaoImpl

public ProfileDaoImpl()
Method Detail

getRequestedConnectionUserIdsForUser

public List<String> getRequestedConnectionUserIdsForUser(String userId)
Get a list of unconfirmed Friend requests for a given user. Uses a native SQL query Returns: (all those where userId is the friend_uuid and confirmed=false)

Specified by:
getRequestedConnectionUserIdsForUser in interface ProfileDao
Parameters:
userId - uuid of the user to retrieve the list of friends for

getConfirmedConnectionUserIdsForUser

public List<String> getConfirmedConnectionUserIdsForUser(String userId)
Get a list of confirmed connections for a given user. Uses a native SQL query so we can use unions Returns: (all those where userId is the user_uuid and confirmed=true) & (all those where user is friend_uuid and confirmed=true) This only returns userIds. If you want a list of Person objects, see getConnectionsForUser()

Specified by:
getConfirmedConnectionUserIdsForUser in interface ProfileDao
Parameters:
userId - uuid of the user to retrieve the list of friends for

findSakaiPersonsByNameOrEmail

public List<String> findSakaiPersonsByNameOrEmail(String search)
Get a list of all userIds that match the search criteria in name or email

Specified by:
findSakaiPersonsByNameOrEmail in interface ProfileDao
Parameters:
search - string to search on
Returns:

findSakaiPersonsByInterest

public List<String> findSakaiPersonsByInterest(String search,
                                               boolean includeBusinessBio)
Get a list of all userIds that match the search criteria in the interest fields.

Specified by:
findSakaiPersonsByInterest in interface ProfileDao
Parameters:
search - string to search on
includeBusinessBio - true if the business biography should also be searched.
Returns:

getCurrentProfileImageRecords

public List<ProfileImageUploaded> getCurrentProfileImageRecords(String userId)
Get the current ProfileImage records from the database. There should only ever be one, but in case things get out of sync this returns all. This method is only used when we are adding a new image as we need to invalidate all of the others If you are just wanting to retrieve the latest image, see getCurrentProfileImageRecord()

Specified by:
getCurrentProfileImageRecords in interface ProfileDao
Parameters:
userId - userId of the user

getCurrentProfileImageRecord

public ProfileImageUploaded getCurrentProfileImageRecord(String userId)
Get the current ProfileImage record from the database. There should only ever be one, but if there are more this will return the latest. This is called when retrieving a profile image for a user. When adding a new image, there is a call to a private method called getCurrentProfileImageRecords() which should invalidate any multiple current images

Specified by:
getCurrentProfileImageRecord in interface ProfileDao
Parameters:
userId - userId of the user

getOtherProfileImageRecords

public List<ProfileImageUploaded> getOtherProfileImageRecords(String userId)
Get old ProfileImage records from the database. TODO: Used for displaying old the profile pictures album

Specified by:
getOtherProfileImageRecords in interface ProfileDao
Parameters:
userId - userId of the user

getConnectionRecord

public ProfileFriend getConnectionRecord(String userId,
                                         String friendId)
Get a connection record for a user/friend pair

This tries both column arrangements, ie user/friend and friend/user

Specified by:
getConnectionRecord in interface ProfileDao
Parameters:
userId - uuid of the user
friendId - uuid of the other user
Returns:

getCompanyProfile

public CompanyProfile getCompanyProfile(String userId,
                                        long companyProfileId)
Get the CompanyProfile record for a user and company ID

Specified by:
getCompanyProfile in interface ProfileDao
Parameters:
userId - uuid of the user
companyProfileId - id of the company
Returns:

getGalleryImageRecord

public GalleryImage getGalleryImageRecord(String userId,
                                          long imageId)
Get the GalleryImage record for a user and image ID

Specified by:
getGalleryImageRecord in interface ProfileDao
Parameters:
userId - uuid of the user
imageId - id of the image
Returns:

getOfficialImageRecordForUser

public ProfileImageOfficial getOfficialImageRecordForUser(String userUuid)
Get the ProfileImageOfficial record from the database for the given user

Specified by:
getOfficialImageRecordForUser in interface ProfileDao
Parameters:
userUuid - uuid of the user
Returns:

addNewConnection

public boolean addNewConnection(ProfileFriend profileFriend)
Save a new connection record

Specified by:
addNewConnection in interface ProfileDao
Parameters:
profileFriend - ProfileFriend record
Returns:

updateConnection

public boolean updateConnection(ProfileFriend profileFriend)
Update a connection record

Specified by:
updateConnection in interface ProfileDao
Parameters:
profileFriend - ProfileFriend record
Returns:

removeConnection

public boolean removeConnection(ProfileFriend profileFriend)
Remove a connection record

Specified by:
removeConnection in interface ProfileDao
Parameters:
profileFriend - ProfileFriend record
Returns:

getPendingConnection

public ProfileFriend getPendingConnection(String userId,
                                          String friendId)
Get a connection record that is pending

Specified by:
getPendingConnection in interface ProfileDao
Parameters:
userId - uuid of the user
friendId - uuid of the friend
Returns:

getUserStatus

public ProfileStatus getUserStatus(String userId,
                                   Date oldestDate)
Get a ProfileStatus record for a user, but only if the date of the record is within the given time

Specified by:
getUserStatus in interface ProfileDao
Parameters:
userId - uuid of the user
oldestDate - oldest date to search until
Returns:

setUserStatus

public boolean setUserStatus(ProfileStatus profileStatus)
Set the status for a user

Specified by:
setUserStatus in interface ProfileDao
Parameters:
profileStatus - ProfileStatus object
Returns:

clearUserStatus

public boolean clearUserStatus(ProfileStatus profileStatus)
Remove the ProfileStatus record for a user

Specified by:
clearUserStatus in interface ProfileDao
Parameters:
profileStatus - ProfileStatus object
Returns:

getStatusUpdatesCount

public int getStatusUpdatesCount(String userId)
Get a count of all status updates for a user

Specified by:
getStatusUpdatesCount in interface ProfileDao
Parameters:
userId - uuid of the user
Returns:

addNewPrivacyRecord

public ProfilePrivacy addNewPrivacyRecord(ProfilePrivacy privacy)
Add a new ProfilePrivacy record

Specified by:
addNewPrivacyRecord in interface ProfileDao
Parameters:
privacy - ProfilePrivacy object
Returns:

getPrivacyRecord

public ProfilePrivacy getPrivacyRecord(String userId)
Get the ProfilePrivacy record for the user

Specified by:
getPrivacyRecord in interface ProfileDao
Parameters:
userId - uuid of the user
Returns:

updatePrivacyRecord

public boolean updatePrivacyRecord(ProfilePrivacy privacy)
Update the ProfilePrivacy record

Specified by:
updatePrivacyRecord in interface ProfileDao
Parameters:
privacy - ProfilePrivacy object
Returns:

addNewCompanyProfile

public boolean addNewCompanyProfile(CompanyProfile companyProfile)
Save a new CompanyProfile record

Specified by:
addNewCompanyProfile in interface ProfileDao
Parameters:
companyProfile - CompanyProfile record
Returns:

updateCompanyProfile

public boolean updateCompanyProfile(CompanyProfile companyProfile)
Update a CompanyProfile record

Specified by:
updateCompanyProfile in interface ProfileDao
Parameters:
companyProfile - CompanyProfile record
Returns:

getCompanyProfiles

public List<CompanyProfile> getCompanyProfiles(String userId)
Get all CompanyProfile records for a user

Specified by:
getCompanyProfiles in interface ProfileDao
Parameters:
userId - uuid of the user
Returns:

removeCompanyProfile

public boolean removeCompanyProfile(CompanyProfile companyProfile)
Remove a CompanyProfile record

Specified by:
removeCompanyProfile in interface ProfileDao
Parameters:
companyProfile - CompanyProfile record
Returns:

addNewGalleryImage

public boolean addNewGalleryImage(GalleryImage galleryImage)
Add a new GalleryImage record

Specified by:
addNewGalleryImage in interface ProfileDao
Parameters:
galleryImage - GalleryImage record
Returns:

getGalleryImages

public List<GalleryImage> getGalleryImages(String userId)
Get all GalleryImage records for a user

Specified by:
getGalleryImages in interface ProfileDao
Parameters:
userId - uuid of the user
Returns:

removeGalleryImage

public boolean removeGalleryImage(GalleryImage galleryImage)
Remove a GalleryImage record

Specified by:
removeGalleryImage in interface ProfileDao
Parameters:
galleryImage - GalleryImage record
Returns:

getGalleryImagesCount

public int getGalleryImagesCount(String userId)
Get a count of all gallery images that a user has

Specified by:
getGalleryImagesCount in interface ProfileDao
Parameters:
userId - uuid of the user
Returns:

getSocialNetworkingInfo

public SocialNetworkingInfo getSocialNetworkingInfo(String userId)
Get a SocialNetworkingInfo record for a user

Specified by:
getSocialNetworkingInfo in interface ProfileDao
Parameters:
userId - uuid of the user
Returns:

saveSocialNetworkingInfo

public boolean saveSocialNetworkingInfo(SocialNetworkingInfo socialNetworkingInfo)
Save a SocialNetworkingInfo record

Specified by:
saveSocialNetworkingInfo in interface ProfileDao
Parameters:
socialNetworkingInfo - SocialNetworkingInfo object
Returns:

addNewProfileImage

public boolean addNewProfileImage(ProfileImageUploaded profileImage)
Add a new profile image record to the database. Invalidates others before it adds itself.

Specified by:
addNewProfileImage in interface ProfileDao
Parameters:
profileImage - ProfileImageUploaded obj

getAllSakaiPersonIds

public List<String> getAllSakaiPersonIds()
Get a list of uuids for all users that have a SakaiPerson record

Specified by:
getAllSakaiPersonIds in interface ProfileDao
Returns:
list of uuids

getAllSakaiPersonIdsCount

public int getAllSakaiPersonIdsCount()
Get a total count of all users with SakaiPerson records

Specified by:
getAllSakaiPersonIdsCount in interface ProfileDao
Returns:
count

getUserProfiles

public List<UserProfile> getUserProfiles(int start,
                                         int count)
Get a list of UserProfiles withing the given pageing parameters

Specified by:
getUserProfiles in interface ProfileDao
Parameters:
start - first record
count - total number of records
Returns:

getExternalImageRecordForUser

public ProfileImageExternal getExternalImageRecordForUser(String userId)
Get a ProfileImageExternal record for a user

Specified by:
getExternalImageRecordForUser in interface ProfileDao
Parameters:
userId - uuid of the user
Returns:

saveExternalImage

public boolean saveExternalImage(ProfileImageExternal externalImage)
Save a ProfileImageExternal record

Specified by:
saveExternalImage in interface ProfileDao
Parameters:
externalImage - ProfileImageExternal record
Returns:

addNewPreferencesRecord

public ProfilePreferences addNewPreferencesRecord(ProfilePreferences prefs)
Persist a new ProfilePreferences record and return it.

Specified by:
addNewPreferencesRecord in interface ProfileDao
Parameters:
prefs - complete ProfilePreferences record

getPreferencesRecordForUser

public ProfilePreferences getPreferencesRecordForUser(String userId)
Get a ProfilePreferences record for the user

Specified by:
getPreferencesRecordForUser in interface ProfileDao
Parameters:
userId - uuid for the user
Returns:

savePreferencesRecord

public boolean savePreferencesRecord(ProfilePreferences prefs)
Save a ProfilePreferences record

Specified by:
savePreferencesRecord in interface ProfileDao
Parameters:
prefs - ProfilePreferences record
Returns:

getAllUnreadMessagesCount

public int getAllUnreadMessagesCount(String userId)
Get a count of all unread messages for a user

Specified by:
getAllUnreadMessagesCount in interface ProfileDao
Parameters:
userId - uuid of the user
Returns:

getThreadsWithUnreadMessagesCount

public int getThreadsWithUnreadMessagesCount(String userId)
Get a count of all threads with unread messages for a user

Specified by:
getThreadsWithUnreadMessagesCount in interface ProfileDao
Parameters:
userId - uuid of the user
Returns:

getMessageThreads

public List<MessageThread> getMessageThreads(String userId)
Get a list of MessageThreads for a user

Specified by:
getMessageThreads in interface ProfileDao
Parameters:
userId - uuid of the user
Returns:

getMessageThreadsCount

public int getMessageThreadsCount(String userId)
Get a count of all message threads for a user

Specified by:
getMessageThreadsCount in interface ProfileDao
Parameters:
userId - uuid of the user
Returns:

getSentMessagesCount

public int getSentMessagesCount(String userId)
Get a count of all sent messages for a user

Specified by:
getSentMessagesCount in interface ProfileDao
Parameters:
userId - uuid of the user
Returns:

getMessagesInThread

public List<Message> getMessagesInThread(String threadId)
Get a list of all Messages in a given thread

Specified by:
getMessagesInThread in interface ProfileDao
Parameters:
threadId - id of the thread
Returns:

getMessagesInThreadCount

public int getMessagesInThreadCount(String threadId)
Get a count of all Messages in a given thread

Specified by:
getMessagesInThreadCount in interface ProfileDao
Parameters:
threadId - id of the thread
Returns:

getMessage

public Message getMessage(String id)
Get a Message record

Specified by:
getMessage in interface ProfileDao
Parameters:
id - uuid of the Message
Returns:

getMessageThread

public MessageThread getMessageThread(String threadId)
Get a MessageThread record

Specified by:
getMessageThread in interface ProfileDao
Parameters:
threadId - id of the thread
Returns:

getLatestMessageInThread

public Message getLatestMessageInThread(String threadId)
Get the latest Message in a MessageThread

Specified by:
getLatestMessageInThread in interface ProfileDao
Parameters:
threadId - id of the thread
Returns:

toggleMessageRead

public boolean toggleMessageRead(MessageParticipant participant,
                                 boolean read)
Toggle a Message as being read by the given participant

Specified by:
toggleMessageRead in interface ProfileDao
Parameters:
participant - MessageParticipant
read - true/false for read/unread
Returns:

getMessageParticipant

public MessageParticipant getMessageParticipant(String messageId,
                                                String userUuid)
Get a MessageParticipant record for the given message and user id

Specified by:
getMessageParticipant in interface ProfileDao
Parameters:
messageId - uuid of the message
userUuid - uuid of the user
Returns:

getThreadParticipants

public List<String> getThreadParticipants(String threadId)
Get a list of uuids of all perticipants in a thread

Specified by:
getThreadParticipants in interface ProfileDao
Parameters:
threadId - id of the thread
Returns:

saveNewThread

public void saveNewThread(MessageThread thread)
Save a MessageThread record

Specified by:
saveNewThread in interface ProfileDao
Parameters:
thread - MessageThread object

saveNewMessage

public void saveNewMessage(Message message)
Save a Message record

Specified by:
saveNewMessage in interface ProfileDao

saveNewMessageParticipant

public void saveNewMessageParticipant(MessageParticipant participant)
Save a MessageParticipant record

Specified by:
saveNewMessageParticipant in interface ProfileDao

saveNewMessageParticipants

public void saveNewMessageParticipants(List<MessageParticipant> participants)
Save a list of MessageParticipants

Specified by:
saveNewMessageParticipants in interface ProfileDao
Parameters:
participants - List of MessageParticipant objects

saveOfficialImageUrl

public boolean saveOfficialImageUrl(ProfileImageOfficial officialImage)
Save the ProfileImageOfficial record the database

Specified by:
saveOfficialImageUrl in interface ProfileDao
Parameters:
officialImage - ProfileImageOfficial object
Returns:

getKudos

public ProfileKudos getKudos(String userUuid)
Get the kudos record for a user

Specified by:
getKudos in interface ProfileDao
Returns:
ProfileKudos record, or null

updateKudos

public boolean updateKudos(ProfileKudos kudos)
Update a user's kudos record

Specified by:
updateKudos in interface ProfileDao
Parameters:
kudos - ProfileKudos for the user
Returns:

getExternalIntegrationInfo

public ExternalIntegrationInfo getExternalIntegrationInfo(String userUuid)
Get the ExternalIntegrationInfo record for a user

Specified by:
getExternalIntegrationInfo in interface ProfileDao
Returns:

updateExternalIntegrationInfo

public boolean updateExternalIntegrationInfo(ExternalIntegrationInfo info)
Update a user's ExternalIntegrationInfo record

Specified by:
updateExternalIntegrationInfo in interface ProfileDao
Parameters:
info - ExternalIntegrationInfo for the user
Returns:

addNewWallItemForUser

public boolean addNewWallItemForUser(String userUuid,
                                     WallItem item)
Adds a wall item for the specified user.

Specified by:
addNewWallItemForUser in interface ProfileDao
Parameters:
userUuid - the user ID.
item - the wall item to add.
Returns:
true on success, false on failure.

removeWallItemFromWall

public boolean removeWallItemFromWall(WallItem item)
Removes a wall item.

Specified by:
removeWallItemFromWall in interface ProfileDao
Parameters:
item - the wall item to remove.
Returns:
true on success, false on failure.

getWallItemsForUser

public List<WallItem> getWallItemsForUser(String userUuid)
Retrieves all wall items for the specified user.

Specified by:
getWallItemsForUser in interface ProfileDao
Parameters:
userUuid - the user ID.
Returns:
the wall items for the specified user.

addNewCommentToWallItem

public boolean addNewCommentToWallItem(WallItemComment wallItemComment)
Adds a new wall item comment.

Specified by:
addNewCommentToWallItem in interface ProfileDao
Parameters:
wallItemComment - the wall item comment to add.
Returns:
true if the add is successful and false if the add fails.

init

public void init()


Copyright © 2008-2012 The Sakai Foundation. All Rights Reserved.