All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.pdx.cs410J.rmi.MovieDatabase Maven / Gradle / Ivy

The newest version!
package edu.pdx.cs410J.rmi;

import java.rmi.*;
import java.util.*;

/**
 * This remote interface allows a client to interact with a database
 * of {@link Movie} objects.
 */
public interface MovieDatabase extends Remote {

  String RMI_OBJECT_NAME = "/MovieDatabase";

  /**
   * Creates a new Movie object on the server.  It
   * returns the id of the movie that was created.
   *
   * @param title
   *        The title of the movie
   * @param year
   *        The year in which the movie was released
   */
  long createMovie(String title, int year)
    throws RemoteException; 
  
  /**
   * Returns the Movie with the given id.
   */
  Movie getMovie(long id) 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
   */
  void noteCharacter(long movieId, String character, long actorId)
    throws RemoteException;

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

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

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

  /**
   * Returns all of the movies in the database
   */
  Collection getMovies() throws RemoteException;

  void deleteMovie(long movieId) throws RemoteException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy