|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.pdx.cs399J.rmi.MovieDatabaseImpl
public class MovieDatabaseImpl
This class provides an implementation of the remote MovieDatabase interface. Note that this class does not extened
UnicastRemoteObject. Therefore, we have to invoke UnicastRemoteObject.exportObject(java.rmi.Remote) in the constructor.
| Constructor Summary | |
|---|---|
MovieDatabaseImpl()
Creates a new MovieDatabaseImpl. |
|
| Method Summary | |
|---|---|
long |
createMovie(String title,
int year)
Creates a new Movie object on the server. |
SortedSet<Movie> |
executeQuery(Query query,
Comparator<Movie> sorter)
Performs a query on the database. |
SortedSet<Movie> |
getFilmography(long actorId)
Returns the movie in which a given actor acted. |
Movie |
getMovie(long id)
Returns the Movie with the given id. |
Collection<Movie> |
getMovies()
Returns all of the movies in the database |
static void |
main(String[] args)
This main program registers an instance of MovieDatabaseImpl in an RMI registry. |
void |
noteCharacter(long movieId,
String character,
long actorId)
Makes note of a character in a given movie played by a given actor. |
void |
shutdown()
Unregisters this MovieDatabseImpl with the RMI
registry. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MovieDatabaseImpl()
throws RemoteException
MovieDatabaseImpl.
RemoteException| Method Detail |
|---|
public long createMovie(String title,
int year)
throws RemoteException
Movie object on the server. It
returns the id of the movie that was created.
createMovie in interface MovieDatabasetitle - The title of the movieyear - The year in which the movie was released
RemoteException
public Movie getMovie(long id)
throws RemoteException
Movie with the given id.
getMovie in interface MovieDatabaseRemoteException
public void noteCharacter(long movieId,
String character,
long actorId)
throws RemoteException
noteCharacter in interface MovieDatabaseIllegalArgumentException - There is no movie with movieId or the
character is already played by someone else
RemoteException
public SortedSet<Movie> getFilmography(long actorId)
throws RemoteException
getFilmography in interface MovieDatabaseRemoteException
public SortedSet<Movie> executeQuery(Query query,
Comparator<Movie> sorter)
throws RemoteException
executeQuery in interface MovieDatabaseRemoteException
public void shutdown()
throws RemoteException
MovieDatabseImpl with the RMI
registry.
shutdown in interface MovieDatabaseRemoteException
public Collection<Movie> getMovies()
throws RemoteException
MovieDatabase
getMovies in interface MovieDatabaseRemoteExceptionpublic static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||