/*
 * Copyright (c) 2004, ADAPT project partners (IST-2001-37126).
 * 
 * InventoryItemBean.java
 */

package org.eu.adapt.demonstrator.eb.retailer;

import javax.ejb.CreateException;
import javax.ejb.EntityContext;
import javax.ejb.EntityBean;

import org.eu.adapt.demonstrator.util.UniqueIdentifierGenerator;

public abstract class InventoryBean implements EntityBean
{
    public String ejbCreate(WarehouseLocal warehouse, ProductLocal product, int minAmount, int maxAmount)
        throws CreateException
    {
        setNumber(UniqueIdentifierGenerator.createUniqueIdentifier());
        setAmount(0);
        setMinAmount(minAmount);
        setMaxAmount(maxAmount);

        return null;
    }

    public void ejbPostCreate(WarehouseLocal warehouse, ProductLocal product, int minAmount, int maxAmount)
    {
        setWarehouse(warehouse);
        setProduct(product);
    }

    public abstract void setNumber(String number);

    public abstract String getNumber();

    public abstract void setAmount(int amount);

    public abstract int getAmount();

    public abstract void setMinAmount(int minAmount);

    public abstract int getMinAmount();

    public abstract void setMaxAmount(int maxAmount);

    public abstract int getMaxAmount();

    public abstract void setWarehouse(WarehouseLocal warehouse);

    public abstract WarehouseLocal getWarehouse();

    public abstract void setProduct(ProductLocal product);

    public abstract ProductLocal getProduct();

    public void setEntityContext(EntityContext entityContext)
    {
    }

    public void unsetEntityContext()
    {
    }

    public void ejbActivate()
    {
    }

    public void ejbPassivate()
    {
    }

    public void ejbLoad()
    {
    }

    public void ejbStore()
    {
    }    

    public void ejbRemove()
    {
    }
}
