]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/python/osrf/const.py
implemented the majority of server-side python. still need to add settings server...
[OpenSRF.git] / src / python / osrf / const.py
1 # -----------------------------------------------------------------------
2 # Copyright (C) 2007  Georgia Public Library Service
3 # Bill Erickson <billserickson@gmail.com>
4
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.
9
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.
14 #
15 #
16 # Collection of global constants
17 # -----------------------------------------------------------------------
18
19 # -----------------------------------------------------------------------
20 # log levels
21 # -----------------------------------------------------------------------
22 OSRF_LOG_ERR    = 1
23 OSRF_LOG_WARN   = 2
24 OSRF_LOG_INFO   = 3
25 OSRF_LOG_DEBUG = 4
26 OSRF_LOG_INTERNAL = 5
27 OSRF_LOG_TYPE_FILE = 1
28 OSRF_LOG_TYPE_SYSLOG = 2
29 OSRF_LOG_TYPE_STDERR = 3
30
31 # -----------------------------------------------------------------------
32 # Session states
33 # -----------------------------------------------------------------------
34 OSRF_APP_SESSION_CONNECTED    = 0
35 OSRF_APP_SESSION_CONNECTING   = 1
36 OSRF_APP_SESSION_DISCONNECTED = 2
37
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'
46
47 # -----------------------------------------------------------------------
48 # OpenSRF message statuses
49 # -----------------------------------------------------------------------
50 OSRF_STATUS_CONTINUE                 = 100
51 OSRF_STATUS_OK                       = 200
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
65
66
67 # -----------------------------------------------------------------------
68 # Some well-known services
69 # -----------------------------------------------------------------------
70 OSRF_APP_SETTINGS = 'opensrf.settings'
71 OSRF_APP_MATH = 'opensrf.math'
72
73
74 # where do we find the settings config
75 OSRF_METHOD_GET_HOST_CONFIG = 'opensrf.settings.host_config.get'
76
77 OSRF_JSON_PAYLOAD_KEY = '__p'
78 OSRF_JSON_CLASS_KEY = '__c'
79
80