uk.org.ury.common.library
Class LibraryUtils

java.lang.Object
  extended by uk.org.ury.common.library.LibraryUtils

public class LibraryUtils
extends java.lang.Object

A set of common utility routines to facilitate the extraction of library items from the library areas of the URY database.

Author:
Matt Windsor

Constructor Summary
LibraryUtils()
           
 
Method Summary
static java.util.List<LibraryItem> search(DatabaseDriver db, java.lang.String search)
          Perform a library search.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LibraryUtils

public LibraryUtils()
Method Detail

search

public static java.util.List<LibraryItem> search(DatabaseDriver db,
                                                 java.lang.String search)
                                          throws QueryFailureException,
                                                 EmptySearchException
Perform a library search.

Parameters:
db - The database to query.
search - The search fragment to include in the search. Can be empty or null.
Returns:
a list of LibraryItems matching the search terms.
Throws:
java.lang.IllegalArgumentException - if the search term is are null.
QueryFailureException - if the database backend yielded an error while executing the search query.
EmptySearchException - if the search term is empty (to be handled as a user error).