edu.pdx.cs399J.family
Interface RemoteFamilyTree

All Superinterfaces:
Remote
All Known Implementing Classes:
XmlRemoteFamilyTree

public interface RemoteFamilyTree
extends Remote

This interface specifies a factory that is responsible for creating, storing and querying Person objects.


Method Summary
 RemoteMarriage createMarriage(int husbandId, int wifeId)
          Creates a new marriage between two people
 RemotePerson createPerson(Person.Gender gender)
          Creates a new Person of a given gender
 Collection<RemotePerson> getLiving()
          Returns the people in the family tree that are living (i.e. have a date of birth, but no date of death)
 Collection<RemotePerson> getLiving(Date date)
          Returns the people in the family tree were alive at a certain time
 RemoteMarriage getMarriage(int husbandId, int wifeId)
          Returns the marriage between two people.
 RemotePerson getPerson(int id)
          Gets the person with the given id.
 RemotePerson getPerson(String firstName, String lastName)
          Gets the person with the given first and last name.
 void shutdown()
          Shuts down this PersonFactory.
 

Method Detail

createPerson

RemotePerson createPerson(Person.Gender gender)
                          throws RemoteException
Creates a new Person of a given gender

Throws:
FamilyTreeException - If gender is neither Person.MALE nor Person.FEMALE.
RemoteException

getPerson

RemotePerson getPerson(int id)
                       throws RemoteException
Gets the person with the given id. If no person with that id exists, then null is returned.

Throws:
RemoteException

getPerson

RemotePerson getPerson(String firstName,
                       String lastName)
                       throws RemoteException
Gets the person with the given first and last name. If no person with that name is found, then null is returned.

Throws:
IllegalArgumentException - If more than one person in the family tree has that name.
RemoteException

shutdown

void shutdown()
              throws IOException,
                     RemoteException
Shuts down this PersonFactory. Modified Persons are written to persistent storage as appropriate.

Throws:
IOException
RemoteException

getMarriage

RemoteMarriage getMarriage(int husbandId,
                           int wifeId)
                           throws RemoteException
Returns the marriage between two people. If the two people have never been married, then null is returned.

Throws:
IllegalArgumentException - If no person with husbandId or no person with wifeId exists in the family tree
RemoteException

createMarriage

RemoteMarriage createMarriage(int husbandId,
                              int wifeId)
                              throws RemoteException
Creates a new marriage between two people

Throws:
IllegalArgumentException - If no person with husbandId or no person with wifeId exists in the family tree or if either spouse does not have the proper gender.
RemoteException

getLiving

Collection<RemotePerson> getLiving()
                                   throws RemoteException
Returns the people in the family tree that are living (i.e. have a date of birth, but no date of death)

Throws:
RemoteException

getLiving

Collection<RemotePerson> getLiving(Date date)
                                   throws RemoteException
Returns the people in the family tree were alive at a certain time

Throws:
RemoteException


Copyright © 2000-2009 Portland State University. All Rights Reserved.