[omapd] r182 committed - initial code refactoring with superficial improvements aimed at preven...

0 views
Skip to first unread message

om...@googlecode.com

unread,
May 25, 2013, 2:07:15 AM5/25/13
to omapd...@googlegroups.com
Revision: 182
Author: fu...@asguardnetworks.com
Date: Fri May 24 23:06:39 2013
Log: initial code refactoring with superficial improvements aimed at
preventing unneccessary copies of structured data in method calls, added
depth tracking to subscription MAP graph and added some recursion pruning
in buildMapGraph
http://code.google.com/p/omapd/source/detail?r=182

Modified:
/branches/lfu/clientconfiguration.cpp
/branches/lfu/clientconfiguration.h
/branches/lfu/clienthandler.cpp
/branches/lfu/clienthandler.h
/branches/lfu/clientparser.cpp
/branches/lfu/clientparser.h
/branches/lfu/identifier.cpp
/branches/lfu/identifier.h
/branches/lfu/mapclient.cpp
/branches/lfu/mapclient.h
/branches/lfu/maprequest.h
/branches/lfu/mapresponse.cpp
/branches/lfu/mapresponse.h
/branches/lfu/mapsessions.cpp
/branches/lfu/mapsessions.h
/branches/lfu/metadata.cpp
/branches/lfu/metadata.h
/branches/lfu/omapdconfig.cpp
/branches/lfu/omapdconfig.h
/branches/lfu/server.cpp
/branches/lfu/server.h
/branches/lfu/subscription.cpp
/branches/lfu/subscription.h

=======================================
--- /branches/lfu/clientconfiguration.cpp Sun Feb 24 14:35:44 2013
+++ /branches/lfu/clientconfiguration.cpp Fri May 24 23:06:39 2013
@@ -28,7 +28,7 @@
_authz = OmapdConfig::DenyAll;
}

-void ClientConfiguration::createBasicAuthClient(QString clientName,
QString username, QString password, OmapdConfig::AuthzOptions authz,
QString metadataPolicy)
+void ClientConfiguration::createBasicAuthClient(const QString& clientName,
const QString& username, const QString& password, OmapdConfig::AuthzOptions
authz, const QString& metadataPolicy)
{
_authType = MapRequest::AuthBasic;
_authz = authz;
@@ -38,7 +38,7 @@
_metadataPolicy = metadataPolicy;
}

-void ClientConfiguration::createCertAuthClient(QString clientName, QString
certFile, QString caCertFile, OmapdConfig::AuthzOptions authz, QString
metadataPolicy)
+void ClientConfiguration::createCertAuthClient(const QString& clientName,
const QString& certFile, const QString& caCertFile,
OmapdConfig::AuthzOptions authz, const QString& metadataPolicy)
{
_authType = MapRequest::AuthCert;
_authz = authz;
@@ -49,7 +49,7 @@
_metadataPolicy = metadataPolicy;
}

-void ClientConfiguration::createCAAuthClient(QString clientPrefix, QString
issuingCACertFile, QString caCertFile, OmapdConfig::AuthzOptions authz,
QString metadataPolicy)
+void ClientConfiguration::createCAAuthClient(const QString& clientPrefix,
const QString& issuingCACertFile, const QString& caCertFile,
OmapdConfig::AuthzOptions authz, const QString& metadataPolicy)
{
_authType = MapRequest::AuthCACert;
_authz = authz;
=======================================
--- /branches/lfu/clientconfiguration.h Sun Feb 24 14:35:44 2013
+++ /branches/lfu/clientconfiguration.h Fri May 24 23:06:39 2013
@@ -29,19 +29,19 @@
{
public:
ClientConfiguration();
- void createBasicAuthClient(QString clientName, QString username,
QString password, OmapdConfig::AuthzOptions authz, QString metadataPolicy);
- void createCertAuthClient(QString clientName, QString certFile,
QString caCertFile, OmapdConfig::AuthzOptions authz, QString
metadataPolicy);
- void createCAAuthClient(QString clientPrefix, QString
issuingCACertFile, QString caCertFile, OmapdConfig::AuthzOptions authz,
QString metadataPolicy);
+ void createBasicAuthClient(const QString& clientName, const QString&
username, const QString& password, OmapdConfig::AuthzOptions authz, const
QString& metadataPolicy);
+ void createCertAuthClient(const QString& clientName, const QString&
certFile, const QString& caCertFile, OmapdConfig::AuthzOptions authz, const
QString& metadataPolicy);
+ void createCAAuthClient(const QString& clientPrefix, const QString&
issuingCACertFile, const QString& caCertFile, OmapdConfig::AuthzOptions
authz, const QString& metadataPolicy);

- QString metadataPolicy() { return _metadataPolicy; }
- QString name() { return _name; }
- QString username() { return _username; }
- QString password() { return _password; }
- QString certFileName() { return _certFileName; }
- QString caCertFileName() { return _caCertFileName; }
- bool haveClientCert() { return _haveClientCert; }
- MapRequest::AuthenticationType authType() { return _authType; }
- OmapdConfig::AuthzOptions authz() { return _authz; }
+ const QString& metadataPolicy() const { return _metadataPolicy; }
+ const QString& name() const { return _name; }
+ const QString& username() const { return _username; }
+ const QString& password() const { return _password; }
+ const QString& certFileName() const { return _certFileName; }
+ const QString& caCertFileName() const { return _caCertFileName; }
+ bool haveClientCert() const { return _haveClientCert; }
+ MapRequest::AuthenticationType authType() const { return _authType; }
+ OmapdConfig::AuthzOptions authz() const { return _authz; }

private:
QString _metadataPolicy;
=======================================
--- /branches/lfu/clienthandler.cpp Tue Mar 19 11:59:00 2013
+++ /branches/lfu/clienthandler.cpp Fri May 24 23:06:39 2013
@@ -30,7 +30,7 @@
#include "mapsessions.h"
#include "clientconfiguration.h"

-QString ClientHandler::buildDN(QSslCertificate cert,
ClientHandler::CertInfoTarget target)
+QString ClientHandler::buildDN(const QSslCertificate& cert, const
ClientHandler::CertInfoTarget& target)
{
QStringList dnElements;
QString certDN;
@@ -79,7 +79,7 @@

}

-ClientHandler::ClientHandler(MapGraphInterface *mapGraph, QString
authToken, QObject *parent) :
+ClientHandler::ClientHandler(MapGraphInterface *mapGraph, const QString&
authToken, QObject *parent) :
QSslSocket(parent), _mapGraph(mapGraph), _authToken(authToken)
{
_omapdConfig = OmapdConfig::getInstance();
@@ -95,7 +95,7 @@
QString publisherId = _mapSessions->pubIdForAuthToken(_authToken);

if (!publisherId.isEmpty()) {
- if
(_mapSessions->removeSubscriptionListForClient(_authToken).size() > 0) {
+ if (_mapSessions->removeSubscriptionListForClient(_authToken) > 0)
{
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowClientOps))
{
qDebug() << __PRETTY_FUNCTION__ << ":" << "Removing
subscriptions for publisherId:"
<< publisherId;
@@ -112,7 +112,7 @@
if (_parser) delete _parser;
}

-void ClientHandler::clientSocketError(QAbstractSocket::SocketError
socketError)
+void ClientHandler::clientSocketError(const QAbstractSocket::SocketError&
socketError)
{
qDebug() << __PRETTY_FUNCTION__ << ":" << "Socket error:" <<
socketError
<< errorString()
@@ -190,7 +190,7 @@
<< "------------->:" << sState;
}

-void ClientHandler::processHeader(QNetworkRequest requestHdrs)
+void ClientHandler::processHeader(const QNetworkRequest& requestHdrs)
{
// TODO: Improve http protocol support
if (requestHdrs.hasRawHeader(QByteArray("Expect"))) {
@@ -252,7 +252,7 @@

}

-void ClientHandler::sendHttpResponse(int hdrNumber, QString hdrText)
+void ClientHandler::sendHttpResponse(int hdrNumber, const QString& hdrText)
{
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowRawSocketData))
qDebug() << __PRETTY_FUNCTION__ << ":" << "Sending Http Response:"
<< hdrNumber << hdrText;
@@ -361,22 +361,22 @@
this, SLOT(processHeader(QNetworkRequest)));
}

-void ClientHandler::sendPollResponse(QByteArray response,
MapRequest::RequestVersion reqVersion)
+void ClientHandler::sendPollResponse(const QByteArray& response, const
MapRequest::RequestVersion& reqVersion)
{
this->sendResponse(response, reqVersion);
}

-void ClientHandler::sendMapResponse(MapResponse &mapResponse)
+void ClientHandler::sendMapResponse(const MapResponse &mapResponse)
{
this->sendResponse(mapResponse.responseData(),
mapResponse.requestVersion());
}

-void ClientHandler::sendResponse(QByteArray response,
MapRequest::RequestVersion reqVersion)
+void ClientHandler::sendResponse(const QByteArray& response, const
MapRequest::RequestVersion& reqVersion)
{
QByteArray compResponse;
QHttpResponseHeader header(200,"OK");
if (_useCompression) {
- compResponse = compressResponse(response);
+ compressResponse(response, compResponse);
header.setValue("Content-Encoding", "gzip");
header.setValue("Transfer-Encoding","chunked");
header.setContentLength(compResponse.size());
@@ -418,10 +418,8 @@
}
}

-QByteArray ClientHandler::compressResponse(QByteArray uncompressed)
+void ClientHandler::compressResponse(const QByteArray& uncompressed,
QByteArray& deflated )
{
- QByteArray deflated;
-
deflated = qCompress(uncompressed);

// eliminate qCompress size on first 4 bytes and 2 byte header
@@ -460,14 +458,12 @@
footer[4] = (isize & 0x000000ff);

deflated.append(footer);
-
- return deflated;
}

void ClientHandler::processClientRequest()
{
MapRequest::RequestType reqType = _parser->requestType();
- QVariant clientRequest = _parser->request();
+ const QVariant& clientRequest = _parser->request();

MapResponse *clientFaultResponse;

@@ -496,8 +492,14 @@
processPurgePublisher(clientRequest);
break;
case MapRequest::Publish:
+ {
+ // LFu - remove this
+ QTime timer;
+ timer.start();
processPublish(clientRequest);
+ // qDebug() << "~~processing publish request took " <<
timer.elapsed() << " ms";
break;
+ }
case MapRequest::Subscribe:
processSubscribe(clientRequest);
break;
@@ -511,7 +513,7 @@

}

-void ClientHandler::processNewSession(QVariant clientRequest)
+void ClientHandler::processNewSession(const QVariant& clientRequest)
{
NewSessionRequest nsReq = clientRequest.value<NewSessionRequest>();
MapResponse nsResp(nsReq.requestVersion());
@@ -549,7 +551,7 @@
sendMapResponse(nsResp);
}

-void ClientHandler::processRenewSession(QVariant clientRequest)
+void ClientHandler::processRenewSession(const QVariant& clientRequest)
{
/* IFMAP20: 4.4: In order to keep an IF-MAP session from timing out,
a MAP Client MUST either keep the underlying TCP connection
associated
@@ -569,7 +571,7 @@
sendMapResponse(rsResp);
}

-void ClientHandler::processEndSession(QVariant clientRequest)
+void ClientHandler::processEndSession(const QVariant& clientRequest)
{
EndSessionRequest esReq = clientRequest.value<EndSessionRequest>();

@@ -593,7 +595,7 @@
sendMapResponse(esResp);
}

-void ClientHandler::processAttachSession(QVariant clientRequest)
+void ClientHandler::processAttachSession(const QVariant& clientRequest)
{
AttachSessionRequest asReq =
clientRequest.value<AttachSessionRequest>();
MapResponse asResp(asReq.requestVersion());
@@ -656,7 +658,8 @@
QList<PublishOperation> publishOperations = pubReq.publishOperations();
QMutableListIterator<PublishOperation> pubOperIt(publishOperations);
while (pubOperIt.hasNext()) {
- PublishOperation pubOperCheck = pubOperIt.next();
+ // LFu: use reference here to avoid copy
+ PublishOperation& pubOperCheck = pubOperIt.next();

// Only check operations that come later in the request against
the current one
for (int i=pubOperCheck._operationNumber;
i<publishOperations.size(); i++) {
@@ -720,7 +723,8 @@
<< "to number of metadata elements:"
<< keepMetaList.size();
}
pubOperCheck._metadata = keepMetaList;
- pubOperIt.setValue(pubOperCheck);
+ // LFu: no need to setValue since we're
manipulating the list element directly
+ // pubOperIt.setValue(pubOperCheck);
}

} else if (pubOperCheck._publishType ==
PublishOperation::Update &&
@@ -753,7 +757,8 @@
<< "to number of metadata
elements:" << keepMetaList.size();
}
pubOperCheck._metadata = keepMetaList;
- pubOperIt.setValue(pubOperCheck);
+ // LFu: no need to setValue since we're
manipulating the list element directly
+ // pubOperIt.setValue(pubOperCheck);
}
}

@@ -789,7 +794,7 @@
pubReq.setPublishOperations(publishOperations);
}

-void ClientHandler::processPublish(QVariant clientRequest)
+void ClientHandler::processPublish(const QVariant& clientRequest)
{
PublishRequest pubReq = clientRequest.value<PublishRequest>();

@@ -805,19 +810,28 @@
an errorResult element with an errorCode attribute indicating the
cause of the
failure.
*/
- QList<PublishOperation> publishOperations = pubReq.publishOperations();
+ const QList<PublishOperation>& publishOperations =
pubReq.publishOperations();
QListIterator<PublishOperation> pubOperIt(publishOperations);
while (pubOperIt.hasNext() && !requestError) {
- PublishOperation pubOper = pubOperIt.next();
+ const PublishOperation& pubOper = pubOperIt.next();

if (pubOper._publishType == PublishOperation::Update
|| pubOper._publishType == PublishOperation::Notify) {

if (pubOper._publishType == PublishOperation::Update) {
+ // LFu - remove
+ QTime timer;
+ timer.start();
_mapGraph->addMeta(pubOper._link, pubOper._isLink,
pubOper._metadata, publisherId);
+ // qDebug() << "~~processing addMeta() took " <<
timer.elapsed() << " ms (meta = " <<
pubOper._metadata.first().elementName() << ")";
+
+ timer.restart();
+
// TODO: Move this outside of while loop for major
performance boost!
// update subscriptions
updateSubscriptions(pubOper._link, pubOper._isLink,
pubOper._metadata, Meta::PublishUpdate);
+ qDebug() << "~~processing updateSubscriptions() took " <<
timer.elapsed() << " ms";
+
} else if (pubOper._publishType == PublishOperation::Notify) {
// Deal with notify
updateSubscriptionsWithNotify(pubOper._link,
pubOper._isLink, pubOper._metadata);
@@ -874,7 +888,13 @@
}

if (metadataDeleted && !requestError) {
+
+ // LFu - remove
+ QTime timer;
+ timer.start();
updateSubscriptions(pubOper._link, pubOper._isLink,
deleteMetaList, Meta::PublishDelete);
+ // qDebug() << "~~processing updateSubscriptions() took "
<< timer.elapsed() << " ms";
+
}

}
@@ -903,7 +923,7 @@
sendMapResponse(pubResp);
}

-QPair< QList<Meta>, QList<Meta> >
ClientHandler::applyDeleteFilterToMeta(QList<Meta> existingMetaList,
PublishOperation pubOper, MapRequest::RequestError &requestError, bool
*metadataDeleted)
+QPair< QList<Meta>, QList<Meta> >
ClientHandler::applyDeleteFilterToMeta(const QList<Meta>& existingMetaList,
const PublishOperation& pubOper, MapRequest::RequestError &requestError,
bool *metadataDeleted)
{
QList<Meta> keepMetaList;
QList<Meta> deleteMetaList;
@@ -952,7 +972,7 @@

}

-void ClientHandler::processSubscribe(QVariant clientRequest)
+void ClientHandler::processSubscribe(const QVariant& clientRequest)
{
SubscribeRequest subReq = clientRequest.value<SubscribeRequest>();

@@ -978,11 +998,14 @@

if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowSearchAlgorithm))
{
qDebug() << __PRETTY_FUNCTION__ << ":" << "Subscription:"
<< subOper.name();
- qDebug() << __PRETTY_FUNCTION__ << ":" << " idList
size:" << sub._idList.size();
+ qDebug() << __PRETTY_FUNCTION__ << ":" << " idList
size:" << sub._ids.size();
qDebug() << __PRETTY_FUNCTION__ << ":" << " linkList
size:" << sub._linkList.size();
}

- QList<Subscription> subList =
_mapSessions->subscriptionListForClient(_authToken);
+ // LFu:
+ // instead of changing a local copy of the subs list and then
writing it back,
+ // change the list in place?
+ QList<Subscription>& subList =
_mapSessions->subscriptionListForClient(_authToken);
if (subList.isEmpty()) {
subList << sub;
} else {
@@ -994,7 +1017,8 @@
qDebug() << __PRETTY_FUNCTION__ << ":" << "subList size:"
<< subList.size();
}

- _mapSessions->setSubscriptionListForClient(_authToken,
subList);
+ // LFu: this is no longer necessary:
+ // _mapSessions->setSubscriptionListForClient(_authToken,
subList);
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowClientOps))
{
qDebug() << __PRETTY_FUNCTION__ << ":" << "Adding
SearchGraph to subscription lists with name:" << sub._name;
}
@@ -1008,7 +1032,9 @@
Subscription delSub(subReq.requestVersion());
delSub._name = subOper.name();

