netcom.mds
Class SearchTask

java.lang.Object
  extended bynetcom.mds.SearchTask
All Implemented Interfaces:
java.lang.Runnable

public class SearchTask
extends java.lang.Object
implements java.lang.Runnable

Title: Search Task

Description: This class is a task which handles Search requests entering an MDS node. It performs a local lookup of the Search criteria, a Bloom Check if in Bloom Search Mode, and propogates the SearchRequest

Copyright: Copyright (c) 2002

Company: NETCOM


Constructor Summary
SearchTask(SearchRequest search_request, java.util.Collection mds_connects, java.util.Collection outgoing_friends, java.util.Map all_psdatas, java.util.Map all_bloom_filters, AddressPort mdsnode_identifier, java.util.Map output_obj_streams)
          The search task is created by providing ALL references it needs to complete the task, which it stored internally, and uses when run().
 
Method Summary
 void run()
          Overwrites run() method from Thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchTask

public SearchTask(SearchRequest search_request,
                  java.util.Collection mds_connects,
                  java.util.Collection outgoing_friends,
                  java.util.Map all_psdatas,
                  java.util.Map all_bloom_filters,
                  AddressPort mdsnode_identifier,
                  java.util.Map output_obj_streams)
The search task is created by providing ALL references it needs to complete the task, which it stored internally, and uses when run().

Parameters:
search_request - the actual request asking for items
mds_connects - the collection of 'friend' connections to this MDS node this is a direct pointer, and not copy of the mds_connects
all_psdatas - the collection of all the internal PSData objects in this MDS node this should be a copy of the psData collection (so thread-safe)
all_bloom_filters - a reference to a map of all known bloom filters this should be a copy of the bloom filters (so thread-safe)
mdsnode_identifier - Information describing "this" MDS Node's location on the network to prevent any request looping
Method Detail

run

public void run()
Overwrites run() method from Thread. Task begins execution from here using stored internal fields from the constructor A SearchRequest is first checked to be a repeat, to prevent looping The SearchRequest is then check againts local PServer information, and a Return is sent directly to the MDSProxy if any matches are found. Then if the Bloom Search method is being used, the searchRequest is propagated to all bloom-matching MDS nodes If the bloom search method is not being used, the request is simply propagated to all "friend" nodes of this MDSNode

Specified by:
run in interface java.lang.Runnable