iotivity 0.9.0
[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 _STRING_CONSTANTS_H_
22 #define _STRING_CONSTANTS_H_
23
24 #include <string>
25
26 using namespace std;
27
28 namespace OC
29 {
30     namespace InitException
31     {
32         static const std::string NO_ERROR                   = "No Error";
33         static const std::string INVALID_URI                = "Invalid URI";
34         static const std::string INVALID_PORT               = "Invalid Port";
35         static const std::string INVALID_IP                 = "Invalid IP";
36         static const std::string INVALID_CB                 = "Invalid Callback";
37         static const std::string INVALID_METHOD             = "Invalid Method";
38         static const std::string GENERAL_FAULT              = "General Fault";
39         static const std::string UNKNOWN_ERROR              = "Unknown Error";
40
41         static const std::string STACK_INIT_ERROR           = "Error Initializing Stack";
42         static const std::string NOT_CONFIGURED_AS_SERVER   =
43                           "Cannot static construct a Server when configured as a client";
44         static const std::string INVALID_PARAM              = "Invalid Param";
45         static const std::string MISSING_URI                = "Missing URI;";
46         static const std::string MISSING_TYPE               = "Missing Resource Type;";
47         static const std::string MISSING_INTERFACE          = "Missing Interface;";
48         static const std::string MISSING_CLIENT_WRAPPER     = "Missing ClientWrapper;";
49     }
50
51     namespace Exception // Not To Be Confused With 'InitException'
52     {
53         static const std::string SVCTYPE_OUTOFPROC          = "ServiceType::OutOfProc";
54         static const std::string BIND_TYPE_FAILED           = "Bind Type to resource failed";
55         static const std::string BIND_INTERFACE_FAILED      = "Bind Interface to resource failed";
56         static const std::string START_PRESENCE_FAILED      = "startPresence failed";
57         static const std::string END_PRESENCE_FAILED        = "stopPresence failed";
58         static const std::string INVALID_ARRAY              = "Array type should have at least []";
59         static const std::string STR_NULL_RESPONSE          = "Response is NULL";
60         static const std::string STR_PAYLOAD_OVERFLOW       = "Payload overflow";
61         static const std::string NIL_GUARD_NULL             = "nullptr at nil_guard()";
62         static const std::string GENERAL_JSON_PARSE_FAILED  = "JSON Parser Error";
63         static const std::string RESOURCE_UNREG_FAILED      = "Unregistering resource failed";
64         static const std::string OPTION_ID_RANGE_INVALID    =
65                             "Error: OptionID valid only from 2048 to 3000 inclusive.";
66
67         static const std::string NO_ERROR                   = "No Error";
68         static const std::string RESOURCE_CREATED           = "Resource Created";
69         static const std::string RESOURCE_DELETED           = "Resource Deleted";
70         static const std::string INVALID_URI                = "Invalid URI";
71         static const std::string INVALID_IP                 = "Invalid IP";
72         static const std::string INVALID_PORT               = "Invalid Port";
73         static const std::string INVALID_CB                 = "Invalid Callback";
74         static const std::string INVALID_METHOD             = "Invalid Method";
75         static const std::string INVALID_QUERY              = "Invalid Query";
76         static const std::string INVALID_PARAM              = "Invalid Param";
77         static const std::string INVALID_OBESERVE           = "Invalid Observe Param";
78         static const std::string NO_MEMORY                  = "No Memory";
79         static const std::string COMM_ERROR                 = "Communication Error";
80         static const std::string NOT_IMPL                   = "Not Implemented";
81         static const std::string NOT_FOUND                  = "Resource Not Found";
82         static const std::string RESOURCE_ERROR             = "Resource Error";
83         static const std::string SLOW_RESOURCE              = "Slow Resource";
84         static const std::string NO_OBSERVERS               = "No Observers";
85         static const std::string OBSV_NO_FOUND              = "Stack observer not found";
86         static const std::string OBSV_NOT_ADDED             = "Stack observer not added";
87         static const std::string OBSV_NOT_REMOVED           = "Stack observer not removed";
88         static const std::string STACK_RESOURCE_DELETED     = "The specified resource has been deleted";
89         static const std::string PRESENCE_STOPPED           = "Stack presence stopped";
90         static const std::string PRESENCE_TIMEOUT           = "Stack presence timed out";
91         static const std::string PRESENCE_NOT_HANDLED       = "Stack presence should not be handled";
92         static const std::string INVALID_OPTION             = "Invalid option";
93         static const std::string GENERAL_FAULT              = "General Fault";
94         static const std::string MALFORMED_STACK_RESPONSE   = "Response from OC_STACK is malformed";
95         static const std::string VIRTUAL_DO_NOT_HANDLE      = "Virtual Do Not Handle";
96         static const std::string PERSISTENT_BUFFER_REQUIRED = "Persistent response buffer required";
97         static const std::string STACK_CONTINUE             = "Stack continue";
98         static const std::string INVALID_REQUEST_HANDLE     = "Invalid request handle";
99         static const std::string UNKNOWN_ERROR              = "Unknown Error";
100         static const std::string INVALID_REPRESENTATION     = "Invalid Payload JSON";
101         static const std::string INVALID_JSON_TYPE          = "Unrecognized JSON Type ";
102         static const std::string INVALID_JSON_NUMERIC       = "Unrecognized JSON Numeric ";
103         static const std::string INVALID_JSON_ARRAY_DEPTH   = "Max JSON Array Depth exceeded";
104         static const std::string INVALID_JSON_TYPE_TAG      = "Invalid JSON Type Tag";
105         static const std::string INVALID_ATTRIBUTE          = "Invalid Attribute: ";
106     }
107
108     namespace Error
109     {
110         static const std::string INVALID_IP                 = "Invalid IP";
111     }
112
113     namespace PlatformCommands
114     {
115         static const std::string GET                        = "GET";
116         static const std::string PUT                        = "PUT";
117         static const std::string POST                       = "POST";
118         static const std::string DELETE                     = "DELETE";
119     }
120
121     namespace Key
122     {
123         static const std::string OCKEY                      = "oc";
124         static const std::string URIKEY                     = "href";
125         static const std::string OBSERVABLEKEY              = "obs";
126         static const std::string RESOURCETYPESKEY           = "rt";
127         static const std::string INTERFACESKEY              = "if";
128         static const std::string PROPERTYKEY                = "prop";
129         static const std::string REPKEY                     = "rep";
130         static const std::string SECUREKEY                  = "sec";
131         static const std::string PORTKEY                    = "port";
132   }
133
134 }
135
136 #endif // _STRING_CONSTANTS_H_