org.olat.note
Class NoteManager

java.lang.Object
  extended by org.olat.core.logging.LogDelegator
      extended by org.olat.note.NoteManager
All Implemented Interfaces:
UserDataDeletable

public class NoteManager
extends LogDelegator
implements UserDataDeletable

Description:

Author:
Alexander Schneider

Method Summary
 void deleteNote(Note n)
          Deletes a note on the database
 void deleteUserData(Identity identity, java.lang.String newDeletedUserName)
          Delete all notes for certain identity.
static NoteManager getInstance()
           
 java.util.List<Note> listUserNotes(Identity owner)
           
 Note loadNoteOrCreateInRAM(Identity owner, java.lang.String resourceTypeName, java.lang.Long resourceTypeId)
           
 void saveNote(Note n)
          Save a note
 void updateNote(Note n)
          Update a note
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static NoteManager getInstance()
Returns:
the singleton

loadNoteOrCreateInRAM

public Note loadNoteOrCreateInRAM(Identity owner,
                                  java.lang.String resourceTypeName,
                                  java.lang.Long resourceTypeId)
Parameters:
owner -
resourceTypeName -
resourceTypeId -
Returns:
a note, either a new one in RAM, or the persisted if found using the params

listUserNotes

public java.util.List<Note> listUserNotes(Identity owner)
Parameters:
owner -
Returns:
a list of notes belonging to the owner

deleteNote

public void deleteNote(Note n)
Deletes a note on the database

Parameters:
n - the note

saveNote

public void saveNote(Note n)
Save a note

Parameters:
n -

updateNote

public void updateNote(Note n)
Update a note

Parameters:
n -

deleteUserData

public void deleteUserData(Identity identity,
                           java.lang.String newDeletedUserName)
Delete all notes for certain identity.

Specified by:
deleteUserData in interface UserDataDeletable
Parameters:
identity - Delete notes for this identity.