pazpar2  1.13.0
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

#define SESSION_WATCH_BYTARGET   4
#define SESSION_WATCH_MAX   4

Definition at line 72 of file session.h.

Referenced by session_create().

#define SESSION_WATCH_RECORD   1

Definition at line 68 of file session.h.

Referenced by client_got_records(), and show_record().

#define SESSION_WATCH_SHOW   0
#define SESSION_WATCH_SHOW_PREF   2
#define SESSION_WATCH_TERMLIST   3

Typedef Documentation

typedef void(* session_watchfun) (void *data)

Definition at line 74 of file session.h.

Enumeration Type Documentation

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

void add_facet ( struct session s,
const char *  type,
const char *  value,
int  count,
struct client cl 
)
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().

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(), normalize_record(), and session::service.

Referenced by client_record_ingest().

int ingest_xml_record ( struct client cl,
xmlDoc *  xdoc,
int  record_no,
NMEM  nmem,
int  cached_copy 
)
void perform_termlist ( struct http_channel c,
struct session se,
const char *  name,
int  num,
int  version 
)
int session_active_clients ( struct session s)
void session_alert_watch ( struct session s,
int  what 
)
void session_apply_setting ( struct session se,
const char *  dbname,
const char *  setting,
const char *  value 
)
int session_check_cluster_limit ( struct session se,
struct record_cluster rec 
)
struct session* session_create ( NMEM  nmem,
struct conf_service service,
unsigned  session_id 
)
void session_destroy ( struct session s)
int session_fetch_more ( struct session s)
void session_init_databases ( struct session s)
int session_is_preferred_clients_ready ( struct session s)
void session_log ( struct session s,
int  level,
const char *  fmt,
  ... 
)
const char* session_lookup_id_facet ( struct session s,
struct client cl,
const char *  type,
const char *  term 
)
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 
)
int session_set_watch ( struct session s,
int  what,
session_watchfun  fun,
void *  data,
struct http_channel c 
)
const char* session_setting_oneval ( struct session_database db,
int  offset 
)
void session_sort ( struct session se,
struct reclist_sortparms sp,
const char *  mergekey,
const char *  rank 
)
void session_stop ( struct session se)
int sessions_get_count ( void  )

Definition at line 116 of file session.c.

References session_use().

Referenced by cmd_info().

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 
)
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().

struct record_cluster* show_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 
)

Definition at line 1378 of file session.c.

References session_leave().

Referenced by show_record().

void statistics ( struct session s,
struct statistics stat 
)