Imported Upstream version 0.9.2
[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 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 from 2048 to 3000 inclusive.";
64         static const char NO_ERROR[]                   = "No Error";
65         static const char RESOURCE_CREATED[]           = "Resource Created";
66         static const char RESOURCE_DELETED[]           = "Resource Deleted";
67         static const char INVALID_URI[]                = "Invalid URI";
68         static const char INVALID_IP[]                 = "Invalid IP";
69         static const char INVALID_PORT[]               = "Invalid Port";
70         static const char INVALID_CB[]                 = "Invalid Callback";
71         static const char INVALID_METHOD[]             = "Invalid Method";
72         static const char INVALID_QUERY[]              = "Invalid Query";
73         static const char INVALID_PARAM[]              = "Invalid Param";
74         static const char INVALID_OBESERVE[]           = "Invalid Observe Param";
75         static const char NO_MEMORY[]                  = "No Memory";
76         static const char COMM_ERROR[]                 = "Communication Error";
77         static const char TIMEOUT[]                    = "Timeout";
78         static const char ADAPTER_NOT_ENABLED[]        = "Adapter Not Enabled";
79         static const char NOT_IMPL[]                   = "Not Implemented";
80         static const char NOT_FOUND[]                  = "Resource Not Found";
81         static const char RESOURCE_ERROR[]             = "Resource Error";
82         static const char SLOW_RESOURCE[]              = "Slow Resource";
83         static const char DUPLICATE_REQUEST[]          = "Duplicate Request";
84         static const char NO_OBSERVERS[]               = "No Observers";
85         static const char OBSV_NO_FOUND[]              = "Stack observer not found";
86         static const char OBSV_NOT_ADDED[]             = "Stack observer not added";
87         static const char OBSV_NOT_REMOVED[]           = "Stack observer not removed";
88         static const char STACK_RESOURCE_DELETED[]     = "The specified resource has been deleted";
89         static const char PRESENCE_STOPPED[]           = "Stack presence stopped";
90         static const char PRESENCE_TIMEOUT[]           = "Stack presence timed out";
91         static const char PRESENCE_NOT_HANDLED[]       = "Stack presence should not be handled";
92         static const char INVALID_OPTION[]             = "Invalid option";
93         static const char GENERAL_FAULT[]              = "General Fault";
94         static const char MALFORMED_STACK_RESPONSE[]   = "Response from OC_STACK is malformed";
95         static const char VIRTUAL_DO_NOT_HANDLE[]      = "Virtual Do Not Handle";
96         static const char PERSISTENT_BUFFER_REQUIRED[] = "Persistent response buffer required";
97         static const char STACK_CONTINUE[]             = "Stack continue";
98         static const char INVALID_REQUEST_HANDLE[]     = "Invalid request handle";
99         static const char UNKNOWN_ERROR[]              = "Unknown Error";
100         static const char INVALID_REPRESENTATION[]     = "Invalid Payload JSON";
101         static const char INVALID_JSON_TYPE[]          = "Unrecognized JSON Type ";
102         static const char INVALID_JSON_NUMERIC[]       = "Unrecognized JSON Numeric ";
103         static const char INVALID_JSON_ARRAY_DEPTH[]   = "Max JSON Array Depth exceeded";
104         static const char INVALID_JSON_TYPE_TAG[]      = "Invalid JSON Type Tag";
105         static const char INVALID_ATTRIBUTE[]          = "Invalid Attribute: ";
106         static const char INVALID_DEVICE_INFO[]        = "Invalid Device Information";
107         static const char UNAUTHORIZED_REQUEST[]       = "Unauthorized Request";
108
109     }
110
111     namespace Error
112     {
113         static const char INVALID_IP[]                 = "Invalid IP";
114     }
115
116     namespace PlatformCommands
117     {
118         static const std::string GET                        = "GET";
119         static const std::string PUT                        = "PUT";
120         static const std::string POST                       = "POST";
121         static const std::string DELETE                     = "DELETE";
122     }
123
124     namespace Key
125     {
126         static const std::string OCKEY                      = "oic";
127         static const std::string URIKEY                     = "href";
128         static const std::string POLICYKEY                  = "p";
129         static const std::string BMKEY                      = "bm";
130         static const std::string RESOURCETYPESKEY           = "rt";
131         static const std::string INTERFACESKEY              = "if";
132         static const std::string PROPERTYKEY                = "prop";
133         static const std::string REPKEY                     = "rep";
134         static const std::string SECUREKEY                  = "sec";
135         static const std::string PORTKEY                    = "port";
136         static const std::string DEVICEIDKEY                = "di";
137         static const std::string LINKS                      = "links";
138
139     }
140
141 }
142
143 #endif // _STRING_CONSTANTS_H_
144