Koha::Z3950Responder::Session
An abstract class where backend-specific session modules are derived from. Z3950Responder creates one of the child classes depending on the SearchEngine preference.
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.
OIDs and diagnostic codes used in Z39.50
my $session = $self->new({ server => $z3950responder, peer => 'PEER NAME' });
Instantiate a Session
Callback that is called when a new search is performed
Calls start_search
for backend-specific retrieval logic
Callback that is called when records are requested
Calls fetch_record
for backend-specific retrieval logic
Callback that is called when a session is terminated
my ($resultset, $hits) = $self->_start_search( $args, $self->{server}->{num_to_prefetch} );
A backend-specific method for starting a new search
$self->check_fetch($resultset, $args, $offset, $num_records);
Check that the fetch request parameters are within bounds of the result set.
my $record = $self->_fetch_record( $resultset, $args, $offset, $server->{num_to_prefetch} );
A backend-specific method for fetching a record
$self->add_item_status( $field );
Add item status to the given field
$self->log_debug('Message');
Output a debug message
$self->log_info('Message');
Output an info message
$self->log_error('Message');
Output an error message
$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