1 # -----------------------------------------------------------------------
2 # Copyright (C) 2007 Georgia Public Library Service
3 # Bill Erickson <billserickson@gmail.com>
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
16 # Collection of global constants
17 # -----------------------------------------------------------------------
19 # -----------------------------------------------------------------------
21 # -----------------------------------------------------------------------
29 OSRF_LOG_TYPE_FILE = 1
30 OSRF_LOG_TYPE_SYSLOG = 2
31 OSRF_LOG_TYPE_STDERR = 3
33 # -----------------------------------------------------------------------
35 # -----------------------------------------------------------------------
36 OSRF_APP_SESSION_CONNECTED = 0
37 OSRF_APP_SESSION_CONNECTING = 1
38 OSRF_APP_SESSION_DISCONNECTED = 2
40 # -----------------------------------------------------------------------
41 # OpenSRF message types
42 # -----------------------------------------------------------------------
43 OSRF_MESSAGE_TYPE_REQUEST = 'REQUEST'
44 OSRF_MESSAGE_TYPE_STATUS = 'STATUS'
45 OSRF_MESSAGE_TYPE_RESULT = 'RESULT'
46 OSRF_MESSAGE_TYPE_CONNECT = 'CONNECT'
47 OSRF_MESSAGE_TYPE_DISCONNECT = 'DISCONNECT'
49 # -----------------------------------------------------------------------
50 # OpenSRF message statuses
51 # -----------------------------------------------------------------------
52 OSRF_STATUS_CONTINUE = 100
54 OSRF_STATUS_ACCEPTED = 202
55 OSRF_STATUS_COMPLETE = 205
56 OSRF_STATUS_REDIRECTED = 307
57 OSRF_STATUS_BADREQUEST = 400
58 OSRF_STATUS_UNAUTHORIZED = 401
59 OSRF_STATUS_FORBIDDEN = 403
60 OSRF_STATUS_NOTFOUND = 404
61 OSRF_STATUS_NOTALLOWED = 405
62 OSRF_STATUS_TIMEOUT = 408
63 OSRF_STATUS_EXPFAILED = 417
64 OSRF_STATUS_INTERNALSERVERERROR = 500
65 OSRF_STATUS_NOTIMPLEMENTED = 501
66 OSRF_STATUS_VERSIONNOTSUPPORTED = 505
69 # -----------------------------------------------------------------------
70 # Some well-known services
71 # -----------------------------------------------------------------------
72 OSRF_APP_SETTINGS = 'opensrf.settings'
73 OSRF_APP_MATH = 'opensrf.math'
76 # where do we find the settings config
77 OSRF_METHOD_GET_HOST_CONFIG = 'opensrf.settings.host_config.get'
79 OSRF_JSON_PAYLOAD_KEY = '__p'
80 OSRF_JSON_CLASS_KEY = '__c'