Skip to content

Commit

Permalink
REMOVE some ngsi9 and ngsi10 text leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalan committed Aug 27, 2024
1 parent 24b7753 commit 4e83aef
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/app/contextBroker/contextBroker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ static const char* validLogLevels[] =
* to treat the incoming request.
*
* The URL path is divided into components (Using '/' as field separator) so that the URL
* "/ngsi9/registerContext" becomes a component vector of the two components
* "ngsi9" and "registerContext".
* "/v2/entities" becomes a component vector of the two components
* "v2" and "entities".
*
* Each line contains the necessary information for ONE service:
* RequestType request - The type of the request
Expand Down
4 changes: 0 additions & 4 deletions src/lib/mongoBackend/TriggeredSubscription.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ TriggeredSubscription::~TriggeredSubscription()
/* ****************************************************************************
*
* TriggeredSubscription::fillExpression -
*
* TriggeredSubscription class is shared for NGSI9 and NGSI10 subscriptions, so it is better
* to keep expressions (an artifact for NGSI10) out of the constructor, in its independent fill
* method
*/
void TriggeredSubscription::fillExpression
(
Expand Down
4 changes: 0 additions & 4 deletions src/lib/mongoBackend/TriggeredSubscription.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@
* the csbubs collection. Note that adding all the BSON object retrieved from the
* csubs collection is not efficient, so we use only the needed fields-
*
* We use the same class for both NGSI10 and NGSI9 subscription. The only difference
* is that throttling and lastNotification are not needed in the second case (note
* that there are different constructor depending the case)
*
*/
class TriggeredSubscription
{
Expand Down
4 changes: 2 additions & 2 deletions src/lib/mongoBackend/mongoNotifyContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ HttpStatusCode mongoNotifyContext
{
bool reqSemTaken;

reqSemTake(__FUNCTION__, "ngsi10 notification", SemWriteOp, &reqSemTaken);
reqSemTake(__FUNCTION__, "notification", SemWriteOp, &reqSemTaken);

// Process each ContextElement
for (unsigned int ix = 0; ix < requestP->contextElementResponseVector.size(); ++ix)
Expand All @@ -70,7 +70,7 @@ HttpStatusCode mongoNotifyContext
processContextElement(eP, &ucr, ActionTypeAppend, tenant, servicePathV, uriParams, xauthToken, fiwareCorrelator, ngsiV2AttrsFormat, forcedUpdate, overrideMetadata, 0);
}

reqSemGive(__FUNCTION__, "ngsi10 notification", reqSemTaken);
reqSemGive(__FUNCTION__, "notification", reqSemTaken);
responseP->responseCode.fill(SccOk);

return SccOk;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/mongoBackend/mongoQueryContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ HttpStatusCode mongoQueryContext
bool reqSemTaken;
ContextElementResponseVector rawCerV;

reqSemTake(__FUNCTION__, "ngsi10 query request", SemReadOp, &reqSemTaken);
reqSemTake(__FUNCTION__, "query request", SemReadOp, &reqSemTaken);

ok = entitiesQuery(requestP->entityIdVector,
requestP->attributeList,
Expand All @@ -364,7 +364,7 @@ HttpStatusCode mongoQueryContext
{
responseP->errorCode.fill(SccReceiverInternalError, err);
rawCerV.release();
reqSemGive(__FUNCTION__, "ngsi10 query request", reqSemTaken);
reqSemGive(__FUNCTION__, "query request", reqSemTaken);

return SccOk;
}
Expand Down Expand Up @@ -474,6 +474,6 @@ HttpStatusCode mongoQueryContext

rawCerV.release();

reqSemGive(__FUNCTION__, "ngsi10 query request", reqSemTaken);
reqSemGive(__FUNCTION__, "query request", reqSemTaken);
return SccOk;
}
12 changes: 6 additions & 6 deletions src/lib/mongoBackend/mongoUnsubscribeContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ HttpStatusCode mongoUnsubscribeContext
bool reqSemTaken;
std::string err;

reqSemTake(__FUNCTION__, "ngsi10 unsubscribe request", SemWriteOp, &reqSemTaken);
reqSemTake(__FUNCTION__, "unsubscribe request", SemWriteOp, &reqSemTaken);

LM_T(LmtMongo, ("Unsubscribe Context"));

if (subId.empty())
{
reqSemGive(__FUNCTION__, "ngsi10 unsubscribe request (no subscriptions found)", reqSemTaken);
reqSemGive(__FUNCTION__, "unsubscribe request (no subscriptions found)", reqSemTaken);
responseP->fill(SccContextElementNotFound, ERROR_DESC_NOT_FOUND_SUBSCRIPTION, ERROR_NOT_FOUND);
alarmMgr.badInput(clientIp, "no subscriptionId");

Expand All @@ -78,15 +78,15 @@ HttpStatusCode mongoUnsubscribeContext

if (!orion::collectionFindOne(composeDatabaseName(tenant), COL_CSUBS, bobId.obj(), &sub, &err) && (err != ""))
{
reqSemGive(__FUNCTION__, "ngsi10 unsubscribe request (mongo db exception)", reqSemTaken);
reqSemGive(__FUNCTION__, "unsubscribe request (mongo db exception)", reqSemTaken);

responseP->fill(SccReceiverInternalError, err, ERROR_INTERNAL_ERROR);
return SccOk;
}

if (sub.isEmpty())
{
reqSemGive(__FUNCTION__, "ngsi10 unsubscribe request (no subscriptions found)", reqSemTaken);
reqSemGive(__FUNCTION__, "unsubscribe request (no subscriptions found)", reqSemTaken);

responseP->fill(SccContextElementNotFound, ERROR_DESC_NOT_FOUND_SUBSCRIPTION, ERROR_NOT_FOUND);
return SccOk;
Expand All @@ -104,7 +104,7 @@ HttpStatusCode mongoUnsubscribeContext

if (!orion::collectionRemove(composeDatabaseName(tenant), COL_CSUBS, bobId2.obj(), &err))
{
reqSemGive(__FUNCTION__, "ngsi10 unsubscribe request (mongo db exception)", reqSemTaken);
reqSemGive(__FUNCTION__, "unsubscribe request (mongo db exception)", reqSemTaken);

responseP->fill(SccReceiverInternalError, err, ERROR_INTERNAL_ERROR);
return SccOk;
Expand All @@ -131,7 +131,7 @@ HttpStatusCode mongoUnsubscribeContext
cacheSemGive(__FUNCTION__, "Removing subscription from cache");
}

reqSemGive(__FUNCTION__, "ngsi10 unsubscribe request", reqSemTaken);
reqSemGive(__FUNCTION__, "unsubscribe request", reqSemTaken);

return SccOk;
}
4 changes: 2 additions & 2 deletions src/lib/mongoBackend/mongoUpdateContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ HttpStatusCode mongoUpdateContext
{
bool reqSemTaken;

reqSemTake(__FUNCTION__, "ngsi10 update request", SemWriteOp, &reqSemTaken);
reqSemTake(__FUNCTION__, "update request", SemWriteOp, &reqSemTaken);

// Initial size of notification queue (could be used by flow control algorithm)
unsigned int q0 = 0;
Expand Down Expand Up @@ -231,7 +231,7 @@ HttpStatusCode mongoUpdateContext
responseP->errorCode.fill(SccOk);
}

reqSemGive(__FUNCTION__, "ngsi10 update request", reqSemTaken);
reqSemGive(__FUNCTION__, "update request", reqSemTaken);

if (flowControl && fcEnabled && (responseP->errorCode.code == SccOk))
{
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/serviceRoutines/badVerbGetPostOnly_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ TEST(badVerbGetPostOnly, ok)
ConnectionInfo ci("/v2/entities", "PUT", "1.1");
std::string expected = "{\"error\":\"MethodNotAllowed\",\"description\":\"method not allowed\"}";
std::string out;
RestService restService = { VersionRequest, 3, { "ngsi9", "contextEntities", "aaa" }, NULL };
RestService restService = { VersionRequest, 3, { "foo", "bar", "aaa" }, NULL };

ci.restServiceP = &restService;

Expand Down

0 comments on commit 4e83aef

Please sign in to comment.