org.xnap.search
Class SearchManager

java.lang.Object
  extended by org.xnap.search.SearchManager

public class SearchManager
extends java.lang.Object

Manages search providers. SearchManager follows the singleton pattern.


Field Summary
static MediaType[] DEFAULT_MEDIA_TYPES
           
static MediaType MEDIA_ANYTHING
          Default media type that matches anything.
static MediaType MEDIA_AUDIO
          Default media type that matches audio files.
static MediaType MEDIA_DOCUMENTS
          Default media type that matches document files.
static MediaType MEDIA_IMAGES
          Default media type that matches image files.
static MediaType MEDIA_SOFTWARE
          Default media type that matches software files.
static java.lang.String MEDIA_TYPE_FILE
           
static MediaType MEDIA_VIDEO
          Default media type that matches video files.
 
Method Summary
 void add(SearchProvider provider)
          Adds provider to the list of available search providers.
 void addListListener(ListListener listener)
          Listener is notified when a new search provider is added.
static SearchManager getInstance()
          Returns the instance of SearchManager.
static MediaType getMediaType(java.lang.String filename)
           
 void handle(Search search)
          Asks the search manager to handle search.
 void initializeMediaTypes()
          Reads the extensions for the default media types from a property file.
 void remove(SearchProvider provider)
          Removes provider from the list of available search providers.
 void removeListListener(ListListener listener)
          Listener is notified when a new search provider is removed.
 Search searchAll(SearchFilter filter)
          Returns a new SearchContainer that searches all networks.
 void setListener(SearchManagerListener listener)
          Registers listener as the user search handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEDIA_TYPE_FILE

public static java.lang.String MEDIA_TYPE_FILE

MEDIA_ANYTHING

public static MediaType MEDIA_ANYTHING
Default media type that matches anything.


MEDIA_AUDIO

public static MediaType MEDIA_AUDIO
Default media type that matches audio files.


MEDIA_DOCUMENTS

public static MediaType MEDIA_DOCUMENTS
Default media type that matches document files.


MEDIA_IMAGES

public static MediaType MEDIA_IMAGES
Default media type that matches image files.


MEDIA_SOFTWARE

public static MediaType MEDIA_SOFTWARE
Default media type that matches software files.


MEDIA_VIDEO

public static MediaType MEDIA_VIDEO
Default media type that matches video files.


DEFAULT_MEDIA_TYPES

public static MediaType[] DEFAULT_MEDIA_TYPES
Method Detail

getInstance

public static SearchManager getInstance()
Returns the instance of SearchManager.


getMediaType

public static MediaType getMediaType(java.lang.String filename)

add

public void add(SearchProvider provider)
Adds provider to the list of available search providers.


addListListener

public void addListListener(ListListener listener)
Listener is notified when a new search provider is added.


handle

public void handle(Search search)
Asks the search manager to handle search. The search object is passed to the listener that starts the search and displays the results. If no listener is set nothing happens.

See Also:
SearchManagerListener

initializeMediaTypes

public void initializeMediaTypes()
Reads the extensions for the default media types from a property file.


remove

public void remove(SearchProvider provider)
Removes provider from the list of available search providers.


removeListListener

public void removeListListener(ListListener listener)
Listener is notified when a new search provider is removed.


searchAll

public Search searchAll(SearchFilter filter)
Returns a new SearchContainer that searches all networks.


setListener

public void setListener(SearchManagerListener listener)
Registers listener as the user search handler.



Copyright © 2001-2005 XNap Team. All Rights Reserved.