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
ConstructorsConstructorDescriptionXmlRemoteFamilyTree(File xmlFile) Creates a newXmlRemoteFamilyTreethat 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 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.static voidvoidshutdown()Shuts down thisPersonFactory.Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObjectMethods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
Constructor Details
-
XmlRemoteFamilyTree
Creates a newXmlRemoteFamilyTreethat gets its data from a given XML file.- Throws:
FamilyTreeException- A problem occurred while parsing the XML fileRemoteExceptionIOException
-
-
Method Details
-
createPerson
Description copied from interface:RemoteFamilyTreeCreates a newPersonof a given gender- Specified by:
createPersonin interfaceRemoteFamilyTree- Throws:
RemoteException
-
getPerson
Description copied from interface:RemoteFamilyTreeGets the person with the given id. If no person with that id exists, thennullis returned.- Specified by:
getPersonin interfaceRemoteFamilyTree- Throws:
RemoteException
-
getPerson
Description copied from interface:RemoteFamilyTreeGets the person with the given first and last name. If no person with that name is found, thennullis returned.- Specified by:
getPersonin interfaceRemoteFamilyTree- Throws:
RemoteException
-
getMarriage
Description copied from interface:RemoteFamilyTreeReturns the marriage between two people. If the two people have never been married, thennullis returned.- Specified by:
getMarriagein interfaceRemoteFamilyTree- Throws:
RemoteException
-
createMarriage
Description copied from interface:RemoteFamilyTreeCreates a new marriage between two people- Specified by:
createMarriagein interfaceRemoteFamilyTree- Throws:
RemoteException
-
getLiving
Description copied from interface:RemoteFamilyTreeReturns the people in the family tree that are living (i.e. have a date of birth, but no date of death)- Specified by:
getLivingin interfaceRemoteFamilyTree- Throws:
RemoteException
-
getLiving
Description copied from interface:RemoteFamilyTreeReturns the people in the family tree were alive at a certain time- Specified by:
getLivingin interfaceRemoteFamilyTree- Throws:
RemoteException
-
shutdown
Description copied from interface:RemoteFamilyTreeShuts down thisPersonFactory. ModifiedPersons are written to persistent storage as appropriate.- Specified by:
shutdownin interfaceRemoteFamilyTree- Throws:
IOExceptionRemoteException
-
main
-