org.strutsme.wishlist.client.adapter
Interface WishAdapter

All Known Implementing Classes:
WishOnlineAdapter

public interface WishAdapter

Author:
lbusmann This interface defines the access to a layer, which is aware the state of the wishes.

Method Summary
 void deleteWish(java.lang.String wishKey)
          deletes the wish with the key wishKey.
 SafeHashtable getErrors()
          gets errormessages from the last action.
 java.lang.String getLastAction()
          gets the last executed forward of the webserver.
 WishDtoImpl getLoadedWish()
           
 UserDtoImpl getLoadedWishAuthor()
           
 java.util.Vector getLoadedWishes()
          gets the loaded wishes, if the last action performed by the adapter was a listWishAction.
 SafeHashtable getMessages()
          gets information about the last action.
 void loadWish(java.lang.String wishKey)
          loads the wish and the author of the wish.
 void loadWishes()
          gets the wishlist.
 void login(java.lang.String username, java.lang.String password)
          performs the login to the server.
 void saveWish(WishDtoImpl wish)
          saves the wish.
 

Method Detail

login

void login(java.lang.String username,
           java.lang.String password)
           throws AdapterException
performs the login to the server.

Parameters:
username - the username of the user
password - the password of the user
Throws:
AdapterException - if the login could not be performed correctly

loadWishes

void loadWishes()
                throws AdapterException
gets the wishlist.

Throws:
AdapterException - if the wishes couldn't be retrieved

getLoadedWishes

java.util.Vector getLoadedWishes()
gets the loaded wishes, if the last action performed by the adapter was a listWishAction.

Returns:
the wishes

saveWish

void saveWish(WishDtoImpl wish)
              throws AdapterException
saves the wish.

Parameters:
wish - the wish to save
Throws:
AdapterException - if the wish could not be saved

deleteWish

void deleteWish(java.lang.String wishKey)
                throws AdapterException
deletes the wish with the key wishKey.

Parameters:
wishKey - the key of the wish to delete
Throws:
AdapterException - if the wish could not be deleted

getLastAction

java.lang.String getLastAction()
gets the last executed forward of the webserver.

Returns:
the last executed forward of the webserver

loadWish

void loadWish(java.lang.String wishKey)
              throws AdapterException
loads the wish and the author of the wish. If wishKey is null, a new Wish is created.

Parameters:
wishKey - the key of the wish to load
Throws:
AdapterException - if the wish could not be loaded
See Also:
getLoadedWish(), getLoadedWishAuthor()

getLoadedWish

WishDtoImpl getLoadedWish()
                          throws AdapterException
Returns:
the previously loaded wish
Throws:
AdapterException - if the wish could not be loaded
See Also:
loadWish(String)

getLoadedWishAuthor

UserDtoImpl getLoadedWishAuthor()
                                throws AdapterException
Returns:
the previously loaded wishauthor
Throws:
AdapterException - if the wish could not be loaded
See Also:
loadWish(String)

getMessages

SafeHashtable getMessages()
gets information about the last action. The values are from type String.

Returns:
the messages of the last action, or null if the last action didn't produce any message

getErrors

SafeHashtable getErrors()
gets errormessages from the last action. The values are from type String.

Returns:
the errormessages of the last action, or null if the last action didn't produce any message