org.strutsme.wishlist.business
Class WishlistBusinessFacade

java.lang.Object
  extended by org.strutsme.wishlist.business.WishlistBusinessFacade

public final class WishlistBusinessFacade
extends java.lang.Object

The business facade for the wishlist.

Author:
lbusmann

Method Summary
 WishDto createWish()
          Creates a new wish.
 void deleteWish(java.lang.String wishId)
          Deletes an wish.
static WishlistBusinessFacade getInstance()
          Singleton accessor method.
 WishlistPersistenceFacade getPersistenceFacade()
          Getter for persistenceFacade.
 UserDto getUserById(java.lang.String userId)
          Returns a user with this id.
 UserDto getUserByName(java.lang.String userName)
          Returns a user for this username.
 WishDto getWishById(java.lang.String wishId)
          Returns the wish with this id.
 java.util.List getWishes()
          Finds all wishes.
 java.lang.String saveWish(WishDto wish)
          Persists the wish.
 void setPersistenceFacade(WishlistPersistenceFacade aPersistenceFacade)
          Setter for the persistence facade.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPersistenceFacade

public WishlistPersistenceFacade getPersistenceFacade()
                                               throws BusinessException
Getter for persistenceFacade.

Returns:
the persistence facade.
Throws:
BusinessException - if the wishlist facade can't be loaded.

setPersistenceFacade

public void setPersistenceFacade(WishlistPersistenceFacade aPersistenceFacade)
Setter for the persistence facade.

Parameters:
aPersistenceFacade - a new persistenceFacade

getInstance

public static WishlistBusinessFacade getInstance()
Singleton accessor method.

Returns:
a unique instance of this class.

getUserById

public UserDto getUserById(java.lang.String userId)
                    throws BusinessException
Returns a user with this id.

Parameters:
userId - the id of user
Returns:
a user DTO
Throws:
BusinessException - the exception

getUserByName

public UserDto getUserByName(java.lang.String userName)
                      throws BusinessException
Returns a user for this username.

Parameters:
userName - the userName
Returns:
a user dto
Throws:
BusinessException - the exception

createWish

public WishDto createWish()
                   throws BusinessException
Creates a new wish.

Returns:
the new wish
Throws:
BusinessException - the exception

saveWish

public java.lang.String saveWish(WishDto wish)
                          throws BusinessException
Persists the wish.

Parameters:
wish - the wish to save
Returns:
the id of the new saved wish
Throws:
BusinessException - the exception

deleteWish

public void deleteWish(java.lang.String wishId)
                throws BusinessException
Deletes an wish.

Parameters:
wishId - key of the wish to delete
Throws:
BusinessException - the exception

getWishById

public WishDto getWishById(java.lang.String wishId)
                    throws BusinessException
Returns the wish with this id.

Parameters:
wishId - the id of the wish
Returns:
the wish
Throws:
BusinessException - the exception

getWishes

public java.util.List getWishes()
                         throws BusinessException
Finds all wishes.

Returns:
all wishes
Throws:
BusinessException - the exception