The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

PICA::Modification::Queue - Queued list of modification requests of PICA+ records

VERSION

version 0.16

SYNOPSIS

    # create a PICA::Modification::Queue::Hash
    my $q = PICA::Modification::Queue->new('Hash'); 

    # create a different kind of queue (all equivalent)
    $q = PICA::Modification::Queue->new('foo', bar => 'doz'); 
    $q = PICA::Modification::Queue->new({type => 'foo', bar => 'doz' }); 
    $q = PICA::Modification::Queue::Foo->new( bar => 'doz' ); 

    # operations on queues:
    
    my $id  = $q->insert( $modification );
    my $mod = $q->get( $id );
    $id     = $q->update( $id => $modification );
    $id     = $q->delete( $id );

    my @mods = $q->list( $key => $value ... );

DESCRIPTION

PICA::Modification::Queue implements a collection of modifications (PICA::Modification) or requests (PICA::Modification::Request) on PICA+ records together with the CRUDL operations get, insert, update, delete, and list. A queue may support insertion of modifications which then are stored as modification requests.

The default implementation is a in-memory (non-persistent) hash (PICA::Modification::Queue::Hash). Additional types of queues can be implemented in the PICA::Modification::Queue:: module namespace.

To test additional implementations of queues, the unit testing package PICA::Modification::TestQueue should be used.

METHODS

new ( $name [, %options ] )

Creates a new queue. Options are passed to the queue's constructor.

request ( $modification )

Must return the id only on success.

get ( $id )

Returns a stored modification or undef.

update ( $id => $modification_or_modification_request )

Must return the id only on success.

delete ( $id )

Must return the id only on success.

list ( %parameters )

List all or a selection of queued modifications. Parameters can be used for selection. Special parameters are: page, limit, and sort.

AUTHOR

Jakob Voß <voss@gbv.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by Jakob Voß.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.