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

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

import java.util.Calendar;
import javax.ejb.CreateException;
import javax.ejb.EntityContext;
import javax.ejb.EntityBean;
import org.eu.adapt.demonstrator.util.UniqueIdentifierGenerator;
import org.eu.adapt.demonstrator.eb.demo.DemoUserLocal;
import org.eu.adapt.demonstrator.eb.demo.RepositoryLocal;

public abstract class LogEventBean implements EntityBean
{
    public String ejbCreate(DemoUserLocal demoUser, RepositoryLocal repository, String serviceId, int eventId, String eventDescription)
        throws CreateException
    {
        setId(UniqueIdentifierGenerator.createUniqueIdentifier());
        setServiceId(serviceId);
        setEventId(eventId);
        setEventDescription(eventDescription);
        setTimestamp(Calendar.getInstance().toString());

        return null;
    }

    public void ejbPostCreate(DemoUserLocal demoUser, RepositoryLocal repository, String serviceId, int eventId, String eventDescription)
    {
        setDemoUser(demoUser);
        setRepository(repository);
    }

    public abstract void setId(String id);

    public abstract String getId();

    public abstract void setServiceId(String serviceId);

    public abstract String getServiceId();

    public abstract void setEventId(int eventId);

    public abstract int getEventId();

    public abstract void setEventDescription(String eventDescription);

    public abstract String getEventDescription();

    public abstract void setTimestamp(String timestamp);

    public abstract String getTimestamp();

    public abstract void setDemoUser(DemoUserLocal demoUser);
    
    public abstract DemoUserLocal getDemoUser();

    public abstract void setRepository(RepositoryLocal repository);

    public abstract RepositoryLocal getRepository();

    public void setEntityContext(EntityContext entityContext)
    {
    }

    public void unsetEntityContext()
    {
    }

    public void ejbActivate()
    {
    }

    public void ejbPassivate()
    {
    }

    public void ejbLoad()
    {
    }

    public void ejbStore()
    {
    }    

    public void ejbRemove()
    {
    }
}