- QList<Subscription> subList =
_mapSessions->removeSubscriptionListForClient(_authToken);
+ // LFu: change subscription list in-place
+ QList<Subscription>& subList =
_mapSessions->subscriptionListForClient(_authToken);
+ // _mapSessions->removeSubscriptionListForClient(_authToken);
if (! subList.isEmpty()) {
// remove delSub from list with same name
subList.removeOne(delSub);
@@ -1021,9 +1047,10 @@
}
}

- if (! subList.isEmpty()) {
- _mapSessions->setSubscriptionListForClient(_authToken,
subList);
- }
+ // (LFu) no longer need to save back list
+ // if (! subList.isEmpty()) {
+ // _mapSessions->setSubscriptionListForClient(_authToken,
subList);
+ // }

if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowClientOps))
{
qDebug() << __PRETTY_FUNCTION__ << ":" << "subList size:"
<< subList.size();
@@ -1041,7 +1068,7 @@
sendMapResponse(subResp);
}

-void ClientHandler::processSearch(QVariant clientRequest)
+void ClientHandler::processSearch(const QVariant& clientRequest)
{
SearchRequest searchReq = clientRequest.value<SearchRequest>();
MapResponse searchResp(searchReq.requestVersion());
@@ -1059,7 +1086,7 @@
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowClientOps))
{
qDebug() << __PRETTY_FUNCTION__ << ":" << "Search Lists";
// NB: idList size should be 1 or more, because we always
include the starting identifier
- qDebug() << __PRETTY_FUNCTION__ << ":" << " idList size:"
<< tempSub._idList.size();
+ qDebug() << __PRETTY_FUNCTION__ << ":" << " ids size:" <<
tempSub._ids.size();
qDebug() << __PRETTY_FUNCTION__ << ":" << " linkList size:"
<< tempSub._linkList.size();
}

@@ -1079,7 +1106,7 @@
sendMapResponse(searchResp);
}

-void ClientHandler::processPurgePublisher(QVariant clientRequest)
+void ClientHandler::processPurgePublisher(const QVariant& clientRequest)
{
PurgePublisherRequest ppReq =
clientRequest.value<PurgePublisherRequest>();

@@ -1114,7 +1141,7 @@
sendMapResponse(ppResp);
}

-void ClientHandler::processPoll(QVariant clientRequest)
+void ClientHandler::processPoll(const QVariant& clientRequest)
{
PollRequest pollReq = clientRequest.value<PollRequest>();

@@ -1191,7 +1218,7 @@
server.
*/
if (requestError) {
- if
(_mapSessions->removeSubscriptionListForClient(_authToken).size() > 0) {
+ if (_mapSessions->removeSubscriptionListForClient(_authToken) > 0)
{
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowClientOps))
{
qDebug() << __PRETTY_FUNCTION__ << ":" << "Removing
subscriptions for publisherId:" << publisherId;
}
@@ -1203,7 +1230,7 @@
}
}

-bool ClientHandler::terminateSession(QString sessionId,
MapRequest::RequestVersion requestVersion)
+bool ClientHandler::terminateSession(const QString& sessionId,
MapRequest::RequestVersion requestVersion)
{
bool hadExistingSSRCSession =
_mapSessions->haveActiveSSRCForClient(_authToken);
if (hadExistingSSRCSession) {
@@ -1217,7 +1244,7 @@
delete any previous subscriptions corresponding to the MAP
Client. In
other words, subscription lists are only valid for a single MAP
Client session.
*/
- if
(_mapSessions->removeSubscriptionListForClient(_authToken).size() > 0) {
+ if (_mapSessions->removeSubscriptionListForClient(_authToken) > 0)
{
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowClientOps))
{
qDebug() << __PRETTY_FUNCTION__ << ":" << "Removing
subscriptions for publisherId:"
<< publisherId;
@@ -1245,7 +1272,7 @@
return hadExistingSSRCSession;
}

-bool ClientHandler::terminateARCSession(QString sessionId,
MapRequest::RequestVersion requestVersion)
+bool ClientHandler::terminateARCSession(const QString& sessionId,
MapRequest::RequestVersion requestVersion)
{
bool hadExistingARCSession =
_mapSessions->haveActiveARCForClient(_authToken);

@@ -1281,7 +1308,7 @@
return hadExistingARCSession;
}

-bool ClientHandler::purgePublisher(QString publisherId, bool
sessionMetadataOnly)
+bool ClientHandler::purgePublisher(const QString& publisherId, bool
sessionMetadataOnly)
{
bool haveChanges = false;
bool haveChange = true;
@@ -1307,14 +1334,14 @@
return haveChanges;
}

-QString ClientHandler::filteredMetadata(Meta meta, QString filter,
QMap<QString, QString> searchNamespaces, MapRequest::RequestError &error)
+QString ClientHandler::filteredMetadata(const Meta& meta, const QString&
filter, const QMap<QString, QString>& searchNamespaces,
MapRequest::RequestError &error)
{
QList<Meta> singleMetaList;
singleMetaList.append(meta);
return filteredMetadata(singleMetaList, filter, searchNamespaces,
error);
}

-QString ClientHandler::filteredMetadata(QList<Meta>metaList, QString
filter, QMap<QString, QString>searchNamespaces, MapRequest::RequestError
&error)
+QString ClientHandler::filteredMetadata(const QList<Meta>& metaList, const
QString& filter, const QMap<QString, QString>& searchNamespaces,
MapRequest::RequestError &error)
{
QString resultString("");
bool matchAll = false;
@@ -1406,7 +1433,7 @@
return resultString;
}

-void ClientHandler::addIdentifierResult(Subscription &sub, Identifier id,
QList<Meta> metaList, SearchResult::ResultType resultType,
MapRequest::RequestError &operationError)
+void ClientHandler::addIdentifierResult(Subscription &sub, const
Identifier& id, const QList<Meta>& metaList, SearchResult::ResultType
resultType, MapRequest::RequestError &operationError)
{

SearchResult *searchResult = new SearchResult(resultType,
SearchResult::IdentifierResult);
@@ -1433,7 +1460,7 @@
}
}

-void ClientHandler::addLinkResult(Subscription &sub, Link link,
QList<Meta> metaList, SearchResult::ResultType resultType,
MapRequest::RequestError &operationError)
+void ClientHandler::addLinkResult(Subscription &sub, const Link& link,
const QList<Meta>& metaList, SearchResult::ResultType resultType,
MapRequest::RequestError &operationError)
{

SearchResult *searchResult = new SearchResult(resultType,
SearchResult::LinkResult);
@@ -1473,16 +1500,30 @@
case, the MAP Server MUST return the identifier with no metadata or
links attached to it.
*/
- QSetIterator<Id> idIt(sub._idList);
- while (idIt.hasNext() && !operationError) {
- Id id = idIt.next();
- QList<Meta> idMetaList = _mapGraph->metaForId(id);
- if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowSearchAlgorithm))
{
- qDebug() << __PRETTY_FUNCTION__ << ":" << "idMetaList size for
id:" << id << "-->" << idMetaList.size();
+
+ QMapIterator<Id, int> idIt(sub._ids);
+ while (idIt.hasNext() && !operationError) {
+ Id id = idIt.next().key();
+ QList<Meta> idMetaList = _mapGraph->metaForId(id);
+ if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowSearchAlgorithm))
{
+ qDebug() << __PRETTY_FUNCTION__ << ":" << "idMetaList size
for id:" << id << "-->" << idMetaList.size();
+ }
+ // TODO: Should the identifier be added if there is no
metadata at all?
+ addIdentifierResult(sub, id, idMetaList, resultType,
operationError);
}
- // TODO: Should the identifier be added if there is no metadata at
all?
- addIdentifierResult(sub, id, idMetaList, resultType,
operationError);
- }
+
+
+// (LFu) was:
+// QSetIterator<Id> idIt(sub._idList);
+// while (idIt.hasNext() && !operationError) {
+// Id id = idIt.next();
+// QList<Meta> idMetaList = _mapGraph->metaForId(id);
+// if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowSearchAlgorithm))
{
+// qDebug() << __PRETTY_FUNCTION__ << ":" << "idMetaList size
for id:" << id << "-->" << idMetaList.size();
+// }
+// // TODO: Should the identifier be added if there is no metadata
at all?
+// addIdentifierResult(sub, id, idMetaList, resultType,
operationError);
+// }

