pazpar2  1.6.30
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 "termlists.h"
#include "reclists.h"
#include "http.h"

Go to the source code of this file.

Data Structures

struct  database
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
#define SESSION_MAX_TERMLISTS   10

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 sessionnew_session (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)
void session_sort (struct session *se, struct reclist_sortparms *sp)
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, struct reclist_sortparms *sort_parm)
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, char *dbname, char *setting, char *value)
const char * session_setting_oneval (struct session_database *db, int offset)
int ingest_record (struct client *cl, const char *rec, int record_no, NMEM nmem)
 ingest XML record
void session_alert_watch (struct session *s, int what)
void add_facet (struct session *s, const char *type, const char *value, int count)
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)
void session_log (struct session *s, int level, const char *fmt,...)

Macro Definition Documentation

#define SESSION_MAX_TERMLISTS   10

Definition at line 84 of file session.h.

Referenced by add_facet().

#define SESSION_WATCH_BYTARGET   4

Definition at line 81 of file session.h.

Referenced by client_got_records(), client_set_state(), and cmd_bytarget().

#define SESSION_WATCH_MAX   4

Definition at line 82 of file session.h.

Referenced by new_session().

#define SESSION_WATCH_RECORD   1

Definition at line 78 of file session.h.

Referenced by client_got_records(), and show_record().

#define SESSION_WATCH_SHOW   0

Definition at line 77 of file session.h.

Referenced by client_got_records(), client_set_state(), cmd_show(), and show_range_start().

#define SESSION_WATCH_SHOW_PREF   2

Definition at line 79 of file session.h.

Referenced by client_check_preferred_watch(), client_set_state(), and cmd_show().

#define SESSION_WATCH_TERMLIST   3

Definition at line 80 of file session.h.

Referenced by client_got_records(), client_set_state(), and cmd_termlist().

Typedef Documentation

typedef void(* session_watchfun)(void *data)

Definition at line 86 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 37 of file session.h.

Function Documentation

void add_facet ( struct session s,
const char *  type,
const char *  value,
int  count 
)
struct hitsbytarget* get_hitsbytarget ( struct session s,
int *  count,
NMEM  nmem 
)
read

Definition at line 1032 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 1647 of file session.c.

References check_record_filter(), client_get_database(), client_get_session(), session_database::database, get_mergekey(), database::id, ingest_to_cluster(), normalize_record(), session::relevance, session::service, session_enter(), session_leave(), and session_log().

Referenced by client_record_ingest().

struct session* new_session ( NMEM  nmem,
struct conf_service service,
unsigned  session_id 
)
read
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,
char *  dbname,
char *  setting,
char *  value 
)
int session_check_cluster_limit ( struct session se,
struct record_cluster rec 
)
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,
  ... 
)
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,
struct reclist_sortparms sort_parm 
)
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 
)

Definition at line 720 of file session.c.

References session_sort_unlocked().

Referenced by cmd_show().

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 
)
read
void show_range_stop ( struct session s,
struct record_cluster **  recs 
)

Definition at line 1367 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 
)
read
void show_single_stop ( struct session s,
struct record_cluster rec 
)

Definition at line 1227 of file session.c.

References session_leave().

Referenced by show_record().

void statistics ( struct session s,
struct statistics stat 
)