@ThreadSafe public class FavoriteManager extends AbstractPhotonWALDAO<Favorite>
Favorite objects.| Constructor and Description |
|---|
FavoriteManager(String sFilename) |
| Modifier and Type | Method and Description |
|---|---|
IFavorite |
addFavorite(String sUserID,
String sApplicationID,
String sMenuItemID,
String sDisplayName,
Map<String,String> aAdditionalParams)
Create a new favorite object.
|
boolean |
containsFavoritesOfUser(String sUserID)
Check if the specified user ID is contained or not.
|
protected com.helger.xml.microdom.IMicroDocument |
createWriteData() |
com.helger.commons.collection.impl.ICommonsList<IFavorite> |
getAllFavoritesOfUser(String sUserID) |
IFavorite |
getFavorite(String sUserID,
String sApplicationID,
String sMenuItemID,
com.helger.commons.collection.impl.ICommonsMap<String,String> aAdditionalParams)
Get the favorite of the specified user ID
|
long |
getSize() |
boolean |
isEmpty() |
boolean |
isFavorite(String sUserID,
String sApplicationID,
String sMenuItemID,
com.helger.commons.collection.impl.ICommonsMap<String,String> aAdditionalParams)
Get a list favorites of the specified user ID
|
boolean |
isReloadable() |
protected com.helger.commons.state.EChange |
onRead(com.helger.xml.microdom.IMicroDocument aDoc) |
protected void |
onRecoveryCreate(Favorite aElement) |
protected void |
onRecoveryDelete(Favorite aElement) |
protected void |
onRecoveryUpdate(Favorite aElement) |
void |
reload() |
com.helger.commons.state.EChange |
removeAllFavoritesOfUser(String sUserID)
Remove all contained favorites objects of an user.
|
com.helger.commons.state.EChange |
removeFavorite(String sUserID,
String sID)
Remove the favorites with the specified ID.
|
String |
toString() |
com.helger.commons.state.EChange |
updateFavorite(String sUserID,
String sID,
String sDisplayName)
Update an existing favorite object.
|
convertNativeToWALString, convertWALStringToNative, getDataTypeClass, getFilenameProvider, getInitCount, getIO, getLastFilename, getLastInitDateTime, getLastReadDateTime, getLastWriteDateTime, getReadCount, getSafeFile, getWaitingTime, getWALXMLWriterSettings, getWriteCount, getXMLWriterSettings, initialRead, markAsChanged, markAsChanged, modifyWriteData, onBetweenReadAndWAL, onFilenameChange, onInit, setWaitingTime, triggerExceptionHandlersRead, triggerExceptionHandlersWrite, writeToFileOnPendingChangesbeginWithoutAutoSave, endWithoutAutoSave, exceptionHandlersRead, exceptionHandlersWrite, hasPendingChanges, internalHasPendingChanges, internalIsAutoSaveEnabled, internalSetPendingChanges, isAutoSaveEnabled, isDebugLoggingprotected void onRecoveryCreate(@Nonnull Favorite aElement)
onRecoveryCreate in class com.helger.dao.wal.AbstractWALDAO<Favorite>protected void onRecoveryUpdate(@Nonnull Favorite aElement)
onRecoveryUpdate in class com.helger.dao.wal.AbstractWALDAO<Favorite>protected void onRecoveryDelete(@Nonnull Favorite aElement)
onRecoveryDelete in class com.helger.dao.wal.AbstractWALDAO<Favorite>@Nonnull protected com.helger.commons.state.EChange onRead(@Nonnull com.helger.xml.microdom.IMicroDocument aDoc)
onRead in class com.helger.dao.wal.AbstractWALDAO<Favorite>@Nonnull protected com.helger.xml.microdom.IMicroDocument createWriteData()
createWriteData in class com.helger.dao.wal.AbstractWALDAO<Favorite>public boolean isReloadable()
public void reload()
throws com.helger.dao.DAOException
com.helger.dao.DAOException@Nonnegative public long getSize()
public boolean isEmpty()
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<IFavorite> getAllFavoritesOfUser(@Nullable String sUserID)
sUserID - The ID of the user.null but maybe empty.public boolean containsFavoritesOfUser(@Nullable String sUserID)
sUserID - The UserID to check. May be null.true if the passed ID is containedpublic boolean isFavorite(@Nullable String sUserID, @Nullable String sApplicationID, @Nullable String sMenuItemID, @Nullable com.helger.commons.collection.impl.ICommonsMap<String,String> aAdditionalParams)
sUserID - The ID of the user.sApplicationID - The application ID to compare to.sMenuItemID - Menu item IDaAdditionalParams - Additional params. May be null.null if no such settings are contained.@Nullable public IFavorite getFavorite(@Nullable String sUserID, @Nullable String sApplicationID, @Nullable String sMenuItemID, @Nullable com.helger.commons.collection.impl.ICommonsMap<String,String> aAdditionalParams)
sUserID - The ID of the user.sApplicationID - The application ID to compare to.sMenuItemID - Menu item IDaAdditionalParams - Additional params. May be null.null if no such settings are contained.@Nonnull public IFavorite addFavorite(@Nonnull @Nonempty String sUserID, @Nonnull @Nonempty String sApplicationID, @Nonnull @Nonempty String sMenuItemID, @Nonnull @Nonempty String sDisplayName, @Nullable Map<String,String> aAdditionalParams)
sUserID - The ID of the user. May neither be null nor empty.sApplicationID - The application ID. May neither be null nor empty.sMenuItemID - Menu item ID. May neither be null nor empty.sDisplayName - Display name of the favorite. May neither be null nor
empty.aAdditionalParams - Additional params. May be null.IFavorite object and never null.@Nullable public com.helger.commons.state.EChange updateFavorite(@Nullable String sUserID, @Nullable String sID, @Nullable String sDisplayName)
sUserID - The ID of the user of the favorite object to be updated.sID - The ID of the favorite object to be updated.sDisplayName - The display name to change.EChange.CHANGED if something was changed.@Nullable public com.helger.commons.state.EChange removeFavorite(@Nullable String sUserID, @Nullable String sID)
sUserID - The ID of the user of the favorite object to be updated.sID - The ID of the favorite object to be updated.EChange.CHANGED if a removal was performed.@Nullable public com.helger.commons.state.EChange removeAllFavoritesOfUser(@Nullable String sUserID)
sUserID - The ID of the user of the favorite objects to be updated.EChange.CHANGED if a removal was performed.Copyright © 2014–2018 Philip Helger. All rights reserved.