|
Comments
|
Today's Top SOA Links
Utility Mobile Agent-Based File Search Utility
Creating a utility that can search for any desired document on multiple remote machines simultaneously
Feb. 4, 2007 05:00 PM
In today's world of network computers our important documents are usually widely dispersed on several computers in our networks. Over a period of time, we forget their location and searching for these files on a huge network turns out to be a frustrating experience. Such searches are typically not only time-consuming, but also consume valuable and scarce network resources. This article provides an elegant solution to this problem.
After initiating the search, the requestor is immediately freed for processing other tasks on the local machine. This is one of the important advantages offered by the current application compared to a traditional file find operation on a local drive that usually brings down machine performance drastically. The application also provides a facility for canceling the search operation anytime. Thus, the requestor after locating the first occurrence of the desired document may send a message to all the participating remote machines to stop searching further. After the document is located, the requestor can fetch it to her local machine for editing or review. Using mobile agent technology results in more efficient searches in terms of network resource utilization and facilitates unattended search.
Why Mobile Agents? One possible solution to this problem is to develop a search utility that will only do local searches. This utility is then deployed on each of the desired machines. The file requestor then communicates with each such deployed application to do the desired network search. This, however, requires a carefully designed communication protocol between the requestor and the remote machine where the search is done. We used mobile agent technology to solve this problem. In this technology, a requestor creates a mobile agent and dispatches it to a desired remote machine on the network. The search criteria are defined in the agent that carries the search code to the remote machine. After reaching the remote machine, the code is executed locally freeing the sender for its own task. After the search is done, the results are dispatched to the sender. In general, mobile agent technology solves many problems faced in traditional distributed software. It reduces the load on network, reduces the code design risk, and provides a robust application over unreliable networks. There are several other benefits offered by mobile agent technology. However, the most important have already been explained. Mobile agent technology also carries a few disadvantages. One is the requirement for an agent server on each participating machine. The server listens to the incoming requests from the senders and provides a runtime environment for the agents to run their code. Other disadvantages would be protection against the malicious code and general code and data security.
Application Structure The search application consists of three agents. Out of these three agents one is stationary (the Master) and two are mobile (the Slave) agents. Each agent has its own specific task assigned in the system. The following are the three agents and the respective code files of our file search application:
Main File Agent (Master) The interface shown in Figure 2 lets the user input the search criteria consisting of the search file name, the search directory, and the addresses of the remote machines to be searched. When the search operation is initiated, the agent creates an instance of the File Search Agent for each search location (remote machine) and dispatches it to the respective location (remote machine) to search for the required file. Thus the search is done simultaneously on a number of remote machines. The Main File Agent is the first agent that the application creates. This agent is also called the stationary agent because it doesn't move on the network and remains on the sender machine.
File Search Agent (Slave) After launching the Main File Agent and providing the search criteria in its user interface, we launch this agent by clicking the START button. The Main File Agent supplies the search criteria to the mobile agent and dispatches it to the remote machine where it searches the entire system or a specified directory (as specified by the user) to find the user-specified file. After this agent moves across the network to the remote machine, the search is carried out locally on the remote machine. The network is only used to transfer this agent to the remote machine. The search is fast because it's done locally. While this agent is searching a particular file on the remote system it sends results to the Main File Agent, which is stationery on the sender machine. This agent sends all the file paths on which it finds the requested file on the remote machine to the Main File Agent. The Main File Agent then displays the result to the user on its GUI in a list box control (named Search Result) as shown in Figure 3. The user has full control over this agent and can destroy it even while the search is in progress on the remote machine by selecting a location from the list box control (named Remote URL) and clicking the STOP button. The user can also initiate a search for the specified criteria on more than one machine. Clicking the STOP ALL button destroys all the File Search Agents. Reader Feedback: Page 1 of 1
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week |
|||||||||||||||||||||||||||