QSetIterator<Link> linkIt(sub._linkList);
while (linkIt.hasNext() && !operationError) {
@@ -1495,7 +1536,7 @@
}
}

-void ClientHandler::addUpdateAndDeleteMetadata(Subscription &sub,
SearchResult::ResultType resultType, QSet<Id>idList, QSet<Link>linkList,
MapRequest::RequestError &operationError)
+void ClientHandler::addUpdateAndDeleteMetadata(Subscription &sub,
SearchResult::ResultType resultType, const QSet<Id>& idList, const
QSet<Link>& linkList, MapRequest::RequestError &operationError)
{
QSetIterator<Id> idIt(idList);
while (idIt.hasNext() && !operationError) {
@@ -1528,7 +1569,7 @@
}

// currentDepth is pass by value! Must initially be -1.
-void ClientHandler::buildSearchGraph(Subscription &sub, Id startId, int
currentDepth)
+void ClientHandler::buildSearchGraph(Subscription &sub, const Id& startId,
int currentDepth)
{
/* IFMAP20: 3.7.2.8: Recursive Algorithm is from spec */
// 1. Current id, current results, current depth
@@ -1540,7 +1581,10 @@

// 2. Save current identifier in list of traversed identifiers
// so we can later gather metadata from these identifiers.
- sub._idList.insert(startId);
+
+ sub.addId(startId, currentDepth);
+ // LFu - was:
+ // sub._idList.insert(startId);

// 3. If the current identifiers type is contained within
// terminal-identifier-type, return current results.
@@ -1606,14 +1650,17 @@
Link link = linkIter.next();
Id linkedId = Identifier::otherIdForLink(link, startId);
// linkedId becomes startId in recursion
- buildSearchGraph(sub, linkedId, currentDepth);
+ // LFu - filter out IDs in the recursion if we have visited
them already
+ int linkedIdDepth = sub.getDepth(linkedId); // returns -1 if
linkedId not in sub
+ if(linkedIdDepth == -1 || linkedIdDepth > currentDepth + 1)
+ buildSearchGraph(sub, linkedId, currentDepth);
}
}


}

