StateManager

OAI-PMH State Manager (for persisting harvest state)

This class actually serves two distinct functions:

Long-term state management: remembering/retrieving the end date of the most recent harvest through saveDate()/loadDate().

Short-term state management: remembering resumption tokens to allow for continuation of an interrupted harvest through saveState()/loadState().

category

VuFind

package

Harvest_Tools

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Methods

Constructor.

__construct(string $basePath) 

Arguments

$basePath

string

Directory to contain state files

Clear the state most recently saved to saveState().

clearState() : void

Retrieve the date from the "last harvested" file and use it as our start date if it is available.

loadDate() : string

Response

string

Load the last saved harvest state. Returns an array of [set, resumption token, start date] if found; false otherwise.

loadState() : array|boolean

Response

array|boolean

Save a date to the "last harvested" file.

saveDate(string $date) : void

Arguments

$date

string

Date to save.

Save a harvest state.

saveState(string $set, string $token, string $startDate) : void

Arguments

$set

string

Set being harvested

$token

string

Current resumption token

$startDate

string

Start date of harvest

Properties

File for tracking last harvest date

lastHarvestFile : string
var

Type(s)

string

File for tracking last harvest state (for continuing interrupted connection).

lastStateFile : string
var

Type(s)

string