diff --git a/scripts/style_check_in_makefile.sh b/scripts/style_check_in_makefile.sh index 3e55d50647..ba5026b0a2 100755 --- a/scripts/style_check_in_makefile.sh +++ b/scripts/style_check_in_makefile.sh @@ -161,16 +161,6 @@ style_check test/unittests/serviceRoutines # o ngsi/ContextElementResponseVector.h (haderding/remove_ngsiv1_indent: 7 lines) # o ngsi/ContextElementVector.cpp (haderding/remove_ngsiv1_indent: 13 lines) # o ngsi/ContextElementVector.h (haderding/remove_ngsiv1_indent: 8 lines) -# o ngsi/ContextRegistration.cpp (haderding/remove_ngsiv1_indent: 10 lines) -# o ngsi/ContextRegistration.h (haderding/remove_ngsiv1_indent: 2 lines) -# o ngsi/ContextRegistrationAttribute.cpp (haderding/remove_ngsiv1_indent: 7 lines) -# o ngsi/ContextRegistrationAttribute.h (haderding/remove_ngsiv1_indent: 1 line) -# o ngsi/ContextRegistrationAttributeVector.cpp (haderding/remove_ngsiv1_indent: 4 lines) -# o ngsi/ContextRegistrationAttributeVector.h (haderding/remove_ngsiv1_indent: 1 line) -# o ngsi/ContextRegistrationResponse.cpp (haderding/remove_ngsiv1_indent: 7 lines) -# o ngsi/ContextRegistrationResponse.h (haderding/remove_ngsiv1_indent: 2 lines) -# o ngsi/ContextRegistrationResponseVector.cpp (haderding/remove_ngsiv1_indent: 6 lines) -# o ngsi/ContextRegistrationResponseVector.h (haderding/remove_ngsiv1_indent: 2 lines) # o ngsi/ContextRegistrationVector.cpp (haderding/remove_ngsiv1_indent: 6 lines) # o ngsi/ContextRegistrationVector.h (haderding/remove_ngsiv1_indent: 2 lines) # o ngsi/Duration.cpp (haderding/remove_ngsiv1_indent: 9 lines) @@ -302,8 +292,6 @@ style_check test/unittests/serviceRoutines # o unittests/ngsi/ContextElement_test.cpp (haderding/remove_ngsiv1_indent: 8 check()) # o unittests/ngsi/ContextRegistrationAttributeVector_test.cpp (haderding/remove_ngsiv1_indent: 4 render() # o unittests/ngsi/ContextRegistrationAttribute_test.cpp (haderding/remove_ngsiv1_indent: 1 render() -# o unittests/ngsi/ContextRegistrationResponseVector_test.cpp (haderding/remove_ngsiv1_indent: 1 render(), 3 check()) -# o unittests/ngsi/ContextRegistrationResponse_test.cpp (haderding/remove_ngsiv1_indent: 2 render(), 1 check()) # o unittests/ngsi/ContextRegistrationVector_test.cpp (haderding/remove_ngsiv1_indent: 1 render() # o unittests/ngsi/Duration_test.cpp (haderding/remove_ngsiv1_indent: 3 check()) # o unittests/ngsi/EntityId_test.cpp (haderding/remove_ngsiv1_indent: 1 render() diff --git a/src/lib/mongoBackend/MongoGlobal.cpp b/src/lib/mongoBackend/MongoGlobal.cpp index b52d0d7f3f..a5e5a2078d 100644 --- a/src/lib/mongoBackend/MongoGlobal.cpp +++ b/src/lib/mongoBackend/MongoGlobal.cpp @@ -433,36 +433,6 @@ bool matchEntity(const EntityId* en1, const ngsiv2::EntID& en2) -#if 0 -// FIXME PR -/* **************************************************************************** -* -* includedEntity - -*/ -bool includedEntity(EntityId en, const EntityIdVector& entityIdV) -{ - for (unsigned int ix = 0; ix < entityIdV.size(); ++ix) - { - if (en.isPatternIsTrue() && en.id == ".*") - { - // By the moment the only supported pattern is .*. In this case matching is - // based exclusively in type - if (en.type == entityIdV[ix]->type) - { - return true; - } - } - else if (matchEntity(&en, entityIdV[ix])) - { - return true; - } - } - return false; -} -#endif - - - /* **************************************************************************** * * includedAttribute - @@ -1697,119 +1667,6 @@ void pruneContextElements -#if 0 -// FIXME PR -/* *************************************************************************** -* -* processEntity - -*/ -static void processEntity(ContextRegistrationResponse* crr, const EntityIdVector& enV, orion::BSONObj entity) -{ - EntityId en; - - en.id = getStringFieldF(entity, REG_ENTITY_ID); - en.type = entity.hasField(REG_ENTITY_TYPE)? getStringFieldF(entity, REG_ENTITY_TYPE) : ""; - en.isPattern = entity.hasField(REG_ENTITY_ISPATTERN)? getStringFieldF(entity, REG_ENTITY_ISPATTERN) : "false"; - - if (includedEntity(en, enV)) - { - EntityId* enP = new EntityId(en.id, en.type, en.isPattern); - - crr->contextRegistration.entityIdVector.push_back(enP); - } -} - - - -/* *************************************************************************** -* -* processAttribute - -*/ -static void processAttribute(ContextRegistrationResponse* crr, const StringList& attrL, const orion::BSONObj& attribute) -{ - ContextRegistrationAttribute attr( - getStringFieldF(attribute, REG_ATTRS_NAME), - getStringFieldF(attribute, REG_ATTRS_TYPE)); - - if (includedAttribute(attr.name, attrL)) - { - ContextRegistrationAttribute* attrP = new ContextRegistrationAttribute(attr.name, attr.type); - crr->contextRegistration.contextRegistrationAttributeVector.push_back(attrP); - } -} - - - -/* *************************************************************************** -* -* processContextRegistrationElement - -*/ -static void processContextRegistrationElement -( - orion::BSONObj cr, - const EntityIdVector& enV, - const StringList& attrL, - ContextRegistrationResponseVector* crrV, - MimeType mimeType, - ProviderFormat providerFormat, - const std::string& regId -) -{ - ContextRegistrationResponse crr; - - crr.contextRegistration.providingApplication.set(getStringFieldF(cr, REG_PROVIDING_APPLICATION)); - crr.contextRegistration.providingApplication.setProviderFormat(providerFormat); - - std::vector queryEntityV = getFieldF(cr, REG_ENTITIES).Array(); - - for (unsigned int ix = 0; ix < queryEntityV.size(); ++ix) - { - processEntity(&crr, enV, queryEntityV[ix].embeddedObject()); - } - - /* Note that attributes can be included only if at least one entity has been found */ - if (crr.contextRegistration.entityIdVector.size() > 0) - { - if (cr.hasField(REG_ATTRS)) /* To prevent registration in the E- style */ - { - std::vector queryAttrV = getFieldF(cr, REG_ATTRS).Array(); - - for (unsigned int ix = 0; ix < queryAttrV.size(); ++ix) - { - processAttribute(&crr, attrL, queryAttrV[ix].embeddedObject()); - } - } - } - - // FIXME: we don't take metadata into account at the moment - // crr.contextRegistration.registrationMetadataV = .. - - /* Note that the context registration element is only included in one of the following cases: - * - The number of entities and attributes included are both greater than 0 - * - The number of entities is greater than 0, the number of attributes is 0 but the discover - * doesn't use attributes in the request - */ - if (crr.contextRegistration.entityIdVector.size() == 0) - { - return; - } - - if (crr.contextRegistration.contextRegistrationAttributeVector.size() > 0 || - (crr.contextRegistration.contextRegistrationAttributeVector.size() == 0 && attrL.size() == 0)) - { - ContextRegistrationResponse* crrP = new ContextRegistrationResponse(); - - crrP->contextRegistration = crr.contextRegistration; - crrP->providerFormat = providerFormat; - crrP->regId = regId; - - crrV->push_back(crrP); - } -} -#endif - - - /* **************************************************************************** * * registrationsQuery - @@ -1850,8 +1707,6 @@ bool registrationsQuery // Note that by construction the $or array always has at least two elements (the two ones corresponding to the // universal pattern) so we cannot avoid to use this operator. // - // FIXME P5: the 'contextRegistration' token (19 chars) repeats in the query BSON. It would be better use 'cr' (2 chars) - // but this would need a data model migration in DB /* Build query based on arguments */ std::string crEntitiesId = REG_CONTEXT_REGISTRATION "." REG_ENTITIES "." REG_ENTITY_ID; @@ -1995,22 +1850,12 @@ bool registrationsQuery LM_T(LmtMongo, ("retrieved document [%d]: '%s'", docs, r.toString().c_str())); - //std::vector queryContextRegistrationV = getFieldF(r, REG_CONTEXT_REGISTRATION).Array(); - std::string format = getStringFieldF(r, REG_FORMAT); - //ProviderFormat providerFormat = (format.empty())? PfJson : (format == "JSON")? PfJson : PfV2; FIXME PR - std::string regId = getFieldF(r, "_id").OID(); - - //for (unsigned int ix = 0 ; ix < queryContextRegistrationV.size(); ++ix) - //{ - //processContextRegistrationElement(queryContextRegistrationV[ix].embeddedObject(), enV, attrL, crrV, mimeType, providerFormat, regId); - ngsiv2::Registration reg; - //if (reg.fromBson(queryContextRegistrationV[ix].embeddedObject())) - if (reg.fromBson(r)) - { - // FIXME PR: controll error if Registration comes from NGSIv1 - regV->push_back(reg); - } - //} + ngsiv2::Registration reg; + if (reg.fromBson(r)) + { + // FIXME PR: control error if Registration comes from NGSIv1 + regV->push_back(reg); + } /* FIXME: note that given the response doesn't distinguish from which registration ID the * response comes, it could have that we have same context registration elements, belong to different @@ -2310,8 +2155,6 @@ void fillContextProviders(ContextElementResponse* cer, const std::vectorname, regV, &perEntPa, - &perEntPaMimeType, &perAttrPa, - &perAttrPaMimeType, &providerFormat, ®Id); @@ -2373,9 +2214,7 @@ void cprLookupByAttribute const std::string& attrName, const std::vector& regV, std::string* perEntPa, - MimeType* perEntPaMimeType, // FIXME PR: really needed? std::string* perAttrPa, - MimeType* perAttrPaMimeType, // FIXME PR: really needed? ProviderFormat* providerFormatP, // FIXME PR: ProviderFormat is really needed as type? std::string* regId ) diff --git a/src/lib/mongoBackend/MongoGlobal.h b/src/lib/mongoBackend/MongoGlobal.h index 260d864046..31a563a3e0 100644 --- a/src/lib/mongoBackend/MongoGlobal.h +++ b/src/lib/mongoBackend/MongoGlobal.h @@ -35,12 +35,10 @@ #include "common/RenderFormat.h" #include "ngsi/EntityId.h" -#include "ngsi/ContextRegistrationAttribute.h" #include "ngsi/ContextAttribute.h" #include "ngsi/EntityIdVector.h" #include "ngsi/StringList.h" #include "ngsi/ContextElementResponseVector.h" -#include "ngsi/ContextRegistrationResponseVector.h" #include "ngsi10/UpdateContextResponse.h" #include "ngsiNotify/Notifier.h" #include "rest/uriParamNames.h" @@ -368,9 +366,7 @@ extern void cprLookupByAttribute const std::string& attrName, const std::vector& regV, std::string* perEntPa, - MimeType* perEntPaMimeType, std::string* perAttrPa, - MimeType* perAttrPaMimeType, ProviderFormat* providerFormatP, std::string* regId ); diff --git a/src/lib/mongoBackend/mongoQueryContext.cpp b/src/lib/mongoBackend/mongoQueryContext.cpp index 382b087638..4175347971 100644 --- a/src/lib/mongoBackend/mongoQueryContext.cpp +++ b/src/lib/mongoBackend/mongoQueryContext.cpp @@ -31,7 +31,6 @@ #include "common/string.h" #include "common/sem.h" #include "alarmMgr/alarmMgr.h" -#include "ngsi/ContextRegistrationResponse.h" #include "ngsi10/QueryContextRequest.h" #include "ngsi10/QueryContextResponse.h" @@ -258,7 +257,6 @@ static void addContextProviders for (unsigned int ix = 0; ix < regV.size(); ++ix) { ngsiv2::Registration reg = regV[ix]; - //cr.providingApplication.setRegId(crrV[ix]->regId); FIXME PR: this is needed?? /* In case a "filtering" entity was provided, check that the current CRR matches or skip to next CRR */ if (enP != NULL && !matchEntityInRegistration(reg, enP)) diff --git a/src/lib/ngsi/CMakeLists.txt b/src/lib/ngsi/CMakeLists.txt index 12147c28b7..b618452781 100644 --- a/src/lib/ngsi/CMakeLists.txt +++ b/src/lib/ngsi/CMakeLists.txt @@ -25,11 +25,6 @@ SET (SOURCES ContextAttributeVector.cpp ContextElementResponse.cpp ContextElementResponseVector.cpp - ContextRegistration.cpp - ContextRegistrationAttribute.cpp - ContextRegistrationAttributeVector.cpp - ContextRegistrationResponse.cpp - ContextRegistrationResponseVector.cpp EntityId.cpp EntityIdVector.cpp Metadata.cpp @@ -47,11 +42,6 @@ SET (HEADERS ContextAttributeVector.h ContextElementResponse.h ContextElementResponseVector.h - ContextRegistrationAttribute.h - ContextRegistrationAttributeVector.h - ContextRegistration.h - ContextRegistrationResponse.h - ContextRegistrationResponseVector.h EntityId.h EntityIdVector.h Metadata.h diff --git a/src/lib/ngsi/ContextRegistration.cpp b/src/lib/ngsi/ContextRegistration.cpp deleted file mode 100644 index 7d93d8098d..0000000000 --- a/src/lib/ngsi/ContextRegistration.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* -* -* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U -* -* This file is part of Orion Context Broker. -* -* Orion Context Broker is free software: you can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* Orion Context Broker is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -* General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -* -* For those usages not covered by this license please contact with -* iot_support at tid dot es -* -* Author: Ken Zangelin -*/ -#include -#include - -#include "logMsg/logMsg.h" -#include "logMsg/traceLevels.h" - -#include "common/globals.h" -#include "ngsi/Request.h" -#include "ngsi/ContextRegistration.h" -#include "ngsi/ContextRegistrationAttribute.h" -#include "ngsi/EntityId.h" - - - -/* **************************************************************************** -* -* ContextRegistration::ContextRegistration - -* -*/ -ContextRegistration::ContextRegistration() -{ -} - - - -/* **************************************************************************** -* -* ContextRegistration::release - -*/ -void ContextRegistration::release(void) -{ - entityIdVector.release(); - contextRegistrationAttributeVector.release(); - providingApplication.release(); -} diff --git a/src/lib/ngsi/ContextRegistration.h b/src/lib/ngsi/ContextRegistration.h deleted file mode 100644 index 202e08791e..0000000000 --- a/src/lib/ngsi/ContextRegistration.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef SRC_LIB_NGSI_CONTEXTREGISTRATION_H_ -#define SRC_LIB_NGSI_CONTEXTREGISTRATION_H_ - -/* -* -* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U -* -* This file is part of Orion Context Broker. -* -* Orion Context Broker is free software: you can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* Orion Context Broker is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -* General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -* -* For those usages not covered by this license please contact with -* iot_support at tid dot es -* -* Author: Ken Zangelin -*/ -#include -#include - -#include "ngsi/EntityIdVector.h" -#include "ngsi/ProvidingApplication.h" -#include "ngsi/ContextRegistrationAttributeVector.h" -#include "ngsi/MetadataVector.h" - - - -/* **************************************************************************** -* -* ContextRegistration - -*/ -typedef struct ContextRegistration -{ - EntityIdVector entityIdVector; // Optional - ContextRegistrationAttributeVector contextRegistrationAttributeVector; // Optional - ProvidingApplication providingApplication; // Mandatory - - ContextRegistration(); - void release(); - -} ContextRegistration; - -#endif // SRC_LIB_NGSI_CONTEXTREGISTRATION_H_ diff --git a/src/lib/ngsi/ContextRegistrationAttribute.cpp b/src/lib/ngsi/ContextRegistrationAttribute.cpp deleted file mode 100644 index 7d695980e4..0000000000 --- a/src/lib/ngsi/ContextRegistrationAttribute.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* -* -* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U -* -* This file is part of Orion Context Broker. -* -* Orion Context Broker is free software: you can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* Orion Context Broker is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -* General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -* -* For those usages not covered by this license please contact with -* iot_support at tid dot es -* -* Author: Ken Zangelin -*/ -#include -#include - -#include "logMsg/logMsg.h" -#include "logMsg/traceLevels.h" - -#include "common/globals.h" -#include "ngsi/ContextRegistrationAttribute.h" - - - -/* **************************************************************************** -* -* ContextRegistrationAttribute::ContextRegistrationAttribute - -*/ -ContextRegistrationAttribute::ContextRegistrationAttribute -( - const std::string& _name, - const std::string& _type -) -{ - name = _name; - type = _type; -} diff --git a/src/lib/ngsi/ContextRegistrationAttribute.h b/src/lib/ngsi/ContextRegistrationAttribute.h deleted file mode 100644 index 176fdaeaef..0000000000 --- a/src/lib/ngsi/ContextRegistrationAttribute.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef SRC_LIB_NGSI_CONTEXTREGISTRATIONATTRIBUTE_H_ -#define SRC_LIB_NGSI_CONTEXTREGISTRATIONATTRIBUTE_H_ - -/* -* -* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U -* -* This file is part of Orion Context Broker. -* -* Orion Context Broker is free software: you can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* Orion Context Broker is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -* General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -* -* For those usages not covered by this license please contact with -* iot_support at tid dot es -* -* Author: Ken Zangelin -*/ -#include -#include - -#include "common/globals.h" - -#include "ngsi/MetadataVector.h" -#include "ngsi/Request.h" - - - -/* **************************************************************************** -* -* ContextRegistrationAttribute - -* -*/ -typedef struct ContextRegistrationAttribute -{ - std::string name; // Mandatory - std::string type; // Optional - - ContextRegistrationAttribute(const std::string& _name, const std::string& _type); - -} ContextRegistrationAttribute; - -#endif // SRC_LIB_NGSI_CONTEXTREGISTRATIONATTRIBUTE_H_ diff --git a/src/lib/ngsi/ContextRegistrationAttributeVector.cpp b/src/lib/ngsi/ContextRegistrationAttributeVector.cpp deleted file mode 100644 index aea5367918..0000000000 --- a/src/lib/ngsi/ContextRegistrationAttributeVector.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* -* -* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U -* -* This file is part of Orion Context Broker. -* -* Orion Context Broker is free software: you can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* Orion Context Broker is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -* General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -* -* For those usages not covered by this license please contact with -* iot_support at tid dot es -* -* Author: Ken Zangelin -*/ -#include -#include -#include - -#include "logMsg/logMsg.h" -#include "logMsg/traceLevels.h" - -#include "common/globals.h" -#include "ngsi/ContextRegistrationAttributeVector.h" - - - -/* **************************************************************************** -* -* ContextRegistrationAttributeVector::push_back - -*/ -void ContextRegistrationAttributeVector::push_back(ContextRegistrationAttribute* item) -{ - vec.push_back(item); -} - - - -/* **************************************************************************** -* -* ContextRegistrationAttributeVector::operator[] - -*/ -ContextRegistrationAttribute* ContextRegistrationAttributeVector::operator[] (unsigned int ix) const -{ - if (ix < vec.size()) - { - return vec[ix]; - } - return NULL; -} - - - -/* **************************************************************************** -* -* ContextRegistrationAttributeVector::size - -*/ -unsigned int ContextRegistrationAttributeVector::size(void) -{ - return vec.size(); -} - - - -/* **************************************************************************** -* -* ContextRegistrationAttributeVector::release - -*/ -void ContextRegistrationAttributeVector::release(void) -{ - for (unsigned int ix = 0; ix < vec.size(); ++ix) - { - delete(vec[ix]); - } - - vec.clear(); -} diff --git a/src/lib/ngsi/ContextRegistrationAttributeVector.h b/src/lib/ngsi/ContextRegistrationAttributeVector.h deleted file mode 100644 index fe177777d7..0000000000 --- a/src/lib/ngsi/ContextRegistrationAttributeVector.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef SRC_LIB_NGSI_CONTEXTREGISTRATIONATTRIBUTEVECTOR_H_ -#define SRC_LIB_NGSI_CONTEXTREGISTRATIONATTRIBUTEVECTOR_H_ - -/* -* -* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U -* -* This file is part of Orion Context Broker. -* -* Orion Context Broker is free software: you can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* Orion Context Broker is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -* General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -* -* For those usages not covered by this license please contact with -* iot_support at tid dot es -* -* Author: Ken Zangelin -*/ -#include -#include - -#include "ngsi/ContextRegistrationAttribute.h" - - - -/* **************************************************************************** -* -* ContextRegistrationAttributeVector - -*/ -typedef struct ContextRegistrationAttributeVector -{ - std::vector vec; - - void push_back(ContextRegistrationAttribute* item); - unsigned int size(void); - void release(); - - ContextRegistrationAttribute* operator[](unsigned int ix) const; - -} ContextRegistrationAttributeVector; - -#endif // SRC_LIB_NGSI_CONTEXTREGISTRATIONATTRIBUTEVECTOR_H_ diff --git a/src/lib/ngsi/ContextRegistrationResponse.cpp b/src/lib/ngsi/ContextRegistrationResponse.cpp deleted file mode 100644 index fc4921348d..0000000000 --- a/src/lib/ngsi/ContextRegistrationResponse.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* -* -* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U -* -* This file is part of Orion Context Broker. -* -* Orion Context Broker is free software: you can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* Orion Context Broker is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -* General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -* -* For those usages not covered by this license please contact with -* iot_support at tid dot es -* -* Author: Ken Zangelin -*/ -#include - -#include "ngsi/StatusCode.h" -#include "ngsi/ContextRegistrationResponse.h" -#include "ngsi/Request.h" - - - -/* **************************************************************************** -* -* ContextRegistrationResponse::ContextRegistrationResponse - -*/ -ContextRegistrationResponse::ContextRegistrationResponse() -{ -} - - - -/* **************************************************************************** -* -* ContextRegistrationResponse::release - -*/ -void ContextRegistrationResponse::release(void) -{ - contextRegistration.release(); -} diff --git a/src/lib/ngsi/ContextRegistrationResponse.h b/src/lib/ngsi/ContextRegistrationResponse.h deleted file mode 100644 index c7f85ff2bd..0000000000 --- a/src/lib/ngsi/ContextRegistrationResponse.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef SRC_LIB_NGSI_CONTEXTREGISTRATIONRESPONSE_H_ -#define SRC_LIB_NGSI_CONTEXTREGISTRATIONRESPONSE_H_ - -/* -* -* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U -* -* This file is part of Orion Context Broker. -* -* Orion Context Broker is free software: you can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* Orion Context Broker is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -* General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -* -* For those usages not covered by this license please contact with -* iot_support at tid dot es -* -* Author: Ken Zangelin -*/ -#include - -#include "ngsi/ContextRegistration.h" -#include "ngsi/StatusCode.h" -#include "ngsi/Request.h" - - - -/* **************************************************************************** -* -* ContextRegistrationResponse - -*/ -typedef struct ContextRegistrationResponse -{ - ContextRegistration contextRegistration; // Mandatory - StatusCode errorCode; // Optional - ProviderFormat providerFormat; // During forwarding, this field is used to record the 'format' from the registration that provoked - // this Context Element to be forwarded. - std::string regId; // During forwarding, this field is used to record the regId (for logging purposes) - - ContextRegistrationResponse(); - - void release(void); - -} ContextRegistrationResponse; - -#endif // SRC_LIB_NGSI_CONTEXTREGISTRATIONRESPONSE_H_ diff --git a/src/lib/ngsi/ContextRegistrationResponseVector.cpp b/src/lib/ngsi/ContextRegistrationResponseVector.cpp deleted file mode 100644 index 2efbdb75d5..0000000000 --- a/src/lib/ngsi/ContextRegistrationResponseVector.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* -* -* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U -* -* This file is part of Orion Context Broker. -* -* Orion Context Broker is free software: you can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* Orion Context Broker is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -* General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -* -* For those usages not covered by this license please contact with -* iot_support at tid dot es -* -* Author: Ken Zangelin -*/ -#include -#include - -#include "logMsg/logMsg.h" -#include "logMsg/traceLevels.h" - -#include "common/globals.h" -#include "ngsi/ContextRegistrationResponseVector.h" - - - -/* **************************************************************************** -* -* ContextRegistrationResponseVector::push_back - -*/ -void ContextRegistrationResponseVector::push_back(ContextRegistrationResponse* item) -{ - vec.push_back(item); -} - - - -/* **************************************************************************** -* -* ContextRegistrationResponseVector::release - -*/ -void ContextRegistrationResponseVector::release(void) -{ - for (unsigned int ix = 0; ix < vec.size(); ++ix) - { - vec[ix]->release(); - delete(vec[ix]); - } - - vec.clear(); -} - - - -/* **************************************************************************** -* -* ContextRegistrationResponseVector::operator[] - -*/ -ContextRegistrationResponse* ContextRegistrationResponseVector::operator[] (unsigned int ix) const -{ - if (ix < vec.size()) - { - return vec[ix]; - } - return NULL; -} - - - -/* **************************************************************************** -* -* ContextRegistrationResponseVector::size - -*/ -unsigned int ContextRegistrationResponseVector::size(void) const -{ - return vec.size(); -} diff --git a/src/lib/ngsi/ContextRegistrationResponseVector.h b/src/lib/ngsi/ContextRegistrationResponseVector.h deleted file mode 100644 index 053283b3b6..0000000000 --- a/src/lib/ngsi/ContextRegistrationResponseVector.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef SRC_LIB_NGSI_CONTEXTREGISTRATIONRESPONSEVECTOR_H_ -#define SRC_LIB_NGSI_CONTEXTREGISTRATIONRESPONSEVECTOR_H_ - -/* -* -* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U -* -* This file is part of Orion Context Broker. -* -* Orion Context Broker is free software: you can redistribute it and/or -* modify it under the terms of the GNU Affero General Public License as -* published by the Free Software Foundation, either version 3 of the -* License, or (at your option) any later version. -* -* Orion Context Broker is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero -* General Public License for more details. -* -* You should have received a copy of the GNU Affero General Public License -* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/. -* -* For those usages not covered by this license please contact with -* iot_support at tid dot es -* -* Author: Ken Zangelin -*/ -#include -#include - -#include "ngsi/ContextRegistrationResponse.h" - - - -/* **************************************************************************** -* -* ContextRegistrationResponseVector - -*/ -typedef struct ContextRegistrationResponseVector -{ - std::vector vec; - - void push_back(ContextRegistrationResponse* item); - unsigned int size(void) const; - void release(void); - - ContextRegistrationResponse* operator[](unsigned int ix) const; - -} ContextRegistrationResponseVector; - - -#endif // SRC_LIB_NGSI_CONTEXTREGISTRATIONRESPONSEVECTOR_H_ diff --git a/src/lib/ngsi/ParseData.h b/src/lib/ngsi/ParseData.h index 23f624fbca..ee62b5d7a5 100644 --- a/src/lib/ngsi/ParseData.h +++ b/src/lib/ngsi/ParseData.h @@ -29,7 +29,6 @@ #include "orionTypes/areas.h" #include "ngsi/EntityId.h" -#include "ngsi/ContextRegistrationAttribute.h" #include "ngsi/ContextElementResponse.h" #include "ngsi/Metadata.h" #include "ngsi10/QueryContextRequest.h" diff --git a/src/lib/serviceRoutines/postQueryContext.cpp b/src/lib/serviceRoutines/postQueryContext.cpp index 9653bb9d65..cd3c688221 100644 --- a/src/lib/serviceRoutines/postQueryContext.cpp +++ b/src/lib/serviceRoutines/postQueryContext.cpp @@ -789,8 +789,6 @@ void postQueryContext } entityId.type = qcrP->entityIdVector[kx]->type; - // FIXME PR: remove this - //if (matchEntity(&tempEn, qcrP->entityIdVector[kx])) if (matchEntity(&tempEn, entityId)) { found = true;