Package edu.pdx.cs410J.family
Class XmlRemoteFamilyTree
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
edu.pdx.cs410J.family.XmlRemoteFamilyTree
- All Implemented Interfaces:
RemoteFamilyTree
,Serializable
,Remote
This class is a remote family tree whose contents are read from and
saved to an XML file. It extends
UnicastRemoteObject
because it is going to be bound into the RMI registry.- See Also:
-
Field Summary
Fields inherited from class java.rmi.server.RemoteObject
ref
-
Constructor Summary
ConstructorDescriptionXmlRemoteFamilyTree
(File xmlFile) Creates a newXmlRemoteFamilyTree
that gets its data from a given XML file. -
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.static void
void
shutdown()
Shuts down thisPersonFactory
.Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
Constructor Details
-
XmlRemoteFamilyTree
Creates a newXmlRemoteFamilyTree
that gets its data from a given XML file.- Throws:
FamilyTreeException
- A problem occurred while parsing the XML fileRemoteException
IOException
-
-
Method Details
-
createPerson
Description copied from interface:RemoteFamilyTree
Creates a newPerson
of a given gender- Specified by:
createPerson
in interfaceRemoteFamilyTree
- Throws:
RemoteException
-
getPerson
Description copied from interface:RemoteFamilyTree
Gets the person with the given id. If no person with that id exists, thennull
is returned.- Specified by:
getPerson
in interfaceRemoteFamilyTree
- Throws:
RemoteException
-
getPerson
Description copied from interface:RemoteFamilyTree
Gets the person with the given first and last name. If no person with that name is found, thennull
is returned.- Specified by:
getPerson
in interfaceRemoteFamilyTree
- Throws:
RemoteException
-
getMarriage
Description copied from interface:RemoteFamilyTree
Returns the marriage between two people. If the two people have never been married, thennull
is returned.- Specified by:
getMarriage
in interfaceRemoteFamilyTree
- Throws:
RemoteException
-
createMarriage
Description copied from interface:RemoteFamilyTree
Creates a new marriage between two people- Specified by:
createMarriage
in interfaceRemoteFamilyTree
- Throws:
RemoteException
-
getLiving
Description copied from interface:RemoteFamilyTree
Returns the people in the family tree that are living (i.e. have a date of birth, but no date of death)- Specified by:
getLiving
in interfaceRemoteFamilyTree
- Throws:
RemoteException
-
getLiving
Description copied from interface:RemoteFamilyTree
Returns the people in the family tree were alive at a certain time- Specified by:
getLiving
in interfaceRemoteFamilyTree
- Throws:
RemoteException
-
shutdown
Description copied from interface:RemoteFamilyTree
Shuts down thisPersonFactory
. ModifiedPerson
s are written to persistent storage as appropriate.- Specified by:
shutdown
in interfaceRemoteFamilyTree
- Throws:
IOException
RemoteException
-
main
-