dino.api
Interface Directory


public interface Directory

Directory is the API for the DiNo directory service.

Author:
Don Swartwout

Method Summary
 java.lang.String createNotebook(java.lang.String title, java.lang.String primaryUrl)
          Create a new notebook, if possible
 void deleteNotebook(java.lang.String id)
          Delete the notebook with the given id
 java.util.List<Notebook> getAllNotebooks()
          Get the directory information for all notebooks currently in the system
 Notebook getNotebook(java.lang.String id)
          Get the directory information for one notebook
 

Method Detail

getAllNotebooks

java.util.List<Notebook> getAllNotebooks()
Get the directory information for all notebooks currently in the system

Returns:
a list of Notebook objects, one for each notebook currently in the system. Returns a list of length 0 if there are no notebooks in the system.

getNotebook

Notebook getNotebook(java.lang.String id)
Get the directory information for one notebook

Parameters:
id - the notebook's id
Returns:
a Notebook object that represents the given notebook; returns null if there is no notebook in the system with the given id

createNotebook

java.lang.String createNotebook(java.lang.String title,
                                java.lang.String primaryUrl)
                                throws NotebookAlreadyExistsException,
                                       BadAddressException
Create a new notebook, if possible

Parameters:
title - the new notebook's title
primaryUrl - the base URL of the notebook service that will host the notebook's primary copy. The base URL for a notebook service consists of the service host and context root, for example, "http://mypc:8080/dino"
Returns:
if successful, an id for the new notebook selected by the directory service
Throws:
NotebookAlreadyExistsException - if a notebook with the same title already exists in the system
BadAddressException - if the primary URL is invalid

deleteNotebook

void deleteNotebook(java.lang.String id)
                    throws NotebookNotFoundException
Delete the notebook with the given id

Parameters:
id - identifier of the notebook to be deleted
Throws:
NotebookNotFoundException - if there is no notebook with the given id