-void ClientHandler::updateSubscriptions(QHash<Id, QList<Meta> >
idMetaDeleted, QHash<Link, QList<Meta> > linkMetaDeleted)
+void ClientHandler::updateSubscriptions(const QHash<Id, QList<Meta> >&
idMetaDeleted, const QHash<Link, QList<Meta> >& linkMetaDeleted)
{
QHashIterator<Id, QList<Meta> > idIter(idMetaDeleted);
while (idIter.hasNext()) {
@@ -1637,7 +1684,7 @@
// the SearchGraphs. If a subscription results in a changed SearchGraph
that
// matches the subscription, build the appropriate metadata results, so
that we
// can send out pollResults.
-void ClientHandler::updateSubscriptions(Link link, bool isLink,
QList<Meta> metaChanges, Meta::PublishOperationType publishType)
+void ClientHandler::updateSubscriptions(const Link link, bool isLink,
const QList<Meta>& metaChanges, Meta::PublishOperationType publishType)
{
// An existing subscription becomes dirty in 4 cases:
// 1. metadata is added to or removed from an identifier already in
the SearchGraph
@@ -1655,7 +1702,7 @@
QHashIterator<QString,QList<Subscription> >
allSubsIt(_mapSessions->subscriptionLists());
while (allSubsIt.hasNext()) {
allSubsIt.next();
- QString authToken = allSubsIt.key();
+ const QString& authToken = allSubsIt.key();
QString pubId = _mapSessions->pubIdForAuthToken(authToken);
QList<Subscription> subList = allSubsIt.value();
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowSearchAlgorithm))
{
@@ -1676,7 +1723,7 @@
bool subIsDirty = false;

if (! isLink) {
- if (sub._idList.contains(link.first)) {
+ if (sub._ids.contains(link.first)) {
// Case 1.
subIsDirty = true;
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowSearchAlgorithm))
{
@@ -1684,7 +1731,10 @@
}
}
} else {
- if (sub._linkList.contains(link) && publishType ==
Meta::PublishDelete) {
+
+ bool isLinkInSub = sub._linkList.contains(link);
+
+ if (isLinkInSub && publishType == Meta::PublishDelete) {
// Case 3.
subIsDirty = true;
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowSearchAlgorithm))
{
@@ -1692,28 +1742,56 @@
}
}

- if (sub._linkList.contains(link) && publishType ==
Meta::PublishUpdate) {
+ if (isLinkInSub && publishType == Meta::PublishUpdate) {
// Case 2.
subIsDirty = true;
- } else {
+ } else if (isLinkInSub || publishType ==
Meta::PublishUpdate) {
+ // (LFu) - the way this else was writen before, it
also covered the case:
+ // !sub._linkList.contains(link) && publishType ==
Meta::PublishDelete, which we should ignore
+
+ // TODO: when adding a link do no re-calculate the
subs search graph if the link identifer
+ // is equal to max search depth because the new link
won't contribute to the subscription
+ // search graph
+
+ // TODO: when ading a link that has no metadata that
matches the subscripton also do not rebuild
+ // the search graph
+
+ // TODO: when adding a link that contrinutes to the
subscription's search graph, we should be able
+ // to extend the search graph rather than having to
completely recalculate it
+
+ // TODO: we should also be able to optimize removal of
a link, e.g. any link that ends in an identifier
+ // of max subs search depth can be removed in
isolation (i.e. no subs graph must be calculated)
+
// Case 4. (and search graph rebuild for case 3)
- QSet<Id> existingIdList = sub._idList;
+ QMap<Id, int> existingIdList = sub._ids;
QSet<Link> existingLinkList = sub._linkList;
- sub._idList.clear();
+ sub._ids.clear();
sub._linkList.clear();
int currentDepth = -1;
+
+ // LFu - remove
+ QTime buildSearchGraphTimer;
+ buildSearchGraphTimer.start();
+
buildSearchGraph(sub, sub._search.startId(),
currentDepth);
+ // qDebug() << "~~processing buildSearchGraph() took "
<< buildSearchGraphTimer.elapsed() << " ms for sub " << sub._name;

- if (sub._idList != existingIdList) {
+ if (sub._ids != existingIdList) {
subIsDirty = true;
modifiedSearchGraph = true;
+
// Metadata on these ids are in updateResults
- idsWithConnectedGraphUpdates = sub._idList -
existingIdList;
+ idsWithConnectedGraphUpdates =
sub.identifiersWithout(existingIdList);
+ // was:
+ // idsWithConnectedGraphUpdates = sub._idList -
existingIdList;
+
// Metadata on these ids are in deleteResults
- idsWithConnectedGraphDeletes = existingIdList -
sub._idList;
+ idsWithConnectedGraphDeletes =
sub.subtractFrom(existingIdList);
+ // was:
+ // idsWithConnectedGraphDeletes = existingIdList -
sub._idList;

if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowSearchAlgorithm))
{
- qDebug() << __PRETTY_FUNCTION__ << ":"
<< "----subscription is dirty with newIdList.size:" << sub._idList.size();
+ qDebug() << __PRETTY_FUNCTION__
<< ":sub._linkList.contains(link) && " << "----subscription is dirty with
newIdList.size:" << sub._ids.size();
}
}

@@ -1780,7 +1858,7 @@
// Iterate over all subscriptions for all publishers, checking the
SearchGraphs
// to see if subscriptions match the notify metadata. If a subscription
matches,
// mark the subscription as dirty, so that we can send out pollResults.
-void ClientHandler::updateSubscriptionsWithNotify(Link link, bool isLink,
QList<Meta> notifyMetaList)
+void ClientHandler::updateSubscriptionsWithNotify(const Link& link, bool
isLink, const QList<Meta>& notifyMetaList)
{
// An existing subscription becomes dirty in 3 cases:
// 1. metadata is publish-notify on an identifier in the SearchGraph
@@ -1808,7 +1886,7 @@

if (! isLink) {
// Case 1.
- if (sub._idList.contains(link.first)) {
+ if (sub._ids.contains(link.first)) {
subIsDirty = true;
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowSearchAlgorithm))
{
qDebug() << __PRETTY_FUNCTION__ << ":"
<< "----subscription is dirty with id in SearchGraph:" << link.first;
@@ -1821,7 +1899,7 @@
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowSearchAlgorithm))
{
qDebug() << __PRETTY_FUNCTION__ << ":"
<< "----subscription is dirty with link in SearchGraph:" << link;
}
- } else if (sub._idList.contains(link.first) ||
sub._idList.contains(link.second)) {
+ } else if (sub._ids.contains(link.first) ||
sub._ids.contains(link.second)) {
// Case 3.
subIsDirty = true;
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowSearchAlgorithm))
{
=======================================
--- /branches/lfu/clienthandler.h Thu Feb 21 17:10:53 2013
+++ /branches/lfu/clienthandler.h Fri May 24 23:06:39 2013
@@ -41,20 +41,20 @@
};

explicit ClientHandler(MapGraphInterface *mapGraph, QObject *parent =
0);
- explicit ClientHandler(MapGraphInterface *mapGraph, QString authToken,
QObject *parent = 0);
+ explicit ClientHandler(MapGraphInterface *mapGraph, const QString&
authToken, QObject *parent = 0);
~ClientHandler();

- static QString buildDN(QSslCertificate cert,
ClientHandler::CertInfoTarget target);
+ static QString buildDN(const QSslCertificate& cert, const
ClientHandler::CertInfoTarget& target);

void sessionMetadataTimeout();
- void sendPollResponse(QByteArray response, MapRequest::RequestVersion
reqVersion);
- QString authToken() { return _authToken; }
+ void sendPollResponse(const QByteArray& response, const
MapRequest::RequestVersion& reqVersion);
+ const QString& authToken() { return _authToken; }
bool useCompression() { return _useCompression; }

signals:
- void needToSendPollResponse(ClientHandler *client, QByteArray
response, MapRequest::RequestVersion reqVersion);
- void receivedNewSession(QString authToken);
- void receivedRenewSession(QString authToken);
+ void needToSendPollResponse(ClientHandler *client, const QByteArray&
response, MapRequest::RequestVersion reqVersion);
+ void receivedNewSession(const QString& authToken);
+ void receivedRenewSession(const QString& authToken);
void receivedEndSession();
void receivedMigratedSession(ClientHandler *client);

@@ -62,51 +62,51 @@
void handleParseComplete();

private slots:
- void clientSocketError(QAbstractSocket::SocketError socketError);
+ void clientSocketError(const QAbstractSocket::SocketError&
socketError);
void processReadyRead();
void socketReady();
void clientSSLErrors(const QList<QSslError> & errors);
void clientConnState(QAbstractSocket::SocketState sState);
- void processHeader(QNetworkRequest requestHdrs);
+ void processHeader(const QNetworkRequest& requestHdrs);

private:
void registerCert();
- QByteArray compressResponse(QByteArray uncompressed);
- void sendHttpResponse(int hdrNumber, QString hdrText);
- void sendMapResponse(MapResponse &mapResponse);
- void sendResponse(QByteArray response, MapRequest::RequestVersion
reqVersion);
+ void compressResponse(const QByteArray& uncompressed, QByteArray&
deflated);
+ void sendHttpResponse(int hdrNumber, const QString& hdrText);
+ void sendMapResponse(const MapResponse &mapResponse);
+ void sendResponse(const QByteArray& response, const
MapRequest::RequestVersion& reqVersion);
void processClientRequest();
void sendResultsOnActivePolls();

- QString filteredMetadata(QList<Meta> metaList, QString filter,
QMap<QString, QString> searchNamespaces, MapRequest::RequestError &error);
- QString filteredMetadata(Meta meta, QString filter, QMap<QString,
QString> searchNamespaces, MapRequest::RequestError &error);
+ QString filteredMetadata(const QList<Meta>& metaList, const QString&
filter, const QMap<QString, QString>& searchNamespaces,
MapRequest::RequestError &error);
+ QString filteredMetadata(const Meta& meta, const QString& filter,
const QMap<QString, QString>& searchNamespaces, MapRequest::RequestError
&error);

void collectSearchGraphMetadata(Subscription &sub,
SearchResult::ResultType resultType, MapRequest::RequestError
&operationError);
- void addUpdateAndDeleteMetadata(Subscription &sub,
SearchResult::ResultType resultType, QSet<Id> idList, QSet<Link> linkList,
MapRequest::RequestError &operationError);
- void buildSearchGraph(Subscription &sub, Id startId, int currentDepth);
- void addIdentifierResult(Subscription &sub, Identifier id, QList<Meta>
metaList, SearchResult::ResultType resultType, MapRequest::RequestError
&operationError);
- void addLinkResult(Subscription &sub, Link link, QList<Meta> metaList,
SearchResult::ResultType resultType, MapRequest::RequestError
&operationError);
+ void addUpdateAndDeleteMetadata(Subscription &sub,
SearchResult::ResultType resultType, const QSet<Id>& idList, const
QSet<Link>& linkList, MapRequest::RequestError &operationError);
+ void buildSearchGraph(Subscription &sub, const Id& startId, int
currentDepth);
+ void addIdentifierResult(Subscription &sub, const Identifier& id,
const QList<Meta>& metaList, SearchResult::ResultType resultType,
MapRequest::RequestError &operationError);
+ void addLinkResult(Subscription &sub, const Link& link, const
QList<Meta>& metaList, SearchResult::ResultType resultType,
MapRequest::RequestError &operationError);

- void updateSubscriptionsWithNotify(Link link, bool isLink, QList<Meta>
metaChanges);
- void updateSubscriptions(QHash<Id, QList<Meta> > idMetaDeleted,
QHash<Link, QList<Meta> > linkMetaDeleted);
- void updateSubscriptions(Link link, bool isLink, QList<Meta>
metaChanges, Meta::PublishOperationType publishType);
+ void updateSubscriptionsWithNotify(const Link& link, bool isLink,
const QList<Meta>& metaChanges);
+ void updateSubscriptions(const QHash<Id, QList<Meta> >& idMetaDeleted,
const QHash<Link, QList<Meta> >& linkMetaDeleted);
+ void updateSubscriptions(const Link link, bool isLink, const
QList<Meta>& metaChanges, Meta::PublishOperationType publishType);

- void processNewSession(QVariant clientRequest);
- void processRenewSession(QVariant clientRequest);
- void processEndSession(QVariant clientRequest);
- void processAttachSession(QVariant clientRequest);
- void processPublish(QVariant clientRequest);
- void processSubscribe(QVariant clientRequest);
- void processSearch(QVariant clientRequest);
- void processPurgePublisher(QVariant clientRequest);
- void processPoll(QVariant clientRequest);
+ void processNewSession(const QVariant& clientRequest);
+ void processRenewSession(const QVariant& clientRequest);
+ void processEndSession(const QVariant& clientRequest);
+ void processAttachSession(const QVariant& clientRequest);
+ void processPublish(const QVariant& clientRequest);
+ void processSubscribe(const QVariant& clientRequest);
+ void processSearch(const QVariant& clientRequest);
+ void processPurgePublisher(const QVariant& clientRequest);
+ void processPoll(const QVariant& clientRequest);

void checkPublishAtomicity(PublishRequest &pubReq,
MapRequest::RequestError &requestError);
- QPair< QList<Meta>, QList<Meta> > applyDeleteFilterToMeta(QList<Meta>
existingMetaList, PublishOperation pubOper, MapRequest::RequestError
&requestError, bool *metadataDeleted = 0);
+ QPair< QList<Meta>, QList<Meta> > applyDeleteFilterToMeta(const
QList<Meta>& existingMetaList, const PublishOperation& pubOper,
MapRequest::RequestError &requestError, bool *metadataDeleted = 0);

- bool terminateSession(QString sessionId, MapRequest::RequestVersion
requestVersion);
- bool terminateARCSession(QString sessionId, MapRequest::RequestVersion
requestVersion);
- bool purgePublisher(QString publisherId, bool sessionMetadataOnly);
+ bool terminateSession(const QString& sessionId,
MapRequest::RequestVersion requestVersion);
+ bool terminateARCSession(const QString& sessionId,
MapRequest::RequestVersion requestVersion);
+ bool purgePublisher(const QString& publisherId, bool
sessionMetadataOnly);

private:
OmapdConfig* _omapdConfig;
=======================================
--- /branches/lfu/clientparser.cpp Sun Feb 24 14:35:44 2013
+++ /branches/lfu/clientparser.cpp Fri May 24 23:06:39 2013
@@ -543,7 +543,7 @@
}

if (_requestError == MapRequest::ErrorNone) {
- QString authToken = ((ClientHandler*)this->parent())->authToken();
+ const QString& authToken =
((ClientHandler*)this->parent())->authToken();
QString clientPubId =
MapSessions::getInstance()->pubIdForAuthToken(authToken);
OmapdConfig::AuthzOptions authz =
MapSessions::getInstance()->authzForAuthToken(authToken);

@@ -569,7 +569,7 @@
pubReq.setRequestVersion(_requestVersion);
_requestType = MapRequest::Publish;
setSessionId(pubReq);
- QString authToken = ((ClientHandler*)this->parent())->authToken();
+ const QString& authToken =
((ClientHandler*)this->parent())->authToken();

pubReq.setPublisherId(MapSessions::getInstance()->pubIdForAuthToken(authToken));

OmapdConfig::AuthzOptions authz =
MapSessions::getInstance()->authzForAuthToken(authToken);
@@ -1283,7 +1283,7 @@
_xml.raiseError("Metadata did not pass validation test");
}

- QString authToken = ((ClientHandler*)this->parent())->authToken();
+ const QString& authToken =
((ClientHandler*)this->parent())->authToken();
bool metaPolicy =
MapSessions::getInstance()->metadataAuthorizationForAuthToken(authToken,
metaName, metaNS);
if (!metaPolicy) {
pubReq.setRequestError(MapRequest::IfmapAccessDenied);
=======================================
--- /branches/lfu/clientparser.h Thu Oct 6 14:28:02 2011
+++ /branches/lfu/clientparser.h Fri May 24 23:06:39 2013
@@ -44,15 +44,15 @@
public:
ClientParser(QIODevice *parent = 0);
~ClientParser();
- QString clientXML() { return _clientRequestXml; }
+ const QString& clientXML() { return _clientRequestXml; }
QString errorString() const { return _xml.errorString(); }
QXmlStreamReader::Error error() const { return _xml.error(); }

- QVariant request() const { return _mapRequest; }
- MapRequest::RequestError requestError() const { return _requestError; }
- MapRequest::RequestVersion requestVersion() const { return
_requestVersion; }
+ const QVariant& request() const { return _mapRequest; }
+ const MapRequest::RequestError& requestError() const { return
_requestError; }
+ const MapRequest::RequestVersion& requestVersion() const { return
_requestVersion; }
MapRequest::RequestType requestType() const { return _requestType; }
- QString sessionId() const { return _sessionId; }
+ const QString& sessionId() const { return _sessionId; }


signals:
=======================================
--- /branches/lfu/identifier.cpp Sun Sep 25 13:51:15 2011
+++ /branches/lfu/identifier.cpp Fri May 24 23:06:39 2013
@@ -122,7 +122,7 @@

}

-Link Identifier::makeLinkFromIds(Id id1, Id id2)
+Link Identifier::makeLinkFromIds(const Id& id1, const Id& id2)
{
Link link;
// Make identifier ordering independent of received order
@@ -138,7 +138,7 @@
return link;
}

-Id Identifier::otherIdForLink(Link link, Id targetId)
+Id Identifier::otherIdForLink(const Link& link, const Id& targetId)
{
if (link.first == targetId)
return link.second;
@@ -151,7 +151,7 @@
{
}

-Identifier::Identifier(Identifier::IdType type, QString value, QString ad,
QString other)
+Identifier::Identifier(Identifier::IdType type, const QString& value,
const QString& ad, const QString& other)
: _type(type), _value(value), _ad(ad), _other(other)
{
}
=======================================
--- /branches/lfu/identifier.h Sun Sep 25 13:51:15 2011
+++ /branches/lfu/identifier.h Fri May 24 23:06:39 2013
@@ -55,28 +55,29 @@
};

Identifier(Identifier::IdType type = Identifier::IdNone);
- Identifier(Identifier::IdType type, QString value, QString ad =
QString(), QString other = QString());
+ Identifier(Identifier::IdType type, const QString& value, const
QString& ad = QString(), const QString& other = QString());

static QString idStringForType(Identifier::IdType idType);
static QString idBaseStringForType(Identifier::IdType idType);
- static Link makeLinkFromIds(Id id1, Id id2);
- static Id otherIdForLink(Link link, Id targetId);
+ static Link makeLinkFromIds(const Id& id1, const Id& id2);
+ static Id otherIdForLink(const Link& link, const Id& targetId);

// Two Identifier objects are equal iff their type, namespace, value,
and other members are the same
bool operator==(const Identifier &other) const;
+ bool operator< (const Id& other) const { return hashString() <
other.hashString(); }
//QDataStream & operator<< ( QDataStream & stream, const Identifier &
id );

Identifier::IdType type() const { return _type; }
- QString value() const { return _value; }
- QString ad() const { return _ad; }
- QString other() const { return _other; }
+ const QString& value() const { return _value; }
+ const QString& ad() const { return _ad; }
+ const QString& other() const { return _other; }

QString hashString() const;

void setType(Identifier::IdType type) { _type = type; }
- void setValue(QString value) { _value = value; }
- void setAd(QString ad) { _ad = ad; }
- void setOther(QString other) { _other = other; }
+ void setValue(const QString& value) { _value = value; }
+ void setAd(const QString& ad) { _ad = ad; }
+ void setOther(const QString& other) { _other = other; }

private:
Identifier::IdType _type;
=======================================
--- /branches/lfu/mapclient.cpp Sun Feb 24 14:35:44 2013
+++ /branches/lfu/mapclient.cpp Fri May 24 23:06:39 2013
@@ -30,7 +30,7 @@
_hasActivePoll = false;
}

