summaryrefslogtreecommitdiff
path: root/p2pvr/daemon/si.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'p2pvr/daemon/si.cpp')
-rw-r--r--p2pvr/daemon/si.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/p2pvr/daemon/si.cpp b/p2pvr/daemon/si.cpp
index 9164a62..d511c47 100644
--- a/p2pvr/daemon/si.cpp
+++ b/p2pvr/daemon/si.cpp
@@ -1,7 +1,8 @@
#include <pch.hpp>
#include "si.h"
#include "resources.h"
-#include "sqlSelectDeserializer.h"
+#include <slicer/db/sqlSelectDeserializer.h>
+#include <slicer/db/exceptions.h>
#include "commonHelpers.h"
#include <slicer/slicer.h>
#include <logger.h>
@@ -25,7 +26,7 @@ DVBSI::Networks
SI::GetNetworks(const Ice::Current &)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, DVBSI::Networks>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DVBSI::Networks>(
*Select(SI_allNetworks).second);
}
@@ -33,7 +34,7 @@ P2PVR::Deliveries
SI::GetAllDeliveries(const Ice::Current &)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- auto rtn = Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Deliveries>(
+ auto rtn = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Deliveries>(
*Select(SI_allDeliveries).second, "delivery_type");
Logger()->messagebf(LOG_DEBUG, "%s: Found %d delivery methods", __PRETTY_FUNCTION__, rtn.size());
return rtn;
@@ -44,10 +45,10 @@ SI::GetDeliveryForTransport(int id, const Ice::Current&)
{
try {
Logger()->messagef(LOG_DEBUG, "%s(%d)", __PRETTY_FUNCTION__, id);
- return Slicer::DeserializeAny<SqlSelectDeserializer, DVBSI::DeliveryPtr>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DVBSI::DeliveryPtr>(
*Select(SI_deliveryForTransport, id).second, "delivery_type");
}
- catch (const NoRowsReturned &) {
+ catch (const Slicer::NoRowsReturned &) {
throw P2PVR::NotFound();
}
}
@@ -57,10 +58,10 @@ SI::GetDeliveryForSi(const Ice::Current&)
{
try {
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, DVBSI::DeliveryPtr>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DVBSI::DeliveryPtr>(
*Select(SI_serviceNextUsed).second, "delivery_type");
}
- catch (const NoRowsReturned &) {
+ catch (const Slicer::NoRowsReturned &) {
return NULL;
}
}
@@ -70,10 +71,10 @@ SI::GetDeliveryForService(int id, const Ice::Current&)
{
try {
Logger()->messagef(LOG_DEBUG, "%s(%d)", __PRETTY_FUNCTION__, id);
- return Slicer::DeserializeAny<SqlSelectDeserializer, DVBSI::DeliveryPtr>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DVBSI::DeliveryPtr>(
*Select(SI_deliveryForService, id).second, "delivery_type");
}
- catch (const NoRowsReturned &) {
+ catch (const Slicer::NoRowsReturned &) {
throw P2PVR::NotFound();
}
}
@@ -82,7 +83,7 @@ DVBSI::ServiceList
SI::GetServices(const Ice::Current&)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, DVBSI::ServiceList>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DVBSI::ServiceList>(
*Select(SI_servicesSelectAll).second);
}
@@ -90,7 +91,7 @@ DVBSI::ServicePtr
SI::GetService(int id, const Ice::Current&)
{
Logger()->messagef(LOG_DEBUG, "%s(%d)", __PRETTY_FUNCTION__, id);
- auto rtn = Slicer::DeserializeAny<SqlSelectDeserializer, DVBSI::ServiceList>(
+ auto rtn = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, DVBSI::ServiceList>(
*Select(SI_servicesSelectById, id).second);
if (rtn.empty()) throw P2PVR::NotFound();
return rtn.front();
@@ -102,7 +103,7 @@ SI::GetEvents(const P2PVR::IntSequence & eventUids, const Ice::Current &)
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
P2PVR::Events rtn;
for (const auto & uid : eventUids) {
- auto list = Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ auto list = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventByUid, uid).second);
std::copy(list.begin(), list.end(), std::back_inserter(rtn));
}
@@ -114,7 +115,7 @@ P2PVR::EventPtr
SI::GetEvent(int serviceId, int eventId, const Ice::Current &)
{
Logger()->messagef(LOG_DEBUG, "%s(s=%d, e=%d)", __PRETTY_FUNCTION__, serviceId, eventId);
- auto rtn = Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ auto rtn = Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventById, serviceId, eventId).second);
if (rtn.empty()) throw P2PVR::NotFound();
return rtn.front();
@@ -124,7 +125,7 @@ P2PVR::Events
SI::EventsOnNow(const Ice::Current &)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventsOnNow).second);
}
@@ -132,7 +133,7 @@ P2PVR::Events
SI::EventsInRange(const Common::DateTime & from, const Common::DateTime & to, const Ice::Current &)
{
Logger()->messagebf(LOG_DEBUG, "%s([%s]-[%s])", from, to, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventsInRange, from, to).second);
}
@@ -141,7 +142,7 @@ SI::EventSearch(const IceUtil::Optional<std::string> & keywords, const IceUtil::
{
Logger()->messagebf(LOG_DEBUG, "%s(keywords=%s,serviceId=%s,from=%s,to=%s)",
keywords, serviceId, from, to, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventSearch, from, to, serviceId, serviceId, keywords, keywords, keywords, keywords).second);
}
@@ -149,7 +150,7 @@ P2PVR::Events
SI::EventsInSchedules(const Ice::Current &)
{
Logger()->message(LOG_DEBUG, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventsInSchedules).second);
}
@@ -157,7 +158,7 @@ P2PVR::Events
SI::EventsInSchedule(int scheduleId, const Ice::Current &)
{
Logger()->messagebf(LOG_DEBUG, "%s(%d)", scheduleId, __PRETTY_FUNCTION__);
- return Slicer::DeserializeAny<SqlSelectDeserializer, P2PVR::Events>(
+ return Slicer::DeserializeAny<Slicer::SqlSelectDeserializer, P2PVR::Events>(
*Select(SI_eventsInSchedule, scheduleId).second);
}