/*
 * Created on 2004-6-29
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package org.huihoo.willow.client;

import java.rmi.RemoteException;

import workflow.live.pm.LiveParticipant;
import workflow.live.store.LiveUserDatabase;
import workflow.services.WorkflowService;
import workflow.store.UserDatabase;
import workflow.wfmc.pm.Participant;

/**
 * @author reic
 *
 * To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
public class LiveUserDatabaseImpl extends LiveRemoteObject implements LiveUserDatabase
{
	private transient WorkflowService workflowService;
	
	public LiveUserDatabaseImpl(WorkflowService workflowService)throws RemoteException
	{
		super();
		this.workflowService=workflowService;	
	}

	public LiveParticipant findParticipant(String username) throws RemoteException
	{
		Participant participant=workflowService.getUserDatabase().findParticipant(username);
		
		if(participant==null)
		{
			return null;
		}
		
		return new LiveParticipant(participant);
	}
	
	public UserDatabase getWrappedObject()
	{
		return workflowService.getUserDatabase();
	}
}