-MapClient::MapClient(QString authToken, MapRequest::AuthenticationType
authType, OmapdConfig::AuthzOptions authz, QString pubId, QString
metadataPolicy)
+MapClient::MapClient(const QString& authToken,
MapRequest::AuthenticationType authType, OmapdConfig::AuthzOptions authz,
const QString& pubId, const QString& metadataPolicy)
{
_hasActiveSSRC = false;
_hasActiveARC = false;
=======================================
--- /branches/lfu/mapclient.h Sun Feb 24 14:35:44 2013
+++ /branches/lfu/mapclient.h Fri May 24 23:06:39 2013
@@ -32,30 +32,31 @@
// that return a default constructed value
MapClient();

- MapClient(QString authToken,
+ MapClient(const QString& authToken,
MapRequest::AuthenticationType authType,
OmapdConfig::AuthzOptions authz,
- QString pubId,
- QString metadataPolicy);
+ const QString& pubId,
+ const QString& metadataPolicy);

- QString pubId() const { return _pubId; }
- QString authToken() const { return _authToken; }
+ const QString& pubId() const { return _pubId; }
+ const QString& authToken() const { return _authToken; }
MapRequest::AuthenticationType authType() const { return _authType; }
OmapdConfig::AuthzOptions authz() const { return _authz; }
- QString metadataPolicy() const { return _metadataPolicy; }
+ const QString& metadataPolicy() const { return _metadataPolicy; }

- QString sessId() const { return _sessId; }
+ const QString& sessId() const { return _sessId; }
bool hasActiveSSRC() const { return _hasActiveSSRC; }
bool hasActiveARC() const { return _hasActiveARC; }
bool hasActivePoll() const { return _hasActivePoll; }
- QList<Subscription> subscriptionList() const { return
_subscriptionList; }
+ const QList<Subscription>& subscriptionList() const { return
_subscriptionList; }
+ QList<Subscription>& subscriptionList() { return _subscriptionList; }

- void setSessId(QString sessId) { _sessId = sessId; }
- void clearSessId() { _sessId = QString(); }
+ void setSessId(const QString& sessId) { _sessId = sessId; }
+ void clearSessId() { _sessId.clear(); }
void setHasActiveSSRC(bool hasActiveSSRC) { _hasActiveSSRC =
hasActiveSSRC; }
void setHasActiveARC(bool hasActiveARC) { _hasActiveARC =
hasActiveARC; }
void setHasActivePoll(bool hasActivePoll) { _hasActivePoll =
hasActivePoll; }
- void setSubscriptionList(QList<Subscription> subList) {
_subscriptionList = subList; }
+ void setSubscriptionList(const QList<Subscription>& subList) {
_subscriptionList = subList; }
void emptySubscriptionList() { _subscriptionList.clear(); }

private:
=======================================
--- /branches/lfu/maprequest.h Thu Jul 12 22:55:18 2012
+++ /branches/lfu/maprequest.h Fri May 24 23:06:39 2013
@@ -105,18 +105,18 @@
MapRequest::RequestError requestError() const { return _requestError; }
MapRequest::RequestVersion requestVersion() const { return
_requestVersion; }
MapRequest::RequestType requestType() const { return _requestType; }
- QString sessionId() const { return _sessionId; }
+ const QString& sessionId() const { return _sessionId; }
bool clientSetSessionId() const { return _clientSetSessionId; }
MapRequest::AuthenticationType authType() const { return _authType; }
- QString authToken() const { return _authValue; }
+ const QString& authToken() const { return _authValue; }

void setRequestError(MapRequest::RequestError requestError) {
_requestError = requestError; }
void setRequestType(MapRequest::RequestType requestType) {
_requestType = requestType; }
void setRequestVersion(MapRequest::RequestVersion requestVersion) {
_requestVersion = requestVersion; }
- void setSessionId(QString sessionId) { _sessionId = sessionId; }
+ void setSessionId(const QString& sessionId) { _sessionId = sessionId; }
void setClientSetSessionId(bool set) { _clientSetSessionId = set; }
void setAuthType(MapRequest::AuthenticationType type) { _authType =
type; }
- void setAuthValue(QString value) { _authValue = value; }
+ void setAuthValue(const QString& value) { _authValue = value; }

protected:
MapRequest::RequestError _requestError;
@@ -179,11 +179,12 @@
PurgePublisherRequest();
PurgePublisherRequest(const PurgePublisherRequest&);
~PurgePublisherRequest() {;}
+ // FIXME LFu: this seems wrong (const return value)
const PurgePublisherRequest& operator= (const PurgePublisherRequest&
rhs);

- QString publisherId() const { return _publisherId; }
+ const QString& publisherId() const { return _publisherId; }
bool clientSetPublisherId() const { return _clientSetPublisherId; }
- void setPublisherId(QString pubId) { _publisherId = pubId; }
+ void setPublisherId(const QString& pubId) { _publisherId = pubId; }
void setClientSetPublisherId(bool set) { _clientSetPublisherId = set; }
private:
QString _publisherId;
@@ -226,11 +227,11 @@
PublishRequest(const PublishRequest&);
~PublishRequest() { _publishOperations.clear();}

- QString publisherId() const { return _publisherId; }
- void setPublisherId(QString pubId) { _publisherId = pubId; }
- void setPublishOperations(QList<PublishOperation> operations) {
_publishOperations = operations; }
- QList<PublishOperation> publishOperations() const { return
_publishOperations; }
- void addPublishOperation(PublishOperation pubOper) {
_publishOperations.append(pubOper); }
+ const QString& publisherId() const { return _publisherId; }
+ void setPublisherId(const QString& pubId) { _publisherId = pubId; }
+ void setPublishOperations(const QList<PublishOperation>& operations) {
_publishOperations = operations; }
+ const QList<PublishOperation>& publishOperations() const { return
_publishOperations; }
+ void addPublishOperation(const PublishOperation& pubOper) {
_publishOperations.append(pubOper); }
private:
QList<PublishOperation> _publishOperations;
QString _publisherId;
@@ -243,11 +244,11 @@
SearchType();
int maxDepth() const { return _maxDepth; }
int maxSize() const { return _maxSize; }
- QString resultFilter() const { return _resultFilter; }
- QString matchLinks() const { return _matchLinks; }
- QString terminalId() const { return _terminalId; }
- Id startId() const { return _startId; }
- QMap<QString, QString> filterNamespaceDefinitions() const { return
_filterNamespaceDefinitions; }
+ const QString& resultFilter() const { return _resultFilter; }
+ const QString& matchLinks() const { return _matchLinks; }
+ const QString& terminalId() const { return _terminalId; }
+ const Id& startId() const { return _startId; }
+ const QMap<QString, QString>& filterNamespaceDefinitions() const {
return _filterNamespaceDefinitions; }

bool clientSetMaxDepth() const { return _clientSetMaxDepth; }
bool clientSetMaxSize() const { return _clientSetMaxSize; }
@@ -257,11 +258,11 @@

void setMaxDepth(int maxDepth) { _maxDepth = maxDepth;
_clientSetMaxDepth = true; }
void setMaxSize(int maxSize) { _maxSize = maxSize; _clientSetMaxSize =
true; }
- void setResultFilter(QString resultFilter) { _resultFilter =
resultFilter; _clientSetResultFilter = true; }
- void setMatchLinks(QString matchLinks) { _matchLinks = matchLinks;
_clientSetMatchLinks = true; }
- void setTerminalId(QString terminalId) { _terminalId = terminalId;
_clientSetTerminalId = true; }
+ void setResultFilter(const QString& resultFilter) { _resultFilter =
resultFilter; _clientSetResultFilter = true; }
+ void setMatchLinks(const QString& matchLinks) { _matchLinks =
matchLinks; _clientSetMatchLinks = true; }
+ void setTerminalId(const QString& terminalId) { _terminalId =
terminalId; _clientSetTerminalId = true; }
void setStartId(Id id) { _startId = id; }
- void setFilterNamespaceDefinitions(QMap<QString,QString> nsDefs)
{_filterNamespaceDefinitions = nsDefs; }
+ void setFilterNamespaceDefinitions(const QMap<QString,QString>&
nsDefs) {_filterNamespaceDefinitions = nsDefs; }
protected:
int _maxDepth;
bool _clientSetMaxDepth;
@@ -287,14 +288,14 @@

SubscribeOperation();

- void setName(QString name) { _name = name; }
- QString name() const { return _name; }
+ void setName(const QString& name) { _name = name; }
+ const QString& name() const { return _name; }

SubscribeOperation::SubscribeType subscribeType() const { return
_subscribeType; }
void setSubscribeType(SubscribeOperation::SubscribeType subType) {
_subscribeType = subType; }

- SearchType search() const { return _search; }
- void setSearch(SearchType search) { _search = search; }
+ const SearchType& search() const { return _search; }
+ void setSearch(const SearchType& search) { _search = search; }
private:
QString _name;
SubscribeOperation::SubscribeType _subscribeType;
@@ -308,8 +309,8 @@
SearchRequest(const SearchRequest&);
~SearchRequest() {;}

- SearchType search() const { return _search; }
- void setSearch(SearchType search) { _search = search; }
+ const SearchType& search() const { return _search; }
+ void setSearch(const SearchType& search) { _search = search; }
private:
SearchType _search;
};
@@ -323,7 +324,7 @@
~SubscribeRequest() { _subscribeOperations.clear();}

QList<SubscribeOperation> subscribeOperations() const { return
_subscribeOperations; }
- void addSubscribeOperation(SubscribeOperation subOper) {
_subscribeOperations.append(subOper); }
+ void addSubscribeOperation(const SubscribeOperation& subOper) {
_subscribeOperations.append(subOper); }
private:
QList<SubscribeOperation> _subscribeOperations;
};
=======================================
--- /branches/lfu/mapresponse.cpp Tue Sep 27 20:40:47 2011
+++ /branches/lfu/mapresponse.cpp Fri May 24 23:06:39 2013
@@ -77,7 +77,7 @@
_xmlWriter.writeEndElement(); // </SOAP-ENV:Body>
}

-void MapResponse::checkAddSessionId(QString sessionId)
+void MapResponse::checkAddSessionId(const QString& sessionId)
{
if (_requestVersion == MapRequest::IFMAPv11) {
_xmlWriter.writeStartElement(_soap_envelope, "Header");
@@ -86,7 +86,7 @@
}
}

-void MapResponse::writeIdentifier(Identifier id)
+void MapResponse::writeIdentifier(const Identifier& id)
{
if (_requestVersion == MapRequest::IFMAPv11) {
_xmlWriter.writeStartElement("identifier");
@@ -192,7 +192,7 @@
}
}

-void MapResponse::setClientFault(QString faultString)
+void MapResponse::setClientFault(const QString& faultString)
{
_xmlWriter.writeStartElement(_soap_envelope, "Body");
_xmlWriter.writeStartElement(_soap_envelope, "Fault");
@@ -203,7 +203,7 @@
finishEnvelope();
}

-void MapResponse::setErrorResponse(MapRequest::RequestError requestError,
QString sessionId, QString errorString, QString name)
+void MapResponse::setErrorResponse(const MapRequest::RequestError&
requestError, const QString& sessionId, const QString& errorString, const
QString& name)
{
checkAddSessionId(sessionId);
startResponse();
@@ -220,7 +220,7 @@
finishEnvelope();
}

