3.1.1.3 FileSearchRequest

FileSearchRequest is a data element that encapsulates a particular search request from the higher-level protocol. A FileSearchRequest element can be represented by a state machine with the following states.

State

Description

STATE_INIT

The initial state for the machine.

STATE_CHOOSE_SERVER

The FileSearchRequest element needs to choose a server so that it can send a request.

STATE_SEND_REQUEST

The FileSearchRequest element needs to send a request to a server.

STATE_WAIT

The FileSearchRequest element is waiting for responses to its requests.

STATE_DISCOVER_SERVERS

The FileSearchRequest element needs to locate more servers, if possible.

STATE_COMPLETE

The FileDiscoveryAttempt element has completed successfully.

The FileSearchRequest element contains the following data elements:

  • The URL search criteria passed by the higher-level protocol.

  • PENDING-CALLS-TABLE: A collection of pending calls.

  • SERVERS-NEEDED: The number of servers remaining to be chosen.

  • F_DISCOVERED: A flag that is true if the FileSearchRequest element previously searched for more servers.

  • F_WAITING_FOR_DISCOVERY: A flag that is true if the FileSearchRequest element is waiting for more servers to be discovered.

  • NEW_SERVER: A server from the Table of Servers element.

  • AUTH_NEEDED: The number of authenticated servers remaining to be chosen.

The client defines a constant IDEAL-SERVER-COUNT as a target for the number of servers to contact. IDEAL-SERVER-COUNT SHOULD be set to 10.

The following figure illustrates the possible state transitions.

Possible state transitions

Figure 4: Possible state transitions

Note The conceptual data can be implemented by using a variety of techniques. Any data structure that stores the conceptual data can be used in the implementation.