pazpar2  1.14.1
Data Structures | Macros | Typedefs | Enumerations | Functions
session.h File Reference
#include <yaz/comstack.h>
#include <yaz/pquery.h>
#include <yaz/ccl.h>
#include <yaz/yaz-ccl.h>
#include "facet_limit.h"
#include "relevance.h"
#include "reclists.h"

Go to the source code of this file.

Data Structures

struct  session_database
 
struct  named_termlist
 
struct  session_watchentry
 
struct  session
 
struct  statistics
 
struct  hitsbytarget
 

Macros

#define SESSION_WATCH_SHOW   0
 
#define SESSION_WATCH_RECORD   1
 
#define SESSION_WATCH_SHOW_PREF   2
 
#define SESSION_WATCH_TERMLIST   3
 
#define SESSION_WATCH_BYTARGET   4
 
#define SESSION_WATCH_MAX   4
 

Typedefs

typedef void(* session_watchfun) (void *data)
 

Enumerations

enum  pazpar2_error_code {
  PAZPAR2_NO_ERROR = 0 , PAZPAR2_NO_SESSION , PAZPAR2_MISSING_PARAMETER , PAZPAR2_MALFORMED_PARAMETER_VALUE ,
  PAZPAR2_MALFORMED_PARAMETER_ENCODING , PAZPAR2_MALFORMED_SETTING , PAZPAR2_HITCOUNTS_FAILED , PAZPAR2_RECORD_MISSING ,
  PAZPAR2_NO_TARGETS , PAZPAR2_CONFIG_TARGET , PAZPAR2_RECORD_FAIL , PAZPAR2_NOT_IMPLEMENTED ,
  PAZPAR2_NO_SERVICE , PAZPAR2_ALREADY_BLOCKED , PAZPAR2_LAST_ERROR
}
 

Functions

struct hitsbytargetget_hitsbytarget (struct session *s, int *count, NMEM nmem)
 
struct sessionsession_create (NMEM nmem, struct conf_service *service, unsigned session_id)
 
void session_destroy (struct session *s)
 
void session_init_databases (struct session *s)
 
void statistics (struct session *s, struct statistics *stat)
 
int sessions_get_count (void)
 
void session_sort (struct session *se, struct reclist_sortparms *sp, const char *mergekey, const char *rank)
 
enum pazpar2_error_code session_search (struct session *s, const char *query, const char *startrecs, const char *maxrecs, const char *filter, const char *limit, const char **addinfo, const char **addinfo2, struct reclist_sortparms *sort_parm, const char *mergekey, const char *rank)
 
struct record_cluster ** show_range_start (struct session *s, struct reclist_sortparms *sp, int start, int *num, int *total, Odr_int *sumhits, Odr_int *approximation, void(*ready)(void *data), struct http_channel *chan)
 
int session_fetch_more (struct session *s)
 
void show_range_stop (struct session *s, struct record_cluster **recs)
 
struct record_clustershow_single_start (struct session *s, const char *id, struct record_cluster **prev_r, struct record_cluster **next_r)
 
void show_single_stop (struct session *s, struct record_cluster *rec)
 
int session_set_watch (struct session *s, int what, session_watchfun fun, void *data, struct http_channel *c)
 
int session_active_clients (struct session *s)
 
int session_is_preferred_clients_ready (struct session *s)
 
void session_apply_setting (struct session *se, const char *dbname, const char *setting, const char *value)
 
const char * session_setting_oneval (struct session_database *db, int offset)
 
void session_stop (struct session *se)
 
int ingest_record (struct client *cl, const char *rec, int record_no, NMEM nmem)
 ingest XML record More...
 
int ingest_xml_record (struct client *cl, xmlDoc *xdoc, int record_no, NMEM nmem, int cached_copy)
 
void session_alert_watch (struct session *s, int what)
 
void add_facet (struct session *s, const char *type, const char *value, int count, struct client *cl)
 
int session_check_cluster_limit (struct session *se, struct record_cluster *rec)
 
void perform_termlist (struct http_channel *c, struct session *se, const char *name, int num, int version)
 
const char * session_lookup_id_facet (struct session *s, struct client *cl, const char *type, const char *term)
 
void session_log (struct session *s, int level, const char *fmt,...)
 

Macro Definition Documentation

◆ SESSION_WATCH_BYTARGET

#define SESSION_WATCH_BYTARGET   4

Definition at line 71 of file session.h.

◆ SESSION_WATCH_MAX

#define SESSION_WATCH_MAX   4

Definition at line 72 of file session.h.

◆ SESSION_WATCH_RECORD

#define SESSION_WATCH_RECORD   1

Definition at line 68 of file session.h.

◆ SESSION_WATCH_SHOW

#define SESSION_WATCH_SHOW   0

Definition at line 67 of file session.h.

◆ SESSION_WATCH_SHOW_PREF

#define SESSION_WATCH_SHOW_PREF   2

Definition at line 69 of file session.h.

◆ SESSION_WATCH_TERMLIST

#define SESSION_WATCH_TERMLIST   3

Definition at line 70 of file session.h.

Typedef Documentation

◆ session_watchfun

typedef void(* session_watchfun) (void *data)

Definition at line 74 of file session.h.

