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

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

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

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

public abstract class InventoryItemBean implements EntityBean
{
    public String ejbCreate(StorehouseLocal storehouseLocal, FinishedGoodsLocal finishedGoodsLocal, int minAmount, int maxAmount)
        throws CreateException
    {
        setId(UniqueIdentifierGenerator.createUniqueIdentifier());
        setAmountFree(0);
        setAmountAllocated(0);
        setMinAmount(minAmount);
        setMaxAmount(maxAmount);

        return null;
    }

    public void ejbPostCreate(StorehouseLocal storehouse, FinishedGoodsLocal finishedGoods, int minAmount, int maxAmount)
    {
        setStorehouse(storehouse);
        setFinishedGoods(finishedGoods);
    }

    public abstract void setId(String id);

    public abstract String getId();

    public abstract void setAmountFree(int amountFree);

    public abstract int getAmountFree();

    public abstract void setAmountAllocated(int amountAllocated);

    public abstract int getAmountAllocated();

    public abstract void setMinAmount(int minAmount);

    public abstract int getMinAmount();

    public abstract void setMaxAmount(int maxAmount);

    public abstract int getMaxAmount();

    public abstract void setStorehouse(StorehouseLocal storehouse);

    public abstract StorehouseLocal getStorehouse();

    public abstract void setFinishedGoods(FinishedGoodsLocal finishedGoods);

    public abstract FinishedGoodsLocal getFinishedGoods();

    public void setEntityContext(EntityContext entityContext)
    {
    }

    public void unsetEntityContext()
    {
    }

    public void ejbActivate()
    {
    }

    public void ejbPassivate()
    {
    }

    public void ejbLoad()
    {
    }

    public void ejbStore()
    {
    }    

    public void ejbRemove()
    {
    }
}
