pazpar2
1.14.1
|
Z39.50 client. More...
Go to the source code of this file.
Enumerations | |
enum | client_state { Client_Connecting , Client_Idle , Client_Working , Client_Error , Client_Failed , Client_Disconnected } |
Functions | |
int | clients_get_count (void) |
int | client_show_raw_begin (struct client *cl, int position, const char *syntax, const char *esn, void *data, void(*error_handler)(void *data, const char *addinfo), void(*record_handler)(void *data, const char *buf, size_t sz), int binary, const char *nativesyntax) |
void | client_show_raw_remove (struct client *cl, void *rr) |
const char * | client_get_state_str (struct client *cl) |
enum client_state | client_get_state (struct client *cl) |
void | client_set_state (struct client *cl, enum client_state st) |
void | client_set_state_nb (struct client *cl, enum client_state st) |
struct connection * | client_get_connection (struct client *cl) |
struct session_database * | client_get_database (struct client *cl) |
void | client_set_database (struct client *cl, struct session_database *db) |
struct session * | client_get_session (struct client *cl) |
void | client_search_response (struct client *cl) |
void | client_record_response (struct client *cl, int *got_records) |
struct client * | client_create (const char *url) |
int | client_destroy (struct client *c) |
void | client_set_connection (struct client *cl, struct connection *con) |
void | client_disconnect (struct client *cl) |
void | client_mark_dead (struct client *cl) |
int | client_prep_connection (struct client *cl, int operation_timeout, int session_timeout, iochan_man_t iochan, const struct timeval *abstime) |
int | client_start_search (struct client *cl) |
int | client_fetch_more (struct client *cl) |
int | client_parse_init (struct client *cl, int same_search) |
int | client_parse_range (struct client *cl, const char *startrecs, const char *maxrecs) |
int | client_parse_sort (struct client *cl, struct reclist_sortparms *sp, int *has_sortmap) |
void | client_set_session (struct client *cl, struct session *se) |
int | client_is_active (struct client *cl) |
int | client_is_active_preferred (struct client *cl) |
struct client * | client_next_in_session (struct client *cl) |
int | client_parse_query (struct client *cl, const char *query, facet_limits_t facet_limits, const char **error_msg) |
Odr_int | client_get_hits (struct client *cl) |
Odr_int | client_get_approximation (struct client *cl) |
int | client_get_num_records (struct client *cl, int *filtered, int *ingest, int *failed) |
int | client_get_diagnostic (struct client *cl, const char **message, const char **addinfo) |
void | client_set_diagnostic (struct client *cl, int diagnostic, const char *message, const char *addinfo) |
const char * | client_get_id (struct client *cl) |
int | client_get_maxrecs (struct client *cl) |
void | client_remove_from_session (struct client *c) |
void | client_incref (struct client *c) |
void | client_got_records (struct client *c) |
void | client_lock (struct client *c) |
void | client_unlock (struct client *c) |
void | client_stop (struct client *c) |
int | client_has_facet (struct client *cl, const char *name) |
int | client_reingest (struct client *cl) |
const char * | client_get_facet_limit_local (struct client *cl, struct session_database *sdb, int *l, NMEM nmem, int *num, char ***values) |
const char * | client_get_suggestions_xml (struct client *cl, WRBUF wrbuf) |
void | client_update_show_stat (struct client *cl, int cmd) |
void | client_store_xdoc (struct client *cl, int record_no, xmlDoc *xdoc) |
const char * | client_get_query (struct client *cl, const char **type, NMEM nmem) |
Z39.50 client.
Definition in file client.h.
enum client_state |
struct client* client_create | ( | const char * | url | ) |
Definition at line 1055 of file client.c.
References client::addinfo, Client_Disconnected, client_init_xdoc(), client_use(), client::connection, client::cqlquery, client::database, client::diagnostic, client::facet_limits, client::filtered, client::hits, client::id, client::maxrecs, client::message, client::mutex, pazpar2_mutex_create(), client::pquery, client::preferred, client::record_offset, client::ref_count, client::resultset, client::session, client::show_raw, client::sort_criteria, client::sort_strategy, client::startrecs, client::state, and client::suggestions.
Referenced by select_targets_callback().
int client_destroy | ( | struct client * | c | ) |
Definition at line 1108 of file client.c.
References client::addinfo, client_destroy_xdoc(), client_get_id(), client_use(), client::connection, client::cqlquery, client::facet_limits, facet_limits_destroy(), client::id, client::message, client::mutex, pazpar2_decref(), client::pquery, client::ref_count, client::resultset, client::sort_criteria, and client::sort_strategy.
Referenced by client_set_connection(), and session_remove_cached_clients().
void client_disconnect | ( | struct client * | cl | ) |
Definition at line 1163 of file client.c.
References Client_Disconnected, Client_Idle, client_set_connection(), client_set_state(), and client::state.
Referenced by connection_destroy().
int client_fetch_more | ( | struct client * | cl | ) |
Definition at line 822 of file client.c.
References client_get_connection(), client_get_database(), client_get_id(), client_set_state(), Client_Working, connection_continue(), client::hits, client::ingest_failures, PZ_ELEMENTS, PZ_EXTENDRECS, PZ_REQUESTSYNTAX, client::record_failures, client::record_offset, client::resultset, session_setting_oneval(), and client::show_stat_no.
Referenced by session_fetch_more().
Odr_int client_get_approximation | ( | struct client * | cl | ) |
Definition at line 1751 of file client.c.
References client_get_id(), client::filtered, client::hits, and client::record_offset.
Referenced by hitsbytarget_nb(), and show_range_start().
struct connection* client_get_connection | ( | struct client * | cl | ) |
Definition at line 246 of file client.c.
References client::connection.
Referenced by client_fetch_more(), client_prep_connection(), client_send_raw_present(), client_start_search(), hitsbytarget_nb(), and statistics().
struct session_database* client_get_database | ( | struct client * | cl | ) |
Definition at line 251 of file client.c.
References client::database.
Referenced by apply_limit(), check_limit_local(), client_fetch_more(), client_has_facet(), client_parse_query(), client_prep_connection(), client_record_ingest(), client_report_facets(), client_send_raw_present(), client_set_facets_request(), client_show_raw_begin(), client_start_search(), connection_connect(), findnorm(), get_strategy_plus_sort(), hitsbytarget_nb(), ingest_record(), ingest_to_cluster(), ingest_xml_record(), prepare_cclmap(), select_targets_callback(), and write_subrecord().
int client_get_diagnostic | ( | struct client * | cl, |
const char ** | message, | ||
const char ** | addinfo | ||
) |
Definition at line 1789 of file client.c.
References client::addinfo, client::diagnostic, and client::message.
Referenced by hitsbytarget_nb().
const char* client_get_facet_limit_local | ( | struct client * | cl, |
struct session_database * | sdb, | ||
int * | l, | ||
NMEM | nmem, | ||
int * | num, | ||
char *** | values | ||
) |
Definition at line 1289 of file client.c.
References client::facet_limits, facet_limits_get(), name, setting::name, setting::next, PZ_LIMITMAP, session_database::settings, and setting::value.
Referenced by check_limit_local().
Odr_int client_get_hits | ( | struct client * | cl | ) |
Definition at line 1746 of file client.c.
References client::hits.
Referenced by hitsbytarget_nb(), ingest_to_cluster(), session_fetch_more(), show_range_start(), and statistics().
const char* client_get_id | ( | struct client * | cl | ) |
Definition at line 1833 of file client.c.
References client::id.
Referenced by client_destroy(), client_fetch_more(), client_get_approximation(), client_incref(), client_parse_query(), client_parse_sort(), client_prep_connection(), client_record_ingest(), client_record_response(), client_search_response(), client_send_raw_present(), client_set_state(), client_start_search(), client_stop(), connection_connect(), get_mergekey(), hitsbytarget_nb(), non_block_events(), prepare_cclmap(), record_create(), session_add_id_facet(), session_fetch_more(), session_lookup_id_facet(), session_sort(), and write_subrecord().
int client_get_maxrecs | ( | struct client * | cl | ) |
Definition at line 1838 of file client.c.
References client::maxrecs.
Referenced by ingest_to_cluster().
int client_get_num_records | ( | struct client * | cl, |
int * | filtered, | ||
int * | ingest, | ||
int * | failed | ||
) |
Definition at line 1765 of file client.c.
References client::filtered, client::ingest_failures, client::record_failures, and client::record_offset.
Referenced by hitsbytarget_nb(), and session_fetch_more().
const char* client_get_query | ( | struct client * | cl, |
const char ** | type, | ||
NMEM | nmem | ||
) |
Definition at line 894 of file client.c.
References client::cqlquery, and client::pquery.
Referenced by hitsbytarget_nb().
Definition at line 256 of file client.c.
References client::session.
Referenced by check_limit_local(), client_parse_query(), client_record_ingest(), client_record_response(), client_report_facets(), client_search_response(), client_start_search(), connection_connect(), findnorm(), ingest_record(), ingest_sub_record(), ingest_to_cluster(), ingest_xml_record(), and non_block_events().
enum client_state client_get_state | ( | struct client * | cl | ) |
Definition at line 161 of file client.c.
References client_states, and client::state.
Referenced by session_fetch_more(), session_sort(), and statistics().
const char* client_get_state_str | ( | struct client * | cl | ) |
Definition at line 161 of file client.c.
Referenced by hitsbytarget_nb(), and session_fetch_more().
const char* client_get_suggestions_xml | ( | struct client * | cl, |
WRBUF | wrbuf | ||
) |
Definition at line 1799 of file client.c.
References suggestions::num, suggestions::passthrough, and client::suggestions.
Referenced by hitsbytarget_nb().
void client_got_records | ( | struct client * | c | ) |
Definition at line 580 of file client.c.
References client_lock(), client_unlock(), session::reclist, reclist_get_num_records(), client::session, session_alert_watch(), session_is_preferred_clients_ready(), SESSION_WATCH_BYTARGET, SESSION_WATCH_RECORD, SESSION_WATCH_SHOW, SESSION_WATCH_SHOW_PREF, and SESSION_WATCH_TERMLIST.
Referenced by non_block_events().
int client_has_facet | ( | struct client * | cl, |
const char * | name | ||
) |
Definition at line 773 of file client.c.
References client_get_database(), name, setting::name, setting::next, PZ_FACETMAP, and session_database::settings.
Referenced by ingest_to_cluster().
void client_incref | ( | struct client * | c | ) |
Definition at line 1101 of file client.c.
References client_get_id(), client::mutex, pazpar2_incref(), and client::ref_count.
Referenced by client_set_connection().
int client_is_active | ( | struct client * | cl | ) |
Definition at line 1726 of file client.c.
References Client_Connecting, Client_Working, client::connection, and client::state.
Referenced by client_set_state(), and session_active_clients().
int client_is_active_preferred | ( | struct client * | cl | ) |
Definition at line 1734 of file client.c.
References Client_Connecting, Client_Working, client::connection, client::preferred, and client::state.
Referenced by session_is_preferred_clients_ready().
void client_lock | ( | struct client * | c | ) |
Definition at line 1091 of file client.c.
References client::mutex.
Referenced by client_got_records(), client_set_connection(), client_stop(), connection_continue(), connection_handler(), session_remove_cached_clients(), and session_reset_active_clients().
void client_mark_dead | ( | struct client * | cl | ) |
Definition at line 1170 of file client.c.
References client::connection, and connection_mark_dead().
Referenced by session_remove_cached_clients().
int client_parse_init | ( | struct client * | cl, |
int | same_search | ||
) |
Definition at line 867 of file client.c.
References client::same_search.
Referenced by session_sort().
int client_parse_query | ( | struct client * | cl, |
const char * | query, | ||
facet_limits_t | facet_limits, | ||
const char ** | error_msg | ||
) |
Definition at line 1502 of file client.c.
References apply_limit(), conf_service::ccl_bibset, conf_service::charsets, Client_Error, client_get_database(), client_get_id(), client_get_session(), client_set_state(), client::cqlquery, client::facet_limits, facet_limits_destroy(), facet_limits_dup(), make_cqlquery(), make_solrquery(), client::pquery, prepare_cclmap(), PZ_PQF_PREFIX, PZ_PQF_STRFTIME, PZ_QUERY_SYNTAX, PZ_SRU, conf_service::rank_cluster, conf_service::rank_follow, conf_service::rank_lead, conf_service::rank_length, session::relevance, relevance_create_ccl(), client::same_search, session::service, session_log(), and session_setting_oneval().
int client_parse_range | ( | struct client * | cl, |
const char * | startrecs, | ||
const char * | maxrecs | ||
) |
Definition at line 876 of file client.c.
References client::maxrecs, client::same_search, and client::startrecs.
int client_parse_sort | ( | struct client * | cl, |
struct reclist_sortparms * | sp, | ||
int * | has_sortmap | ||
) |
Definition at line 1654 of file client.c.
References client_get_id(), get_strategy_plus_sort(), reclist_sortparms::increasing, reclist_sortparms::name, client::same_search, client::sort_criteria, and client::sort_strategy.
Referenced by session_sort().
int client_prep_connection | ( | struct client * | cl, |
int | operation_timeout, | ||
int | session_timeout, | ||
iochan_man_t | iochan, | ||
const struct timeval * | abstime | ||
) |
Definition at line 471 of file connection.c.
References client_get_connection(), client_get_database(), client_get_id(), connection_create(), session_database::database, database::id, connection::link, PZ_URL, PZ_ZPROXY, session_setting_oneval(), and session_timeout().
Referenced by client_start_search().
void client_record_response | ( | struct client * | cl, |
int * | got_records | ||
) |
Definition at line 693 of file client.c.
References show_raw::active, Client_Error, client_get_id(), client_get_session(), client_record_ingest(), client_set_state(), client::connection, connection_get_link(), error(), ingest_raw_record(), connection::link, show_raw::position, client::resultset, session_log(), and client::show_raw.
Referenced by non_block_events().
int client_reingest | ( | struct client * | cl | ) |
Definition at line 732 of file client.c.
References client_record_ingest(), client::filtered, client::ingest_failures, client::record_failures, client::record_offset, and client::startrecs.
Referenced by client_start_search().
void client_remove_from_session | ( | struct client * | c | ) |
void client_search_response | ( | struct client * | cl | ) |
Definition at line 549 of file client.c.
References Client_Error, client_get_id(), client_get_session(), client_report_facets(), client_set_state(), client_suggestions_create(), client_suggestions_destroy(), client::connection, connection_get_link(), error(), client::hits, connection::link, client::record_offset, client::resultset, session_log(), client::startrecs, and client::suggestions.
Referenced by non_block_events().
void client_set_connection | ( | struct client * | cl, |
struct connection * | con | ||
) |
Definition at line 1144 of file client.c.
References client_destroy(), client_incref(), client_lock(), client_unlock(), client::connection, and client::resultset.
Referenced by client_disconnect(), and connection_create().
void client_set_database | ( | struct client * | cl, |
struct session_database * | db | ||
) |
Definition at line 1828 of file client.c.
References client::database.
Referenced by select_targets_callback(), and session_remove_cached_clients().
void client_set_diagnostic | ( | struct client * | cl, |
int | diagnostic, | ||
const char * | message, | ||
const char * | addinfo | ||
) |
Definition at line 1777 of file client.c.
References client::addinfo, client::diagnostic, and client::message.
Referenced by connection_connect(), non_block_events(), and prepare_cclmap().
Definition at line 1721 of file client.c.
References client::session.
Referenced by select_targets_callback(), session_remove_cached_clients(), and session_reset_active_clients().
void client_set_state | ( | struct client * | cl, |
enum client_state | st | ||
) |
Definition at line 176 of file client.c.
References client_get_id(), client_is_active(), client::session, session_active_clients(), session_alert_watch(), SESSION_WATCH_BYTARGET, SESSION_WATCH_SHOW, SESSION_WATCH_SHOW_PREF, SESSION_WATCH_TERMLIST, and client::state.
Referenced by client_disconnect(), client_fetch_more(), client_parse_query(), client_record_response(), client_search_response(), client_start_search(), connection_connect(), and non_block_events().
void client_set_state_nb | ( | struct client * | cl, |
enum client_state | st | ||
) |
Definition at line 171 of file client.c.
References client::state.
Referenced by connection_connect(), and prepare_cclmap().
int client_show_raw_begin | ( | struct client * | cl, |
int | position, | ||
const char * | syntax, | ||
const char * | esn, | ||
void * | data, | ||
void(*)(void *data, const char *addinfo) | error_handler, | ||
void(*)(void *data, const char *buf, size_t sz) | record_handler, | ||
int | binary, | ||
const char * | nativesyntax | ||
) |
Definition at line 299 of file client.c.
References show_raw::active, show_raw::binary, Client_Disconnected, Client_Failed, client_get_database(), client_send_raw_present(), client_show_immediate(), client_show_raw_error(), client::connection, show_raw::data, show_raw::error_handler, show_raw::esn, show_raw::nativesyntax, show_raw::next, show_raw::position, PZ_NATIVESYNTAX, show_raw::record_handler, client::resultset, session_setting_oneval(), client::show_raw, client::state, and show_raw::syntax.
Referenced by show_record().
void client_show_raw_remove | ( | struct client * | cl, |
void * | rr | ||
) |
Definition at line 381 of file client.c.
References client_show_raw_delete(), show_raw::data, show_raw::next, and client::show_raw.
int client_start_search | ( | struct client * | cl | ) |
Definition at line 910 of file client.c.
References client_destroy_xdoc(), client_get_connection(), client_get_database(), client_get_id(), client_get_session(), client_init_xdoc(), client_prep_connection(), client_reingest(), client_report_facets(), client_set_facets_request(), client_set_state(), Client_Working, connection_continue(), connection_get_link(), client::cqlquery, client::diagnostic, client::filtered, client::hits, client::ingest_failures, conf_server::iochan_man, connection::link, client::maxrecs, client::pquery, client::preferred, PZ_ELEMENTS, PZ_EXTRA_ARGS, PZ_MAXRECS, PZ_PIGGYBACK, PZ_PREFERRED, PZ_PRESENT_CHUNK, PZ_QUERYENCODING, PZ_REQUESTSYNTAX, PZ_SORT, PZ_SRU, PZ_TIMEOUT, client::record_failures, client::record_offset, client::resultset, client::same_search, conf_service::server, session::service, session_log(), session_setting_oneval(), client::sort_criteria, client::sort_strategy, client::startrecs, conf_service::z3950_operation_timeout, and conf_service::z3950_session_timeout.
Referenced by session_sort().
void client_stop | ( | struct client * | c | ) |
Definition at line 1176 of file client.c.
References Client_Connecting, Client_Disconnected, client_get_id(), client_lock(), client_unlock(), Client_Working, client::connection, connection_release2(), client::ref_count, and client::state.
Referenced by session_search().
void client_store_xdoc | ( | struct client * | cl, |
int | record_no, | ||
xmlDoc * | xdoc | ||
) |
Definition at line 228 of file client.c.
References client::xdoc, and XDOC_CACHE_SIZE.
Referenced by ingest_record().
void client_unlock | ( | struct client * | c | ) |
Definition at line 1096 of file client.c.
References client::mutex.
Referenced by client_got_records(), client_set_connection(), client_stop(), connection_continue(), connection_handler(), session_remove_cached_clients(), and session_reset_active_clients().
void client_update_show_stat | ( | struct client * | cl, |
int | cmd | ||
) |
Definition at line 814 of file client.c.
References client::show_stat_no.
Referenced by show_range_start().
int clients_get_count | ( | void | ) |