Package edu.pdx.cs410J.family
Class RemotePersonImpl
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
edu.pdx.cs410J.family.RemotePersonImpl
- All Implemented Interfaces:
RemotePerson
,Serializable
,Remote
This is a concrete class that implements the
RemotePerson
interface. It delegates most of its
functionality to an underlying Person
object.
Note that because this class is only executed on the
server-side, it does not have to be public. However, the fact that
it is a UnicastRemoteObject
allows the client to
execute its methods remotely.
-
Field Summary
Fields inherited from class java.rmi.server.RemoteObject
ref
-
Constructor Summary
ConstructorDescriptionRemotePersonImpl
(RemoteFamilyTree tree, Person person) Creates a newRemotePersonImpl
that delegates most of its behavior to a givenPerson
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
TwoRemotePersonImpl
s are considered equal if their underlying persons have the same id.Returns this person's date of birthReturns this person's date of deathReturns a string describing this personint
Returns the id of this person's fatherReturns this person's first nameReturns this person's gender (eitherPerson.MALE
orPerson.FEMALE
.int
getId()
Returns this person's unique idReturns this person's last nameReturns this person's middle nameint
Returns the id of this person's mothervoid
setDateOfBirth
(Date dob) Sets this person's date of birthvoid
setDateOfDeath
(Date dod) Sets this person's date of deathvoid
setFatherId
(int fatherId) Sets the id of this person's fathervoid
setFirstName
(String firstName) Sets this person's first namevoid
setLastName
(String lastName) Sets this person's last namevoid
setMiddleName
(String middleName) Sets this person's middle namevoid
setMotherId
(int motherId) Sets the id of this person's motherMethods 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
Methods inherited from class java.rmi.server.RemoteObject
getRef, hashCode, toString, toStub
-
Constructor Details
-
RemotePersonImpl
RemotePersonImpl(RemoteFamilyTree tree, Person person) throws RemoteException Creates a newRemotePersonImpl
that delegates most of its behavior to a givenPerson
.- Throws:
RemoteException
-
-
Method Details
-
getId
Description copied from interface:RemotePerson
Returns this person's unique id- Specified by:
getId
in interfaceRemotePerson
- Throws:
RemoteException
-
getGender
Description copied from interface:RemotePerson
Returns this person's gender (eitherPerson.MALE
orPerson.FEMALE
.- Specified by:
getGender
in interfaceRemotePerson
- Throws:
RemoteException
-
getFirstName
Description copied from interface:RemotePerson
Returns this person's first name- Specified by:
getFirstName
in interfaceRemotePerson
- Throws:
RemoteException
-
setFirstName
Description copied from interface:RemotePerson
Sets this person's first name- Specified by:
setFirstName
in interfaceRemotePerson
- Throws:
RemoteException
-
getMiddleName
Description copied from interface:RemotePerson
Returns this person's middle name- Specified by:
getMiddleName
in interfaceRemotePerson
- Throws:
RemoteException
-
setMiddleName
Description copied from interface:RemotePerson
Sets this person's middle name- Specified by:
setMiddleName
in interfaceRemotePerson
- Throws:
RemoteException
-
getLastName
Description copied from interface:RemotePerson
Returns this person's last name- Specified by:
getLastName
in interfaceRemotePerson
- Throws:
RemoteException
-
setLastName
Description copied from interface:RemotePerson
Sets this person's last name- Specified by:
setLastName
in interfaceRemotePerson
- Throws:
RemoteException
-
getFatherId
Description copied from interface:RemotePerson
Returns the id of this person's father- Specified by:
getFatherId
in interfaceRemotePerson
- Throws:
RemoteException
-
setFatherId
Description copied from interface:RemotePerson
Sets the id of this person's father- Specified by:
setFatherId
in interfaceRemotePerson
- Throws:
RemoteException
-
getMotherId
Description copied from interface:RemotePerson
Returns the id of this person's mother- Specified by:
getMotherId
in interfaceRemotePerson
- Throws:
RemoteException
-
setMotherId
Description copied from interface:RemotePerson
Sets the id of this person's mother- Specified by:
setMotherId
in interfaceRemotePerson
- Throws:
RemoteException
-
getDateOfBirth
Description copied from interface:RemotePerson
Returns this person's date of birth- Specified by:
getDateOfBirth
in interfaceRemotePerson
- Throws:
RemoteException
-
setDateOfBirth
Description copied from interface:RemotePerson
Sets this person's date of birth- Specified by:
setDateOfBirth
in interfaceRemotePerson
- Throws:
RemoteException
-
getDateOfDeath
Description copied from interface:RemotePerson
Returns this person's date of death- Specified by:
getDateOfDeath
in interfaceRemotePerson
- Throws:
RemoteException
-
setDateOfDeath
Description copied from interface:RemotePerson
Sets this person's date of death- Specified by:
setDateOfDeath
in interfaceRemotePerson
- Throws:
RemoteException
-
getDescription
Description copied from interface:RemotePerson
Returns a string describing this person- Specified by:
getDescription
in interfaceRemotePerson
- Throws:
RemoteException
-
equals
TwoRemotePersonImpl
s are considered equal if their underlying persons have the same id.- Overrides:
equals
in classRemoteObject
-