<<

NAME

Koha::Z3950Responder::Session

SYNOPSIS

An abstract class where backend-specific session modules are derived from. Z3950Responder creates one of the child classes depending on the SearchEngine preference.

DESCRIPTION

This class contains common functions for handling searching for and fetching of records. It can optionally add item status information to the returned records. The backend-specific abstract methods need to be implemented in a child class.

CONSTANTS

OIDs and diagnostic codes used in Z39.50

FUNCTIONS

INSTANCE METHODS

new

    my $session = $self->new({
        server => $z3950responder,
        peer => 'PEER NAME'
    });

Instantiate a Session

search_handler

    Callback that is called when a new search is performed

Calls start_search for backend-specific retrieval logic

fetch_handler

    Callback that is called when records are requested

Calls fetch_record for backend-specific retrieval logic

close_handler

Callback that is called when a session is terminated

start_search

    my ($resultset, $hits) = $self->_start_search( $args, $self->{server}->{num_to_prefetch} );

A backend-specific method for starting a new search

check_fetch

    $self->check_fetch($resultset, $args, $offset, $num_records);

Check that the fetch request parameters are within bounds of the result set.

fetch_record

    my $record = $self->_fetch_record( $resultset, $args, $offset, $server->{num_to_prefetch} );

A backend-specific method for fetching a record

add_item_status

    $self->add_item_status( $field );

Add item status to the given field

log_debug

    $self->log_debug('Message');

Output a debug message

log_info

    $self->log_info('Message');

Output an info message

log_error

    $self->log_error('Message');

Output an error message

set_error

    $self->set_error($args, $self->ERR_SEARCH_FAILED, 'Backend connection failed' );

Set and log an error code and diagnostic message to be returned to the client

<<