-void MapResponse::setNewSessionResponse(QString sessionId, QString
publisherId, bool mprsSet, unsigned int mprs)
+void MapResponse::setNewSessionResponse(const QString& sessionId, const
QString& publisherId, bool mprsSet, unsigned int mprs)
{
if (_requestVersion == MapRequest::IFMAPv11) {
_xmlWriter.writeStartElement(_soap_envelope, "Header");
@@ -249,7 +249,7 @@
finishEnvelope();
}

-void MapResponse::setRenewSessionResponse(QString sessionId)
+void MapResponse::setRenewSessionResponse(const QString& sessionId)
{
startResponse();
_xmlWriter.writeEmptyElement("renewSessionResult");
@@ -258,7 +258,7 @@
finishEnvelope();
}

-void MapResponse::setEndSessionResponse(QString sessionId)
+void MapResponse::setEndSessionResponse(const QString& sessionId)
{
startResponse();
_xmlWriter.writeEmptyElement("endSessionResult");
@@ -267,7 +267,7 @@
finishEnvelope();
}

-void MapResponse::setAttachSessionResponse(QString sessionId, QString
publisherId)
+void MapResponse::setAttachSessionResponse(const QString& sessionId, const
QString& publisherId)
{
_xmlWriter.writeStartElement(_soap_envelope, "Header");
_xmlWriter.writeTextElement(IFMAP_NS_1, "session-id", sessionId);
@@ -281,7 +281,7 @@
finishEnvelope();
}

-void MapResponse::setPublishResponse(QString sessionId)
+void MapResponse::setPublishResponse(const QString& sessionId)
{
checkAddSessionId(sessionId);
startResponse();
@@ -290,7 +290,7 @@
finishEnvelope();
}

-void MapResponse::setSubscribeResponse(QString sessionId)
+void MapResponse::setSubscribeResponse(const QString& sessionId)
{
checkAddSessionId(sessionId);
startResponse();
@@ -299,7 +299,7 @@
finishEnvelope();
}

-void MapResponse::setPurgePublisherResponse(QString sessionId)
+void MapResponse::setPurgePublisherResponse(const QString& sessionId)
{
checkAddSessionId(sessionId);
startResponse();
@@ -308,7 +308,7 @@
finishEnvelope();
}

-void MapResponse::setSearchResults(QString sessionId, QList<SearchResult
*> searchResults)
+void MapResponse::setSearchResults(const QString& sessionId, const
QList<SearchResult *>& searchResults)
{
checkAddSessionId(sessionId);
startResponse();
@@ -334,7 +334,7 @@
finishEnvelope();
}

-void MapResponse::addLinkResult(Link link, QString metaXML)
+void MapResponse::addLinkResult(const Link& link, const QString& metaXML)
{
if (_requestVersion == MapRequest::IFMAPv11) {
_xmlWriter.writeStartElement("linkResult");
@@ -357,7 +357,7 @@
}
}

-void MapResponse::addIdentifierResult(Identifier id, QString metaXML)
+void MapResponse::addIdentifierResult(const Identifier& id, const QString&
metaXML)
{
if (_requestVersion == MapRequest::IFMAPv11) {
_xmlWriter.writeStartElement("identifierResult");
@@ -376,7 +376,7 @@
}
}

-void MapResponse::addMetadataResult(QString metaXML)
+void MapResponse::addMetadataResult(const QString& metaXML)
{
// TODO: It would be cleaner to just write the <metadata> tags here
// instead of adding them in Server::filteredMetadata(), but if I do
that
@@ -410,14 +410,14 @@
//_xmlWriter.writeEndElement(); // </metadata>
}

-void MapResponse::startPollResponse(QString sessionId)
+void MapResponse::startPollResponse(const QString& sessionId)
{
checkAddSessionId(sessionId);
startResponse();
_xmlWriter.writeStartElement("pollResult");
}

-void MapResponse::addPollErrorResult(QString subName,
MapRequest::RequestError error, QString errorString)
+void MapResponse::addPollErrorResult(const QString& subName, const
MapRequest::RequestError& error, const QString& errorString)
{
_xmlWriter.writeStartElement("errorResult");
_xmlWriter.writeAttribute("errorCode",
MapRequest::requestErrorString(error));
@@ -428,7 +428,7 @@
_xmlWriter.writeEndElement(); // </errorResult>
}

-void MapResponse::addPollResults(QList<SearchResult *> results, QString
subName)
+void MapResponse::addPollResults(const QList<SearchResult *>& results,
const QString& subName)
{
QListIterator<SearchResult *> srIt(results);

@@ -494,7 +494,7 @@
finishEnvelope();
}

-void MapResponse::startSearchResult(SearchResult::ResultType resultType,
QString subName)
+void MapResponse::startSearchResult(SearchResult::ResultType resultType,
const QString& subName)
{
QString tagName = "";
switch (resultType) {
=======================================
--- /branches/lfu/mapresponse.h Tue Sep 27 20:40:47 2011
+++ /branches/lfu/mapresponse.h Fri May 24 23:06:39 2013
@@ -56,41 +56,41 @@
MapResponse(MapRequest::RequestVersion reqVersion);
~MapResponse();

- QByteArray responseData() const { return _responseBuffer.data(); }
+ const QByteArray& responseData() const { return
_responseBuffer.data(); }
MapRequest::RequestVersion requestVersion() const { return
_requestVersion; }

- void setClientFault(QString faultString);
+ void setClientFault(const QString &faultString);

- void setErrorResponse(MapRequest::RequestError requestError, QString
sessionId, QString errorString = "", QString name = "");
- void setNewSessionResponse(QString sessiondId, QString publisherId,
bool mprsSet = false, unsigned int mprs = 0);
- void setRenewSessionResponse(QString sessiondId);
- void setEndSessionResponse(QString sessiondId);
- void setAttachSessionResponse(QString sessionId, QString publisherId);
- void setPublishResponse(QString sessionId);
- void setSubscribeResponse(QString sessionId);
- void setPurgePublisherResponse(QString sessionId);
+ void setErrorResponse(const MapRequest::RequestError& requestError,
const QString& sessionId, const QString& errorString = "", const QString&
name = "");
+ void setNewSessionResponse(const QString& sessiondId, const QString&
publisherId, bool mprsSet = false, unsigned int mprs = 0);
+ void setRenewSessionResponse(const QString& sessiondId);
+ void setEndSessionResponse(const QString& sessiondId);
+ void setAttachSessionResponse(const QString& sessionId, const QString&
publisherId);
+ void setPublishResponse(const QString& sessionId);
+ void setSubscribeResponse(const QString& sessionId);
+ void setPurgePublisherResponse(const QString& sessionId);

- void setSearchResults(QString sessionId, QList<SearchResult *>
searchResults);
+ void setSearchResults(const QString& sessionId, const
QList<SearchResult *>& searchResults);

- void startPollResponse(QString sessionId);
- void addPollErrorResult(QString subName, MapRequest::RequestError
error, QString errorString = "");
- void addPollResults(QList<SearchResult *> results, QString subName);
+ void startPollResponse(const QString& sessionId);
+ void addPollErrorResult(const QString& subName, const
MapRequest::RequestError& error, const QString& errorString = "");
+ void addPollResults(const QList<SearchResult *>& results, const
QString& subName);
void endPollResponse();

private:
MapResponse(); // Don't use

- void checkAddSessionId(QString sessionId);
+ void checkAddSessionId(const QString& sessionId);
void finishEnvelope();
void startResponse();
void endResponse();
- void writeIdentifier(Identifier id);
+ void writeIdentifier(const Identifier& id);

- void addLinkResult(Link link, QString metaXML);
- void addIdentifierResult(Identifier id, QString metaXML);
- void addMetadataResult(QString metaXML);
+ void addLinkResult(const Link& link, const QString& metaXML);
+ void addIdentifierResult(const Identifier& id, const QString& metaXML);
+ void addMetadataResult(const QString& metaXML);

- void startSearchResult(SearchResult::ResultType resultType, QString
subName);
+ void startSearchResult(SearchResult::ResultType resultType, const
QString& subName);
void endSearchResult();
private:
const char *_soap_envelope;
=======================================
--- /branches/lfu/mapsessions.cpp Fri Mar 1 13:17:05 2013
+++ /branches/lfu/mapsessions.cpp Fri May 24 23:06:39 2013
@@ -71,7 +71,7 @@

void MapSessions::loadClientConfigurations()
{
- QList<ClientConfiguration *> clientConfigurations =
_omapdConfig->clientConfigurations();
+ const QList<ClientConfiguration *>& clientConfigurations =
_omapdConfig->clientConfigurations();

QListIterator<ClientConfiguration *> clientIt(clientConfigurations);
while (clientIt.hasNext()) {
@@ -80,7 +80,7 @@
}
}

-bool MapSessions::loadClientConfiguration(ClientConfiguration *client)
+bool MapSessions::loadClientConfiguration(const ClientConfiguration
*client)
{
bool clientConfigOk = false;

@@ -258,15 +258,13 @@
_activePollConnections.remove(authToken);

if (_mapClients.contains(authToken)) {
- MapClient client = _mapClients.take(authToken);
- client.setHasActiveARC(false);
- client.setHasActivePoll(false);
- _mapClients.insert(authToken, client);
+ _mapClients[authToken].setHasActiveARC(false);
+ _mapClients[authToken].setHasActivePoll(false);
}
}
}

-QString MapSessions::registerMapClient(ClientHandler *clientHandler,
MapRequest::AuthenticationType authType, QString authToken)
+QString MapSessions::registerMapClient(ClientHandler *clientHandler,
MapRequest::AuthenticationType authType, const QString& authToken)
{
QString pubId;
bool registered = false;
@@ -324,56 +322,72 @@
return pubId;
}

-bool MapSessions::haveActiveSSRCForClient(QString authToken)
+bool MapSessions::haveActiveSSRCForClient(const QString& authToken)
{
bool haveSSRC = false;

if (_mapClients.contains(authToken)) {
- haveSSRC = ! _mapClients.value(authToken).sessId().isEmpty();
+
+ // LFu: access hash element in-place
+ haveSSRC = ! _mapClients[authToken].sessId().isEmpty();
}
return haveSSRC;
}

-void MapSessions::removeActiveSSRCForClient(QString authToken)
+void MapSessions::removeActiveSSRCForClient(const QString& authToken)
{
if (_mapClients.contains(authToken) &&
- _mapClients.value(authToken).hasActiveSSRC()) {
- MapClient client = _mapClients.take(authToken);
+ _mapClients[authToken].hasActiveSSRC()) {
+ // LFu: manipulate hash element in-place
+ MapClient& client = _mapClients[authToken];
client.setHasActiveSSRC(false);
client.clearSessId();
- _mapClients.insert(authToken, client);

_ssrcConnections.remove(authToken);
}
}

-QString MapSessions::sessIdForClient(QString authToken)
+QString MapSessions::sessIdForClient(const QString& authToken)
{
QString sessId;
if (_mapClients.contains(authToken)) {
- sessId = _mapClients.value(authToken).sessId();
+ // LFu: access hash element in-place
+ sessId = _mapClients[authToken].sessId();
}
return sessId;
}

-QString MapSessions::pubIdForSessId(QString sessId)
+QString MapSessions::pubIdForSessId(const QString& sessId)
{
QString pubId;
- QList<MapClient> clientList = _mapClients.values();
- bool done = false;
- int i=0;

- while (!done && i<clientList.size()) {
- if (clientList[i].sessId().compare(sessId, Qt::CaseSensitive) ==
0) {
- done = true;
- pubId = clientList[i].pubId();
+ QHash<QString, MapClient>::const_iterator i = _mapClients.constBegin();
+ while (i != _mapClients.constEnd()) {
+
+ const MapClient& client = i.value();
+ if (client.sessId() == sessId) {
+ pubId = client.pubId();
+ break;
}
- i++;
+ ++i;
}
+
+// (LFu) was:
+// QList<MapClient> clientList = _mapClients.values();
+// bool done = false;
+// int i=0;
+
+// while (!done && i<clientList.size()) {
+// if (clientList[i].sessId().compare(sessId, Qt::CaseSensitive) ==
0) {
+// done = true;
+// pubId = clientList[i].pubId();
+// }
+// i++;
+// }
return pubId;
}

-QString MapSessions::addActiveSSRCForClient(ClientHandler *clientHandler,
QString authToken)
+QString MapSessions::addActiveSSRCForClient(ClientHandler *clientHandler,
const QString& authToken)
{
QString sessId;
if (_mapClients.contains(authToken)) {
@@ -381,63 +395,63 @@
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowClientOps))
qDebug() << __PRETTY_FUNCTION__ << ":" << "Got session-id to
use:" << sessId;

- MapClient client = _mapClients.take(authToken);
+ // LFu: code changed to modify MapClient in-place
+ MapClient& client = _mapClients[authToken];
client.setSessId(sessId);
client.setHasActiveSSRC(true);
- _mapClients.insert(authToken, client);

_ssrcConnections.insert(authToken, clientHandler);
}
return sessId;
}

-bool MapSessions::validateSessionId(QString sessId, QString authToken)
+bool MapSessions::validateSessionId(const QString& sessId, const QString&
authToken)
{
bool rc = false;
if (_mapClients.contains(authToken) &&
- _mapClients.value(authToken).hasActiveSSRC() &&
- _mapClients.value(authToken).sessId().compare(sessId,
Qt::CaseSensitive) == 0) {
+ _mapClients[authToken].hasActiveSSRC() &&
+ _mapClients[authToken].sessId() == sessId) {
rc = true;
}
return rc;
}

-QString MapSessions::pubIdForAuthToken(QString authToken)
+QString MapSessions::pubIdForAuthToken(const QString& authToken)
{
QString pubId;
if (_mapClients.contains(authToken)) {
- pubId = _mapClients.value(authToken).pubId();
+ pubId = _mapClients[authToken].pubId();
}
return pubId;
}

-OmapdConfig::AuthzOptions MapSessions::authzForAuthToken(QString authToken)
+OmapdConfig::AuthzOptions MapSessions::authzForAuthToken(const QString&
authToken)
{
OmapdConfig::AuthzOptions authz =
_omapdConfig->valueFor("default_authorization").value<OmapdConfig::AuthzOptions>();
if (_mapClients.contains(authToken)) {
- authz = _mapClients.value(authToken).authz();
+ authz = _mapClients[authToken].authz();
}
return authz;
}

-bool MapSessions::metadataAuthorizationForAuthToken(QString authToken,
QString metaName, QString metaNamespace)
+bool MapSessions::metadataAuthorizationForAuthToken(const QString&
authToken, const QString& metaName, const QString& metaNamespace)
{
bool clientAuthorized = false;
if (_mapClients.contains(authToken)) {
- QString policyName = _mapClients.value(authToken).metadataPolicy();
+ const QString& policyName =
_mapClients[authToken].metadataPolicy();

if (policyName.isEmpty()) {
// No policy defined for client
clientAuthorized = true;
} else {
- QList<VSM> metaAllowed =
_omapdConfig->metadataPolicies().values(policyName);
- QListIterator<VSM> i(metaAllowed);
- while (i.hasNext() && !clientAuthorized) {
- VSM metaAllowed = i.next();
- if (metaAllowed.first == metaName && metaAllowed.second ==
metaNamespace) {
- clientAuthorized = true;
- }
- }
+ QList<VSM> metaAllowed =
_omapdConfig->metadataPolicies().values(policyName);
+ QListIterator<VSM> i(metaAllowed);
+ while (i.hasNext() && !clientAuthorized) {
+ VSM metaAllowed = i.next();
+ if (metaAllowed.first == metaName && metaAllowed.second
== metaNamespace) {
+ clientAuthorized = true;
+ }
+ }
}

if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowClientOps))
{
@@ -450,139 +464,143 @@
return clientAuthorized;
}

-bool MapSessions::haveActivePollForClient(QString authToken)
+bool MapSessions::haveActivePollForClient(const QString& authToken)
{
bool rc = false;
if (_mapClients.contains(authToken)) {
- rc = _mapClients.value(authToken).hasActivePoll();
+ rc = _mapClients[authToken].hasActivePoll();
}
return rc;
}

-void MapSessions::setActivePollForClient(QString authToken, ClientHandler
*pollClientHandler)
+void MapSessions::setActivePollForClient(const QString& authToken,
ClientHandler *pollClientHandler)
{
if (_mapClients.contains(authToken)) {
- MapClient client = _mapClients.take(authToken);
+
+ MapClient& client = _mapClients[authToken];
client.setHasActivePoll(true);
- _mapClients.insert(authToken, client);

_activePollConnections.insert(authToken, pollClientHandler);
}
}

-void MapSessions::removeActivePollForClient(QString authToken)
+void MapSessions::removeActivePollForClient(const QString& authToken)
{
if (_mapClients.contains(authToken) &&
- _mapClients.value(authToken).hasActivePoll()) {
- MapClient client = _mapClients.take(authToken);
- client.setHasActivePoll(false);
- _mapClients.insert(authToken, client);
+ _mapClients[authToken].hasActivePoll()) {

+ _mapClients[authToken].setHasActivePoll(false);
_activePollConnections.remove(authToken);
}
}

-ClientHandler* MapSessions::pollConnectionForClient(QString authToken)
+ClientHandler* MapSessions::pollConnectionForClient(const QString&
authToken)
{
ClientHandler* clientHandler = 0;
if (_mapClients.contains(authToken) &&
- _mapClients.value(authToken).hasActiveARC() &&
- _mapClients.value(authToken).hasActivePoll()) {
+ _mapClients[authToken].hasActiveARC() &&
+ _mapClients[authToken].hasActivePoll()) {
clientHandler = _activePollConnections.value(authToken, 0);
}
return clientHandler;
}

-ClientHandler* MapSessions::ssrcForClient(QString authToken)
+ClientHandler* MapSessions::ssrcForClient(const QString& authToken)
{
ClientHandler* clientHandler = 0;
if (_mapClients.contains(authToken) &&
- _mapClients.value(authToken).hasActiveSSRC()) {
+ _mapClients[authToken].hasActiveSSRC()) {
clientHandler = _ssrcConnections.value(authToken, 0);
}
return clientHandler;
}

-void MapSessions::migrateSSRCForClient(QString authToken, ClientHandler
*newSSRCClientHandler)
+void MapSessions::migrateSSRCForClient(const QString& authToken,
ClientHandler *newSSRCClientHandler)
{
if (_mapClients.contains(authToken) &&
- _mapClients.value(authToken).hasActiveSSRC()) {
+ _mapClients[authToken].hasActiveSSRC()) {
ClientHandler *oldConnection = _ssrcConnections.take(authToken);
_ssrcConnections.insert(authToken, newSSRCClientHandler);
oldConnection->disconnectFromHost();
}
}

-void MapSessions::setActiveARCForClient(QString authToken, ClientHandler
*arcClientHandler)
+void MapSessions::setActiveARCForClient(const QString& authToken,
ClientHandler *arcClientHandler)
{
if (_mapClients.contains(authToken) &&
- _mapClients.value(authToken).hasActiveSSRC()) {
- MapClient client = _mapClients.take(authToken);
- client.setHasActiveARC(true);
- _mapClients.insert(authToken, client);
+ _mapClients[authToken].hasActiveSSRC()) {
+
+ _mapClients[authToken].setHasActiveARC(true);

_arcConnections.insert(authToken, arcClientHandler);
}
}

-bool MapSessions::haveActiveARCForClient(QString authToken)
+bool MapSessions::haveActiveARCForClient(const QString& authToken)
{
bool rc = false;
if (_mapClients.contains(authToken) &&
- _mapClients.value(authToken).hasActiveARC()) {
+ _mapClients[authToken].hasActiveARC()) {
rc = true;
}
return rc;
}

-void MapSessions::removeActiveARCForClient(QString authToken)
+void MapSessions::removeActiveARCForClient(const QString& authToken)
{
if (_mapClients.contains(authToken) &&
- _mapClients.value(authToken).hasActiveARC()) {
- MapClient client = _mapClients.take(authToken);
- client.setHasActiveARC(false);
- _mapClients.insert(authToken, client);
+ _mapClients[authToken].hasActiveARC()) {

+ _mapClients[authToken].setHasActiveARC(false);
_arcConnections.remove(authToken);
}
}

-ClientHandler* MapSessions::arcForClient(QString authToken)
+ClientHandler* MapSessions::arcForClient(const QString& authToken)
{
ClientHandler* clientHandler = 0;
if (_mapClients.contains(authToken) &&
- _mapClients.value(authToken).hasActiveARC()) {
+ _mapClients[authToken].hasActiveARC()) {
clientHandler = _arcConnections.value(authToken, 0);
}
- return clientHandler;}
+ return clientHandler;
+}

-QList<Subscription> MapSessions::subscriptionListForClient(QString
authToken)
+QList<Subscription>& MapSessions::subscriptionListForClient(const QString&
authToken)
{
- QList<Subscription> subList;
- if (_mapClients.contains(authToken)) {
- subList = _mapClients.value(authToken).subscriptionList();
- }
- return subList;
+ // LFu: changed this to return a reference to the client subscriptions
and
+ // changed usage of the method to make changes in-place. Before, the
caller
+ // retrieved a copy of the list, changed that list and then had to
restore
+ // the whole list back in order to make changes
+
+ return _mapClients[authToken].subscriptionList();
+
+// was:
+// QList<Subscription> subList;
+// if (_mapClients.contains(authToken)) {
+// subList = _mapClients[authToken].subscriptionList();
+// }
+// return subList;
}

-QList<Subscription> MapSessions::removeSubscriptionListForClient(QString
authToken)
+// LFu: instead of removing and re-inserting the MapClient,
+// manipulate the subscription list directly. Also, return an int instead
of a
+// copy of the whole list
+int MapSessions::removeSubscriptionListForClient(const QString& authToken)
{
- QList<Subscription> subList;
+ int result = 0;
if (_mapClients.contains(authToken)) {
- MapClient client = _mapClients.take(authToken);
- subList = client.subscriptionList();
+ MapClient& client = _mapClients[authToken];
+ result = client.subscriptionList().size();
client.emptySubscriptionList();
- _mapClients.insert(authToken, client);
}
- return subList;
+ return result;
}

-void MapSessions::setSubscriptionListForClient(QString authToken,
QList<Subscription> subList)
+void MapSessions::setSubscriptionListForClient(const QString& authToken,
const QList<Subscription>& subList)
{
if (_mapClients.contains(authToken)) {
- MapClient client = _mapClients.take(authToken);
- client.setSubscriptionList(subList);
- _mapClients.insert(authToken, client);
+ _mapClients[authToken].setSubscriptionList(subList);
}
}

@@ -600,7 +618,7 @@
return allSubLists;
}

