Package org.apache.beehive.samples.petstore.controls.exceptions

Examples of org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException


    {
    _sharedFlow.ensureLogin();
 
    String addressId = getRequest().getParameter("addressId");
    if (addressId == null)
      throw new InvalidIdentifierException("AddressId not passed in");
     
    // Will only delete the address if the user owns it
    _addressControl.deleteAddress(Integer.parseInt(addressId), _sharedFlow.getAccount().getUserId());

        return new Forward("success");
View Full Code Here


        Item i = getCatalogBean().getItem(itemId);
        if (i != null) {
            i.setListPrice(listPrice);
        }
        else {
            throw new InvalidIdentifierException
                ("A price cannot be set for a null Item");
        }
    }
View Full Code Here

        throws InvalidIdentifierException, NoSuchAddressException {
    _sharedFlow.ensureLogin();
 
    String addressId = getRequest().getParameter("addressId");
    if (addressId == null)
      throw new InvalidIdentifierException("AddressId not passed in");
     
        // Will only delete the address if the user owns it
    _addressControl.deleteAddress(Integer.parseInt(addressId), _sharedFlow.getAccount().getUserId());

        return new Forward("success");
View Full Code Here

        throws InvalidIdentifierException {

        String workingItemId = lookupCurrentItemId();

        if(workingItemId == null)
            throw new InvalidIdentifierException("Could not find working item identifier");

        Cart cart = lookupCart();
        if (cart.containsItemId(workingItemId))
            cart.incrementQuantityByItemId(workingItemId);
        else {
View Full Code Here

    public void updateAccount(Account account)
        throws InvalidIdentifierException, NoSuchAccountException
    {
        String userId = account.getUserId();
        if (userId == null || userId.length()==0)
            throw new InvalidIdentifierException("cannot update Account with null or empty userId");

        if (!checkAccountExists(userId))
            throw new NoSuchAccountException("no Account found for userId: "+userId);

        doUpdateAccount(account);
View Full Code Here

         throws InvalidIdentifierException, AccountAlreadyExistsException
    {
        String userId = account.getUserId();
        if (userId == null || userId.length() == 0)
        {
            throw new InvalidIdentifierException("cannot insert Account with null userId");
        }

        if (checkAccountExists(userId))
            throw new AccountAlreadyExistsException("attempted to insert Account with duplicate userId: "+userId);
View Full Code Here

  public Address getAddress(int key) throws InvalidIdentifierException
    {
    Address add = new Address();
    add = _addressDao.getAddress(key);
    if (add == null)
      throw new InvalidIdentifierException("Address: " + key + " not found!");

    return add;
    }
View Full Code Here

    {
        String userId = address.getUserId();
    int addressId = address.getAddressId();
   
        if (userId == null || userId.length() == 0 || addressId == -1)
            throw new InvalidIdentifierException("cannot update Address with null or empty userId or addressId of -1");

    if (!_addressDao.checkAddressExists(addressId, userId))
      throw new NoSuchAddressException("no Address found for userId: " + userId + " and addressId " + addressId);
     
    _addressDao.updateAddress(address);
View Full Code Here

    public void insertAddress(Address address) throws InvalidIdentifierException
    {
        String userId = address.getUserId();
        if (userId == null || userId.length() == 0)
            throw new InvalidIdentifierException("cannot insert Address with null userId");

    _addressDao.insertAddress(address);
    }
View Full Code Here

    public void deleteAddress(int addressId, String userId)
      throws InvalidIdentifierException, NoSuchAddressException
  {
        if (userId == null || userId.length() == 0 || addressId == -1)
            throw new InvalidIdentifierException("cannot delete Address with null or empty userId or addressId of -1");

    if (!_addressDao.checkAddressExists(addressId, userId))
      throw new NoSuchAddressException("no Address found for userId: " + userId + " and addressId " + addressId);
     
    _addressDao.deleteAddress(addressId, userId);
View Full Code Here

TOP

Related Classes of org.apache.beehive.samples.petstore.controls.exceptions.InvalidIdentifierException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.