diff --git a/livesupport/products/scheduler/doc/model/SchedulerModel.zuml b/livesupport/products/scheduler/doc/model/SchedulerModel.zuml index 509d485d4..8dad1f165 100644 Binary files a/livesupport/products/scheduler/doc/model/SchedulerModel.zuml and b/livesupport/products/scheduler/doc/model/SchedulerModel.zuml differ diff --git a/livesupport/products/scheduler/src/PlayLogEntry.cxx b/livesupport/products/scheduler/src/PlayLogEntry.cxx deleted file mode 100644 index d91d4bf7e..000000000 --- a/livesupport/products/scheduler/src/PlayLogEntry.cxx +++ /dev/null @@ -1,119 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.1 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/PlayLogEntry.cxx,v $ - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "PlayLogEntry.h" - -using namespace boost::posix_time; -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string PlayLogEntry::configElementNameStr = "playLogEntry"; - -/** - * The name of the attribute to get the id of the audio clip. - */ -static const std::string idAttrName = "id"; - -/** - * The name of the attribute to get the ID of the audio clip logged. - */ -static const std::string audioClipIdAttrName = "audioClipId"; - -/** - * The name of the attribute to get the time the audio clip was played. - */ -static const std::string timeStampAttrName = "timeStamp"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Create a play log entry object based on an XML element. - *----------------------------------------------------------------------------*/ -void -PlayLogEntry :: configure(const xmlpp::Element & element) - throw (std::invalid_argument) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - const xmlpp::Attribute * attribute; - std::stringstream idStrStream; - unsigned long int idValue; - - if (!(attribute = element.get_attribute(idAttrName))) { - std::string eMsg = "missing attribute "; - eMsg += idAttrName; - throw std::invalid_argument(eMsg); - } - idStrStream.str(attribute->get_value()); - idStrStream >> idValue; - id.reset(new UniqueId(idValue)); - - std::stringstream audioClipIdStrStream; - unsigned long int audioClipIdValue; - - if (!(attribute = element.get_attribute(audioClipIdAttrName))) { - std::string eMsg = "Missing attribute "; - eMsg += audioClipIdAttrName; - throw std::invalid_argument(eMsg); - } - audioClipIdStrStream.str(attribute->get_value()); - audioClipIdStrStream >> audioClipIdValue; - audioClipId.reset(new UniqueId(audioClipIdValue)); - - if (!(attribute = element.get_attribute(timeStampAttrName))) { - std::string eMsg = "missing attribute "; - eMsg += timeStampAttrName; - throw std::invalid_argument(eMsg); - } - timeStamp.reset(new ptime(time_from_string(attribute->get_value()))); -} diff --git a/livesupport/products/scheduler/src/PlayLogEntry.h b/livesupport/products/scheduler/src/PlayLogEntry.h index 3553a07e9..35cc2c8e7 100644 --- a/livesupport/products/scheduler/src/PlayLogEntry.h +++ b/livesupport/products/scheduler/src/PlayLogEntry.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.2 $ + Version : $Revision: 1.3 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/PlayLogEntry.h,v $ ------------------------------------------------------------------------------*/ @@ -47,7 +47,6 @@ #include "LiveSupport/Core/Ptr.h" #include "LiveSupport/Core/UniqueId.h" -#include "LiveSupport/Core/Configurable.h" namespace LiveSupport { @@ -69,7 +68,7 @@ using namespace LiveSupport::Core; * PlayLogEntries contain information about the audio clips played. * * @author $Author: fgerlits $ - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ class PlayLogEntry { diff --git a/livesupport/products/scheduler/src/PlayLogEntryTest.cxx b/livesupport/products/scheduler/src/PlayLogEntryTest.cxx deleted file mode 100644 index eb55697bd..000000000 --- a/livesupport/products/scheduler/src/PlayLogEntryTest.cxx +++ /dev/null @@ -1,124 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.1 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/PlayLogEntryTest.cxx,v $ - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include - -#include "PlayLogEntry.h" -#include "PlayLogEntryTest.h" - - -using namespace std; -using namespace boost::posix_time; -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(PlayLogEntryTest); - -/** - * The name of the configuration file for the audio clip. - */ -static const std::string configFileName = "etc/playLogEntry.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -PlayLogEntryTest :: setUp(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -PlayLogEntryTest :: tearDown(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Test to see if the singleton Hello object is accessible - *----------------------------------------------------------------------------*/ -void -PlayLogEntryTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - try { - Ptr::Ref parser( - new xmlpp::DomParser(configFileName, true)); - const xmlpp::Document * document - = parser->get_document(); - const xmlpp::Element * root - = document->get_root_node(); - Ptr::Ref playLogEntry(new PlayLogEntry()); - - playLogEntry->configure(*root); - - CPPUNIT_ASSERT(playLogEntry->getId()->getId() == 1); - CPPUNIT_ASSERT(playLogEntry->getAudioClipId()->getId() == 10001); - - Ptr::Ref - timeStamp = playLogEntry->getTimeStamp(); - ptime beethovensBirthDay(time_from_string("1770-12-16 07:00:00")); - CPPUNIT_ASSERT(*timeStamp == beethovensBirthDay); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - std::string eMsg = "error parsing configuration file: "; - eMsg += e.what(); - CPPUNIT_FAIL(eMsg); - } -} diff --git a/livesupport/products/scheduler/src/PlayLogEntryTest.h b/livesupport/products/scheduler/src/PlayLogEntryTest.h deleted file mode 100644 index a5c988e55..000000000 --- a/livesupport/products/scheduler/src/PlayLogEntryTest.h +++ /dev/null @@ -1,107 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2004 Media Development Loan Fund - - This file is part of the LiveSupport project. - http://livesupport.campware.org/ - To report bugs, send an e-mail to bugs@campware.org - - LiveSupport is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - LiveSupport is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LiveSupport; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 1.1 $ - Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/PlayLogEntryTest.h,v $ - -------------------------------------------------------------------------------*/ -#ifndef PlayLogEntryTest_h -#define PlayLogEntryTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - - -namespace LiveSupport { -namespace Scheduler { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the PlayLogEntry class. - * - * @author $Author: fgerlits $ - * @version $Revision: 1.1 $ - * @see PlayLogEntry - */ -class PlayLogEntryTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(PlayLogEntryTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST_SUITE_END(); - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // PlayLogEntryTest_h - diff --git a/livesupport/products/scheduler/src/PlayLogInterface.h b/livesupport/products/scheduler/src/PlayLogInterface.h index ad6bde600..7352191c4 100644 --- a/livesupport/products/scheduler/src/PlayLogInterface.h +++ b/livesupport/products/scheduler/src/PlayLogInterface.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.2 $ + Version : $Revision: 1.3 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PlayLogInterface.h,v $ ------------------------------------------------------------------------------*/ @@ -70,7 +70,7 @@ using namespace LiveSupport::Core; * The generic interface for the component scheduling events. * * @author $Author: fgerlits $ - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ class PlayLogInterface : virtual public Installable { @@ -82,7 +82,7 @@ class PlayLogInterface : virtual public Installable * @param timeStamp the time the clip was played (started). * @return the id of the newly created play log entry. */ - virtual Ptr::Ref + virtual Ptr::Ref addPlayLogEntry(Ptr::Ref audioClipId, Ptr::Ref timeStamp) throw (std::invalid_argument) @@ -97,7 +97,7 @@ class PlayLogInterface : virtual public Installable * non-inclusive * @return a vector of the play log entries for the time region. */ - virtual Ptr::Ref> >::Ref + virtual Ptr::Ref> >::Ref getPlayLogEntries(Ptr::Ref fromTime, Ptr::Ref toTime) throw (std::invalid_argument) diff --git a/livesupport/products/scheduler/src/PostgresqlPlayLog.cxx b/livesupport/products/scheduler/src/PostgresqlPlayLog.cxx index fc6d82523..f24a32c21 100644 --- a/livesupport/products/scheduler/src/PostgresqlPlayLog.cxx +++ b/livesupport/products/scheduler/src/PostgresqlPlayLog.cxx @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.2 $ + Version : $Revision: 1.3 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PostgresqlPlayLog.cxx,v $ ------------------------------------------------------------------------------*/ @@ -165,15 +165,15 @@ PostgresqlPlayLog :: uninstall(void) throw (std::exception) /*------------------------------------------------------------------------------ * Add a new play log entry *----------------------------------------------------------------------------*/ -Ptr::Ref +Ptr::Ref PostgresqlPlayLog :: addPlayLogEntry( Ptr::Ref audioClipId, Ptr::Ref clipTimestamp) throw (std::invalid_argument) { - Ptr::Ref conn; - bool result = false; - Ptr::Ref id; + Ptr::Ref conn; + bool result = false; + Ptr::Ref id; try { conn = cm->getConnection(); @@ -209,15 +209,15 @@ PostgresqlPlayLog :: addPlayLogEntry( /*------------------------------------------------------------------------------ * Get the play log entries for a given time interval *----------------------------------------------------------------------------*/ -Ptr::Ref> >::Ref +Ptr::Ref> >::Ref PostgresqlPlayLog :: getPlayLogEntries( Ptr::Ref fromTime, Ptr::Ref toTime) throw (std::invalid_argument) { Ptr::Ref conn; - Ptr::Ref> >::Ref result( - new std::vector::Ref>()); + Ptr::Ref> >::Ref result( + new std::vector::Ref>()); try { conn = cm->getConnection(); @@ -238,7 +238,7 @@ PostgresqlPlayLog :: getPlayLogEntries( Ptr::Ref clipTimestamp = Conversion::timestampToPtime(timestamp); - Ptr::Ref entry(new PlayLogEntry(id, + Ptr::Ref entry(new PlayLogEntry(id, audioClipId, clipTimestamp)); result->push_back(entry); diff --git a/livesupport/products/scheduler/src/PostgresqlPlayLog.h b/livesupport/products/scheduler/src/PostgresqlPlayLog.h index 9adf75f48..2b2925a23 100644 --- a/livesupport/products/scheduler/src/PostgresqlPlayLog.h +++ b/livesupport/products/scheduler/src/PostgresqlPlayLog.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.2 $ + Version : $Revision: 1.3 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/PostgresqlPlayLog.h,v $ ------------------------------------------------------------------------------*/ @@ -81,7 +81,7 @@ using namespace LiveSupport::Core; * * * @author $Author: fgerlits $ - * @version $Revision: 1.2 $ + * @version $Revision: 1.3 $ */ class PostgresqlPlayLog : public Configurable, public PlayLogInterface @@ -202,7 +202,7 @@ class PostgresqlPlayLog : public Configurable, * @param timeStamp the time the clip was played (started). * @return the id of the newly created play log entry. */ - virtual Ptr::Ref + virtual Ptr::Ref addPlayLogEntry(Ptr::Ref audioClipId, Ptr::Ref timeStamp) throw (std::invalid_argument); @@ -216,7 +216,7 @@ class PostgresqlPlayLog : public Configurable, * non-inclusive * @return a vector of the play log entries for the time region. */ - virtual Ptr::Ref> >::Ref + virtual Ptr::Ref> >::Ref getPlayLogEntries(Ptr::Ref fromTime, Ptr::Ref toTime) throw (std::invalid_argument); diff --git a/livesupport/products/scheduler/src/XmlRpcTools.h b/livesupport/products/scheduler/src/XmlRpcTools.h index b8755288a..538946acb 100644 --- a/livesupport/products/scheduler/src/XmlRpcTools.h +++ b/livesupport/products/scheduler/src/XmlRpcTools.h @@ -22,7 +22,7 @@ Author : $Author: fgerlits $ - Version : $Revision: 1.7 $ + Version : $Revision: 1.8 $ Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/scheduler/src/Attic/XmlRpcTools.h,v $ ------------------------------------------------------------------------------*/ @@ -72,7 +72,7 @@ using namespace LiveSupport::Core; * in the Scheduler. * * @author $Author: fgerlits $ - * @version $Revision: 1.7 $ + * @version $Revision: 1.8 $ */ class XmlRpcTools { @@ -245,8 +245,9 @@ class XmlRpcTools /** * Convert an error code, message pair to an XmlRpcValue * - * @param playlist the Playlist to convert. - * @param xmlRpcValue the output parameter holding the result of + * @param errorCode the numerical code of the error. + * @param errorMessage a short English description of the error. + * @param xmlRpcValue the output parameter holding the result of * the conversion. */ static void @@ -319,7 +320,7 @@ class XmlRpcTools * Convert a schedule entry ID (a UniqueId) to an XmlRpcValue * * @param scheduleEntryId the UniqueId to convert. - * @param xmlRpcValue the output parameter holding the result of + * @param returnValue the output parameter holding the result of * the conversion. */ static void