Package edu.pdx.cs410J.family
Interface RemoteFamilyTree
- All Superinterfaces:
Remote
- All Known Implementing Classes:
XmlRemoteFamilyTree
This interface specifies a factory that is responsible for creating,
storing and querying
Person objects.-
Method Summary
Modifier and TypeMethodDescriptioncreateMarriage(int husbandId, int wifeId) Creates a new marriage between two peoplecreatePerson(Person.Gender gender) Creates a newPersonof a given genderReturns the people in the family tree that are living (i.e. have a date of birth, but no date of death)Returns the people in the family tree were alive at a certain timegetMarriage(int husbandId, int wifeId) Returns the marriage between two people.getPerson(int id) Gets the person with the given id.Gets the person with the given first and last name.voidshutdown()Shuts down thisPersonFactory.
-
Method Details
-
createPerson
Creates a newPersonof a given gender- Throws:
FamilyTreeException- Ifgenderis neitherPerson.MALEnorPerson.FEMALE.RemoteException
-
getPerson
Gets the person with the given id. If no person with that id exists, thennullis returned.- Throws:
RemoteException
-
getPerson
Gets the person with the given first and last name. If no person with that name is found, thennullis returned.- Throws:
IllegalArgumentException- If more than one person in the family tree has that name.RemoteException
-
shutdown
Shuts down thisPersonFactory. ModifiedPersons are written to persistent storage as appropriate.- Throws:
IOExceptionRemoteException
-
getMarriage
Returns the marriage between two people. If the two people have never been married, thennullis returned.- Throws:
IllegalArgumentException- If no person with husbandId or no person with wifeId exists in the family treeRemoteException
-
createMarriage
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
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
Returns the people in the family tree were alive at a certain time- Throws:
RemoteException
-