summaryrefslogtreecommitdiff
path: root/apps/JAWS/HTTP_Helpers.h
blob: e7a48c228f98edbdea1feaca1736797506099d55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// HTTP_Helpers.h

// Design around the Singleton pattern
// Simplify interface to HTTP_types:
//  -> type(path) returns the type of the path matched by extension.
//  -> app(path) returns the app for the path matched by extension.

#ifndef HTTP_HELPERS_H_
#define HTTP_HELPERS_H_

#include "ace/Log_Msg.h"
#include "ace/Synch_T.h"

class HTTP_Status_Code
{
public:
  static char const * const * const instance(void);

  enum STATUS_CODE {
    STATUS_OK = 200,
    STATUS_CREATED = 201,
    STATUS_ACCEPTED = 202,
    STATUS_NO_CONTENT = 204,
    STATUS_MOVED_PERMANENTLY = 301,
    STATUS_MOVED_TEMPORARILY = 302,
    STATUS_NOT_MODIFIED = 304,
    STATUS_BAD_REQUEST = 400,
    STATUS_UNAUTHORIZED = 401,
    STATUS_FORBIDDEN = 403,
    STATUS_NOT_FOUND = 404,
    STATUS_INTERNAL_SERVER_ERROR = 500,
    STATUS_NOT_IMPLEMENTED = 501,
    STATUS_BAD_GATEWAY = 502,
    STATUS_SERVICE_UNAVAILABLE = 503
  };

  enum {MAX_STATUS_CODE=599};

private:
  static const char * Reason[MAX_STATUS_CODE+1];
  static int instance_;
  static ACE_Thread_Mutex lock_;

};

#endif

/// Local Variables:
/// mode: c++
/// End: