API:EPrints/DataObj/EventQueue

From EPrints Documentation
Revision as of 00:17, 3 January 2022 by Pod2wiki (talk | contribs)
Jump to: navigation, search

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::DataObj::EventQueue - Scheduler/indexer event queue.

User Comments


DESCRIPTION

Individual tasks for the EPrints event queue that can then be actioned by the EPrints indexer in the background.

User Comments


INSTANCE VARIABLES

See EPrints::DataObj#INSTANCE_VARIABLES.

User Comments


CORE METADATA FIELDS

User Comments


eventqueueid (uuid)

Either a UUID or a hash of the event (if created with create_unique).

User Comments


cleanup (boolean)

If set to true removes this event once it has finished. Defaults to true.

User Comments


priority (int)

The priority for this event.

User Comments


start_time (time)

The event should not be executed before this time.

User Comments


end_time (time)

The event was last touched at this time.

User Comments


status (set)

The status of this event. Can be waiting, inprogress, success or failed. Defaults to failed.

User Comments


description (longtext)

A human-readable description of this event (or error).

User Comments


pluginid (id)

The EPrints::Plugin::Event plugin id to call to execute this event.

User Comments


action (id)

The name of the action to execute on the plugin (i.e. method name).

User Comments


params (storable)

Parameters to pass to the action (a text serialisation).

User Comments


REFERENCES AND RELATED OBJECTS

User Comments


userid (itemref)

The user (if any) that was responsible for creating this event.

User Comments


METHODS

User Comments


Constructor Methods

User Comments


create_unique

$event = EPrints::DataObj::EventQueue->create_unique( $session, $data, [ $dataset ] )

Returns a unique event queue task using the $data provided. Setting the eventqueueid to a MD5 hash of the pluginid, action and (if given) params.

Returns undef if such an event already exists.

If $dataset is not provided generate from dataset ID of the class.

User Comments


new_from_hash

$event = EPrints::DataObj::EventQueue->new_from_hash( $session, $data, [ $dataset ] )

Returns the event that corresponds to the MD5 hash of the $data provided, (pluginid, action and params). Returns undef if no event queue task exists with a matching MD5 hash.

If $dataset is not provided generate from dataset ID of the class.

User Comments


Class Methods

User Comments


get_system_field_info

$metadata = EPrints::DataObj::EPrint->get_system_field_info

Returns an array describing the system metadata of the event queue dataset.

User Comments


get_dataset_id

$dataset = EPrints::DataObj::EPrint->get_dataset_id

Returns the ID of the EPrints::DataSet object to which this record belongs.

User Comments


Object Methods

User Comments


execute

$ok = $event->execute()

Execute the action this event queue task describes.

The response from the EPrints::Plugin::Event plugin action is treated as follows:

undef - equivalent to HTTP_OK
HTTP_OK - action succeeded, event is removed if cleanup is TRUE
HTTP_RESET_CONTENT - action succeeded, event is set 'waiting'
HTTP_NOT_FOUND - action failed, event is removed if cleanup is TRUE
HTTP_LOCKED - action failed, event is re-scheduled for 10 minutes time
HTTP_INTERNAL_SERVER_ERROR - action failed, event is 'failed' and kept
 

User Comments


message

$event->message( $type, $message )

Utility method to log the $message for this event.

$type is required by this method but not currently used.

User Comments


COPYRIGHT

© Copyright 2000-2024 University of Southampton.

EPrints 3.4 is supplied by EPrints Services.

http://www.eprints.org/eprints-3.4/

LICENSE

This file is part of EPrints 3.4 http://www.eprints.org/.

EPrints 3.4 and this file are released under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation unless otherwise stated.

EPrints 3.4 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with EPrints 3.4. If not, see http://www.gnu.org/licenses/.

User Comments