-bool MapSessions::validateMetadata(Meta aMeta)
+bool MapSessions::validateMetadata(const Meta& aMeta)
{
bool isValid = false;

=======================================
--- /branches/lfu/mapsessions.h Fri Mar 1 13:17:05 2013
+++ /branches/lfu/mapsessions.h Fri May 24 23:06:39 2013
@@ -40,43 +40,43 @@
public:
static MapSessions* getInstance();

- QString registerMapClient(ClientHandler *socket,
MapRequest::AuthenticationType authType, QString authToken);
- QString sessIdForClient(QString authToken);
- QString addActiveSSRCForClient(ClientHandler *clientHandler, QString
authToken);
+ QString registerMapClient(ClientHandler *socket,
MapRequest::AuthenticationType authType, const QString& authToken);
+ QString sessIdForClient(const QString& authToken);
+ QString addActiveSSRCForClient(ClientHandler *clientHandler, const
QString& authToken);

- bool haveActiveSSRCForClient(QString authToken);
- void removeActiveSSRCForClient(QString authToken);
+ bool haveActiveSSRCForClient(const QString& authToken);
+ void removeActiveSSRCForClient(const QString& authToken);

- bool haveActivePollForClient(QString authToken);
- void setActivePollForClient(QString authToken, ClientHandler
*pollClientHandler);
- void removeActivePollForClient(QString authToken);
- ClientHandler* pollConnectionForClient(QString authToken);
- ClientHandler* ssrcForClient(QString authToken);
- void migrateSSRCForClient(QString authToken, ClientHandler
*newSSRCClientHandler);
+ bool haveActivePollForClient(const QString& authToken);
+ void setActivePollForClient(const QString& authToken, ClientHandler
*pollClientHandler);
+ void removeActivePollForClient(const QString& authToken);
+ ClientHandler* pollConnectionForClient(const QString& authToken);
+ ClientHandler* ssrcForClient(const QString& authToken);
+ void migrateSSRCForClient(const QString& authToken, ClientHandler
*newSSRCClientHandler);

- void setActiveARCForClient(QString authToken, ClientHandler
*arcClientHandler);
- bool haveActiveARCForClient(QString authToken);
- void removeActiveARCForClient(QString authToken);
- ClientHandler* arcForClient(QString authToken);
+ void setActiveARCForClient(const QString& authToken, ClientHandler
*arcClientHandler);
+ bool haveActiveARCForClient(const QString& authToken);
+ void removeActiveARCForClient(const QString& authToken);
+ ClientHandler* arcForClient(const QString& authToken);

void removeClientConnections(ClientHandler *clientHandler);
- bool validateSessionId(QString sessId, QString authToken);
+ bool validateSessionId(const QString& sessId, const QString&
authToken);

- QString pubIdForAuthToken(QString authToken);
- QString pubIdForSessId(QString sessId);
- OmapdConfig::AuthzOptions authzForAuthToken(QString authToken);
- bool metadataAuthorizationForAuthToken(QString authToken, QString
metaName, QString metaNamespace);
+ QString pubIdForAuthToken(const QString& authToken);
+ QString pubIdForSessId(const QString& sessId);
+ OmapdConfig::AuthzOptions authzForAuthToken(const QString& authToken);
+ bool metadataAuthorizationForAuthToken(const QString& authToken, const
QString& metaName, const QString& metaNamespace);

- QList<Subscription> subscriptionListForClient(QString authToken);
- QList<Subscription> removeSubscriptionListForClient(QString authToken);
- void setSubscriptionListForClient(QString authToken,
QList<Subscription> subList);
+ QList<Subscription>& subscriptionListForClient(const QString&
authToken);
+ int removeSubscriptionListForClient(const QString& authToken);
+ void setSubscriptionListForClient(const QString& authToken, const
QList<Subscription>& subList);
QHash<QString, QList<Subscription> > subscriptionLists(); // authToken
--> subscriptionList for authToken

- bool validateMetadata(Meta aMeta);
+ bool validateMetadata(const Meta& aMeta);

QString generateSessionId();

- bool loadClientConfiguration(ClientConfiguration *client);
+ bool loadClientConfiguration(const ClientConfiguration *client);
bool removeClientConfiguration(ClientConfiguration *client);

private:
=======================================
--- /branches/lfu/metadata.cpp Sun Oct 28 22:12:29 2012
+++ /branches/lfu/metadata.cpp Fri May 24 23:06:39 2013
@@ -26,7 +26,7 @@
{
}

-QString Meta::lifetimeString()
+QString Meta::lifetimeString() const
{
QString str("");
switch (_lifetime) {
=======================================
--- /branches/lfu/metadata.h Sun Oct 28 22:12:29 2012
+++ /branches/lfu/metadata.h Fri May 24 23:06:39 2013
@@ -47,20 +47,20 @@
Meta(Meta::Cardinality cardinality = Meta::SingleValue,
Meta::Lifetime lifetime = Meta::LifetimeSession);

- Meta::Cardinality cardinality() { return _cardinality; }
+ Meta::Cardinality cardinality() const { return _cardinality; }
Meta::Lifetime lifetime() const { return _lifetime; }
- QString lifetimeString();
+ QString lifetimeString() const;

- QString publisherId() const { return _publisherId; }
- QString elementName() const { return _elementName; }
- QString elementNS() const { return _elementNS; }
- QString metaXML() const { return _metaXML; }
+ const QString& publisherId() const { return _publisherId; }
+ const QString& elementName() const { return _elementName; }
+ const QString& elementNS() const { return _elementNS; }
+ const QString& metaXML() const { return _metaXML; }

void setLifetime(Meta::Lifetime lifetime) { _lifetime = lifetime; }
- void setPublisherId(QString pubId) { _publisherId = pubId; }
- void setElementName(QString elementName) { _elementName = elementName;
}
- void setElementNS(QString elementNS) { _elementNS = elementNS; }
- void setMetaXML(QString metaXML) {_metaXML = metaXML; }
+ void setPublisherId(const QString& pubId) { _publisherId = pubId; }
+ void setElementName(const QString& elementName) { _elementName =
elementName; }
+ void setElementNS(const QString& elementNS) { _elementNS = elementNS; }
+ void setMetaXML(const QString& metaXML) {_metaXML = metaXML; }

// Two Meta objects are equal iff their elementName and namespace
members are the same
bool operator==(const Meta &other) const;
=======================================
--- /branches/lfu/omapdconfig.cpp Sun Feb 24 14:35:44 2013
+++ /branches/lfu/omapdconfig.cpp Fri May 24 23:06:39 2013
@@ -191,7 +191,7 @@
qDebug() << fnName;
}

-void OmapdConfig::addConfigItem(QString key, QVariant value)
+void OmapdConfig::addConfigItem(const QString& key, const QVariant& value)
{
_omapdConfig.insert(key,value);
}
@@ -618,7 +618,7 @@
return !xmlReader.error();
}

-int OmapdConfig::readConfigFile(QString configFileName)
+int OmapdConfig::readConfigFile(const QString& configFileName)
{
const char *fnName = "ConfigFile::readConfigFile:";
int rc = 0;
@@ -642,8 +642,7 @@
return rc;
}

-QVariant OmapdConfig::valueFor(QString key)
+const QVariant& OmapdConfig::valueFor(const QString& key)
{
- QVariant value = _omapdConfig.value(key);
- return value;
+ return _omapdConfig[key];
}
=======================================
--- /branches/lfu/omapdconfig.h Sun Feb 24 14:35:44 2013
+++ /branches/lfu/omapdconfig.h Fri May 24 23:06:39 2013
@@ -77,16 +77,16 @@

static OmapdConfig* getInstance();

- bool isSet(QString key) { return _omapdConfig.contains(key); }
- QVariant valueFor(QString key);
+ bool isSet(const QString& key) { return _omapdConfig.contains(key); }
+ const QVariant& valueFor(const QString& key);
void showConfigValues();

- QList<ClientConfiguration *> clientConfigurations() { return
_clientConfigurations; }
- QMultiHash<QString, VSM> metadataPolicies() { return
_metadataPolicies; }
+ const QList<ClientConfiguration *>& clientConfigurations() { return
_clientConfigurations; }
+ const QMultiHash<QString, VSM>& metadataPolicies() { return
_metadataPolicies; }

- int readConfigFile(QString configFileName = "omapd.conf");
+ int readConfigFile(const QString& configFileName = "omapd.conf");

- void addConfigItem(QString key, QVariant value);
+ void addConfigItem(const QString& key, const QVariant& value);
private:
OmapdConfig(QObject * parent = 0);
~OmapdConfig();
=======================================
--- /branches/lfu/server.cpp Wed Dec 26 15:49:29 2012
+++ /branches/lfu/server.cpp Fri May 24 23:06:39 2013
@@ -118,7 +118,7 @@
client->deleteLater();
}

