]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/python/osrf/const.py
Cleaned up the network hint / object registration code in net_obj
[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
28 # -----------------------------------------------------------------------
29 # Session states
30 # -----------------------------------------------------------------------
31 OSRF_APP_SESSION_CONNECTED    = 0
32 OSRF_APP_SESSION_CONNECTING   = 1
33 OSRF_APP_SESSION_DISCONNECTED = 2
34
35 # -----------------------------------------------------------------------
36 # OpenSRF message types
37 # -----------------------------------------------------------------------
38 OSRF_MESSAGE_TYPE_REQUEST = 'REQUEST'
39 OSRF_MESSAGE_TYPE_STATUS  = 'STATUS' 
40 OSRF_MESSAGE_TYPE_RESULT  = 'RESULT'
41 OSRF_MESSAGE_TYPE_CONNECT = 'CONNECT'
42 OSRF_MESSAGE_TYPE_DISCONNECT = 'DISCONNECT'
43
44 # -----------------------------------------------------------------------
45 # OpenSRF message statuses
46 # -----------------------------------------------------------------------
47 OSRF_STATUS_CONTINUE                 = 100
48 OSRF_STATUS_OK                       = 200
49 OSRF_STATUS_ACCEPTED                 = 202
50 OSRF_STATUS_COMPLETE                 = 205
51 OSRF_STATUS_REDIRECTED               = 307
52 OSRF_STATUS_BADREQUEST               = 400
53 OSRF_STATUS_UNAUTHORIZED             = 401
54 OSRF_STATUS_FORBIDDEN                = 403
55 OSRF_STATUS_NOTFOUND                 = 404
56 OSRF_STATUS_NOTALLOWED               = 405
57 OSRF_STATUS_TIMEOUT                  = 408
58 OSRF_STATUS_EXPFAILED                = 417
59 OSRF_STATUS_INTERNALSERVERERROR      = 500
60 OSRF_STATUS_NOTIMPLEMENTED           = 501
61 OSRF_STATUS_VERSIONNOTSUPPORTED      = 505
62
63
64 # -----------------------------------------------------------------------
65 # Some well-known services
66 # -----------------------------------------------------------------------
67 OSRF_APP_SETTINGS = 'opensrf.settings'
68 OSRF_APP_MATH = 'opensrf.math'
69
70
71 # where do we find the settings config
72 OSRF_METHOD_GET_HOST_CONFIG = 'opensrf.settings.host_config.get'
73
74 OSRF_JSON_PAYLOAD_KEY = '__p'
75 OSRF_JSON_CLASS_KEY = '__c'
76
77