diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-01-03 21:37:35 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2016-01-03 21:37:35 +0000 |
commit | be239e4ef71ebed8694b06fb9e4f958f1e45abcc (patch) | |
tree | eab6c6f956830e1bb9062a19217615bf7815424e | |
parent | Use icetray tools for SQL embedding (diff) | |
download | gentoobrowse-api-0.3.1.tar.bz2 gentoobrowse-api-0.3.1.tar.xz gentoobrowse-api-0.3.1.zip |
Switch to explicit caching base classgentoobrowse-api-0.3.1
-rw-r--r-- | gentoobrowse-api/service/portageimpl.cpp | 36 | ||||
-rw-r--r-- | gentoobrowse-api/service/portageimpl.h | 4 |
2 files changed, 20 insertions, 20 deletions
diff --git a/gentoobrowse-api/service/portageimpl.cpp b/gentoobrowse-api/service/portageimpl.cpp index 99af5f8..af446d9 100644 --- a/gentoobrowse-api/service/portageimpl.cpp +++ b/gentoobrowse-api/service/portageimpl.cpp @@ -20,110 +20,110 @@ namespace Gentoo { namespace Service { Portage::Portage(boost::shared_ptr<AdHoc::ResourcePool<DB::Connection>> d) : - IceTray::AbstractDatabaseClient(d) + IceTray::AbstractCachingDatabaseClient(d) { } Gentoo::CategoryPtr Portage::getCategory(Ice::Int id, const Ice::Current &) { - return fetch<Gentoo::CategoryPtr, sql::portage::getCategory>(id); + return fetchCache<Gentoo::CategoryPtr, sql::portage::getCategory>(30, id); } Gentoo::Categories Portage::getAllCategories(const Ice::Current &) { - return fetch<Gentoo::Categories, sql::portage::getAllCategories>(); + return fetchCache<Gentoo::Categories, sql::portage::getAllCategories>(30); } Gentoo::Categories Portage::getCategoriesInSuper(const std::string & super, const Ice::Current &) { - return fetch<Gentoo::Categories, sql::portage::getCategoriesInSuper>(super); + return fetchCache<Gentoo::Categories, sql::portage::getCategoriesInSuper>(30, super); } Gentoo::OverviewCategories Portage::getOverviewCategoriesInSuper(const std::string & super, const Ice::Current &) { - return fetch<Gentoo::OverviewCategories, sql::portage::getOverviewCategoriesInSuper>(super); + return fetchCache<Gentoo::OverviewCategories, sql::portage::getOverviewCategoriesInSuper>(30, super); } Gentoo::PackagePtr Portage::getPackage(Ice::Int id, const Ice::Current &) { - return fetch<Gentoo::PackagePtr, sql::portage::getPackage>(id); + return fetchCache<Gentoo::PackagePtr, sql::portage::getPackage>(30, id); } IceUtil::Optional<Gentoo::PackagePtr> Portage::findPackage(const std::string & cat, const std::string & pkg, const Ice::Current &) { - return fetch<IceUtil::Optional<Gentoo::PackagePtr>, sql::portage::findPackage>(cat, pkg); + return fetchCache<IceUtil::Optional<Gentoo::PackagePtr>, sql::portage::findPackage>(30, cat, pkg); } Gentoo::Packages Portage::getPackagesInCategory(Ice::Int id, const Ice::Current &) { - return fetch<Gentoo::Packages, sql::portage::getPackagesInCategory>(id); + return fetchCache<Gentoo::Packages, sql::portage::getPackagesInCategory>(30, id); } Gentoo::SearchResultPackages Portage::getPackagesSearch(const std::string & query, const Ice::Current &) { - return fetch<Gentoo::SearchResultPackages, sql::portage::getPackagesSearch>(query, query); + return fetchCache<Gentoo::SearchResultPackages, sql::portage::getPackagesSearch>(30, query, query); } Gentoo::Ebuilds Portage::getPackageVersions(Ice::Int id, const Ice::Current &) { - return fetch<Gentoo::Ebuilds, sql::portage::getPackageVersions>(id); + return fetchCache<Gentoo::Ebuilds, sql::portage::getPackageVersions>(30, id); } Gentoo::ChangeLog Portage::getPackageChangeLog(Ice::Int id, const Ice::Current &) { - return fetch<Gentoo::ChangeLog, sql::portage::getPackageChangeLog>(id); + return fetchCache<Gentoo::ChangeLog, sql::portage::getPackageChangeLog>(30, id); } Gentoo::Ebuilds Portage::getRecentAdditions(Ice::Int syncs, const Ice::Current &) { - return fetch<Gentoo::Ebuilds, sql::portage::getRecentAdditions>(syncs); + return fetchCache<Gentoo::Ebuilds, sql::portage::getRecentAdditions>(30, syncs); } Gentoo::BugPtr Portage::getBug(Ice::Int id, const Ice::Current &) { - return fetch<Gentoo::BugPtr, sql::portage::getBug>(id); + return fetchCache<Gentoo::BugPtr, sql::portage::getBug>(30, id); } Gentoo::Bugs Portage::getPackageBugs(Ice::Int packageId, const Ice::Current &) { - return fetch<Gentoo::Bugs, sql::portage::getPackageBugs>(packageId); + return fetchCache<Gentoo::Bugs, sql::portage::getPackageBugs>(30, packageId); } Gentoo::SearchResultBugs Portage::getBugsSearch(const std::string & query, const Ice::Current &) { - return fetch<Gentoo::SearchResultBugs, sql::portage::getBugsSearch>(query, query); + return fetchCache<Gentoo::SearchResultBugs, sql::portage::getBugsSearch>(30, query, query); } Gentoo::NewsItemPtr Portage::getNewsItem(const std::string & id, const Ice::Current &) { - return fetch<Gentoo::NewsItemPtr, sql::portage::getNewsItem>(id); + return fetchCache<Gentoo::NewsItemPtr, sql::portage::getNewsItem>(30, id); } Gentoo::News Portage::getNewsSearch(const std::string & query, const Ice::Current &) { - return fetch<Gentoo::News, sql::portage::getNewsSearch>(query); + return fetchCache<Gentoo::News, sql::portage::getNewsSearch>(30, query); } Gentoo::News Portage::getNewsRecent(Ice::Int items, const Ice::Current &) { - return fetch<Gentoo::News, sql::portage::getNewsRecent>(items); + return fetchCache<Gentoo::News, sql::portage::getNewsRecent>(30, items); } } } diff --git a/gentoobrowse-api/service/portageimpl.h b/gentoobrowse-api/service/portageimpl.h index 980aeb3..d47941b 100644 --- a/gentoobrowse-api/service/portageimpl.h +++ b/gentoobrowse-api/service/portageimpl.h @@ -3,11 +3,11 @@ #include <portage.h> #include <visibility.h> -#include <abstractDatabaseClient.h> +#include <abstractCachingDatabaseClient.h> namespace Gentoo { namespace Service { -class DLL_PUBLIC Portage : public Gentoo::Portage, IceTray::AbstractDatabaseClient { +class DLL_PUBLIC Portage : public Gentoo::Portage, IceTray::AbstractCachingDatabaseClient { public: Portage(boost::shared_ptr<AdHoc::ResourcePool<DB::Connection>> d); |