|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.strutsme.wishlist.persistence.facade.AbstractWishlistPersistenceFacade
public abstract class AbstractWishlistPersistenceFacade
| Field Summary | |
|---|---|
protected int |
count
Counter for create wishes. |
protected java.util.Map |
users
Map of users. |
protected java.util.Map |
wishes
Map of wishes. |
| Constructor Summary | |
|---|---|
AbstractWishlistPersistenceFacade()
The constructor also loads the data or initilized it with some dummy data. |
|
| Method Summary | |
|---|---|
protected void |
addDummyWishes()
Add a certain amount of distinct dummy wishes. |
WishDto |
createWish()
Creates a new wish. |
void |
deleteWish(java.lang.String wishId)
Deletes an wish with this id. |
protected UserDto |
getDefaultUser()
Gets the default user. |
UserDto |
getUserById(java.lang.String userId)
Returns the user with this id. |
UserDto |
getUserByName(java.lang.String userName)
Returns a user with this name. |
WishDto |
getWishById(java.lang.String wishId)
Returns the wish with this id. |
java.util.List |
getWishes()
Returns all wishes. |
protected abstract void |
load()
Should load the data and update the instance variables. |
java.lang.String |
saveWish(WishDto wish)
Saves an wish. |
protected abstract void |
stateChanged()
Called if the state changed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int count
protected java.util.Map wishes
protected java.util.Map users
| Constructor Detail |
|---|
public AbstractWishlistPersistenceFacade()
throws java.io.IOException,
java.lang.ClassNotFoundException
java.lang.ClassNotFoundException - if the wishes couldn't be loaded
java.io.IOException - if the wishes couldn't be loaded| Method Detail |
|---|
protected abstract void load()
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOException - if the wishes couldn't be loaded
java.lang.ClassNotFoundException - if the wishes couldn't be loadedpublic final UserDto getUserById(java.lang.String userId)
getUserById in interface WishlistPersistenceFacadeuserId - the id of user.
public final UserDto getUserByName(java.lang.String userName)
getUserByName in interface WishlistPersistenceFacadeuserName - the name of user
public final WishDto createWish()
createWish in interface WishlistPersistenceFacade
public final java.lang.String saveWish(WishDto wish)
throws java.io.IOException
saveWish in interface WishlistPersistenceFacadewish - the wish to save.
java.io.IOException - if the wish can't be saved.
protected abstract void stateChanged()
throws java.io.IOException
java.io.IOException - if for example the saving failed.
public final WishDto getWishById(java.lang.String wishId)
throws java.io.IOException
getWishById in interface WishlistPersistenceFacadewishId - the id of the wish.
java.io.IOException - if the wish can't be accessed.
public final java.util.List getWishes()
throws java.io.IOException
getWishes in interface WishlistPersistenceFacadejava.io.IOException - if the wishes couldn't be loaded.
public final void deleteWish(java.lang.String wishId)
throws java.io.IOException
deleteWish in interface WishlistPersistenceFacadewishId - the id of the wish to delete.
java.io.IOException - if the wish can't be deleted.protected final UserDto getDefaultUser()
protected final void addDummyWishes()
throws java.io.IOException
java.io.IOException - if the wishes couldn't be saved.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||