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 newPerson
of 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.void
shutdown()
Shuts down thisPersonFactory
.
-
Method Details
-
createPerson
Creates a newPerson
of a given gender- Throws:
FamilyTreeException
- Ifgender
is neitherPerson.MALE
norPerson.FEMALE
.RemoteException
-
getPerson
Gets the person with the given id. If no person with that id exists, thennull
is returned.- Throws:
RemoteException
-
getPerson
Gets the person with the given first and last name. If no person with that name is found, thennull
is returned.- Throws:
IllegalArgumentException
- If more than one person in the family tree has that name.RemoteException
-
shutdown
Shuts down thisPersonFactory
. ModifiedPerson
s are written to persistent storage as appropriate.- Throws:
IOException
RemoteException
-
getMarriage
Returns the marriage between two people. If the two people have never been married, thennull
is 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
-