com.sun.slamd.misc
Class GetFileCacheItem

java.lang.Object
  extended bycom.sun.slamd.misc.GetFileCacheItem

public class GetFileCacheItem
extends java.lang.Object

This class defines a state item that is used to store information about a file that can be retrieved by the GetFile servlet.


Constructor Summary
GetFileCacheItem(java.lang.String baseName, int numFiles)
          Creates a new cache item for a file with the specified base name and total number of files.
 
Method Summary
 java.lang.String nextFileName()
          Retrieves the name of the next file that should be retrieved.
 java.lang.String randomFileName()
          Retrieves the name of a random file that should be retrieved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetFileCacheItem

public GetFileCacheItem(java.lang.String baseName,
                        int numFiles)
Creates a new cache item for a file with the specified base name and total number of files.

Parameters:
baseName - The base name for the file with which this cache item is associated.
numFiles - The total number of files available with the specified base name.
Method Detail

nextFileName

public java.lang.String nextFileName()
Retrieves the name of the next file that should be retrieved. It will be the base name followed by a period and a number. In addition, the counter will be incremented.

Returns:
The name of the next file that should be retrieved.

randomFileName

public java.lang.String randomFileName()
Retrieves the name of a random file that should be retrieved. It will be the base name followed by a period and a randomly-chosen number (between 1 and numFiles, inclusive).

Returns:
The name of the randomly-chosen file that should be retrieved.