edu.pdx.cs399J.rmi
Interface MovieDatabase

All Superinterfaces:
Remote
All Known Implementing Classes:
MovieDatabaseImpl

public interface MovieDatabase
extends Remote

This remote interface allows a client to interact with a database of Movie objects.


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
 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 MovieDatabase object with the RMI registry.
 

Method Detail

createMovie

long createMovie(String title,
                 int year)
                 throws RemoteException
Creates a new Movie object on the server. It returns the id of the movie that was created.

Parameters:
title - The title of the movie
year - The year in which the movie was released
Throws:
RemoteException

getMovie

Movie getMovie(long id)
               throws RemoteException
Returns the Movie with the given id.

Throws:
RemoteException

noteCharacter

void noteCharacter(long movieId,
                   String character,
                   long actorId)
                   throws RemoteException
Makes note of a character in a given movie played by a given actor.

Throws:
IllegalArgumentException - The character is already played by someone else
RemoteException

getFilmography

SortedSet<Movie> getFilmography(long actorId)
                                throws RemoteException
Returns the movie in which a given actor acted. The movies are sorted by release date.

Throws:
RemoteException

executeQuery

SortedSet<Movie> executeQuery(Query query,
                              Comparator<Movie> sorter)
                              throws RemoteException
Performs a query on the database. The movies that match the query are sorted using the given comparator.

Throws:
RemoteException

shutdown

void shutdown()
              throws RemoteException
Unregisters this MovieDatabase object with the RMI registry. Once it is unregistered, this object will no longer be accessible.

Throws:
RemoteException

getMovies

Collection<Movie> getMovies()
                            throws RemoteException
Returns all of the movies in the database

Throws:
RemoteException


Copyright © 2000-2009 Portland State University. All Rights Reserved.