Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

msproxy.h File Reference

Proxy interface for remote model storage. More...

#include "stmt/statement.h"

Include dependency graph for msproxy.h:

Go to the source code of this file.

Defines

#define MS_PROXY_ERROR_CMD_FAIL   -88002
#define MS_PROXY_ERROR_CMD_INCORRECT   -88003
#define MS_PROXY_ERROR_CMD_UNKNOWN   -88004
#define MS_PROXY_ERROR_DATA_WRONG   -88005
#define MS_PROXY_ERROR_RECV_FAIL   -88001
#define MS_PROXY_ERROR_WRONG_HASH   -88006
#define MS_SERVER_ERROR_TXN_EXIST   -88400
#define MS_SERVER_ERROR_TXN_NOT_EXIST   -88401
#define PROXY_STORAGE_TYPE   extern

Typedefs

typedef _client_conn client_conn
 Client connection type.

Functions

PROXY_STORAGE_TYPE int model_server_batch_get (client_conn *pconn, const Statement *masks, Statement **result)
 perform multiquery for statements from ModelStorage using current transaction.
PROXY_STORAGE_TYPE int model_server_cleanup ()
 Cleanups subsystems.
PROXY_STORAGE_TYPE int model_server_connect (const char *server_name, unsigned short server_port, client_conn **ppconn)
 Connects to server, creates client_conn object to identificate remote ModelStorage connection (conn.
PROXY_STORAGE_TYPE void model_server_connection_close (client_conn *pconn)
 Closes remote ModelStorage connection, clears connection object.
PROXY_STORAGE_TYPE int model_server_get (client_conn *pconn, const Statement *pmask, Statement **result)
 Gets statements from ModelStorage using current transaction.
PROXY_STORAGE_TYPE int model_server_get_count (client_conn *pconn, const Statement *pmask, unsigned long *result)
PROXY_STORAGE_TYPE int model_server_get_new_id (client_conn *pconn, Node *idnode)
 Gets new id from ModelStorage.
PROXY_STORAGE_TYPE int model_server_init ()
 Inits internal subsystems.
PROXY_STORAGE_TYPE int model_server_login (client_conn *pconn, const char *login, const char *password)
 Loging in ModelStorage server.
PROXY_STORAGE_TYPE int model_server_logout (client_conn *pconn)
 Loging out ModelStorage server.
PROXY_STORAGE_TYPE int model_server_notify (client_conn *pconn, const char *login)
 Open notification connection.
PROXY_STORAGE_TYPE int model_server_read_notifications (client_conn *pconn, Statement **result)
 Gets notifications from ModelStorage.
PROXY_STORAGE_TYPE void model_server_result_free (Statement **result)
 Use this function for freeing results from model_server_get() & model_server_notifications().
PROXY_STORAGE_TYPE int model_server_set (client_conn *pconn, const Statement *pst)
 Sets statement in ModelStorage.
PROXY_STORAGE_TYPE int model_server_txn_begin (client_conn *pconn)
 Begins transaction.
PROXY_STORAGE_TYPE int model_server_txn_commit (client_conn *pconn)
 Commits current transaction.
PROXY_STORAGE_TYPE int model_server_txn_rollback (client_conn *pconn)
 Rollbacks current transaction.


Detailed Description

Proxy interface for remote model storage.


Define Documentation

#define MS_PROXY_ERROR_CMD_FAIL   -88002
 

#define MS_PROXY_ERROR_CMD_INCORRECT   -88003
 

#define MS_PROXY_ERROR_CMD_UNKNOWN   -88004
 

#define MS_PROXY_ERROR_DATA_WRONG   -88005
 

#define MS_PROXY_ERROR_RECV_FAIL   -88001
 

#define MS_PROXY_ERROR_WRONG_HASH   -88006
 

#define MS_SERVER_ERROR_TXN_EXIST   -88400
 

#define MS_SERVER_ERROR_TXN_NOT_EXIST   -88401
 

#define PROXY_STORAGE_TYPE   extern
 


Typedef Documentation

typedef struct _client_conn client_conn
 

Client connection type.


Function Documentation

PROXY_STORAGE_TYPE int model_server_batch_get client_conn pconn,
const Statement masks,
Statement **  result
 

perform multiquery for statements from ModelStorage using current transaction.

  • pconn [in] - connection descriptor
  • pmasks [in] - a list of Masks to be matched
  • result -- a pointer to the list of statements.
    Returns:
    zero on success, error value otherwise

PROXY_STORAGE_TYPE int model_server_cleanup  ) 
 

Cleanups subsystems.

Returns:
zero on success, error value otherwise

PROXY_STORAGE_TYPE int model_server_connect const char *  server_name,
unsigned short  server_port,
client_conn **  ppconn
 

Connects to server, creates client_conn object to identificate remote ModelStorage connection (conn.

desc.).

  • server_name [in] - internet name of server
  • server_port [in] - internet port of server (host byte order)
  • ppconn [out] - pointer empty pointer of type client_conn.
    Returns:
    zero on success, error value otherwise

PROXY_STORAGE_TYPE void model_server_connection_close client_conn pconn  ) 
 

Closes remote ModelStorage connection, clears connection object.

  • pconn [in] - pointer to connection descriptor

PROXY_STORAGE_TYPE int model_server_get client_conn pconn,
const Statement pmask,
Statement **  result
 

Gets statements from ModelStorage using current transaction.

  • pconn [in] - connection descriptor
  • pmask [in] - Mask to be matched
  • result -- a pointer to the list of statements.
  • count -- a pointer to the size of result
    Returns:
    zero on success, error value otherwise

PROXY_STORAGE_TYPE int model_server_get_count client_conn pconn,
const Statement pmask,
unsigned long *  result
 

PROXY_STORAGE_TYPE int model_server_get_new_id client_conn pconn,
Node idnode
 

Gets new id from ModelStorage.

  • pconn [in] - connection descriptor
  • idnode -- an awly generated node should be placed
    Returns:
    zero on success, error value otherwise

PROXY_STORAGE_TYPE int model_server_init  ) 
 

Inits internal subsystems.

Returns:
zero on success, error value otherwise

PROXY_STORAGE_TYPE int model_server_login client_conn pconn,
const char *  login,
const char *  password
 

Loging in ModelStorage server.

  • login [in] - login name of connection
  • password [in] - password
  • pconn [in] - connection descriptor
    Returns:
    zero on success, error value otherwise

PROXY_STORAGE_TYPE int model_server_logout client_conn pconn  ) 
 

Loging out ModelStorage server.

  • pconn [in] - connection descriptor
    Returns:
    zero on success, error value otherwise

PROXY_STORAGE_TYPE int model_server_notify client_conn pconn,
const char *  login
 

Open notification connection.

PROXY_STORAGE_TYPE int model_server_read_notifications client_conn pconn,
Statement **  result
 

Gets notifications from ModelStorage.

Works only with connections, opened by model_server_notify method. Blocks the thread on unpredictable time.

  • pconn [in] - connection descriptor
  • result -- a pointer to the list of statements.
    Returns:
    zero on success, error value otherwise

PROXY_STORAGE_TYPE void model_server_result_free Statement **  result  ) 
 

Use this function for freeing results from model_server_get() & model_server_notifications().

  • result -- a pointer to the list of statements

PROXY_STORAGE_TYPE int model_server_set client_conn pconn,
const Statement pst
 

Sets statement in ModelStorage.

Statement will set независимо from satatement operation.

  • pconn [in] - connection descriptor
  • pst [in] - statement to set.
    Returns:
    zero on success, error value otherwise

PROXY_STORAGE_TYPE int model_server_txn_begin client_conn pconn  ) 
 

Begins transaction.

  • pconn [in] - connection descriptor.
    Returns:
    zero on success, error value otherwise

PROXY_STORAGE_TYPE int model_server_txn_commit client_conn pconn  ) 
 

Commits current transaction.

  • pconn [in] - connection descriptor
    Returns:
    zero on success, error value otherwise

PROXY_STORAGE_TYPE int model_server_txn_rollback client_conn pconn  ) 
 

Rollbacks current transaction.

  • pconn [in] - connection descriptor
    Returns:
    zero on success, error value otherwise


Generated on Wed Dec 27 16:52:22 2006 for VRB Online Server by  doxygen 1.4.4