com.atlassian.confluence.user
Class DefaultPersonalInformationManager

java.lang.Object
  extended by com.atlassian.confluence.core.DefaultContentEntityManager
      extended by com.atlassian.confluence.user.DefaultPersonalInformationManager
All Implemented Interfaces:
ContentEntityManager, ContentEntityManagerInternal, PersonalInformationManager

public class DefaultPersonalInformationManager
extends DefaultContentEntityManager
implements PersonalInformationManager


Field Summary
 
Fields inherited from class com.atlassian.confluence.core.DefaultContentEntityManager
attachmentManager, contentEntityObjectDao, eventManager, hibernateSessionManager, indexer, labelManager, linkManager
 
Fields inherited from interface com.atlassian.confluence.core.ContentEntityManager
ITERATE_ALL
 
Constructor Summary
DefaultPersonalInformationManager()
           
 
Method Summary
 PersonalInformation createPersonalInformation(com.atlassian.user.User user)
          Creates a new PersonalInformation for the specified user.
 PersonalInformation getOrCreatePersonalInformation(com.atlassian.user.User user)
          This operation needs to be atomic to avoid a race condition with duplicate PersonalInformation objects being created (CONF-10234)
 PersonalInformation getPersonalInformation(com.atlassian.user.User user)
          Retrieve the personal information for a user.
 boolean hasPersonalInformation(java.lang.String username)
           
protected  void publishCreateEvent(ContentEntityObject obj)
          This method publishes *CreateEventss.
protected  void publishCreateEvent(ContentEntityObject obj, SaveContext saveContext)
           
protected  void publishRemoveEvent(ContentEntityObject obj)
          This method publishes *RemoveEvents.
protected  void publishUpdateEvent(ContentEntityObject obj, ContentEntityObject origObj, SaveContext saveContext)
          This method publishes *UpdateEvents.
 void removePersonalInformation(ConfluenceUser user)
           
 void removePersonalInformation(java.lang.String username)
          Deprecated. 
 void savePersonalInformation(PersonalInformation newInfo, PersonalInformation oldInfo)
          Saves personal information object.
 void savePersonalInformation(com.atlassian.user.User user, java.lang.String newInfoString, java.lang.String fullName)
          Saves personal information and full name against the user object.
 void setPersonalInformationDao(PersonalInformationDao personalInformationDao)
           
 
Methods inherited from class com.atlassian.confluence.core.DefaultContentEntityManager
getBodyContentForRevert, getById, getById, getEventManager, getNextVersion, getOtherVersion, getPageDao, getPreviousVersion, getRecentlyAddedEntities, getRecentlyModifiedEntities, getRecentlyModifiedEntitiesForUser, getRecentlyModifiedForChangeDigest, getVersionHistorySummaries, refreshContentEntity, removeContentEntity, removeHistoricalVersion, revertContentEntityBackToVersion, saveContentEntity, saveContentEntity, saveNewVersion, saveNewVersion, setAttachmentManager, setContentEntityObjectDao, setEventManager, setHibernateSessionManager, setIndexer, setLabelManager, setLinkManager, suppressNotificationsOnEventIfRequired, updateContentLinkingTo, updateContentLinkingTo, updateOutgoingLinksInContent, updateOutgoingLinksInContent, updateSingleContentLinkinTo, updateSingleContentLinkinTo, updateSingleContentLinkinTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPersonalInformationManager

public DefaultPersonalInformationManager()
Method Detail

getPersonalInformation

public PersonalInformation getPersonalInformation(com.atlassian.user.User user)
Description copied from interface: PersonalInformationManager
Retrieve the personal information for a user. If no personal information exists in the database, one will be created.

Specified by:
getPersonalInformation in interface PersonalInformationManager
Parameters:
user - the user to retrieve personal information for
Returns:
the personal information for that user

getOrCreatePersonalInformation

public PersonalInformation getOrCreatePersonalInformation(com.atlassian.user.User user)
This operation needs to be atomic to avoid a race condition with duplicate PersonalInformation objects being created (CONF-10234)

Specified by:
getOrCreatePersonalInformation in interface PersonalInformationManager
Parameters:
user - the user to retrieve personal information for
Returns:
the personal information for that user

createPersonalInformation

public PersonalInformation createPersonalInformation(com.atlassian.user.User user)
Description copied from interface: PersonalInformationManager
Creates a new PersonalInformation for the specified user. Returns the existing one if it already exists.

Specified by:
createPersonalInformation in interface PersonalInformationManager

savePersonalInformation

public void savePersonalInformation(PersonalInformation newInfo,
                                    PersonalInformation oldInfo)
Description copied from interface: PersonalInformationManager
Saves personal information object.

Specified by:
savePersonalInformation in interface PersonalInformationManager

savePersonalInformation

public void savePersonalInformation(com.atlassian.user.User user,
                                    java.lang.String newInfoString,
                                    java.lang.String fullName)
Description copied from interface: PersonalInformationManager
Saves personal information and full name against the user object. Will only store the new information if either the information or full name has changed.

Specified by:
savePersonalInformation in interface PersonalInformationManager

setPersonalInformationDao

public void setPersonalInformationDao(PersonalInformationDao personalInformationDao)

removePersonalInformation

@Deprecated
public void removePersonalInformation(java.lang.String username)
Deprecated. 

Specified by:
removePersonalInformation in interface PersonalInformationManager

removePersonalInformation

public void removePersonalInformation(ConfluenceUser user)
Specified by:
removePersonalInformation in interface PersonalInformationManager

publishCreateEvent

protected void publishCreateEvent(ContentEntityObject obj)
Description copied from class: DefaultContentEntityManager
This method publishes *CreateEventss. Specific content entity object manager that need to publish those events should override this method.

Overrides:
publishCreateEvent in class DefaultContentEntityManager
Parameters:
obj - the created content entity object

publishCreateEvent

protected void publishCreateEvent(ContentEntityObject obj,
                                  SaveContext saveContext)
Overrides:
publishCreateEvent in class DefaultContentEntityManager

publishUpdateEvent

protected void publishUpdateEvent(ContentEntityObject obj,
                                  ContentEntityObject origObj,
                                  SaveContext saveContext)
Description copied from class: DefaultContentEntityManager
This method publishes *UpdateEvents. Specific content entity object manager that need to publish those events should override this method.

Overrides:
publishUpdateEvent in class DefaultContentEntityManager
Parameters:
obj - the updated content entity object
origObj - the old version of the content entity object, for history purpose
saveContext - the associated SaveContext

publishRemoveEvent

protected void publishRemoveEvent(ContentEntityObject obj)
Description copied from class: DefaultContentEntityManager
This method publishes *RemoveEvents. Specific content entity object manager that need to publish those events should override this method.

Overrides:
publishRemoveEvent in class DefaultContentEntityManager
Parameters:
obj - the removed content entity object

hasPersonalInformation

public boolean hasPersonalInformation(java.lang.String username)
Specified by:
hasPersonalInformation in interface PersonalInformationManager
Returns:
true if a there is a PersonalInformation object corresponding to this user, if this method returns false calls to getPersonalInformation and getOrCreatePersonalInformation will create a new PersonalInformation object for this user


Copyright © 2003-2014 Atlassian. All Rights Reserved.