-void Server::addClientToTimeout(QString authToken)
+void Server::addClientToTimeout(const QString& authToken)
{
ClientHandler *client = (ClientHandler*)sender();
_clientAuthTokens.insert(client, authToken);
@@ -136,7 +136,7 @@
_clientAuthTokens.remove(client);
}

-void Server::removeTimerForClient(QString authToken)
+void Server::removeTimerForClient(const QString& authToken)
{
if (_clientTimeouts.contains(authToken)) {
QTimer *timer = _clientTimeouts.take(authToken);
@@ -157,9 +157,9 @@
qDebug() << __PRETTY_FUNCTION__ << ":" << "Time to remove
session metadata for client with authToken:" << authToken;
ClientHandler client(_mapGraph, authToken, this);
connect(&client,
-
SIGNAL(needToSendPollResponse(ClientHandler*,QByteArray,MapRequest::RequestVersion)),
+ SIGNAL(needToSendPollResponse(ClientHandler*, const
QByteArray&,MapRequest::RequestVersion)),
this,
-
SLOT(sendPollResponseToClient(ClientHandler*,QByteArray,MapRequest::RequestVersion)));
+ SLOT(sendPollResponseToClient(ClientHandler*,const
QByteArray&,MapRequest::RequestVersion)));
client.sessionMetadataTimeout();

removeTimerForClient(authToken);
@@ -169,7 +169,7 @@

}

-void Server::sendPollResponseToClient(ClientHandler *client, QByteArray
response, MapRequest::RequestVersion reqVersion)
+void Server::sendPollResponseToClient(ClientHandler *client, const
QByteArray& response, MapRequest::RequestVersion reqVersion)
{
if (client) {
if
(_omapdConfig->valueFor("debug_level").value<OmapdConfig::IfmapDebugOptions>().testFlag(OmapdConfig::ShowClientOps))
=======================================
--- /branches/lfu/server.h Tue Oct 30 13:09:45 2012
+++ /branches/lfu/server.h Fri May 24 23:06:39 2013
@@ -43,8 +43,8 @@
signals:

public slots:
- void sendPollResponseToClient(ClientHandler *client, QByteArray
response, MapRequest::RequestVersion reqVersion);
- void addClientToTimeout(QString authToken);
+ void sendPollResponseToClient(ClientHandler *client, const QByteArray&
response, MapRequest::RequestVersion reqVersion);
+ void addClientToTimeout(const QString& authToken);
void removeClientFromTimeout();
void removeClientConnectionFromTimeout(ClientHandler *client);

@@ -54,7 +54,7 @@

private:
void incomingConnection(int socketDescriptor);
- void removeTimerForClient(QString authToken);
+ void removeTimerForClient(const QString& authToken);

private:
OmapdConfig* _omapdConfig;
=======================================
--- /branches/lfu/subscription.cpp Sun Oct 28 22:13:22 2012
+++ /branches/lfu/subscription.cpp Fri May 24 23:06:39 2013
@@ -59,6 +59,48 @@
{
// TODO: Do I need to clearSearchResults() to avoid leaking memory?
}
+
+QSet<Id> Subscription::identifiers() const
+{
+ QSet<Id> resultSet;
+
+ QMapIterator<Id, int> mapIt(_ids);
+ while(mapIt.hasNext())
+ {
+ mapIt.next();
+ resultSet << mapIt.key();
+ }
+
+ return resultSet;
+}
+
+QSet<Id> Subscription::identifiersWithout(const QMap<Id, int>& others)
const
+{
+ QSet<Id> resultSet;
+ QMapIterator<Id, int> mapIt(_ids);
+ while(mapIt.hasNext())
+ {
+ mapIt.next();
+ if(!others.contains(mapIt.key()))
+ resultSet << mapIt.key();
+ }
+
+ return resultSet;
+}
+
+QSet<Id> Subscription::subtractFrom(const QMap<Id, int>& others) const
+{
+ QSet<Id> resultSet;
+ QMapIterator<Id, int> mapIt(others);
+ while(mapIt.hasNext())
+ {
+ mapIt.next();
+ if(!_ids.contains(mapIt.key()))
+ resultSet << mapIt.key();
+ }
+
+ return resultSet;
+}

void Subscription::clearSearchResults()
{
@@ -81,7 +123,7 @@
return false;
}

-QString Subscription::translateFilter(QString ifmapFilter)
+QString Subscription::translateFilter(const QString& ifmapFilter)
{
//const char *fnName = "SearchGraph::translateFilter:";

@@ -104,7 +146,7 @@
if (ifmapFilter.contains(" or ", Qt::CaseInsensitive)) {
//qDebug() << fnName << "WARNING! filter translation is woefully
incomplete!";
//qDebug() << fnName << "filter before translation:" <<
ifmapFilter;
- qtFilter = ifmapFilter.replace(" or "," | ");
+ qtFilter.replace(" or "," | ");
qtFilter.prepend("(");
qtFilter.append(")");
//qDebug() << fnName << "filter after translation:" << qtFilter;
@@ -113,7 +155,7 @@
return qtFilter;
}

-QString Subscription::intersectFilter(QString matchLinksFilter, QString
resultFilter)
+QString Subscription::intersectFilter(const QString& matchLinksFilter,
const QString& resultFilter)
{
/* This method creates an intersect filter for XPath
as the logical AND combination of the match-links
@@ -131,7 +173,7 @@
return qtFilter;
}

-QStringList Subscription::filterPrefixes(QString filter)
+QStringList Subscription::filterPrefixes(const QString& filter)
{
// TODO: Improve RegExp to not include colons inside quotes
// For example: vend:ike-policy[@gateway=1.2.3.4 and
meta:phase1/@identity=name:joe]
=======================================
--- /branches/lfu/subscription.h Sun Sep 25 13:51:15 2011
+++ /branches/lfu/subscription.h Fri May 24 23:06:39 2013
@@ -64,7 +64,16 @@
QString _name;
SearchType _search;

- QSet<Id> _idList;
+ QMap<Id, int> _ids;
+ QSet<Id> identifiers() const;
+ inline void addId(const Id& id, int depth) { if(!_ids.contains(id) ||
_ids[id] > depth) _ids[id] = depth; }
+ inline int getDepth(const Id& id) const { return (_ids.contains(id) ?
_ids[id] : -1); }
+ // calculates the set difference between this subscription's
identifiers and others
+ QSet<Id> identifiersWithout(const QMap<Id, int>& others) const;
+ // subtracts this subscription's identifiers form others
+ QSet<Id> subtractFrom(const QMap<Id, int>& others) const;
+
+ // QSet<Id> _idList;
QSet<Link> _linkList;

QList<SearchResult *> _searchResults;
@@ -77,11 +86,11 @@
// Two SearchGraphs are equal iff their names are equal
bool operator==(const Subscription &other) const;

- void clearSearchResults();
+ void clearSearchResults();

- static QString translateFilter(QString ifmapFilter);
- static QString intersectFilter(QString matchLinksFilter, QString
resultFilter);
- static QStringList filterPrefixes(QString filter);
+ static QString translateFilter(const QString& ifmapFilter);
+ static QString intersectFilter(const QString& matchLinksFilter, const
QString& resultFilter);
+ static QStringList filterPrefixes(const QString& filter);
};

#endif // SUBSCRIPTION_H
Reply all
Reply to author
Forward
0 new messages