Imported Upstream version 1.1.1
[platform/upstream/iotivity.git] / resource / include / StringConstants.h
1 //******************************************************************
2 //
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 #ifndef OC_STRING_CONSTANTS_H_
22 #define OC_STRING_CONSTANTS_H_
23
24 #include <string>
25
26 namespace OC
27 {
28     namespace InitException
29     {
30         static const char NO_ERROR[]                   = "No Error";
31         static const char INVALID_URI[]                = "Invalid URI";
32         static const char INVALID_PORT[]               = "Invalid Port";
33         static const char INVALID_IP[]                 = "Invalid IP";
34         static const char INVALID_CB[]                 = "Invalid Callback";
35         static const char INVALID_METHOD[]             = "Invalid Method";
36         static const char GENERAL_FAULT[]              = "General Fault";
37         static const char UNKNOWN_ERROR[]              = "Unknown Error";
38
39         static const char STACK_INIT_ERROR[]           = "Error Initializing Stack";
40         static const char NOT_CONFIGURED_AS_SERVER[]   =
41                           "Cannot static construct a Server when configured as a client";
42         static const char INVALID_PARAM[]              = "Invalid Param";
43         static const char MISSING_URI[]                = "Missing URI;";
44         static const char MISSING_TYPE[]               = "Missing Resource Type;";
45         static const char MISSING_INTERFACE[]          = "Missing Interface;";
46         static const char MISSING_CLIENT_WRAPPER[]     = "Missing ClientWrapper;";
47     }
48
49     namespace Exception // Not To Be Confused With 'InitException'
50     {
51         static const char SVCTYPE_OUTOFPROC[]          = "ServiceType::OutOfProc";
52         static const char BIND_TYPE_FAILED[]           = "Bind Type to resource failed";
53         static const char BIND_INTERFACE_FAILED[]      = "Bind Interface to resource failed";
54         static const char START_PRESENCE_FAILED[]      = "startPresence failed";
55         static const char END_PRESENCE_FAILED[]        = "stopPresence failed";
56         static const char INVALID_ARRAY[]              = "Array type should have at least []";
57         static const char STR_NULL_RESPONSE[]          = "Response is NULL";
58         static const char STR_PAYLOAD_OVERFLOW[]       = "Payload overflow";
59         static const char NIL_GUARD_NULL[]             = "nullptr at nil_guard()";
60         static const char GENERAL_JSON_PARSE_FAILED[]  = "JSON Parser Error";
61         static const char RESOURCE_UNREG_FAILED[]      = "Unregistering resource failed";
62         static const char OPTION_ID_RANGE_INVALID[]    =
63                             "Error: OptionID valid only If-Match(1), If-None-Match(5),"
64                             "Location-Path(8), Location-Query(20),"
65                             "and from 2048 to 3000 inclusive.";
66         static const char NO_ERROR[]                   = "No Error";
67         static const char RESOURCE_CREATED[]           = "Resource Created";
68         static const char RESOURCE_DELETED[]           = "Resource Deleted";
69         static const char INVALID_URI[]                = "Invalid URI";
70         static const char INVALID_IP[]                 = "Invalid IP";
71         static const char INVALID_PORT[]               = "Invalid Port";
72         static const char INVALID_CB[]                 = "Invalid Callback";
73         static const char INVALID_METHOD[]             = "Invalid Method";
74         static const char INVALID_QUERY[]              = "Invalid Query";
75         static const char INVALID_PARAM[]              = "Invalid Param";
76         static const char INVALID_OBESERVE[]           = "Invalid Observe Param";
77         static const char NO_MEMORY[]                  = "No Memory";
78         static const char COMM_ERROR[]                 = "Communication Error";
79         static const char TIMEOUT[]                    = "Timeout";
80         static const char ADAPTER_NOT_ENABLED[]        = "Adapter Not Enabled";
81         static const char NOT_IMPL[]                   = "Not Implemented";
82         static const char NOT_FOUND[]                  = "Resource Not Found";
83         static const char RESOURCE_ERROR[]             = "Resource Error";
84         static const char SLOW_RESOURCE[]              = "Slow Resource";
85         static const char DUPLICATE_REQUEST[]          = "Duplicate Request";
86         static const char NO_OBSERVERS[]               = "No Observers";
87         static const char OBSV_NO_FOUND[]              = "Stack observer not found";
88         static const char OBSV_NOT_ADDED[]             = "Stack observer not added";
89         static const char OBSV_NOT_REMOVED[]           = "Stack observer not removed";
90         static const char STACK_RESOURCE_DELETED[]     = "The specified resource has been deleted";
91         static const char PRESENCE_STOPPED[]           = "Stack presence stopped";
92         static const char PRESENCE_TIMEOUT[]           = "Stack presence timed out";
93         static const char PRESENCE_NOT_HANDLED[]       = "Stack presence should not be handled";
94         static const char INVALID_OPTION[]             = "Invalid option";
95         static const char GENERAL_FAULT[]              = "General Fault";
96         static const char MALFORMED_STACK_RESPONSE[]   = "Response from OC_STACK is malformed";
97         static const char VIRTUAL_DO_NOT_HANDLE[]      = "Virtual Do Not Handle";
98         static const char PERSISTENT_BUFFER_REQUIRED[] = "Persistent response buffer required";
99         static const char STACK_CONTINUE[]             = "Stack continue";
100         static const char INVALID_REQUEST_HANDLE[]     = "Invalid request handle";
101         static const char UNKNOWN_ERROR[]              = "Unknown Error";
102         static const char INVALID_REPRESENTATION[]     = "Invalid Payload JSON";
103         static const char INVALID_JSON_TYPE[]          = "Unrecognized JSON Type ";
104         static const char INVALID_JSON_NUMERIC[]       = "Unrecognized JSON Numeric ";
105         static const char INVALID_JSON_ARRAY_DEPTH[]   = "Max JSON Array Depth exceeded";
106         static const char INVALID_JSON_TYPE_TAG[]      = "Invalid JSON Type Tag";
107         static const char INVALID_ATTRIBUTE[]          = "Invalid Attribute: ";
108         static const char INVALID_DEVICE_INFO[]        = "Invalid Device Information";
109         static const char UNAUTHORIZED_REQUEST[]       = "Unauthorized Request";
110         static const char PDM_DB_NOT_INITIALIZED[]     = "Provisioning DB is not initialized";
111         static const char DUPLICATE_UUID[]             = "Duplicate UUID in DB";
112         static const char INCONSISTENT_DB[]            = "Data in provisioning DB is inconsistent";
113         static const char AUTHENTICATION_FAILURE[]     = "Authentication failure";
114     }
115
116     namespace Error
117     {
118         static const char INVALID_IP[]                 = "Invalid IP";
119     }
120
121     namespace PlatformCommands
122     {
123         static const std::string GET                        = "GET";
124         static const std::string PUT                        = "PUT";
125         static const std::string POST                       = "POST";
126         static const std::string DELETE                     = "DELETE";
127     }
128
129     namespace Key
130     {
131         static const std::string OCKEY                      = "oic";
132         static const std::string URIKEY                     = "href";
133         static const std::string POLICYKEY                  = "p";
134         static const std::string BMKEY                      = "bm";
135         static const std::string RESOURCETYPESKEY           = "rt";
136         static const std::string INTERFACESKEY              = "if";
137         static const std::string PROPERTYKEY                = "prop";
138         static const std::string REPKEY                     = "rep";
139         static const std::string SECUREKEY                  = "sec";
140         static const std::string PORTKEY                    = "port";
141         static const std::string DEVICEIDKEY                = "di";
142         static const std::string LINKS                      = "links";
143
144     }
145
146 }
147
148 #endif // OC_STRING_CONSTANTS_H_
149