|  | ## Cheshire3 Objects: Server

Description

A Server object is a collection point for other objects, and an initial entry point into the system for requests from a ProtocolHandler. A server might know about several Databases, RecordStores and so forth, but its main function is to check whether the request should be accepted or not and create an environment in which the request can be processed. It will likely have access to a UserStore database which maintains authentication and authorisation information. The exact nature of this information is not defined, allowing many possible backend implementations. Servers are the top level of configuration for the system and hence their constructor requires the path to a local XML configuration file, however from then on configuration information may be retrieved from other locations such as a remote datastore to enable distributed environments to maintain synchronicity.

Implementations

- server.SimpleServer
  A very simple server which instantiates and handles search, scan and sort but does not (currently) have any facility for authentication (etc).

API

Note: the Server API is not well tested and is currently under review

Function | Parameters | Returns | Description
--- | --- | --- | ---
__init__ | configFile |  | The constructer takes a file path to the configuration file to be parsed and processed.
connect | undefined | Session | Accept a connection to the server and perform any per session initialisation
disconnect | undefined | undefined | Called when a connection is dropped to perform any garbage collection or other such tidying.
search | undefined | undefined | Handle a search style request and return response
scan | undefined | undefined | Handle a browse/scan style request and return response
sort | undefined | undefined | Handle a sort style request and return response
retrieve | undefined | undefined | Handle a get/retrieve/present style request and return response
explain | undefined | undefined | Handle a get/retrieve/present style request for server metadata
deleteResultSet | undefined | undefined | Handle a request to delete an existing result set
addRecord | undefined | undefined | Handle a request to add a record to a database
replaceRecord | undefined | undefined | Handle a request to replace a record in a database
deleteRecord | undefined | undefined | Handle a request to delete a record from a database
indexRecord | undefined | undefined | Handle a request to index a specific record
addDatabase | undefined | undefined | Handle a request to create a new database from a configuration
replaceDatabase | undefined | undefined | Handle a request to replace a database configuration
deleteDatabase | undefined | undefined | Handle a request to delete an existing database
indexDatabase | undefined | undefined | Handle a request to re-index from scratch an existing database
authenticate | undefined | undefined | Handle authentication of session/request and establish user profile