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 # -----------------------------------------------------------------------
27 OSRF_LOG_TYPE_FILE = 1
28 OSRF_LOG_TYPE_SYSLOG = 2
29 OSRF_LOG_TYPE_STDERR = 3
31 # -----------------------------------------------------------------------
33 # -----------------------------------------------------------------------
34 OSRF_APP_SESSION_CONNECTED = 0
35 OSRF_APP_SESSION_CONNECTING = 1
36 OSRF_APP_SESSION_DISCONNECTED = 2
38 # -----------------------------------------------------------------------
39 # OpenSRF message types
40 # -----------------------------------------------------------------------
41 OSRF_MESSAGE_TYPE_REQUEST = 'REQUEST'
42 OSRF_MESSAGE_TYPE_STATUS = 'STATUS'
43 OSRF_MESSAGE_TYPE_RESULT = 'RESULT'
44 OSRF_MESSAGE_TYPE_CONNECT = 'CONNECT'
45 OSRF_MESSAGE_TYPE_DISCONNECT = 'DISCONNECT'
47 # -----------------------------------------------------------------------
48 # OpenSRF message statuses
49 # -----------------------------------------------------------------------
50 OSRF_STATUS_CONTINUE = 100
52 OSRF_STATUS_ACCEPTED = 202
53 OSRF_STATUS_COMPLETE = 205
54 OSRF_STATUS_REDIRECTED = 307
55 OSRF_STATUS_BADREQUEST = 400
56 OSRF_STATUS_UNAUTHORIZED = 401
57 OSRF_STATUS_FORBIDDEN = 403
58 OSRF_STATUS_NOTFOUND = 404
59 OSRF_STATUS_NOTALLOWED = 405
60 OSRF_STATUS_TIMEOUT = 408
61 OSRF_STATUS_EXPFAILED = 417
62 OSRF_STATUS_INTERNALSERVERERROR = 500
63 OSRF_STATUS_NOTIMPLEMENTED = 501
64 OSRF_STATUS_VERSIONNOTSUPPORTED = 505
67 # -----------------------------------------------------------------------
68 # Some well-known services
69 # -----------------------------------------------------------------------
70 OSRF_APP_SETTINGS = 'opensrf.settings'
71 OSRF_APP_MATH = 'opensrf.math'
74 # where do we find the settings config
75 OSRF_METHOD_GET_HOST_CONFIG = 'opensrf.settings.host_config.get'
77 OSRF_JSON_PAYLOAD_KEY = '__p'
78 OSRF_JSON_CLASS_KEY = '__c'