1 //******************************************************************
3 // Copyright 2014 Intel Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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
11 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #ifndef _STRING_CONSTANTS_H_
22 #define _STRING_CONSTANTS_H_
30 namespace InitException
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";
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;";
51 namespace Exception // Not To Be Confused With 'InitException'
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.";
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 =
89 "The specified resource has been deleted";
90 static const std::string PRESENCE_STOPPED = "Stack presence stopped";
91 static const std::string PRESENCE_TIMEOUT = "Stack presence timed out";
92 static const std::string PRESENCE_NOT_HANDLED = "Stack presence should not be handled";
93 static const std::string INVALID_OPTION = "Invalid option";
94 static const std::string GENERAL_FAULT = "General Fault";
95 static const std::string MALFORMED_STACK_RESPONSE =
96 "Response from OC_STACK is malformed";
97 static const std::string VIRTUAL_DO_NOT_HANDLE = "Virtual Do Not Handle";
98 static const std::string PERSISTENT_BUFFER_REQUIRED = "Persistent response buffer required";
99 static const std::string STACK_CONTINUE = "Stack continue";
100 static const std::string INVALID_REQUEST_HANDLE = "Invalid request handle";
101 static const std::string UNKNOWN_ERROR = "Unknown Error";
102 static const std::string INVALID_REPRESENTATION = "Invalid Payload JSON";
103 static const std::string INVALID_JSON_TYPE = "Unrecognized JSON Type ";
104 static const std::string INVALID_JSON_NUMERIC = "Unrecognized JSON Numeric ";
105 static const std::string INVALID_JSON_ARRAY_DEPTH = "Max JSON Array Depth exceeded";
106 static const std::string INVALID_JSON_TYPE_TAG = "Invalid JSON Type Tag";
107 static const std::string INVALID_ATTRIBUTE = "Invalid Attribute: ";
112 static const std::string INVALID_IP = "Invalid IP";
115 namespace PlatformCommands
117 static const std::string GET = "GET";
118 static const std::string PUT = "PUT";
119 static const std::string POST = "POST";
120 static const std::string DELETE = "DELETE";
125 static const std::string OCKEY = "oc";
126 static const std::string URIKEY = "href";
127 static const std::string OBSERVABLEKEY = "obs";
128 static const std::string RESOURCETYPESKEY = "rt";
129 static const std::string INTERFACESKEY = "if";
130 static const std::string PROPERTYKEY = "prop";
131 static const std::string REPKEY = "rep";
132 static const std::string SECUREKEY = "sec";
133 static const std::string PORTKEY = "port";
138 #endif // _STRING_CONSTANTS_H_