|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
edu.pdx.cs399J.family.XmlRemoteFamilyTree
public class XmlRemoteFamilyTree
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.
| Field Summary |
|---|
| Fields inherited from class java.rmi.server.RemoteObject |
|---|
ref |
| Constructor Summary | |
|---|---|
XmlRemoteFamilyTree(File xmlFile)
Creates a new XmlRemoteFamilyTree that gets its data
from a given XML file. |
|
| 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. |
static void |
main(String[] args)
|
void |
shutdown()
Shuts down this PersonFactory. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
|---|
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
|---|
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
|---|
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XmlRemoteFamilyTree(File xmlFile)
throws RemoteException,
IOException,
FamilyTreeException
XmlRemoteFamilyTree that gets its data
from a given XML file.
ParserException - A problem occurred while parsing the XML file
RemoteException
IOException
FamilyTreeException| Method Detail |
|---|
public RemotePerson createPerson(Person.Gender gender)
throws RemoteException
RemoteFamilyTreePerson of a given gender
createPerson in interface RemoteFamilyTreeRemoteException
public RemotePerson getPerson(int id)
throws RemoteException
RemoteFamilyTreenull is returned.
getPerson in interface RemoteFamilyTreeRemoteException
public RemotePerson getPerson(String firstName,
String lastName)
throws RemoteException
RemoteFamilyTreenull is returned.
getPerson in interface RemoteFamilyTreeRemoteException
public RemoteMarriage getMarriage(int husbandId,
int wifeId)
throws RemoteException
RemoteFamilyTreenull is returned.
getMarriage in interface RemoteFamilyTreeRemoteException
public RemoteMarriage createMarriage(int husbandId,
int wifeId)
throws RemoteException
RemoteFamilyTree
createMarriage in interface RemoteFamilyTreeRemoteException
public Collection<RemotePerson> getLiving()
throws RemoteException
RemoteFamilyTree
getLiving in interface RemoteFamilyTreeRemoteException
public Collection<RemotePerson> getLiving(Date date)
throws RemoteException
RemoteFamilyTree
getLiving in interface RemoteFamilyTreeRemoteException
public void shutdown()
throws IOException,
RemoteException
RemoteFamilyTreePersonFactory. Modified
Persons are written to persistent storage as
appropriate.
shutdown in interface RemoteFamilyTreeIOException
RemoteExceptionpublic static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||