Enumeration Type Documentation

◆ pazpar2_error_code

Enumerator
PAZPAR2_NO_ERROR 
PAZPAR2_NO_SESSION 
PAZPAR2_MISSING_PARAMETER 
PAZPAR2_MALFORMED_PARAMETER_VALUE 
PAZPAR2_MALFORMED_PARAMETER_ENCODING 
PAZPAR2_MALFORMED_SETTING 
PAZPAR2_HITCOUNTS_FAILED 
PAZPAR2_RECORD_MISSING 
PAZPAR2_NO_TARGETS 
PAZPAR2_CONFIG_TARGET 
PAZPAR2_RECORD_FAIL 
PAZPAR2_NOT_IMPLEMENTED 
PAZPAR2_NO_SERVICE 
PAZPAR2_ALREADY_BLOCKED 
PAZPAR2_LAST_ERROR 

Definition at line 36 of file session.h.

Function Documentation

◆ add_facet()

void add_facet ( struct session s,
const char *  type,
const char *  value,
int  count,
struct client cl 
)

◆ get_hitsbytarget()

struct hitsbytarget* get_hitsbytarget ( struct session s,
int *  count,
NMEM  nmem 
)

Definition at line 1184 of file session.c.

References hitsbytarget_nb(), session_enter(), and session_leave().

Referenced by bytarget_response().

◆ ingest_record()

int ingest_record ( struct client cl,
const char *  rec,
int  record_no,
NMEM  nmem 
)

ingest XML record

Parameters
clclient holds the result set for record
recrecord buffer (0 terminated)
record_norecord position (1, 2, ..)
nmemworking NMEM
Return values
0OK
-1failure
-2Filtered

Definition at line 1874 of file session.c.

References client_get_database(), client_get_session(), client_store_xdoc(), ingest_xml_record(), conf_service::nmem, normalize_record(), and session::service.

Referenced by client_record_ingest().

◆ ingest_xml_record()

int ingest_xml_record ( struct client cl,
xmlDoc *  xdoc,
int  record_no,
NMEM  nmem,
int  cached_copy 
)

◆ perform_termlist()

void perform_termlist ( struct http_channel c,
struct session se,
const char *  name,
int  num,
int  version 
)

◆ session_active_clients()

int session_active_clients ( struct session s)

◆ session_alert_watch()

void session_alert_watch ( struct session s,
int  what 
)

◆ session_apply_setting()

void session_apply_setting ( struct session se,
const char *  dbname,
const char *  setting,
const char *  value 
)

◆ session_check_cluster_limit()

int session_check_cluster_limit ( struct session se,
struct record_cluster rec 
)

◆ session_create()

struct session* session_create ( NMEM  nmem,
struct conf_service service,
unsigned  session_id 
)

◆ session_destroy()

void session_destroy ( struct session s)

◆ session_fetch_more()

int session_fetch_more ( struct session s)

◆ session_init_databases()

void session_init_databases ( struct session s)

◆ session_is_preferred_clients_ready()

int session_is_preferred_clients_ready ( struct session s)

◆ session_log()

void session_log ( struct session s,
int  level,
const char *  fmt,
  ... 
)

◆ session_lookup_id_facet()

const char* session_lookup_id_facet ( struct session s,
struct client cl,
const char *  type,
const char *  term 
)

◆ session_search()

enum pazpar2_error_code session_search ( struct session s,
const char *  query,
const char *  startrecs,
const char *  maxrecs,
const char *  filter,
const char *  limit,
const char **  addinfo,
const char **  addinfo2,
struct reclist_sortparms sort_parm,
const char *  mergekey,
const char *  rank 
)

◆ session_set_watch()

int session_set_watch ( struct session s,
int  what,
session_watchfun  fun,
void *  data,
struct http_channel c 
)

◆ session_setting_oneval()

const char* session_setting_oneval ( struct session_database db,
int  offset 
)

◆ session_sort()

void session_sort ( struct session se,
struct reclist_sortparms sp,
const char *  mergekey,
const char *  rank 
)

◆ session_stop()

void session_stop ( struct session se)

Definition at line 791 of file session.c.

Referenced by cmd_stop().

◆ sessions_get_count()

int sessions_get_count ( void  )

Definition at line 116 of file session.c.

References session_use().

Referenced by cmd_info().

◆ show_range_start()

struct record_cluster** show_range_start ( struct session s,
struct reclist_sortparms sp,
int  start,
int *  num,
int *  total,
Odr_int *  sumhits,
Odr_int *  approximation,
void(*)(void *data)  ready,
struct http_channel chan 
)

◆ show_range_stop()

void show_range_stop ( struct session s,
struct record_cluster **  recs 
)

Definition at line 1543 of file session.c.

References session_leave().

Referenced by show_range_start(), and show_records().

◆ show_single_start()

struct record_cluster* show_single_start ( struct session s,
const char *  id,
struct record_cluster **  prev_r,
struct record_cluster **  next_r 
)

◆ show_single_stop()

void show_single_stop ( struct session s,
struct record_cluster rec 
)

Definition at line 1378 of file session.c.

References session_leave().

Referenced by show_record().

◆ statistics()

void statistics ( struct session s,
struct statistics stat 
)