/**
 * Remote PIMCollection wrapper class
 * basically a pass-through class.
 * we can't avoid this since each remote method must
 * throw RemoteException (and the methods in
 * PIMCollection don't do this).
 *
 */

import java.util.*;
import java.rmi.*;
import java.rmi.server.*;

class RemotePIMCollectionImpl extends UnicastRemoteObject implements RemotePIMCollection {
    PIMCollection p;

    RemotePIMCollectionImpl() throws RemoteException {
	super();
	p = new PIMCollection();
    }

    RemotePIMCollectionImpl(PIMCollection initial) throws RemoteException {
	super();
	p = initial;
    }

    public PIMCollection getNotes() throws RemoteException {
	PIMCollection pc = new PIMCollection();
	pc.addAll(p.getNotes());
	return pc;
    }

    public PIMCollection getNotes(String owner) throws RemoteException {
	PIMCollection pc = new PIMCollection();
	pc.addAll(p.getNotes(owner));
	return pc;
    }

    public PIMCollection getTodos() throws RemoteException {
	PIMCollection pc = new PIMCollection();
	pc.addAll(p.getTodos()); 
	return pc;
    }

    public PIMCollection getTodos(String owner) throws RemoteException {
	PIMCollection pc = new PIMCollection();
	pc.addAll( p.getTodos(owner));
	return pc;
    }

    public PIMCollection getAppointments() throws RemoteException {
	PIMCollection pc = new PIMCollection();
	pc.addAll( p.getAppointments());
	return pc;
    }

    public PIMCollection getAppointments(String owner) throws RemoteException {
	PIMCollection pc = new PIMCollection();
	pc.addAll( p.getAppointments( owner));
	return pc;
    }

    public PIMCollection getContacts() throws RemoteException {
	PIMCollection pc = new PIMCollection();
	pc.addAll( p.getContacts());
	return pc;
    }

    public PIMCollection getContacts(String owner) throws RemoteException {
	PIMCollection pc = new PIMCollection();
	pc.addAll( p.getContacts( owner));
	return pc;
    }

    public PIMCollection getItemsForDate(Date d) throws RemoteException {
	return p.getItemsForDate(d);
    }

    public PIMCollection getItemsForDate(Date d, String owner) throws RemoteException {
	return p.getItemsForDate(d,owner);
    }

    public PIMCollection getAll() throws RemoteException {
	return p.getAll();
    }

    public PIMCollection getAllByOwner(String owner) throws RemoteException {
	return p.getAllByOwner( owner);
    }

    public boolean add(PIMEntity e) {
	return p.add(e);
    }
}





